pax_global_header00006660000000000000000000000064145052041470014514gustar00rootroot0000000000000052 comment=a6448b99f725d457e35821b73a865b5c4d4c6a61 rollup-3.29.4/000077500000000000000000000000001450520414700131305ustar00rootroot00000000000000rollup-3.29.4/.editorconfig000066400000000000000000000003201450520414700156000ustar00rootroot00000000000000# editorconfig.org root = true [*.ts] charset = utf-8 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = tab indent_size = 2 [*.md] trim_trailing_whitespace = false rollup-3.29.4/.eslintrc.js000066400000000000000000000073461450520414700154010ustar00rootroot00000000000000module.exports = { env: { browser: true, es6: true, node: true }, extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended', 'plugin:import/recommended', 'plugin:import/typescript', 'plugin:unicorn/recommended' ], ignorePatterns: [ 'node_modules', 'dist', 'perf', 'tmp', 'coverage', '_tmp', 'cache', 'wasm', '/test/*/samples/**/*.*', '!/test/*/samples/**/_config.js', '!/test/*/samples/**/rollup.config.js', '!.vitepress' ], overrides: [ { files: ['*.js'], rules: { '@typescript-eslint/explicit-module-boundary-types': 'off', 'unicorn/no-process-exit': 'off', 'unicorn/prefer-module': 'off' } }, { files: ['./*.ts', 'cli/**/*.ts'], rules: { 'unicorn/no-process-exit': 'off' } }, { files: ['*.js', 'cli/**/*.ts'], rules: { '@typescript-eslint/no-var-requires': 'off' } }, { env: { mocha: true }, files: ['test/**/*.js'], rules: { 'sort-keys': 'off' } }, { extends: [ 'plugin:vue/vue3-essential', '@vue/eslint-config-typescript/recommended', '@vue/eslint-config-prettier' ], files: ['*.vue'] }, { files: ['docs/repl/examples/**/*.js'], rules: { 'import/namespace': 'off', 'import/no-unresolved': 'off', 'no-undef': 'off', 'unicorn/prevent-abbreviations': 'off' } }, { files: ['test/**/_config.js'], rules: { 'no-undef': 'off' } } ], parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint'], rules: { '@typescript-eslint/consistent-type-assertions': [ 'error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' } ], '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], '@typescript-eslint/consistent-type-imports': 'error', '@typescript-eslint/member-ordering': [ 'error', { default: { memberTypes: [], order: 'alphabetically' } } ], '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_', ignoreRestSiblings: true, varsIgnorePattern: '^_' } ], 'arrow-body-style': ['error', 'as-needed'], 'dot-notation': 'error', 'import/no-unresolved': [ 'error', { // 'fsevents' is only available on macOS, and not installed on linux/windows ignore: [ 'fsevents', 'help.md', 'is-reference', 'package.json', 'types', 'examples.json', 'locate-character' ] } ], 'import/order': ['error', { alphabetize: { order: 'asc' } }], 'no-constant-condition': ['error', { checkLoops: false }], 'no-prototype-builtins': 'off', 'object-shorthand': 'error', 'prefer-const': ['error', { destructuring: 'all' }], 'prefer-object-spread': 'error', 'sort-imports': [ 'error', { ignoreCase: true, ignoreDeclarationSort: true, ignoreMemberSort: false } ], 'sort-keys': ['error', 'asc', { caseSensitive: false }], 'unicorn/filename-case': 'off', 'unicorn/no-array-callback-reference': 'off', 'unicorn/no-array-reduce': 'off', 'unicorn/no-await-expression-member': 'off', 'unicorn/no-empty-file': 'off', 'unicorn/no-for-loop': 'off', 'unicorn/no-nested-ternary': 'off', 'unicorn/no-null': 'off', 'unicorn/no-this-assignment': 'off', 'unicorn/no-useless-undefined': 'off', 'unicorn/prefer-at': 'off', 'unicorn/prefer-code-point': 'off', 'unicorn/prefer-math-trunc': 'off', 'unicorn/prefer-number-properties': 'off', 'unicorn/prefer-string-replace-all': 'off', 'unicorn/prefer-top-level-await': 'off', 'unicorn/prevent-abbreviations': ['error', { replacements: { dir: false } }] } }; rollup-3.29.4/.gitattributes000066400000000000000000000000221450520414700160150ustar00rootroot00000000000000* text=auto eol=lfrollup-3.29.4/.github/000077500000000000000000000000001450520414700144705ustar00rootroot00000000000000rollup-3.29.4/.github/FUNDING.yml000066400000000000000000000000301450520414700162760ustar00rootroot00000000000000open_collective: rollup rollup-3.29.4/.github/ISSUE_TEMPLATE.md000066400000000000000000000012731450520414700172000ustar00rootroot00000000000000 rollup-3.29.4/.github/ISSUE_TEMPLATE/000077500000000000000000000000001450520414700166535ustar00rootroot00000000000000rollup-3.29.4/.github/ISSUE_TEMPLATE/SUPPORT.md000066400000000000000000000011221450520414700203450ustar00rootroot00000000000000--- name: 🆘 Support, Help, and Advice about: 👉🽠Need help or tech support? Please don't open an issue! Head to https://is.gd/rollup_chat or https://stackoverflow.com/questions/tagged/rollupjs. --- Hey there! If you need help or tech support then this is not the place to ask. Please head to the [Rollup Discord](https://is.gd/rollup_chat) instead or post a question to https://stackoverflow.com/questions/tagged/rollupjs. If you arrived here because you think Rollup's documentation is unclear, insufficient or wrong, please consider creating an issue for the documentation instead. rollup-3.29.4/.github/ISSUE_TEMPLATE/bug.yaml000066400000000000000000000046501450520414700203210ustar00rootroot00000000000000name: 🞠Bug Report description: Something went awry and you'd like to tell us about it. labels: [t¹ 🞠bug, t⸠⋅ triage] body: - type: markdown attributes: value: | âš¡ï¸ katchow! We 💛 issues. 👉🽠Need help or tech support? Please don't open an issue! Head to https://is.gd/rollup_chat or https://stackoverflow.com/questions/tagged/rollupjs 👉🽠Is this issue related to an official plugin? Please do not open an issue here, go to the plugins repository instead: https://github.com/rollup/plugins/issues â¤ï¸ Rollup? Please consider supporting our collective: 👉 https://opencollective.com/rollup/donate - type: input id: version attributes: label: Rollup Version placeholder: e.g. vX.Y.Z validations: required: true - type: input id: os_version attributes: label: Operating System (or Browser) validations: required: true - type: input id: node_version attributes: label: Node Version (if applicable) validations: required: false - type: input id: reproduction_link attributes: label: Link To Reproduction description: | Issues without minimal reproductions will be closed! Please provide a link to one by: 1. Using the REPL at https://rollupjs.org/repl/, or 2. Using the StackBlitz reproduction template at https://stackblitz.com/fork/rollup-repro (allows full use of all rollup options and plugins), or 3. Using the repl.it reproduction template at https://replit.com/@rollup/rollup-plugin-repro, or 4. Provide a minimal repository link (Read https://gist.github.com/Rich-Harris/88c5fc2ac6dc941b22e7996af05d70ff for instructions). These may take more time to triage than the other options. For some bugs it this may seem like overkill but believe us, very often what seems like a "clear issue" is actually specific to some details of your setup. Having a runnable reproduction not only "proves" your bug to us but also allows us to spend all our effort fixing the bug instead of struggling to understand your issue. validations: required: true - type: textarea id: expected_behaviour attributes: label: Expected Behaviour validations: required: true - type: textarea id: actual_behaviour attributes: label: Actual Behaviour validations: required: true rollup-3.29.4/.github/ISSUE_TEMPLATE/docs.yaml000066400000000000000000000023011450520414700204630ustar00rootroot00000000000000name: 📚 Documentation description: Are the docs lacking or missing something? Do they need some new 🔥 hotness? Tell us here. labels: [t² 📚 documentation, t⸠⋅ triage] body: - type: markdown attributes: value: | âš¡ï¸ katchow! We 💛 issues. 👉🽠Need help or tech support? Please don't open an issue! Head to https://is.gd/rollup_chat or https://stackoverflow.com/questions/tagged/rollupjs 👉🽠Is this issue related to an official plugin? Please do not open an issue here, go to the plugins repository instead: https://github.com/rollup/plugins/issues â¤ï¸ Rollup? Please consider supporting our collective: 👉 https://opencollective.com/rollup/donate - type: checkboxes id: documentation_is attributes: label: Documentation is options: - label: Missing - label: Needed - label: Confusing - label: Not sure? - type: textarea id: explanation attributes: label: Please Explain in Detail... validations: required: true - type: textarea id: proposal attributes: label: Your Proposal for Changes validations: required: true rollup-3.29.4/.github/ISSUE_TEMPLATE/feature.yaml000066400000000000000000000016331450520414700211750ustar00rootroot00000000000000name: ✨ Feature Request description: Suggest an idea for this project. labels: [t³ ✨ enhancement, t⸠⋅ triage] body: - type: markdown attributes: value: | âš¡ï¸ katchow! We 💛 issues. 👉🽠Need help or tech support? Please don't open an issue! Head to https://is.gd/rollup_chat or https://stackoverflow.com/questions/tagged/rollupjs 👉🽠Is this issue related to an official plugin? Please do not open an issue here, go to the plugins repository instead: https://github.com/rollup/plugins/issues â¤ï¸ Rollup? Please consider supporting our collective: 👉 https://opencollective.com/rollup/donate - type: textarea id: use_case attributes: label: Feature Use Case validations: required: true - type: textarea id: proposal attributes: label: Feature Proposal validations: required: true rollup-3.29.4/.github/ISSUE_TEMPLATE/modification.yaml000066400000000000000000000022171450520414700222060ustar00rootroot00000000000000name: 🔧 Modification Request description: Would you like something work differently? Have an alternative approach? This is the template for you. labels: [tâ· â‹… modification, t⸠⋅ triage] body: - type: markdown attributes: value: | âš¡ï¸ katchow! We 💛 issues. 👉🽠Need help or tech support? Please don't open an issue! Head to https://is.gd/rollup_chat or https://stackoverflow.com/questions/tagged/rollupjs 👉🽠Is this issue related to an official plugin? Please do not open an issue here, go to the plugins repository instead: https://github.com/rollup/plugins/issues â¤ï¸ Rollup? Please consider supporting our collective: 👉 https://opencollective.com/rollup/donate - type: textarea id: expected_behaviour attributes: label: Expected Behavior / Situation validations: required: true - type: textarea id: actual_behaviour attributes: label: Actual Behavior / Situation validations: required: true - type: textarea id: proposal attributes: label: Modification Proposal validations: required: true rollup-3.29.4/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000027741450520414700203030ustar00rootroot00000000000000 This PR contains: - [ ] bugfix - [ ] feature - [ ] refactor - [ ] documentation - [ ] other Are tests included? - [ ] yes (_bugfixes and features will not be merged without tests_) - [ ] no Breaking Changes? - [ ] yes (_breaking changes will not be merged unless absolutely necessary_) - [ ] no List any relevant issue numbers: ### Description rollup-3.29.4/.github/dependabot.yml000066400000000000000000000001661450520414700173230ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" rollup-3.29.4/.github/labels.json000066400000000000000000000046421450520414700166330ustar00rootroot00000000000000[ { "name": "💩 template incomplete", "color": "#4E342E" }, { "name": "💩 template removed", "color": "#4E342E" }, { "name": "c¹ â‹… discussion", "color": "#1976D2" }, { "name": "c² â‹… feedback wanted", "color": "#F9A825" }, { "name": "c³ â‹… PR welcome", "color": "#1B5E20" }, { "name": "câ´ â‹… need more info", "color": "#6A1B9A" }, { "name": "câµ â‹… question", "color": "#C2185B" }, { "name": "câ¶ â‹… request for comments", "color": "#BBDEFB" }, { "name": "p¹ â‹… browser", "color": "#B2DFDB" }, { "name": "p² â‹… linux", "color": "#B2DFDB" }, { "name": "p³ â‹… mac", "color": "#B2DFDB" }, { "name": "pâ´ â‹… windows", "color": "#B2DFDB" }, { "name": "pr¹ 🔧 chore", "color": "#D7CCC8" }, { "name": "pr² 🔧 docs", "color": "#D7CCC8" }, { "name": "pr³ 🔧 feature", "color": "#D7CCC8" }, { "name": "prⴠ🔧 fix", "color": "#D7CCC8" }, { "name": "prⵠ🔧 performance", "color": "#D7CCC8" }, { "name": "prⶠ🔧 refactor", "color": "#D7CCC8" }, { "name": "prⷠ🔧 style", "color": "#D7CCC8" }, { "name": "pr⸠🔧 test", "color": "#D7CCC8" }, { "name": "s¹ 🔥🔥🔥 critical", "color": "#E53935" }, { "name": "s² 🔥🔥 important", "color": "#FB8C00" }, { "name": "s³ 🔥 nice to have", "color": "#FDD835" }, { "name": "sⴠ💧 low", "color": "#039BE5" }, { "name": "sⵠ💧💧 inconvenient", "color": "#c0e0f7" }, { "name": "t¹ 🞠bug", "color": "#F44336" }, { "name": "t² 📚 documentation", "color": "#FDD835" }, { "name": "t³ ✨ enhancement", "color": "#03a9f4" }, { "name": "tâ´ â‹… regression", "color": "#0052cc" }, { "name": "tâµ â‹… todo", "color": "#311B92" }, { "name": "tâ¶ â‹… waiting on upstream", "color": "#0D47A1" }, { "name": "tâ· â‹… modification", "color": "#03a9f4" }, { "name": "t⸠⋅ triage", "color": "#CFD8DC" }, { "name": "v¹ â‹… major", "color": "#CDDC39" }, { "name": "v² â‹… minor", "color": "#FF9800" }, { "name": "v³ â‹… minor (experimental)", "color": "#FFC107" }, { "name": "x¹ â‹… abandoned", "color": "#CFD8DC" }, { "name": "x² â‹… could not reproduce", "color": "#CFD8DC" }, { "name": "x³ â‹… duplicate", "color": "#CFD8DC" }, { "name": "xâ´ â‹… hold", "color": "#CFD8DC" }, { "name": "xâµ â‹… in progress", "color": "#4CAF50" }, { "name": "xâ¶ â‹… invalid", "color": "#CFD8DC" }, { "name": "xâ· â‹… wontfix", "color": "#CFD8DC" }, { "name": "xâ¸ âš™ï¸ build repl artefacts", "color": "#4CAF50" } ] rollup-3.29.4/.github/workflows/000077500000000000000000000000001450520414700165255ustar00rootroot00000000000000rollup-3.29.4/.github/workflows/clean-cache.yml000066400000000000000000000016131450520414700213740ustar00rootroot00000000000000name: Clean Up Caches By Branch on: pull_request: types: - closed jobs: cleanup: runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v4 - name: Cleanup run: | gh extension install actions/gh-actions-cache REPO=${{ github.repository }} BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" echo "Fetching list of cache key" cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) ## Setting this to not fail the workflow while deleting cache keys. set +e echo "Deleting caches..." for cacheKey in $cacheKeysForPR do gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm done echo "Done" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} rollup-3.29.4/.github/workflows/repl-artefacts.yml000066400000000000000000000153051450520414700221700ustar00rootroot00000000000000name: Upload REPL artefacts on: pull_request_target: types: - synchronize - opened - reopened - labeled permissions: contents: read jobs: upload: permissions: pull-requests: write # for peter-evans/find-comment and peter-evans/create-or-update-comment if: ${{ github.event.pull_request.head.repo.full_name == 'rollup/rollup' || contains( toJson(github.event.pull_request.labels), 'xâ¸ âš™ï¸ build repl artefacts' ) }} runs-on: ubuntu-latest name: Upload steps: - name: Checkout Commit uses: actions/checkout@v4 with: ref: refs/pull/${{ github.event.number }}/merge - name: Install Toolchain uses: dtolnay/rust-toolchain@stable #TODO: remove after or before merging release-4.0 if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }} with: toolchain: nightly targets: x86_64-unknown-linux-gnu - name: Cache cargo uses: actions/cache@v3 #TODO: remove after or before merging release-4.0 if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }} with: path: | ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ .cargo-cache rust/target/ key: cargo-cache-${{ hashFiles('rust/Cargo.lock') }} restore-keys: cargo-cache - name: Setup Node uses: actions/setup-node@v3 with: node-version: 18 - name: Cache Node Modules id: cache-node-modules uses: actions/cache@v3 with: path: node_modules key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - name: Install dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci --ignore-scripts - name: Build artefacts #TODO: remove after or before merging release-4.0 if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }} run: npm exec -- concurrently -c green,blue,yellow 'npm:build:napi -- --release' 'npm run build:wasm' 'npm:build:cjs' && npm run build:copy-native && npm run build:bootstrap #TODO: remove after or before merging release-4.0 - name: Build artefacts if: ${{ github.head_ref != 'release-4.0' && github.base_ref != 'release-4.0' }} run: npm run build:cjs && npm run build:bootstrap - name: Upload "${{ github.event.number }}/rollup.browser.js" to bucket uses: zdurham/s3-upload-github-action@master with: args: --cache-control max-age=300,public env: FILE: browser/dist/rollup.browser.js AWS_REGION: ${{ secrets.AWS_REGION }} S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} S3_KEY: ${{ github.event.number }}/rollup.browser.js AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Upload "${{ github.event.number }}/rollup.browser.js.map" to bucket uses: zdurham/s3-upload-github-action@master with: args: --cache-control max-age=300,public env: FILE: browser/dist/rollup.browser.js.map AWS_REGION: ${{ secrets.AWS_REGION }} S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} S3_KEY: ${{ github.event.number }}/rollup.browser.js.map AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Upload "${{ github.event.number }}/bindings_wasm_bg.wasm" to bucket uses: zdurham/s3-upload-github-action@master #TODO: remove after or before merging release-4.0 if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }} with: args: --cache-control max-age=300,public env: FILE: browser/dist/bindings_wasm_bg.wasm AWS_REGION: ${{ secrets.AWS_REGION }} S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} S3_KEY: ${{ github.event.number }}/bindings_wasm_bg.wasm AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - name: Find Comment uses: peter-evans/find-comment@v2 id: findComment with: issue-number: ${{ github.event.number }} comment-author: 'github-actions[bot]' body-includes: 'Thank you for your contribution!' - name: Create or update comment uses: peter-evans/create-or-update-comment@v3 id: createInitialComment with: comment-id: ${{ steps.findComment.outputs.comment-id }} issue-number: ${{ github.event.number }} edit-mode: replace body: | ### Thank you for your contribution! â¤ï¸ You can try out this pull request locally by installing Rollup via ```bash npm install ${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }} ``` Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly. or load it into the REPL: https://rollupjs.org/repl/?pr=${{ github.event.number }} - name: Find Vercel preview URL uses: patrickedqvist/wait-for-vercel-preview@v1.3.1 id: waitForVercel with: token: ${{ secrets.GITHUB_TOKEN }} - name: Update comment with Vercel preview URL uses: peter-evans/create-or-update-comment@v3 if: ${{ steps.waitForVercel.outputs.url }} with: comment-id: ${{ steps.createInitialComment.outputs.comment-id }} issue-number: ${{ github.event.number }} edit-mode: replace body: | ### Thank you for your contribution! â¤ï¸ You can try out this pull request locally by installing Rollup via ```bash npm install ${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }} ``` Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly. or load it into the REPL: ${{ steps.waitForVercel.outputs.url }}/repl/?pr=${{ github.event.number }} rollup-3.29.4/.github/workflows/tests.yml000066400000000000000000000112441450520414700204140ustar00rootroot00000000000000name: Tests on: push: branches: - master pull_request: types: [synchronize, opened, reopened] merge_group: permissions: contents: read jobs: linux18: runs-on: ubuntu-latest timeout-minutes: 15 name: Node 18 + Coverage (Linux) steps: - name: Checkout Commit uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node uses: actions/setup-node@v3 with: node-version: '18' - name: Cache Node Modules id: cache-node-modules uses: actions/cache@v3 with: path: node_modules key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - name: Install dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci --ignore-scripts - name: Run tests with coverage run: npm run ci:coverage env: CI: true - uses: codecov/codecov-action@v3 with: # It appears that with the token, the comment is not created # token: ${{ secrets.CODECOV_TOKEN }} commit_parent: ${{ github.event.pull_request.head.sha }} linux16: runs-on: ubuntu-latest timeout-minutes: 15 name: Node 16 + Extra Tests (Linux) steps: - name: Checkout Commit uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v3 with: node-version: '16' - name: Cache Node Modules id: cache-node-modules uses: actions/cache@v3 with: path: node_modules key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - name: Install dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci --ignore-scripts - name: Lint run: npm run ci:lint - name: Vulnerabilities run: npm audit - name: Run all tests run: npm run ci:test env: CI: true linux: runs-on: ubuntu-latest timeout-minutes: 15 strategy: matrix: node: ['14.18.0'] name: Node ${{ matrix.node }} (Linux) steps: - name: Checkout Commit uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - name: Cache Node Modules id: cache-node-modules uses: actions/cache@v3 with: path: node_modules key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - name: Install dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm i -g npm@8 && npm ci --ignore-scripts - name: Run tests run: npm run ci:test:only env: CI: true macos: runs-on: macos-latest timeout-minutes: 15 strategy: matrix: node: ['14.18.0', '18'] name: Node ${{ matrix.node }} (macOS) steps: - name: Checkout Commit uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - name: Cache Node Modules id: cache-node-modules uses: actions/cache@v3 with: path: node_modules key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - name: Update npm if: (matrix.node == '14.18.0') && (steps.cache-node-modules.outputs.cache-hit != 'true') run: npm i -g npm@8 - name: Install dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci --ignore-scripts - name: Run tests run: npm run ci:test:only env: CI: true windows: runs-on: windows-latest timeout-minutes: 15 strategy: matrix: node: ['14.18.0', '18'] name: Node ${{ matrix.node }} (Windows) steps: - name: Checkout Commit uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - name: Cache Node Modules id: cache-node-modules uses: actions/cache@v3 with: path: node_modules key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - name: Update npm if: (matrix.node == '14.18.0') && (steps.cache-node-modules.outputs.cache-hit != 'true') run: npm i -g npm@8 - name: Install dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci --ignore-scripts - name: Run tests run: npm run ci:test:only env: CI: true rollup-3.29.4/.gitignore000066400000000000000000000004501450520414700151170ustar00rootroot00000000000000.DS_Store /node_modules .gobble* cache dist dist-build _actual _actual.js coverage .commithash .idea .eslintcache test/_tmp test/hooks/tmp test/tmp test/typescript/typings perf/ .nyc_output/ .github_token .temp docs/.vitepress/graphs *.tsbuildinfo target *.node /wasm/* !/wasm/*.d.ts /wasm-node/ rollup-3.29.4/.husky/000077500000000000000000000000001450520414700143515ustar00rootroot00000000000000rollup-3.29.4/.husky/pre-commit000077500000000000000000000000721450520414700163520ustar00rootroot00000000000000#!/bin/sh . "$(dirname "$0")/_/husky.sh" npx lint-staged rollup-3.29.4/.lintstagedrc.js000066400000000000000000000001351450520414700162260ustar00rootroot00000000000000module.exports = { '*.{ts,js}': ['eslint --fix --cache'], '*.md': ['prettier --write'], }; rollup-3.29.4/.nycrc000066400000000000000000000000661450520414700142510ustar00rootroot00000000000000{ "exclude": ["test"], "extension": [".ts", ""] } rollup-3.29.4/.prettierignore000066400000000000000000000000271450520414700161720ustar00rootroot00000000000000cli/help.md LICENSE.md rollup-3.29.4/.prettierrc.json000066400000000000000000000003741450520414700162700ustar00rootroot00000000000000{ "arrowParens": "avoid", "printWidth": 100, "singleQuote": true, "trailingComma": "none", "useTabs": true, "overrides": [ { "files": "**/*.md", "options": { "printWidth": 76, "tabWidth": 2, "proseWrap": "never" } } ] } rollup-3.29.4/.vscode/000077500000000000000000000000001450520414700144715ustar00rootroot00000000000000rollup-3.29.4/.vscode/launch.json000066400000000000000000000007101450520414700166340ustar00rootroot00000000000000{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Mocha Tests", "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", "args": [ "-u", "bdd", "--timeout", "999999", "--colors" ], "console": "integratedTerminal" } ] }rollup-3.29.4/.vscode/settings.json000066400000000000000000000004761450520414700172330ustar00rootroot00000000000000{ "typescript.format.insertSpaceBeforeFunctionParenthesis": true, "typescript.format.insertSpaceAfterConstructor": true, "typescript.format.enable": true, "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "references.preferredLocation": "peek", "vue.features.codeActions.enable": false } rollup-3.29.4/CHANGELOG.md000066400000000000000000011215331450520414700147470ustar00rootroot00000000000000 # rollup changelog ## 3.29.4 _2023-09-28_ ### Bug Fixes - Fix static analysis when an exported function uses callbacks (#5158) ### Pull Requests - [#5158](https://github.com/rollup/rollup/pull/5158): Deoptimize all parameters when losing track of a function (@lukastaegert) ## 3.29.3 _2023-09-24_ ### Bug Fixes - Fix a bug where code was wrongly tree-shaken after mutating function parameters (#5153) ### Pull Requests - [#5145](https://github.com/rollup/rollup/pull/5145): docs: improve the docs repl appearance in the light mode (@TrickyPi) - [#5148](https://github.com/rollup/rollup/pull/5148): chore(deps): update dependency @vue/eslint-config-typescript to v12 (@renovate[bot]) - [#5149](https://github.com/rollup/rollup/pull/5149): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5153](https://github.com/rollup/rollup/pull/5153): Fully deoptimize first level path when deoptimizing nested parameter paths (@lukastaegert) ## 3.29.2 _2023-09-15_ ### Bug Fixes - Export `TreeshakingPreset` type (#5131) ### Pull Requests - [#5131](https://github.com/rollup/rollup/pull/5131): fix: exports `TreeshakingPreset` (@moltar) - [#5134](https://github.com/rollup/rollup/pull/5134): docs: steps to enable symlinks on windows (@thebanjomatic) - [#5137](https://github.com/rollup/rollup/pull/5137): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) ## 3.29.1 _2023-09-10_ ### Bug Fixes - Fix time measurement of plugin hooks in watch mode (#5114) - Ensure accessing document.currentScript in import.meta.url returns correct results (#5118) ### Pull Requests - [#5114](https://github.com/rollup/rollup/pull/5114): fix(perf): avoid superfluous timer wrappings in watch mode (@ZhengLiu2825) - [#5118](https://github.com/rollup/rollup/pull/5118): fix: access document.currentScript at the top level (@TrickyPi) - [#5125](https://github.com/rollup/rollup/pull/5125): chore(deps): update actions/checkout action to v4 (@renovate[bot]) - [#5126](https://github.com/rollup/rollup/pull/5126): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5129](https://github.com/rollup/rollup/pull/5129): re-enbale repl-artefacts workflow for rollup-swc branch (@TrickyPi) ## 3.29.0 _2023-09-06_ ### Features - Add output.sourcemapFileNames option (#5105) - Add generic type parameter for `api` to Plugin type (#5112) ### Bug Fixes - Ensure mutations of CustomEvent details are tracked (#5123) ### Pull Requests - [#5105](https://github.com/rollup/rollup/pull/5105): Added option to name sourcemap files, i.e. a output.sourcemapFileName… (@atti187) - [#5108](https://github.com/rollup/rollup/pull/5108): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5109](https://github.com/rollup/rollup/pull/5109): Docs: load full path of rollup.browser.js for Rollup V4 (@TrickyPi) - [#5112](https://github.com/rollup/rollup/pull/5112): feat(types): add generic type for plugin api (@sxzz) - [#5115](https://github.com/rollup/rollup/pull/5115): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5123](https://github.com/rollup/rollup/pull/5123): Deoptimize custom event detail (@lukastaegert) ## 3.28.1 _2023-08-22_ ### Bug Fixes - Ensure external files with relative import paths outside the target are rendered correctly (#5099) ### Pull Requests - [#5093](https://github.com/rollup/rollup/pull/5093): chore(deps): update dependency eslint-config-prettier to v9 (@renovate[bot]) - [#5094](https://github.com/rollup/rollup/pull/5094): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5099](https://github.com/rollup/rollup/pull/5099): Fix resolution of relative external files outside target directory (@lukastaegert) - [#5101](https://github.com/rollup/rollup/pull/5101): chore(deps): update dependency lint-staged to v14 (@renovate[bot]) - [#5102](https://github.com/rollup/rollup/pull/5102): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) ## 3.28.0 _2023-08-09_ ### Features - Add a new property `preliminaryFileName` to generated chunks containing the file name placeholder (#5086) - Improve performance of sourcemap generation by lazily decoding mappings (#5087) ### Bug Fixes - Make the `code` property of rendered modules in the output readonly (#5091) ### Pull Requests - [#5086](https://github.com/rollup/rollup/pull/5086): feat: add `preliminaryFileName` to `OutputChunk` (@lsdsjy) - [#5087](https://github.com/rollup/rollup/pull/5087): perf(sourcemaps): add back lazy sourcemap decode and handling nullish mappings (@thebanjomatic) - [#5091](https://github.com/rollup/rollup/pull/5091): fix: the type of RenderedModule.code is readonly (@TrickyPi) ## 3.27.2 _2023-08-04_ ### Bug Fixes - Revert sourcemap performance improvement for now as it causes issues with Vite (#5075) ### Pull Requests - [#5075](https://github.com/rollup/rollup/pull/5075): Revert perf(sourcemap): lazy compute decoded mappings (@thebanjomatic) ## 3.27.1 _2023-08-03_ ### Bug Fixes - Improve performance when generating sourcemaps (#5075) ### Pull Requests - [#5075](https://github.com/rollup/rollup/pull/5075): perf(sourcemap): lazy compute decoded mappings (@thebanjomatic) ## 3.27.0 _2023-07-28_ ### Features - Mark `Object.values` and `Object.entries` as pure if their argument does not contain getters (#5072) ### Pull Requests - [#5070](https://github.com/rollup/rollup/pull/5070): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5071](https://github.com/rollup/rollup/pull/5071): docs(tutorial): change the .js extension to .mjs (@TrickyPi) - [#5072](https://github.com/rollup/rollup/pull/5072): Add known globals (@sapphi-red) - [#5078](https://github.com/rollup/rollup/pull/5078): chore(deps): update dependency @vue/eslint-config-prettier to v8 (@renovate[bot]) - [#5079](https://github.com/rollup/rollup/pull/5079): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) ## 3.26.3 _2023-07-17_ ### Bug Fixes - Do not pass external modules to `manualChunks` to avoid breaking existing configs (#5068) ### Pull Requests - [#5056](https://github.com/rollup/rollup/pull/5056): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5059](https://github.com/rollup/rollup/pull/5059): chore(config): migrate renovate config (@renovate[bot]) - [#5064](https://github.com/rollup/rollup/pull/5064): chore(deps): update dependency prettier to v3 (@renovate[bot]) - [#5065](https://github.com/rollup/rollup/pull/5065): chore(deps): update typescript-eslint monorepo to v6 (major) (@renovate[bot]) - [#5068](https://github.com/rollup/rollup/pull/5068): fix: don't pass external modules to the manualChunks function (@TrickyPi) ## 3.26.2 _2023-07-06_ ### Bug Fixes - Improve error handling when manual chunks would contain external modules (#5050) ### Pull Requests - [#5050](https://github.com/rollup/rollup/pull/5050): fix: improve error for manualChunks' modules that are resolved as an external module (@TrickyPi) ## 3.26.1 _2023-07-05_ ### Bug Fixes - Support `hasOwnProperty` as exported name in CommonJS (#5010) - Properly reference browser types in package file (#5051) ### Pull Requests - [#5010](https://github.com/rollup/rollup/pull/5010): safe hasOwnProperty call (@LongTengDao) - [#5051](https://github.com/rollup/rollup/pull/5051): @rollup/browser: fix types export map entry (@developit) ## 3.26.0 _2023-06-30_ ### Features - Add `--filterLogs` CLI flag and `ROLLUP_FILTER_LOGS` environment variable for log filtering (#5035) ### Pull Requests - [#5035](https://github.com/rollup/rollup/pull/5035): Add ability to filter logs via CLI option or environment variable (@lukastaegert) - [#5049](https://github.com/rollup/rollup/pull/5049): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) ## 3.25.3 _2023-06-26_ ### Bug Fixes - Fix error when inlining dynamic imports that contain unused reexported variables (#5047) ### Pull Requests - [#5047](https://github.com/rollup/rollup/pull/5047): Do not add tree-shaken variables to namespaces when inlining dynamic imports (@lukastaegert) ## 3.25.2 _2023-06-24_ ### Bug Fixes - Handle plugin errors where `code` is not a string (#5042) - Use current transformed source when generating code frames with positions in transform hooks (#5045) ### Pull Requests - [#5038](https://github.com/rollup/rollup/pull/5038): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5040](https://github.com/rollup/rollup/pull/5040): Fix typo in index.md (@vHeemstra) - [#5042](https://github.com/rollup/rollup/pull/5042): fix: a plugin error can contains numeric code (@TrickyPi) - [#5045](https://github.com/rollup/rollup/pull/5045): Fix `this.error` with `pos` in `transform` hook (@sapphi-red) - [#5046](https://github.com/rollup/rollup/pull/5046): chore(deps): update dependency locate-character to v3 (@renovate[bot]) ## 3.25.1 _2023-06-12_ ### Bug Fixes - Respect `__NO_SIDE_EFFECTS__` for async functions (#5031) ### Pull Requests - [#5031](https://github.com/rollup/rollup/pull/5031): fix: `__NO_SIDE_EFFECTS__` annotation for async function (@antfu) ## 3.25.0 _2023-06-11_ ### Features - Add `this.info` and `this.debug` plugin context logging functions (#5026) - Add `onLog` option to read, map and filter logs (#5026) - Add `logLevel` option to fully suppress logs by level (#5026) - Support function logs in `this.warn`, `this.info` and `this.debug` to avoid heavy computations based on log level (#5026) - Add `onLog` plugin hook to read, filter and map logs from plugins (#5026) ### Pull Requests - [#5026](https://github.com/rollup/rollup/pull/5026): Add Logging API (@lukastaegert) ## 3.24.1 _2023-06-10_ ### Bug Fixes - Fix an issue where bundles with `@rollup/plugin-commonjs` were missing internal dependencies when code-splitting (#5029) - Do not use `process.exit(0)` in watch mode to avoid issues in embedded scenarios (#5027) ### Pull Requests - [#5027](https://github.com/rollup/rollup/pull/5027): fix turborepo with rollup --watch (@plumber-dhaval) - [#5028](https://github.com/rollup/rollup/pull/5028): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5029](https://github.com/rollup/rollup/pull/5029): fix: get right sideEffectModules (@TrickyPi) ## 3.24.0 _2023-06-07_ ### Features - Add new annotation `/* #__NO_SIDE_EFFECTS__ */` to mark function declarations as side effect free (#5024) ### Pull Requests - [#5024](https://github.com/rollup/rollup/pull/5024): feat: support `#__NO_SIDE_EFFECTS__` annotation for function declaration (@antfu) ## 3.23.1 _2023-06-04_ ### Bug Fixes - Ensure the last segment of sourcemapBaseUrl is never omitted (#5022) ### Pull Requests - [#5006](https://github.com/rollup/rollup/pull/5006): Better workflow caching (@lukastaegert) - [#5012](https://github.com/rollup/rollup/pull/5012): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5022](https://github.com/rollup/rollup/pull/5022): fix: add a trailing slash automatically for sourcemapBaseUrl (@TrickyPi) - [#5023](https://github.com/rollup/rollup/pull/5023): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) ## 3.23.0 _2023-05-22_ ### Features - Support emitting "prebuilt chunks" from plugins (#4990) ### Bug Fixes - Mark Sets and Maps as pure when they receive an array literal as argument (#5005) ### Pull Requests - [#4990](https://github.com/rollup/rollup/pull/4990): feat: this.emitFile support prebuilt-chunk type (@TrickyPi) - [#5005](https://github.com/rollup/rollup/pull/5005): feat: mark Set, Map, WeakSet and WeakMap with array arguments as pure (@TrickyPi) ## 3.22.1 _2023-05-21_ ### Bug Fixes - Remove force quit again as it caused some issues (#5004) ### Pull Requests - [#5001](https://github.com/rollup/rollup/pull/5001): chore(deps): update dependency @rollup/plugin-commonjs to v25 (@renovate[bot]) - [#5002](https://github.com/rollup/rollup/pull/5002): chore(deps): update dependency eslint-plugin-unicorn to v47 (@renovate[bot]) - [#5003](https://github.com/rollup/rollup/pull/5003): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#5004](https://github.com/rollup/rollup/pull/5004): Do not force quit Rollup or close stdout (@lukastaegert) ## 3.22.0 _2023-05-17_ ### Features - Prevent empty non-facade chunks by merging them into other suitable chunks (#4989) - Avoid facade chunks in some situations involving reexports (#4989) - Improve algorithm for best merge target when using `experimentalMinChunkSize` to take tree-shaking into account (#4989) ### Bug Fixes - Take side effects of external dependencies into account when merging chunks for `experimentalMinChunkSize` (#4989) ### Pull Requests - [#4989](https://github.com/rollup/rollup/pull/4989): Prevent empty chunks and thoroughly improve experimentalMinChunkSize (@lukastaegert) ## 3.21.8 _2023-05-16_ ### Bug Fixes - Allow a namespace to properly contain itself as a named export (#4991) ### Pull Requests - [#4991](https://github.com/rollup/rollup/pull/4991): Handle self-referencing namespaces (@lukastaegert) ## 3.21.7 _2023-05-13_ ### Bug Fixes - Show correct error on uncaught exceptions in watch mode (#4987) ### Pull Requests - [#4987](https://github.com/rollup/rollup/pull/4987): Properly quit on uncaught exceptions (@lukastaegert) - [#4988](https://github.com/rollup/rollup/pull/4988): test: add options type for function tests (@TrickyPi) ## 3.21.6 _2023-05-09_ ### Bug Fixes - Ensure Rollup CLI prints everything to stdout before exiting (#4980) ### Pull Requests - [#4980](https://github.com/rollup/rollup/pull/4980): chore(deps): lock file maintenance minor/patch updates (@renovate[bot]) - [#4983](https://github.com/rollup/rollup/pull/4983): Prevent exit before stdout is drained (@lukastaegert) ## 3.21.5 _2023-05-05_ ### Bug Fixes - Keep all consecutive lines at the top of each module that start with a comment (#4975) - Ensure that declarations inside switch cases do not use the same scope as the discriminator (#4979) ### Pull Requests - [#4975](https://github.com/rollup/rollup/pull/4975): Keep leading comments on consecutive lines (@lukastaegert) - [#4979](https://github.com/rollup/rollup/pull/4979): Use correct scope in switch statements (@lukastaegert) ## 3.21.4 _2023-05-03_ ### Bug Fixes - Resolve crash when shimming a missing export in an otherwise non-included module when preserving modules (#4971) ### Pull Requests - [#4971](https://github.com/rollup/rollup/pull/4971): Handle shimming missing exports when preserving modules (@lukastaegert) - [#4972](https://github.com/rollup/rollup/pull/4972): Configure Renovate (@renovate[bot]) ## 3.21.3 _2023-05-02_ ### Bug Fixes - Run `process.exit()` when Rollup CLI finishes successfully to solve issues on some systems (#4969) ### Pull Requests - [#4954](https://github.com/rollup/rollup/pull/4954): test: enable typecheck for \_config files (@antfu) - [#4969](https://github.com/rollup/rollup/pull/4969): Automatically force close Rollup when done (@lukastaegert) ## 3.21.2 _2023-04-30_ ### Bug Fixes - Mark global functions that trigger iterators as impure for now (#4955) ### Pull Requests - [#4955](https://github.com/rollup/rollup/pull/4955): fix: mark some known globals or their functions as impure (@TrickyPi) ## 3.21.1 _2023-04-29_ ### Bug Fixes - Make sure call arguments are properly deoptimized when a function uses the `arguments` variable (#4965) ### Pull Requests - [#4957](https://github.com/rollup/rollup/pull/4957): Update dependencies (@lukastaegert) - [#4964](https://github.com/rollup/rollup/pull/4964): Fix REPL in dev (@lukastaegert) - [#4965](https://github.com/rollup/rollup/pull/4965): Ensure arguments are deoptimized when arguments variable is used (@lukastaegert) - [#4967](https://github.com/rollup/rollup/pull/4967): Log REPL output to console (@lukastaegert) ## 3.21.0 _2023-04-23_ ### Features - Support tree-shaking of named exports in dynamic imports when using destructuring and similar patterns (#4952) ### Pull Requests - [#4952](https://github.com/rollup/rollup/pull/4952): feat: tree-shake deterministic dynamic imports (@antfu) ## 3.20.7 _2023-04-21_ ### Bug Fixes - Properly track array element mutations when iterating with a for-of loop (#4949) - Handle default exporting an anonymous class that extends another class (#4950) ### Pull Requests - [#4943](https://github.com/rollup/rollup/pull/4943): Add a test for reserved keywords used as import/export specifiers (@Andarist) - [#4949](https://github.com/rollup/rollup/pull/4949): Deoptimize right side in for-of loops (@lukastaegert) - [#4950](https://github.com/rollup/rollup/pull/4950): Support default exported classes that extend other classes (@lukastaegert) ## 3.20.6 _2023-04-18_ ### Bug Fixes - Revert handling of non-JS import and export names due to regressions (#4914) ### Pull Requests - [#4914](https://github.com/rollup/rollup/pull/4914): feat: add locales in vitepress config (@iDestin) - [#4946](https://github.com/rollup/rollup/pull/4946): Revert #4939 for now (@lukastaegert) ## 3.20.5 _2023-04-18_ ### Bug Fixes - Handle import and export names that are not valid JavaScript identifiers (#4939) ### Pull Requests - [#4939](https://github.com/rollup/rollup/pull/4939): Fixed imports/exports that are illegal identifiers in the es output (@Andarist) - [#4941](https://github.com/rollup/rollup/pull/4941): Reinstate global styles (@lukastaegert) ## 3.20.4 _2023-04-17_ ### Bug Fixes - Do not remove breaks statements after switch statements with conditional breaks (#4937) ### Pull Requests - [#4937](https://github.com/rollup/rollup/pull/4937): fix: handle conditional breaks in nested switch statement cases (@TrickyPi and @lukastaegert) ## 3.20.3 _2023-04-16_ ### Bug Fixes - Reduce memory consumption for function call parameter analysis (#4938) - Fix types for `shouldTransformCachedModule` (#4932) ### Pull Requests - [#4925](https://github.com/rollup/rollup/pull/4925): chore: repl style add scoped (@btea) - [#4926](https://github.com/rollup/rollup/pull/4926): docs: Update the x_google_ignorelist url (@jecfish) - [#4932](https://github.com/rollup/rollup/pull/4932): Allow shouldTransformCachedModule to return null (@bluwy) - [#4935](https://github.com/rollup/rollup/pull/4935): Bump peter-evans/create-or-update-comment from 2 to 3 (@dependabot[bot]) - [#4936](https://github.com/rollup/rollup/pull/4936): Disable puppeteer sandbox to fix Vercel deployment (@lukastaegert) - [#4938](https://github.com/rollup/rollup/pull/4938): Improve memory usage for parameter deoptimizations (@lukastaegert) ## 3.20.2 _2023-03-24_ ### Bug Fixes - Fix a crash when using a manual chunk entry that is not already included in the module graph (#4921) - Fix a crash when reporting a warning with incorrect sourcemap information (#4922) ### Pull Requests - [#4921](https://github.com/rollup/rollup/pull/4921): Handle manual chunks where the entry is not part of the module graph (@lukastaegert) - [#4922](https://github.com/rollup/rollup/pull/4922): Do not fail if the location of a warning is outside the original source (@lukastaegert) ## 3.20.1 _2023-03-23_ ### Bug Fixes - Fix returned file name from this.getFileName when assets are deduplicated (#4919) ### Pull Requests - [#4919](https://github.com/rollup/rollup/pull/4919): Only set asset names when finalizing (@lukastaegert) ## 3.20.0 _2023-03-20_ ### Features - Allow dynamically imported files to have synthetic named exports when preserving modules (#4913) ### Bug Fixes - Use deterministic file name when emitting several files with same source (#4912) - Fix a crash when dynamically importing a file with synthetic named exports when preserving modules (#4913) ### Pull Requests - [#4912](https://github.com/rollup/rollup/pull/4912): fix: make file name deterministic in parallel emits (fix #4909) (@sun0day) - [#4913](https://github.com/rollup/rollup/pull/4913): Provide synthetic namespace for dynamic imports when perserving modules (@lukastaegert) ## 3.19.1 _2023-03-10_ ### Bug Fixes - Produce valid code when the first statement in aclass static block is tree-shaken (#4898) ### Pull Requests - [#4898](https://github.com/rollup/rollup/pull/4898): fix: set a correct node location for static blocks (@TrickyPi) - [#4900](https://github.com/rollup/rollup/pull/4900): docs: fix table at `output.sanitizeFileName` section (@0x009922) ## 3.19.0 _2023-03-09_ ### Features - Make reassignment tracking of call parameters more specific to no lose information when an object is passed to a function (#4892) ### Pull Requests - [#4890](https://github.com/rollup/rollup/pull/4890): Fix `npm run dev` (@lukastaegert) - [#4892](https://github.com/rollup/rollup/pull/4892): Only selectively deoptimize call parameters (@lukastaegert) - [#4897](https://github.com/rollup/rollup/pull/4897): Pre-render mermaid graphs on website (@lukastaegert) ## 3.18.0 _2023-03-01_ ### Features - Add `experimentalLogSideEffects` to log the first detected side effect in every module (#4871) - Ignore-list sourcemaps of files inside node_modules by default (#4877) ### Pull Requests - [#4871](https://github.com/rollup/rollup/pull/4871): Add experimental logging for side effects (@lukastaegert) - [#4877](https://github.com/rollup/rollup/pull/4877): feat: mark files in a `node_modules` as ignore-listed by default (@bmeurer) - [#4880](https://github.com/rollup/rollup/pull/4880): build: use @rollup/plugin-replace to replace chokidar fsevents (@dnalborczyk) - [#4887](https://github.com/rollup/rollup/pull/4887): Refactor (@dnalborczyk) ## 3.17.3 _2023-02-25_ ### Bug Fixes - Handle non-URL-safe characters when poly-filling import.meta.url (#4875) ### Pull Requests - [#4870](https://github.com/rollup/rollup/pull/4870): fix: style optimization in dark mode (@huodoushigemi) - [#4875](https://github.com/rollup/rollup/pull/4875): Fix transformation of `import.meta.url` in CommonJS (@fasttime) - [#4876](https://github.com/rollup/rollup/pull/4876): fix: wrong params of the transform hook (@ZzqiZQute) - [#4878](https://github.com/rollup/rollup/pull/4878): Improve test stability (@lukastaegert) ## 3.17.2 _2023-02-20_ ### Bug Fixes - Do not omit code if a file that only re-exports a used variable has `moduleSideEffects` set to `true` (#4867) - Add missing `needsCodeReference` property in TypeScript for asset tree-shaking (#4868) - Add correct side effect configuration for additional Object and Promise methods (#4323) ### Pull Requests - [#4323](https://github.com/rollup/rollup/pull/4323): feat: add known globals (@dnalborczyk) - [#4867](https://github.com/rollup/rollup/pull/4867): Include side effects of re-exporters unless they have moduleSideEffects: false (@lukastaegert) - [#4868](https://github.com/rollup/rollup/pull/4868): Add `needsCodeReference` property to `EmittedAsset` (@sapphi-red) ## 3.17.1 _2023-02-18_ ### Bug Fixes - Add TypeScript types for `loadConfigFile` (#4853) - Fix an issue that could include unused classes in the bundle if their super class was in a file with `moduleSideEffects: false` (#4866) ### Pull Requests - [#4853](https://github.com/rollup/rollup/pull/4853): feat: export loadConfigFile type (@TrickyPi) - [#4866](https://github.com/rollup/rollup/pull/4866): Do not mark variable access in files without side effects as TDZ (@lukastaegert) ## 3.17.0 _2023-02-18_ ### Features - Deprecate `experimentalDeepDynamicChunkOptimization` and always run the full chunk generation algorithm (#4862) ### Bug Fixes - Fix an issue that caused very slow builds for projects with over 1000 dynamic imports when `experimentalDeepDynamicChunkOptimization` was enabled (#4862) ### Pull Requests - [#4862](https://github.com/rollup/rollup/pull/4862): Improve chunking performance (@lukastaegert) ## 3.16.0 _2023-02-17_ ### Features - Support `output.sourcemapIgnoreList` option to mark file sources as ignored in the `x_google_ignoreList` attribute of the resulting sourcemap (#4848) - Support sourcemaps where `sourcesContent` contains `null` entries (#4846) - Allow explicitly passing `true` for the `cache` option to override Vite's default (#4859) ### Bug Fixes - Fix an issue where unrelated side effects spilled into other chunks when using the `experimentalMinChunkSize` option (#4851) ### Pull Requests - [#4846](https://github.com/rollup/rollup/pull/4846): Update magic-string and adjust types. (@bmeurer) - [#4848](https://github.com/rollup/rollup/pull/4848): Introduce `sourcemapIgnoreList` predicate. (@bmeurer) - [#4851](https://github.com/rollup/rollup/pull/4851): Fix chunk graph update when merging chunks for minChunkSize (@lukastaegert) - [#4852](https://github.com/rollup/rollup/pull/4852): docs: make api params more readable (@cunzaizhuyi) - [#4856](https://github.com/rollup/rollup/pull/4856): simplify code in includeStatements (@TrickyPi) - [#4859](https://github.com/rollup/rollup/pull/4859): Allow to pass "true" to InputOptions.cache (@danielrentz) ## 3.15.0 _2023-02-10_ ### Features - Do not consider instantiating a constructor a side effect if it adds properties to "this" and is instantiated elsewhere (#4842) ### Bug Fixes - Improve side effect detection in constructors (#4842) ### Pull Requests - [#4842](https://github.com/rollup/rollup/pull/4842): fix: add this option to context.ignore (@TrickyPi) - [#4843](https://github.com/rollup/rollup/pull/4843): fixed the logo link (@oMatheuss) - [#4844](https://github.com/rollup/rollup/pull/4844): Update index.md (@cunzaizhuyi) - [#4845](https://github.com/rollup/rollup/pull/4845): docs: fix style (@TrickyPi) ## 3.14.0 _2023-02-05_ ### Features - Add `experimentalDeepDynamicChunkOptimization` option to produce fewer chunks from dynamic imports (#4837) ### Pull Requests - [#4837](https://github.com/rollup/rollup/pull/4837): Add flag to re-enable deep dynamic chunk optimization (@lukastaegert) - [#4839](https://github.com/rollup/rollup/pull/4839): fix: correct incorrect assertions (@TrickyPi) ## 3.13.0 _2023-02-03_ ### Features - Prevent chunk cycles when using `experimentalMinChunkSize` (#4723) ### Pull Requests - [#4723](https://github.com/rollup/rollup/pull/4723): Improve minChunkSize algorithm (@lukastaegert) - [#4833](https://github.com/rollup/rollup/pull/4833): docs: Fix typo (@mturoci) - [#4835](https://github.com/rollup/rollup/pull/4835): Tables in docs (@lukastaegert) ## 3.12.1 _2023-02-01_ ### Bug Fixes - Handle self-references in class static blocks and construtors when the class is renamed (#4827) - Improve warnings when creating circular chunks taht reexport variables (#4829) ### Pull Requests - [#4827](https://github.com/rollup/rollup/pull/4827): fix: use the original class name in the class body (@TrickyPi) - [#4829](https://github.com/rollup/rollup/pull/4829): Improve and fix cross-chunk-reexport warning (@lukastaegert) - [#4830](https://github.com/rollup/rollup/pull/4830): Add Algolia doc search (@lukastaegert) - [#4831](https://github.com/rollup/rollup/pull/4831): Add warning not to add assets directly to the bundle (@lukastaegert) ## 3.12.0 _2023-01-28_ ### Features - Change generated external namespace reexport helper code for CommonJS to better work with NodeJS named export detection (#4826) ### Pull Requests - [#4825](https://github.com/rollup/rollup/pull/4825): Add and use anchors for nested options (@lukastaegert) - [#4826](https://github.com/rollup/rollup/pull/4826): Use old namespace reexport code pattern for better Node support (@lukastaegert) ## 3.11.0 _2023-01-26_ ### Features - Support opt-in tree-shaking for emitted assets based on code references (#4805) ### Bug Fixes - Adapt documentation references in Rollup to new website (#4807) ### Pull Requests - [#4805](https://github.com/rollup/rollup/pull/4805): feat: add needsCodeReference field to EmittedAsset (@TrickyPi) - [#4807](https://github.com/rollup/rollup/pull/4807): Rewrite website in Vitepress and merge it into the main repository (@lukastaegert) - [#4816](https://github.com/rollup/rollup/pull/4816): web-publisher: Update docs/faqs/index.md (@PuruVJ) - [#4819](https://github.com/rollup/rollup/pull/4819): Replace fs-extra with built-ins (@dnalborczyk) - [#4820](https://github.com/rollup/rollup/pull/4820): Introduce timeout-minutes in Github actions ci (@dnalborczyk) - [#4822](https://github.com/rollup/rollup/pull/4822): Tweak document landing page (@sapphi-red) - [#4823](https://github.com/rollup/rollup/pull/4823): Minor migration guide improvements (@sapphi-red) - [#4824](https://github.com/rollup/rollup/pull/4824): Add most options to the REPL (@lukastaegert) ## 3.10.1 _2023-01-20_ ### Bug Fixes - Fix some crashes when using optional chaining with namespaces and improve tree-shaking (#4812) - Avoid wrongly removed code when using optional chaining (#4812) ### Pull Requests - [#4809](https://github.com/rollup/rollup/pull/4809): fix: rollup bin file is in dist folder (@saibotsivad) - [#4812](https://github.com/rollup/rollup/pull/4812): Rework tree-shaking support for optional chaining (@lukastaegert) ## 3.10.0 _2023-01-12_ ### Features - Add information about the resolving plugin to resolved ids (#4789) - Improve treeshaking for optional chaining when the root is nullish (#4797) ### Bug Fixes - Remove unnecessary internal defaults for acorn options (#4786) ### Pull Requests - [#4785](https://github.com/rollup/rollup/pull/4785): Use @jridgewell/sourcemap-codec (@bluwy) - [#4786](https://github.com/rollup/rollup/pull/4786): Remove default acorn options + other fixes (@dnalborczyk) - [#4789](https://github.com/rollup/rollup/pull/4789): feat: add `resolvedBy` field to `ResolvedId` (@TrickyPi) - [#4794](https://github.com/rollup/rollup/pull/4794): fix: import can be shortened (@cunzaizhuyi) - [#4796](https://github.com/rollup/rollup/pull/4796): Update dependencies (@lukastaegert) - [#4797](https://github.com/rollup/rollup/pull/4797): feat: treeshake for optional chaining (@antfu) ## 3.9.1 _2023-01-02_ ### Bug Fixes - Sort keys in generated dynamic namespace objects (#4780) - Do not consider Array.group to be side effect free as the specs have changed (#4779) ### Pull Requests - [#4777](https://github.com/rollup/rollup/pull/4777): Import from node:fs/promises (@dnalborczyk) - [#4778](https://github.com/rollup/rollup/pull/4778): Bump deps (@dnalborczyk) - [#4779](https://github.com/rollup/rollup/pull/4779): Remove array grouping (web compat issue) (@dnalborczyk) - [#4780](https://github.com/rollup/rollup/pull/4780): Sort namespace object keys (@dnalborczyk) - [#4781](https://github.com/rollup/rollup/pull/4781): Use Set and builtin-modules package (@dnalborczyk) - [#4782](https://github.com/rollup/rollup/pull/4782): Use more restrictive types (@dnalborczyk) ## 3.9.0 _2022-12-28_ ### Features - Support ES2022 arbitrary module namespace identifiers (#4770) - Add optional `version` property to plugin type (#4771) ### Pull Requests - [#4768](https://github.com/rollup/rollup/pull/4768): Fix small typo in 999-big-list-of-options.md (@ericmutta) - [#4769](https://github.com/rollup/rollup/pull/4769): docs: add a instruction about how to run one test on your local computer (@TrickyPi) - [#4770](https://github.com/rollup/rollup/pull/4770): Add support for arbitrary module namespace identifiers (@lukastaegert) - [#4771](https://github.com/rollup/rollup/pull/4771): Add `version` property to Plugin type (@Septh) ## 3.8.1 _2022-12-23_ ### Bug Fixes - Reduce memory footprint when explicitly passing `cache: false` (#4762) - Fix a crash when preserving modules and reexporting namespaces (#4766) ### Pull Requests - [#4762](https://github.com/rollup/rollup/pull/4762): Improve AST garbage collection (@bluwy) - [#4766](https://github.com/rollup/rollup/pull/4766): Fix handling of namespace reexports when preserving modules (@lukastaegert) ## 3.8.0 _2022-12-22_ ### Features - Deduplicate ESM exports and reexports when preserving modules (#4759) ### Bug Fixes - Handle files that are emitted as a side effect of the manualChunks option (#4759) ### Pull Requests - [#4759](https://github.com/rollup/rollup/pull/4759): feat: deduplicate reexports and renderedExports to simplify output (@TrickyPi) - [#4761](https://github.com/rollup/rollup/pull/4761): Support emitting files via manualChunks in output (@lukastaegert) - [#4763](https://github.com/rollup/rollup/pull/4763): docs: update outdated info (@TrickyPi) ## 3.7.5 _2022-12-17_ ### Bug Fixes - Avoid name shadowing when default exporting a class that matches the name of another class (#4756) - Do not display the error message both in a separate line and in the stack trace in rollup CLI (#4749) - Make type of `RollupWarning.cause` compatible with `Error.cause` (#4757) - Do not swallow side effects when interacting with modules namespaces nested in another object (#4758) ### Pull Requests - [#4749](https://github.com/rollup/rollup/pull/4749): feat: simplify `stack` info in cli error (@TrickyPi) - [#4756](https://github.com/rollup/rollup/pull/4756): Avoid name conflicts for default exported classes (@lukastaegert) - [#4757](https://github.com/rollup/rollup/pull/4757): fix: RollupLog cause allow unknown (@Shinigami92) - [#4758](https://github.com/rollup/rollup/pull/4758): Correctly handle side effects when a namespace is nested in an object (@lukastaegert) ## 3.7.4 _2022-12-13_ ### Bug Fixes - Do not remove calls to `.exec` and `.test` for included stateful regular expressions (#4742) ### Pull Requests - [#4742](https://github.com/rollup/rollup/pull/4742): fix: check whether RegExp have the global or sticky flags set (@TrickyPi) ## 3.7.3 _2022-12-11_ ### Bug Fixes - Ensure `this.getFileName` no longer returns a placeholder as soon as hash placeholders have been resolved (#4747) ### Pull Requests - [#4747](https://github.com/rollup/rollup/pull/4747): provide hashed file name when using this.getFileName in generateBundle (@lukastaegert) ## 3.7.2 _2022-12-10_ ### Bug Fixes - Improve chunk generation performance when one module is dynamically imported by many other modules (#4736) ### Pull Requests - [#4736](https://github.com/rollup/rollup/pull/4736): Improve chunk assignment performance (@lukastaegert) ## 3.7.1 _2022-12-09_ ### Bug Fixes - Ad a hint to use @rollup/plugin-json when imports from a JSON file are not found (#4741) ### Pull Requests - [#4741](https://github.com/rollup/rollup/pull/4741): fix: provide json hint when importing a no export json file (@TrickyPi) ## 3.7.0 _2022-12-08_ ### Features - Do not treat `.test` and `.exec` on regular expressions as side effects (#4737) ### Pull Requests - [#4737](https://github.com/rollup/rollup/pull/4737): feat: add sutiable RegExp prototype methods (@TrickyPi) ## 3.6.0 _2022-12-05_ ### Features - extend `this.getModuleInfo` with information about exports (#4731) ### Pull Requests - [#4731](https://github.com/rollup/rollup/pull/4731): feat: add `exports` and `exportedBindings` to `Module` class (@TrickyPi) ## 3.5.1 _2022-12-01_ ### Bug Fixes - Accept functions returning a config in defineConfig (#4728) ### Pull Requests - [#4728](https://github.com/rollup/rollup/pull/4728): Overload defineConfig to accept a RollupOptionsFunction parameter (@Septh) ## 3.5.0 _2022-11-27_ ### Features - Add `treeshake.manualPureFunctions` to override static analysis for explicit function names (#4718) ### Bug Fixes - Do not throw when a plugin uses `this.load` without awaiting its result (#4725) ### Pull Requests - [#4718](https://github.com/rollup/rollup/pull/4718): Add simple way to manually declare pure functions (@lukastaegert) - [#4725](https://github.com/rollup/rollup/pull/4725): Fix isIncluded error when using rollup-plugin-typescript2 (@lukastaegert) ## 3.4.0 _2022-11-22_ ### Features - Do not keep unused `Object.freeze` calls on object literals (#4720) ### Pull Requests - [#4720](https://github.com/rollup/rollup/pull/4720): Only consider Object.freeze a side effect if the argument is used (@lukastaegert) ## 3.3.0 _2022-11-12_ ### Features - Add "experimentalMinChunkSize" option to merge smaller chunks into larger ones (#4705) - Automatically deduplicate assets again when the source is a `Buffer` (#4712) - Deduplicate `Buffer` with `string` assets (#4712) ### Bug Fixes - Support plugins with object hooks when using `perf: true` (#4707) ### Pull Requests - [#4702](https://github.com/rollup/rollup/pull/4702): docs: add additional tips for heap out of memory (@benmccann) - [#4705](https://github.com/rollup/rollup/pull/4705): Allow to define minimum chunk size limit (@lukastaegert) - [#4707](https://github.com/rollup/rollup/pull/4707): Fix perf timers for object hooks (@lukastaegert) - [#4710](https://github.com/rollup/rollup/pull/4710): Update terser docs (@nikolas) - [#4712](https://github.com/rollup/rollup/pull/4712): feat: deduplicate assets with buffer source (@patak-dev) ## 3.2.5 _2022-11-01_ ### Bug Fixes - We deconflicting classes, ensure the original class name still does not shadow variables (#4697) ### Pull Requests - [#4697](https://github.com/rollup/rollup/pull/4697): Prevent class ids from shadowing other variables (@lukastaegert) ## 3.2.4 _2022-10-31_ ### Bug Fixes - Always use forward slashes in chunk ids when preserving modules, even on Windows (#4693) - Escape problematic characters in ids when rewriting `import.meta.url` (#4693) ### Pull Requests - [#4685](https://github.com/rollup/rollup/pull/4685): update package-lock version (@jerry-lllman) - [#4689](https://github.com/rollup/rollup/pull/4689): Update 07-tools.md (@cokert) - [#4693](https://github.com/rollup/rollup/pull/4693): Use correct import.meta.url slashes on Windows (@lukastaegert) ## 3.2.3 _2022-10-18_ ### Bug Fixes - Fix an issue whre Rollup confused `new.target` with `import.meta` (#4679) - Ensure that Rollup does not make assumptions about the value of unknown namespace import members (#4684) ### Pull Requests - [#4679](https://github.com/rollup/rollup/pull/4679): Do not rewrite new.target (@lukastaegert) - [#4683](https://github.com/rollup/rollup/pull/4683): Remove typo in resolveId documentation (@ChrispyChris) - [#4684](https://github.com/rollup/rollup/pull/4684): Return correct values for unknown namespace members (@lukastaegert) ## 3.2.2 _2022-10-16_ ### Bug Fixes - Do not hang/crash on hashbang comments in input modules (#4676) ### Pull Requests - [#4675](https://github.com/rollup/rollup/pull/4675): refactor: improve & simplify types (@sxzz) - [#4676](https://github.com/rollup/rollup/pull/4676): Ignore hashhbang comments (@lukastaegert) ## 3.2.1 _2022-10-16_ ### Bug Fixes - Rewrite class declarations to preserve their .name property if necessary (#4674) ### Pull Requests - [#4674](https://github.com/rollup/rollup/pull/4674): Preserve rendered class names (@lukastaegert) ## 3.2.0 _2022-10-15_ ### Features - Support providing Promises as plugins like Vite (#4671) ### Pull Requests - [#4666](https://github.com/rollup/rollup/pull/4666): Add unicorn plugin (@lukastaegert) - [#4667](https://github.com/rollup/rollup/pull/4667): refactor: improve types (@sxzz) - [#4668](https://github.com/rollup/rollup/pull/4668): fix: nested plugin in options stage (@sxzz) - [#4669](https://github.com/rollup/rollup/pull/4669): refactor: merge duplicate imports (@c0dedance) - [#4670](https://github.com/rollup/rollup/pull/4670): docs: fix minor typo in migration documentation (@ThisIsMissEm) - [#4671](https://github.com/rollup/rollup/pull/4671): feat: support async plugins (@sxzz) ## 3.1.0 _2022-10-12_ ### Features - Support using arrays of plugins as plugins like Vite (#4657) ### Pull Requests - [#4657](https://github.com/rollup/rollup/pull/4657): feat: support nested plugin (@sxzz) ## 3.0.1 _2022-10-12_ ### Bug Fixes - Fix installation on Windows (#4662) - Avoid missing parameters that are only used in a destructuring initializer (#4663) ### Pull Requests - [#4661](https://github.com/rollup/rollup/pull/4661): Enforce type imports (@lukastaegert) - [#4662](https://github.com/rollup/rollup/pull/4662): fix: missing "node" causes run script error (@c0dedance) - [#4663](https://github.com/rollup/rollup/pull/4663): Ensure the initializer of a destructuring declaration is always included if the id is included (@lukastaegert) - [#4664](https://github.com/rollup/rollup/pull/4664): fix: remove lint:js:nofix script redundancy options (@c0dedance) ## 3.0.0 _2022-10-11_ ### Breaking Changes #### General Changes - Rollup now requires at least Node 14.18.0 to run (#4548 and #4596) - The browser build has been split into a separate package `@rollup/browser` (#4593) - The node build uses the `node:` prefix for imports of builtin modules (#4596) - Some previously deprecated features have been removed (#4552): - Some plugin context functions have been removed: - `this.emitAsset()`: use `this.emitFile()` - `this.emitChunk()`: use `this.emitFile()` - `this.getAssetFileName()`: use `this.getFileName()` - `this.getChunkFileName()`: use `this.getFileName()` - `this.isExternal()`: use `this.resolve()` - `this.resolveId()`: use `this.resolve()` - The `resolveAssetUrl` plugin hook has been removed: use `resolveFileUrl` - Rollup no longer passes `assetReferenceId` or `chunkReferenceId` parameters to `resolveFileUrl` - The `treeshake.pureExternalModules` option has been removed: use `treeshake.moduleSideEffects: 'no-external'` - You may no longer use `true` or `false` for `output.interop`. As a replacement for `true`, you can use "compat" - Emitted assets no longer have an `isAsset` flag in the bundle - Rollup will no longer fix assets added directly to the bundle by adding the `type: "asset"` field - Some features that were previously marked for deprecation now show warnings when used (#4552): - Some options have been deprecated: - `inlineDynamicImports` as part of the input options: use `output. inlineDynamicImports` - `manualChunks` as part of the input options: use `output. manualChunks ` - `maxParallelFileReads`: use `maxParallelFileOps - `output.preferConst`: use `output.generatedCode.constBindings` - `output.dynamicImportFunction`: use the `renderDynamicImport` plugin hook - `output.namespaceToStringTag`: use `output.generatedCode.symbols` - `preserveModules` as part of the input options: use `output. preserveModules ` - You should no longer access `this.moduleIds` in plugins: use `this.getModuleIds()` - You should no longer access `this.getModuleInfo(...).hasModuleSideEffects` in plugins: use `this.getModuleInfo(...).moduleSideEffects` - Configuration files are only bundled if either the `--configPlugin` or the `--bundleConfigAsCjs` options are used. The configuration is bundled to an ES module unless the `--bundleConfigAsCjs` option is used. In all other cases, configuration is now loaded using Node's native mechanisms (#4574 and #4621) - The properties attached to some errors have been changed so that there are fewer different possible properties with consistent types (#4579) - Some errors have been replaced by others (ILLEGAL_NAMESPACE_REASSIGNMENT -> ILLEGAL_REASSIGNMENT, NON_EXISTENT_EXPORT -> MISSING_EXPORT) (#4579) - Files in `rollup/dist/*` can only be required using their file extension (#4581) - The `loadConfigFile` helper now has a named export of the same name instead of a default export (#4581) - When using the API and sourcemaps, sourcemap comments are contained in the emitted files and sourcemaps are emitted as regular assets (#4605) - Watch mode no longer uses Node's EventEmitter but a custom implementation that awaits Promises returned from event handlers (#4609) - Assets may only be deduplicated with previously emitted assets if their source is a `string` (#4644) - By default, Rollup will keep external dynamic imports as `import(…)` in commonjs output unless `output.dynamicImportInCjs` is set to false (#4647) #### Changes to Rollup Options - As functions passed to `output.banner/footer/intro/outro` are now called per-chunk, they should be careful to avoid performance-heavy operations (#4543) - `entryFileNames/chunkFileNames` functions now longer have access to the rendered module information via `modules`, only to a list of included `moduleIds` (#4543) - The path of a module is no longer prepended to the corresponding chunk when preserving modules (#4565) - When preserving modules, the `[name]` placeholder (as well as the `chunkInfo.name` property when using a function) now includes the relative path of the chunk as well as optionally the file extension if the extension is not one of `.js`, `.jsx`, `.mjs`, `.cjs`, `.ts`, `.tsx`, `.mts`, or `.cts` (#4565) - The `[ext]`, `[extName]` and `[assetExtName]` placeholders are no longer supported when preserving modules (#4565) - The `perf` option no longer collects timings for the asynchronous part of plugin hooks as the readings were wildly inaccurate and very misleading, and timings are adapted to the new hashing algorithm (#4566) - Change the default value of `makeAbsoluteExternalsRelative` to "ifRelativeSource" so that absolute external imports will no longer become relative imports in the output, while relative external imports will still be renormalized (#4567) - Change the default for `output.generatedCode.reservedNamesAsProps` to no longer quote properties like `default` by default (#4568) - Change the default for `preserveEntrySignatures` to "exports-only" so that by default, empty facades for entry chunks are no longer created (#4576) - Change the default for `output.interop` to "default" to better align with NodeJS interop (#4611) - Change the default for `output.esModule` to "if-default-prop", which only adds \_\_esModule when the default export would be a property (#4611) - Change the default for `output.systemNullSetters` to `true`, which requires at least SystemJS 6.3.3 (#4649) #### Plugin API Changes - Plugins that add/change/remove imports or exports in `renderChunk` should make sure to update `ChunkInfo.imports/importedBindings/exports` accordingly (#4543) - The order of plugin hooks when generating output has changed (#4543) - Chunk information passed to `renderChunk` now contains names with hash placeholders instead of final names, which will be replaced when used in the returned code or `ChunkInfo.imports/importedBindings/exports` (#4543 and #4631) - Hooks defined in output plugins will now run after hooks defined in input plugins (used to be the other way around) (#3846) ### Features - Functions passed to `output.banner/footer/intro/outro` are now called per-chunk with some chunk information (#4543) - Plugins can access the entire chunk graph via an additional parameter in `renderChunk` (#4543) - Chunk hashes only depend on the actual content of the chunk and are otherwise stable against things like renamed/moved source files or changed module resolution order (#4543) - The length of generated file hashes can be customized both globally and per-chunk (#4543) - When preserving modules, the regular `entryFileNames` logic is used and the path is included in the `[name]` property. This finally gives full control over file names when preserving modules (#4565) - `output.entryFileNames` now also supports the `[hash]` placeholder when preserving modules (#4565) - The `perf` option will now collect (synchronous) timings for all plugin hooks, not just a small selection (#4566) - All errors thrown by Rollup have `name: RollupError` now to make clearer that those are custom error types (#4579) - Error properties that reference modules (such as id and ids) will now always contain the full ids. Only the error message will use shortened ids (#4579) - Errors that are thrown in response to other errors (e.g. parse errors thrown by acorn) will now use the standardized cause property to reference the original error (#4579) - If sourcemaps are enabled, files will contain the appropriate sourcemap comment in `generateBundle` and sourcemap files are available as regular assets (#4605) - Returning a Promise from an event handler attached to a RollupWatcher instance will make Rollup wait for the Promise to resolve (#4609) - There is a new value "compat" for output.interop that is similar to "auto" but uses duck-typing to determine if there is a default export (#4611) - There is a new value "if-default-prop" for esModule that only adds an `__esModule` marker to the bundle if there is a default export that is rendered as a property (#4611) - Rollup can statically resolve checks for `foo[Symbol.toStringTag]` to "Module" if foo is a namespace (#4611) - There is a new CLI option `--bundleConfigAsCjs` which will force the configuration to be bundled to CommonJS (#4621) - Import assertions for external imports that are present in the input files will be retained in ESM output (#4646) - Rollup will warn when a module is imported with conflicting import assertions (#4646) - Plugins can add, remove or change import assertions when resolving ids (#4646) - The `output.externalImportAssertions` option allows to turn off emission of import assertions (#4646) - Use `output.dynamicImportInCjs` to control if dynamic imports are emitted as `import(…)` or wrapped `require(…)` when generating commonjs output (#4647) ### Bug Fixes - Chunk hashes take changes in `renderChunk`, e.g. minification, into account (#4543) - Hashes of referenced assets are properly reflected in the chunk hash (#4543) - No longer warn about implicitly using default export mode to not tempt users to switch to named export mode and break Node compatibility (#4624) - Avoid performance issues when emitting thousands of assets (#4644) ### Pull Requests - [#3846](https://github.com/rollup/rollup/pull/3846): [v3.0] Run output plugins last (@aleclarson) - [#4543](https://github.com/rollup/rollup/pull/4543): [v3.0] New hashing algorithm that "fixes (nearly) everything" (@lukastaegert) - [#4548](https://github.com/rollup/rollup/pull/4548): [v3.0] Deprecate Node 12 (@lukastaegert) - [#4552](https://github.com/rollup/rollup/pull/4552): [v3.0] Remove actively deprecated features, show warnings for other deprecated features (@lukastaegert) - [#4558](https://github.com/rollup/rollup/pull/4558): [v3.0] Convert build scripts to ESM, update dependencies (@lukastaegert) - [#4565](https://github.com/rollup/rollup/pull/4565): [v3.0] Rework file name patterns when preserving modules (@lukastaegert) - [#4566](https://github.com/rollup/rollup/pull/4566): [v3.0] Restructure timings (@lukastaegert) - [#4567](https://github.com/rollup/rollup/pull/4567): [v3.0] Change default for makeAbsoluteExternalsRelative (@lukastaegert) - [#4568](https://github.com/rollup/rollup/pull/4568): [v3.0] Change default for output.generatedCode.reservedNamesAsProps (@lukastaegert) - [#4574](https://github.com/rollup/rollup/pull/4574): [v3.0] Better esm config file support (@lukastaegert) - [#4575](https://github.com/rollup/rollup/pull/4575): [v3.0] Show deprecation warning for maxParallelFileReads (@lukastaegert) - [#4576](https://github.com/rollup/rollup/pull/4576): [v3.0] Change default for preserveEntrySignatures to exports-only (@lukastaegert) - [#4579](https://github.com/rollup/rollup/pull/4579): [v3.0] Refine errors and warnings (@lukastaegert) - [#4581](https://github.com/rollup/rollup/pull/4581): [v3.0] Use named export for loadConfigFile (@lukastaegert) - [#4592](https://github.com/rollup/rollup/pull/4592): [v3.0] Port doc changes from #4572 and #4583 to 3.0 (@berniegp) - [#4593](https://github.com/rollup/rollup/pull/4593): [v3.0] Browser build (@lukastaegert) - [#4596](https://github.com/rollup/rollup/pull/4596): [v3.0] Use "node:" prefix for imports of node builtins (@lukastaegert) - [#4605](https://github.com/rollup/rollup/pull/4605): [v3.0] Better sourcemap emission (@lukastaegert) - [#4609](https://github.com/rollup/rollup/pull/4609): [v3.0] Custom awaiting watch emitter (@lukastaegert) - [#4611](https://github.com/rollup/rollup/pull/4611): [v3.0] Improve interop defaults (@lukastaegert) - [#4621](https://github.com/rollup/rollup/pull/4621): [v3.0] Always try to load config files via Node if possible (@lukastaegert) - [#4624](https://github.com/rollup/rollup/pull/4624): [v3.0] Remove warning when using implicit default export mode (@lukastaegert) - [#4631](https://github.com/rollup/rollup/pull/4631): [v3.0] Use ASCII characters for hash placeholders (@lukastaegert) - [#4644](https://github.com/rollup/rollup/pull/4644): [v3.0] Improve performance of asset emissions (@lukastaegert) - [#4646](https://github.com/rollup/rollup/pull/4646): [v3.0] Basic support for import assertions (@lukastaegert) - [#4647](https://github.com/rollup/rollup/pull/4647): [v3.0] Keep dynamic imports in CommonJS output (@lukastaegert) - [#4649](https://github.com/rollup/rollup/pull/4649): [v3.0] Change default for systemNullSetters (@lukastaegert) - [#4651](https://github.com/rollup/rollup/pull/4651): [v3.0] use compiler target ES2020 (@dnalborczyk) ## 2.79.1 _2022-09-22_ ### Bug Fixes - Avoid massive performance degradation when creating thousands of chunks (#4643) ### Pull Requests - [#4639](https://github.com/rollup/rollup/pull/4639): fix: typo docs and contributors link in CONTRIBUTING.md (@takurinton) - [#4641](https://github.com/rollup/rollup/pull/4641): Update type definition of resolveId (@ivanjonas) - [#4643](https://github.com/rollup/rollup/pull/4643): Improve performance of chunk naming collision check (@lukastaegert) ## 2.79.0 _2022-08-31_ ### Features - Add `amd.forceJsExtensionForImports` to enforce using `.js` extensions for relative AMD imports (#4607) ### Pull Requests - [#4607](https://github.com/rollup/rollup/pull/4607): add option to keep extensions for amd (@wh1tevs) ## 2.78.1 _2022-08-19_ ### Bug Fixes - Avoid inferring "arguments" as name for a default export placeholder variable (#4613) ### Pull Requests - [#4613](https://github.com/rollup/rollup/pull/4613): Prevent using arguments for generated variable names (@lukastaegert) ## 2.78.0 _2022-08-14_ ### Features - Support writing plugin hooks as objects with a "handler" property (#4600) - Allow changing execution order per plugin hook (#4600) - Add flag to execute plugins in async parallel hooks sequentially (#4600) ### Pull Requests - [#4600](https://github.com/rollup/rollup/pull/4600): Allow using objects as hooks to change execution order (@lukastaegert) ## 2.77.3 _2022-08-11_ ### Bug Fixes - Correctly resolve preserveModulesRoot in Vite (#4591) ### Pull Requests - [#4591](https://github.com/rollup/rollup/pull/4591): resolve currentPath (@cleverpp) ## 2.77.2 _2022-07-27_ ### Bug Fixes - Avoid a rendering failure when mixing outputs with inlined and non-inlined dynamic imports (#4589) ### Pull Requests - [#4589](https://github.com/rollup/rollup/pull/4589): Handle generating non-inlined imports after inlined ones (@lukastaegert) ## 2.77.1 _2022-07-26_ ### Bug Fixes - Ensure IIFE output generates a global variable when generating ES5 (#4588) ### Pull Requests - [#4577](https://github.com/rollup/rollup/pull/4577): broken link removed (@Jawad-H) - [#4580](https://github.com/rollup/rollup/pull/4580): Update dependencies (@lukastaegert) - [#4584](https://github.com/rollup/rollup/pull/4584): Documentation clarity and syntax improvements (@berniegp) - [#4588](https://github.com/rollup/rollup/pull/4588): Use var for IIFE (@lukastaegert) ## 2.77.0 _2022-07-15_ ### Features - Introduce `maxParallelFileOps` to limit both read and write operations, default to 20 and replaces `maxParallelFileRead` (#4570) ### Bug Fixes - Avoid including variables referenced from return statements that are never reached (#4573) ### Pull Requests - [#4570](https://github.com/rollup/rollup/pull/4570): Introduce maxParallelFileOps to limit parallel writes (@lukastaegert) - [#4572](https://github.com/rollup/rollup/pull/4572): Document more ways to read package.json in ESM (@berniegp) - [#4573](https://github.com/rollup/rollup/pull/4573): Do not include unused return expressions (@lukastaegert) ## 2.76.0 _2022-07-08_ ### Features - Allow setting a `sourcmapBaseUrl` for absolute paths in sourcemaps (#4527) ### Bug Fixes - Support absolute CLI plugin paths on Windows (#4533) ### Pull Requests - [#4527](https://github.com/rollup/rollup/pull/4527): Add sourcemapBaseUrl option (@nickgarlis) - [#4533](https://github.com/rollup/rollup/pull/4533): Add support for absolute plugin paths (@ygoe) - [#4538](https://github.com/rollup/rollup/pull/4538): chore: Included githubactions in the dependabot config (@naveensrinivasan) - [#4546](https://github.com/rollup/rollup/pull/4546): Adapt Node versions on CI to prepare for v3 (@lukastaegert) - [#4556](https://github.com/rollup/rollup/pull/4556): Improve error message for invalid patterns (@DysphoricUnicorn) - [#4559](https://github.com/rollup/rollup/pull/4559): Update dependencies (@lukastaegert) - [#4560](https://github.com/rollup/rollup/pull/4560): Bump peter-evans/create-or-update-comment from 1 to 2 (@dependabot) - [#4561](https://github.com/rollup/rollup/pull/4561): Bump peter-evans/find-comment from 1 to 2 (@dependabot) - [#4562](https://github.com/rollup/rollup/pull/4562): Bump codecov/codecov-action from 1 to 3 (@dependabot) ## 2.75.7 _2022-06-20_ ### Bug Fixes - Mark Array.prototype.group/groupToMap as side effect free. (#4531) ### Pull Requests - [#4523](https://github.com/rollup/rollup/pull/4523): chore: remove source map workaround, bump deps (@dnalborczyk) - [#4525](https://github.com/rollup/rollup/pull/4525): Add regression tests for instanceof (@lukastaegert) - [#4528](https://github.com/rollup/rollup/pull/4528): chore: Set permissions for GitHub actions (@naveensrinivasan) - [#4531](https://github.com/rollup/rollup/pull/4531): fix: rename Array.prototype.group/groupToMap (@dnalborczyk) - [#4535](https://github.com/rollup/rollup/pull/4535): chore: bump resolve from 1.22.0 to 1.22.1 (@pos777) ## 2.75.6 _2022-06-07_ ### Bug Fixes - Properly deoptimize "this" when using member expressions with getters/setters in for loops and update expressions (#4522) ### Pull Requests - [#4522](https://github.com/rollup/rollup/pull/4522): Refactor side effect handling for property interactions (@lukastaegert) ## 2.75.5 _2022-06-01_ ### Bug Fixes - Avoid crashes when using logical expressions for unused constructor arguments (#4519) - Fix missing parameter defaults for calls from try statements and functions returned by functions (#4520) ### Pull Requests - [#4519](https://github.com/rollup/rollup/pull/4519): Try to make logical expression deoptimization more robust (@lukastaegert) - [#4520](https://github.com/rollup/rollup/pull/4520): Roll back parameter default tree shaking (@lukastaegert) ## 2.75.4 _2022-05-31_ ### Bug Fixes - Ensure parameter defaults are retained when a function is used as an object property (#4516) ### Pull Requests - [#4516](https://github.com/rollup/rollup/pull/4516): Deoptimize parameter defaults when referenced from object/array/class literals (@lukastaegert) ## 2.75.3 _2022-05-29_ ### Bug Fixes - Retain parameter defaults for functions that are defaults themselves (#4515) - Track mutations for objects as default values (#4515) ### Pull Requests - [#4515](https://github.com/rollup/rollup/pull/4515): Ensure parameter defaults are deoptimized (@lukastaegert) ## 2.75.1 _2022-05-28_ ### Pull Requests - [#4513](https://github.com/rollup/rollup/pull/4513): Update link to node polyfill repo (@lukastaegert) ## 2.75.0 _2022-05-27_ ### Features - Re-implement default parameter tree-shaking for top-level functions (#4510) - Do not consider calling string methods like `.trim()` on template literals a side effect (#4511) ### Pull Requests - [#4510](https://github.com/rollup/rollup/pull/4510): Tree-shake parameter defaults (replaces #4498) (@lukastaegert) - [#4511](https://github.com/rollup/rollup/pull/4511): Tree-shake side-effect-free string methods on template literals (@lukastaegert) ## 2.74.1 _2022-05-19_ ### Bug Fixes - Revert #4498 until some issues are understood and resolved ## 2.74.0 _2022-05-19_ ### Features - Remove unneeded default values for function parameters (#4498) ### Bug Fixes - Use a consistent mechanism to resolve the config file to avoid issues on Windows (#4501) - Avoid an inaccurate warning about an event emitter leak for complicated builds (#4502) - Ensure that reexporting values from other chunks via dynamic imports does not reference non-imported variables (#4499) ### Pull Requests - [#4498](https://github.com/rollup/rollup/pull/4498): Tree shake parameter defaults (@lukastaegert) - [#4499](https://github.com/rollup/rollup/pull/4499): Ensure reexports are available for namespaces (@lukastaegert) - [#4501](https://github.com/rollup/rollup/pull/4501): fix: config path problem on windows (@pos777) - [#4502](https://github.com/rollup/rollup/pull/4502): Avoid maximum listeners exceeded warning (@lukastaegert) ## 2.73.0 _2022-05-13_ ### Features - Do not treat Object.defineProperty/ies as side effect when called on an unused object (#4493) - Do not assume that assigning a property can create a getter with side effects (#4493) - Do not treat string.prototype.replace(All) as side effect when used with two literals (#4493) ### Bug Fixes - Detect side effects when manually declaring getters on functions (#4493) ### Pull Requests - [#4493](https://github.com/rollup/rollup/pull/4493): Handle getters on functions and improve property deoptimization (@lukastaegert) - [#4494](https://github.com/rollup/rollup/pull/4494): Do not treat string.replace as side effect when used with a literal (@lukastaegert) - [#4495](https://github.com/rollup/rollup/pull/4495): Update docs for --configPlugin using typescript (@Jimmydalecleveland) ## 2.72.1 _2022-05-07_ ### Bug Fixes - Improve tree-shaking of classes with super classes in certain scenarios (#4489) ### Pull Requests - [#4489](https://github.com/rollup/rollup/pull/4489): Do not deoptimize entire super class when adding a property (@lukastaegert) ## 2.72.0 _2022-05-05_ ### Features - Add CLI hooks to run external commands at certain points in watch mode (#4457) ### Bug Fixes - Fix an issue that could accidentally treat relevant assignments as side effect free (#4486) ### Pull Requests - [#4457](https://github.com/rollup/rollup/pull/4457): feat: CLI event hook flags (@Harris-Miller) - [#4486](https://github.com/rollup/rollup/pull/4486): Fix reassignment tracking (@lukastaegert) ## 2.71.1 _2022-04-30_ ### Bug Fixes - Allow importing loadConfigFile without extension (#4483) ### Pull Requests - [#4483](https://github.com/rollup/rollup/pull/4483): Add exports exception for loadConfigFile (@lukastaegert) ## 2.71.0 _2022-04-30_ ## Features - Mark `Object.hasOwn` as pure (#4482) ### Bug Fixes - Prevent infinite recursion and display proper warning for recursive reexports (#4472) - Fix type issue in TypeScript nightly (#4471) ### Pull Requests - [#4467](https://github.com/rollup/rollup/pull/4467): docs: update deprecated option in tools.md (@kimjh96) - [#4471](https://github.com/rollup/rollup/pull/4471): Fix: tsc did not build (@frank-dspeed) - [#4472](https://github.com/rollup/rollup/pull/4472): Throw proper error when indirectly reexporting a recursive binding (@lukastaegert) - [#4475](https://github.com/rollup/rollup/pull/4475): chore: bump deps (#4475) (@dnalborczyk) - [#4477](https://github.com/rollup/rollup/pull/4477): chore: bump github actions (@dnalborczyk) - [#4478](https://github.com/rollup/rollup/pull/4478): ci: test with node.js v18, remove v17 (@dnalborczyk) - [#4479](https://github.com/rollup/rollup/pull/4479): chore(repo): replace `git.io` in the issue template (@SukkaW) - [#4482](https://github.com/rollup/rollup/pull/4482): feat: add Object.hasOwn as pure function (@dnalborczyk) ## 2.70.2 _2022-04-15_ ### Bug Fixes - Do not enforce undefined return values in TypeScript types (#4463) ### Pull Requests - [#4463](https://github.com/rollup/rollup/pull/4463): use void for options hook instead of undefined (@ycmjason) ## 2.70.1 _2022-03-14_ ### Bug Fixes - Handle unfinished hook action errors as regular errors and avoid console logging (#4434) - Allow access to "dist" folder in a Node 17 compatible way (#4436) ### Pull Requests - [#4434](https://github.com/rollup/rollup/pull/4434): Track unfinished hook actions as regular errors (@lukastaegert) - [#4436](https://github.com/rollup/rollup/pull/4436): Update package.json (@frank-dspeed) ## 2.70.0 _2022-03-07_ ### Features - Make the `watchChange` and `closeWatcher` hooks asynchronous and make Rollup wait for these hooks before continuing (#4427) ### Bug Fixes - Do not abort watch mode for errors in `watchChange` but display them properly (#4427) ### Pull Requests - [#4427](https://github.com/rollup/rollup/pull/4427): Do not abort watch mode on errors in watchChange (@lukastaegert) ## 2.69.2 _2022-03-06_ ### Bug Fixes - Mark `Object.entries` and `Object.fromEntries` as pure (#4429) - Make sure new properties on Array.prototype and Object.prototype are not evaluated as "undefined" (#4428) ### Pull Requests - [#4428](https://github.com/rollup/rollup/pull/4428): Treat unknown prototype props as unknown (@lukastaegert) - [#4429](https://github.com/rollup/rollup/pull/4429): Treat unknown prototype props as unknown (@869288142) ## 2.69.1 _2022-03-04_ ### Bug Fixes - Approximate source position instead of ignoring it when using a low-resolution source map in a transform hook (#4334) ### Pull Requests - [#4334](https://github.com/rollup/rollup/pull/4334): fix(sourcemap): fall back to low-resolution line mapping (@aleclarson and @lukastaegert) ## 2.69.0 _2022-03-02_ ### Features - Introduce new `output.generatedCode.symbols` to control the usage of Symbols in Rollup-generated code (#4378) - soft-deprecate `output.namespaceToStringTag` in favor of `output.generatedCode.symbols` (#4378) ### Bug Fixes - Properly handle `./` and `../` as external dependencies (#4419) - Make generated "Module" namespace toStringTag non-enumerable for correct Object.assign/spread behaviour (#4378) - Add file name to error when top-level-await is used in disallowed formats (#4421) ### Pull Requests - [#4378](https://github.com/rollup/rollup/pull/4378): Make namespace @@toStringTag "Module" non-enumerable (@dnalborczyk and @lukastaegert) - [#4413](https://github.com/rollup/rollup/pull/4413): refactor: some code and type fixes (@dnalborczyk) - [#4418](https://github.com/rollup/rollup/pull/4418): chore: bump deps (@dnalborczyk) - [#4419](https://github.com/rollup/rollup/pull/4419): Properly handle upper directories as external dependencies (@lukastaegert) - [#4421](https://github.com/rollup/rollup/pull/4421): Improve the error prompt and output the error file name (@caoxiemeihao) - [#4423](https://github.com/rollup/rollup/pull/4423): Update 999-big-list-of-options.md (@leoj3n) ## 2.68.0 _2022-02-22_ ### Features - provide information about cached import resolutions in `shouldTransformCachedModule` (#4414) - Add "types" field to Rollup's package exports (#4416) ### Pull Requests - [#4410](https://github.com/rollup/rollup/pull/4410): refactor: use map for declarations and name suggestions (@dnalborczyk) - [#4411](https://github.com/rollup/rollup/pull/4411): refactor: use map for namespace reexports by name (@dnalborczyk) - [#4412](https://github.com/rollup/rollup/pull/4412): refactor: use includes where appropriate (@dnalborczyk) - [#4414](https://github.com/rollup/rollup/pull/4414): Add resolved sources to shouldTransformCachedModule (@lukastaegert) - [#4416](https://github.com/rollup/rollup/pull/4416): Add Typescript 4.5 nodenext node12 module resolution support (@frank-dspeed) ## 2.67.3 _2022-02-18_ ### Bug Fixes - Do not swallow other errors when unfinished hook actions are detected (#4409) - Add additional information to output when there are unfinished hook actions (#4409) ### Pull Requests - [#4399](https://github.com/rollup/rollup/pull/4399): docs: remove const (@TrickyPi) - [#4401](https://github.com/rollup/rollup/pull/4401): Improve test stability by getting independent of module id ordering in more places (@lukastaegert) - [#4403](https://github.com/rollup/rollup/pull/4403): fix: remove unnecessary property descriptor spread (@dnalborczyk) - [#4404](https://github.com/rollup/rollup/pull/4404): refactor: use map for import descriptions + re-export descriptions (@dnalborczyk) - [#4405](https://github.com/rollup/rollup/pull/4405): refactor: module exports to map (@dnalborczyk) - [#4406](https://github.com/rollup/rollup/pull/4406): Fix a typo in 'Direct plugin communication' code example (@younesmln) - [#4407](https://github.com/rollup/rollup/pull/4407): Document how resolveId is cached (@lukastaegert) - [#4409](https://github.com/rollup/rollup/pull/4409): Print ids for unfinished moduleParsed and shouldTransformCachedModule hooks (@lukastaegert) ## 2.67.2 _2022-02-10_ ### Bug Fixes - Ensure consistent order between manual chunks to fix hashing issues (#4397) ### Pull Requests - [#4390](https://github.com/rollup/rollup/pull/4390): refactor: add @types/estree explicitly, fix dynamic type imports (@dnalborczyk) - [#4391](https://github.com/rollup/rollup/pull/4391): chore: remove acorn-walk ambient type definitions (@dnalborczyk) - [#4397](https://github.com/rollup/rollup/pull/4397): Sort manual chunks generated via a function by name (@lukastaegert) ## 2.67.1 _2022-02-07_ ### Bug Fixes - Make chunk file and variable names more deterministic when emitting chunks (#4386) - Improve default module resolver performance by using non-blocking IO (#4386) ### Pull Requests - [#4373](https://github.com/rollup/rollup/pull/4373): fix: even more types (@dnalborczyk) - [#4382](https://github.com/rollup/rollup/pull/4382): Update contribution tut link desc (@lemredd) - [#4383](https://github.com/rollup/rollup/pull/4383): chore: bump deps (@dnalborczyk) - [#4384](https://github.com/rollup/rollup/pull/4384): chore: move "wait" to utils + re-use (@dnalborczyk) - [#4385](https://github.com/rollup/rollup/pull/4385): refactor: convert watch tests to async functions (@dnalborczyk) - [#4386](https://github.com/rollup/rollup/pull/4386): refactor: use fs.promises in resolve id, Part 4 (@dnalborczyk and @lukastaegert) - [#4389](https://github.com/rollup/rollup/pull/4389): refactor: use fs.promises in generate license file, rollup config, Part 5 (@dnalborczyk) ## 2.67.0 _2022-02-02_ ### Features - Improve side effect detection when using Array.prototype.groupBy/groupByToMap (#4360) - Allow changing `moduleSideEffects` at any time during the build (#4379) - Soft-deprecate `ModuleInfo.hasModuleSideEffects` in favour of `ModuleInfo.moduleSideEffects` (#4379) ### Bug Fixes - Do not include queries and hashes in generated file names when preserving modules (#4374) ### Pull Requests - [#4319](https://github.com/rollup/rollup/pull/4319): refactor: use fs, fs-extra, remove sander (@dnalborczyk) - [#4360](https://github.com/rollup/rollup/pull/4360): feat: add Array.prototype.groupBy/groupByToMap (@dnalborczyk) - [#4361](https://github.com/rollup/rollup/pull/4361): fix: more types (@dnalborczyk) - [#4369](https://github.com/rollup/rollup/pull/4369): fix: remove acorn-walk patch (@dnalborczyk) - [#4371](https://github.com/rollup/rollup/pull/4371): refactor: use fs.promises in cli/run (@dnalborczyk) - [#4372](https://github.com/rollup/rollup/pull/4372): refactor: use fs.promises in module loader (@dnalborczyk) - [#4374](https://github.com/rollup/rollup/pull/4374): Ignore queries and hashes in file names when preserving modules (@lukastaegert) - [#4375](https://github.com/rollup/rollup/pull/4375): Fix typo in \_config.js (@eltociear) - [#4376](https://github.com/rollup/rollup/pull/4376): refactor: fs.promises, move mkdir to writeoutputfile, Part 3 (@dnalborczyk) - [#4379](https://github.com/rollup/rollup/pull/4379): Deprecate hasModuleSideEffects in favor of moduleSideEffects and ensure it is mutable on ModuleInfo (@lukastaegert) ## 2.66.1 _2022-01-25_ ### Bug Fixes - Only warn for conflicting names in namespace reexports if it actually causes problems (#4363) - Only allow explicit exports or reexports as synthetic namespaces and hide them from namespace reexports (#4364) ### Pull Requests - [#4362](https://github.com/rollup/rollup/pull/4362): refactor: convert exportsByName object to map (@dnalborczyk) - [#4363](https://github.com/rollup/rollup/pull/4363): Do not warn unnecessarily for namespace conflicts (@lukastaegert) - [#4364](https://github.com/rollup/rollup/pull/4364): Do not expose synthetic namespace export in entries and namespaces (@lukastaegert) ## 2.66.0 _2022-01-22_ ### Features - Note if a module has a default export in ModuleInfo to allow writing better proxy modules (#4356) - Add option to wait until all imported ids have been resolved when awaiting `this.load` (#4358) ### Pull Requests - [#4356](https://github.com/rollup/rollup/pull/4356): Add hasDefaultExport to ModuleInfo (@lukastaegert) - [#4358](https://github.com/rollup/rollup/pull/4358): Add "resolveDependencies" option to "this.load" (@lukastaegert) ## 2.65.0 _2022-01-21_ ### Features - Add complete import resolution objects to ModuleInfo for use in `this.load` (#4354) ### Bug Fixes - Use correct context in plugin hooks with `perf: true` (#4357) ### Pull Requests - [#4351](https://github.com/rollup/rollup/pull/4351): refactor: re-use source mapping url (@dnalborczyk) - [#4352](https://github.com/rollup/rollup/pull/4352): refactor: replace require-relative with built-in require.resolve (@dnalborczyk) - [#4353](https://github.com/rollup/rollup/pull/4353): chore: bump deps (@dnalborczyk) - [#4354](https://github.com/rollup/rollup/pull/4354): Add importedIdResolutions to moduleInfo (@lukastaegert) - [#4355](https://github.com/rollup/rollup/pull/4355): chore: remove external from config (@dnalborczyk) - [#4357](https://github.com/rollup/rollup/pull/4357): fix: timed plugin context (@dnalborczyk) ## 2.64.0 _2022-01-14_ ### Features - Allow inspecting cached modules and forcing them to be transformed again via shouldTransformCachedModule (#4320) - Do not wait for the config file to be parsed in watch mode if it is updated before that (#4344) ### Bug Fixes - Do not mutate objects returned as `meta` from the resolveId hook (#4347) ### Pull Requests - [#4326](https://github.com/rollup/rollup/pull/4326): refactor: type fixes (@dnalborczyk) - [#4339](https://github.com/rollup/rollup/pull/4339): More watch test stabilization (@lukastaegert) - [#4340](https://github.com/rollup/rollup/pull/4340): refactor: performance timers for node.js and browser (@dnalborczyk) - [#4341](https://github.com/rollup/rollup/pull/4341): Implement shouldTransformCachedModule hook (@lukastaegert) - [#4344](https://github.com/rollup/rollup/pull/4344): Directly restart Rollup when config file change is detected in watch mode (@lukastaegert) - [#4347](https://github.com/rollup/rollup/pull/4347): Create a shallow copy when returning meta from resolveId (@lukastaegert) ## 2.63.0 _2022-01-04_ ### Features - Report a helpful error if rollup exits due to an empty event loop when using `this.load` (#4320) - Allow directly mutating ModuleInfo.meta for modules and never replace this object (#4328) - Detect additional side effect free array prototype methods (#4332) ### Bug Fixes - Do not watch if CLI watch options are specified but `--watch` is missing (#4335) ### Pull Requests - [#4320](https://github.com/rollup/rollup/pull/4320): Detect unfulfilled async hook actions and report error on exit (@kzc) - [#4328](https://github.com/rollup/rollup/pull/4328): Make initial ModuleInfo.meta mutable and maintain object identity (@lukastaegert) - [#4318](https://github.com/rollup/rollup/pull/4318): Stabilize watch tests (@lukastaegert) - [#4331](https://github.com/rollup/rollup/pull/4331): Improve JS docs example (@lukastaegert) - [#4332](https://github.com/rollup/rollup/pull/4332): add support for Array.prototype.findLast,findLastIndex (@dnalborczyk) - [#4333](https://github.com/rollup/rollup/pull/4333): convert utils.transform to async function (@dnalborczyk) - [#4335](https://github.com/rollup/rollup/pull/4335): Do not watch unless --watch is specified explicitly (@lukastaegert) - [#4338](https://github.com/rollup/rollup/pull/4338): Add build delay for plugin event test (@lukastaegert) ## 2.62.0 _2021-12-24_ ### Features - Mark additional string prototype methods as side-effect-free and correct typings of existing ones (#4299) - Mark additional array prototype methods as side-effect-free and correct typings of existing ones (#4309) - Expose if a module is included after tree-shaking in its ModuleInfo (#4305) ### Bug Fixes - Fix how fsevents is included to improve watch mode on MacOS (#4312) ### Pull Requests - [#4299](https://github.com/rollup/rollup/pull/4299): Add additional string prototype methods (@dnalborczyk) - [#4300](https://github.com/rollup/rollup/pull/4300): Bump deps, fix expected test result for core-js (@dnalborczyk) - [#4302](https://github.com/rollup/rollup/pull/4302): Replace type assertion with type guard (@dnalborczyk) - [#4304](https://github.com/rollup/rollup/pull/4304): Re-use reserved names set (@dnalborczyk) - [#4305](https://github.com/rollup/rollup/pull/4305): Expose isIncluded in module info (@william57m) - [#4306](https://github.com/rollup/rollup/pull/4306): Fix git line breaks on windows (@dnalborczyk) - [#4307](https://github.com/rollup/rollup/pull/4307): Add macos to pipeline (@dnalborczyk) - [#4309](https://github.com/rollup/rollup/pull/4309): Add additional array prototype methods (@dnalborczyk) - [#4311](https://github.com/rollup/rollup/pull/4311): Add Deno instructions to docs (@jespertheend) - [#4312](https://github.com/rollup/rollup/pull/4312): fsevents integration (@dnalborczyk) - [#4313](https://github.com/rollup/rollup/pull/4313): Remove non-existing static functions from known globals (@dnalborczyk) ## 2.61.1 _2021-12-11_ ### Bug Fixes - Only resolve this.load once the code of the module is available (#4296) ### Pull Requests - [#4296](https://github.com/rollup/rollup/pull/4296): Make sure this.load waits for modules that are already loading (@lukastaegert) - [#4298](https://github.com/rollup/rollup/pull/4298): use set for reserved words (@dnalborczyk) ## 2.61.0 _2021-12-09_ ### Features - Support ergonomic brand checks for private fields (#4293) ### Bug Fixes - Improve handling of directory creation on systems with restrictive open files limit (#4288) ### Pull Requests - [#4288](https://github.com/rollup/rollup/pull/4288): modifymkdirpath (@mgrabowski84) - [#4293](https://github.com/rollup/rollup/pull/4293): bump deps (@dnalborczyk) ## 2.60.2 _2021-11-30_ ### Bug Fixes - Produce correct output when dynamic import paths contain quotes (#4286) ### Pull Requests - [#4286](https://github.com/rollup/rollup/pull/4286): Escape dynamic import paths (@danielroe) ## 2.60.1 _2021-11-22_ ### Bug Fixes - Make sure virtual files have proper file extensions when preserving modules (#4270) ### Pull Requests - [#4270](https://github.com/rollup/rollup/pull/4270): Use entryFileNames when generating filenames for virtual modules (@BPScott) ## 2.60.0 _2021-11-11_ ### Features - Add `this.load` context function to load, transform and parse modules without adding them to the graph (#4234) - Sanitize non-url-safe characters in generated chunk names by default (#4262) - Support ESM plugins via command line (#4265) ### Pull Requests - [#4234](https://github.com/rollup/rollup/pull/4234): Plugin context function for pre-loading modules (@lukastaegert) - [#4262](https://github.com/rollup/rollup/pull/4262): exclude invalid URL chars (@danielroe) - [#4265](https://github.com/rollup/rollup/pull/4265): support loading ESM plugins from the CLI via --plugin (@kzc) ## 2.59.0 _2021-11-01_ ### Features - Support static class initialization blocks (#4249) ### Bug Fixes - Fix an issue with the CommonJS plugin when module.exports has inherited properties (#4256) ### Pull Requests - [#4236](https://github.com/rollup/rollup/pull/4236): typescript bug class field initialization order (@dnalborczyk) - [#4249](https://github.com/rollup/rollup/pull/4249): Support for class static initialization block (@dnalborczyk and @lukastaegert) - [#4256](https://github.com/rollup/rollup/pull/4256): Skip inherited properties in synthetic namespaces (@lukastaegert) ## 2.58.3 _2021-10-25_ ### Bug Fixes - Republish 2.58.1 with npm 6 as files were missing ## 2.58.2 _2021-10-25_ ### Bug Fixes - Republish 2.58.1 as files were missing ## 2.58.1 _2021-10-25_ ### Bug Fixes - Fix an issue with the CommonJS plugin when module.exports is falsy (#4247) ### Pull Requests - [#4247](https://github.com/rollup/rollup/pull/4247): Handle falsy synthetic namespaces (@lukastaegert) ## 2.58.0 _2021-10-01_ ### Features - Add a flag to more reliably identify entry points in the `resolveId` hook (#4230) ### Pull Requests - [#4230](https://github.com/rollup/rollup/pull/4230): Add isEntry flag to resolveId and this.resolve (@lukastaegert) - [#4233](https://github.com/rollup/rollup/pull/4233): Remove unused rollup-plugin-typescript ambient module types (@dnalborczyk) - [#4235](https://github.com/rollup/rollup/pull/4235): Update dependencies (@lukastaegert) ## 2.57.0 _2021-09-22_ ### Features - Add `generatedCode` option to allow Rollup to use es2015 features for smaller output and more efficient helpers (#4215) - Improve AMD and SystemJS parsing performance by wrapping relevant functions in parentheses (#4215) - Using `preferConst` will now show a warning with `strictDeprecations: true` (#4215) ### Bug Fixes - Improve ES3 syntax compatibility by more consequently quoting reserved words as props in generated code (#4215) - Do not use `Object.assign` in generated code to ensure ES5 compatibility without the need for polyfills (#4215) - Support live-bindings in dynamic namespace objects that contain reexported external or synthetic namespaces (#4215) - Use correct "this" binding in dynamic import expressions for CommonJS and AMD (#4215) - Properly handle `shimMissingExports` for exports that are only used internally (#4215) - Prevent unhandled rejection for failed module parsing (#4228) ### Pull Requests - [#4212](https://github.com/rollup/rollup/pull/4212): chore: remove unused ambient types (@dnalborczyk) - [#4215](https://github.com/rollup/rollup/pull/4215): Use ES2015 features in generated code snippets (@lukastaegert) - [#4219](https://github.com/rollup/rollup/pull/4219): chore: bump rollup typescript, remove unused micromatch (@dnalborczyk) - [#4220](https://github.com/rollup/rollup/pull/4220): chore: use forceConsistentCasingInFileNames in ts-config (@dnalborczyk) - [#4224](https://github.com/rollup/rollup/pull/4224): prepare for useDefineForClassFields (@dnalborczyk) - [#4228](https://github.com/rollup/rollup/pull/4228): fix: prevent UnhandledPromiseRejectionWarning when module resolution/parsing fails (@kherock) ## 2.56.3 _2021-08-23_ ### Bug Fixes - Make sure moduleInfo contains complete information about imported ids in the moduleParsed hook (#4208) ### Pull Requests - [#4208](https://github.com/rollup/rollup/pull/4208): `ModuleInfo.importedIds` will return null if `resolvedIds[source]` is undefined (@FoxDaxian and @lukastaegert) ## 2.56.2 _2021-08-10_ ### Bug Fixes - Check if after simplification, an object pattern would become an expression statement or arrow function return value (#4204) ### Pull Requests - [#4204](https://github.com/rollup/rollup/pull/4204): Do not create invalid code when simplifying object pattern assignments (@lukastaegert) ## 2.56.1 _2021-08-08_ ### Bug Fixes - Fix rendering of SystemJS export declarations initialized with a simplifiable expression (#4202) ### Pull Requests - [#4202](https://github.com/rollup/rollup/pull/4202): Fix incorrect rendering of export declarations in SystemJS (@lukastaegert) ## 2.56.0 _2021-08-05_ ### Features - Create more efficient code for SystemJS exports (#4199) - Extend `maxParallelFileReads` option to also throttle plugin load hooks (#4200) ### Bug Fixes - Return correct value for postfix update expressions of exported variables (#4194) ### Pull Requests - [#4199](https://github.com/rollup/rollup/pull/4199): Refine SystemJS export rendering (@lukastaegert) - [#4200](https://github.com/rollup/rollup/pull/4200): Restrict parallel execution of load hook (@schummar) ## 2.55.1 _2021-07-29_ ### Bug Fixes - Improve CLI warning message for unused external imports (#4194) ### Pull Requests - [#4194](https://github.com/rollup/rollup/pull/4194): Align batch warning for UNUSED_EXTERNAL_IMPORT to individual warning (@benmccann) ## 2.55.0 _2021-07-28_ ### Features - Support default export live-bindings when generating ESM output (#4182) ### Bug Fixes - Always write `["default"]` as computed property when used as named export (#4182) - Do not mask default export TDZ errors (#4182) ### Pull Requests - [#4182](https://github.com/rollup/rollup/pull/4182): Use mutable bindings for default exports (@lukastaegert) ## 2.54.0 _2021-07-25_ ### Features - Extend UMD import.meta.url polyfill to support web workers (#4186) ### Bug Fixes - Resolve an issue where certain uses of classes could lead to an infinite recursion (#4189) ### Pull Requests - [#4186](https://github.com/rollup/rollup/pull/4186): Fix UMD import.meta.url inside web workers (@ceifa) - [#4188](https://github.com/rollup/rollup/pull/4188): Fix typo in renderHelpers.ts (@eltociear) - [#4189](https://github.com/rollup/rollup/pull/4189): Move long path recursion prevention to MemberExpression (@lukastaegert) - [#4190](https://github.com/rollup/rollup/pull/4190): Stop recommending node-builtins (@curran) ## 2.53.3 _2021-07-21_ ### Bug Fixes - Solve an issue that could lead to severe memory issues and crashes when there are a lot of hoisted variables (#4183) ### Pull Requests - [#4183](https://github.com/rollup/rollup/pull/4183): Avoid memory issues with hoisted variables (@lukastaegert) ## 2.53.2 _2021-07-15_ ### Bug Fixes - Identify additional TDZ situations in functions that are run more than once (#4177) - Fix a scoping issue when a variable inside a catch scope matches the scope parameter's name (#4178) ### Pull Requests - [#4177](https://github.com/rollup/rollup/pull/4177): Fix additional let/var init bugs (@kzc) - [#4178](https://github.com/rollup/rollup/pull/4178): Correctly create outside variable when shadowed by catch parameter (@lukastaegert) ## 2.53.1 _2021-07-11_ ### Bug Fixes - Do not omit namespace reexports when `treeshake` is `false` (#4175) ### Pull Requests - [#4175](https://github.com/rollup/rollup/pull/4175): Generate namespace objects when not tree-shaking (@lukastaegert) ## 2.53.0 _2021-07-09_ ### Features - Add `maxParallelFileReads` option to limit read operations with a default of 20 (#4170) ### Pull Requests - [#4170](https://github.com/rollup/rollup/pull/4170): Limit parallel file reads to prevent "EMFILE: too many open files" error (@schummar) ## 2.52.8 _2021-07-07_ ### Bug Fixes - Automatically handle many use `var` before declaration and TDZ access scenarios correctly without the need for `treeshake.correctVarValueBeforeDeclaration` (#4148) ### Pull Requests - [#4148](https://github.com/rollup/rollup/pull/4148): Fix var/const/let variable use before declaration (@kzc and @lukastaegert) ## 2.52.7 _2021-07-02_ ### Bug Fixes - Fix an issue where reassignments where not tracked through async function returns (#4163) ### Pull Requests - [#4163](https://github.com/rollup/rollup/pull/4163): Deoptimize return values of async functions (@lukastaegert) ## 2.52.6 _2021-07-01_ ### Bug Fixes - Fix an issue where reassignments where not tracked through an await expression (#4162) ### Pull Requests - [#4162](https://github.com/rollup/rollup/pull/4162): doptimize awaited expressions (@lukastaegert) ## 2.52.5 _2021-07-01_ ### Bug Fixes - Properly display parser errors not tied to a code location (#4160) ### Pull Requests - [#4160](https://github.com/rollup/rollup/pull/4160): fix: max stack call error is caught on locate (@semoal) ## 2.52.4 _2021-06-30_ ### Bug Fixes - Fix an error when external namespaces are reexported across several files (#4159) ### Pull Requests - [#4159](https://github.com/rollup/rollup/pull/4159): Properly handle double reexports from external namespaces (@lukastaegert) ## 2.52.3 _2021-06-25_ ### Bug Fixes - Fix an issue where code was wrongly removed when using vars in nested scopes (#4149) ### Pull Requests - [#4149](https://github.com/rollup/rollup/pull/4149): Make sure the initializer of hoisted variables is deoptimized (@lukastaegert) ## 2.52.2 _2021-06-21_ ### Bug Fixes - Support falsy plugins in types (#4144) - Do not require return value in renderChunkHook type (#4144) ### Pull Requests - [#4144](https://github.com/rollup/rollup/pull/4144): Use TypeScript config and improve some types (@lukastaegert) ## 2.52.1 _2021-06-17_ ### Bug Fixes - Fix a memory leak in watch mode (#4142) ### Pull Requests - [#4142](https://github.com/rollup/rollup/pull/4142): Make array and object prototype singletons immutable for now (@lukastaegert) ## 2.52.0 _2021-06-16_ ### Features - Add `--configPlugin` CLI option to apply plugins to the config file for e.g. TypeScript configs (#3835) - Add "safest" and "smallest" presets to tree-shaking options for easier configuration (#4131) - Add `treeshake.correctVarValueBeforeDeclaration` option to deoptimize `var` declarations (#4139) ### Pull Requests - [#3835](https://github.com/rollup/rollup/pull/3835): Add typescript config support (@TheRealSyler) - [#4131](https://github.com/rollup/rollup/pull/4131): Add presets to the tree-shaking options (@lukastaegert) - [#4139](https://github.com/rollup/rollup/pull/4139): Add option to deoptimize var declarations for tree-shaking (@lukastaegert) - [#4141](https://github.com/rollup/rollup/pull/4141): Update dependencies (@lukastaegert) ## 2.51.2 _2021-06-11_ ### Bug Fixes - Include modules imported from no-treeshake modules even if they would be empty (#4138) ### Pull Requests - [#4138](https://github.com/rollup/rollup/pull/4138): Include all dependencies from modules with no-treeshake (@lukastaegert) ## 2.51.1 _2021-06-08_ ### Bug Fixes - Fix error when using `defineConfig` (#4134) ### Pull Requests - [#4134](https://github.com/rollup/rollup/pull/4134): export `rollup.defineConfig` at runtime (@mshrtsr) ## 2.51.0 _2021-06-06_ ### Features - Add a helper for IntelliSense support in config files (#4127) ### Bug Fixes - Improve performance when generating source maps (#4122) ### Pull Requests - [#4122](https://github.com/rollup/rollup/pull/4122): User Map to optimize performance (@izevo) - [#4127](https://github.com/rollup/rollup/pull/4127): Export defineConfig defines the auxiliary function of the configuration (@rxliuli) ## 2.50.6 _2021-06-03_ ### Bug Fixes - Do not consider the object spread operator as side effect when `propertyReadSideEffects` are false (#4119) - Detect side effects when returning thenables from async arrow functions (#4120) ### Pull Requests - [#4119](https://github.com/rollup/rollup/pull/4119): Respect propertyReadSideEffects in spread elements (@lukastaegert) - [#4120](https://github.com/rollup/rollup/pull/4120): Detect async arrow thenable side effects (@lukastaegert) ## 2.50.5 _2021-05-30_ ### Bug Fixes - Detect side effects when accessing thenables (#4115) ### Pull Requests - [#4114](https://github.com/rollup/rollup/pull/4114): use `colorette` instead of `turbocolor` (@ryuever) - [#4115](https://github.com/rollup/rollup/pull/4115): Tracks side effects of thenables (@lukastaegert) ## 2.50.4 _2021-05-29_ ### Bug Fixes - Fix a situation where tree-shaking would stop including nodes prematurely (#4111) - Track mutations and accessor side effects when using `__proto__` in an object literal (#4112) - Check for getter effects when spreading an object (#4113) ### Pull Requests - [#4111](https://github.com/rollup/rollup/pull/4111): Always request a new tree-shaking pass when deoptimizations of a node are first included (@lukastaegert) - [#4112](https://github.com/rollup/rollup/pull/4112): Actually set the prototype when using a **proto** property (@lukastaegert) - [#4113](https://github.com/rollup/rollup/pull/4113): Track access side effects when using object spread operator (@lukastaegert) ## 2.50.3 _2021-05-28_ ### Bug Fixes - Wrap parentheses around leading elements in simplified sequence expressions if this would otherwise lead to invalid code (#4110) - Do not associate block soped variables in catch clauses with the clause parameter (#4108) - Do not associate hoisted variables in catch clauses with outside variables if they match the parameter (#4108) - Use correct "this" context for tagged template literal member expressions in simplified sequences (#4110) ### Pull Requests - [#4108](https://github.com/rollup/rollup/pull/4108): Correctly handle catch declarations (@lukastaegert) - [#4110](https://github.com/rollup/rollup/pull/4110): Invalid sequence expression simplification (@lukastaegert) ## 2.50.2 _2021-05-27_ ### Bug Fixes - Avoid unnecessary side effects when using methods like `.filter` and `.map` (#4103) - Avoid crash when a module with moduleSideEffects no-treeshake imports a tree-shaken module (#4104) ### Pull Requests - [#4103](https://github.com/rollup/rollup/pull/4103): Do not track side-effect-free array methods as side effects (@lukastaegert) - [#4104](https://github.com/rollup/rollup/pull/4104): Fix crash when using inlineDynamicImports with no-treeshake (@lukastaegert) ## 2.50.1 _2021-05-26_ ### Bug Fixes - Do not associate pure annotations in simplified expressions with wrong elements (#4095) - Prevent invalid code when simplified conditionals start with an IIFE function expression (#4099) ### Pull Requests - [#4095](https://github.com/rollup/rollup/pull/4095): Correctly associate pure annotations and remove invalid ones (@lukastaegert) - [#4099](https://github.com/rollup/rollup/pull/4099): Wrap leading function expression iifes in conditionals (@lukastaegert) ## 2.50.0 _2021-05-25_ ### Features - Only include last elements of comma expressions if they are used or have side effects (#4087) ### Bug Fixes - Prevent a crash that could occur when calling object methods (#4091) ### Pull Requests - [#4085](https://github.com/rollup/rollup/pull/4085): Switch to ESLint (@lukastaegert) - [#4087](https://github.com/rollup/rollup/pull/4087): Drop unused last sequence element (@lukastaegert) - [#4091](https://github.com/rollup/rollup/pull/4091): Prevent crash for recursive "this" deoptimization (@lukastaegert) ## 2.49.0 _2021-05-23_ ### Features - Detect side-effect-free static class methods and properties (#4018) - Detect side-effect-free array elements (#4018) - Do not apply deoptimizations from dead code (#4018) ### Bug Fixes - Handle side effect detection for getters and setters added in untracked code (#4018) - Track "this" mutations for methods, getters and setters (#4018) ### Pull Requests - [#4018](https://github.com/rollup/rollup/pull/4018): Class method effects (@marijnh and @lukastaegert) ## 2.48.0 _2021-05-15_ ### Features - Add replacement to conditionally insert asset extensions in `entryFileNames` when preserving modules (#4077) ### Bug Fixes - Fix crash when dynamically assigning to namespace members (#4070) - Do not associate pure annotations in front of a semi-colon or comma with succeeding code (#4068) ### Pull Requests - [#4068](https://github.com/rollup/rollup/pull/4068): ignore invalid trailing pure annotations (@kzc) - [#4070](https://github.com/rollup/rollup/pull/4070): undefined `deoptimizePath` when the first element is empty string (@si3nloong) - [#4071](https://github.com/rollup/rollup/pull/4071): add node.js v16 support (@dnalborczyk) - [#4077](https://github.com/rollup/rollup/pull/4077): Add assetExtname replacement in entryFileNames (@BPScott) - [#4080](https://github.com/rollup/rollup/pull/4080): Added Rollup logo in README.md (@priyanshurav) - [#4081](https://github.com/rollup/rollup/pull/4081): fix comment regarding invalid annotation handling (@kzc) ## 2.47.0 _2021-05-04_ ### Features - Warn about ambiguous imports from combined external namespace reexports (#4064) - In case of combined namespace reexports, always prefer local exports over external namespaces (#4064) - Treat conflicting names in local namespace reexports as undefined (#4064) ### Pull Requests - [#4064](https://github.com/rollup/rollup/pull/4064): Prefer locally defined exports and reexports over external namespaces (@lukastaegert) ## 2.46.0 _2021-04-29_ ### Features - Add option to disable file name sanitation (#4058) - Add information about importers to unused external import warning (#4054) ### Pull Requests - [#4042](https://github.com/rollup/rollup/pull/4042): Use Github actions only (@lukastaegert) - [#4045](https://github.com/rollup/rollup/pull/4045): Fix REPL artefact branch reference (@lukastaegert) - [#4046](https://github.com/rollup/rollup/pull/4046): Use codecov action for coverage (@lukastaegert) - [#4054](https://github.com/rollup/rollup/pull/4054): Add to `UNUSED_EXTERNAL_IMPORT` warning information about the origin of the problem (@cawa-93) - [#4058](https://github.com/rollup/rollup/pull/4058): Add sanitizeFileName option (@guybedford) ## 2.45.2 _2021-04-13_ ### Bug Fixes - Do not user a dynamic entry file name for naming a manual chunk (#4040) ### Pull Requests - [#4040](https://github.com/rollup/rollup/pull/4040): Prioritize manual chunk name over dynamic entry id (@lukastaegert) ## 2.45.1 _2021-04-10_ ### Bug Fixes - Handle falsy return values from async plugin options hooks (#4039) ### Pull Requests - [#4039](https://github.com/rollup/rollup/pull/4039): Do not fail when returning null or undefined from an async options hook (@lukastaegert) ## 2.45.0 _2021-04-09_ ### Features - Support private class instance methods and accessors (#4034) ### Pull Requests - [#4034](https://github.com/rollup/rollup/pull/4034): feat: add support for private class methods (@dnalborczyk) ## 2.44.0 _2021-03-29_ ### Features - Add a new option `makeAbsoluteExternalsRelative` to opt out of renormalizing absolute external ids to relative ids (#4021) - Extend the `resolveId` plugin hook to allow forcing or preventing renormalization of absolute external ids (#4021) - Make the rendered code of individual modules available in the generated bundle (#4028) ### Bug Fixes - Handle objects with `__proto__` properties correctly (#4019) ### Pull Requests - [#4019](https://github.com/rollup/rollup/pull/4019): Deoptimize ObjectExpression when a `__proto__` property is present (@marijnh) - [#4021](https://github.com/rollup/rollup/pull/4021): Improve absolute path handling (@lukastaegert) - [#4026](https://github.com/rollup/rollup/pull/4026): chore: fix vscode launch config (change tdd to bdd) (@jameslahm) - [#4027](https://github.com/rollup/rollup/pull/4027): Post comment for PRs from forks (@lukastaegert) - [#4028](https://github.com/rollup/rollup/pull/4028): Expose rendered module code to generateBundle hook (@btd) ## 2.43.1 _2021-03-28_ ### Bug Fixes - Prevent infinite recursions in certain scenarios when calling object properties (#4025) ### Pull Requests - [#4025](https://github.com/rollup/rollup/pull/4025): Handle recursive this mutation detection (@lukastaegert) ## 2.43.0 _2021-03-27_ ### Features - Track side effects of function properties in objects for better tree-shaking (#4011) ### Pull Requests - [#4011](https://github.com/rollup/rollup/pull/4011): Disable pessimistic object deoptimization for calls when the called function doesn't ref this (@marijnh) - [#4012](https://github.com/rollup/rollup/pull/4012): fix `sourcemap` reference in docs (@tjenkinson) - [#4015](https://github.com/rollup/rollup/pull/4015): Use SIGTERM instead of SIGINT to kill test child processes in tests (@marijnh) ## 2.42.4 _2021-03-24_ ### Bug Fixes - Do not discard plugin return values when using perf option (#4010) ### Pull Requests - [#4010](https://github.com/rollup/rollup/pull/4010): Return hook result inside promise with async timer end (@SuperOleg39) ## 2.42.3 _2021-03-22_ ### Bug Fixes - Do not ignore `#__PURE__` comments in front of optional chaining expressions (#4007) ### Pull Requests - [#4007](https://github.com/rollup/rollup/pull/4007): Tree-shake pure call expressions with optional chaining (@lukastaegert) ## 2.42.2 _2021-03-22_ ### Bug Fixes - Use correct import.meta.url in relative imports from transpiled config files (#4005) ### Pull Requests - [#4005](https://github.com/rollup/rollup/pull/4005): Use correct import.meta.url in config files (@lukastaegert) ## 2.42.1 _2021-03-20_ ### Bug Fixes - Do not produce unhandled Promise rejections when plugins throw while using the `perf` option (#4004) ### Pull Requests - [#4004](https://github.com/rollup/rollup/pull/4004): Fixed unhandled promise rejections (@gluck) ## 2.42.0 _2021-03-19_ ### Features - Prevent infinite loops when several plugins are using `this.resolve` in their resolveId hook (#4000) ### Pull Requests - [#4000](https://github.com/rollup/rollup/pull/4000): Break infinite loops in this.resolve (@lukastaegert) ## 2.41.5 _2021-03-18_ ### Bug Fixes - Make sure unused property accesses of external namespaces can be tree-shaken (#4001) ### Pull Requests - [#4001](https://github.com/rollup/rollup/pull/4001): Do not count accessing members of an external namespace as side-effects (@lukastaegert) ## 2.41.4 _2021-03-16_ ### Bug Fixes - Do not replace external namespace imports with individual named imports to avoid changing behaviour with regard to missing exports (#3999) ### Pull Requests - [#3999](https://github.com/rollup/rollup/pull/3999): Allow to safely probe external namespaces (@lukastaegert) ## 2.41.3 _2021-03-16_ ### Bug Fixes - Always retain arguments passed to empty object pattern parameters (#3998) ### Pull Requests - [#3998](https://github.com/rollup/rollup/pull/3998): Do not create invalid code if a function argument is an empty object pattern (@lukastaegert) ## 2.41.3 _2021-03-16_ ### Bug Fixes - Always retain arguments passed to empty object pattern parameters (#3998) ### Pull Requests - [#3998](https://github.com/rollup/rollup/pull/3998): Do not create invalid code if a function argument is an empty object pattern (@lukastaegert) ## 2.41.2 _2021-03-12_ ### Bug Fixes - Also remove sourcemaps comments if plugins return a pre-made ast (#3987) ### Pull Requests - [#3987](https://github.com/rollup/rollup/pull/3987): Change removal of sourcemap comment (@yannayl) ## 2.41.1 _2021-03-11_ ### Pull Requests - [#3990](https://github.com/rollup/rollup/pull/3990): Add browser sourcemap and remove log (@lukastaegert) ## 2.41.0 _2021-03-09_ ### Features - Add option to `treeshake.propertyReadSideEffects` to keep all property accesses (#3985) ### Bug Fixes - Also respect pure comment annotations when a plugin provides an AST in the transform hook provided they use this.parse (#3981) ### Pull Requests - [#3981](https://github.com/rollup/rollup/pull/3981): Move pure comment annotation to Graph.contextParse (@yannayl) - [#3985](https://github.com/rollup/rollup/pull/3985): implement --treeshake.propertyReadSideEffects=always to handle getters with side effects (@kzc) ## 2.40.0 _2021-02-26_ ### Features - Make sure that entry point variable names take precedence over variable names in dependencies when deconflicting (#3977) ### Bug Fixes - Replace `:` in generated file names to prevent invalid files on Windows (#3972) ### Pull Requests - [#3972](https://github.com/rollup/rollup/pull/3972): Don't allow `:` in file names (@lukastaegert) - [#3976](https://github.com/rollup/rollup/pull/3976): Add soft breaks to guide to improve mobile experience (@lukastaegert) - [#3977](https://github.com/rollup/rollup/pull/3977): Reverse module deconflicting order (@lukastaegert) ## 2.39.1 _2021-02-23_ ### Bug Fixes - Make sure local variables named Symbol, Object or Promise do not conflict with code generated by Rollup (#3971) ### Pull Requests - [#3964](https://github.com/rollup/rollup/pull/3964): Remove extra word (@jamonholmgren) - [#3971](https://github.com/rollup/rollup/pull/3971): Avoid conflicts with local variables named Symbol, Object, Promise (@lukastaegert) ## 2.39.0 _2021-02-12_ ### Features - Add "validate" option to verify generated chunks are valid JavaScript (#3952) ### Bug Fixes - Always add exports properties for uninitialized named exports (#3957) - Allow using an external namespace reexport together with named exports (#3959) - Avoid invalid generated code in certain scenarios with SystemJS exports (#3960) ### Pull Requests - [#3952](https://github.com/rollup/rollup/pull/3952): implement `validate` output option and `--validate` CLI option (@kzc) - [#3956](https://github.com/rollup/rollup/pull/3956): Update dependencies, fix fsevents issue (@lukastaegert) - [#3957](https://github.com/rollup/rollup/pull/3957): Make sure uninitialised exports turn up via .hasOwnProperty for non-ES formats (@lukastaegert) - [#3959](https://github.com/rollup/rollup/pull/3959): Allow overriding individual exports of reexported external namespaces (@lukastaegert) - [#3960](https://github.com/rollup/rollup/pull/3960): Make sure system exports are valid JavaScript (@lukastaegert) ## 2.38.5 _2021-02-05_ ### Bug Fixes - Prevent invalid code when simplifying assignments and delcarations (#3951) - Prevent behaviour-changing line-breaks when simplifying assignments in return statements (#3951) - Slightly improve white-space rendering when simplifying certain expressions (#3951) ### Pull Requests - [#3951](https://github.com/rollup/rollup/pull/3951): Wrap simplified assignments if necessary (@lukastaegert) ## 2.38.4 _2021-02-02_ ### Bug Fixes - Do not change logic when tree-shaking declarations in if statements or loops (#3947) ### Pull Requests - [#3947](https://github.com/rollup/rollup/pull/3947): Do not tear apart declarations in loop or if bodies (@lukastaegert) ## 2.38.3 _2021-02-01_ ### Bug Fixes - Prevent an unexpected live-binding when default exporting a synthetic named export (#3946) ### Pull Requests - [#3945](https://github.com/rollup/rollup/pull/3945): Upgrade chokidar and fsevents for Apple M1 compatibility (@threepointone) - [#3946](https://github.com/rollup/rollup/pull/3946): Make sure default exports snapshot synthetic named exports (@lukastaegert) ## 2.38.2 _2021-01-31_ ### Bug Fixes - Do not generate invalid code for partially tree-shaken declarations in for loops (#3943) - Always include function bodies of functions in side-effect-free modules (#3944) ### Pull Requests - [#3943](https://github.com/rollup/rollup/pull/3943): Do not partially tree-shake unused declarations in for loops (@lukastaegert) - [#3944](https://github.com/rollup/rollup/pull/3944): Correctly include functions with side effects from side-effect-free modules (@lukastaegert) ## 2.38.1 _2021-01-28_ ### Bug Fixes - Fix internal error when resolving a missing entry point in the browser build (#3935) ### Pull Requests - [#3935](https://github.com/rollup/rollup/pull/3935): fix: remove isolated resolve() for compat with browser distribution (@cmorten and @lukastaegert) - [#3936](https://github.com/rollup/rollup/pull/3936): Ensure test after() callback is always executed (@Benjamin-Dobell) - [#3937](https://github.com/rollup/rollup/pull/3937): Modernize references to other software (@ludofischer) ## 2.38.0 _2021-01-22_ ### Features - Entirely remove declared variables that only have an initializer side effect (#3933) ### Pull Requests - [#3933](https://github.com/rollup/rollup/pull/3933): Tree-shake unused declarations while keeping initializer side-effects (@lukastaegert) ## 2.37.1 _2021-01-20_ ### Pull Requests - [#3929](https://github.com/rollup/rollup/pull/3929): Deduplicate acorn import (@lukastaegert) ## 2.37.0 _2021-01-19_ ### Features - Always check modules for side effects that only indirectly reexport a used variable (#3840) - Warn if a circular dependency would cause wrong execution order when preserving modules (#3840) ### Bug Fixes - Allow consuming synthetic exports via modules that reexport a namespace (#3894) - Do not crash for circular default reexports (#3840) - Do not crash for circular synthetic namespaces (#3840) - Improve circular dependency execution order in certain scenarios (#3840) ### Pull Requests - [#3840](https://github.com/rollup/rollup/pull/3840): Improve circular dependency execution order (@lukastaegert) - [#3894](https://github.com/rollup/rollup/pull/3894): Always respect synthetic namespaces in namespace reexport (@lukastaegert) ## 2.36.2 _2021-01-16_ ### Bug Fixes - Fix an issue where invalid code was generated for unused assignments with side effects (#3926) ### Pull Requests - [#3926](https://github.com/rollup/rollup/pull/3926): Correctly simplify assignments with parentheses (@lukastaegert) ## 2.36.1 _2021-01-06_ ### Bug Fixes - Solve issues that result in invalid code when partially removing assignments (#3921) ### Pull Requests - [#3921](https://github.com/rollup/rollup/pull/3921): Prevent invalid code when removing assignment target of side-effectful object expression (@lukastaegert) ## 2.36.0 _2021-01-05_ ### Features - Support partial tree-shaking of chained assignments and unused assignment targets (#3919) ### Pull Requests - [#3919](https://github.com/rollup/rollup/pull/3919): Treeshake chained assignment expressions (@lukastaegert) ## 2.35.1 _2020-12-14_ ### Bug Fixes - Allow closing the bundle when watching in case of generate errors by adding the bundle to the error event (#3909) - Automatically close all bundles on generate errors when watching and using the CLI (#3909) - Try to create remaining bundles when watching and one of them throws (#3909) ### Pull Requests - [#3909](https://github.com/rollup/rollup/pull/3909): Forward bundle through watch error events (@lukastaegert) ## 2.35.0 _2020-12-14_ ### Features - Add `closeBundle` hook that is triggered by `bundle.close()` in the JS API (#3883) ### Pull Requests - [#3883](https://github.com/rollup/rollup/pull/3883): Revert pattern to folder export (@intrnl) ## 2.34.2 _2020-12-06_ ### Bug Fixes - Revert pattern export change (#3898) ### Pull Requests - [#3898](https://github.com/rollup/rollup/pull/3898): Revert pattern to folder export (@lukastaegert) ## 2.34.1 _2020-12-03_ ### Bug Fixes - Avoid Node deprecation warning by using a pattern export for nested Rollup files (#3896) ### Pull Requests - [#3887](https://github.com/rollup/rollup/pull/3887): Run memory leak test on all systems (@lukastaegert) - [#3892](https://github.com/rollup/rollup/pull/3892): Add pull_request to windows github actions (@shellscape) - [#3893](https://github.com/rollup/rollup/pull/3893): Update dependencies (@lukastaegert) - [#3896](https://github.com/rollup/rollup/pull/3896): Replace deprecated folder package export with pattern export (@lukastaegert) ## 2.34.0 _2020-11-29_ ### Features - Support RequireJS comaptible AMD ids in code-splitting builds via amd.autoId (#3867) - Allow adding an AMD id base path (#3867) ### Bug Fixes - Warn when using an constant AMD id in a code-splitting build (#3867) ### Pull Requests - [#3867](https://github.com/rollup/rollup/pull/3867): Implement amd.autoId/amd.basePath options (@tjenkinson) ## 2.33.3 _2020-11-18_ ### Bug Fixes - Do not use `.js` extension when importing AMD files from a UMD bundle (#3872) ### Pull Requests - [#3861](https://github.com/rollup/rollup/pull/3861): Update chat/support links (@shellscape) - [#3872](https://github.com/rollup/rollup/pull/3872): Also removeExtensionFromRelativeAmdId in UMD finaliser (@tjenkinson) ## 2.33.2 _2020-11-14_ ### Bug Fixes - Fix an issue where statements were ignored after a conditional return in a labeled statement (#3871) ### Pull Requests - [#3871](https://github.com/rollup/rollup/pull/3871): Correctly track label usage in try statements (@Amareis) ## 2.33.1 _2020-11-02_ ### Bug Fixes - Add `syntheticNamedExports` to `this.getModuleInfo` to align with documentation (#3847) ### Pull Requests - [#3847](https://github.com/rollup/rollup/pull/3847): Expose syntheticNamedExports to ModuleInfo (@Amareis) - [#3852](https://github.com/rollup/rollup/pull/3852): Fix typo on docs (@jpsc) ## 2.33.0 _2020-11-01_ ### Features - Add parameter to "watchChange" hook to denote if a change was an addition, update or deletion (#3841) - Add "closeWatcher" hook to allow plugins to clean up resources when the watcher is closed (#3841) - Add "this.getWatchFiles" function to plugin context to get the current set of watched files (#3841) ### Pull Requests - [#3841](https://github.com/rollup/rollup/pull/3841): Improved watcher hooks (@Amareis) - [#3848](https://github.com/rollup/rollup/pull/3848): Add options hook to asyncpluginhooks (@intrnl) ## 2.32.1 _2020-10-21_ ### Bug Fixes - Print warning location for plugin warnings if only `loc` is supplied (#3824) ### Pull Requests - [#3824](https://github.com/rollup/rollup/pull/3824): plugin warnings not showing warning.loc (@luciotato) ## 2.32.0 _2020-10-16_ ### Features - Extend `preserveEntrySignatures` with a value `"exports-only"` to allow extension only if an entry does not have exports (#3823) ### Pull Requests - [#3823](https://github.com/rollup/rollup/pull/3823): Add "exports-only" option to preserveSignature (@lukastaegert) ## 2.31.0 _2020-10-15_ ### Features - When using the `output.moduleToStringTag` option, also add the tag to entries with exports and simulated external namespaces (#3822) - Add the `__esModule` interop marker to IIFE global variables unless `output.esModule` is turned off (#3822) ### Pull Requests - [#3822](https://github.com/rollup/rollup/pull/3822): Add module toStringTag to entries and interop namespaces (@lukastaegert) ## 2.30.0 _2020-10-13_ ### Features - Add `moduleParsed` hook that is called for each module once code and AST are available (#3813) - Include code and AST in `this.getModuleInfo` (#3813) ### Bug Fixes - Provide the original Acorn AST instead of the internal one when resolving dynamic imports that contain non-trivial expressions (#3813) ### Pull Requests - [#3813](https://github.com/rollup/rollup/pull/3813): Add moduleParsed plugin hook (@lukastaegert) - [#3815](https://github.com/rollup/rollup/pull/3815): Docs: wile => while (@tjenkinson) - [#3817](https://github.com/rollup/rollup/pull/3817): Docs: fix code snippet (@codefrau) - [#3818](https://github.com/rollup/rollup/pull/3818): Update documentation on configuring Babel, removing the section on passing '{"modules": false}' as that is no longer needed since Babel 7 (@Robin-Hoodie) ## 2.29.0 _2020-10-08_ ### Features - Allow passing custom options to other plugins via `this.resolve` (#3807) - Allow attaching custom meta information to modules when resolving, loading or transforming (#3807) - Do not throw but return `null` when using `this.getModuleInfo` for an unknown id (#3807) ### Bug Fixes - Trigger build in watch mode when files are added to a watched directory (#3812) - Make `code` optional when transforming modules (#3807) ### Pull Requests - [#3807](https://github.com/rollup/rollup/pull/3807): Implement new APIs for inter-plugin communication (@lukastaegert) - [#3808](https://github.com/rollup/rollup/pull/3808): Document that the default value of --format is 'es' (@jameshfisher) - [#3812](https://github.com/rollup/rollup/pull/3812): Watch: listen for new files added to a directory (@dmitrage) ## 2.28.2 _2020-09-24_ ### Bug Fixes - Fix a source of possible variable name conflicts when using preserveModules with SystemJS (#3796) ### Pull Requests - [#3792](https://github.com/rollup/rollup/pull/3792): add documentation for output.PreserveModulesRoot (@davidroeca) - [#3796](https://github.com/rollup/rollup/pull/3796): Fix SystemJS default variable conflict (@lukastaegert) ## 2.28.1 _2020-09-21_ ### Bug Fixes - Fix a path slash issue when using the preserveModulesRoot option on Windows (#3791) ### Pull Requests - [#3791](https://github.com/rollup/rollup/pull/3791): Fix preserveModulesRoot path on Windows (@lukastaegert) ## 2.28.0 _2020-09-21_ ### Features - Add an option to treat modules at a given path as located at root when preserving modules (#3786) ### Pull Requests - [#3786](https://github.com/rollup/rollup/pull/3786): Add preserveModulesRoot config option (@davidroeca) ## 2.27.1 _2020-09-17_ ### Bug Fixes - Do not fail when using ES module imports in symlinked config files (#3783) ### Pull Requests - [#3783](https://github.com/rollup/rollup/pull/3783): Handle loading symlinked config files (@lukastaegert) ## 2.27.0 _2020-09-16_ ### Features - Support specifying a file extension when reading from stdin (#3775) ### Bug Fixes - Do not break logic if a branch with hoisted variables is tree-shaken in an else-if statement (#3782) ### Pull Requests - [#3770](https://github.com/rollup/rollup/pull/3770): Docs: Exception for babel plugin and commonjs plugin (@jsk7) - [#3775](https://github.com/rollup/rollup/pull/3775): add ability to specify stdin file extension via --stdin=ext (@kzc) - [#3782](https://github.com/rollup/rollup/pull/3782): Handle hoisted variables in dead branches of nested if statements (@lukastaegert) ## 2.26.11 _2020-09-08_ ### Bug Fixes - Do not fail for unknown nodes as if statement branches (#3769) ### Pull Requests - [#3769](https://github.com/rollup/rollup/pull/3769): Handle debugger statements as if-statement branches (@lukastaegert) ## 2.26.10 _2020-09-04_ ### Bug Fixes - Do not create invalid code when simplifying expressions in return statements that contain line comments (#3762) ### Pull Requests - [#3757](https://github.com/rollup/rollup/pull/3757): Fix api docs loadconfigfile (@maxwell8888) - [#3762](https://github.com/rollup/rollup/pull/3762): Handle line-comments when removing line-breaks to prevent ASI (@lukastaegert) ## 2.26.9 _2020-09-01_ ### Bug Fixes - Add regular expression support to watch include/exclude types (#3754) ### Pull Requests - [#3754](https://github.com/rollup/rollup/pull/3754): Add RegExp to the include and exclude fields of the WatcherOptions type (@dagda1) - [#3756](https://github.com/rollup/rollup/pull/3756): Update FAQ: I think it was meant "external" instead of "other-entry.js" (@madacol) ## 2.26.8 _2020-08-29_ ### Bug Fixes - Make sure that both unresolved and resolved ids are passed to the `external` option in all cases (#3753) ### Pull Requests - [#3753](https://github.com/rollup/rollup/pull/3753): Also pass resolved ids to external if they use the object for (@lukastaegert) ## 2.26.7 _2020-08-28_ ### Bug Fixes - Avoid invalid code when rendering hoisted variable declarations from dead branches (#3752) - Mark the `options` parameter of `this.parse` as optional for TypeScript plugins (#3750) ### Pull Requests - [#3750](https://github.com/rollup/rollup/pull/3750): Make `options` of `PluginContext#parse` optional (@intrnl) - [#3752](https://github.com/rollup/rollup/pull/3752): Extract hoisted variables from dead branches (@lukastaegert) ## 2.26.6 _2020-08-27_ ### Bug Fixes - Avoid conflicts between the namespace of synthetic named exports and local variables (#3747) ### Pull Requests - [#3747](https://github.com/rollup/rollup/pull/3747): Properly deconflict synthetic named exports (@lukastaegert) ## 2.26.5 _2020-08-22_ ### Bug Fixes - Use correctly deconflicted variable names for reexported namespaces in ES formats (#3742) ### Pull Requests - [#3742](https://github.com/rollup/rollup/pull/3742): Avoid variable name conflict when reexporting several namespaces from a chunk (@lukastaegert) ## 2.26.4 _2020-08-19_ ### Bug Fixes - Fix a situation where invalid code was rendered when dynamically importing a module with synthetic named exports when preserving modules (#3738) - Create a proper namespace object when in a non-es format, a namespace is imported from a chunk with `default` export mode (#3738) - Use the same variable when in a chunk, a namespace is both imported and reexported as a binding (#3738) - Do not include the synthetic namespace in static entry points unless it is actually used (#3738) - Make sure the chunking of one output does not interfere with the namespace objects of another output (#3738) ### Pull Requests - [#3738](https://github.com/rollup/rollup/pull/3738): Improve synthetic entry handling (@lukastaegert) ## 2.26.3 _2020-08-16_ ### Bug Fixes - Fix a situation where line-breaks in a nested simplified conditional expression could result in broken code (#3734) ### Pull Requests - [#3734](https://github.com/rollup/rollup/pull/3734): Prevent ASI when simplifying a nested logical expression (@lukastaegert) ## 2.26.2 _2020-08-16_ ### Bug Fixes - Fix a situation where line-breaks in a simplified conditional expression could result in broken code (#3732) ### Pull Requests - [#3732](https://github.com/rollup/rollup/pull/3732): Prevent unintended ASI for nested conditionals (@lukastaegert) ## 2.26.1 _2020-08-16_ ### Bug Fixes - Correctly render external namespace imports when only generating SystemJS output (#3731) ### Pull Requests - [#3731](https://github.com/rollup/rollup/pull/3731): Render system namespace import (@sastan and @lukastaegert) ## 2.26.0 _2020-08-15_ ### Features - Add a new entry `importedBindings` to the bundle information to list bindings per dependency (#3722) ### Bug Fixes - Do not render an invalid UMD wrapper when no bindings are imported from a dependency (#3724) - Avoid situations where removing the `else` branch from an `if` statement might catch the `else` branch from another one (#3725) ### Pull Requests - [#3722](https://github.com/rollup/rollup/pull/3722): Add import specifiers to bundle information (@lukastaegert) - [#3724](https://github.com/rollup/rollup/pull/3724): Fix missing variables for UMD and IIFE builds (@lukastaegert) - [#3725](https://github.com/rollup/rollup/pull/3725): Do not entirely remove else branch if another else branch might accidentally be referenced (@lukastaegert) ## 2.25.0 _2020-08-14_ ### Features - Add `--failAfterWarnings` CLI flag that will complete builds with warnings but return an error at the end (#3712) ### Pull Requests - [#3712](https://github.com/rollup/rollup/pull/3712): Implement `--failAfterWarnings` flag (@tjenkinson) ## 2.24.0 _2020-08-13_ ### Features - Allow defining interop per dependency via a function (#3710) - Support interop "auto" as a more compatible version of "true" (#3710) - Support interop "default" and "esModule" to avoid unnecessary interop helpers (#3710) - Support interop "defaultOnly" for simplified helpers and Node ESM interop compatible output (#3710) - Respect interop option for external dynamic imports (#3710) - Support live-bindings for external default imports in non-ES formats unless "externalLiveBindings" is "false" (#3710) - Use shared default interop helpers for AMD, UMD and IIFE formats (#3710) - Avoid unnecessarily deconflicted module variables in non-ES formats (#3710) - Freeze generated interop namespace objects (#3710) - Always mark interop helpers as pure (#3710) - Avoid default export interop if there is already an interop namespace object (#3710) - Sort all `require` statements to the top in CommonJS output for easier back-transpilation to ES modules by other tools (#3710) ### Bug Fixes - Handle accessing `super` in static class fields (#3720) - Deconflict the names of helper variables introduced for interop (#3710) - Generate proper namespace objects for static namespace imports in non-ES formats (#3710) - Do not add unused interop helpers when using the renderDynamicImport hook (#3710) ### Pull Requests - [#3710](https://github.com/rollup/rollup/pull/3710): Rework interop handling (@lukastaegert) - [#3720](https://github.com/rollup/rollup/pull/3720): Handle super in static class fields (@lukastaegert) ## 2.23.1 _2020-08-07_ ### Bug Fixes - Fix an issue where dynamically importing an entry point could return a malformed namespace for CJS and AMD formats (#3709) ### Pull Requests - [#3709](https://github.com/rollup/rollup/pull/3709): Properly construct namespace when dynamically importing chunks with facades in default export mode (@lukastaegert) ## 2.23.0 _2020-07-23_ ### Features - Handle environments with only globalThis in UMD output (#3691) ### Pull Requests - [#3691](https://github.com/rollup/rollup/pull/3691): Check for globalThis in UMD wrapper (@lukastaegert) ## 2.22.2 _2020-07-21_ ### Bug Fixes - Always generate correct exports when an implicit entry is reexporting from another module (#3688) ### Pull Requests - [#3688](https://github.com/rollup/rollup/pull/3688): Include all relevant modules to generate reexports for implicit dependencies (@lukastaegert) ## 2.22.1 _2020-07-18_ ### Bug Fixes - Remove unused arguments when calling a conditional expression (#3680) ### Pull Requests - [#3680](https://github.com/rollup/rollup/pull/3680): Allow tree-shaking of arguments of functions that are returned by conditional expressions (@lukastaegert) ## 2.22.0 _2020-07-18_ ### Features - Allow resolving synthetic named exports via an arbitrary export name (#3657) - Display a warning when the user does not explicitly select an export mode and would generate a chunk with default export mode when targeting CommonJS (#3657) ### Pull Requests - [#3657](https://github.com/rollup/rollup/pull/3657): Add basic support for using a non-default export for syntheticNamedExports (@lukastaegert) - [#3659](https://github.com/rollup/rollup/pull/3659): Warn when implicitly using default export mode (@lukastaegert) ## 2.21.0 _2020-07-07_ ### Features - Allow plugins to disable tree-shaking for individual modules to ensure even empty modules are associated with chunks (#3663) ### Pull Requests - [#3663](https://github.com/rollup/rollup/pull/3663): Disable treeshaking per module (@lukastaegert) ## 2.20.0 _2020-07-06_ ### Features - Support using a function to generate different chunk and asset naming patterns per chunk or asset (#3658) - Add `referencedFiles` property to the chunk info in generateBundle to list referenced assets (#3661) ### Pull Requests - [#3658](https://github.com/rollup/rollup/pull/3658): Add ability to use a function that returns a pattern string in all places where you could use a pattern string before (@frank-dspeed) - [#3661](https://github.com/rollup/rollup/pull/3661): Add referenced files to bundle (@lukastaegert) ## 2.19.0 _2020-07-05_ ### Features - Allow plugins to return a Promise in the options hook (#3660) ### Pull Requests - [#3660](https://github.com/rollup/rollup/pull/3660): Make options hooks async (@TomerAberbach) ## 2.18.2 _2020-07-02_ ### Bug Fixes - Do not remove spread element args when the corresponding positional parameter is unused (#3652) ### Pull Requests - [#3652](https://github.com/rollup/rollup/pull/3652): Do not tree-shake arguments that contain a spread element (@lukastaegert) ## 2.18.1 _2020-06-26_ ### Bug Fixes - Make sure synthetic exports are present when a module is imported dynamically (#3648) - Strip the `rollup-plugin-` prefix off the plugin name when looking for the plugin export in a CLI plugin without a default export (#3647) - Convert plugin names with dashes to camel case when looking for the plugin export in a CLI plugin without a default export (#3647) ### Pull Requests - [#3647](https://github.com/rollup/rollup/pull/3647): Strip rollup-plugin prefix to find named plugin exports, throw when export cannot be found (@lukastaegert) - [#3648](https://github.com/rollup/rollup/pull/3648): Always create a dynamic namespace object when a module with synthetic named exports is imported dynamically (@lukastaegert) ## 2.18.0 _2020-06-22_ ### Features - `inlineDynamicImports`, `manualChunks` and `preserveModules` can now be used as output options (#3645) - Use sourcemaps for certain warnings that reference source code locations (#3645) ### Bug Fixes - `this.getFileName` will now always return the correct file name for chunks when multiple outputs are created (#3645) ### Pull Requests - [#3645](https://github.com/rollup/rollup/pull/3645): Per output chunking (@lukastaegert) ## 2.17.1 _2020-06-19_ ### Bug Fixes - Properly resolve accessing properties of namespace members again (#3643) ### Pull Requests - [#3643](https://github.com/rollup/rollup/pull/3643): Fix accessing nested properties of namespaces (@lukastaegert) ## 2.17.0 _2020-06-17_ ### Features - When importing Rollup via package.exports, always fall back to the browser ESM build for non-Node environments (#3634) - Create more efficient code when handling namespace mutations (#3637) ### Bug Fixes - Fix a severe performance regression when the same module is imported by a lot of modules (#3641) - Properly escape special characters in imports (#3638) ### Pull Requests - [#3634](https://github.com/rollup/rollup/pull/3634): Set browser build in exports (@guybedford) - [#3637](https://github.com/rollup/rollup/pull/3637): Do not include the whole namespace when illegally mutating a namespace (@lukastaegert) - [#3638](https://github.com/rollup/rollup/pull/3638): Support backslash escaping, retain exact newline escaping (@guybedford) - [#3641](https://github.com/rollup/rollup/pull/3641): Fix performance regression when a file is imported by many importers (@lukastaegert) ## 2.16.1 _2020-06-13_ ### Bug Fixes - Do not produce invalid code when an external or chunk id contain quotes or line-breaks (#3632) - Do not fail but emit a warning when mutating a namespace object (#3633) ### Pull Requests - [#3632](https://github.com/rollup/rollup/pull/3632): Handle single quote escaping in ids (@guybedford) - [#3633](https://github.com/rollup/rollup/pull/3633): Turn namespace assignment error into a warning (@guybedford) ## 2.16.0 _2020-06-12_ ### Features - Add support for numeric separators (#3626) - Switch to finalized ESTree optional chaining AST (#3628) ### Pull Requests - [#3626](https://github.com/rollup/rollup/pull/3626): Support numeric separator (@TrySound) - [#3628](https://github.com/rollup/rollup/pull/3628): Acorn 7.3.0 upgrade (@guybedford) - [#3631](https://github.com/rollup/rollup/pull/3631): Improve discoverability of `manualChunks` for code splitting (@zlamma) ## 2.15.0 _2020-06-08_ ### Features - Allow to skip watching some configs via `watch: false` (#3620) - Provide the resolved sourcemap path to `sourcemapPathTransform` (#3617) ### Pull Requests - [#3617](https://github.com/rollup/rollup/pull/3617): Update sourcemapPathTransform to also take the path to the sourcemap file as a second argument (@dgoldstein0) - [#3620](https://github.com/rollup/rollup/pull/3620): Rollup watch only one config in exported array (@luwol03) ## 2.14.0 _2020-06-07_ ### Features - Make `this.meta.watchMode` available for plugins to detect watch mode (#3616) ### Bug Fixes - Handle exporting the same binding with different names in SystemJS (#3575) ### Pull Requests - [#3575](https://github.com/rollup/rollup/pull/3575): Handle some cases of duplicate export bindings (@joeljeske) - [#3616](https://github.com/rollup/rollup/pull/3616): Make watch mode available in plugins (@lukastaegert) ## 2.13.1 _2020-06-04_ ### Bug Fixes - Prevent conflicts in SystemJS when `module` is used as a top-level variable (#3614) ### Pull Requests - [#3614](https://github.com/rollup/rollup/pull/3614): Handle system reserved identifier dedupes (@guybedford) ## 2.13.0 _2020-06-03_ ### Features - Allow to specify that an emitted chunk is only loaded after a given module has loaded to improve chunking (#3606) ### Pull Requests - [#3606](https://github.com/rollup/rollup/pull/3606): Enable specifying implicit dependencies when emitting chunks (@lukastaegert) ## 2.12.1 _2020-06-02_ ### Bug Fixes - Render valid imports when chunk names correspond to directory names in virtual setups (#3609) ### Pull Requests - [#3609](https://github.com/rollup/rollup/pull/3609): Handle imports from chunks with names that correspond to parent directory names of other chunks (@guybedford) ## 2.12.0 _2020-05-31_ ### Features - Add an option `--waitForBundleInput` to let the build wait until all entry point files are available before starting (#3577) ### Pull Requests - [#3577](https://github.com/rollup/rollup/pull/3577): Wait for bundle input option (@Heerschop) ## 2.11.2 _2020-05-28_ ### Bug Fixes - Include side-effects in the second argument of `Array.from` (#3604) ### Pull Requests - [#3604](https://github.com/rollup/rollup/pull/3604): Mark `Array.from` as side-effectful, use two-argument Array.from when mapping Sets (@lukastaegert) ## 2.11.1 _2020-05-28_ ### Bug Fixes - Also include side-effects in files that are marked as side-effect-free if they contain an included default export that is reexported (#3602) ### Pull Requests - [#3602](https://github.com/rollup/rollup/pull/3602): Handle side-effects next to side-effect-free default exports in case the default export is reexported (@lukastaegert) ## 2.11.0 _2020-05-27_ ### Features - Add basic support for optional chaining (#3582) - Provide a normalized set of options with proper default values to `buildStart` and `renderStart` (#3597) - Do not count adding properties to the prototype of an unused class as a side-effect (#3598) - Support providing `null` for empty setters in SystemJS via option (#3592) ### Bug Fixes - Do not fail when using a `/*#__PURE__*/` annotation inside a class field (#3599) - Allow using `--watch` and `--treeshake` together with sub-options such as `--watch.clearScreen` on the command line (#3597) ### Pull Requests - [#3582](https://github.com/rollup/rollup/pull/3582): Support optional chaining via acorn fork(@guybedford) - [#3592](https://github.com/rollup/rollup/pull/3592): System format optional setters(@guybedford) - [#3597](https://github.com/rollup/rollup/pull/3597): Provide normalized options (@lukastaegert) - [#3598](https://github.com/rollup/rollup/pull/3598): Treeshake prototype modifications in classes (@lukastaegert) - [#3599](https://github.com/rollup/rollup/pull/3599): Retain pure annotations in class fields (@lukastaegert) - [#3601](https://github.com/rollup/rollup/pull/3601): Fix white-space in docs (@tu4mo) ## 2.10.9 _2020-05-24_ ### Bug Fixes - Prevent invalid exports when facades are created (#3590) ### Pull Requests - [#3590](https://github.com/rollup/rollup/pull/3590): Prevent unneeded exports when entry facades are created and ensure all exported variables in facades are imported (@lukastaegert) ## 2.10.8 _2020-05-23_ ### Bug Fixes - Fix issues when synthetic named exports are reexported as default exports (#3586) ### Pull Requests - [#3584](https://github.com/rollup/rollup/pull/3584): Clarify documentation for `output.paths` (@jacksteamdev) - [#3585](https://github.com/rollup/rollup/pull/3585): Target Node.js v14 instead of v13 in Windows tests (@mangs) - [#3586](https://github.com/rollup/rollup/pull/3586): Handle default reexports of synthetic named exports over several stages (@lukastaegert) ## 2.10.7 _2020-05-22_ ### Bug Fixes - Handle modules re-exporting namespaces without further own code (#3576) ### Pull Requests - [#3576](https://github.com/rollup/rollup/pull/3576): Fix "cannot read exports of undefined" error (@guybedford) ## 2.10.6 _2020-05-22_ ### Bug Fixes - Fix some issues around class fields (#3580) - Prevent a maximum call stack error when a called entity references itself in its declaration (#3581) ### Pull Requests - [#3580](https://github.com/rollup/rollup/pull/3580): Update acorn class features (@guybedford) - [#3581](https://github.com/rollup/rollup/pull/3581): Do not fail when including call arguments of recursively defined variables (@lukastaegert) ## 2.10.5 _2020-05-19_ ### Bug Fixes - Do not remove side-effects that may influence an included default export declaration when side-effects are disabled (#3572) ### Pull Requests - [#3572](https://github.com/rollup/rollup/pull/3572): Observe side-effects in files containing a default export declaration that reexports a variable (@lukastaegert) ## 2.10.4 _2020-05-19_ ### Bug Fixes - Tree-shake unused classes with fields unless there are side-effects in the field declaration (#3569) ### Pull Requests - [#3569](https://github.com/rollup/rollup/pull/3569): Make sure unused classes with fields are tree-shaken if possible (@lukastaegert) ## 2.10.3 _2020-05-18_ ### Bug Fixes - Validate return value of sourcemapPathTransform option (#3561) ### Pull Requests - [#3561](https://github.com/rollup/rollup/pull/3561): Throw error if sourcemapPathTransform-option does not return a string (@Simonwep) ## 2.10.2 _2020-05-15_ ### Bug Fixes - Properly include calls to mutating array methods in certain scenarios (#3559) ### Pull Requests - [#3559](https://github.com/rollup/rollup/pull/3559): Make sure UnknownFooExpressions are included when referenced as return values in a MultiExpression (@lukastaegert) ## 2.10.1 _2020-05-15_ ### Bug Fixes - Do not throw when "undefined" is used as a default export (#3558) ### Pull Requests - [#3558](https://github.com/rollup/rollup/pull/3558): Properly handle default exporting undefined (@lukastaegert) ## 2.10.0 _2020-05-13_ ### Features - Avoid unnecessary empty imports from a facade chunk to the original chunk (#3552) - Pin facade creation order so that if several user-defined chunks reference the same module, the first always becomes the "actual" chunk while the later ones become facades (#3552) ### Bug Fixes - Do not omit reexports from secondary chunks when creating facades for entry points without hoisting transitive dependencies (#3552) ### Pull Requests - [#3552](https://github.com/rollup/rollup/pull/3552): Avoid unnecessary facade dependency inlining (@guybedford) ## 2.9.1 _2020-05-11_ ### Bug Fixes - Do not create unintended live-bindings or invalid reexports when reexporting global variables (#3550) ### Pull Requests - [#3550](https://github.com/rollup/rollup/pull/3550): Track updates of globals that are exported as default (@lukastaegert) ## 2.9.0 _2020-05-10_ ### Features - Add ids of static and dynamic imports to `this.getModuleInfo` (#3542) - Provide `getModuleInfo` and `getModuleIds` to `manualChunks` functions (#3542) - Add nullish coalescing support (#3548) - Make the rebuild delay in watch mode configurable and set the default to `0` for snappy rebuilds (#3502) - Add `this.getModuleIds` to the plugin context as future replacement for `this.moduleIds` (#3542) ### Pull Requests - [#3502](https://github.com/rollup/rollup/pull/3502): Configurable build delay (@mattdesl) - [#3542](https://github.com/rollup/rollup/pull/3542): Extend manualChunks API (@lukastaegert) - [#3548](https://github.com/rollup/rollup/pull/3548): Support nullish coalescing with tree-shaking (@lukastaegert) ## 2.8.2 _2020-05-07_ ### Bug Fixes - Avoid invalid code when simplifying the body of a shorthand arrow function expression (#3540) ### Pull Requests - [#3540](https://github.com/rollup/rollup/pull/3540): Wrap object expressions in parentheses if they become children of an arrow function expression (@lukastaegert) ## 2.8.1 _2020-05-07_ ### Bug Fixes - Allow using plugins on CLI that are exported as `exports.default` (#3529) - Do not fail side-effect detection in nested callbacks of builtins (#3539) ### Pull Requests - [#3529](https://github.com/rollup/rollup/pull/3529): Use default named export with plugins (@NotWoods) - [#3539](https://github.com/rollup/rollup/pull/3539): Track call side-effects both by entity and CallExpression to avoid untracked side-effects in nested calls (@lukastaegert) ## 2.8.0 _2020-05-06_ ### Features - When a dynamically imported chunk contains more exports than the imported module namespace, do not create a facade chunk but an inline namespace (#3535) ### Bug Fixes - Do not execute dynamically imported code before synchronous code in the importing module when generating CommonJS (#3535) ### Pull Requests - [#3535](https://github.com/rollup/rollup/pull/3535): Avoid dynamic facade chunks (@lukastaegert) ## 2.7.6 _2020-04-30_ ### Bug Fixes - Fix a type issue when a default export references a global variable (#3526) ### Pull Requests - [#3526](https://github.com/rollup/rollup/pull/3526): Handles default exporting global variables (@lukastaegert) ## 2.7.5 _2020-04-29_ ### Bug Fixes - Prevent infinite loop when default values of function parameters in a default export contain a slash (#3522) ### Pull Requests - [#3522](https://github.com/rollup/rollup/pull/3522): Avoid infinite loop when finding position for id insertion in default export (@lukastaegert) ## 2.7.4 _2020-04-29_ ### Bug Fixes - Fix an issue where wrong variable names were used when preserving modules (#3521) ### Pull Requests - [#3521](https://github.com/rollup/rollup/pull/3521): Fix and improve default export alias logic (@lukastaegert) ## 2.7.3 _2020-04-27_ ### Bug Fixes - Do not access `__proto__` when running Rollup (#3518) ### Pull Requests - [#3518](https://github.com/rollup/rollup/pull/3518): use acorn-class-fields and acorn-static-class-features from npm (@nitsky) ## 2.7.2 _2020-04-22_ ### Bug Fixes - Prevent an infinite loop when creating separate manual chunks with circular dependencies (#3510) - Do not fail if "super" is used in the definition of a class field (#3511) - Throw if a plugin tries to emit a file with an absolute Windows path (#3509) ### Pull Requests - [#3509](https://github.com/rollup/rollup/pull/3509): Ban emitFile via absolute paths on Windows OS (@SASUKE40) - [#3510](https://github.com/rollup/rollup/pull/3510): Do not fail for circular imports between manual chunks (@lukastaegert) - [#3511](https://github.com/rollup/rollup/pull/3511): Support "super" in class fields (@lukastaegert) ## 2.7.1 _2020-04-21_ ### Bug Fixes - Use correct path for dynamic imports if `output.paths` is used (#3508) ### Pull Requests - [#3508](https://github.com/rollup/rollup/pull/3508): Respect output.paths in dynamic imports (@lukastaegert) ## 2.7.0 _2020-04-21_ ### Features - Add `preserveEntrySignatures` option to control how exports of entry points are handled (#3498) - Add `preserveSignature` flag to `this.emitFile` to control exports of emitted chunks (#3498) - Add `output.minifyInternalExports` option to control if internal exports are minified (#3498) ### Pull Requests - [#3498](https://github.com/rollup/rollup/pull/3498): Add option to configure if entry signatures are preserved (@lukastaegert) ## 2.6.1 _2020-04-12_ ### Bug Fixes - Close watch mode when stdin closes in a non-TTY environment (#3493) ### Pull Requests - [#3493](https://github.com/rollup/rollup/pull/3493): Ensure --watch mode exits correctly when stdin is closed (@jakesgordon) ## 2.6.0 _2020-04-10_ ### Features - Allow regular expressions to declare external modules (#3482) ### Pull Requests - [#3482](https://github.com/rollup/rollup/pull/3482): Allow regular expressions in config.external (@johannes-z) ## 2.5.0 This version is identical to 2.4.0 ## 2.4.0 _2020-04-09_ ### Features - Add support for most private and public class field features (#3488) ### Bug Fixes - Do not replace `this` with `undefined` in class field definitions (#3488) ### Pull Requests - [#3488](https://github.com/rollup/rollup/pull/3488): Rollup class fields support (@guybedford and @lukastaegert) ## 2.3.5 _2020-04-09_ ### Bug Fixes - Never remove labels when tree-shaking is disabled (#3492) ### Pull Requests - [#3492](https://github.com/rollup/rollup/pull/3492): Always use a new inclusion context when including declarations of variables, always inlcude labels when not treeshaking (@lukastaegert) ## 2.3.4 _2020-04-07_ ### Bug Fixes - Handle re-exporting synthetic exports from entry-points (#3319) - Fix cross-chunk imports of synthetic exports (#3319) - Handle namespace objects that contain re-exported synthetic namespaces (#3319) ### Pull Requests - [#3319](https://github.com/rollup/rollup/pull/3319): Handle re-exports of synthetic named exports (@manucorporat and @lukastaegert) ## 2.3.3 _2020-04-04_ ### Bug Fixes - Add external namespaces to dynamic namespace objects (#3474) ### Pull Requests - [#3474](https://github.com/rollup/rollup/pull/3474): Support external star exports on namespace objects (@guybedford) ## 2.3.2 _2020-03-31_ ### Bug Fixes - Only warn but do not fail build when a namespace is called as a function (#3475) - Make sure pre-existing sourcemap comments are also removed when rebuilding using the cache (#3476) ### Pull Requests - [#3475](https://github.com/rollup/rollup/pull/3475): Call namespace error as a warning (@guybedford) - [#3476](https://github.com/rollup/rollup/pull/3476): Store locations for removed comments in cache (@lukastaegert) ## 2.3.1 _2020-03-30_ ### Bug Fixes - Do not fail if the config file returns an function returning a Promise (#3472) ### Pull Requests - [#3472](https://github.com/rollup/rollup/pull/3472): Fix support for async functions as config (@lukastaegert) ## 2.3.0 _2020-03-29_ ### Features - Do not transpile config files with `.mjs` extension in Node 13+ or `.cjs` extension in any Node version and load them appropriately (#3445) - Extract helper to load a config file the way rollup does it via `rollup/dist/loadConfigFile` (#3445) ### Bug Fixes - Keep watching the config file if an error occurs during initial load in watch node (#3445) - Add a helpful error message when using a transpiled config in a repository with "type": "module" (#3445) ### Pull Requests - [#3445](https://github.com/rollup/rollup/pull/3445): Support native ESM configs in Node 13, support untranspiled configs (@lukastaegert) - [#3468](https://github.com/rollup/rollup/pull/3468): Don't use esm output format alias in the documentation (@vsn4ik) ## 2.2.0 _2020-03-24_ ### Features - Add `renderDynamicImport` hook to rewrite dynamic import expressions (#3449) - Add information about dynamically imported modules to `this.getModuleInfo` (#3449) ### Bug Fixes - Make file emission work with Uin8Array sources when using Rollup in the browser (#3452) - Fix types to allow watch to accept an array of configs (#3453) - Do not strip `.js` extensions from AMD imports when the import is a user-supplied replacement for a non-resolvable dynamic import target (#3453) ### Pull Requests - [#3449](https://github.com/rollup/rollup/pull/3449): Add hook to rewrite dynamic import expressions (@lukastaegert) - [#3452](https://github.com/rollup/rollup/pull/3452): Avoid the assumption of Buffer in browser envs (@JoviDeCroock) - [#3453](https://github.com/rollup/rollup/pull/3453): fix types since watch accepts single or array config (@lukeed) - [#3456](https://github.com/rollup/rollup/pull/3456): fix SystemJS url in tutorial (@guybedford) ## 2.1.0 _2020-03-18_ ### Features - Allow specifying an importer when emitting files to resolve relative ids (#3442) ### Pull Requests - [#3442](https://github.com/rollup/rollup/pull/3442): Add optional `importer` parameter to `this.emitFile` (@lukastaegert) ## 2.0.6 _2020-03-13_ ### Bug Fixes - Do not use file names from different outputs when generating sourcemaps using the `dir` option (#3440) ### Pull Requests - [#3440](https://github.com/rollup/rollup/pull/3440): Use correct file names when writing sourcemaps for multiple outputs (@lukastaegert) ## 2.0.5 _2020-03-12_ ### Bug Fixes - Fix an issue where conditional statements would assume they have the wrong test value (#3438) ### Pull Requests - [#3438](https://github.com/rollup/rollup/pull/3438): Make sure logical expressions always check the left argument for side-effects (@lukastaegert) ## 2.0.4 _2020-03-12_ ### Bug Fixes - Avoid conflicts between namespace imports when preserving modules (#3435) ### Pull Requests - [#3435](https://github.com/rollup/rollup/pull/3435): Deconflict multiple `index` imports for ES format using nested export star statements (@kamranayub) ## 2.0.3 _2020-03-10_ ### Bug Fixes - Add type for this.getCombinedSourcemap to transform context (#3431) ### Pull Requests - [#3377](https://github.com/rollup/rollup/pull/3377): Switch to yargs-parser lib (@jamesgeorge007) - [#3426](https://github.com/rollup/rollup/pull/3426): Use strict types with PluginDriver (@NotWoods) - [#3431](https://github.com/rollup/rollup/pull/3431): Add missing type declaration for getCombinedSourcemap (@Anidetrix) - [#3432](https://github.com/rollup/rollup/pull/3432): Detail how return values from `augmentChunkHash` are used (@jakearchibald) ## 2.0.2 _2020-03-07_ ### Bug Fixes - Make sure the ESM import still works (#3430) ### Pull Requests - [#3430](https://github.com/rollup/rollup/pull/3430): Fix conditional exports again (@lukastaegert) ## 2.0.1 _2020-03-07_ ### Bug Fixes - Reenable importing rollup in Node 13.0 - 13.7 (#3428) ### Pull Requests - [#3428](https://github.com/rollup/rollup/pull/3428): Fix conditional exports in Node 13.0 - 13.7 (@lukastaegert) ## 2.0.0 _2020-03-06_ ### Breaking Changes - Rollup now requires at least Node 10 to run, or a sufficiently modern browser (#3346) - The file structure of Rollup's ESM builds has changed: - The main ESM entry point is now at `rollup/dist/es/rollup.js` instead of `rollup/dist/rollup.es.js` - The ESM browser build is at `rollup/dist/es/rollup.browser.js` instead of `rollup/dist/rollup.browser.es.js` In general, the ESM builds now follow the same naming scheme as the CJS builds but are located in the `rollup/dist/es` subfolder instead of `rollup/dist` (#3391) - The "watch.chokidar" option no longer accepts a `boolean` value but only an object of parameters that is passed to the bundled Chokidar instance. Chokidar installations by the user will be ignored in favour of the bundled instance (#3331) - Modules that are completely tree-shaken will no longer be listed as part of any chunks in `generateBundle` - The `experimentalOptimizeChunks` and `chunkGroupingSize` options have been removed - [acorn](https://github.com/acornjs/acorn) plugins can only be used if they accept a passed-in acorn instance instead of importing it themselves. See https://github.com/acornjs/acorn/pull/870#issuecomment-527339830 for what needs to be done to make plugins compatible that do not support this yet (#3391) - Emitted chunks now have the TypeScript type `Uint8Array` instead of `Buffer`. A `Buffer` can still be used, though (#3395) - The TypeScript types no longer use ESTree types for AST nodes but a very generic type that does not contain information specific to certain node types (#3395) - The signature of the `writeBundle` plugin hook has been changed to match `generateBundle`: The bundle object is now passed as second parameter instead of first and the first parameter is the output options (#3361) - The following plugin hooks have been removed: - ongenerate: use `generateBundle` instead - onwrite: use `writeBundle` instead - transformBundle: use `renderChunk` instead - transformChunk: use `renderChunk` instead - You can no longer access `this.watcher` on the plugin context. - The `transform` hook can no longer return `dependencies`. - The `treeshake.pureExternalModules` option will now show a deprecation warning when used: use `treeshake.moduleSideEffects: 'no-external'` instead - Using `import.meta.ROLLUP_ASSET_URL_<..>` and `import.meta.ROLLUP_CHUNK_URL_<..>` in code will now show warnings: use `import.meta.ROLLUP_FILE_URL_<..>` instead - The `resolveAssetUrl` hook will now show a deprecation warning when used: use `resolveFileUrl` instead - The following plugin context functions will show warnings when used: - `this.emitAsset`: use `this.emitFile` - `this.emitChunk`: use `this.emitFile` - `this.getAssetFileName`: use `this.getFileName` - `this.getChunkFileName`: use `this.getFileName` - `this.isExternal`: use `this.resolve` - `this.resolveId`: use `this.resolve` - Directly adding properties to the bundle object in the `generateBundle` is deprecated will show a warning (removing properties is allowed, though): Use `this.emitFile` - Accessing `chunk.isAsset` on the bundle is deprecated: Use `chunk.type === 'asset'` instead - The error code for a missing `name` property when targeting UMD has been changed to `MISSING_NAME_OPTION_FOR_IIFE_EXPORT` to emphasize this is needed for the IIFE part of UMD (#3393) ### Features - Rollup now bundles [Chokidar](https://github.com/paulmillr/chokidar) for a better watch experience (#3331) - Rollup now bundles [acorn](https://github.com/acornjs/acorn) again, removing its only external dependency (#3391) - Do not consider empty imports from side-effect-free modules for chunking and hoist side-effect imports if necessary (#3369) - Rollup can now be imported as an ES module in Node via `import {rollup} from 'rollup'`. Note that this relies on Node's experimental [conditional package exports](https://nodejs.org/dist/latest-v13.x/docs/api/esm.html#esm_conditional_exports) feature and is therefore itself experimental (#3391) - `systemjs` can be used as format alias for `system` (#3381) ### Bug Fixes - Unknown output options now trigger a warning when using the JavaScript API (#3352) - Rollup will no longer introduce Node types into TypeScript projects that do not use them (#3395) - Generate correct sourcemaps when tree-shaking occurs in a multi-file bundle (#3423) ### Pull Requests - [#3331](https://github.com/rollup/rollup/pull/3331): Bundle Chokidar (@lukastaegert) - [#3343](https://github.com/rollup/rollup/pull/3343): Remove experimentalOptimizeChunks (@lukastaegert) - [#3346](https://github.com/rollup/rollup/pull/3346): Update minimum required Node version to 10 (@lukastaegert) - [#3352](https://github.com/rollup/rollup/pull/3352): Remove active deprecations (@lukastaegert) - [#3361](https://github.com/rollup/rollup/pull/3361): Change writeBundle signature to match generateBundle (@lukastaegert) - [#3369](https://github.com/rollup/rollup/pull/3369): Avoid empty imports from side-effect-free chunks (@lukastaegert) - [#3381](https://github.com/rollup/rollup/pull/3381): Rename esm to es everywhere, add systemjs alias (@lukastaegert) - [#3391](https://github.com/rollup/rollup/pull/3391): Bundle acorn, allow importing Rollup as Node ES module, update dependencies (@lukastaegert) - [#3393](https://github.com/rollup/rollup/pull/3393): Better error code for name-less umd bundle (@rail44) - [#3395](https://github.com/rollup/rollup/pull/3395): Remove `@types` dependencies (@lukastaegert) - [#3423](https://github.com/rollup/rollup/pull/3423): Update magic-string and fix sourcemaps (@lukastaegert) ## 1.32.1 _2020-03-06_ ### Bug Fixes - Handle default export detection for AMD and IIFE externals that do not have a prototype (#3420) - Handle missing whitespace when the else branch of an if-statement is simplified (#3421) - Mention the importing module when reporting errors for missing named exports (#3401) - Add code to warning for missing output.name of IIFE bundles (#3372) ### Pull Requests - [#3372](https://github.com/rollup/rollup/pull/3372): Add warning code for missing output.name of IIFE bundle that has export (@rail44) - [#3401](https://github.com/rollup/rollup/pull/3401): Missing exports errors now print the importing module (@timiyay) - [#3418](https://github.com/rollup/rollup/pull/3418): Structure lifecycle hooks, add links to build time hooks (@lukastaegert) - [#3420](https://github.com/rollup/rollup/pull/3420): Update generated code of getInteropBlock() to work with null prototype objects (@jdalton) - [#3421](https://github.com/rollup/rollup/pull/3421): Avoid invalid code when "else" branch is simplified (@lukastaegert) ## 1.32.0 _2020-02-28_ ### Features - Allow adding plugins on the command line via `--plugin ` (#3379) ### Pull Requests - [#3379](https://github.com/rollup/rollup/pull/3379): introduce CLI --plugin support (@kzc) - [#3390](https://github.com/rollup/rollup/pull/3390): fix typo: this.addWatchfile (@mistlog) - [#3392](https://github.com/rollup/rollup/pull/3392): Bump codecov from 3.6.1 to 3.6.5 - [#3404](https://github.com/rollup/rollup/pull/3404): Update resolveFileUrl docs (@jakearchibald) ## 1.31.1 _2020-02-14_ ### Bug Fixes - Make sure errored files are always re-evaluated in watch mode to avoid an issue in the typescript plugin (#3388) ### Pull Requests - [#3366](https://github.com/rollup/rollup/pull/3366): Correct spelling minifaction to minification (@VictorHom) - [#3371](https://github.com/rollup/rollup/pull/3371): Adjust bug template to mention REPL.it (@lukastaegert) - [#3388](https://github.com/rollup/rollup/pull/3388): Run transform hooks again in watch mode on files that errored (@lukastaegert) ## 1.31.0 _2020-01-31_ ### Features - Always disable tree-shaking for asm.js functions to maintain semantics (#3362) ### Pull Requests - [#3362](https://github.com/rollup/rollup/pull/3362): Preserve asm.js code (@lukastaegert) ## 1.30.1 _2020-01-27_ ### Bug Fixes - Do not mistreat static entgry points as dynamic ones when chunking (#3357) - Resolve a crash when chunking circular dynamic imports (#3357) ### Pull Requests - [#3357](https://github.com/rollup/rollup/pull/3357): Resolve issues with circular dynamic entries (@lukastaegert) ## 1.30.0 _2020-01-27_ ### Features - Do not split chunks when dynamically imported modules import modules that are already loaded by all dynamic importers (#3354) - Add `hoistTransitiveImports` option to disable hoisting imports of static dependencies into entry chunks (#3353) ### Bug Fixes - Make sure polyfills are always loaded first when each static entry point contains them as first import (#3354) ### Pull Requests - [#3353](https://github.com/rollup/rollup/pull/3353): Add option to avoid hoisting transitive imports (@lukastaegert) - [#3354](https://github.com/rollup/rollup/pull/3354): Improve chunking algorithm for dynamic imports (@tjenkinson and @lukastaegert) ## 1.29.1 _2020-01-21_ ### Bug Fixes - Avoid crashes for circular reexports when named exports cannot be found (#3350) ### Pull Requests - [#3335](https://github.com/rollup/rollup/pull/3335): Fix typo (@robbinworks) - [#3342](https://github.com/rollup/rollup/pull/3342): Remove ":" from test file names for Windows and update dependencies (@lukastaegert) - [#3350](https://github.com/rollup/rollup/pull/3350): Properly handle circular reexports (@lukastaegert) ## 1.29.0 _2020-01-08_ ### Features - Enable top-level await by default (#3089) - Add typings for watch events (#3302) ### Bug Fixes - Deconflict files that would conflict only on a case-insensitive OS (#3317) - Do not fail in certain scenarios where a logical expression inside a sequence expression was being directly included (#3327) ### Pull Requests - [#3089](https://github.com/rollup/rollup/pull/3089): Move top-level await out of experimental (@guybedford) - [#3302](https://github.com/rollup/rollup/pull/3302): Adds type definitions for RollupWatcher events (@NotWoods) - [#3317](https://github.com/rollup/rollup/pull/3317): Fix module id conflict on a case insensitive OS (@yesmeck) - [#3327](https://github.com/rollup/rollup/pull/3327): Handle deoptimizations while a node is being included (@lukastaegert) ## 1.28.0 _2020-01-04_ ### Features - Allow piping in stdin via the command line interface (#3312, #3290) - Allow plugins to mark modules as having syntheticNamedExports for e.g. better CJS interoperability (#3295) - Ignore variable reassignments in dead code when tree-shaking to remove more unneeded code (#3212) ### Bug Fixes - Properly respect tree-shaken code when generating sourcemaps (#3318) ### Pull Requests - [#3212](https://github.com/rollup/rollup/pull/3212): Handle assignments in dead code (@tjenkinson) - [#3290](https://github.com/rollup/rollup/pull/3290): Implement stdin input with optional "-" as the file name (@kzc) - [#3295](https://github.com/rollup/rollup/pull/3295): Add syntheticNamedExports (@manucorporat) - [#3300](https://github.com/rollup/rollup/pull/3300): Add note about setting `types` in tsconfig file (@tjenkinson) - [#3303](https://github.com/rollup/rollup/pull/3303): Use ! to assert not-null in TypeScript (@NotWoods) - [#3312](https://github.com/rollup/rollup/pull/3312): Implement stdin input (@lukastaegert) - [#3318](https://github.com/rollup/rollup/pull/3318): Update magic-string and other dependencies (@lukastaegert) ## 1.27.14 _2019-12-22_ ### Bug Fixes - Update references to official rollup plugins in error messages (#3297, #3298) ### Pull Requests - [#3286](https://github.com/rollup/rollup/pull/3286): Update link to JavaScript API documentation (@romankaravia) - [#3294](https://github.com/rollup/rollup/pull/3294): Update deprecated references to the node-resolve plugin in the documentation (@Vlad-Shcherbina) - [#3297](https://github.com/rollup/rollup/pull/3297): Update references to rollup-plugin-json (@cprecioso) - [#3298](https://github.com/rollup/rollup/pull/3298): Update references to official rollup plugins (@cprecioso) ## 1.27.13 _2019-12-14_ ### Bug Fixes - Do not truncate environment variable values at the first colon when using the `--environment` option (#3283) ### Pull Requests - [#3283](https://github.com/rollup/rollup/pull/3283): Allow environment variables to contain colons (@tlaverdure) ## 1.27.12 _2019-12-13_ ### Bug Fixes - Prevent invalid AMD or SystemJS code when accessing `import.meta` (#3282) ### Pull Requests - [#3282](https://github.com/rollup/rollup/pull/3282): Always make "module" available for SystemJS and AMD formats if `import.meta` is accessed directly (@lukastaegert) ## 1.27.11 _2019-12-12_ ### Bug Fixes - Resolve a crash due to an infinite loop (#3280) ### Pull Requests - [#3280](https://github.com/rollup/rollup/pull/3280): Prevent infinite deoptimizations (@lukastaegert) ## 1.27.10 _2019-12-11_ ### Bug Fixes - Keep track of function return values in more situations (#3278) ### Pull Requests - [#3278](https://github.com/rollup/rollup/pull/3278): Avoid some unnecessary value tracking deoptimizations (@lukastaegert) ## 1.27.9 _2019-12-07_ ### Bug Fixes - Fix an issue where reexports could be missing when preserving modules (#3273) - Allow turning of color output via NO_COLOR or FORCE_COLOR=0 environment variables (#3272) ### Pull Requests - [#3272](https://github.com/rollup/rollup/pull/3272): Support either NO_COLOR or FORCE_COLOR=0 to turn off color (@kikonen) - [#3273](https://github.com/rollup/rollup/pull/3273): Make sure that indirectly reexported modules also become chunk dependencies when preserving modules(@lukastaegert) ## 1.27.8 _2019-12-02_ ### Bug Fixes - Deoptimize objects when a method is called on them to make sure modifications via "this" are observed (#3266) ### Pull Requests - [#3266](https://github.com/rollup/rollup/pull/3266): Workaround for various object literal mutation bugs (@kzc) ## 1.27.7 _2019-12-01_ ### Bug Fixes - Fix a scenario where a reassignments to computed properties were not tracked (#3267) ### Pull Requests - [#3267](https://github.com/rollup/rollup/pull/3267): Fix incomplete computed property deoptimization (@lukastaegert) ## 1.27.6 _2019-11-30_ ### Bug Fixes - Use "auto" export mode by default for all modules when preserving modules (#3265) - Observe "output.exports" when preserving modules and warn for mixed exports if necessary (#3265) ### Pull Requests - [#3265](https://github.com/rollup/rollup/pull/3265): Use export mode "auto" by default when preserving modules (@lukastaegert) ## 1.27.5 _2019-11-25_ ### Bug Fixes - Make sure namespaces for inlined dynamic imports are treated as variable accesses when deconflicting (#3256) ### Pull Requests - [#3256](https://github.com/rollup/rollup/pull/3256): Avoid name conflicts when inlining dynamic imports nested in functions (@lukastaegert) - [#3257](https://github.com/rollup/rollup/pull/3257): Update dependencies (@lukastaegert) ## 1.27.4 _2019-11-22_ ### Bug Fixes - Aggregate circular dependency warnings in the CLI (#3249) - Do not defer non-aggregated handlers in the CLI (#3249) ### Pull Requests - [#3249](https://github.com/rollup/rollup/pull/3249): Fix broken Windows CLI tests (@lukastaegert) - [#3251](https://github.com/rollup/rollup/pull/3251): Add installation as a separate header (@ashrith-kulai) ## 1.27.3 _2019-11-20_ ### Bug Fixes - Provide better warning when empty chunks are created in a code-splitting scenario (#3244) ### Pull Requests - [#3244](https://github.com/rollup/rollup/pull/3244): Clearer empty chunk warning (@tjenkinson) ## 1.27.2 _2019-11-18_ ### Bug Fixes - Fix an issue where live bindings were not working correctly when using `+=` in SystemJS (#3242) ### Pull Requests - [#3242](https://github.com/rollup/rollup/pull/3242): Export updated assignments when using shorthand update assignment expressions in SystemJS (@lukastaegert) ## 1.27.1 _2019-11-18_ ### Bug Fixes - Fix an issue where code after a switch-statement with removed cases was erroneously not included (#3241) ### Pull Requests - [#3237](https://github.com/rollup/rollup/pull/3237): make `acornOptions` optional in `parse()` in docs (@tjenkinson) - [#3240](https://github.com/rollup/rollup/pull/3240): Update dependencies and fix vulnerability (@lukastaegert) - [#3241](https://github.com/rollup/rollup/pull/3241): Do not truncate after switch-statement with removed case (@lukastaegert) ## 1.27.0 _2019-11-12_ ### Features - Add support for output-specific plugins (#3218) - Reenable parallel output processing when using the CLI (#3218) - Warn if files are emitted that would overwrite previously emitted files (#3218) ### Bug Fixes - Do not overwrite files emitted in other builds if outputs are generated in parallel (#3218) ### Pull Requests - [#3218](https://github.com/rollup/rollup/pull/3218): Per output plugins (@lukastaegert) ## 1.26.5 _2019-11-11_ ### Bug Fixes - Fix a regression where it was no longer to pass a certain option format to generate (#3223) ### Pull Requests - [#3223](https://github.com/rollup/rollup/pull/3223): Allow passing input options to output (@lukastaegert) ## 1.26.4 _2019-11-09_ ### Bug Fixes - Keep watching known files after a plugin error during the initial build (#3219) ### Pull Requests - [#3216](https://github.com/rollup/rollup/pull/3216): Fix small typo (@kaisermann) - [#3217](https://github.com/rollup/rollup/pull/3217): Update dependencies and fix security vulnerability (@lukastaegert) - [#3219](https://github.com/rollup/rollup/pull/3219): Also recover from plugin errors during the initial build (@lukastaegert) ## 1.26.3 _2019-11-02_ ### Bug Fixes - Work around an incompatibility with rollup-plugin-dts (#3211) ### Pull Requests - [#3211](https://github.com/rollup/rollup/pull/3211): Do no fail if the source attribute is `undefined` in an unused named export (@lukastaegert) ## 1.26.2 _2019-10-31_ ### Bug Fixes - Do not create invalid code when using `treeshake: false` and star re-exports (#3209) ### Pull Requests - [#3209](https://github.com/rollup/rollup/pull/3209): Also remove export-all declarations when not tree-shaking (@lukastaegert) ## 1.26.1 _2019-10-31_ ### Bug Fixes - Prevent an issue where outputs would overwrite files emitted by other outputs (#3201) - Do not throw an error if the config file does not have a .js extension (#3204) ### Pull Requests - [#3201](https://github.com/rollup/rollup/pull/3201): Make the CLI run generate/output in serial (@marijnh) - [#3204](https://github.com/rollup/rollup/pull/3204): support all config file extensions (.js,.mjs,...) (@arlac77) ## 1.26.0 _2019-10-27_ ### Features - Only warn when no output is provided for an IIFE bundle but still produce valid code (#3181) - Support reexporting namespaces as a binding (#3193) - Switch from hash.js to crypto for hashing in the Node build for better performance and support for very large assets (#3194) ### Bug Fixes - Correctly handle chunks reexporting the same namespace as two different bindings (#3193) ### Pull Requests - [#3181](https://github.com/rollup/rollup/pull/3181): Remove the need to provide an output name for IIFE bundles (@bterrier) - [#3193](https://github.com/rollup/rollup/pull/3193): Add support for "export \* as name from …" (@lukastaegert) - [#3194](https://github.com/rollup/rollup/pull/3194): Add support for large assets (> 100 MB) (@SebastianNiemann) ## 1.25.2 _2019-10-23_ ### Bug Fixes - Improve performance of bundled UMD code by adding additional parentheses to enforce eager parsing (#3183) - Improve types to tolerate passing a Rollup config with multiple outputs to `rollup.rollup` (#3184) ### Pull Requests - [#3183](https://github.com/rollup/rollup/pull/3183): Add parentheses to factory function of UMD bundles (@ajihyf) - [#3184](https://github.com/rollup/rollup/pull/3184): RollupOptions accept output as array (@imcotton) ## 1.25.1 _2019-10-20_ ### Bug Fixes - Handle a situation where code was not included after a switch statement (#3178) - Handle a situation where code was not included after a do-while loop (#3180) - Do not fail if different outputs emit the same file (#3175) - Give access to the original acorn error for parse errors (#3176) ### Pull Requests - [#3175](https://github.com/rollup/rollup/pull/3175): Disable errors for duplicate emitted file names (@marijnh) - [#3176](https://github.com/rollup/rollup/pull/3176): Add original parser error to rollup error; Update tests (@gribnoysup) - [#3178](https://github.com/rollup/rollup/pull/3178): Fix switch case not being included correctly (@lukastaegert) - [#3179](https://github.com/rollup/rollup/pull/3179): Update dependencies (@lukastaegert) - [#3180](https://github.com/rollup/rollup/pull/3180): Handle conditional breaks in do-while loops with unconditional return (@lukastaegert) ## 1.25.0 _2019-10-18_ ### Features - Remove try-catch if there is no side-effect in the try-block (#3166) - Omit side-effect-free trailing cases in switch-statements (#3166) - Remove unused labels (#3170) ### Bug Fixes - Do not remove code after labeled statements that contain a throw or return if the label is used (#3170) - Prevent invalid code when expressions are simplified that do not follow a white-space character (#3173) - Do not remove continue statements inside switch statements (#3166) - Prevent trailing empty lines when tree-shaking inside switch statements (#3166) ### Pull Requests - [#3166](https://github.com/rollup/rollup/pull/3166): Better try statement tree shaking (@lukastaegert) - [#3170](https://github.com/rollup/rollup/pull/3170): Handle optional control flow in labeled statements, remove unused labels (@lukastaegert) - [#3173](https://github.com/rollup/rollup/pull/3173): Add missing spaces in certain statements and expressions to avoid invalid code (@lukastaegert) ## 1.24.0 _2019-10-15_ ### Features - Respect `break`, `continue`, `return` and `throw` when tree-shaking to detect dead code (#3153) - Do treat treat hoisted function declarations as "unknown" when checking for call side-effects (#3153) ### Bug Fixes - Make sure that unknown `import.meta` properties produce valid code in SystemJS (#3152) - Make sure `treeshake.annotations: false` is respected for class instantiation (#3153) - Check property access side-effects for class instantiation (#3153) - Do not suppress break statements inside labeled statements (#3153) ### Pull Requests - [#3152](https://github.com/rollup/rollup/pull/3152): Allow import.meta.\* for systemjs format (@dmail) - [#3153](https://github.com/rollup/rollup/pull/3153): Get rid of immutable.js and implement tree-shaking for broken control flow (@lukastaegert) ## 1.23.1 _2019-10-05_ ### Bug Fixes - Fix a regression where the node types had a specific minimal version (#3143) ### Pull Requests - [#3143](https://github.com/rollup/rollup/pull/3143): Ensure that types packages have star version ranges (@lukastaegert) ## 1.23.0 _2019-10-03_ ### Features - Add placeholders for extensions when preserving modules (#3116) ### Pull Requests - [#3116](https://github.com/rollup/rollup/pull/3116): Include extensions in preserveModules output filenames for scriptified assets (@Andarist) - [#3142](https://github.com/rollup/rollup/pull/3142): Fix typo (@tu4mo) ## 1.22.0 _2019-09-29_ ### Features - Add a new "hidden" sourcemap type that generates the map files but omits the sourcemap comment (#3120) - Generate more efficient code when using `namespaceToStringTag: true` (#3135) - Make sure namespace objects do not have a prototype (#3136) ### Bug Fixes - Do not ignore side-effectful iterators by always preserving for..of loops for now (#3132) - Make sure `--context` is observed as a CLI option (#3134) - Do not require specific versions for @types dependencies (#3131) ### Pull Requests - [#3120](https://github.com/rollup/rollup/pull/3120): Generate sourcemaps but omit the comment (@rohitmohan96) - [#3131](https://github.com/rollup/rollup/pull/3131): Use asterisk for @types/\* dependencies (@frenzzy) - [#3132](https://github.com/rollup/rollup/pull/3132): Preserve empty for...of loops (@imatlopez) - [#3133](https://github.com/rollup/rollup/pull/3133): Update dependencies (@lukastaegert) - [#3134](https://github.com/rollup/rollup/pull/3134): Wire up --context CLI flag (@tchetwin) - [#3135](https://github.com/rollup/rollup/pull/3135): Remove Symbol polyfill in module namespaces (@mkubilayk) - [#3136](https://github.com/rollup/rollup/pull/3136): Set null prototype on namespace objects (@rpamely) ## 1.21.4 _2019-09-16_ ### Bug Fixes - Recognize common browser globals (#3117) - Do not treat "typeof " as a side-effect (#3117) ### Pull Requests - [#3117](https://github.com/rollup/rollup/pull/3117): Add browser globals to known globals and prevent "typeof" side-effects (@lukastaegert) ## 1.21.3 _2019-09-14_ ### Bug Fixes - Fix a regression where modifying a watched file did not trigger a rebuild (#3112) ### Pull Requests - [#3112](https://github.com/rollup/rollup/pull/3112): Fix .addWatchFile() dependencies failing to invalidate in watch mode (@tivac) ## 1.21.2 _2019-09-09_ ### Bug Fixes - Fix wrong deprecation message to direct to `this.emitFile` instead of `this.emitAsset` ## 1.21.1 _2019-09-09_ ### Bug Fixes - Allow legacy plugins to still add assets directly to the bundle object (#3105) ### Pull Requests - [#3105](https://github.com/rollup/rollup/pull/3105): Allow legacy plugins to still add assets directly to the bundle object (@lukastaegert) ## 1.21.0 _2019-09-08_ ### Features - Respect `output.entryFileNames` when preserving modules (#3088) - Make accessing unknown globals a side-effect unless this is deactivated via `treeshake.unknownGlobalSideEffects` (#3068) - Respect global objects when checking for pure global functions (#3068) - Introduce a `type` to more easily distinguish chunks and assets in the output bundle (#3080) ### Bug Fixes - Recover in watch mode when the initial build fails (#3081) - Make sure `output.strict` is respected for SystemJS output (#3101) ### Pull Requests - [#3068](https://github.com/rollup/rollup/pull/3068): Make accessing unknown globals a side-effect (@lukastaegert) - [#3080](https://github.com/rollup/rollup/pull/3080): OutputBundle Tagged union with 'type = chunk|asset' (@askbeka) - [#3081](https://github.com/rollup/rollup/pull/3081): Watch files onbuild, even if build fails (@mhkeller) - [#3088](https://github.com/rollup/rollup/pull/3088): Add support for entryFileNames pattern used in combination with preserveModules option (@Andarist) - [#3101](https://github.com/rollup/rollup/pull/3101): Remove 'use strict'; from systemjs when strict=false (@askbeka) ## 1.20.3 _2019-08-28_ ### Bug Fixes - Make sure file hashes change when a change of the naming pattern leads to a file name change of a dependency (#3083) - Fix several issues where reexporting an external "default" export could lead to invalid or incorrect code (#3084) ### Pull Requests - [#3078](https://github.com/rollup/rollup/pull/3078): Add github actions workflow config for windows (@shellscape) - [#3083](https://github.com/rollup/rollup/pull/3083): Properly reflect dependency file names in hash (@lukastaegert) - [#3084](https://github.com/rollup/rollup/pull/3084): Fix "default" reexport issues in non ESM/System formats (@lukastaegert) ## 1.20.2 _2019-08-25_ ### Bug Fixes - Avoid an issue where circular namespace reexports would crash Rollup (#3074) ### Pull Requests - [#3077](https://github.com/rollup/rollup/pull/3077): Handle namespaces that reexport themselves (@lukastaegert) ## 1.20.1 _2019-08-22_ ### Bug Fixes - Fix an issue where variable names inside dynamic import expressions were not rendered correctly (#3073) - Fix type definition to allow a single watcher config as well as an array (#3074) ### Pull Requests - [#3073](https://github.com/rollup/rollup/pull/3073): Fix wrong variable name in import expression (@lukastaegert) - [#3074](https://github.com/rollup/rollup/pull/3074): Fixes type definition on watch and Watcher constructor (@MicahZoltu) ## 1.20.0 _2019-08-21_ ### Features - Add augmentChunkHash plugin hook to be able to reflect changes in renderChunk in the chunk hash (#2921) ### Bug Fixes - Do not mutate the acorn options object (#3051) - Make sure the order of emitted chunks always reflects the order in which they were emitted (#3055) - Do not hang when there are strings containing comment-like syntax in some scenarios (#3069) ### Pull Requests - [#2921](https://github.com/rollup/rollup/pull/2921): Add augmentChunkHash plugin hook (@isidrok) - [#2995](https://github.com/rollup/rollup/pull/2995): Add info on installing locally to docs (@mesqueeb) - [#3037](https://github.com/rollup/rollup/pull/3037): Refresh pull request labels (@shellscape) - [#3048](https://github.com/rollup/rollup/pull/3048): Document ROLLUP_WATCH environment variable (@shellscape) - [#3051](https://github.com/rollup/rollup/pull/3051): Avoid changes to the original options (.acorn) object (@LongTengDao) - [#3052](https://github.com/rollup/rollup/pull/3052): Minor refactoring: Remove one try-catch (@KSXGitHub) - [#3053](https://github.com/rollup/rollup/pull/3053): Refactor to use async-await in more places (@KSXGitHub) - [#3055](https://github.com/rollup/rollup/pull/3055): Provide consistent chunking via a consistent order of entry modules when emitting chunks (@lukastaegert) - [#3058](https://github.com/rollup/rollup/pull/3058): Remove acorn-bigint and acorn-dynamic-import from bundle (@LongTengDao) - [#3061](https://github.com/rollup/rollup/pull/3061): Update to acorn@7 (@lukastaegert) - [#3063](https://github.com/rollup/rollup/pull/3063): Auto-generate license file (@lukastaegert) - [#3069](https://github.com/rollup/rollup/pull/3069): Prevent infinite loop when scanning for line-breaks and there are comment-like strings (@lukastaegert) ## 1.19.4 _2019-08-07_ ### Bug Fixes - Prevent invalid code when exporting an external namespace (#3034) - Prevent invalid or non-equivalent code when simplifying expressions in return and throw statements (#3035) ### Pull Requests - [#3034](https://github.com/rollup/rollup/pull/3034): Avoid generating .\* as export (@LongTengDao) - [#3035](https://github.com/rollup/rollup/pull/3035): Prevent ASI errors for conditional expressions (@lukastaegert) - [#3036](https://github.com/rollup/rollup/pull/3036): Fix documents to use https, not http (@giraffate) ## 1.19.3 _2019-08-06_ ### Bug Fixes - Fix wrong URLs in error messages (#3033) ### Pull Requests - [#3033](https://github.com/rollup/rollup/pull/3033): Fix wrong URLs in error messages (@giraffate) ## 1.19.2 _2019-08-05_ ### Bug Fixes - Add bin file to package ## 1.19.1 _2019-08-05_ ### Bug Fixes - Remove wrong extension in package.json file (#3031) ### Pull Requests - [#3031](https://github.com/rollup/rollup/pull/3031): Fix wrong extension (@lukastaegert) ## 1.19.0 _2019-08-05_ ### Features - Implement a new unified file emission API for assets and chunks with support for explicit file names (#2999) - Use the id of the last module in a chunk as base for the chunk name if no better name is available (#3025) - Use the id of the last module in a chunk as base for the variable name of a chunk in some formats if no better name is available (#2999) ### Bug Fixes - Do not produce invalid variable names if an empty name is chosen for a virtual module (#3026) - Fix an issue where a module variable name would conflict with a local variable name in some formats (#3020) ### Pull Requests - [#2999](https://github.com/rollup/rollup/pull/2999): Unified file emission api (@lukastaegert) - [#3020](https://github.com/rollup/rollup/pull/3020): Switch to a code-splitting build and update dependencies (@lukastaegert) - [#3025](https://github.com/rollup/rollup/pull/3025): Use id of last module in chunk as name base for auto-generated chunks (@lukastaegert) - [#3026](https://github.com/rollup/rollup/pull/3026): Avoid variable from empty module name be empty (@LongTengDao) ## 1.18.0 _2019-08-01_ ### Features - Add `externalLiveBindings: false` option to optimize code when live bindings are not needed (#3010) ### Pull Requests - [#2997](https://github.com/rollup/rollup/pull/2997): Integrate coverage into CI setup (@lukastaegert) - [#2998](https://github.com/rollup/rollup/pull/2998): Update readme badges (@lukastaegert) - [#3010](https://github.com/rollup/rollup/pull/3010): Add option to prevent code for external live bindings (@lukastaegert) ## 1.17.0 _2019-07-15_ ### Features - Allow plugins to access current combined sourcemap in transform hook for coverage instrumentation (#2993) ### Pull Requests - [#2987](https://github.com/rollup/rollup/pull/2987): Fix code fences for link (@johanholmerin) - [#2989](https://github.com/rollup/rollup/pull/2989): Bump lodash from 4.17.11 to 4.17.14 (@dependabot) - [#2993](https://github.com/rollup/rollup/pull/2993): Add getCombinedSourceMap in transform plugin context (@billowz) ## 1.16.7 _2019-07-09_ ### Bug Fixes - Fix an issue where exported import.meta properties would lead to invalid code (#2986) ### Pull Requests - [#2985](https://github.com/rollup/rollup/pull/2985): Improve sourcemap types (@jridgewell) - [#2986](https://github.com/rollup/rollup/pull/2986): Only overwrite content when resolving import.meta properties (@lukastaegert) ## 1.16.6 _2019-07-04_ ### Bug Fixes - Do not pass undefined to resolveDynamicImport for unresolvable template literals (#2984) ### Pull Requests - [#2984](https://github.com/rollup/rollup/pull/2984): Always forward AST nodes for unresolvable dynamic imports (@lukastaegert) ## 1.16.5 _2019-07-04_ ### Bug Fixes - onwarn should still be called when --silent is used (#2982) - Properly clean up watchers for files that are deleted between builds (#2982) ### Pull Requests - [#2981](https://github.com/rollup/rollup/pull/2981): Do not skip onwarn handler when --silent is used (@lukastaegert) - [#2982](https://github.com/rollup/rollup/pull/2982): Make tests run on Node 12, fix watcher cleanup issue (@lukastaegert) ## 1.16.4 _2019-07-02_ ### Bug Fixes - Do not show a TypeScript error when providing a location as number to this.warn and this.error (#2974) - Use the correct TypeScript type for Sourcemap.version (#2976) ### Pull Requests - [#2965](https://github.com/rollup/rollup/pull/2965): Use async readFile in getRollupDefaultPlugin (@kaksmet) - [#2974](https://github.com/rollup/rollup/pull/2974): Align TS types, docs and implementation for this.warn and this.error (@lukastaegert) - [#2976](https://github.com/rollup/rollup/pull/2976): Fix sourcemap type and update dependencies (@lukastaegert) ## 1.16.3 _2019-06-29_ ### Bug Fixes - Prevent name conflicts with unused function parameters (#2972) ### Pull Requests - [#2972](https://github.com/rollup/rollup/pull/2972): Deconflict unused parameters (@lukastaegert) ## 1.16.2 _2019-06-22_ ### Bug Fixes - Properly wrap dynamic imports in Promises that can be caught when generating CJS output (#2958) ### Pull Requests - [#2958](https://github.com/rollup/rollup/pull/2958): Make sure errors from dynamic imports can be caught (@lukastaegert) ## 1.16.1 _2019-06-21_ ### Pull Requests - [#2956](https://github.com/rollup/rollup/pull/2956): Add missing CLI docs for strictDeprecations (@lukastaegert) ## 1.16.0 _2019-06-21_ ### Features - Add strictDeprecations option to throw when currently or upcoming deprecated features are used (#2945) - Keep annotations and comments when simplifying logical and conditional expressions (#2955) ### Bug Fixes - Generate proper namespace objects when dynamically importing external dependencies for AMD or CJS formats (#2954) - Fix dynamically imported variables not being resolved correctly when importing from an entry chunk with only a default export (#2954) - Do not reexport default when reexporting a namespace (#2954) ### Pull Requests - [#2945](https://github.com/rollup/rollup/pull/2945): Add option to handle use of features marked for deprecation as errors (@lukastaegert) - [#2954](https://github.com/rollup/rollup/pull/2954): Improve dynamic import interop (@lukastaegert) - [#2955](https://github.com/rollup/rollup/pull/2955): Keep annotations and comments when simplifying logical and conditional expressions (@lukastaegert) ## 1.15.6 _2019-06-16_ ### Bug Fixes - No longer use an alternate screen in watch mode to allow scrolling (#2942) - Prioritize non-external imports over external ones when resolving conflicting namespace re-exports (#2893) ### Pull Requests - [#2893](https://github.com/rollup/rollup/pull/2893): Improve handling of conflicting namespace exports (@aleclarson) - [#2942](https://github.com/rollup/rollup/pull/2942): Get rid of alternate screen and simplify screen clearing (@lukastaegert) ## 1.15.5 _2019-06-14_ ### Bug Fixes - Do not include any comments for completely tree-shaken files so that `renderedLength === 0` is a reliable check (#2940) - Do not cause type errors when returning `null` from `resolveId` (#2941) ### Pull Requests - [#2940](https://github.com/rollup/rollup/pull/2940): Completely omit files that do not have any included statements (@lukastaegert) - [#2941](https://github.com/rollup/rollup/pull/2941): Explicitly allow null as return value for various hooks (@lukastaegert) ## 1.15.4 _2019-06-14_ ### Bug Fixes - Improve how asset and chunk URLs are resolved for UMD, IIFE and CJS output (#2937) ### Pull Requests - [#2937](https://github.com/rollup/rollup/pull/2937): Fix URL resolution to work when the current script contains query parameters (@lukastaegert) ## 1.15.3 _2019-06-13_ ### Bug Fixes - Always reemit assets and chunks from cached transform hooks (#2936) ### Pull Requests - [#2936](https://github.com/rollup/rollup/pull/2936): Fix repeated re-emission of files emitted from a transform hook (@lukastaegert) ## 1.15.2 _2019-06-13_ ### Bug Fixes - Make sure chunks emitted from transform hooks are also emitted for incremental builds in watch mode (#2933) ### Pull Requests - [#2933](https://github.com/rollup/rollup/pull/2933): Reemit chunks emitted from transform hooks (@lukastaegert) ## 1.15.1 _2019-06-11_ ### Bug Fixes - Do not fail when reexporting variables in dynamic entry points from other chunks (#2928) ### Pull Requests - [#2928](https://github.com/rollup/rollup/pull/2928): Handle reexports from dynamic entries across chunk (@lukastaegert) ## 1.15.0 _2019-06-11_ ### Features - Tone down try-catch deoptimization while maintaining polyfill support (#2918) ### Bug Fixes - Handle feature detection with "typeof" for regular expressios (#2916) - Deoptimize `'' + variable'` type coercion as expression statement for feature detection (#2917) - Always observe argument side-effects when tree-shaking (#2924) ### Pull Requests - [#2916](https://github.com/rollup/rollup/pull/2916): Deoptimize typeof for regular expression literals to better support es6-shim (@lukastaegert) - [#2917](https://github.com/rollup/rollup/pull/2917): Support implicit type coercion errors in es5-shim (@lukastaegert) - [#2918](https://github.com/rollup/rollup/pull/2918): Deoptimize try-catch less radically (@lukastaegert) - [#2924](https://github.com/rollup/rollup/pull/2924): Do not tree-shake arguments with side-effects (@lukastaegert) ## 1.14.6 _2019-06-10_ ### Bug Fixes - Fix an issue where call arguments were not included in try statements (#2914) ### Pull Requests - [#2914](https://github.com/rollup/rollup/pull/2914): Properly include try statements for each pass when deoptimization is deactivated (@lukastaegert) ## 1.14.5 _2019-06-09_ ### Bug Fixes - Keep external ids unmodified when using the object form of resolveId (#2907) - Cache dynamic import resolutions when using Rollup cache (#2908) - Keep all necessary parentheses when tree-shaking call arguments (#2911) ### Pull Requests - [#2906](https://github.com/rollup/rollup/pull/2906): Update dependencies (@lukastaegert) - [#2907](https://github.com/rollup/rollup/pull/2907): Do not renormalize external ids when using the object form (@lukastaegert) - [#2908](https://github.com/rollup/rollup/pull/2908): Cache dynamic ids if possible (@lukastaegert) - [#2911](https://github.com/rollup/rollup/pull/2911): Fix treeshaken parameters around parentheses (@manucorporat) ## 1.14.4 _2019-06-07_ ### Bug Fixes - Do not omit external re-exports for `moduleSideEffects: false` (#2905) ### Pull Requests - [#2905](https://github.com/rollup/rollup/pull/2905): Make sure external re-exports are included for moduleSideEffects: false (@lukastaegert) ## 1.14.3 _2019-06-06_ ### Bug Fixes - Generate correct external imports when importing from a directory that would be above the root of the current working directory (#2902) ### Pull Requests - [#2902](https://github.com/rollup/rollup/pull/2902): Use browser relative path algorithm for chunks (@lukastaegert) ## 1.14.2 _2019-06-05_ ### Bug Fixes - Prevent unnecessary inclusion of external namespace import in certain situations (#2900) ### Pull Requests - [#2900](https://github.com/rollup/rollup/pull/2900): Handle early bind for member expressions (@lukastaegert) ## 1.14.1 _2019-06-05_ ### Bug Fixes - Fix an issue where try-statements were not included properly when a variable declared inside the statement was accessed outside it (#2898) - Fix an issue where `await` expressions were not included properly (#2899) ### Pull Requests - [#2898](https://github.com/rollup/rollup/pull/2898): Properly include try-catch-statements even if they have already been included in some way (@lukastaegert) - [#2899](https://github.com/rollup/rollup/pull/2899): Fix unintended early return in await inclusion handling (@lukastaegert) ## 1.14.0 _2019-06-05_ ### Features - Deoptimize code inside and called from try-statements for feature detection (#2892) - Tree-shake unused call arguments (#2892) ### Pull Requests - [#2892](https://github.com/rollup/rollup/pull/2892): Implement try-statement-deoptimization for feature detection, tree-shake unused arguments (@lukastaegert) ## 1.13.1 _2019-06-01_ ### Bug Fixes - Avoid conflicts between top-level module, require etc. and CommonJS runtimes (#2889) ### Pull Requests - [#2888](https://github.com/rollup/rollup/pull/2888): Enable full TypeScript strict mode (@lukastaegert) - [#2889](https://github.com/rollup/rollup/pull/2889): Protect all module globals for CJS output from being redefined (@lukastaegert) ## 1.13.0 _2019-05-31_ ### Features - Omit `exports` and `module` from SystemJS wrapper if possible (#2880) - Try to use the first letters of names when mangling exports (#2885) ### Bug Fixes - Avoid conflicts with local variables when using format specific globals to render dynamic imports and file URLs (#2880) - Do not produce undefined reexports when reexporting from entry points (#2885) ### Pull Requests - [#2880](https://github.com/rollup/rollup/pull/2880): Deconflict global variables used inside format-specific code (@lukastaegert) - [#2885](https://github.com/rollup/rollup/pull/2885): Do not produce undefined reexports when reexporting from entry points and refactor chunk linking (@lukastaegert) ## 1.12.5 _2019-05-30_ ### Pull Requests - [#2884](https://github.com/rollup/rollup/pull/2884): Update pluginutils for new micormatch and reduced bundle size (@lukastaegert) ## 1.12.4 _2019-05-27_ ### Bug Fixes - Show correct error stack trace for errors throw in "load" hooks (#2871) ### Pull Requests - [#2875](https://github.com/rollup/rollup/pull/2875): Mention subfolders in docs (@lukastaegert) - [#2871](https://github.com/rollup/rollup/pull/2871): Reserve error stack information (@LongTengDao) ## 1.12.3 _2019-05-19_ ### Bug Fixes - Prevent duplicate imports when exports are reexported as default exports (#2866) ### Pull Requests - [#2755](https://github.com/rollup/rollup/pull/2755): Enable TypeScript strictNullChecks (@edsrzf) - [#2866](https://github.com/rollup/rollup/pull/2866): Properly deduplicate reexported default exports (@lukastaegert) ## 1.12.2 _2019-05-17_ ### Bug Fixes - Do not fail when using clearScreen:false in watchMode (#2858) - Properly resolve star reexports when preserving modules (#2860) ### Pull Requests - [#2858](https://github.com/rollup/rollup/pull/2858): Declare processConfigsErr before use (@humphd) - [#2860](https://github.com/rollup/rollup/pull/2860): Keep nested exports with preserveModules (@TomCaserta) - [#2864](https://github.com/rollup/rollup/pull/2864): Cache transitive reexport detection (@lukastaegert) ## 1.12.1 _2019-05-16_ ### Bug Fixes - Extend file name sanitation to also replace "?" and "\*" e.g. when preserving modules with the updated commonjs plugin (#2860) - Do not ignore module transformer that return an empty string (#2861) ### Pull Requests - [#2860](https://github.com/rollup/rollup/pull/2860): Update to latest plugins and extend file name sanitation (@lukastaegert) - [#2861](https://github.com/rollup/rollup/pull/2861): Allow transformers to return an empty string (@lukastaegert) ## 1.12.0 _2019-05-15_ ### Features - Add `treeshake.moduleSideEffects` option to allow removing empty imports without a side-effect check (#2844) - Extend plugin API to allow marking modules as side-effect-free (#2844) - Extend `this.resolve` plugin context function with an option to skip the `resolveId` hook of the calling plugin (#2844) - Add `isEntry` flag to `this.getModuleInfo` plugin context function (#2844) - Distribute Rollup as optimized ES2015 code (#2851) ### Pull Requests - [#2844](https://github.com/rollup/rollup/pull/2844): Add options and hooks to control module side effects (@lukastaegert) - [#2851](https://github.com/rollup/rollup/pull/2851): Switch to ES2015 output (@lukastaegert) ## 1.11.3 _2019-05-05_ ### Bug Fixes - Quote es3 keywords in namespace objects (#2825) ### Pull Requests - [#2825](https://github.com/rollup/rollup/pull/2825): Add es3 support for namespace object import (@sormy) ## 1.11.2 _2019-05-04_ ### Bug Fixes - Prevent a crash when handling circular namespace exports (#2836) ### Pull Requests - [#2836](https://github.com/rollup/rollup/pull/2836): Make sure circular `export * from X` does not stack overflow (@Swatinem) ## 1.11.1 _2019-05-04_ ### Bug Fixes - Fix an issue where rendered exports were reported as "removed" in the bundle information (#2835) ### Pull Requests - [#2835](https://github.com/rollup/rollup/pull/2835): Fix `removedExports` to correctly track the exported item (@Swatinem) ## 1.11.0 _2019-05-03_ ### Features - Add `emitChunk` plugin context function to emit additional entry chunks that can be referenced from the code (#2809) - Allow `manualChunks` to be a function (#2831) - Omit `.js` extensions in AMD imports to make sure an AMD `baseUrl` would work (#2809) - Automatically use the name of the imported module as a base for dynamically imported chunks (#2809) - Add `resolveFileUrl` plugin hook to replace `resolveAssetUrl` and handle emitted chunks as well (#2809) - Add `resolve` plugin hook to replace `resolveId` and `isExternal` that returns an object (#2829) - Allow `resolveDynamicImport` to return an `{id, external}` object to also resolve unresolvable dynamic imports to a module (#2829) ### Bug Fixes - Do not create invalid code if a dynamic import contains nothing but reexports (#2809) - Do not fail if modules that define a manual chunk depend on each other (#2809) - Do not fail if a module that defines a manual chunk is the dependency of a module defining a different manual chunk (#2809) - No longer fail for unnamed duplicate entry points but combine them (#2809) - Always return `string | null` from `this.resolveId` even if some `resolveId` hooks return objects (#2829) - Show proper warnings when `resolveDynamicImport` resolves to a non-external module that does not exist (#2829) ### Pull Requests - [#2809](https://github.com/rollup/rollup/pull/2809): Add hook for dynamic entry chunk emission (@lukastaegert) - [#2821](https://github.com/rollup/rollup/pull/2821): Fix syntax error in documentation (@FFxSquall) - [#2829](https://github.com/rollup/rollup/pull/2829): Improve id resolution (@lukastaegert) - [#2831](https://github.com/rollup/rollup/pull/2831): Allow manualChunks to be a function (@lukastaegert) - [#2832](https://github.com/rollup/rollup/pull/2832): Improve `generateBundle` documentation (@lukastaegert) - [#2833](https://github.com/rollup/rollup/pull/2833): Update dependencies (@lukastaegert) ## 1.10.1 _2019-04-19_ ### Bug Fixes - Invalid options.format values will now trigger a helpful error (#2813) ### Pull Requests - [#2812](https://github.com/rollup/rollup/pull/2812): Minor documentation update (@dnalborczyk) - [#2813](https://github.com/rollup/rollup/pull/2813): Catch invalid options.format values (@marijnh) - [#2816](https://github.com/rollup/rollup/pull/2816): Update all dependencies to fix security issues (@lukastaegert) ## 1.10.0 _2019-04-11_ ### Features - Improve generated code to polyfill `import.meta.url` (#2785) - Add plugin hook to configure handling of `import.meta` (#2785) - Improve generated code when accessing URLs of emitted assets (#2796) - Add plugin hook to configure the generated code when accessing URLs of emitted assets (#2796) ### Bug Fixes - No longer resolve assets to their parent URL in some cases (#2796) ### Pull Requests - [#2785](https://github.com/rollup/rollup/pull/2785): Refactor handling of import.meta.url and add option to configure behaviour (@lukastaegert) - [#2796](https://github.com/rollup/rollup/pull/2796): Improve and fix asset emission (@lukastaegert) ## 1.9.3 _2019-04-10_ ### Bug Fixes - Simplify return expressions that are evaluated before the surrounding function is bound (#2803) ### Pull Requests - [#2803](https://github.com/rollup/rollup/pull/2803): Handle out-of-order binding of identifiers to improve tree-shaking (@lukastaegert) ## 1.9.2 _2019-04-10_ ### Bug Fixes - Allowing replacing `output.file` with `output.dir` in the `outputOptions` hook (#2802) ### Pull Requests - [#2802](https://github.com/rollup/rollup/pull/2802): Observe modified output options in bundle.write (@lukastaegert) ## 1.9.1 _2019-04-10_ ### Bug Fixes - Make sure inline comments in dynamic imports are preserved (#2797) ### Pull Requests - [#2797](https://github.com/rollup/rollup/pull/2797): Emit inline comments inside dynamic import (@manucorporat) ## 1.9.0 _2019-04-05_ ### Features - Add built-in support for bigint (#2789) ### Pull Requests - [#2789](https://github.com/rollup/rollup/pull/2789): Ship with bigint support built-in (@danielgindi) - [#2791](https://github.com/rollup/rollup/pull/2791): Use shared extractAssignedNames from rollup-pluginutils (@lukastaegert) - [#2792](https://github.com/rollup/rollup/pull/2792): Test that rollup-plugin-commonjs works with preserveModules (@lukastaegert) ## 1.8.0 _2019-04-02_ ### Features - Support `module` as alias for `esm` and `commonjs` for `cjs` to match Node (#2783) ### Pull Requests - [#2782](https://github.com/rollup/rollup/pull/2782): Inline interopDefault in config loading (@guybedford) - [#2783](https://github.com/rollup/rollup/pull/2783): Support Node-style format aliases (@guybedford) ## 1.7.4 _2019-03-28_ ### Bug Fixes - Improve TypeScript type of the treeshaking options (#2779) ### Pull Requests - [#2779](https://github.com/rollup/rollup/pull/2779): Make all properties in TreeshakingOptions optional (@ndelangen) ## 1.7.3 _2019-03-24_ ### Bug Fixes - Use getters when re-exporting live-bindings (#2765) ### Pull Requests - [#2765](https://github.com/rollup/rollup/pull/2765): Support exporting live-bindings from other chunks or external dependencies (@lukastaegert) ## 1.7.2 _2019-03-24_ ### Bug Fixes - Make sure relative external ids are resolved correctly (#2774) ### Pull Requests - [#2774](https://github.com/rollup/rollup/pull/2774): Resolve relative external ids (@lukastaegert) ## 1.7.1 _2019-03-24_ ### Bug Fixes - Prevent invalid code when exporting several hundred identifiers from a chunk (#2768) - Do not wrongly deconflict labels (#2776) ### Pull Requests - [#2768](https://github.com/rollup/rollup/pull/2768): Sanitize shortened internal export names (@lukastaegert) - [#2769](https://github.com/rollup/rollup/pull/2769): Update dependencies and fix security issue (@lukastaegert) - [#2776](https://github.com/rollup/rollup/pull/2776): Do not treat break labels as identifiers (@lukastaegert) ## 1.7.0 _2019-03-20_ ### Features - Sort chunk exports by name for greater consistency (#2757) ### Bug Fixes - Fix a situation where tree-shakeable code would not be removed in an indeterminate manner (#2757) ### Pull Requests - [#2757](https://github.com/rollup/rollup/pull/2757): Sort modules before binding, sort exports (@lukastaegert) ## 1.6.1 _2019-03-20_ ### Bug Fixes - Avoid name clashes of unused default exports when tree-shaking is false (#2758) - Do not crash when generating SystemJS bundles containing array patterns with member expressions (#2760) ### Pull Requests - [#2758](https://github.com/rollup/rollup/pull/2758): Make sure unused default exports are deconflicted when tree-shaking is false (@lukastaegert) - [#2760](https://github.com/rollup/rollup/pull/2760): Handle member expressions in array patterns (@lukastaegert) ## 1.6.0 _2019-03-08_ ### Features - Add plugin hook to modify output options (#2736) ### Pull Requests - [#2736](https://github.com/rollup/rollup/pull/2736): Add hook for modifying OutputOptions (@Comandeer) ## 1.5.0 _2019-03-07_ ### Features - Allow resolving to a different id while marking it as external at the same time (#2734) ### Pull Requests - [#2734](https://github.com/rollup/rollup/pull/2734): Allow resolveId to return an object (@lukastaegert) ## 1.4.2 _2019-03-07_ ### Bug Fixes - Respect variable identity of exports when hashing (#2741) - Resolve a situations where a variable was imported twice with the same name (#2737) ### Pull Requests - [#2741](https://github.com/rollup/rollup/pull/2741): Fix hashing when different variable are exported using the same name (@lukastaegert) - [#2737](https://github.com/rollup/rollup/pull/2737): Fix duplicate imports with conflicting names (@lukastaegert) ## 1.4.1 _2019-03-04_ ### Bug Fixes - Do not treat the import target "" as external by default (#2733) ### Pull Requests - [#2733](https://github.com/rollup/rollup/pull/2733): Do not treat the import target "" as external by default (@LongTengDao) ## 1.4.0 _2019-03-01_ ### Features - Add option to change the name of the dynamic import function to allow polyfilling it (#2723) ### Pull Requests - [#2723](https://github.com/rollup/rollup/pull/2723): Add dynamicImportFunction option (@keithamus) ## 1.3.3 _2019-03-01_ ### Bug Fixes - Fix performance regression when handling long chains of calls to property methods (#2732) ### Pull Requests - [#2730](https://github.com/rollup/rollup/pull/2730): Order types, interfaces, classes, and object members (@lukastaegert) - [#2732](https://github.com/rollup/rollup/pull/2732): Take chunk export mode into account when reexporting default (@lukastaegert) ## 1.3.2 _2019-02-27_ ### Bug Fixes - Allow ids of default exported classes to be exported separately (#2728) ### Pull Requests - [#2728](https://github.com/rollup/rollup/pull/2728): Update dependencies (@lukastaegert) ## 1.3.1 _2019-02-27_ ### Bug Fixes - Correctly reexport the default export from entry chunks (#2727) ### Pull Requests - [#2727](https://github.com/rollup/rollup/pull/2727): Take chunk export mode into account when reexporting default (@lukastaegert) ## 1.3.0 _2019-02-26_ ### Features - Treeshake call expressions prefixed with UglifyJS style `@__PURE__` annotations (#2429) ### Pull Requests - [#2429](https://github.com/rollup/rollup/pull/2429): Add support for /_#**PURE**_/ comments (@conartist6 and @lukastaegert) ## 1.2.5 _2019-02-26_ ### Bug Fixes - Store external ids reported by plugins in watch mode (#2718) ### Pull Requests - [#2718](https://github.com/rollup/rollup/pull/2718): Incremental external (@andreas-karlsson) ## 1.2.4 _2019-02-26_ ### Bug Fixes - Fix an issue where a variable was imported twice under the same name (#2715) ### Pull Requests - [#2715](https://github.com/rollup/rollup/pull/2715): Deduplicate imports referencing default exports and their original variables (@lukastaegert) ## 1.2.3 _2019-02-23_ ### Bug Fixes - Use correct path when rendering dynamic imports where the entry module is empty (#2714) ### Pull Requests - [#2714](https://github.com/rollup/rollup/pull/2714): Properly render dynamic imports when imported module is empty (@lukastaegert) ## 1.2.2 _2019-02-19_ ### Bug Fixes - Fix wrong external imports when using the `paths` options only for some outputs (#2706) ### Pull Requests - [#2706](https://github.com/rollup/rollup/pull/2706): Always recreate paths for external modules (@lukastaegert) ## 1.2.1 _2019-02-17_ ### Bug Fixes - Fix ESM version of Rollup (#2705) ### Pull Requests - [#2705](https://github.com/rollup/rollup/pull/2705): Fix ESM version of Rollup (@lukastaegert) ## 1.2.0 _2019-02-17_ ### Features - Fewer renamed variables due to a completely reimplemented deconflicting logic (#2689) ### Bug Fixes - Respect rendered and tree-shaken exports when determining chunk hashes (#2695) - Fix an error when dynamic imports end up in the same chunk as one of their importees (#2677) - Do not generate invalid code when expressions containing IIFEs are simplified (#2696) - Do not throw an error when more than ten bundles are watched (#2700) - Treat re-exported globals in a spec-compliant way (#2691) - Fix issues related to wrongly renamed variables (#2689) - Do not throw an error if config files contain non-default exports (#2673) - Improve type of `RollupOutput.output` to guarantee at least one chunk (#2679) ### Pull Requests - [#2673](https://github.com/rollup/rollup/pull/2673): Allow config files to have non-default exports (@swansontec) - [#2677](https://github.com/rollup/rollup/pull/2677): Prevent final resolution and facade creation for inlined dynamic imports (@Rich-Harris and @lukastaegert) - [#2679](https://github.com/rollup/rollup/pull/2679): Improve type of `RollupOutput.output` (@MattiasBuelens) - [#2689](https://github.com/rollup/rollup/pull/2689): Reimplement variable deconflicting logic (@lukastaegert) - [#2691](https://github.com/rollup/rollup/pull/2691): Fix CI issues and update acorn dependency (@lukastaegert) - [#2693](https://github.com/rollup/rollup/pull/2693): Fix typo in export-globals test (@MattiasBuelens) - [#2695](https://github.com/rollup/rollup/pull/2695): Respect rendered exports when generating chunk hashes (@lukastaegert) - [#2696](https://github.com/rollup/rollup/pull/2696): Correctly render function expression inside simplified expression statements (@lukastaegert) - [#2700](https://github.com/rollup/rollup/pull/2700): Add a fix for MaxListenersExceededWarning (@luwes) - [#2703](https://github.com/rollup/rollup/pull/2703): Update rollup-pluginutils (@lukastaegert) ## 1.1.2 _2019-01-21_ ### Bug Fixes - Tree-shaken dynamic imports no longer leave behind `undefined` entries in the bundle information (#2663) - Dynamic imports in dynamically imported files could lead to crashes and would not always create new chunks (#2664) ### Pull Requests - [#2663](https://github.com/rollup/rollup/pull/2663): Do not include tree-shaken dynamic imports in bundle information (@lukastaegert) - [#2664](https://github.com/rollup/rollup/pull/2664): Properly handle dynamic imports declared in dynamically imported files (@everdimension) ## 1.1.1 _2019-01-19_ ### Bug Fixes - Make sure object prototype methods are not considered to be falsy when tree-shaking (#2652) ### Pull Requests - [#2652](https://github.com/rollup/rollup/pull/2652): Make sure object prototype methods are not considered to be falsy (@lukastaegert) - [#2654](https://github.com/rollup/rollup/pull/2654): Use correct signature for `this.setAssetSource` in docs (@everdimension) - [#2656](https://github.com/rollup/rollup/pull/2656): Swap descriptions for `[extname]` and `[ext]` in docs (@tivac) ## 1.1.0 _2019-01-09_ ### Features - Make `this.meta` available from the `options` plugin hook (#2642) - Add a new `writeBundle` plugin hook that is called _after_ all files have been written (#2643) ### Bug Fixes - Make sure the `acorn` import of the bundled non-ESM acorn plugins is correctly translated to ESM (#2636) - Make sure input options are actually passed to the `buildStart` hook (#2642) ### Pull Requests - [#2636](https://github.com/rollup/rollup/pull/2636): Improve how acorn is imported, update dependencies (@lukastaegert) - [#2642](https://github.com/rollup/rollup/pull/2642): Make this.meta available in options hook, pass input options to buildStart (@lukastaegert) - [#2643](https://github.com/rollup/rollup/pull/2643): Implement writeBundle hook (@lukastaegert) ## 1.0.2 _2019-01-05_ ### Bug Fixes - Make sure the transform hook is always reevaluated when a file watched by the hook changes (#2633) - Fix a crash when generating hashes for tree-shaken dynamic imports (#2638) - Fix a crash and some inconsistencies when using the acorn-bigint plugin (#2640) ### Pull Requests - [#2633](https://github.com/rollup/rollup/pull/2633): Document `this.addWatchFile` and make sure it also declares transform dependencies (@lukastaegert) - [#2635](https://github.com/rollup/rollup/pull/2635): Make sure `code` is optional in warning type (@lukastaegert) - [#2638](https://github.com/rollup/rollup/pull/2638): Do not fail when generating hashes for tree-shaken dynamic imports (@lukastaegert) - [#2640](https://github.com/rollup/rollup/pull/2640): Always treat bigints as unknown (@lukastaegert) - [#2641](https://github.com/rollup/rollup/pull/2641): Make sure all CLI options are listed in the summary (@lukastaegert) ## 1.0.1 _2019-01-03_ ### Bug Fixes - Properly handle reexporting an external default export for non-ESM targets when using named exports mode (#2620) - Do not (wrongly) re-declare input options in the merged `RollupOptions` type (#2622) ### Pull Requests - [#2620](https://github.com/rollup/rollup/pull/2620): Fixed issue with reexporting default as default with `{exports: named, interop: true}` options (@Andarist) - [#2622](https://github.com/rollup/rollup/pull/2622): Simplify RollupOptions (@Kinrany) - [#2627](https://github.com/rollup/rollup/pull/2627): Show how to skip imports for optional plugins (@chris-morgan) ## 1.0.0 _2018-12-28_ ### Breaking Changes - Several (mostly deprecated) options have been removed or renamed (#2293, #2409): - banner -> output.banner - dest -> output.file - entry -> input - experimentalCodeSplitting -> now always active - experimentalDynamicImport -> now always active - experimentalPreserveModules -> preserveModules - exports -> output.exports - extend -> output.extend - footer -> output.footer - format -> output.format - freeze -> output.freeze - globals -> output.globals - indent -> output.indent - interop -> output.interop - intro -> output.intro - load -> use plugin API - moduleName -> output.name - name -> output.name - noConflict -> output.noConflict - output.moduleId -> output.amd.id - outro -> output.outro - paths -> output.paths - preferConst -> output.preferConst - pureExternalModules -> treeshake.pureExternalModules - resolveExternal -> use plugin API - resolveId -> use plugin API - sourcemap -> output.sourcemap - sourceMap -> output.sourcemap - sourceMapFile -> output.sourcemapFile - strict -> output.strict - targets -> use output as an array - transform -> use plugin API - useStrict -> output.strict - In general, output options can no longer be used as input options (#2409) - `bundle.generate` and `bundle.write` now return a new format (#2293) - Several plugin hooks have become deprecated and will display warnings when used (#2409): - transformBundle - transformChunk - ongenerate - onwrite - Plugin transform dependencies are deprecated in favour of using the `this.addWatchFile` plugin context function (#2409) - Accessing `this.watcher` in plugin hooks is deprecated in favour of the `watchChange` plugin hook and the `this.addWatchFile` plugin context function (#2409) - Using dynamic import statements will by default create a new chunk unless `inlineDynamicImports` is used (#2293) - Rollup now uses acorn@6 which means that acorn plugins must be compatible with this version; acorn is now external for non-browser builds to make plugins work (#2293) ### Features - The `--dir` ClI option can now be aliased as `-d` (#2293) - The `--input` option now supports named entry points via `=` (#2293) ### Bug Fixes - Both the `--input` option as well as the default CLI option now support named inputs (#2293) ### Pull Requests - [#2293](https://github.com/rollup/rollup/pull/2293): Unify code paths for 1.0 relase and update documentation (@guybedford and @lukastaegert) - [#2409](https://github.com/rollup/rollup/pull/2409): Remove old deprecated features and add new deprecation warnings (@guybedford) - [#2486](https://github.com/rollup/rollup/pull/2486): Upgrade to acorn 6 (@marijnh) - [#2611](https://github.com/rollup/rollup/pull/2611): Fix hook's name in test description (@Andarist) - [#2612](https://github.com/rollup/rollup/pull/2612): Fix a self-contradicting comment in the docs (@LongTengDao) ## 0.68.2 _2018-12-23_ ### Bug Fixes - Do not assume hoisted variables to have been initialized (#2607) ### Pull Requests - [#2607](https://github.com/rollup/rollup/pull/2607): Fix an issues where hoisted variables were assumed to have been initialized (@lye) ## 0.68.1 _2018-12-19_ ### Bug Fixes - Fix an issue with UMD wrappers where a variable is used without being defined (#2600) ### Pull Requests - [#2600](https://github.com/rollup/rollup/pull/2600): Fix UMD and IIFE wrapper issues and add comprehensive functional wrapper tests (@lukastaegert) ## 0.68.0 _2018-12-16_ ### Breaking Changes - `optimizeChunks` is renamed to `experimentalOptimizeChunks` to reflect this feature is not production-ready yet (#2575) ### Features - Plugins can iterate all module ids via `this.moduleIds` (#2565) - Plugins can get graph information about a module via `this.getModuleInfo(id)` (#2565) - Plugins and JS API users get more information about the generated chunks: `dynamicImports`, `facadeModuleId`, `isDynamicEntry`, `name` (#2575) - Tree-shaken dynamic imports will no longer create chunks or influence chunking in any way (#2575) - Dynamic imports will no longer follow the `entryFileNames` but the `chunkFileNames` property reflecting those are solely internally used (#2575) - If there are chunk naming conflicts, entry chunks will always take precedence (#2575) - If an entry facade is created, only the facade chunk is marked as `isEntry` (#2575) - Dynamic chunks will only be marked as `isEntry` if they are actually entry chunks as well; thus there is now a 1-to-1 correspondence between modules listed in `input` and chunks marked as `isEntry` (#2575) - Chunks no longer contain imports for variables that are tree-shaken in the chunk but used in other chunks (#2584) - Chunks will always import re-exported variables directly from the chunk where they are originally exported from (#2584) - Null characters will be pruned from chunk ids to allow for virtually created chunks and make `rollup-plugin-multi-entry` compatible with code-splitting and thus the upcoming 1.0 version (#2590) - Simplify the UMD wrapper code as much as possible, especially if there are no exports (#2594) - The UMD wrapper will now work in strict mode by checking for `self` before `this` when determining the global variable (#2594) ### Bug Fixes - If a facade is created for a dynamic entry point, this facade will be imported instead of the facaded chunk (#2575) - Manual chunks that include multiple entry points will have proper facades created for all entry points if necessary (#2575) - If missing exports are shimmed, the shim variable will not be global but created on a per-module basis and is deconflicted with variables having the same name (#2584) - Missing export shims work properly in SystemJS (#2584) - `preserveModules` now handles dynamic namespace imports (#2584) - Fix chunk execution order in certain scenarios (#2584) - Exports and assignments using destructuring syntax will properly update the exported variables when generating SystemJS output (#2587) - Hashes in chunk names will now also take dynamic imports into account (#2596) ### Pull Requests - [#2565](https://github.com/rollup/rollup/pull/2565): Provide module graph information on the plugin context (@samccone) - [#2575](https://github.com/rollup/rollup/pull/2575): Extend bundle information, tree-shake dynamic imports, fix dynamic import facade creation, support manual chunks with multiple entry points, make `optimizeChunks` experimental (@lukastaegert) - [#2577](https://github.com/rollup/rollup/pull/2577): Update dependencies (@lukastaegert) - [#2584](https://github.com/rollup/rollup/pull/2584): Prune tree-shaken chunk imports, fix missing export shimming, support dynamic namespaces when preserving modules, improve chunk execution order (@lukastaegert) - [#2587](https://github.com/rollup/rollup/pull/2587): Support exports using destructuring declarations and assignments in SystemJS (@lukastaegert) - [#2590](https://github.com/rollup/rollup/pull/2590): Make sure chunk ids do not contain invalid characters to allow for chunks to correspond to virtual modules (@lukastaegert) - [#2594](https://github.com/rollup/rollup/pull/2594): Simplify UMD wrapper code and make sure it works in strict mode (@lukastaegert) - [#2596](https://github.com/rollup/rollup/pull/2596): Take both static and dynamic dependencies into account when calculating hashes (@lukastaegert) ## 0.67.4 _2018-12-03_ ### Bug Fixes - Prevent corrupt source maps for files with very long lines (#2571) ### Pull Requests - [#2571](https://github.com/rollup/rollup/pull/2571): Fix an issue with long lines in sourcemaps (@mislav) ## 0.67.3 _2018-11-17_ ### Bug Fixes - Make sure the ESM browser build is actually published to npm (#2560) - Throw proper error when using `inlineDynamicImports` with `experimentalPreserveModules` (#2560) ### Pull Requests - [#2552](https://github.com/rollup/rollup/pull/2552): Properly include ESM browser build in package (@lukastaegert) - [#2560](https://github.com/rollup/rollup/pull/2560): Show proper error when using `inlineDynamicImports` with `experimentalPreserveModules` (@clarkdo) ## 0.67.2 _2018-11-17_ ### Bug Fixes - Prevent crash when not returning sourcemaps from `renderChunk` plugin hook (#2558) ### Pull Requests - [#2558](https://github.com/rollup/rollup/pull/2558): Prevent crash when not returning sourcemaps from `renderChunk` (@kyle1320) ## 0.67.1 _2018-11-11_ ### Bug Fixes - Deconflict CLI entry points with same name but on different paths if no explicit naming is used (#2548) ### Pull Requests - [#2548](https://github.com/rollup/rollup/pull/2548): Deconflict CLI entry points with same name but on different paths if no explicit naming is used (@lukastaegert) ## 0.67.0 _2018-11-04_ ### Breaking Changes none ### Features - Do not resolve external dynamic imports via plugins to match the logic for static external imports again (#2505) - Support virtual modules created by plugins when preserving modules (#2511) - Add new `output.sourcemapExcludeSources` option to exclude the actual sources from sourcemaps (#2531) ### Bug Fixes - Fix TypeScript type for sourcemaps (#2507) - Fix order of external and inter-chunk imports to match the proper execution order (#2508) - Do not tree-shake children of unknown nodes to e.g. properly handle do-expressions via acorn plugin (#2510) - Prevent memory leak when using the bundle as cache (#2522) - Fix mis-placed semicolons for certain SystemJS exports (#2529) ### Pull Requests - [#2505](https://github.com/rollup/rollup/pull/2505): Do not resolve external dynamic imports via plugins (@lukastaegert) - [#2507](https://github.com/rollup/rollup/pull/2507): Fix public sourcemap type (@aMarCruz) - [#2508](https://github.com/rollup/rollup/pull/2508): Improve execution order of chunks and externals (@lukastaegert) - [#2510](https://github.com/rollup/rollup/pull/2510): Do not tree-shake children of unknown nodes to e.g. properly handle do-expressions via acorn plugin (@devsnek) - [#2511](https://github.com/rollup/rollup/pull/2511): Create chunks for virtual modules when preserving modules (@lukastaegert) - [#2522](https://github.com/rollup/rollup/pull/2522): Prevent memory leak when using the bundle as cache (@kyle1320) - [#2529](https://github.com/rollup/rollup/pull/2529): Fix mis-placed semicolons for certain SystemJS exports (@kyle1320) - [#2531](https://github.com/rollup/rollup/pull/2531): add `sourcemapExcludeSources` option to exclude the source content from sourcemaps (@kitsonk) ## 0.66.6 _2018-10-10_ - Properly deconflict function and class declaration ids of reassigned default exports ([#2502](https://github.com/rollup/rollup/pull/2502)) ## 0.66.5 _2018-10-09_ - Remove cache from memory once no longer needed ([#2496](https://github.com/rollup/rollup/pull/2496)) - Provide better error message when reexporting external namespace reexports ([#2499](https://github.com/rollup/rollup/pull/2499)) ## 0.66.4 _2018-10-04_ - Fix links in warnings and errors ([#2471](https://github.com/rollup/rollup/pull/2471)) ## 0.66.3 _2018-10-03_ - Detect side-effects in string.replace function arguments ([#2476](https://github.com/rollup/rollup/pull/2476)) - Make sure chunk ids are assigned before creating output bundle ([#2483](https://github.com/rollup/rollup/pull/2483)) - Use proper plugin name in error ([#2470](https://github.com/rollup/rollup/pull/2470)) - Update TypeScript version and fix type errors ([#2488](https://github.com/rollup/rollup/pull/2488)) ## 0.66.2 _2018-09-21_ - Add additional information to parse errors messages in JSON and other non-JS files ([#2466](https://github.com/rollup/rollup/pull/2466)) ## 0.66.1 _2018-09-19_ - Ignore falsy plugins ([#2464](https://github.com/rollup/rollup/pull/2464)) - Switch back to official TypeScript plugin ([#2465](https://github.com/rollup/rollup/pull/2465)) ## 0.66.0 _2018-09-16_ - Support ES2019 optional catch bindings ([#2455](https://github.com/rollup/rollup/pull/2455)) - Add option to transform paths within sourcemaps ([#2430](https://github.com/rollup/rollup/pull/2430)) - Add renderStart and renderEnd plugin hooks ([#2438](https://github.com/rollup/rollup/pull/2438)) - Expose ESM browser build and minify browser builds ([#2437](https://github.com/rollup/rollup/pull/2437) - Associate hoisted variables in function bodys with function parameters ([#2456](https://github.com/rollup/rollup/pull/2456)) - Fix issue when deconflicting variables used as pattern defaults ([#2446](https://github.com/rollup/rollup/pull/2446)) - Properly deconflict default exported class and function expressions with ids ([#2458](https://github.com/rollup/rollup/pull/2458)) - Faster internal test builds ([#2457](https://github.com/rollup/rollup/pull/2457)) - Switch to rollup-plugin-typescript2 ([#2460](https://github.com/rollup/rollup/pull/2460)) - Fix internal "perf" script ([#2433](https://github.com/rollup/rollup/pull/2433)) - Test that errors are passed to the buildEnd hook ([#2450](https://github.com/rollup/rollup/pull/2450)) ## 0.65.2 _2018-09-05_ - Prevent watch mode memory leak ([#2441](https://github.com/rollup/rollup/pull/2441)) ## 0.65.1 _2018-09-05_ - Prevent globbing when using chokidar ([#2432](https://github.com/rollup/rollup/pull/2432)) ## 0.65.0 _2018-08-25_ - Refactor and unify plugin system ([#2382](https://github.com/rollup/rollup/pull/2382)) - Implement plugin cache API ([#2389](https://github.com/rollup/rollup/pull/2389)) - Add watchChange plugin hook to watch changed files, deprecate asset dependencies ([#2405](https://github.com/rollup/rollup/pull/2405)) - Refine asset handling ([#2369](https://github.com/rollup/rollup/pull/2369)) - Implement `renderChunk` hook to replace `transformChunk` and `transformBundle` hooks ([#2406](https://github.com/rollup/rollup/pull/2406)) - Add rollup version to plugin context ([#2394](https://github.com/rollup/rollup/pull/2394)) - Do not resume stdin in watch mode to fix it for Lerna users ([#2410](https://github.com/rollup/rollup/pull/2410)) - Allow `[format]` placeholder for id generation ([#2387](https://github.com/rollup/rollup/pull/2387)) - Always log error stacks even when a code frame is given ([#2417](https://github.com/rollup/rollup/pull/2417)) - Do not test module ids starting with `\0` as external ([#2400](https://github.com/rollup/rollup/pull/2400)) - Fix tracing of namespace variables ([#2408](https://github.com/rollup/rollup/pull/2408)) - Fix re-tracing of namespace variables ([#2420](https://github.com/rollup/rollup/pull/2420)) - Properly wrap comment annotations in SystemJS exports ([#2408](https://github.com/rollup/rollup/pull/2408)) - Fix renaming of destructured parameters ([#2419](https://github.com/rollup/rollup/pull/2419)) - Do not display version in watch mode when using `--silent` ([#2392](https://github.com/rollup/rollup/pull/2392)) - Make `cacheExpiry` an experimental option for now ([#2401](https://github.com/rollup/rollup/pull/2401)) - Lint test configs on commit ([#2402](https://github.com/rollup/rollup/pull/2402)) - Add code of conduct ([#2388](https://github.com/rollup/rollup/pull/2388)) - Move to CircleCI ([#2390](https://github.com/rollup/rollup/pull/2390)) - Update pull request template ([#2404](https://github.com/rollup/rollup/pull/2404)) ## 0.64.1 _2018-08-07_ - Do not render initializers of hoisted variables in dead branches ([#2384](https://github.com/rollup/rollup/pull/2384)) ## 0.64.0 _2018-08-07_ - Print memory consumption together with performance timings ([#2370](https://github.com/rollup/rollup/pull/2370)) - Enable plugins to mark imports as external by returning false for resolveId ([#2351](https://github.com/rollup/rollup/pull/2351)) - Always retain empty manual chunks ([#2362](https://github.com/rollup/rollup/pull/2362)) - Ensure CLI warnings are shown on errors and add error for external id collisions ([#2334](https://github.com/rollup/rollup/pull/2334)) - Remove unnecessary dependency, update dependencies, fix linting of test config ([#2376](https://github.com/rollup/rollup/pull/2376)) - Add targeted Github issue templates ([#2356](https://github.com/rollup/rollup/pull/2356)) ## 0.63.5 _2018-08-01_ - Ensure onwrite plugin hooks execute in sequence ([#2364](https://github.com/rollup/rollup/pull/2364)) - Always warn when no name is provided for a global module ([#2359](https://github.com/rollup/rollup/pull/2359)) - Add utility type for user created plugins ([#2355](https://github.com/rollup/rollup/pull/2355)) - Remove deprecated es6 format from types ([#2349](https://github.com/rollup/rollup/pull/2349)) - Mark inlineDynamicImports as optional in types ([#2348](https://github.com/rollup/rollup/pull/2348)) ## 0.63.4 _2018-07-20_ - Use turbocolor instead of chalk ([#2339](https://github.com/rollup/rollup/pull/2339)) ## 0.63.3 _2018-07-20_ - Handle expressions where "in" and "instanceof" are applied to primitive values ([#2344](https://github.com/rollup/rollup/pull/2344)) ## 0.63.2 _2018-07-18_ - Fix bind order in for-of loops ([#2338](https://github.com/rollup/rollup/pull/2338)) ## 0.63.1 _2018-07-18_ ## 0.63.0 _2018-07-17_ - Fix many tree-shaking related issues ([#2315](https://github.com/rollup/rollup/pull/2315)) - Add experimental support for top-level await ([#2235](https://github.com/rollup/rollup/pull/2235)) - Prevent duplicate version printout in watch mode ([#2325](https://github.com/rollup/rollup/pull/2325)) - Respect error frames provided by plugins ([#2309](https://github.com/rollup/rollup/pull/2309)) - Add `esm` format alias to types ([#2327](https://github.com/rollup/rollup/pull/2327)) - Further unify internal test setup ([#2329](https://github.com/rollup/rollup/pull/2329)) ## 0.62.0 _2018-06-27_ - Add option to automatically shim missing exports ([#2118](https://github.com/rollup/rollup/pull/2118)) - Inline dynamic imports that are also imported statically and only used in a single chunk ([#2295](https://github.com/rollup/rollup/pull/2295)) - Handle caching and invalidation of assets ([#2267](https://github.com/rollup/rollup/pull/2267)) - Fix plugin related types ([#2299](https://github.com/rollup/rollup/pull/2299)) ## 0.61.2 _2018-06-23_ - Improve watcher error handling, only rebuild invalidated outputs ([#2296](https://github.com/rollup/rollup/pull/2296)) - Update dependencies, make watcher more stable ([#2297](https://github.com/rollup/rollup/pull/2297)) ## 0.61.1 _2018-06-21_ - Do not try to deconflict "undefined" ([#2291](https://github.com/rollup/rollup/pull/2291)) - Properly track values for loop interator declarations and reassigned namespaces, add smoke test ([#2292](https://github.com/rollup/rollup/pull/2292)) ## 0.61.0 _2018-06-20_ - Declare file dependencies via transform plugin hooks ([#2259](https://github.com/rollup/rollup/pull/2259)) - Handle undefined values when evaluating conditionals ([#2264](https://github.com/rollup/rollup/pull/2264)) - Handle known undefined properties when evaluating conditionals ([#2265](https://github.com/rollup/rollup/pull/2265)) - Access watch events via the plugin context ([#2261](https://github.com/rollup/rollup/pull/2261)) - Add option to suppress `__esModule` flag in output ([#2287](https://github.com/rollup/rollup/pull/2287)) - Fix issue when re-declaring variables, track reassignments in more cases ([#2279](https://github.com/rollup/rollup/pull/2279)) - Add VSCode debug settings ([#2276](https://github.com/rollup/rollup/pull/2276)) ## 0.60.7 _2018-06-14_ - Fix typing issue ([#2269](https://github.com/rollup/rollup/pull/2269)) ## 0.60.6 _2018-06-14_ - Track mutations of included virtual arrays ([#2263](https://github.com/rollup/rollup/pull/2263)) - Update readme ([#2266](https://github.com/rollup/rollup/pull/2266)) ## 0.60.5 _2018-06-14_ - Track deep reassignments of global and exported variables and improve performance ([#2254](https://github.com/rollup/rollup/pull/2254)) ## 0.60.4 _2018-06-13_ - Properly handle initially uninitialized exports and exports of globals in SystemJS output ([#2258](https://github.com/rollup/rollup/pull/2258)) ## 0.60.3 _2018-06-13_ - Fix types to allow watching an array of outputs ([#2262](https://github.com/rollup/rollup/pull/2262)) ## 0.60.2 _2018-06-11_ - Permit setting an asset's source in `generateBundle` ([#2256](https://github.com/rollup/rollup/pull/2256)) - Add automatic linting ([#2242](https://github.com/rollup/rollup/pull/2242)) ## 0.60.1 _2018-06-07_ - Fix plugin regressions ([#2246](https://github.com/rollup/rollup/pull/2246)) - Avoid conflicts for large numbers of variables ([#2244](https://github.com/rollup/rollup/pull/2244)) ## 0.60.0 _2018-06-06_ - New plugin hooks: transformChunk, buildStart, buildEnd; extended plugin context with warn, error, resolveId, isExternal, emitAsset, setAssetSource and getAssetFileName available to any hook ([#2208](https://github.com/rollup/rollup/pull/2208)) - [BREAKING] Deprecate the `legacy` option and thus IE8 support ([#2141](https://github.com/rollup/rollup/pull/2141)) - Detect more known extensions and load .mjs without extension ([#2211](https://github.com/rollup/rollup/pull/2211)) - Add compact output mode ([#2151](https://github.com/rollup/rollup/pull/2151)) - Significantly improve sourcemap generation performance ([#2228](https://github.com/rollup/rollup/pull/2228)) - Enable naming SystemJS modules ([#2028](https://github.com/rollup/rollup/pull/2028)) - Do not use alternate screen if clearScreen is set in watch mode ([#2125](https://github.com/rollup/rollup/pull/2125)) - Allow object input form for code-splitting in watch mode ([#2217](https://github.com/rollup/rollup/pull/2217)) - Track reassignments of methods of exports from outside ([#2240](https://github.com/rollup/rollup/pull/2240)) - Preserve id of default exported functions and classes ([#2234](https://github.com/rollup/rollup/pull/2234)) - Add semicolons after default exports ([#2209](https://github.com/rollup/rollup/pull/2209)) - Fix build problems on Windows ([#2232](https://github.com/rollup/rollup/pull/2232)) - Display install size in readme ([#2196](https://github.com/rollup/rollup/pull/2196)) - Improve preserve modules test ([#2236](https://github.com/rollup/rollup/pull/2236)) ## 0.59.4 _2018-05-28_ - Fix performance regression when many return statements are used ([#2218](https://github.com/rollup/rollup/pull/2218)) ## 0.59.3 _2018-05-24_ - Fix reassignment tracking for constructor parameters ([#2214](https://github.com/rollup/rollup/pull/2214)) ## 0.59.2 _2018-05-21_ - Fix reassignment tracking in for-in loops ([#2205](https://github.com/rollup/rollup/pull/2205)) ## 0.59.1 _2018-05-16_ - Fix infinite recursion when determining literal values of circular structures ([#2193](https://github.com/rollup/rollup/pull/2193)) - Fix invalid code when simplifying expressions without spaces ([#2194](https://github.com/rollup/rollup/pull/2194)) ## 0.59.0 _2018-05-15_ - Tree-shake statically analysable dynamic conditionals ([#2167](https://github.com/rollup/rollup/pull/2167)) - Do not emit empty chunks when code-splitting or empty files when preserving modules ([#2128](https://github.com/rollup/rollup/pull/2128)) - Support `import.meta.url` ([#2164](https://github.com/rollup/rollup/pull/2164)) - Add `esm` format alias ([#2102](https://github.com/rollup/rollup/pull/2102)) - Use alphanumeric base64 characters when deconflicting variables ([#2188](https://github.com/rollup/rollup/pull/2188)) - Improve handling of external modules imported as both default and named imports ([#2136](https://github.com/rollup/rollup/pull/2136)) - Properly deconflict named imports from other chunks ([#2177](https://github.com/rollup/rollup/pull/2177)) - Fix an issue with namespaces containing reexports ([#2157](https://github.com/rollup/rollup/pull/2157)) - Fix an issue with with incorrectly mapped default exports when code-splitting CJS or AMD modules ([#2178](https://github.com/rollup/rollup/pull/2178)) - Fix an issue with wrong paths of relative external imports ([#2160](https://github.com/rollup/rollup/pull/2160)) - Fix an issue when using default exports and `interop: false` ([#2149](https://github.com/rollup/rollup/pull/2149)) - Fix in issue with invalid syntax in SystemJS output ([#2187](https://github.com/rollup/rollup/pull/2187)) - Fix an issue when tree-shaking call expressions and reassigned variables ([#2186](https://github.com/rollup/rollup/pull/2186)) - Fix file paths in source maps ([#2161](https://github.com/rollup/rollup/pull/2161)) - Fix wrong file name in error message ([#2137](https://github.com/rollup/rollup/pull/2137)) - Always use npm 5 on CI ([#2185](https://github.com/rollup/rollup/pull/2185)) ## 0.58.2 _2018-04-23_ - Fix rendering of certain statically resolvable if statements ([#2146](https://github.com/rollup/rollup/pull/2146)) ## 0.58.1 _2018-04-18_ - Fix comment detection ([#2129](https://github.com/rollup/rollup/pull/2129)) ## 0.58.0 _2018-04-16_ - Support individual chunk names with optional content hashes ([#2068](https://github.com/rollup/rollup/pull/2068)) - Support manually created chunks ([#2084](https://github.com/rollup/rollup/pull/2084)) - Automatically import deep dependencies when code splitting for better performance ([#2073](https://github.com/rollup/rollup/pull/2073)) - Automatically minify internal export/import names for esm and system output ([#2087](https://github.com/rollup/rollup/pull/2087)) - Add option to automatically merge small chunks ([#2090](https://github.com/rollup/rollup/pull/2090)) - Significantly improve tree-shaking performance ([#2119](https://github.com/rollup/rollup/pull/2119)) - Enable tree-shaking for logical expressions ([#2098](https://github.com/rollup/rollup/pull/2098)) - Rework external types and reduce type related dependencies ([#2108](https://github.com/rollup/rollup/pull/2108)) - Support parallel dependency resolution ([#2116](https://github.com/rollup/rollup/pull/2116)) - Improve deprecation handling ([#2076](https://github.com/rollup/rollup/pull/2076)) - Enable `--perf` timings in watch mode ([#2065](https://github.com/rollup/rollup/pull/2065)) - Improve performance timers ([#2111](https://github.com/rollup/rollup/pull/2111)) - Improve error handling for plugins ([#2100](https://github.com/rollup/rollup/pull/2100)) - Improve error when using `--dir` in a single file build ([#2123](https://github.com/rollup/rollup/pull/2123)) - Do not warn for external imports that are unused due to tree-shaking ([#2124](https://github.com/rollup/rollup/pull/2124)) - Update mixed export warning message ([#2107](https://github.com/rollup/rollup/pull/2107)) - Remove duplicate badges from readme ([#2083](https://github.com/rollup/rollup/pull/2083)) - Update readme examples ([#2086](https://github.com/rollup/rollup/pull/2086)) ## 0.57.1 _2018-03-17_ - Improve sourcemap generation performance ([#2062](https://github.com/rollup/rollup/pull/2062)) - Add reserved config option namespace and improve CLI interface ([#2063](https://github.com/rollup/rollup/pull/2063)) - Fix issue with default exported function and class expressions ([#2059](https://github.com/rollup/rollup/pull/2059)) - Replace `forEach` with faster `for` loops in some places ([#2064](https://github.com/rollup/rollup/pull/2064)) ## 0.57.0 _2018-03-15_ - Add option to preserve the module structure instead of bundling ([#1922](https://github.com/rollup/rollup/pull/1922)) - Enable watch mode when code-splitting ([#2035](https://github.com/rollup/rollup/pull/2035)) - Optionally pass CLI commands to config file ([#1926](https://github.com/rollup/rollup/pull/1926)) - Option to add correct `.toString` tags to namespaces ([#2041](https://github.com/rollup/rollup/pull/2041)) - Option and scripts to display performance timings ([#2045](https://github.com/rollup/rollup/pull/2045)) - Fixes for exported or early accessed namespaces + improved namespace indentation ([#2041](https://github.com/rollup/rollup/pull/2041)) - Include missing TypeScript dependencies ([#1965](https://github.com/rollup/rollup/pull/1965)) - Add #\_PURE annotation to frozen namespaces ([#2044](https://github.com/rollup/rollup/pull/2044)) - Improve sourcemap and tree-shaking performance ([#2052](https://github.com/rollup/rollup/pull/2052)) - Inline sourcemap lookups and make rollup smaller ([#2055](https://github.com/rollup/rollup/pull/2055)) - Use updated magic-string types ([#2057](https://github.com/rollup/rollup/pull/2057)) - [BREAKING] Revert class id preservation from #2025 ([#2048](https://github.com/rollup/rollup/pull/2048)) - [BREAKING] Refactor missing export plugin hook ([#1987](https://github.com/rollup/rollup/pull/1987)) ## 0.56.5 _2018-03-07_ - Preserve ids when deconflicting classes ([#2025](https://github.com/rollup/rollup/pull/2025)) - Fix an issue with re-exported namespace imports ([#2034](https://github.com/rollup/rollup/pull/2034)) - Prevent an infinite loop when binding member expressions ([#1963](https://github.com/rollup/rollup/pull/1963)) - Convert code style via prettier ([#2031](https://github.com/rollup/rollup/pull/2031)) - Fix links in documentation ([#2026](https://github.com/rollup/rollup/pull/2026)) ## 0.56.4 _2018-03-05_ - Make rollup builds reproducible ([#2024](https://github.com/rollup/rollup/pull/2024)) - Improve error handling for source maps ([#2012](https://github.com/rollup/rollup/pull/2012)) - Properly handle SystemJS default exports without semicolons ([#2019](https://github.com/rollup/rollup/pull/2019)) - Properly handle importing the same variable several times when code-splitting ([#2020](https://github.com/rollup/rollup/pull/2020)) - Improve re-export tracing ([#2021](https://github.com/rollup/rollup/pull/2021)) - Apply "prettier" on commit ([#2017](https://github.com/rollup/rollup/pull/2017)) - Automatically clean up outdated tests ([#2009](https://github.com/rollup/rollup/pull/2009)) - Add SystemJS output to form tests ([#2022](https://github.com/rollup/rollup/pull/2022)) - Improve internal build configuration ([#2016](https://github.com/rollup/rollup/pull/2016)) ## 0.56.3 _2018-02-25_ - Fix issues around default exports and module facades ([#2001](https://github.com/rollup/rollup/pull/2001)) - Improve and fix internal chunk interface ([#1994](https://github.com/rollup/rollup/pull/1994)) - Fix superfluous semicolons added after declarations ([#1999](https://github.com/rollup/rollup/pull/1999)) - Improve code-splitting tests ([#1990](https://github.com/rollup/rollup/pull/1990)) ## 0.56.2 _2018-02-19_ - Fix handling of reassigned default exports ([#1975](https://github.com/rollup/rollup/pull/1975)) - Fix handling of renamed exports in entry points ([#1977](https://github.com/rollup/rollup/pull/1977)) - Update internal TypeScript version ([#1980](https://github.com/rollup/rollup/pull/1980)) - Omit compiled source files from published types ([#1981](https://github.com/rollup/rollup/pull/1981)) - Fix example in readme file ([#1984](https://github.com/rollup/rollup/pull/1984)) - Fix non-replaced dynamic imports in non-ESM output ([#1985](https://github.com/rollup/rollup/pull/1985)) ## 0.56.1 _2018-02-16_ - Fix regression when rendering switch statements ([#1971](https://github.com/rollup/rollup/pull/1971)) ## 0.56.0 _2018-02-15_ - Update to ECMAScript 2018 ([#1953](https://github.com/rollup/rollup/pull/1953)) - Rework tree-shaking rendering algorithm ([#1949](https://github.com/rollup/rollup/pull/1949)) - Tree-shake pure prototype calls on literals ([#1916](https://github.com/rollup/rollup/pull/1916)) - Expose AST parser to plugins ([#1945](https://github.com/rollup/rollup/pull/1945)) - Fix namespace re-export deconflicting ([#1960](https://github.com/rollup/rollup/pull/1960)) - Allow globals to be re-exported ([#1959](https://github.com/rollup/rollup/pull/1959)) - Fix internal performance timers ([#1966](https://github.com/rollup/rollup/pull/1966)) ## 0.55.5 _2018-02-10_ - Remove OpenCollective dependency ([#1915](https://github.com/rollup/rollup/pull/1915)) ## 0.55.4 _2018-02-09_ - Improve name deconflicting of external variables ([#1930](https://github.com/rollup/rollup/pull/1930)) - Improve re-export handling ([#1947](https://github.com/rollup/rollup/pull/1947)) - Mark preserveSymlinks option as optional ([#1939](https://github.com/rollup/rollup/pull/1939)) - Enable code-splitting tests to check directory structures ([#1924](https://github.com/rollup/rollup/pull/1924)) - Improve TypeScript definition test ([#1954](https://github.com/rollup/rollup/pull/1954)) ## 0.55.3 _2018-02-01_ - Remove OpenCollective dependency ([#1915](https://github.com/rollup/rollup/pull/1915)) ## 0.55.2 _2018-02-01_ - Add option to not follow symlinks ([#1819](https://github.com/rollup/rollup/pull/1819)) - Fix crash in windows shell ([#1928](https://github.com/rollup/rollup/pull/1928)) - Fix and test for external TypeScript errors ([#1903](https://github.com/rollup/rollup/pull/1903)) - Activate OpenCollective ([#1915](https://github.com/rollup/rollup/pull/1915)) - Optimize CI scripts ([#1921](https://github.com/rollup/rollup/pull/1921)) ## 0.55.1 _2018-01-26_ - Improve dynamic import workflow ([#1907](https://github.com/rollup/rollup/pull/1907)) - Properly handle multiple dynamic imports of the same module ([#1911](https://github.com/rollup/rollup/pull/1911)) - Fix import specifier deshadowing ([#1912](https://github.com/rollup/rollup/pull/1912)) - Allow plugin load hook to return an empty string ([#1908](https://github.com/rollup/rollup/pull/1908)) - Let onwarn handler accept strings ([#1905](https://github.com/rollup/rollup/pull/1905)) ## 0.55.0 _2018-01-23_ - Support code splitting ([#1841](https://github.com/rollup/rollup/pull/1841)) - Support SystemJS as output format ([#1897](https://github.com/rollup/rollup/pull/1897)) - Allow injecting acorn plugins ([#1857](https://github.com/rollup/rollup/pull/1857)) - Add `missingExport` plugin hook ([#1845](https://github.com/rollup/rollup/pull/1845)) - No longer parse config files via bublé ([#1899](https://github.com/rollup/rollup/pull/1899)) - Use externally maintained dynamic import acorn plugin ([#1891](https://github.com/rollup/rollup/pull/1891)) - Fix an error message ([#1886](https://github.com/rollup/rollup/pull/1886)) - Refactor internal rendering options ([#1900](https://github.com/rollup/rollup/pull/1900)) - Extract internal path resolution ([#1879](https://github.com/rollup/rollup/pull/1879)) - Extract internal bundle option handling ([#1880](https://github.com/rollup/rollup/pull/1880)) - Add import description type ([#1884](https://github.com/rollup/rollup/pull/1884)) - Clean up watch options types ([#1860](https://github.com/rollup/rollup/pull/1860)) - Clean up some tests ([#1888](https://github.com/rollup/rollup/pull/1888)) ## 0.54.1 _2018-01-17_ - Fix TypeScript errors in emitted type definitions ([#1871](https://github.com/rollup/rollup/pull/1871)) ## 0.54.0 _2018-01-12_ - Automatically inline locally resolvable dynamic imports ([#1816](https://github.com/rollup/rollup/pull/1816)) - Preserve directives in function bodies ([#1856](https://github.com/rollup/rollup/pull/1856)) - Refactor an error notification ([#1846](https://github.com/rollup/rollup/pull/1846)) - Refactor a wrong import ([#1863](https://github.com/rollup/rollup/pull/1863)) - Improve emitted TypeScript definitions ([#1864](https://github.com/rollup/rollup/pull/1864)) - Refactor unused import ([#1866](https://github.com/rollup/rollup/pull/1866)) ## 0.53.4 _2018-01-10_ - More type cleanup ([#1858](https://github.com/rollup/rollup/pull/1858)) - Use chalks internal helper to detect if colors should be used ([#1853](https://github.com/rollup/rollup/pull/1853)) - Refactor entity handling to use interfaces ([#1840](https://github.com/rollup/rollup/pull/1840)) - Use immutable.js internal types ([#1844](https://github.com/rollup/rollup/pull/1844)) - Ship `TypeScript` declaration files ([#1837](https://github.com/rollup/rollup/pull/1837)) ## 0.53.3 _2018-01-02_ - Use correct name when re-exporting from external modules ([#1794](https://github.com/rollup/rollup/pull/1794)) - Disable warnings when `resolveId` returns false ([#1825](https://github.com/rollup/rollup/pull/1825)) ## 0.53.2 _2017-12-30_ - Properly handle output arrays in the JavaScript API ([#1827](https://github.com/rollup/rollup/pull/1827)) ## 0.53.1 _2017-12-28_ - Properly deprecate more config options ([#1812](https://github.com/rollup/rollup/pull/1812)) - Pass output options to `transformBundle` plugin hook ([#1813](https://github.com/rollup/rollup/pull/1813)) ## 0.53.0 _2017-12-22_ - Experimental dynamic import support ([#1790](https://github.com/rollup/rollup/pull/1790)) - Unify config validation ([#1805](https://github.com/rollup/rollup/pull/1805)) ## 0.52.3 _2017-12-19_ - Properly hoist default exported functions in more situations ([#1799](https://github.com/rollup/rollup/pull/1799)) - Allow plugin transformations to not overwrite source maps by returning null ([#1797](https://github.com/rollup/rollup/pull/1797)) - Provide more parameters to "external" handler ([#1792](https://github.com/rollup/rollup/pull/1792)) ## 0.52.2 _2017-12-15_ - No longer ignore side-effects in JSON.parse and JSON.stringify ([#1785](https://github.com/rollup/rollup/pull/1785)) - Updated links in warnings ([#1776](https://github.com/rollup/rollup/pull/1776)) - No longer prevent self-imports ([#1777](https://github.com/rollup/rollup/pull/1777)) - Properly hoist default exported functions ([#1787](https://github.com/rollup/rollup/pull/1787)) - Prevent corruption when re-exporting default exports ([#1765](https://github.com/rollup/rollup/pull/1765)) ## 0.52.1 _2017-12-05_ - Improve deprecation warnings ([#1765](https://github.com/rollup/rollup/pull/1765)) - Properly use stdin ([#1774](https://github.com/rollup/rollup/pull/1774)) - Let --environment be used multiple times ([#1768](https://github.com/rollup/rollup/pull/1768)) - Always transpile config files ([#1759](https://github.com/rollup/rollup/pull/1759)) - Respect globals option in headers of UMD and IIFE files ([#1747](https://github.com/rollup/rollup/pull/1747)) ## 0.52.0 _2017-11-25_ - Accept config as promise ([#1731](https://github.com/rollup/rollup/pull/1731)) - Accept promises for intro/outro/banner/footer ([#1253](https://github.com/rollup/rollup/pull/1253)) - Option to prevent freezing of namespace imports ([#1696](https://github.com/rollup/rollup/pull/1696)) - Option to retain all output in watch mode ([#1688](https://github.com/rollup/rollup/pull/1688)) - Options to fine-tune treeshaking ([#1760](https://github.com/rollup/rollup/pull/1760)) ## 0.51.8 _2017-11-19_ - Fix speed problems by simplifying treeshaking reassignment handling ([#1740](https://github.com/rollup/rollup/pull/1740)) - Update dependencies ([#1742](https://github.com/rollup/rollup/pull/1742)) ## 0.51.7 _2017-11-17_ - Keep "this"-context when calling sequence expressions ([#1724](https://github.com/rollup/rollup/pull/1724)) ## 0.51.6 _2017-11-16_ - Use sourcemaps to determine error locations ([#1728](https://github.com/rollup/rollup/pull/1728)) ## 0.51.5 _2017-11-11_ - Fix regressions with uninitialised conditional expressions ([#1720](https://github.com/rollup/rollup/pull/1720)) ## 0.51.4 _2017-11-11_ - Fix regressions preventing builds ([#1725](https://github.com/rollup/rollup/pull/1725)) ## 0.51.3 _2017-11-10_ - Fix regression when treeshaking sequence expressions ([#1717](https://github.com/rollup/rollup/pull/1717)) ## 0.51.2 _2017-11-09_ - Fix treeshaking regression when labels are used inside functions ([#1712](https://github.com/rollup/rollup/pull/1712)) ## 0.51.1 _2017-11-08_ - Fix an issue with empty return statements ([#1704](https://github.com/rollup/rollup/pull/1704)) ## 0.51.0 _2017-11-08_ - Massive improvements to the treeshaking algorithm ([#1667](https://github.com/rollup/rollup/pull/1667)) ## 0.50.1 _2017-11-08_ - Fix treeshaking regression ([#1695](https://github.com/rollup/rollup/pull/1695)) - Treeshaking improvements ([#1650](https://github.com/rollup/rollup/pull/1650)) - Enable installation from Github ([#1670](https://github.com/rollup/rollup/pull/1670)) - Update documentation ([#1660](https://github.com/rollup/rollup/pull/1660)) ## 0.50.0 _2017-09-16_ - Many treeshaking improvements ([#1624](https://github.com/rollup/rollup/pull/1624)) - Show finish time in watch mode ([#1620](https://github.com/rollup/rollup/pull/1620)) ## 0.49.3 _2017-09-08_ - Respect `watch` options ([#1596](https://github.com/rollup/rollup/issues/1596)) - Fix treeshaking regressions ([#1604](https://github.com/rollup/rollup/pull/1604)) - Allow `-o` to work with `output.format` ([#1606](https://github.com/rollup/rollup/pull/1606)) ## 0.49.2 _2017-08-29_ - Fix treeshaking regressions ([#1591](https://github.com/rollup/rollup/pull/1591)) ## 0.49.1 _2017-08-28_ - Fix treeshaking regressions ([#1586](https://github.com/rollup/rollup/pull/1586)) ## 0.49.0 _2017-08-27_ - Completely update the treeshaking algorithm ([#1582](https://github.com/rollup/rollup/pull/1582)) - Only flip screen buffer if appropriate ([#1574](https://github.com/rollup/rollup/pull/1574)) - Guard against two instances creating the same dir ([#1576](https://github.com/rollup/rollup/pull/1576)) ## 0.48.2 - Paths is an output option ([#1569](https://github.com/rollup/rollup/pull/1569)) ## 0.48.1 - Print deprecation warnings in watch mode, and fix options when watcher restarts ([#1568](https://github.com/rollup/rollup/pull/1568)) ## 0.48.0 - Numerous changes to the `options` object and CLI arguments ([#1479](https://github.com/rollup/rollup/issues/1479)). See [this gist](https://gist.github.com/Rich-Harris/d472c50732dab03efeb37472b08a3f32) for a rundown. ## 0.47.6 - Set `process.env.ROLLUP_WATCH` _before_ loading config file ## 0.47.5 - Fix broken multi-bundle configs with `rollup.watch` ([#1532](https://github.com/rollup/rollup/issues/1532)) ## 0.47.4 - Delete cached config file before reloading in watch mode ## 0.47.3 - Deshadow aliased imports ([#1550](https://github.com/rollup/rollup/issues/1550)) ## 0.47.2 - Rebuild with dependency that npm randomly deleted ## 0.47.1 - Ignore external namespace imports when deshadowing ([#1547](https://github.com/rollup/rollup/issues/1547)) ## 0.47.0 - Watch config file, restart `rollup.watch` on change ([#1535](https://github.com/rollup/rollup/issues/1535)) - Correctly render `export { foo } from` declarations in `es` output ([#1543](https://github.com/rollup/rollup/pull/1543)) - Reinstate missing `rollup.VERSION` ## 0.46.3 - init for/for-of loop section head with correct scopes ([#1538](https://github.com/rollup/rollup/issues/1538), [#1539](https://github.com/rollup/rollup/issues/1539)) - Fix namespace imports and re-exports in `es` output ([#1511](https://github.com/rollup/rollup/issues/1511)) - Deshadow indirectly imported namespaces ([#1488](https://github.com/rollup/rollup/issues/1488), [#1505](https://github.com/rollup/rollup/issues/1505)) ## 0.46.2 - Pass options to `bundle.write` correctly in `rollup.watch` ([#1533](https://github.com/rollup/rollup/issues/1533)) - init for-in loop section head with correct scopes ([#1480](https://github.com/rollup/rollup/issues/1480)) - support `--no-interop` flag ([#1524](https://github.com/rollup/rollup/issues/1524)) ## 0.46.1 - Remove `rollup.watch` from browser build ([#1530](https://github.com/rollup/rollup/issues/1530)) - Remove `source-map-support` dependency ([#1528](https://github.com/rollup/rollup/issues/1528)) ## 0.46.0 - `options.format` is now required ([#1491](https://github.com/rollup/rollup/pull/1491)) - if `options.format` is `es6`, it will now throw an error (should be `es`) ([#1491](https://github.com/rollup/rollup/pull/1491)) - Add experimental `rollup.watch` method, replacing [rollup-watch](https://github.com/rollup/rollup-watch) ([#1491](https://github.com/rollup/rollup/pull/1491)) - Batch warnings together in CLI output ([#1491](https://github.com/rollup/rollup/pull/1491)) - Clear screen between rebuilds in `--watch` mode ([#1491](https://github.com/rollup/rollup/pull/1491)) - `onwarn` function's second argument is the default handler, allowing easier filtering without reimplementing any logic ([#1491](https://github.com/rollup/rollup/pull/1491)) - Prevent semi-colon removal after variable declaration that is for loop body ([#1275](https://github.com/rollup/rollup/issues/1275)) - Return `exports` for namespaced but non-extended IIFE bundles ([#1492](https://github.com/rollup/rollup/issues/1492)) - Fix scoping in switch statements ([#1498](https://github.com/rollup/rollup/pull/1498)) - Handle side-effects in tagged template expressions ([#1508](https://github.com/rollup/rollup/pull/1508)) - More descriptive error for missing options.format ([#1510](https://github.com/rollup/rollup/pull/1510)) - Refactor scope handling ([#1517](https://github.com/rollup/rollup/pull/1517)) - Handle failure of a config in multi-config build ([#1513](https://github.com/rollup/rollup/issues/1513)) ## 0.45.2 - Fix interop when import is a string ([#1486](https://github.com/rollup/rollup/issues/1486)) - Separate `resolvedIds` from `resolvedExternalIds` ([#1490](https://github.com/rollup/rollup/pull/1490)) - Add `--extend` flag to CLI ([#1482](https://github.com/rollup/rollup/pull/1482)) ## 0.45.1 - Remove `weak` from `optionalDependencies` ([#1483](https://github.com/rollup/rollup/issues/1483)) ## 0.45.0 - [BREAKING] `bundle.generate(...)` returns a Promise, so that `transformBundle` plugin hooks can be asynchronous ([#1474](https://github.com/rollup/rollup/issues/1474)) ## 0.44.0 - [BREAKING] Don't extend existing globals, unless `options.extend` is true ([#827](https://github.com/rollup/rollup/issues/827)) - Fix handling of catch clause parameters ([#1462](https://github.com/rollup/rollup/issues/1462)) ## 0.43.1 - Fix memory leak on incremental rebuilds ([#883](https://github.com/rollup/rollup/issues/883)) - Allow `this.warn` and `this.error` to accept a `{line, column}` object as an alternative to a character index ([#1265](https://github.com/rollup/rollup/issues/1265)) - Print more useful error if entry module is 'external' ([#1264](https://github.com/rollup/rollup/issues/1264)) - Catch errors in `bundle.generate` options ([#1463](https://github.com/rollup/rollup/pull/1463)) - Fix magic-string deprecation warning ([#1445](https://github.com/rollup/rollup/pull/1445)) ## 0.43.0 - Allow config files to import JSON ([#1426](https://github.com/rollup/rollup/issues/1426)) - Allow undefined imports in interop block ([#1341](https://github.com/rollup/rollup/issues/1341)) - Add `process.env.ROLLUP_WATCH = 'true'` in watch mode ([#1429](https://github.com/rollup/rollup/issues/1429)) - Add `pureExternalModules` option ([#1352](https://github.com/rollup/rollup/issues/1352)) - Allow plugins to specify `options.entry` ([#1270](https://github.com/rollup/rollup/issues/1270)) - Update dependencies ## 0.42.0 - Deprecate `options.moduleId` in favour of `options.amd.id` ([#1365](https://github.com/rollup/rollup/pull/1365)) - Add `options.amd.define` option to specify name of AMD `define` function ([#1365](https://github.com/rollup/rollup/pull/1365)) - Fix incorrect class removal with `treeshake: false` ([#1375](https://github.com/rollup/rollup/pull/1375)) - Deconflict module exports imported as namespaces ([#1384](https://github.com/rollup/rollup/issues/1384)) - Handle bare self-imports ([#1274](https://github.com/rollup/rollup/issues/1274)) - Allow config file to export an array of multiple configs ([#1389](https://github.com/rollup/rollup/pull/1389)) - Handle exponentiation operator, and fail gracefully on unknown operators ([#1416](https://github.com/rollup/rollup/issues/1416)) - Add `watch` option ([#1424](https://github.com/rollup/rollup/pull/1424)) ## 0.41.6 - Preserve `originalSourceMap` on incremental rebuilds for loaders with sourcemaps ([#1336](https://github.com/rollup/rollup/issues/1336)) ## 0.41.5 - Wrap ternary consequent/alternate sequences in parens ([#1273](https://github.com/rollup/rollup/issues/1273)) - Fix erroneous warning on multiple `export * from` declarations with defaults ([#1278](https://github.com/rollup/rollup/issues/1278)) - Prevent variable conflicts with `treeshake: false` ([#1268](https://github.com/rollup/rollup/issues/1268)) - Allow missing `source` when collapsing sourcemaps ([#1254](https://github.com/rollup/rollup/issues/1254)) - Allow plugins to log with strings ([#1316](https://github.com/rollup/rollup/pull/1316)) ## 0.41.4 - Fix cases of multiple `export * from 'external'` declarations ([#1252](https://github.com/rollup/rollup/issues/1252)) - Fix 'TODO' error message ([#1257](https://github.com/rollup/rollup/issues/1257)) ## 0.41.3 - Don't treat `this.foo` as possible namespace ([#1258](https://github.com/rollup/rollup/issues/1258)) ## 0.41.2 - Optimize `namespace['foo']` references ([#1240](https://github.com/rollup/rollup/pull/1240)) ## 0.41.1 - Include `new` expressions where callee is a class with side-effects ([#980](https://github.com/rollup/rollup/issues/980) [#1233](https://github.com/rollup/rollup/issues/1233)) ## 0.41.0 - Add `this.warn(...)` and `this.error(...)` methods to plugin `transform` hook contexts ([#1140](https://github.com/rollup/rollup/issues/1140)) - `throw` always considered to be a side effect ([#1227](https://github.com/rollup/rollup/pull/1227)) ## 0.40.2 - Add `file` property to sourcemaps for bundles with plugins ([#986](https://github.com/rollup/rollup/issues/986)) - Don't require globals for empty imports ([#1217](https://github.com/rollup/rollup/issues/1217)) ## 0.40.1 - Allow missing space between `export default` and declaration ([#1218](https://github.com/rollup/rollup/pull/1218)) ## 0.40.0 - [BREAKING] Better, more consistent error logging ([#1212](https://github.com/rollup/rollup/pull/1212)) - Don't use colours and emojis for non-TTY stderr ([#1201](https://github.com/rollup/rollup/issues/1201)) ## 0.39.2 - Prevent mutation of cached ASTs (fixes stack overflow with rollup-watch) ([#1205](https://github.com/rollup/rollup/pull/1205)) ## 0.39.1 - Ignore `var` initialisers in dead branches ([#1198](https://github.com/rollup/rollup/issues/1198)) ## 0.39.0 - [BREAKING] Warnings are objects, rather than strings ([#1194](https://github.com/rollup/rollup/issues/1194)) ## 0.38.3 - More informative warning for implicit external dependencies ([#1051](https://github.com/rollup/rollup/issues/1051)) - Warn when creating browser bundle with external dependencies on Node built-ins ([#1051](https://github.com/rollup/rollup/issues/1051)) - Statically analyse LogicalExpression nodes, for better dead code removal ([#1061](https://github.com/rollup/rollup/issues/1061)) ## 0.38.2 - Preserve `var` declarations in dead branches ([#997](https://github.com/rollup/rollup/issues/997)) - Warn if exporting a call expression that looks like a function declaration ([#1011](https://github.com/rollup/rollup/issues/1011)) - Wrap function expressions in parentheses if necessary ([#1011](https://github.com/rollup/rollup/issues/1011)) ## 0.38.1 - Fix sourcemap comment removal ([#1104](https://github.com/rollup/rollup/issues/1104)) - Warn if empty bundle is generated ([#444](https://github.com/rollup/rollup/issues/444)) - Support ES2017 syntax ([#492](https://github.com/rollup/rollup/issues/492)) - Remove unused imports from external modules ([#595](https://github.com/rollup/rollup/issues/595)) - Remove unused function and class declarations inside function bodies ([#1108](https://github.com/rollup/rollup/issues/1108), [#1178](https://github.com/rollup/rollup/issues/1178)) - Deconflict function expression IDs ([#1176](https://github.com/rollup/rollup/issues/1176)) ## 0.38.0 - [BREAKING] `export { foo as default }` creates live binding ([#1078](https://github.com/rollup/rollup/issues/1078)) - Prevent sourceMappingURL removal edge case ([#988](https://github.com/rollup/rollup/issues/988)) - Bind function expression IDs to the correct scope ([#1083](https://github.com/rollup/rollup/issues/1083)) - Correctly deshadow destructured parameters with assignments ([#1008](https://github.com/rollup/rollup/issues/1008)) ## 0.37.2 - Remove unused `new` expressions without side-effects ([#179](https://github.com/rollup/rollup/issues/179)) - Only remove valid sourceMappingURL comments ([#1132](https://github.com/rollup/rollup/issues/1132)) - Ensure blocks containing activated `var` declarations are included in output ([#1113](https://github.com/rollup/rollup/issues/1113)) - Support plugin outros ([#1116](https://github.com/rollup/rollup/issues/1116)) ## 0.37.1 - Follow symlinks ([#447](https://github.com/rollup/rollup/issues/447)) - Fix tree-shaking of recursive functions and other cases ([#1120](https://github.com/rollup/rollup/issues/1120), [#1142](https://github.com/rollup/rollup/issues/1142)) - Support module names that require quotes ([#582](https://github.com/rollup/rollup/issues/582), [#584](https://github.com/rollup/rollup/issues/584)) - Fix [#957](https://github.com/rollup/rollup/issues/957) ## 0.37.0 - [BREAKING] Default exports are not included in reified namespaces ([#1028](https://github.com/rollup/rollup/issues/1028)) - Parentheses do not defeat tree-shaking ([#1101](https://github.com/rollup/rollup/issues/1101), [#1128](https://github.com/rollup/rollup/issues/1128)) - More `legacy` fixes: do not create getters ([#1069](https://github.com/rollup/rollup/pull/1069)), do not include `__esModule` ([#1068](https://github.com/rollup/rollup/pull/1068)), quote reserved property names ([#1057](https://github.com/rollup/rollup/pull/1057)) - Fix missing namespace member warnings ([#1045](https://github.com/rollup/rollup/issues/1045)) - Fix TypeError in arrow function without braces returning a function ([#1062](https://github.com/rollup/rollup/pull/1062)) ## 0.36.4 - Only depend on program-level call expressions ([#977](https://github.com/rollup/rollup/issues/977)) ## 0.36.3 - Add `legacy` option for IE8 support ([#989](https://github.com/rollup/rollup/pull/989)) ## 0.36.2 - Insert semicolons where necessary to fix broken code ([#1004](https://github.com/rollup/rollup/issues/1004)) - Include module ID and location when warning about top-level `this` ([#1012](https://github.com/rollup/rollup/pull/1012)) - More informative error for missing exports ([#1033](https://github.com/rollup/rollup/issues/1033)) - `options.moduleContext` for per-module context overrides ([#1023](https://github.com/rollup/rollup/pull/1023)) ## 0.36.1 - Include naked block statements ([#981](https://github.com/rollup/rollup/issues/981)) - Correctly include falsy alternate statements in optimised if blocks ([#973](https://github.com/rollup/rollup/issues/973)) - Prevent omission of default exports that are only used by the exporting module ([#967](https://github.com/rollup/rollup/pull/967)) - Prevent warning on `auto` exports with ES output ([#966](https://github.com/rollup/rollup/pull/966)) ## 0.36.0 - `export { foo as default }` no longer creates a live binding ([#860](https://github.com/rollup/rollup/issues/860)) ## 0.35.15 - Warn on missing unused imports in deshadowing phase ([#928](https://github.com/rollup/rollup/issues/928)) - Always add a newline to the end of bundles ([#958](https://github.com/rollup/rollup/issues/958)) ## 0.35.14 - Include all parent statements of expression with effects, up to function boundary ([#930](https://github.com/rollup/rollup/issues/930)) ## 0.35.13 - Include superclasses when including their subclasses ([#932](https://github.com/rollup/rollup/issues/932)) ## 0.35.12 - Add `interop: false` option to disable unwrapping of external imports ([#939](https://github.com/rollup/rollup/issues/939)) ## 0.35.11 - Deconflict reified namespaces with other declarations ([#910](https://github.com/rollup/rollup/issues/910)) ## 0.35.10 - Only remove EmptyStatement nodes directly inside blocks ([#913](https://github.com/rollup/rollup/issues/931)) ## 0.35.9 - Support Node 0.12 ([#909](https://github.com/rollup/rollup/issues/909)) ## 0.35.8 - Correctly deshadow re-assigned module functions ([#910](https://github.com/rollup/rollup/issues/910)) ## 0.35.7 - Refactor `flushTime.js` ([#922](https://github.com/rollup/rollup/pull/922)) ## 0.35.6 - Fix browser build ## 0.35.5 - Allow empty for loop heads ([#919](https://github.com/rollup/rollup/issues/919)) ## 0.35.4 - Preserve effects in for-of and for-in loops ([#870](https://github.com/rollup/rollup/issues/870)) - Remove empty statements ([#918](https://github.com/rollup/rollup/pull/918)) ## 0.35.3 - Render identifiers inside template literals ## 0.35.2 - Fix broken build caused by out of date locally installed dependencies ## 0.35.1 - Rewrite deconflicted class identifiers ([#915](https://github.com/rollup/rollup/pull/915)) - Include `dependencies` in `bundle.modules` objects ([#903](https://github.com/rollup/rollup/issues/903)) - Update to Acorn 4 ([#914](https://github.com/rollup/rollup/pull/914)) ## 0.35.0 - Rewrite analysis/tree-shaking code ([#902](https://github.com/rollup/rollup/pull/902)) - Include conditional mutations of global objects ([#901](https://github.com/rollup/rollup/issues/901)) - Only reify namespaces if necessary ([#898](https://github.com/rollup/rollup/issues/898)) - Track mutations of aliased globals ([#893](https://github.com/rollup/rollup/issues/893)) - Include duplicated var declarations ([#716](https://github.com/rollup/rollup/issues/716)) ## 0.34.13 - Pass `{ format }` through to `transformBundle` ([#867](https://github.com/rollup/rollup/issues/867)) ## 0.34.12 - Fix `rollup --watch` ([#887](https://github.com/rollup/rollup/issues/887)) - Case-sensitive paths ([#862](https://github.com/rollup/rollup/issues/862)) ## 0.34.11 - Prevent leaky state when `bundle` is reused ([#875](https://github.com/rollup/rollup/issues/875)) - Ensure `intro` appears before interop block ([#880](https://github.com/rollup/rollup/issues/880)) ## 0.34.10 - Allow custom `options.context` to replace top-level `this` ([#851](https://github.com/rollup/rollup/issues/851)) - Fix `noConflict` when used via `rollup --config` ([#846](https://github.com/rollup/rollup/issues/846)) - Place `outro` block _after_ export block ([#852](https://github.com/rollup/rollup/issues/852)) ## 0.34.9 - Disable indentation by default, for faster bundle generation ([#812](https://github.com/rollup/rollup/pull/812)) - More helpful error on missing entry file ([#802](https://github.com/rollup/rollup/issues/802)) - Preserve comments before import declarations ([#815](https://github.com/rollup/rollup/pull/815)) ## 0.34.8 - Wrap UMD factory function in parens to avoid lazy parsing ([#774](https://github.com/rollup/rollup/pull/774)) ## 0.34.7 - Leave it up to resolveId to normalize the entry path ([#835](https://github.com/rollup/rollup/pull/835)) - Cache decoded mappings ([#834](https://github.com/rollup/rollup/pull/834)) ## 0.34.5 - Fix circular export ([#813](https://github.com/rollup/rollup/issues/813)) ## 0.34.4 - Module render performance tweak ([#823](https://github.com/rollup/rollup/pull/823)) ## 0.34.3 - Avoid infinite recursion in `Bundle.sort()` ([#800](https://github.com/rollup/rollup/pull/800)) ## 0.34.2 - resolveId calls are cached now to improve incremental build - Fixed error message recursion in plugins ## 0.34.1 - Support `paths` config ([#754](https://github.com/rollup/rollup/issues/754)) - Allow `export *` from external module, internally ## 0.34.0 - Use resolved IDs for relative imports that are also external modules, to allow `options.globals` to work with them ([#763](https://github.com/rollup/rollup/issues/763)) - Ensure reassigned exports are declared in an ES bundle, and remove empty `exports.foo;` statements ([#755](https://github.com/rollup/rollup/issues/755)) - Add newline after sourcemap comment ([#756](https://github.com/rollup/rollup/issues/756)) ## 0.33.2 - Add `bundle` as second argument to `ongenerate` and `onwrite` hooks ([#773](https://github.com/rollup/rollup/pull/773)) - Warn on top-level `this` ([#770](https://github.com/rollup/rollup/issues/770)) ## 0.33.1 - Fix `--no-strict` option ([#751](https://github.com/rollup/rollup/pull/751)) - Fix Windows edge case with case-sensitive paths ([#760](https://github.com/rollup/rollup/pull/760)) ## 0.33.0 - Downgrade missing transformer sourcemap to a warning, not an error, and print the name of the offending plugin if possible ([#746](https://github.com/rollup/rollup/issues/746)) - Warn if same name is re-exported from two modules ([#722](https://github.com/rollup/rollup/issues/722)) ## 0.32.4 - Add `ongenerate` and `onwrite` plugin hooks ([#742](https://github.com/rollup/rollup/pull/742)) ## 0.32.3 - Generated correct sourcemaps with reified namespaces ([#668](https://github.com/rollup/rollup/issues/668)) - Exclude plugin helper modules from sourcemaps ([#747](https://github.com/rollup/rollup/pull/747)) ## 0.32.2 - Allow `--globals` to work with `--external` or `options.external` in whatever configuration ([#743](https://github.com/rollup/rollup/issues/743)) ## 0.32.1 - Preserve side-effects to default exports that coincide with used named exports ([#733](https://github.com/rollup/rollup/issues/733)) - Support `rollup -c node:pkgname` ([#736](https://github.com/rollup/rollup/issues/736)) ## 0.32.0 - Deprecate `es6` format in favour of `es` ([#468](https://github.com/rollup/rollup/issues/468)) - Add correct `jsnext:main` build ([#726](https://github.com/rollup/rollup/pull/726)) ## 0.31.2 - Allow `load` plugins to provide sourcemap ([#715](https://github.com/rollup/rollup/pull/715)) - Allow `sourceMapFile` in config options ([#717](https://github.com/rollup/rollup/issues/717)) ## 0.31.1 - Logging for errors emitted by `rollup-watch` ([#712](https://github.com/rollup/rollup/issues/712)) ## 0.31.0 - Rewrite top-level `this` as `undefined` ([#707](https://github.com/rollup/rollup/pull/707)) - Pass `options.acorn` to Acorn ([#564](https://github.com/rollup/rollup/issues/564)) ## 0.30.0 - Bundle CLI ([#700](https://github.com/rollup/rollup/issues/700)) - Ensure absolute paths are normalised ([#704](https://github.com/rollup/rollup/issues/704)) - Allow `rollup --watch` to work with targets ## 0.29.1 - Merge `target` options with main options ([#701](https://github.com/rollup/rollup/issues/701)) - Update magic-string ([#690](https://github.com/rollup/rollup/issues/690)) ## 0.29.0 - `rollup --watch` ([#284](https://github.com/rollup/rollup/issues/284)) ## 0.28.0 - Experimental support for incremental rebuilds ([#658](https://github.com/rollup/rollup/pull/658)) ## 0.27.1 - Ensure names exported from a module are not replaced with reserved words ([#696](https://github.com/rollup/rollup/pull/696)) - Revert ([#692](https://github.com/rollup/rollup/pull/692)) – resolved IDs must be strings ## 0.27.0 - Use native promises instead of `es6-promise` ([#689](https://github.com/rollup/rollup/issues/689)) - Support multiple targets in config files ([#655](https://github.com/rollup/rollup/issues/655)) - Allow `resolveId` plugin functions to return non-strings ([#692](https://github.com/rollup/rollup/pull/692)) ## 0.26.7 - Distinguish between default and namespace imports of external module ([#637](https://github.com/rollup/rollup/issues/637)) - Add `__esModule` property to named exports in AMD, CJS and UMD modes ([#650](https://github.com/rollup/rollup/issues/650)) ## 0.26.6 - Deconflict named imports from external modules in ES bundles ([#659](https://github.com/rollup/rollup/issues/659)) - Support `options.preferConst` to generate `const` declarations for exports rather than `var` declarations ([#653](https://github.com/rollup/rollup/issues/653)) ## 0.26.5 - Preserve `debugger` statements ([#664](https://github.com/rollup/rollup/issues/664)) - Allow `options.external` to be a function ([#522](https://github.com/rollup/rollup/issues/522)) ## 0.26.4 - Prevent plugin-provided external IDs being normalised ([#630](https://github.com/rollup/rollup/issues/630), [#633](https://github.com/rollup/rollup/issues/633)) - Throw if module exports/re-exports the same name twice, or has multiple default exports ([#679](https://github.com/rollup/rollup/issues/679)) - Warn about `eval` security issue ([#675](<(https://github.com/rollup/rollup/issues/675)>)) ## 0.26.3 - Ensure reference is not incorrectly marked as a reassignment ([#648](https://github.com/rollup/rollup/issues/648)) ## 0.26.2 - Sanity check output of `load` hook ([#607](https://github.com/rollup/rollup/issues/607)) - Correct scoping for ID class expressions ([#626](https://github.com/rollup/rollup/issues/626)) - Warn if named and default exports are used together in auto mode ([#587](https://github.com/rollup/rollup/issues/587)) - Allow variable initialisers to be rewritten if necessary ([#632](https://github.com/rollup/rollup/issues/632)) - Prevent double `var` with no-treeshake option ([#639](https://github.com/rollup/rollup/pull/639)) ## 0.26.1 - Add `treeshake: false`/`--no-treeshake` option for debugging ([#505](https://github.com/rollup/rollup/issues/505)) - Update build process to use Bublé ([#620](https://github.com/rollup/rollup/pull/620)) ## 0.26.0 - Add `noConflict`/`--no-conflict` option for UMD builds ([#580](https://github.com/rollup/rollup/pull/580)) - Normalise relative external paths ([#591](https://github.com/rollup/rollup/pull/591)) - Report files causing transform errors ([#609](https://github.com/rollup/rollup/pull/609)) - Handle sourcemap segments with a single member ([#619](https://github.com/rollup/rollup/pull/619)) - Update dependencies ## 0.25.8 - Unixize entry path ([#586](https://github.com/rollup/rollup/pull/586)) ## 0.25.7 - Expand deshadowed shorthand properties ([#575](https://github.com/rollup/rollup/issues/575)) - Allow external files to be non-existent ([#532](https://github.com/rollup/rollup/issues/532)) ## 0.25.6 - Fix a regression introduced by #566 ([#569](https://github.com/rollup/rollup/issues/569)) - Prune dead conditional expressions more carefully ([#567](https://github.com/rollup/rollup/issues/567)) ## 0.25.5 - Make sure shorthand destructuring assignments don't break ([#528](https://github.com/rollup/rollup/issues/528)) - Allow 'exports' key ([#542](https://github.com/rollup/rollup/issues/542)) - Ensure `foo. bar` where `foo` is a namespace import is rewritten correctly ([#566](https://github.com/rollup/rollup/issues/566)) - Fix an edge case for exported globals (e.g. `export { document }`) ([#562](https://github.com/rollup/rollup/issues/562)) ## 0.25.4 - Fix misnamed exports of default imports in ES bundles ([#513](https://github.com/rollup/rollup/issues/513)) - CLI: warn on missing config ([#515](https://github.com/rollup/rollup/pull/515)) - Detect side-effects in non-top-level member expression assignment ([#476](https://github.com/rollup/rollup/issues/476)) - Don't remove computed property class keys ([#504](https://github.com/rollup/rollup/issues/504)) - Augment existing global object rather than replacing ([#493](https://github.com/rollup/rollup/issues/493)) - Don't fail on `export {}`, warn instead ([#486](https://github.com/rollup/rollup/issues/486)) ## 0.25.3 - Handle non-objects and `null` in `_interopDefault` ([#474](https://github.com/rollup/rollup/issues/474)) ## 0.25.2 - Skip dead branches of a conditional expression (#[465](https://github.com/rollup/rollup/pull/465)) - Allow globals to be exported ([#472](https://github.com/rollup/rollup/pull/472)) - Ensure reassigned exports are exported ([#484](https://github.com/rollup/rollup/issues/484)) ## 0.25.1 - Throw error if namespace is called ([#446](https://github.com/rollup/rollup/issues/446)) - Prevent shadowing bug in ES6 output ([#441](https://github.com/rollup/rollup/pull/441)) - Prevent `var exports.foo` ([#426](https://github.com/rollup/rollup/issues/426)) - Prevent double export of aliased symbols ([#438](https://github.com/rollup/rollup/issues/438)) - Provide more informative error if Rollup is used in-browser without appropriate `resolveId`/`load` hooks ([#275](https://github.com/rollup/rollup/issues/275)) - Use `_interopDefault` function to DRY out code with many external dependencies, in CommonJS output ([#458](https://github.com/rollup/rollup/pull/458)) ## 0.25.0 - **breaking** Module order is determined according to spec, rather than in a way designed to prevent runtime errors. Rollup will warn if it detects runtime errors are likely ([#435](https://github.com/rollup/rollup/issues/435)) - Prevent overly aggressive tree-shaking with complex call expressions ([#440](https://github.com/rollup/rollup/issues/440)) ## 0.24.1 - Handle calls to default exports other that are not function expressions or references to function declarations ([#421](https://github.com/rollup/rollup/issues/421)) - Ensure namespace blocks are created for chained imports ([#430](https://github.com/rollup/rollup/issues/430)) - Include references in computed property keys ([#434](https://github.com/rollup/rollup/issues/434)) - Use CLI `--external` option correctly ([#417](https://github.com/rollup/rollup/pull/417)) - Allow relative imports to be treated as external, if absolute paths are provided in `options.external` ([#410](https://github.com/rollup/rollup/issues/410)) - Make IIFE output adhere to Crockford style ([#415](https://github.com/rollup/rollup/pull/415)) ## 0.24.0 - No longer attempts to resolve IDs in `options.external` ([#407](https://github.com/rollup/rollup/issues/407)) - Fix broken sourcemap resolution in cases where some modules are transformed and others aren't ([#404](https://github.com/rollup/rollup/issues/404)) ## 0.23.2 - Ensure `dest` or `sourceMapFile` is resolved against CWD for purposes of sourcemap generation ([#344](https://github.com/rollup/rollup/issues/344)) - Support `banner`, `footer`, `intro` and `outro` options via CLI ([#330](https://github.com/rollup/rollup/issues/330)) - Allow `options.global` to be a function rather than an object, and warn on missing names ([#293](https://github.com/rollup/rollup/issues/293)) - Ensure side-effects are captured in cyclical call expressions ([#397](https://github.com/rollup/rollup/issues/397)) - Fix parse error with body-less arrow function expressions ([#403](https://github.com/rollup/rollup/issues/403)) ## 0.23.1 - Reinstate missing fix from ([#392](https://github.com/rollup/rollup/pull/392)) ## 0.23.0 - Add `bundleTransform` plugin hook and option ([#387](https://github.com/rollup/rollup/pull/387)) - Correctly store names in sourcemaps, regardless of transformers - Add `--environment` option to CLI ([#388](https://github.com/rollup/rollup/pull/388)) - Handle destructuring in exports ([#374](https://github.com/rollup/rollup/issues/374)) - Fix UMD global exports bug introduced in 0.22.1 ([#392](https://github.com/rollup/rollup/pull/392)) ## 0.22.2 - Prevent lost `var` keywords ([#390](https://github.com/rollup/rollup/issues/390)) ## 0.22.1 - Update expected option keys ([#379](https://github.com/rollup/rollup/issues/379)) - Handle transformers that return stringified sourcemaps ([#377](https://github.com/rollup/rollup/issues/377)) - Automatically create missing namespaces if `moduleName` contains dots ([#378](https://github.com/rollup/rollup/issues/378)) - Ignore external dependency warnings coming from config file ([#333](https://github.com/rollup/rollup/issues/333)) - Update to latest magic-string for performance boost ## 0.22.0 - Duplicate warnings are squelched ([#362](https://github.com/rollup/rollup/issues/362)) - Plugins can manipulate or override the `options` object ([#371](https://github.com/rollup/rollup/pull/371)) ## 0.21.3 - Validate option keys ([#348](https://github.com/rollup/rollup/pull/348)) - Allow namespaces imports to sit alongside named imports ([#355](https://github.com/rollup/rollup/issues/355)) - Count references inside destructured objects ([#364](https://github.com/rollup/rollup/issues/364)) - Preserve top-level `delete` statements ([#352](https://github.com/rollup/rollup/issues/352)) ## 0.21.2 - Missing relative imports are an error, not a warning ([#321](https://github.com/rollup/rollup/issues/321)) - Fixed incorrectly renamed default exports in ES6 bundles ([#339](https://github.com/rollup/rollup/issues/339)) - Fixed infinite recursion bug ([#341](https://github.com/rollup/rollup/issues/341)) ## 0.21.1 - Remove `aggressive: true` (was too aggressive) ([#309](https://github.com/rollup/rollup/pull/309)) - Handle top-level block statements ([#326](https://github.com/rollup/rollup/issues/326)) - Optimise namespaces with default exports ([#314](https://github.com/rollup/rollup/issues/314)) ## 0.21.0 - Only include statements whose side-effects are relevant (i.e. contribute to exports or affect global state) ([#253](https://github.com/rollup/rollup/pull/253)) ([#253](https://github.com/rollup/rollup/pull/253)) - Exclude dead branches from analysis and inclusion ([#249](https://github.com/rollup/rollup/pull/249)) - Add `aggressive: true` option to eliminate all side-effects outside entry module - More informative error when re-exporting non-existent binding ([#274](https://github.com/rollup/rollup/issues/274)) - Fix infinite recursion bug ([#291](https://github.com/rollup/rollup/issues/291)) - Log errors when using `rollup --config` ([#288](https://github.com/rollup/rollup/pull/288)) - Return rejected promises on startup instead of throwing error, if options are invalid ([#303](https://github.com/rollup/rollup/pull/303)) ## 0.20.5 - Ensure re-exports don't create a local binding ([#270](https://github.com/rollup/rollup/pull/270)) ## 0.20.4 - Check file exists at resolve time, to allow filenames with non-extension dots in them ([#250](https://github.com/rollup/rollup/pull/250)) - Import `Promise` where used, for Node 0.10 support ([#254](https://github.com/rollup/rollup/issues/254)) - Allow asynchronous transformer plugins ([#260](https://github.com/rollup/rollup/issues/260)) - Don't assume re-exported bindings are globals when deconflicting ([#267](https://github.com/rollup/rollup/issues/267)) ## 0.20.3 - Fix bug where multiple `export *` declarations caused error ([#244](https://github.com/rollup/rollup/pulls/244)) - Missing namespace exports are a warning, not an error ([#244](https://github.com/rollup/rollup/pulls/244)) - Plugins can provide `banner` and `footer` options (string, or function that returns a string) ([#235](https://github.com/rollup/rollup/issues/235)) - Warn on encountering `eval` ([#186](https://github.com/rollup/rollup/issues/186)) ## 0.20.2 - Handle errors in build config file - More robust deconflicting, in cases where e.g. `foo$1` already exists - Use Rollup CLI for own build process ## 0.20.1 - Support `--config` file to enable plugins with CLI ([#226](https://github.com/rollup/rollup/pulls/226)) - Prevent `default` being used as variable name ([#215](https://github.com/rollup/rollup/issues/215)) - Update deps ## 0.20.0 - Support for [plugins](https://github.com/rollup/rollup/wiki/Plugins) ([#207](https://github.com/rollup/rollup/pulls/207)) - BREAKING – `options.transform`, `options.load`, `options.resolveId`, `options.resolveExternal` and `options.external` are no longer supported, and should be handled by plugins. [More info](https://github.com/rollup/rollup/wiki/Plugins) - BREAKING – the .js extension is only added if it looks like there's no extension, allowing e.g. `import data from 'data.json'` (with the appropriate transformer). For safety, always include the file extension – import `./foo.js`, not `./foo` ## 0.19.2 - Fix exporting namespaces to include all of their exports ([#204](https://github.com/rollup/rollup/issues/204)) - Namespace exotic objects are frozen to ensure that its properties cannot be modified, reconfigured, redefined or deleted ([#203](https://github.com/rollup/rollup/pulls/203)) - Fix `ReferenceError: Promise is not defined` in node v0.10 ([#189](https://github.com/rollup/rollup/issues/189)) ## 0.19.1 - Fix `module.basename()` when used with custom `resolveId` function - Use [rollup-babel](https://github.com/rollup/rollup-babel) to build self - Exposed the version string through the API: `require( 'rollup' ).VERSION` ## 0.19.0 - **breaking** The `transform` option is no longer passed through to custom loaders. Loaders should only concern themselves with providing source code; transformation will _always_ take place - `options.transform` functions can return a string, or a `{code, map, ast}` object. Where possible, sourcemap chains will be flattened ([#175](https://github.com/rollup/rollup/pull/175)) - `options.resolveId`, `options.resolveExternal` and `options.load` can each be a function or an array of functions. If an array, the first non-null/undefined return value is used. In both cases, failed resolution/loading will fall back to the defaults, unless an error is thrown. ([#174](https://github.com/rollup/rollup/pull/174)) - New `intro` and `outro` options – similar to `banner` and `footer` except inserted _inside_ any format-specific wrapper - Multiple var declarations in an export block (e.g. `export let a = 1, b = 2`) are split up to facilitate tree-shaking ([#171](https://github.com/rollup/rollup/issues/171)) - More informative error when using a missing namespace property ([#169](https://github.com/rollup/rollup/pull/169)) - Update various dependencies ## 0.18.5 - Allow namespaces to be assigned to variables ([#168](https://github.com/rollup/rollup/issues/168)) - Promote `chalk` and `source-map-support` to `dependencies`, as they're used by the CLI ([#167](https://github.com/rollup/rollup/pull/167)) ## 0.18.4 - Make external modules configurable (i.e. `external.config.foo = 'bar'`) without erroring ## 0.18.3 - Crop indent exclusion ranges to exclude enclosing quotes ([#166](https://github.com/rollup/rollup/issues/166)) ## 0.18.2 - Include definitions of namespace members that are exported as defaults ## 0.18.1 - Include `acorn.parse` in bundle, remove `sander` from dependencies, simplify build ## 0.18.0 - Internal rewrite - Reinstate statically-analysable namespace imports - Avoid using getters in namespace blocks where possible ([#144](https://github.com/rollup/rollup/issues/144)) - Track variable aliases ([#96](https://github.com/rollup/rollup/issues/96)) - Prevent multiline strings being indented ([#164](https://github.com/rollup/rollup/issues/164)) ## 0.17.4 - Allow imports from hidden directories (replay of [#133](https://github.com/rollup/rollup/issues/133)) ## 0.17.3 - Handle parenthesised default exports ([#136](https://github.com/rollup/rollup/issues/136)) ## 0.17.2 - Allow use of scoped npm packages ([#131](https://github.com/rollup/rollup/issues/131)) ## 0.17.1 - Allow namespaces to be passed to a function ([#149](https://github.com/rollup/rollup/issues/149)) ## 0.17.0 - Roll back to 0.15.0 and reapply subsequent fixes pending resolution of ([#132](https://github.com/rollup/rollup/issues/132)) and related issues ## 0.16.4 - Fix import paths with `.` ([#133](https://github.com/rollup/rollup/issues/133)) - Prevent sourceMappingURL confusion leading to broken sourcemap - Add code coverage reporting [#130](https://github.com/rollup/rollup/pull/130)) - Add `modules` property to user-facing `bundle` – an array with `{id}` objects ([#128](https://github.com/rollup/rollup/issues/128)) ## 0.16.3 - Prevent adjacent blocks of multiple var declarations causing magic-string failure ([#105](https://github.com/rollup/rollup/issues/105)) ## 0.16.2 - Top-level function calls and assignments to globals are treated as side-effects, and always included - Import files from subdirectories of external packages, e.g. `import mod from 'foo/sub/mod'` ([#126](https://github.com/rollup/rollup/issues/126)) ## 0.16.1 - Handle assignment patterns, and destructured/rest parameters, when analysing scopes - Fix bug preventing project from self-building (make base `Identifier` class markable) ## 0.16.0 - Internal refactoring ([#99](https://github.com/rollup/rollup/pull/99)) - Optimisation for statically-analysable namespace imports ([#99](https://github.com/rollup/rollup/pull/99)) - Windows support (theoretically!) ([#117](https://github.com/rollup/rollup/pull/117) / [#119](https://github.com/rollup/rollup/pull/119)) ## 0.15.0 - Load all modules specified by `import` statements, and do tree-shaking synchronously once loading is complete. This results in simpler and faster code, and enables future improvements ([#97](https://github.com/rollup/rollup/pull/97)) - Only rewrite `foo` as `exports.foo` when it makes sense to ([#92](https://github.com/rollup/rollup/issues/92)) - Fix bug with shadowed variables that are eventually exported ([#91](https://github.com/rollup/rollup/issues/91)) - Exclude unused function declarations that happen to modify a used name ([#90](https://github.com/rollup/rollup/pull/90)) - Simplify internal `Scope` model – scopes always attach to blocks, never function expressions/declarations ## 0.14.1 - `export { name } from './other'` does not create a local binding ([#16](https://github.com/rollup/rollup/issues/16)) - A single binding can be exported under multiple names ([#18](https://github.com/rollup/rollup/issues/18)) - `useStrict` option exposed to CLI as `--strict`/`--no-strict` ([#81](https://github.com/rollup/rollup/issues/81)) - Neater exports from ES6 bundles ## 0.14.0 - Internal refactoring - Correctly deconflict generated default export names ([#72](https://github.com/rollup/rollup/issues/72)) - Handle `export { x } from 'y'` declarations ([#74](https://github.com/rollup/rollup/issues/74)) - Dedupe named imports from external modules in ES6 bundles ([#77](https://github.com/rollup/rollup/issues/77)) ## 0.13.0 - Support `banner` and `footer` options ([#66](https://github.com/rollup/rollup/pull/66)) - Remove pre-existing sourcemap comments ([#66](https://github.com/rollup/rollup/pull/66)) - Deconflict external imports ([#66](https://github.com/rollup/rollup/pull/66)) - Use existing AST, if provided ([#66](https://github.com/rollup/rollup/pull/66)) - Rename internal namespace exports as appropriate ([#66](https://github.com/rollup/rollup/pull/66)) - Remove uninitialised var declarations that get exported ([#66](https://github.com/rollup/rollup/pull/66)) - Rename variables named `exports` to avoid conflicts ([#66](https://github.com/rollup/rollup/pull/66)) ## 0.12.1 - Don't attempt to mark statements belonging to external modules ([#68](https://github.com/rollup/rollup/issues/68)) - Correctly deshadow variables that conflict with imports ([#68](https://github.com/rollup/rollup/issues/68)) ## 0.12.0 - Internal re-architecting, resulting in more efficient bundling with reduced memory usage - Shorthand properties are expanded if necessary ([#61](https://github.com/rollup/rollup/issues/61)) - Fixed various bugs with bundle external dependencies, particularly when generating ES6 bundles ([#59](https://github.com/rollup/rollup/issues/59)) - Add `--globals` option to CLI ([#60](https://github.com/rollup/rollup/pull/60)) - Allow imports of external modules for side-effects ([#55](https://github.com/rollup/rollup/pull/55)) - Prevent Rollup hanging on non-existent external module ([#54](https://github.com/rollup/rollup/pull/54)) ## 0.11.4 - Side-effect preservation applies to internal default exports ([#43](https://github.com/rollup/rollup/issues/43)) ## 0.11.3 - Class methods are not incorrectly renamed ([#42](https://github.com/rollup/rollup/issues/42)) - External modules are assigned names before canonical names are determined ([#42](https://github.com/rollup/rollup/issues/42)) ## 0.11.2 - Correctly handle computed properties (e.g. `foo[bar]`) when discovering dependencies ([#47](https://github.com/rollup/rollup/pull/47)) ## 0.11.1 - Support for `export * from '..'` ([#46](https://github.com/rollup/rollup/pull/46)) ## 0.11.0 - Experimental browser-friendly build (`dist/rollup.browser.js`) ([#25](https://github.com/rollup/rollup/issues/25)) - Internal re-architecting to make discovery process simpler and more performant - Preservation of side-effects that happen in a separate module to the affected definition ([#39](https://github.com/rollup/rollup/issues/39)) ## 0.10.0 - Better sorting algorithm – sorting happens at the module level, rather than the statement level. This avoids certain edge cases - IIFEs are ignored for the purposes of distinguishing between 'strong' and 'weak' dependencies - Empty `var` declarations for exported bindings are omitted ## 0.9.1 - Much faster statement insertion (fixes major 0.9.0 performance regression) ## 0.9.0 - BREAKING - `resolvePath` is now `resolveId`. The returned `id` (which by default is a filepath) is passed to the `load` function, which can optionally be overridden, and which is applied to all modules including the entry module. This allows custom resolver and loading logic for integration with third party systems (e.g. JSPM) or, eventually, in-browser usage ([#30](https://github.com/rollup/rollup/issues/30)) - A statement cannot appear after later statements from the same bundle ([#34](https://github.com/rollup/rollup/issues/34)) - Tricky cyclical dependencies are handled ([#36](https://github.com/rollup/rollup/issues/36)) - `sourcemap` option is used by CLI (was omitted previously) ## 0.8.3 - Correctly rename functions that have arguments with the same name ([#32](https://github.com/rollup/rollup/issues/32)) - Ensure unused default exports are given a legal name ([#33](https://github.com/rollup/rollup/issues/33)) ## 0.8.2 - Support `moduleId` and `moduleName` via CLI ([#24](https://github.com/rollup/rollup/issues/24)) ## 0.8.1 - Anonymous functions that are exported as default are converted to named function declarations for correct hoisting, rather than being bound to functions ([#29](https://github.com/rollup/rollup/issues/29)) - Automatically-generated default export names are deconflicted with local definitions ([#29](https://github.com/rollup/rollup/issues/29)) ## 0.8.0 - Top-level variable declarations with multiple declarators are split up, to avoid unnecessary code importing and incorrectly-ordered statements ([#26](https://github.com/rollup/rollup/issues/26)) - `this` at the top level is `undefined` ([#28](https://github.com/rollup/rollup/issues/28)) ## 0.7.8 - Avoid using `path.parse` - unsupported in node 0.10 ## 0.7.7 - Promise `source-map-support` from `devDependencies` to `dependencies` ([#23](https://github.com/rollup/rollup/issues/23)) ## 0.7.6 - Better placement of `export default` statements ([#21](https://github.com/rollup/rollup/issues/21)) - Prevent function calls and property assignments from being treated as rebinding for sake of unbound default exports - Add `--external foo,bar,baz` option to CLI (equivalent to `external: ['foo', 'bar', 'baz']`) - Add CLI tests ## 0.7.5 - Prevent accidental conflicts with the global namespace ([#20](https://github.com/rollup/rollup/issues/20)) ## 0.7.4 - More precise statement re-ordering to satisfy `export default` constraint (fixes bug introduced in 0.7.3) ## 0.7.3 - Default exports are not bound. To enable this, statements within a module are sorted to retain their original order ([#15](https://github.com/rollup/rollup/issues/15)) - Better positioning of comments ([#14](https://github.com/rollup/rollup/issues/14)) - Various fixes to get Travis-CI rigged up ## 0.7.2 - Fix sourcemap paths on Windows ([#6](https://github.com/rollup/rollup/pull/6)) ## 0.7.1 - Named functions can be used as default exports from a bundle - Method calls are assumed to mutate the owner (i.e. `foo.bar()` mutates `foo`) ([#13](https://github.com/rollup/rollup/issues/13)) - `options.indent` can be used to control indentation of resulting bundle. `options.true` (default) means 'auto', `options.false` means empty string. Alternatively specify whitespace e.g. `' '` or `'\t'` ([#5](https://github.com/rollup/rollup/issues/5)) ## 0.7.0 - Ensure statements are always separated by a newline ([#9](https://github.com/rollup/rollup/pull/9)) - Use CommonJS `exports` correctly (UMD exports) - Throw error if `moduleName` is required but missing (UMD exports) - Attach IIFE global to `this` rather than `window` - Allow names inside bundle to the the names of `Object.prototype` properties ([#12](https://github.com/rollup/rollup/pull/12)) - Keep exports live ([#11](https://github.com/rollup/rollup/pull/11)) ## 0.6.5 - Add sourceMappingURL comment to code, as appropriate - Higher resolution sourcemaps ## 0.6.4 - Fix CJS bundling with default export ## 0.6.3 - Fix exports and external module imports with some output formats - Fix endless cycle bug on Windows ([#3](https://github.com/rollup/rollup/pull/3)) - thanks @Bobris ## 0.6.2 - Permit assignments to properties of imported bindings ## 0.6.1 - Support for basic transformers ## 0.6.0 - BREAKING - `rollup.rollup` and `bundle.write` both take a single options argument - BREAKING - external modules must be declared upfront with `options.external: [...]` - Non-relative module paths will be resolved by looking for `jsnext:main` fields in the appropriate `package.json` files. This behaviour can be overridden by passing an alternative `resolveExternal` function - Fix sourcemap options - Include CLI files in npm package (duh) ## 0.5.0 - Command line interface - Sourcemap generation - Correct behaviour with `export { x as y } from 'z'` ## 0.4.1 - More import name deconflicting ## 0.4.0 - Self-hosting! `rollup.rollup` now rolls up rollup - Fix bug with comments inside a statement later being appended to it - Prevent shadowing of external modules - Rewrite computed property identifiers where necessary - Preserve original statement order where possible - Internal refactoring ## 0.3.1 - Saner deconflicting - Rename namespace imports from external modules correctly ## 0.3.0 - Basic functionality present, mostly spec-compliant ## 0.2.1 - Include dist files in npm package (duh) ## 0.2.0 - First release capable of doing anything useful - Still lots of basic functionality missing ## 0.1.0 - Initial experiment rollup-3.29.4/CODE_OF_CONDUCT.md000066400000000000000000000062041450520414700157310ustar00rootroot00000000000000# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: - Using welcoming and inclusive language - Being respectful of differing viewpoints and experiences - Gracefully accepting constructive criticism - Focusing on what is best for the community - Showing empathy towards other community members Examples of unacceptable behavior by participants include: - The use of sexualized language or imagery and unwelcome sexual attention or advances - Trolling, insulting/derogatory comments, and personal or political attacks - Public or private harassment - Publishing others' private information, such as a physical or electronic address, without explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at TODO. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version] [homepage]: https://contributor-covenant.org [version]: https://contributor-covenant.org/version/1/4/ rollup-3.29.4/CONTRIBUTING.md000066400000000000000000000153521450520414700153670ustar00rootroot00000000000000# Contribute ## Introduction First, thank you for considering contributing to rollup! It's people like you that make the open source community such a great community! 😊 We welcome any type of contribution, not only code. You can help with - **QA**: file bug reports, the more details you can give the better (i.e. [REPL](https://rollupjs.org/repl/)-links or repos that demonstrate the specific issue) - **Marketing**: writing blog posts, howto's, printing stickers, ... - **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ... - **Code**: take a look at the [open issues](https://github.com/rollup/rollup/issues). Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them. - **Money**: we welcome financial contributions in full transparency on our [open collective](https://opencollective.com/rollup). ## Your First Contribution Working on your first Pull Request? You can learn how from this _free_ course, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). ### Git configuration to enable symlinks The unit tests in this projects make use of symlinks in the git project. On Windows, this may not work as expected without extra configuration. To configure git to create symlinks on windows, you need to enable the Windows "Developer Mode" setting, and also set the `core.symlinks` git feature using either of the following commands: ```bash # Global setting git config --global core.symlinks true # Local setting git config core.symlinks true ``` After applying this setting, you may need to reset your local branch to ensure the files get rewritten as symlinks. Note that this step is destructive and you will want to push any changes you have made prior to resetting your branch. ```bash git reset --hard ``` ### How to run one test on your local machine With `npm run test` you can run all tests together. To save time for quick iterations, you can add `solo:true` to the `_config.js` file of any given test to run just this one test. To further speed up rebuilds, note that most tests just need the CommonJS build of Rollup. For those tests, it is enough to run ```shell npm run build:cjs npm run test:quick ``` Note that this does not run the browser tests and a few CLI tests will fail. ### Developing with the website Running ```shell npm run dev ``` will start the website locally in development mode via Vite. This will give you a live preview of the documentation. It will also verify that the documentation does not contain any dead links. A special feature of the website is that the REPL at `http://localhost:5173/repl/` is directly using the browser build of your local copy of Rollup created via Vite. It even supports full hot module replacement, which means that when you change anything within Rollup, the REPL will automatically rebundle the current code using your latest changes. This can come in very handy when working on a bug or tree-shaking improvement to allow extremely fast iterations. ## Submitting code Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests. ## Code review process The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge. It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you? Does it resolve any known Github issues? Adding a line "resolves #" (e.g. "resolves #23") to the description of your pull request or of a specific commit will automatically close this issue once the pull request is merged. ## Financial contributions We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/rollup). Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. ## Questions If you require technical assistance, [Stackoverflow](https://stackoverflow.com/questions/tagged/rollupjs) or [Discord](https://is.gd/rollup_chat) are usually the best places to start. You can also create an [issue](issue) (protip: do a quick search first to see if someone else didn't ask the same question before!). ## Credits ### Contributors Thank you to all the people who have already contributed to rollup! ### Backers Thank you to all our backers! [[Become a backer](https://opencollective.com/rollup#backer)] ### Sponsors Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/rollup#sponsor)) rollup-3.29.4/LICENSE-CORE.md000066400000000000000000000021571450520414700152670ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. rollup-3.29.4/LICENSE.md000066400000000000000000001066331450520414700145450ustar00rootroot00000000000000# Rollup core license Rollup is released under the MIT license: The MIT License (MIT) Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Licenses of bundled dependencies The published Rollup artifact additionally contains code with the following licenses: MIT, ISC # Bundled dependencies: ## @jridgewell/sourcemap-codec License: MIT By: Rich Harris Repository: git+https://github.com/jridgewell/sourcemap-codec.git > The MIT License > > Copyright (c) 2015 Rich Harris > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## @rollup/pluginutils License: MIT By: Rich Harris Repository: rollup/plugins --------------------------------------- ## acorn License: MIT By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine Repository: https://github.com/acornjs/acorn.git > MIT License > > Copyright (C) 2012-2022 by various contributors (see AUTHORS) > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## acorn-import-assertions License: MIT By: Sven Sauleau Repository: https://github.com/xtuc/acorn-import-assertions --------------------------------------- ## acorn-walk License: MIT By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine Repository: https://github.com/acornjs/acorn.git > MIT License > > Copyright (C) 2012-2020 by various contributors (see AUTHORS) > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## anymatch License: ISC By: Elan Shanker Repository: https://github.com/micromatch/anymatch > The ISC License > > Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com) > > Permission to use, copy, modify, and/or distribute this software for any > purpose with or without fee is hereby granted, provided that the above > copyright notice and this permission notice appear in all copies. > > THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES > WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF > MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR > ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES > WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN > ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR > IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------- ## binary-extensions License: MIT By: Sindre Sorhus Repository: sindresorhus/binary-extensions > MIT License > > Copyright (c) 2019 Sindre Sorhus (https://sindresorhus.com), Paul Miller (https://paulmillr.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## braces License: MIT By: Jon Schlinkert, Brian Woodward, Elan Shanker, Eugene Sharygin, hemanth.hm Repository: micromatch/braces > The MIT License (MIT) > > Copyright (c) 2014-2018, Jon Schlinkert. > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## builtin-modules License: MIT By: Sindre Sorhus Repository: sindresorhus/builtin-modules > MIT License > > Copyright (c) Sindre Sorhus (https://sindresorhus.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## chokidar License: MIT By: Paul Miller, Elan Shanker Repository: git+https://github.com/paulmillr/chokidar.git > The MIT License (MIT) > > Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the “Softwareâ€), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED “AS ISâ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## colorette License: MIT By: Jorge Bucaran Repository: jorgebucaran/colorette > Copyright © Jorge Bucaran <> > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## date-time License: MIT By: Sindre Sorhus Repository: sindresorhus/date-time > MIT License > > Copyright (c) Sindre Sorhus (https://sindresorhus.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## fill-range License: MIT By: Jon Schlinkert, Edo Rivai, Paul Miller, Rouven Weßling Repository: jonschlinkert/fill-range > The MIT License (MIT) > > Copyright (c) 2014-present, Jon Schlinkert. > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## flru License: MIT By: Luke Edwards Repository: lukeed/flru > MIT License > > Copyright (c) Luke Edwards (lukeed.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## glob-parent License: ISC By: Gulp Team, Elan Shanker, Blaine Bublitz Repository: gulpjs/glob-parent > The ISC License > > Copyright (c) 2015, 2019 Elan Shanker > > Permission to use, copy, modify, and/or distribute this software for any > purpose with or without fee is hereby granted, provided that the above > copyright notice and this permission notice appear in all copies. > > THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES > WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF > MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR > ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES > WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN > ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR > IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------- ## is-binary-path License: MIT By: Sindre Sorhus Repository: sindresorhus/is-binary-path > MIT License > > Copyright (c) 2019 Sindre Sorhus (https://sindresorhus.com), Paul Miller (https://paulmillr.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## is-extglob License: MIT By: Jon Schlinkert Repository: jonschlinkert/is-extglob > The MIT License (MIT) > > Copyright (c) 2014-2016, Jon Schlinkert > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## is-glob License: MIT By: Jon Schlinkert, Brian Woodward, Daniel Perez Repository: micromatch/is-glob > The MIT License (MIT) > > Copyright (c) 2014-2017, Jon Schlinkert. > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## is-number License: MIT By: Jon Schlinkert, Olsten Larck, Rouven Weßling Repository: jonschlinkert/is-number > The MIT License (MIT) > > Copyright (c) 2014-present, Jon Schlinkert. > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## is-reference License: MIT By: Rich Harris Repository: git+https://github.com/Rich-Harris/is-reference.git --------------------------------------- ## locate-character License: MIT By: Rich Harris Repository: git+https://gitlab.com/Rich-Harris/locate-character.git --------------------------------------- ## magic-string License: MIT By: Rich Harris Repository: https://github.com/rich-harris/magic-string > Copyright 2018 Rich Harris > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## normalize-path License: MIT By: Jon Schlinkert, Blaine Bublitz Repository: jonschlinkert/normalize-path > The MIT License (MIT) > > Copyright (c) 2014-2018, Jon Schlinkert. > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## parse-ms License: MIT By: Sindre Sorhus Repository: sindresorhus/parse-ms > MIT License > > Copyright (c) Sindre Sorhus (https://sindresorhus.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## picomatch License: MIT By: Jon Schlinkert Repository: micromatch/picomatch > The MIT License (MIT) > > Copyright (c) 2017-present, Jon Schlinkert. > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## pretty-bytes License: MIT By: Sindre Sorhus Repository: sindresorhus/pretty-bytes > MIT License > > Copyright (c) Sindre Sorhus (https://sindresorhus.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## pretty-ms License: MIT By: Sindre Sorhus Repository: sindresorhus/pretty-ms > MIT License > > Copyright (c) Sindre Sorhus (https://sindresorhus.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## readdirp License: MIT By: Thorsten Lorenz, Paul Miller Repository: git://github.com/paulmillr/readdirp.git > MIT License > > Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all > copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > SOFTWARE. --------------------------------------- ## signal-exit License: ISC By: Ben Coe Repository: https://github.com/tapjs/signal-exit.git > The ISC License > > Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors > > Permission to use, copy, modify, and/or distribute this software > for any purpose with or without fee is hereby granted, provided > that the above copyright notice and this permission notice > appear in all copies. > > THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES > WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES > OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE > LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES > OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, > WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, > ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------- ## time-zone License: MIT By: Sindre Sorhus Repository: sindresorhus/time-zone > MIT License > > Copyright (c) Sindre Sorhus (https://sindresorhus.com) > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- ## to-regex-range License: MIT By: Jon Schlinkert, Rouven Weßling Repository: micromatch/to-regex-range > The MIT License (MIT) > > Copyright (c) 2015-present, Jon Schlinkert. > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, subject to the following conditions: > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE SOFTWARE. --------------------------------------- ## yargs-parser License: ISC By: Ben Coe Repository: https://github.com/yargs/yargs-parser.git > Copyright (c) 2016, Contributors > > Permission to use, copy, modify, and/or distribute this software > for any purpose with or without fee is hereby granted, provided > that the above copyright notice and this permission notice > appear in all copies. > > THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES > WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES > OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE > LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES > OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, > WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, > ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. rollup-3.29.4/README.md000066400000000000000000000223771450520414700144220ustar00rootroot00000000000000

npm version install size code coverage backers sponsors license Join the chat at https://is.gd/rollup_chat

Rollup

## Overview Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library or application. It uses the standardized ES module format for code, instead of previous idiosyncratic solutions such as CommonJS and AMD. ES modules let you freely and seamlessly combine the most useful individual functions from your favorite libraries. Rollup can optimize ES modules for faster native loading in modern browsers, or output a legacy module format allowing ES module workflows today. ## Quick Start Guide Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/command-line-interface/) with an optional configuration file or else through its [JavaScript API](https://rollupjs.org/javascript-api/). Run `rollup --help` to see the available options and parameters. The starter project templates, [rollup-starter-lib](https://github.com/rollup/rollup-starter-lib) and [rollup-starter-app](https://github.com/rollup/rollup-starter-app), demonstrate common configuration options, and more detailed instructions are available throughout the [user guide](https://rollupjs.org/introduction/). ### Commands These commands assume the entry point to your application is named main.js, and that you'd like all imports compiled into a single file named bundle.js. For browsers: ```bash # compile to a '); } }; } rollup-3.29.4/cli/000077500000000000000000000000001450520414700136775ustar00rootroot00000000000000rollup-3.29.4/cli/cli.ts000066400000000000000000000013331450520414700150160ustar00rootroot00000000000000import process from 'node:process'; import help from 'help.md'; import { version } from 'package.json'; import argParser from 'yargs-parser'; import { commandAliases } from '../src/utils/options/mergeOptions'; import run from './run/index'; const command = argParser(process.argv.slice(2), { alias: commandAliases, configuration: { 'camel-case-expansion': false } }); if (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) { console.log(`\n${help.replace('__VERSION__', version)}\n`); } else if (command.version) { console.log(`rollup v${version}`); } else { try { // eslint-disable-next-line unicorn/prefer-module require('source-map-support').install(); } catch { // do nothing } run(command); } rollup-3.29.4/cli/help.md000066400000000000000000000152731450520414700151610ustar00rootroot00000000000000rollup version __VERSION__ ===================================== Usage: rollup [options] Basic options: -c, --config Use this config file (if argument is used but value is unspecified, defaults to rollup.config.js) -d, --dir Directory for chunks (if absent, prints to stdout) -e, --external Comma-separate list of module IDs to exclude -f, --format Type of output (amd, cjs, es, iife, umd, system) -g, --globals Comma-separate list of `moduleID:Global` pairs -h, --help Show this help message -i, --input Input (alternative to ) -m, --sourcemap Generate sourcemap (`-m inline` for inline map) -n, --name Name for UMD export -o, --file Single output file (if absent, prints to stdout) -p, --plugin Use the plugin specified (may be repeated) -v, --version Show version number -w, --watch Watch files in bundle and rebuild on changes --amd.autoId Generate the AMD ID based off the chunk name --amd.basePath Path to prepend to auto generated AMD ID --amd.define Function to use in place of `define` --amd.forceJsExtensionForImports Use `.js` extension in AMD imports --amd.id ID for AMD module (default is anonymous) --assetFileNames Name pattern for emitted assets --banner Code to insert at top of bundle (outside wrapper) --chunkFileNames Name pattern for emitted secondary chunks --compact Minify wrapper code --context Specify top-level `this` value --no-dynamicImportInCjs Write external dynamic CommonJS imports as require --entryFileNames Name pattern for emitted entry chunks --environment Settings passed to config file (see example) --no-esModule Do not add __esModule property --exports Specify export mode (auto, default, named, none) --extend Extend global variable defined by --name --no-externalImportAssertions Omit import assertions in "es" output --no-externalLiveBindings Do not generate code to support live bindings --failAfterWarnings Exit with an error if the build produced warnings --filterLogs Filter log messages --footer Code to insert at end of bundle (outside wrapper) --no-freeze Do not freeze namespace objects --generatedCode Which code features to use (es5/es2015) --generatedCode.arrowFunctions Use arrow functions in generated code --generatedCode.constBindings Use "const" in generated code --generatedCode.objectShorthand Use shorthand properties in generated code --no-generatedCode.reservedNamesAsProps Always quote reserved names as props --generatedCode.symbols Use symbols in generated code --no-hoistTransitiveImports Do not hoist transitive imports into entry chunks --no-indent Don't indent result --inlineDynamicImports Create single bundle when using dynamic imports --no-interop Do not include interop block --intro Code to insert at top of bundle (inside wrapper) --logLevel Which kind of logs to display --no-makeAbsoluteExternalsRelative Prevent normalization of external imports --maxParallelFileOps How many files to read in parallel --minifyInternalExports Force or disable minification of internal exports --noConflict Generate a noConflict method for UMD globals --outro Code to insert at end of bundle (inside wrapper) --perf Display performance timings --no-preserveEntrySignatures Avoid facade chunks for entry points --preserveModules Preserve module structure --preserveModulesRoot Put preserved modules under this path at root level --preserveSymlinks Do not follow symlinks when resolving files --no-sanitizeFileName Do not replace invalid characters in file names --shimMissingExports Create shim variables for missing exports --silent Don't print warnings --sourcemapBaseUrl Emit absolute sourcemap URLs with given base --sourcemapExcludeSources Do not include source code in source maps --sourcemapFile Specify bundle position for source maps --sourcemapFileNames Name pattern for emitted sourcemaps --stdin=ext Specify file extension used for stdin input --no-stdin Do not read "-" from stdin --no-strict Don't emit `"use strict";` in the generated modules --strictDeprecations Throw errors for deprecated features --no-systemNullSetters Do not replace empty SystemJS setters with `null` --no-treeshake Disable tree-shaking optimisations --no-treeshake.annotations Ignore pure call annotations --treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared --treeshake.manualPureFunctions Manually declare functions as pure --no-treeshake.moduleSideEffects Assume modules have no side effects --no-treeshake.propertyReadSideEffects Ignore property access side effects --no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking --no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw --validate Validate output --waitForBundleInput Wait for bundle input files --watch.buildDelay Throttle watch rebuilds --no-watch.clearScreen Do not clear the screen when rebuilding --watch.exclude Exclude files from being watched --watch.include Limit watching to specified files --watch.onBundleEnd Shell command to run on `"BUNDLE_END"` event --watch.onBundleStart Shell command to run on `"BUNDLE_START"` event --watch.onEnd Shell command to run on `"END"` event --watch.onError Shell command to run on `"ERROR"` event --watch.onStart Shell command to run on `"START"` event --watch.skipWrite Do not write files to disk when watching Examples: # use settings in config file rollup -c # in config file, process.env.INCLUDE_DEPS === 'true' # and process.env.BUILD === 'production' rollup -c --environment INCLUDE_DEPS,BUILD:production # create CommonJS bundle.js from src/main.js rollup --format=cjs --file=bundle.js -- src/main.js # create self-executing IIFE using `window.jQuery` # and `window._` as external globals rollup -f iife --globals jquery:jQuery,lodash:_ \ -i src/app.js -o build/app.js -m build/app.js.map Notes: * When piping to stdout, only inline sourcemaps are permitted For more information visit https://rollupjs.org rollup-3.29.4/cli/logging.ts000066400000000000000000000024251450520414700157000ustar00rootroot00000000000000import process from 'node:process'; import type { RollupError } from '../src/rollup/types'; import { bold, cyan, dim, red } from '../src/utils/colors'; import relativeId from '../src/utils/relativeId'; // log to stderr to keep `rollup main.js > bundle.js` from breaking export const stderr = (...parameters: readonly unknown[]) => process.stderr.write(`${parameters.join('')}\n`); export function handleError(error: RollupError, recover = false): void { const name = error.name || (error.cause as Error)?.name; const nameSection = name ? `${name}: ` : ''; const pluginSection = error.plugin ? `(plugin ${error.plugin}) ` : ''; const message = `${pluginSection}${nameSection}${error.message}`; const outputLines = [bold(red(`[!] ${bold(message.toString())}`))]; if (error.url) { outputLines.push(cyan(error.url)); } if (error.loc) { outputLines.push( `${relativeId((error.loc.file || error.id)!)} (${error.loc.line}:${error.loc.column})` ); } else if (error.id) { outputLines.push(relativeId(error.id)); } if (error.frame) { outputLines.push(dim(error.frame)); } if (error.stack) { outputLines.push(dim(error.stack?.replace(`${nameSection}${error.message}\n`, ''))); } outputLines.push('', ''); stderr(outputLines.join('\n')); if (!recover) process.exit(1); } rollup-3.29.4/cli/run/000077500000000000000000000000001450520414700145035ustar00rootroot00000000000000rollup-3.29.4/cli/run/batchWarnings.ts000066400000000000000000000224051450520414700176500ustar00rootroot00000000000000import { blue, cyan } from 'colorette'; import type { RollupLog } from '../../src/rollup/types'; import { bold, gray, yellow } from '../../src/utils/colors'; import { ensureArray } from '../../src/utils/ensureArray'; import { getLogFilter } from '../../src/utils/getLogFilter'; import { getNewArray, getOrCreate } from '../../src/utils/getOrCreate'; import { LOGLEVEL_DEBUG, LOGLEVEL_WARN } from '../../src/utils/logging'; import { printQuotedStringList } from '../../src/utils/printStringList'; import relativeId from '../../src/utils/relativeId'; import { getRollupUrl } from '../../src/utils/url'; import { URL_AVOIDING_EVAL, URL_NAME_IS_NOT_EXPORTED, URL_OUTPUT_EXPORTS, URL_OUTPUT_GLOBALS, URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT, URL_THIS_IS_UNDEFINED, URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY } from '../../src/utils/urls'; import { stderr } from '../logging'; import type { BatchWarnings } from './loadConfigFileType'; export default function batchWarnings(command: Record): BatchWarnings { const silent = !!command.silent; const logFilter = generateLogFilter(command); let count = 0; const deferredWarnings = new Map(); let warningOccurred = false; const add = (warning: RollupLog) => { count += 1; warningOccurred = true; if (silent) return; if (warning.code! in deferredHandlers) { getOrCreate(deferredWarnings, warning.code!, getNewArray).push(warning); } else if (warning.code! in immediateHandlers) { immediateHandlers[warning.code!](warning); } else { title(warning.message); defaultBody(warning); } }; return { add, get count() { return count; }, flush() { if (count === 0 || silent) return; const codes = [...deferredWarnings.keys()].sort( (a, b) => deferredWarnings.get(b)!.length - deferredWarnings.get(a)!.length ); for (const code of codes) { deferredHandlers[code](deferredWarnings.get(code)!); } deferredWarnings.clear(); count = 0; }, log(level, log) { if (!logFilter(log)) return; switch (level) { case LOGLEVEL_WARN: { return add(log); } case LOGLEVEL_DEBUG: { if (!silent) { stderr(bold(blue(log.message))); defaultBody(log); } return; } default: { if (!silent) { stderr(bold(cyan(log.message))); defaultBody(log); } } } }, get warningOccurred() { return warningOccurred; } }; } const immediateHandlers: { [code: string]: (warning: RollupLog) => void; } = { MISSING_NODE_BUILTINS(warning) { title(`Missing shims for Node.js built-ins`); stderr( `Creating a browser bundle that depends on ${printQuotedStringList( warning.ids! )}. You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node` ); }, UNKNOWN_OPTION(warning) { title(`You have passed an unrecognized option`); stderr(warning.message); } }; const deferredHandlers: { [code: string]: (warnings: RollupLog[]) => void; } = { CIRCULAR_DEPENDENCY(warnings) { title(`Circular dependenc${warnings.length > 1 ? 'ies' : 'y'}`); const displayed = warnings.length > 5 ? warnings.slice(0, 3) : warnings; for (const warning of displayed) { stderr(warning.ids!.map(relativeId).join(' -> ')); } if (warnings.length > displayed.length) { stderr(`...and ${warnings.length - displayed.length} more`); } }, EMPTY_BUNDLE(warnings) { title( `Generated${warnings.length === 1 ? ' an' : ''} empty ${ warnings.length > 1 ? 'chunks' : 'chunk' }` ); stderr(printQuotedStringList(warnings.map(warning => warning.names![0]))); }, EVAL(warnings) { title('Use of eval is strongly discouraged'); info(getRollupUrl(URL_AVOIDING_EVAL)); showTruncatedWarnings(warnings); }, MISSING_EXPORT(warnings) { title('Missing exports'); info(getRollupUrl(URL_NAME_IS_NOT_EXPORTED)); for (const warning of warnings) { stderr(bold(relativeId(warning.id!))); stderr(`${warning.binding} is not exported by ${relativeId(warning.exporter!)}`); stderr(gray(warning.frame!)); } }, MISSING_GLOBAL_NAME(warnings) { title(`Missing global variable ${warnings.length > 1 ? 'names' : 'name'}`); info(getRollupUrl(URL_OUTPUT_GLOBALS)); stderr( `Use "output.globals" to specify browser global variable names corresponding to external modules:` ); for (const warning of warnings) { stderr(`${bold(warning.id!)} (guessing "${warning.names![0]}")`); } }, MIXED_EXPORTS(warnings) { title('Mixing named and default exports'); info(getRollupUrl(URL_OUTPUT_EXPORTS)); stderr(bold('The following entry modules are using named and default exports together:')); warnings.sort((a, b) => (a.id! < b.id! ? -1 : 1)); const displayedWarnings = warnings.length > 5 ? warnings.slice(0, 3) : warnings; for (const warning of displayedWarnings) { stderr(relativeId(warning.id!)); } if (displayedWarnings.length < warnings.length) { stderr(`...and ${warnings.length - displayedWarnings.length} other entry modules`); } stderr( `\nConsumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.` ); }, NAMESPACE_CONFLICT(warnings) { title(`Conflicting re-exports`); for (const warning of warnings) { stderr( `"${bold(relativeId(warning.reexporter!))}" re-exports "${ warning.binding }" from both "${relativeId(warning.ids![0])}" and "${relativeId( warning.ids![1] )}" (will be ignored).` ); } }, PLUGIN_WARNING(warnings) { const nestedByPlugin = nest(warnings, 'plugin'); for (const { key: plugin, items } of nestedByPlugin) { const nestedByMessage = nest(items, 'message'); let lastUrl = ''; for (const { key: message, items } of nestedByMessage) { title(`Plugin ${plugin}: ${message}`); for (const warning of items) { if (warning.url && warning.url !== lastUrl) info((lastUrl = warning.url)); const id = warning.id || warning.loc?.file; if (id) { let loc = relativeId(id); if (warning.loc) { loc += `: (${warning.loc.line}:${warning.loc.column})`; } stderr(bold(loc)); } if (warning.frame) info(warning.frame); } } } }, SOURCEMAP_BROKEN(warnings) { title(`Broken sourcemap`); info(getRollupUrl(URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT)); const plugins = [...new Set(warnings.map(({ plugin }) => plugin).filter(Boolean))] as string[]; stderr( `Plugins that transform code (such as ${printQuotedStringList( plugins )}) should generate accompanying sourcemaps.` ); }, THIS_IS_UNDEFINED(warnings) { title('"this" has been rewritten to "undefined"'); info(getRollupUrl(URL_THIS_IS_UNDEFINED)); showTruncatedWarnings(warnings); }, UNRESOLVED_IMPORT(warnings) { title('Unresolved dependencies'); info(getRollupUrl(URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY)); const dependencies = new Map(); for (const warning of warnings) { getOrCreate(dependencies, relativeId(warning.exporter!), getNewArray).push( relativeId(warning.id!) ); } for (const [dependency, importers] of dependencies) { stderr(`${bold(dependency)} (imported by ${printQuotedStringList(importers)})`); } }, UNUSED_EXTERNAL_IMPORT(warnings) { title('Unused external imports'); for (const warning of warnings) { stderr( warning.names + ' imported from external module "' + warning.exporter + '" but never used in ' + printQuotedStringList(warning.ids!.map(relativeId)) + '.' ); } } }; function defaultBody(log: RollupLog): void { if (log.url) { info(getRollupUrl(log.url)); } const id = log.loc?.file || log.id; if (id) { const loc = log.loc ? `${relativeId(id)} (${log.loc.line}:${log.loc.column})` : relativeId(id); stderr(bold(relativeId(loc))); } if (log.frame) info(log.frame); } function title(string_: string): void { stderr(bold(yellow(`(!) ${string_}`))); } function info(url: string): void { stderr(gray(url)); } interface Nested { items: T[]; key: string; } function nest>(array: readonly T[], property: string): Nested[] { const nested: Nested[] = []; const lookup = new Map>(); for (const item of array) { const key = item[property]; getOrCreate(lookup, key, () => { const items = { items: [], key }; nested.push(items); return items; }).items.push(item); } return nested; } function showTruncatedWarnings(warnings: readonly RollupLog[]): void { const nestedByModule = nest(warnings, 'id'); const displayedByModule = nestedByModule.length > 5 ? nestedByModule.slice(0, 3) : nestedByModule; for (const { key: id, items } of displayedByModule) { stderr(bold(relativeId(id))); stderr(gray(items[0].frame!)); if (items.length > 1) { stderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`); } } if (nestedByModule.length > displayedByModule.length) { stderr(`\n...and ${nestedByModule.length - displayedByModule.length} other files`); } } function generateLogFilter(command: Record) { const filters = ensureArray(command.filterLogs).flatMap(filter => String(filter).split(',')); if (process.env.ROLLUP_FILTER_LOGS) { filters.push(...process.env.ROLLUP_FILTER_LOGS.split(',')); } return getLogFilter(filters); } rollup-3.29.4/cli/run/build.ts000066400000000000000000000042041450520414700161520ustar00rootroot00000000000000import process from 'node:process'; import ms from 'pretty-ms'; import { rollup } from '../../src/node-entry'; import type { MergedRollupOptions } from '../../src/rollup/types'; import { bold, cyan, green } from '../../src/utils/colors'; import { logOnlyInlineSourcemapsForStdout } from '../../src/utils/logs'; import relativeId from '../../src/utils/relativeId'; import { handleError, stderr } from '../logging'; import type { BatchWarnings } from './loadConfigFileType'; import { printTimings } from './timings'; export default async function build( inputOptions: MergedRollupOptions, warnings: BatchWarnings, silent = false ): Promise { const outputOptions = inputOptions.output; const useStdout = !outputOptions[0].file && !outputOptions[0].dir; const start = Date.now(); const files = useStdout ? ['stdout'] : outputOptions.map(t => relativeId(t.file || t.dir!)); if (!silent) { let inputFiles: string | undefined; if (typeof inputOptions.input === 'string') { inputFiles = inputOptions.input; } else if (Array.isArray(inputOptions.input)) { inputFiles = inputOptions.input.join(', '); } else if (typeof inputOptions.input === 'object' && inputOptions.input !== null) { inputFiles = Object.values(inputOptions.input).join(', '); } stderr(cyan(`\n${bold(inputFiles!)} → ${bold(files.join(', '))}...`)); } const bundle = await rollup(inputOptions as any); if (useStdout) { const output = outputOptions[0]; if (output.sourcemap && output.sourcemap !== 'inline') { handleError(logOnlyInlineSourcemapsForStdout()); } const { output: outputs } = await bundle.generate(output); for (const file of outputs) { if (outputs.length > 1) process.stdout.write(`\n${cyan(bold(`//→ ${file.fileName}:`))}\n`); process.stdout.write(file.type === 'asset' ? file.source : file.code); } if (!silent) { warnings.flush(); } return; } await Promise.all(outputOptions.map(bundle.write)); await bundle.close(); if (!silent) { warnings.flush(); stderr(green(`created ${bold(files.join(', '))} in ${bold(ms(Date.now() - start))}`)); if (bundle && bundle.getTimings) { printTimings(bundle.getTimings()); } } } rollup-3.29.4/cli/run/commandPlugins.ts000066400000000000000000000076321450520414700200430ustar00rootroot00000000000000import { resolve } from 'node:path'; import { pathToFileURL } from 'node:url'; import type { InputOptionsWithPlugins } from '../../src/rollup/types'; import { normalizePluginOption } from '../../src/utils/options/options'; import { stdinPlugin } from './stdin'; import { waitForInputPlugin } from './waitForInput'; export async function addCommandPluginsToInputOptions( inputOptions: InputOptionsWithPlugins, command: Record ): Promise { if (command.stdin !== false) { inputOptions.plugins.push(stdinPlugin(command.stdin)); } if (command.waitForBundleInput === true) { inputOptions.plugins.push(waitForInputPlugin()); } await addPluginsFromCommandOption(command.plugin, inputOptions); } export async function addPluginsFromCommandOption( commandPlugin: unknown, inputOptions: InputOptionsWithPlugins ): Promise { if (commandPlugin) { const plugins = await normalizePluginOption(commandPlugin); for (const plugin of plugins) { if (/[={}]/.test(plugin)) { // -p plugin=value // -p "{transform(c,i){...}}" await loadAndRegisterPlugin(inputOptions, plugin); } else { // split out plugins joined by commas // -p node-resolve,commonjs,buble for (const p of plugin.split(',')) { await loadAndRegisterPlugin(inputOptions, p); } } } } } async function loadAndRegisterPlugin( inputOptions: InputOptionsWithPlugins, pluginText: string ): Promise { let plugin: any = null; let pluginArgument: any = undefined; if (pluginText[0] === '{') { // -p "{transform(c,i){...}}" plugin = new Function('return ' + pluginText); } else { const match = pluginText.match(/^([\w./:@\\^{|}-]+)(=(.*))?$/); if (match) { // -p plugin // -p plugin=arg pluginText = match[1]; pluginArgument = new Function('return ' + match[3])(); } else { throw new Error(`Invalid --plugin argument format: ${JSON.stringify(pluginText)}`); } if (!/^\.|^rollup-plugin-|[/@\\]/.test(pluginText)) { // Try using plugin prefix variations first if applicable. // Prefix order is significant - left has higher precedence. for (const prefix of ['@rollup/plugin-', 'rollup-plugin-']) { try { plugin = await requireOrImport(prefix + pluginText); break; } catch { // if this does not work, we try requiring the actual name below } } } if (!plugin) { try { if (pluginText[0] == '.') pluginText = resolve(pluginText); // Windows absolute paths must be specified as file:// protocol URL // Note that we do not have coverage for Windows-only code paths else if (/^[A-Za-z]:\\/.test(pluginText)) { pluginText = pathToFileURL(resolve(pluginText)).href; } plugin = await requireOrImport(pluginText); } catch (error: any) { throw new Error(`Cannot load plugin "${pluginText}": ${error.message}.`); } } } // some plugins do not use `module.exports` for their entry point, // in which case we try the named default export and the plugin name if (typeof plugin === 'object') { plugin = plugin.default || plugin[getCamelizedPluginBaseName(pluginText)]; } if (!plugin) { throw new Error( `Cannot find entry for plugin "${pluginText}". The plugin needs to export a function either as "default" or "${getCamelizedPluginBaseName( pluginText )}" for Rollup to recognize it.` ); } inputOptions.plugins.push( typeof plugin === 'function' ? plugin.call(plugin, pluginArgument) : plugin ); } function getCamelizedPluginBaseName(pluginText: string): string { return (pluginText.match(/(@rollup\/plugin-|rollup-plugin-)(.+)$/)?.[2] || pluginText) .split(/[/\\]/) .slice(-1)[0] .split('.')[0] .split('-') .map((part, index) => (index === 0 || !part ? part : part[0].toUpperCase() + part.slice(1))) .join(''); } async function requireOrImport(pluginPath: string): Promise { try { // eslint-disable-next-line unicorn/prefer-module return require(pluginPath); } catch { return import(pluginPath); } } rollup-3.29.4/cli/run/getConfigPath.ts000066400000000000000000000025001450520414700175720ustar00rootroot00000000000000import { readdir } from 'node:fs/promises'; import { resolve } from 'node:path'; import { cwd } from 'node:process'; import { logMissingExternalConfig } from '../../src/utils/logs'; import { handleError } from '../logging'; const DEFAULT_CONFIG_BASE = 'rollup.config'; export async function getConfigPath(commandConfig: string | true): Promise { if (commandConfig === true) { return resolve(await findConfigFileNameInCwd()); } if (commandConfig.slice(0, 5) === 'node:') { const packageName = commandConfig.slice(5); try { // eslint-disable-next-line unicorn/prefer-module return require.resolve(`rollup-config-${packageName}`, { paths: [cwd()] }); } catch { try { // eslint-disable-next-line unicorn/prefer-module return require.resolve(packageName, { paths: [cwd()] }); } catch (error: any) { if (error.code === 'MODULE_NOT_FOUND') { handleError(logMissingExternalConfig(commandConfig)); } throw error; } } } return resolve(commandConfig); } async function findConfigFileNameInCwd(): Promise { const filesInWorkingDirectory = new Set(await readdir(cwd())); for (const extension of ['mjs', 'cjs', 'ts']) { const fileName = `${DEFAULT_CONFIG_BASE}.${extension}`; if (filesInWorkingDirectory.has(fileName)) return fileName; } return `${DEFAULT_CONFIG_BASE}.js`; } rollup-3.29.4/cli/run/index.ts000066400000000000000000000053641450520414700161720ustar00rootroot00000000000000import { env } from 'node:process'; import type { MergedRollupOptions } from '../../src/rollup/types'; import { logDuplicateImportOptions, logFailAfterWarnings } from '../../src/utils/logs'; import { isWatchEnabled } from '../../src/utils/options/mergeOptions'; import { getAliasName } from '../../src/utils/relativeId'; import { loadFsEvents } from '../../src/watch/fsevents-importer'; import { handleError } from '../logging'; import build from './build'; import { getConfigPath } from './getConfigPath'; import { loadConfigFile } from './loadConfigFile'; import type { BatchWarnings } from './loadConfigFileType'; import loadConfigFromCommand from './loadConfigFromCommand'; export default async function runRollup(command: Record): Promise { let inputSource; if (command._.length > 0) { if (command.input) { handleError(logDuplicateImportOptions()); } inputSource = command._; } else if (typeof command.input === 'string') { inputSource = [command.input]; } else { inputSource = command.input; } if (inputSource && inputSource.length > 0) { if (inputSource.some((input: string) => input.includes('='))) { command.input = {}; for (const input of inputSource) { const equalsIndex = input.indexOf('='); const value = input.slice(Math.max(0, equalsIndex + 1)); const key = input.slice(0, Math.max(0, equalsIndex)) || getAliasName(input); command.input[key] = value; } } else { command.input = inputSource; } } if (command.environment) { const environment = Array.isArray(command.environment) ? command.environment : [command.environment]; for (const argument of environment) { for (const pair of argument.split(',')) { const [key, ...value] = pair.split(':'); env[key] = value.length === 0 ? String(true) : value.join(':'); } } } if (isWatchEnabled(command.watch)) { await loadFsEvents(); const { watch } = await import('./watch-cli'); await watch(command); } else { try { const { options, warnings } = await getConfigs(command); try { for (const inputOptions of options) { await build(inputOptions, warnings, command.silent); } if (command.failAfterWarnings && warnings.warningOccurred) { warnings.flush(); handleError(logFailAfterWarnings()); } } catch (error: any) { warnings.flush(); handleError(error); } } catch (error: any) { handleError(error); } } } async function getConfigs( command: any ): Promise<{ options: MergedRollupOptions[]; warnings: BatchWarnings }> { if (command.config) { const configFile = await getConfigPath(command.config); const { options, warnings } = await loadConfigFile(configFile, command, false); return { options, warnings }; } return await loadConfigFromCommand(command, false); } rollup-3.29.4/cli/run/loadConfigFile.ts000066400000000000000000000114611450520414700177230ustar00rootroot00000000000000import { unlink, writeFile } from 'node:fs/promises'; import { dirname, isAbsolute, join } from 'node:path'; import process from 'node:process'; import { pathToFileURL } from 'node:url'; import * as rollup from '../../src/node-entry'; import type { MergedRollupOptions } from '../../src/rollup/types'; import { bold } from '../../src/utils/colors'; import { error, logCannotBundleConfigAsEsm, logCannotLoadConfigAsCjs, logCannotLoadConfigAsEsm, logMissingConfig } from '../../src/utils/logs'; import { mergeOptions } from '../../src/utils/options/mergeOptions'; import type { GenericConfigObject } from '../../src/utils/options/options'; import relativeId from '../../src/utils/relativeId'; import { stderr } from '../logging'; import batchWarnings from './batchWarnings'; import { addCommandPluginsToInputOptions, addPluginsFromCommandOption } from './commandPlugins'; import type { LoadConfigFile } from './loadConfigFileType'; export const loadConfigFile: LoadConfigFile = async ( fileName, commandOptions = {}, watchMode = false ) => { const configs = await getConfigList( getDefaultFromCjs(await getConfigFileExport(fileName, commandOptions, watchMode)), commandOptions ); const warnings = batchWarnings(commandOptions); try { const normalizedConfigs: MergedRollupOptions[] = []; for (const config of configs) { const options = await mergeOptions(config, watchMode, commandOptions, warnings.log); await addCommandPluginsToInputOptions(options, commandOptions); normalizedConfigs.push(options); } return { options: normalizedConfigs, warnings }; } catch (error_) { warnings.flush(); throw error_; } }; async function getConfigFileExport( fileName: string, commandOptions: Record, watchMode: boolean ) { if (commandOptions.configPlugin || commandOptions.bundleConfigAsCjs) { try { return await loadTranspiledConfigFile(fileName, commandOptions); } catch (error_: any) { if (error_.message.includes('not defined in ES module scope')) { return error(logCannotBundleConfigAsEsm(error_)); } throw error_; } } let cannotLoadEsm = false; const handleWarning = (warning: Error): void => { if (warning.message.includes('To load an ES module')) { cannotLoadEsm = true; } }; process.on('warning', handleWarning); try { const fileUrl = pathToFileURL(fileName); if (watchMode) { // We are adding the current date to allow reloads in watch mode fileUrl.search = `?${Date.now()}`; } return (await import(fileUrl.href)).default; } catch (error_: any) { if (cannotLoadEsm) { return error(logCannotLoadConfigAsCjs(error_)); } if (error_.message.includes('not defined in ES module scope')) { return error(logCannotLoadConfigAsEsm(error_)); } throw error_; } finally { process.off('warning', handleWarning); } } function getDefaultFromCjs(namespace: GenericConfigObject): unknown { return namespace.default || namespace; } async function loadTranspiledConfigFile( fileName: string, commandOptions: Record ): Promise { const { bundleConfigAsCjs, configPlugin, silent } = commandOptions; const warnings = batchWarnings(commandOptions); const inputOptions = { external: (id: string) => (id[0] !== '.' && !isAbsolute(id)) || id.slice(-5, id.length) === '.json', input: fileName, onwarn: warnings.add, plugins: [], treeshake: false }; await addPluginsFromCommandOption(configPlugin, inputOptions); const bundle = await rollup.rollup(inputOptions); const { output: [{ code }] } = await bundle.generate({ exports: 'named', format: bundleConfigAsCjs ? 'cjs' : 'es', plugins: [ { name: 'transpile-import-meta', resolveImportMeta(property, { moduleId }) { if (property === 'url') { return `'${pathToFileURL(moduleId).href}'`; } if (property == null) { return `{url:'${pathToFileURL(moduleId).href}'}`; } } } ] }); if (!silent && warnings.count > 0) { stderr(bold(`loaded ${relativeId(fileName)} with warnings`)); warnings.flush(); } return loadConfigFromWrittenFile( join(dirname(fileName), `rollup.config-${Date.now()}.${bundleConfigAsCjs ? 'cjs' : 'mjs'}`), code ); } async function loadConfigFromWrittenFile( bundledFileName: string, bundledCode: string ): Promise { await writeFile(bundledFileName, bundledCode); try { return (await import(pathToFileURL(bundledFileName).href)).default; } finally { // Not awaiting here saves some ms while potentially hiding a non-critical error unlink(bundledFileName); } } async function getConfigList(configFileExport: any, commandOptions: any): Promise { const config = await (typeof configFileExport === 'function' ? configFileExport(commandOptions) : configFileExport); if (Object.keys(config).length === 0) { return error(logMissingConfig()); } return Array.isArray(config) ? config : [config]; } rollup-3.29.4/cli/run/loadConfigFileType.d.ts000066400000000000000000000007451450520414700210120ustar00rootroot00000000000000import type { LogHandler, MergedRollupOptions, RollupLog } from '../../src/rollup/types'; export interface BatchWarnings { add: (warning: RollupLog) => void; readonly count: number; flush: () => void; log: LogHandler; readonly warningOccurred: boolean; } export type LoadConfigFile = typeof loadConfigFile; export function loadConfigFile( fileName: string, commandOptions: any, watchMode?: boolean ): Promise<{ options: MergedRollupOptions[]; warnings: BatchWarnings; }>; rollup-3.29.4/cli/run/loadConfigFromCommand.ts000066400000000000000000000016601450520414700212460ustar00rootroot00000000000000import process from 'node:process'; import type { MergedRollupOptions } from '../../src/rollup/types'; import { mergeOptions } from '../../src/utils/options/mergeOptions'; import batchWarnings from './batchWarnings'; import { addCommandPluginsToInputOptions } from './commandPlugins'; import type { BatchWarnings } from './loadConfigFileType'; import { stdinName } from './stdin'; export default async function loadConfigFromCommand( commandOptions: Record, watchMode: boolean ): Promise<{ options: MergedRollupOptions[]; warnings: BatchWarnings; }> { const warnings = batchWarnings(commandOptions); if (!commandOptions.input && (commandOptions.stdin || !process.stdin.isTTY)) { commandOptions.input = stdinName; } const options = await mergeOptions({ input: [] }, watchMode, commandOptions, warnings.log); await addCommandPluginsToInputOptions(options, commandOptions); return { options: [options], warnings }; } rollup-3.29.4/cli/run/resetScreen.ts000066400000000000000000000012131450520414700173320ustar00rootroot00000000000000import type { MergedRollupOptions } from '../../src/rollup/types'; import { stderr } from '../logging'; const CLEAR_SCREEN = '\u001Bc'; export function getResetScreen( configs: readonly MergedRollupOptions[], allowClearScreen: boolean | undefined ): (heading: string) => void { let clearScreen = allowClearScreen; for (const config of configs) { if (config.watch && config.watch.clearScreen === false) { clearScreen = false; } } if (clearScreen) { return (heading: string) => stderr(CLEAR_SCREEN + heading); } let firstRun = true; return (heading: string) => { if (firstRun) { stderr(heading); firstRun = false; } }; } rollup-3.29.4/cli/run/stdin.ts000066400000000000000000000016351450520414700162010ustar00rootroot00000000000000import process from 'node:process'; import type { Plugin } from '../../src/rollup/types'; export const stdinName = '-'; let stdinResult: Promise | null = null; export function stdinPlugin(argument: unknown): Plugin { const suffix = typeof argument == 'string' && argument.length > 0 ? '.' + argument : ''; return { load(id) { if (id === stdinName || id.startsWith(stdinName + '.')) { return stdinResult || (stdinResult = readStdin()); } }, name: 'stdin', resolveId(id) { if (id === stdinName) { return id + suffix; } } }; } function readStdin(): Promise { return new Promise((resolve, reject) => { const chunks: Buffer[] = []; process.stdin.setEncoding('utf8'); process.stdin .on('data', chunk => chunks.push(chunk)) .on('end', () => { const result = chunks.join(''); resolve(result); }) .on('error', error => { reject(error); }); }); } rollup-3.29.4/cli/run/timings.ts000066400000000000000000000010431450520414700165230ustar00rootroot00000000000000import prettyBytes from 'pretty-bytes'; import type { SerializedTimings } from '../../src/rollup/types'; import { bold, underline } from '../../src/utils/colors'; export function printTimings(timings: SerializedTimings): void { for (const [label, [time, memory, total]] of Object.entries(timings)) { const appliedColor = label[0] === '#' ? (label[1] === '#' ? bold : underline) : (text: string) => text; const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes(memory)} / ${prettyBytes(total)}`; console.info(appliedColor(row)); } } rollup-3.29.4/cli/run/waitForInput.ts000066400000000000000000000016311450520414700175070ustar00rootroot00000000000000import type { NormalizedInputOptions, Plugin, PluginContext } from '../../src/rollup/types'; import { bold } from '../../src/utils/colors'; import { stderr } from '../logging'; export function waitForInputPlugin(): Plugin { return { async buildStart(this: PluginContext, options: NormalizedInputOptions) { const inputSpecifiers = Array.isArray(options.input) ? options.input : Object.keys(options.input); let lastAwaitedSpecifier: string | null = null; checkSpecifiers: while (true) { for (const specifier of inputSpecifiers) { if ((await this.resolve(specifier)) === null) { if (lastAwaitedSpecifier !== specifier) { stderr(`waiting for input ${bold(specifier)}...`); lastAwaitedSpecifier = specifier; } await new Promise(resolve => setTimeout(resolve, 500)); continue checkSpecifiers; } } break; } }, name: 'wait-for-input' }; } rollup-3.29.4/cli/run/watch-cli.ts000066400000000000000000000114221450520414700167260ustar00rootroot00000000000000import type { FSWatcher } from 'node:fs'; import { readFile } from 'node:fs/promises'; import process from 'node:process'; import chokidar from 'chokidar'; import dateTime from 'date-time'; import ms from 'pretty-ms'; import { onExit } from 'signal-exit'; import * as rollup from '../../src/node-entry'; import type { MergedRollupOptions, RollupWatcher } from '../../src/rollup/types'; import { bold, cyan, green, underline } from '../../src/utils/colors'; import relativeId from '../../src/utils/relativeId'; import { handleError, stderr } from '../logging'; import { getConfigPath } from './getConfigPath'; import { loadConfigFile } from './loadConfigFile'; import type { BatchWarnings } from './loadConfigFileType'; import loadConfigFromCommand from './loadConfigFromCommand'; import { getResetScreen } from './resetScreen'; import { printTimings } from './timings'; import { createWatchHooks } from './watchHooks'; export async function watch(command: Record): Promise { process.env.ROLLUP_WATCH = 'true'; const isTTY = process.stderr.isTTY; const silent = command.silent; let watcher: RollupWatcher; let configWatcher: FSWatcher; let resetScreen: (heading: string) => void; const configFile = command.config ? await getConfigPath(command.config) : null; const runWatchHook = createWatchHooks(command); onExit(close as any); process.on('uncaughtException', closeWithError); if (!process.stdin.isTTY) { process.stdin.on('end', close); process.stdin.resume(); } async function loadConfigFromFileAndTrack(configFile: string): Promise { let configFileData: string | null = null; let configFileRevision = 0; configWatcher = chokidar.watch(configFile).on('change', reloadConfigFile); await reloadConfigFile(); async function reloadConfigFile() { try { const newConfigFileData = await readFile(configFile, 'utf8'); if (newConfigFileData === configFileData) { return; } configFileRevision++; const currentConfigFileRevision = configFileRevision; if (configFileData) { stderr(`\nReloading updated config...`); } configFileData = newConfigFileData; const { options, warnings } = await loadConfigFile(configFile, command, true); if (currentConfigFileRevision !== configFileRevision) { return; } if (watcher) { await watcher.close(); } start(options, warnings); } catch (error: any) { handleError(error, true); } } } if (configFile) { await loadConfigFromFileAndTrack(configFile); } else { const { options, warnings } = await loadConfigFromCommand(command, true); await start(options, warnings); } async function start(configs: MergedRollupOptions[], warnings: BatchWarnings): Promise { watcher = rollup.watch(configs as any); watcher.on('event', event => { switch (event.code) { case 'ERROR': { warnings.flush(); handleError(event.error, true); runWatchHook('onError'); break; } case 'START': { if (!silent) { if (!resetScreen) { resetScreen = getResetScreen(configs, isTTY); } resetScreen(underline(`rollup v${rollup.VERSION}`)); } runWatchHook('onStart'); break; } case 'BUNDLE_START': { if (!silent) { let input = event.input; if (typeof input !== 'string') { input = Array.isArray(input) ? input.join(', ') : Object.values(input as Record).join(', '); } stderr( cyan(`bundles ${bold(input)} → ${bold(event.output.map(relativeId).join(', '))}...`) ); } runWatchHook('onBundleStart'); break; } case 'BUNDLE_END': { warnings.flush(); if (!silent) stderr( green( `created ${bold(event.output.map(relativeId).join(', '))} in ${bold( ms(event.duration) )}` ) ); runWatchHook('onBundleEnd'); if (event.result && event.result.getTimings) { printTimings(event.result.getTimings()); } break; } case 'END': { runWatchHook('onEnd'); if (!silent && isTTY) { stderr(`\n[${dateTime()}] waiting for changes...`); } } } if ('result' in event && event.result) { event.result.close().catch(error => handleError(error, true)); } }); } async function close(code: number | null | undefined): Promise { process.removeListener('uncaughtException', closeWithError); // removing a non-existent listener is a no-op process.stdin.removeListener('end', close); if (watcher) await watcher.close(); if (configWatcher) configWatcher.close(); if (code) process.exit(code); } // return a promise that never resolves to keep the process running return new Promise(() => {}); } function closeWithError(error: Error): void { error.name = `Uncaught ${error.name}`; handleError(error); } rollup-3.29.4/cli/run/watchHooks.ts000066400000000000000000000021621450520414700171660ustar00rootroot00000000000000import { execSync } from 'node:child_process'; import type { RollupWatchHooks } from '../../src/rollup/types'; import { bold, cyan } from '../../src/utils/colors'; import { stderr } from '../logging'; function extractWatchHooks( command: Record ): Partial> { if (!Array.isArray(command.watch)) return {}; return command.watch .filter(value => typeof value === 'object') .reduce((accumulator, keyValueOption) => ({ ...accumulator, ...keyValueOption }), {}); } export function createWatchHooks(command: Record): (hook: RollupWatchHooks) => void { const watchHooks = extractWatchHooks(command); return function (hook: RollupWatchHooks): void { if (watchHooks[hook]) { const cmd = watchHooks[hook]!; if (!command.silent) { stderr(cyan(`watch.${hook} ${bold(`$ ${cmd}`)}`)); } try { // !! important - use stderr for all writes from execSync const stdio = [process.stdin, process.stderr, process.stderr]; execSync(cmd, { stdio: command.silent ? 'ignore' : stdio }); } catch (error) { stderr((error as Error).message); } } }; } rollup-3.29.4/codecov.yml000066400000000000000000000000771450520414700153010ustar00rootroot00000000000000codecov: require_ci_to_pass: no notify: wait_for_ci: norollup-3.29.4/docs/000077500000000000000000000000001450520414700140605ustar00rootroot00000000000000rollup-3.29.4/docs/.vitepress/000077500000000000000000000000001450520414700161625ustar00rootroot00000000000000rollup-3.29.4/docs/.vitepress/config.ts000066400000000000000000000074511450520414700200060ustar00rootroot00000000000000import alias from '@rollup/plugin-alias'; import { defineConfig } from 'vitepress'; import { moduleAliases } from '../../build-plugins/aliases'; import replaceBrowserModules from '../../build-plugins/replace-browser-modules'; import '../declarations.d'; import { examplesPlugin } from './create-examples'; import { renderMermaidGraphsPlugin } from './mermaid'; import { transposeTables } from './transpose-tables'; import { buildEnd, callback, transformPageData } from './verify-anchors'; export default defineConfig({ buildEnd, description: 'compile JS code', head: [ ['link', { href: '/favicon.png', rel: 'icon', type: 'image/png' }], ['link', { href: '/favicon.png', rel: 'apple-touch-icon', sizes: '128x128' }], ['link', { href: '/manifest.json', rel: 'manifest' }], ['meta', { content: '#333333', name: 'theme-color' }], ['meta', { content: 'yes', name: 'mobile-web-app-capable' }], ['meta', { content: 'default', name: 'apple-mobile-web-app-status-bar-style' }], ['meta', { content: 'summary_large_image', name: 'twitter:card' }], ['meta', { content: '@rollupjs', name: 'twitter:site' }], ['meta', { content: '@rollupjs', name: 'twitter:creator' }], ['meta', { content: 'Rollup', name: 'twitter:title' }], ['meta', { content: 'The JavaScript module bundler', name: 'twitter:description' }], ['meta', { content: 'https://rollupjs.org/twitter-card.jpg', name: 'twitter:image' }] ], locales: { root: { label: 'English' }, zh: { label: '简体中文', link: 'https://cn.rollupjs.org' } }, markdown: { anchor: { callback, level: 2 }, config(md) { transposeTables(md); }, linkify: false, toc: { level: [2, 3, 4] } }, themeConfig: { algolia: { apiKey: '233d24494bdf54811b5c3181883b5ee3', appId: 'V5XQ4IDZSG', indexName: 'rollupjs' }, editLink: { pattern: 'https://github.com/rollup/rollup/edit/master/docs/:path', text: 'Edit this page on GitHub' }, footer: { copyright: 'Copyright © 2015-present Rollup contributors', message: 'Released under the MIT License.' }, logo: '/rollup-logo.svg', nav: [ { link: '/introduction/', text: 'guide' }, { link: '/repl/', text: 'repl' }, { link: 'https://is.gd/rollup_chat', text: 'chat' }, { link: 'https://opencollective.com/rollup', text: 'opencollective' } ], outline: 'deep', sidebar: [ { items: [ { link: '/introduction/', text: 'Introduction' }, { link: '/command-line-interface/', text: 'Command Line Interface' }, { link: '/javascript-api/', text: 'Javascript API' } ], text: 'Getting started' }, { items: [ { link: '/tutorial/', text: 'Tutorial' }, { link: '/es-module-syntax/', text: 'ES Module Syntax' }, { link: '/faqs/', text: 'Frequently Asked Questions' }, { link: '/troubleshooting/', text: 'Troubleshooting' }, { link: '/migration/', text: 'Migrating to Rollup 3' }, { link: '/tools/', text: 'Other Tools' } ], text: 'More info' }, { items: [ { link: '/configuration-options/', text: 'Configuration Options' }, { link: '/plugin-development/', text: 'Plugin Development' } ], text: 'API' } ], socialLinks: [ { icon: 'github', link: 'https://github.com/rollup/rollup' }, { icon: 'mastodon', link: 'https://m.webtoo.ls/@rollupjs' } ] }, title: 'Rollup', transformPageData, vite: { plugins: [ renderMermaidGraphsPlugin(), replaceBrowserModules(), { apply: 'build', enforce: 'pre', name: 'replace-local-rollup', resolveId(source) { if (source.includes('/browser-entry')) { return false; } } }, examplesPlugin(), alias(moduleAliases) ] } }); rollup-3.29.4/docs/.vitepress/create-examples.ts000066400000000000000000000036261450520414700216200ustar00rootroot00000000000000import { readFile } from 'node:fs/promises'; import type { Plugin } from 'vite'; import type { RollupOptions } from '../../src/rollup/types'; import type { Example, Module } from '../types'; import { getFilesInDirectory } from './helpers'; const examplesDirectory = new URL('../repl/examples', import.meta.url); export function examplesPlugin(): Plugin { return { async load(id) { if (id === 'examples.json') { const exampleFiles = await getFilesInDirectory(examplesDirectory); const examples: Example[] = await Promise.all( exampleFiles.map(async id => { const { entryModules = ['main.js'], options = {}, title }: { entryModules?: string[]; options?: RollupOptions; title: string; } = JSON.parse( await readFile(new URL(`examples/${id}/example.json`, examplesDirectory), 'utf8') ); const moduleFiles = await getFilesInDirectory( new URL(`examples/${id}/modules`, examplesDirectory) ); const modules: Module[] = await Promise.all( moduleFiles.map(async name => { const code = ( await readFile( new URL(`examples/${id}/modules/${name}`, examplesDirectory), 'utf8' ) ).trim(); return { code, isEntry: entryModules.includes(name), name }; }) ); modules.sort((a, b) => { if (a.name === 'main.js') return -1; if (b.name === 'main.js') return 1; if (a.isEntry) return -1; if (b.isEntry) return 1; return a.name < b.name ? -1 : 1; }); return { id, modules, options, title }; }) ); const examplesById: Record = {}; for (const example of examples) { examplesById[example.id] = example; } return JSON.stringify(examplesById); } }, name: 'examples', resolveId(source) { if (source === 'examples.json') { return source; } } }; } rollup-3.29.4/docs/.vitepress/helpers.ts000066400000000000000000000003021450520414700201670ustar00rootroot00000000000000import { readdir } from 'node:fs/promises'; export async function getFilesInDirectory(directory: URL): Promise { return (await readdir(directory)).filter(file => file[0] !== '.'); } rollup-3.29.4/docs/.vitepress/legacy-slugs.json000066400000000000000000000237341450520414700214650ustar00rootroot00000000000000{"introduction/index.md":{"": "introduction","Overview":"overview","Installation":"installation","Quick Start":"quick-start","The Why":"the-why","Tree-Shaking":"tree-shaking","Compatibility":"compatibility","Importing CommonJS":"importing-commonjs","Publishing ES Modules":"publishing-es-modules"},"command-line-interface/index.md":{"": "command-line-reference","Configuration Files":"configuration-files","Config Intellisense":"config-intellisense","Differences to the JavaScript API":"differences-to-the-javascript-api","Loading a configuration from a Node package":"loading-a-configuration-from-a-node-package","Caveats when using native Node ES modules":"caveats-when-using-native-node-es-modules","Getting the current directory":"getting-the-current-directory","Importing package.json":"importing-packagejson","Command line flags":"command-line-flags","-h/--help":"-h--help","-p plugin, --plugin plugin":"-p-plugin---plugin-plugin","--configPlugin plugin":"--configplugin-plugin","--bundleConfigAsCjs":"--bundleconfigascjs","-v/--version":"-v--version","-w/--watch":"-w--watch","--silent":"--silent","--failAfterWarnings":"--failafterwarnings","--environment values":"--environment-values","--waitForBundleInput":"--waitforbundleinput","--stdin=ext":"--stdinext","--no-stdin":"--no-stdin","--watch.onStart cmd, --watch.onBundleStart cmd, --watch.onBundleEnd cmd, --watch.onEnd cmd, --watch.onError cmd":"--watchonstart-cmd---watchonbundlestart-cmd---watchonbundleend-cmd---watchonend-cmd---watchonerror-cmd","Reading a file from stdin":"reading-a-file-from-stdin"},"javascript-api/index.md":{"": "javascript-api","rollup.rollup":"rolluprollup","inputOptions object":"inputoptions-object","outputOptions object":"outputoptions-object","rollup.watch":"rollupwatch","watchOptions":"watchoptions","Programmatically loading a config file":"programmatically-loading-a-config-file"},"es-module-syntax/index.md":{"": "es-module-syntax","Importing":"importing","Named Imports":"named-imports","Namespace Imports":"namespace-imports","Default Import":"default-import","Empty Import":"empty-import","Dynamic Import":"dynamic-import","Exporting":"exporting","Named exports":"named-exports","Default Export":"default-export","How bindings work":"how-bindings-work"},"tutorial/index.md":{"": "tutorial","Creating Your First Bundle":"creating-your-first-bundle","Using Config Files":"using-config-files","Installing Rollup locally":"installing-rollup-locally","Using plugins":"using-plugins","Using output plugins":"using-output-plugins","Code Splitting":"code-splitting"},"plugin-development/index.md":{"": "plugin-development","Plugins Overview":"plugins-overview","A Simple Example":"a-simple-example","Conventions":"conventions","Properties":"properties","name":"name","version?":"version","Build Hooks":"build-hooks","buildEnd":"buildend","buildStart":"buildstart","closeWatcher":"closewatcher","load":"load","moduleParsed":"moduleparsed","options":"options","resolveDynamicImport":"resolvedynamicimport","resolveId":"resolveid","shouldTransformCachedModule":"shouldtransformcachedmodule","transform":"transform","watchChange":"watchchange","Output Generation Hooks":"output-generation-hooks","augmentChunkHash":"augmentchunkhash","banner":"banner","closeBundle":"closebundle","footer":"footer","generateBundle":"generatebundle","intro":"intro","outputOptions":"outputoptions","outro":"outro","renderChunk":"renderchunk","renderDynamicImport":"renderdynamicimport","renderError":"rendererror","renderStart":"renderstart","resolveFileUrl":"resolvefileurl","resolveImportMeta":"resolveimportmeta","writeBundle":"writebundle","Plugin Context":"plugin-context","this.addWatchFile":"thisaddwatchfile","this.emitFile":"thisemitfile","this.error":"thiserror","this.getCombinedSourcemap":"thisgetcombinedsourcemap","this.getFileName":"thisgetfilename","this.getModuleIds":"thisgetmoduleids","this.getModuleInfo":"thisgetmoduleinfo","this.getWatchFiles":"thisgetwatchfiles","this.load":"thisload","this.meta":"thismeta","this.parse":"thisparse","this.resolve":"thisresolve","this.setAssetSource":"thissetassetsource","this.warn":"thiswarn","Deprecated Context Functions":"deprecated-context-functions","File URLs":"file-urls","Transformers":"transformers","Example Transformer":"example-transformer","Source Code Transformations":"source-code-transformations","Synthetic named exports":"synthetic-named-exports","Inter-plugin communication":"inter-plugin-communication","Custom resolver options":"custom-resolver-options","Custom module meta-data":"custom-module-meta-data","Direct plugin communication":"direct-plugin-communication"},"faqs/index.md":{"": "faqs","Why are ES modules better than CommonJS Modules?":"why-are-es-modules-better-than-commonjs-modules","What Is tree-shaking?":"what-is-tree-shaking","How do I use Rollup in Node.js with CommonJS modules?":"how-do-i-use-rollup-in-nodejs-with-commonjs-modules","Why isn't node-resolve a built-in feature?":"why-isnt-node-resolve-a-built-in-feature","Why do additional imports turn up in my entry chunks when code-splitting?":"why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting","How do I add polyfills to a Rollup bundle?":"how-do-i-add-polyfills-to-a-rollup-bundle","Is Rollup meant for building libraries or applications?":"is-rollup-meant-for-building-libraries-or-applications","How do I run Rollup itself in a browser":"how-do-i-run-rollup-itself-in-a-browser","Who made the Rollup logo? It's lovely.":"who-made-the-rollup-logo-its-lovely"},"tools/index.md":{"": "tools","With NPM Packages":"with-npm-packages","@rollup/plugin-node-resolve":"rollupplugin-node-resolve","@rollup/plugin-commonjs":"rollupplugin-commonjs","Peer dependencies":"peer-dependencies","Babel":"babel","Gulp":"gulp","Deno":"deno"},"troubleshooting/index.md":{"": "troubleshooting","Avoiding eval":"avoiding-eval","eval2 = eval":"eval2--eval","new Function":"new-function","Tree-shaking doesn't seem to be working":"tree-shaking-doesnt-seem-to-be-working","Error: [name] is not exported by [module]":"error-name-is-not-exported-by-module","Error: this is undefined":"error-this-is-undefined","Warning: Sourcemap is likely to be incorrect":"warning-sourcemap-is-likely-to-be-incorrect","Warning: Treating [module] as external dependency":"warning-treating-module-as-external-dependency","Error: EMFILE: too many open files":"error-emfile-too-many-open-files","Error: JavaScript heap out of memory":"error-javascript-heap-out-of-memory","Error: Node tried to load your configuration file as CommonJS even though it is likely an ES module":"error-node-tried-to-load-your-configuration-file-as-commonjs-even-though-it-is-likely-an-es-module"},"migration/index.md":{"": "migration","Prerequisites":"prerequisites","Using Configuration Files":"using-configuration-files","Changed Defaults":"changed-defaults","More Changed Options":"more-changed-options","Dynamic Import in CommonJS Output":"dynamic-import-in-commonjs-output","Changes to the Plugin API":"changes-to-the-plugin-api"},"configuration-options/index.md":{"": "big-list-of-options","Core functionality":"core-functionality","external":"external","input":"input","output.dir":"outputdir","output.file":"outputfile","output.format":"outputformat","output.globals":"outputglobals","output.name":"outputname","output.plugins":"outputplugins","plugins":"plugins","Advanced functionality":"advanced-functionality","cache":"cache","makeAbsoluteExternalsRelative":"makeabsoluteexternalsrelative","maxParallelFileOps":"maxparallelfileops","onwarn":"onwarn","output.assetFileNames":"outputassetfilenames","output.banner/output.footer":"outputbanneroutputfooter","output.chunkFileNames":"outputchunkfilenames","output.compact":"outputcompact","output.dynamicImportInCjs":"outputdynamicimportincjs","output.entryFileNames":"outputentryfilenames","output.extend":"outputextend","output.externalImportAssertions":"outputexternalimportassertions","output.generatedCode":"outputgeneratedcode","output.hoistTransitiveImports":"outputhoisttransitiveimports","output.inlineDynamicImports":"outputinlinedynamicimports","output.interop":"outputinterop","output.intro/output.outro":"outputintrooutputoutro","output.manualChunks":"outputmanualchunks","output.minifyInternalExports":"outputminifyinternalexports","output.paths":"outputpaths","output.preserveModules":"outputpreservemodules","output.preserveModulesRoot":"outputpreservemodulesroot","output.sourcemap":"outputsourcemap","output.sourcemapBaseUrl":"outputsourcemapbaseurl","output.sourcemapExcludeSources":"outputsourcemapexcludesources","output.sourcemapFile":"outputsourcemapfile","output.sourcemapPathTransform":"outputsourcemappathtransform","output.validate":"outputvalidate","preserveEntrySignatures":"preserveentrysignatures","strictDeprecations":"strictdeprecations","Danger zone":"danger-zone","acorn":"acorn","acornInjectPlugins":"acorninjectplugins","context":"context","moduleContext":"modulecontext","output.amd":"outputamd","output.esModule":"outputesmodule","output.exports":"outputexports","output.externalLiveBindings":"outputexternallivebindings","output.freeze":"outputfreeze","output.indent":"outputindent","output.noConflict":"outputnoconflict","output.sanitizeFileName":"outputsanitizefilename","output.strict":"outputstrict","output.systemNullSetters":"outputsystemnullsetters","preserveSymlinks":"preservesymlinks","shimMissingExports":"shimmissingexports","treeshake":"treeshake","Experimental options":"experimental-options","experimentalCacheExpiry":"experimentalcacheexpiry","experimentalMinChunkSize":"experimentalminchunksize","perf":"perf","watch":"watch-options","watch.buildDelay":"watchbuilddelay","watch.chokidar":"watchchokidar","watch.clearScreen":"watchclearscreen","watch.exclude":"watchexclude","watch.include":"watchinclude","watch.skipWrite":"watchskipwrite","Deprecated options":"deprecated-options","inlineDynamicImports":"inlinedynamicimports","manualChunks":"manualchunks","maxParallelFileReads":"maxparallelfilereads","output.dynamicImportFunction":"outputdynamicimportfunction","output.preferConst":"outputpreferconst","output.namespaceToStringTag":"outputnamespacetostringtag","preserveModules":"preservemodules"}} rollup-3.29.4/docs/.vitepress/mermaid.config.json000066400000000000000000000001201450520414700217300ustar00rootroot00000000000000{ "themeCSS": "* { line-height: 1.5; } span.edgeLabel { padding: 2px 5px; }" } rollup-3.29.4/docs/.vitepress/mermaid.ts000066400000000000000000000061761450520414700201620ustar00rootroot00000000000000import { exec } from 'node:child_process'; import { createHash } from 'node:crypto'; import { readFile, writeFile } from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; import { promisify } from 'node:util'; import type { Plugin } from 'vite'; import { mkdir } from '../../src/utils/fs'; import { getFilesInDirectory } from './helpers'; const execPromise = promisify(exec); const graphsDirectory = new URL('graphs/', import.meta.url); const mermaidRegExp = /^```mermaid\n([\S\s]*?)\n```/gm; const greaterThanRegExp = />/g; const styleTagRegExp = /
parallel
sequential
first
async
sync
```mermaid flowchart TB classDef default fill:transparent, color:#000; classDef hook-parallel fill:#ffb3b3,stroke:#000; classDef hook-sequential fill:#ffd2b3,stroke:#000; classDef hook-first fill:#fff2b3,stroke:#000; classDef hook-sequential-sync fill:#ffd2b3,stroke:#f00; classDef hook-first-sync fill:#fff2b3,stroke:#f00; watchchange("watchChange"):::hook-parallel click watchchange "#watchchange" _parent closewatcher("closeWatcher"):::hook-parallel click closewatcher "#closewatcher" _parent buildend("buildEnd"):::hook-parallel click buildend "#buildend" _parent buildstart("buildStart"):::hook-parallel click buildstart "#buildstart" _parent load("load"):::hook-first click load "#load" _parent moduleparsed("moduleParsed"):::hook-parallel click moduleparsed "#moduleparsed" _parent options("options"):::hook-sequential click options "#options" _parent resolvedynamicimport("resolveDynamicImport"):::hook-first click resolvedynamicimport "#resolvedynamicimport" _parent resolveid("resolveId"):::hook-first click resolveid "#resolveid" _parent shouldtransformcachedmodule("shouldTransformCachedModule"):::hook-first click shouldtransformcachedmodule "#shouldtransformcachedmodule" _parent transform("transform"):::hook-sequential click transform "#transform" _parent options --> buildstart --> |each entry|resolveid .-> |external|buildend resolveid --> |non-external|load --> |not cached|transform --> moduleparsed .-> |no imports|buildend load --> |cached|shouldtransformcachedmodule --> |false|moduleparsed shouldtransformcachedmodule --> |true|transform moduleparsed --> |"each import()"|resolvedynamicimport --> |non-external|load moduleparsed --> |"each import\n(cached)"|load moduleparsed --> |"each import\n(not cached)"|resolveid resolvedynamicimport .-> |external|buildend resolvedynamicimport --> |unresolved|resolveid ``` Additionally, in watch mode the [`watchChange`](#watchchange) hook can be triggered at any time to notify a new run will be triggered once the current run has generated its outputs. Also, when watcher closes, the [`closeWatcher`](#closewatcher) hook will be triggered. See [Output Generation Hooks](#output-generation-hooks) for hooks that run during the output generation phase to modify the generated output. ### buildEnd | | | | --: | :-- | | Type: | `(error?: Error) => void` | | Kind: | async, parallel | | Previous: | [`moduleParsed`](#moduleparsed), [`resolveId`](#resolveid) or [`resolveDynamicImport`](#resolvedynamicimport) | | Next: | [`outputOptions`](#outputoptions) in the output generation phase as this is the last hook of the build phase | Called when Rollup has finished bundling, but before `generate` or `write` is called; you can also return a Promise. If an error occurred during the build, it is passed on to this hook. ### buildStart | | | | --: | :-- | | Type: | `(options: InputOptions) => void` | | Kind: | async, parallel | | Previous: | [`options`](#options) | | Next: | [`resolveId`](#resolveid) to resolve each entry point in parallel | Called on each `rollup.rollup` build. This is the recommended hook to use when you need access to the options passed to `rollup.rollup()` as it takes the transformations by all [`options`](#options) hooks into account and also contains the right default values for unset options. ### closeWatcher | | | | --: | :-- | | Type: | `() => void` | | Kind: | async, parallel | | Previous/Next: | This hook can be triggered at any time both during the build and the output generation phases. If that is the case, the current build will still proceed but no new [`watchChange`](#watchchange) events will be triggered ever | Notifies a plugin when the watcher process will close so that all open resources can be closed too. If a Promise is returned, Rollup will wait for the Promise to resolve before closing the process. This hook cannot be used by output plugins. ### load | | | | --: | :-- | | Type: | `(id: string) => LoadResult` | | Kind: | async, first | | Previous: | [`resolveId`](#resolveid) or [`resolveDynamicImport`](#resolvedynamicimport) where the loaded id was resolved. Additionally, this hook can be triggered at any time from plugin hooks by calling [`this.load`](#this-load) to preload the module corresponding to an id | | Next: | [`transform`](#transform) to transform the loaded file if no cache was used, or there was no cached copy with the same `code`, otherwise [`shouldTransformCachedModule`](#shouldtransformcachedmodule) | ```typescript type LoadResult = string | null | SourceDescription; interface SourceDescription { code: string; map?: string | SourceMap; ast?: ESTree.Program; assertions?: { [key: string]: string } | null; meta?: { [plugin: string]: any } | null; moduleSideEffects?: boolean | 'no-treeshake' | null; syntheticNamedExports?: boolean | string | null; } ``` Defines a custom loader. Returning `null` defers to other `load` functions (and eventually the default behavior of loading from the file system). To prevent additional parsing overhead in case e.g. this hook already used `this.parse` to generate an AST for some reason, this hook can optionally return a `{ code, ast, map }` object. The `ast` must be a standard ESTree AST with `start` and `end` properties for each node. If the transformation does not move code, you can preserve existing sourcemaps by setting `map` to `null`. Otherwise, you might need to generate the source map. See the section on [source code transformations](#source-code-transformations). If `false` is returned for `moduleSideEffects` and no other module imports anything from this module, then this module will not be included in the bundle even if the module would have side effects. If `true` is returned, Rollup will use its default algorithm to include all statements in the module that have side effects (such as modifying a global or exported variable). If `"no-treeshake"` is returned, treeshaking will be turned off for this module and it will also be included in one of the generated chunks even if it is empty. If `null` is returned or the flag is omitted, then `moduleSideEffects` will be determined by the first `resolveId` hook that resolved this module, the [`treeshake.moduleSideEffects`](../configuration-options/index.md#treeshake-modulesideeffects) option, or eventually default to `true`. The `transform` hook can override this. `assertions` contain the import assertions that were used when this module was imported. At the moment, they do not influence rendering for bundled modules but rather serve documentation purposes. If `null` is returned or the flag is omitted, then `assertions` will be determined by the first `resolveId` hook that resolved this module, or the assertions present in the first import of this module. The `transform` hook can override this. See [synthetic named exports](#synthetic-named-exports) for the effect of the `syntheticNamedExports` option. If `null` is returned or the flag is omitted, then `syntheticNamedExports` will be determined by the first `resolveId` hook that resolved this module or eventually default to `false`. The `transform` hook can override this. See [custom module meta-data](#custom-module-meta-data) for how to use the `meta` option. If a `meta` object is returned by this hook, it will be merged shallowly with any `meta` object returned by the resolveId hook. If no hook returns a `meta` object it will default to an empty object. The `transform` hook can further add or replace properties of this object. You can use [`this.getModuleInfo`](#this-getmoduleinfo) to find out the previous values of `assertions`, `meta`, `moduleSideEffects` and `syntheticNamedExports` inside this hook. ### moduleParsed | | | | --: | :-- | | Type: | `(moduleInfo: ModuleInfo) => void` | | Kind: | async, parallel | | Previous: | [`transform`](#transform) where the currently handled file was transformed | | Next: | [`resolveId`](#resolveid) and [`resolveDynamicImport`](#resolvedynamicimport) to resolve all discovered static and dynamic imports in parallel if present, otherwise [`buildEnd`](#buildend) | This hook is called each time a module has been fully parsed by Rollup. See [`this.getModuleInfo`](#this-getmoduleinfo) for what information is passed to this hook. In contrast to the [`transform`](#transform) hook, this hook is never cached and can be used to get information about both cached and other modules, including the final shape of the `meta` property, the `code` and the `ast`. This hook will wait until all imports are resolved so that the information in `moduleInfo.importedIds`, `moduleInfo.dynamicallyImportedIds`, `moduleInfo.importedIdResolutions`, and `moduleInfo.dynamicallyImportedIdResolutions` is complete and accurate. Note however that information about importing modules may be incomplete as additional importers could be discovered later. If you need this information, use the [`buildEnd`](#buildend) hook. ### onLog | | | | -------------: | :----------------------------------------------------- | | Type: | `(level: LogLevel, log: RollupLog) => boolean \| null` | | Kind: | sync, sequential | | Previous/Next: | This hook can be triggered at any time. | See the [`onLog`](../configuration-options/index.md#onlog) option for the available `Loglevel` values and the `RollupLog` type. A function that receives and filters logs and warnings generated by Rollup and plugins before they are passed to the [`onLog`](../configuration-options/index.md#onlog) option or printed to the console. If `false` is returned from this hook, the log will be filtered. Otherwise, the log will be handed to the `onLog` hook of the next plugin, the `onLog` option, or printed to the console. Plugins can also change the log level of a log or turn a log into an error by passing the log to [`this.error`](#this-error), [`this.warn`](#this-warn), [`this.info`](#this-info) or [`this.debug`](#this-debug) and returning `false`. Note that unlike other plugin hooks that add e.g. the plugin name to the log, those functions will not add or change properties of the log. Additionally, logs generated by an `onLog` hook will not be passed back to the `onLog` hook of the same plugin. If another plugin generates a log in response to such a log in its own `onLog` hook, this log will not be passed to the original `onLog` hook, either. ```js function plugin1() { return { name: 'plugin1', buildStart() { this.info({ message: 'Hey', pluginCode: 'SPECIAL_CODE' }); }, onLog(level, log) { if (log.plugin === 'plugin1' && log.pluginCode === 'SPECIAL_CODE') { // We turn logs into warnings based on their code. This warnings // will not be passed back to the same plugin to avoid an // infinite loop, but other plugins will still receive it. this.warn(log); return false; } } }; } function plugin2() { return { name: 'plugin2', onLog(level, log) { if (log.plugin === 'plugin1' && log.pluginCode === 'SPECIAL_CODE') { // You can modify logs in this hooks as well log.meta = 'processed by plugin 2'; // This turns the log back to "info". If this happens in // response to the first plugin, it will not be passed back to // either plugin to avoid an infinite loop. If both plugins are // active, the log will be an info log if the second plugin is // placed after the first one this.info(log); return false; } } }; } ``` Like the [`options`](#options) hook, this hook does not have access to most [plugin context](#plugin-context) utility functions as it may be run before Rollup is fully configured. The only supported properties are [`this.meta`](#this-meta) as well as [`this.error`](#this-error), [`this.warn`](#this-warn), [`this.info`](#this-info) and [`this.debug`](#this-debug) for logging and errors. ### options | | | | --------: | :------------------------------------------------ | | Type: | `(options: InputOptions) => InputOptions \| null` | | Kind: | async, sequential | | Previous: | This is the first hook of the build phase | | Next: | [`buildStart`](#buildstart) | Replaces or manipulates the options object passed to `rollup.rollup`. Returning `null` does not replace anything. If you just need to read the options, it is recommended to use the [`buildStart`](#buildstart) hook as that hook has access to the options after the transformations from all `options` hooks have been taken into account. Like the [`onLog`](#onlog) hook, this hook does not have access to most [plugin context](#plugin-context) utility functions as it is run before Rollup is fully configured. The only supported properties are [`this.meta`](#this-meta) as well as [`this.error`](#this-error), [`this.warn`](#this-warn), [`this.info`](#this-info) and [`this.debug`](#this-debug) for logging and errors. ### resolveDynamicImport | | | | --: | :-- | | Type: | `ResolveDynamicImportHook` | | Kind: | async, first | | Previous: | [`moduleParsed`](#moduleparsed) for the importing file | | Next: | [`load`](#load) if the hook resolved with an id that has not yet been loaded, [`resolveId`](#resolveid) if the dynamic import contains a string and was not resolved by the hook, otherwise [`buildEnd`](#buildend) | ```typescript type ResolveDynamicImportHook = ( specifier: string | AcornNode, importer: string, options: { assertions: Record } ) => ResolveIdResult; ``` ::: tip The return type **ResolveIdResult** is the same as that of the [`resolveId`](#resolveid) hook. ::: Defines a custom resolver for dynamic imports. Returning `false` signals that the import should be kept as it is and not be passed to other resolvers thus making it external. Similar to the [`resolveId`](#resolveid) hook, you can also return an object to resolve the import to a different id while marking it as external at the same time. `assertions` tells you which import assertions were present in the import. I.e. `import("foo", {assert: {type: "json"}})` will pass along `assertions: {type: "json"}`. In case a dynamic import is passed a string as argument, a string returned from this hook will be interpreted as an existing module id while returning `null` will defer to other resolvers and eventually to `resolveId` . In case a dynamic import is not passed a string as argument, this hook gets access to the raw AST nodes to analyze and behaves slightly different in the following ways: - If all plugins return `null`, the import is treated as `external` without a warning. - If a string is returned, this string is _not_ interpreted as a module id but is instead used as a replacement for the import argument. It is the responsibility of the plugin to make sure the generated code is valid. - To resolve such an import to an existing module, you can still return an object `{id, external}`. Note that the return value of this hook will not be passed to `resolveId` afterwards; if you need access to the static resolution algorithm, you can use [`this.resolve(source, importer)`](#this-resolve) on the plugin context. ### resolveId | | | | --: | :-- | | Type: | `ResolveIdHook` | | Kind: | async, first | | Previous: | [`buildStart`](#buildstart) if we are resolving an entry point, [`moduleParsed`](#moduleparsed) if we are resolving an import, or as fallback for [`resolveDynamicImport`](#resolvedynamicimport). Additionally, this hook can be triggered during the build phase from plugin hooks by calling [`this.emitFile`](#this-emitfile) to emit an entry point or at any time by calling [`this.resolve`](#this-resolve) to manually resolve an id | | Next: | [`load`](#load) if the resolved id has not yet been loaded, otherwise [`buildEnd`](#buildend) | ```typescript type ResolveIdHook = ( source: string, importer: string | undefined, options: { assertions: Record; custom?: { [plugin: string]: any }; isEntry: boolean; } ) => ResolveIdResult; type ResolveIdResult = string | null | false | PartialResolvedId; interface PartialResolvedId { id: string; external?: boolean | 'absolute' | 'relative'; assertions?: Record | null; meta?: { [plugin: string]: any } | null; moduleSideEffects?: boolean | 'no-treeshake' | null; resolvedBy?: string | null; syntheticNamedExports?: boolean | string | null; } ``` Defines a custom resolver. A resolver can be useful for e.g. locating third-party dependencies. Here `source` is the importee exactly as it is written in the import statement, i.e. for ```js import { foo } from '../bar.js'; ``` the source will be `"../bar.js"`. The `importer` is the fully resolved id of the importing module. When resolving entry points, importer will usually be `undefined`. An exception here are entry points generated via [`this.emitFile`](#this-emitfile) as here, you can provide an `importer` argument. For those cases, the `isEntry` option will tell you if we are resolving a user defined entry point, an emitted chunk, or if the `isEntry` parameter was provided for the [`this.resolve`](#this-resolve) context function. You can use this for instance as a mechanism to define custom proxy modules for entry points. The following plugin will proxy all entry points to inject a polyfill import. ```js // We prefix the polyfill id with \0 to tell other plugins not to try to load or // transform it const POLYFILL_ID = '\0polyfill'; const PROXY_SUFFIX = '?inject-polyfill-proxy'; function injectPolyfillPlugin() { return { name: 'inject-polyfill', async resolveId(source, importer, options) { if (source === POLYFILL_ID) { // It is important that side effects are always respected // for polyfills, otherwise using // "treeshake.moduleSideEffects: false" may prevent the // polyfill from being included. return { id: POLYFILL_ID, moduleSideEffects: true }; } if (options.isEntry) { // Determine what the actual entry would have been. We need // "skipSelf" to avoid an infinite loop. const resolution = await this.resolve(source, importer, { skipSelf: true, ...options }); // If it cannot be resolved or is external, just return it // so that Rollup can display an error if (!resolution || resolution.external) return resolution; // In the load hook of the proxy, we need to know if the // entry has a default export. There, however, we no longer // have the full "resolution" object that may contain // meta-data from other plugins that is only added on first // load. Therefore we trigger loading here. const moduleInfo = await this.load(resolution); // We need to make sure side effects in the original entry // point are respected even for // treeshake.moduleSideEffects: false. "moduleSideEffects" // is a writable property on ModuleInfo. moduleInfo.moduleSideEffects = true; // It is important that the new entry does not start with // \0 and has the same directory as the original one to not // mess up relative external import generation. Also // keeping the name and just adding a "?query" to the end // ensures that preserveModules will generate the original // entry name for this entry. return `${resolution.id}${PROXY_SUFFIX}`; } return null; }, load(id) { if (id === POLYFILL_ID) { // Replace with actual polyfill return "console.log('polyfill');"; } if (id.endsWith(PROXY_SUFFIX)) { const entryId = id.slice(0, -PROXY_SUFFIX.length); // We know ModuleInfo.hasDefaultExport is reliable because // we awaited this.load in resolveId const { hasDefaultExport } = this.getModuleInfo(entryId); let code = `import ${JSON.stringify(POLYFILL_ID)};` + `export * from ${JSON.stringify(entryId)};`; // Namespace reexports do not reexport default, so we need // special handling here if (hasDefaultExport) { code += `export { default } from ${JSON.stringify(entryId)};`; } return code; } return null; } }; } ``` `assertions` tells you which import assertions were present in the import. I.e. `import "foo" assert {type: "json"}` will pass along `assertions: {type: "json"}`. Returning `null` defers to other `resolveId` functions and eventually the default resolution behavior. Returning `false` signals that `source` should be treated as an external module and not included in the bundle. If this happens for a relative import, the id will be renormalized the same way as when the `external` option is used. If you return an object, then it is possible to resolve an import to a different id while excluding it from the bundle at the same time. This allows you to replace dependencies with external dependencies without the need for the user to mark them as "external" manually via the `external` option: ```js function externalizeDependencyPlugin() { return { name: 'externalize-dependency', resolveId(source) { if (source === 'my-dependency') { return { id: 'my-dependency-develop', external: true }; } return null; } }; } ``` If `external` is `true`, then absolute ids will be converted to relative ids based on the user's choice for the [`makeAbsoluteExternalsRelative`](../configuration-options/index.md#makeabsoluteexternalsrelative) option. This choice can be overridden by passing either `external: "relative"` to always convert an absolute id to a relative id or `external: "absolute"` to keep it as an absolute id. When returning an object, relative external ids, i.e. ids starting with `./` or `../`, will _not_ be internally converted to an absolute id and converted back to a relative id in the output, but are instead included in the output unchanged. If you want relative ids to be renormalised and deduplicated instead, return an absolute file system location as `id` and choose `external: "relative"`. If `false` is returned for `moduleSideEffects` in the first hook that resolves a module id and no other module imports anything from this module, then this module will not be included even if the module would have side effects. If `true` is returned, Rollup will use its default algorithm to include all statements in the module that have side effects (such as modifying a global or exported variable). If `"no-treeshake"` is returned, treeshaking will be turned off for this module and it will also be included in one of the generated chunks even if it is empty. If `null` is returned or the flag is omitted, then `moduleSideEffects` will be determined by the [`treeshake.moduleSideEffects`](../configuration-options/index.md#treeshake-modulesideeffects) option or default to `true`. The `load` and `transform` hooks can override this. `resolvedBy` can be explicitly declared in the returned object. It will replace the corresponding field returned by [`this.resolve`](#this-resolve). If you return a value for `assertions` for an external module, this will determine how imports of this module will be rendered when generating `"es"` output. E.g. `{id: "foo", external: true, assertions: {type: "json"}}` will cause imports of this module appear as `import "foo" assert {type: "json"}`. If you do not pass a value, the value of the `assertions` input parameter will be used. Pass an empty object to remove any assertions. While `assertions` do not influence rendering for bundled modules, they still need to be consistent across all imports of a module, otherwise a warning is emitted. The `load` and `transform` hooks can override this. See [synthetic named exports](#synthetic-named-exports) for the effect of the `syntheticNamedExports` option. If `null` is returned or the flag is omitted, then `syntheticNamedExports` will default to `false`. The `load` and `transform` hooks can override this. See [custom module meta-data](#custom-module-meta-data) for how to use the `meta` option. If `null` is returned or the option is omitted, then `meta` will default to an empty object. The `load` and `transform` hooks can add or replace properties of this object. Note that while `resolveId` will be called for each import of a module and can therefore resolve to the same `id` many times, values for `external`, `assertions`, `meta`, `moduleSideEffects` or `syntheticNamedExports` can only be set once before the module is loaded. The reason is that after this call, Rollup will continue with the [`load`](#load) and [`transform`](#transform) hooks for that module that may override these values and should take precedence if they do so. When triggering this hook from a plugin via [`this.resolve`](#this-resolve), it is possible to pass a custom options object to this hook. While this object will be passed unmodified, plugins should follow the convention of adding a `custom` property with an object where the keys correspond to the names of the plugins that the options are intended for. For details see [custom resolver options](#custom-resolver-options). In watch mode or when using the cache explicitly, the resolved imports of a cached module are also taken from the cache and not determined via the `resolveId` hook again. To prevent this, you can return `true` from the [`shouldTransformCachedModule`](#shouldtransformcachedmodule) hook for that module. This will remove the module and its import resolutions from cache and call `transform` and `resolveId` again. ### shouldTransformCachedModule | | | | --: | :-- | | Type: | `ShouldTransformCachedModuleHook` | | Kind: | async, first | | Previous: | [`load`](#load) where the cached file was loaded to compare its code with the cached version | | Next: | [`moduleParsed`](#moduleparsed) if no plugin returns `true`, otherwise [`transform`](#transform) | ```typescript type ShouldTransformCachedModuleHook = (options: { ast: AcornNode; code: string; id: string; meta: { [plugin: string]: any }; moduleSideEffects: boolean | 'no-treeshake'; syntheticNamedExports: boolean | string; }) => boolean | NullValue; ``` If the Rollup cache is used (e.g. in watch mode or explicitly via the JavaScript API), Rollup will skip the [`transform`](#transform) hook of a module if after the [`load`](#transform) hook, the loaded `code` is identical to the code of the cached copy. To prevent this, discard the cached copy and instead transform a module, plugins can implement this hook and return `true`. This hook can also be used to find out which modules were cached and access their cached meta information. If a plugin does not return a boolean, Rollup will trigger this hook for other plugins, otherwise all remaining plugins will be skipped. ### transform | | | | --: | :-- | | Type: | `(code: string, id: string) => TransformResult` | | Kind: | async, sequential | | Previous: | [`load`](#load) where the currently handled file was loaded. If caching is used and there was a cached copy of that module, [`shouldTransformCachedModule`](#shouldtransformcachedmodule) if a plugin returned `true` for that hook | | Next: | [`moduleParsed`](#moduleparsed) once the file has been processed and parsed | ```typescript type TransformResult = string | null | Partial; interface SourceDescription { code: string; map?: string | SourceMap; ast?: ESTree.Program; assertions?: { [key: string]: string } | null; meta?: { [plugin: string]: any } | null; moduleSideEffects?: boolean | 'no-treeshake' | null; syntheticNamedExports?: boolean | string | null; } ``` Can be used to transform individual modules. To prevent additional parsing overhead in case e.g. this hook already used `this.parse` to generate an AST for some reason, this hook can optionally return a `{ code, ast, map }` object. The `ast` must be a standard ESTree AST with `start` and `end` properties for each node. If the transformation does not move code, you can preserve existing sourcemaps by setting `map` to `null`. Otherwise, you might need to generate the source map. See [the section on source code transformations](#source-code-transformations). Note that in watch mode or when using the cache explicitly, the result of this hook is cached when rebuilding and the hook is only triggered again for a module `id` if either the `code` of the module has changed or a file has changed that was added via `this.addWatchFile` the last time the hook was triggered for this module. In all other cases, the [`shouldTransformCachedModule`](#shouldtransformcachedmodule) hook is triggered instead, which gives access to the cached module. Returning `true` from `shouldTransformCachedModule` will remove the module from cache and instead call `transform` again. You can also use the object form of the return value to configure additional properties of the module. Note that it's possible to return only properties and no code transformations. If `false` is returned for `moduleSideEffects` and no other module imports anything from this module, then this module will not be included even if the module would have side effects. If `true` is returned, Rollup will use its default algorithm to include all statements in the module that have side effects (such as modifying a global or exported variable). If `"no-treeshake"` is returned, treeshaking will be turned off for this module and it will also be included in one of the generated chunks even if it is empty. If `null` is returned or the flag is omitted, then `moduleSideEffects` will be determined by the `load` hook that loaded this module, the first `resolveId` hook that resolved this module, the [`treeshake.moduleSideEffects`](../configuration-options/index.md#treeshake-modulesideeffects) option, or eventually default to `true`. `assertions` contain the import assertions that were used when this module was imported. At the moment, they do not influence rendering for bundled modules but rather serve documentation purposes. If `null` is returned or the flag is omitted, then `assertions` will be determined by the `load` hook that loaded this module, the first `resolveId` hook that resolved this module, or the assertions present in the first import of this module. See [synthetic named exports](#synthetic-named-exports) for the effect of the `syntheticNamedExports` option. If `null` is returned or the flag is omitted, then `syntheticNamedExports` will be determined by the `load` hook that loaded this module, the first `resolveId` hook that resolved this module, the [`treeshake.moduleSideEffects`](../configuration-options/index.md#treeshake-modulesideeffects) option, or eventually default to `false`. See [custom module meta-data](#custom-module-meta-data) for how to use the `meta` option. If `null` is returned or the option is omitted, then `meta` will be determined by the `load` hook that loaded this module, the first `resolveId` hook that resolved this module or eventually default to an empty object. You can use [`this.getModuleInfo`](#this-getmoduleinfo) to find out the previous values of `assertions`, `meta`, `moduleSideEffects` and `syntheticNamedExports` inside this hook. ### watchChange | | | | --: | :-- | | Type: | `watchChange: (id: string, change: {event: 'create' \| 'update' \| 'delete'}) => void` | | Kind: | async, parallel | | Previous/Next: | This hook can be triggered at any time both during the build and the output generation phases. If that is the case, the current build will still proceed but a new build will be scheduled to start once the current build has completed, starting again with [`options`](#options) | Notifies a plugin whenever Rollup has detected a change to a monitored file in `--watch` mode. If a Promise is returned, Rollup will wait for the Promise to resolve before scheduling another build. This hook cannot be used by output plugins. The second argument contains additional details of the change event. ## Output Generation Hooks Output generation hooks can provide information about a generated bundle and modify a build once complete. They work the same way and have the same types as [Build Hooks](#build-hooks) but are called separately for each call to `bundle.generate(outputOptions)` or `bundle.write(outputOptions)`. Plugins that only use output generation hooks can also be passed in via the output options and therefore run only for certain outputs. The first hook of the output generation phase is [`outputOptions`](#outputoptions), the last one is either [`generateBundle`](#generatebundle) if the output was successfully generated via `bundle.generate(...)`, [`writeBundle`](#writebundle) if the output was successfully generated via `bundle.write(...)`, or [`renderError`](#rendererror) if an error occurred at any time during the output generation.
parallel
sequential
first
async
sync
```mermaid flowchart TB classDef default fill:transparent, color:#000; classDef hook-parallel fill:#ffb3b3,stroke:#000; classDef hook-sequential fill:#ffd2b3,stroke:#000; classDef hook-first fill:#fff2b3,stroke:#000; classDef hook-sequential-sync fill:#ffd2b3,stroke:#f00; classDef hook-first-sync fill:#fff2b3,stroke:#f00; augmentchunkhash("augmentChunkHash"):::hook-sequential-sync click augmentchunkhash "#augmentchunkhash" _parent banner("banner"):::hook-sequential click banner "#banner" _parent closebundle("closeBundle"):::hook-parallel click closebundle "#closebundle" _parent footer("footer"):::hook-sequential click footer "#footer" _parent generatebundle("generateBundle"):::hook-sequential click generatebundle "#generatebundle" _parent intro("intro"):::hook-sequential click intro "#intro" _parent outputoptions("outputOptions"):::hook-sequential-sync click outputoptions "#outputoptions" _parent outro("outro"):::hook-sequential click outro "#outro" _parent renderchunk("renderChunk"):::hook-sequential click renderchunk "#renderchunk" _parent renderdynamicimport("renderDynamicImport"):::hook-first-sync click renderdynamicimport "#renderdynamicimport" _parent rendererror("renderError"):::hook-parallel click rendererror "#rendererror" _parent renderstart("renderStart"):::hook-parallel click renderstart "#renderstart" _parent resolvefileurl("resolveFileUrl"):::hook-first-sync click resolvefileurl "#resolvefileurl" _parent resolveimportmeta("resolveImportMeta"):::hook-first-sync click resolveimportmeta "#resolveimportmeta" _parent writebundle("writeBundle"):::hook-parallel click writebundle "#writebundle" _parent outputoptions --> renderstart --> |each chunk|beforerenderdynamicimport afteraddons --> |each chunk|renderchunk augmentchunkhash --> generatebundle --> writebundle .-> closebundle subgraph generateChunks [" "] direction TB beforerenderdynamicimport(( )) ---> beforeresolveimportmeta(( )) ----> beforereaddons(( )) --> banner & footer & intro & outro --> afteraddons(( )) .-> |next chunk|beforerenderdynamicimport beforerenderdynamicimport --> |"each import()"|renderdynamicimport --> beforerenderdynamicimport beforeresolveimportmeta --> |each import.meta.*|beforeimportmeta(( )) --> |import.meta.url|resolvefileurl --> afterresolveimportmeta(( )) beforeimportmeta --> |other|resolveimportmeta --> afterresolveimportmeta afterresolveimportmeta --> beforeresolveimportmeta end renderchunk --> augmentchunkhash .-> |next chunk|renderchunk style generateChunks stroke-width:0px; rendererror .-> closebundle ``` Additionally, [`closeBundle`](#closebundle) can be called as the very last hook, but it is the responsibility of the User to manually call [`bundle.close()`](../javascript-api/index.md#rollup-rollup) to trigger this. The CLI will always make sure this is the case. ### augmentChunkHash | | | | --: | :-- | | Type: | `(chunkInfo: ChunkInfo) => string` | | Kind: | sync, sequential | | Previous: | [`renderChunk`](#renderchunk) | | Next: | [`renderChunk`](#renderchunk) if there are other chunks that still need to be processed, otherwise [`generateBundle`](#generatebundle) | Can be used to augment the hash of individual chunks. Called for each Rollup output chunk. Returning a falsy value will not modify the hash. Truthy values will be passed to [`hash.update`](https://nodejs.org/dist/latest-v12.x/docs/api/crypto.html#crypto_hash_update_data_inputencoding). The `chunkInfo` is a reduced version of the one in [`generateBundle`](#generatebundle) without `code` and `map` and using placeholders for hashes in file names. The following plugin will invalidate the hash of chunk `foo` with the current timestamp: ```js function augmentWithDatePlugin() { return { name: 'augment-with-date', augmentChunkHash(chunkInfo) { if (chunkInfo.name === 'foo') { return Date.now().toString(); } } }; } ``` ### banner | | | | --: | :-- | | Type: | `string \| ((chunk: ChunkInfo) => string)` | | Kind: | async, sequential | | Previous: | [`resolveFileUrl`](#resolvefileurl) for each use of `import.meta.ROLLUP_FILE_URL_referenceId` and [`resolveImportMeta`](#resolveimportmeta) for all other accesses to `import.meta` in the current chunk | | Next: | [`renderDynamicImport`](#renderdynamicimport) for each dynamic import expression in the next chunk if there is another one, otherwise [`renderChunk`](#renderchunk) for the first chunk | Cf. [`output.banner/output.footer`](../configuration-options/index.md#output-banner-output-footer). ### closeBundle | | | | --: | :-- | | Type: | `closeBundle: () => Promise \| void` | | Kind: | async, parallel | | Previous: | [`buildEnd`](#buildend) if there was a build error, otherwise when [`bundle.close()`](../javascript-api/index.md#rollup-rollup) is called, in which case this would be the last hook to be triggered | Can be used to clean up any external service that may be running. Rollup's CLI will make sure this hook is called after each run, but it is the responsibility of users of the JavaScript API to manually call `bundle.close()` once they are done generating bundles. For that reason, any plugin relying on this feature should carefully mention this in its documentation. If a plugin wants to retain resources across builds in watch mode, they can check for [`this.meta.watchMode`](#this-meta) in this hook and perform the necessary cleanup for watch mode in [`closeWatcher`](#closewatcher). ### footer | | | | --: | :-- | | Type: | `string \| ((chunk: ChunkInfo) => string)` | | Kind: | async, sequential | | Previous: | [`resolveFileUrl`](#resolvefileurl) for each use of `import.meta.ROLLUP_FILE_URL_referenceId` and [`resolveImportMeta`](#resolveimportmeta) for all other accesses to `import.meta` in the current chunk | | Next: | [`renderDynamicImport`](#renderdynamicimport) for each dynamic import expression in the next chunk if there is another one, otherwise [`renderChunk`](#renderchunk) for the first chunk | Cf. [`output.banner/output.footer`](../configuration-options/index.md#output-banner-output-footer). ### generateBundle | | | | --: | :-- | | Type: | `(options: OutputOptions, bundle: { [fileName: string]: AssetInfo \| ChunkInfo }, isWrite: boolean) => void` | | Kind: | async, sequential | | Previous: | [`augmentChunkHash`](#augmentchunkhash) | | Next: | [`writeBundle`](#writebundle) if the output was generated via `bundle.write(...)`, otherwise this is the last hook of the output generation phase and may again be followed by [`outputOptions`](#outputoptions) if another output is generated | ```typescript interface AssetInfo { fileName: string; name?: string; needsCodeReference: boolean; source: string | Uint8Array; type: 'asset'; } interface ChunkInfo { code: string; dynamicImports: string[]; exports: string[]; facadeModuleId: string | null; fileName: string; implicitlyLoadedBefore: string[]; imports: string[]; importedBindings: { [imported: string]: string[] }; isDynamicEntry: boolean; isEntry: boolean; isImplicitEntry: boolean; map: SourceMap | null; modules: { [id: string]: { renderedExports: string[]; removedExports: string[]; renderedLength: number; originalLength: number; code: string | null; }; }; moduleIds: string[]; name: string; preliminaryFileName: string; referencedFiles: string[]; type: 'chunk'; } ``` Called at the end of `bundle.generate()` or immediately before the files are written in `bundle.write()`. To modify the files after they have been written, use the [`writeBundle`](#writebundle) hook. `bundle` provides the full list of files being written or generated along with their details. You can prevent files from being emitted by deleting them from the bundle object in this hook. To emit additional files, use the [`this.emitFile`](#this-emitfile) plugin context function. ::: danger Do not directly add assets to the bundle. This circumvents internal mechanisms that Rollup has for tracking assets. It can also cause your asset to miss vital properties that Rollup relies on internally and your plugin can break with minor Rollup releases. Instead, always use [`this.emitFile`](#this-emitfile). ::: ### intro | | | | --: | :-- | | Type: | `string \| ((chunk: ChunkInfo) => string)` | | Kind: | async, sequential | | Previous: | [`resolveFileUrl`](#resolvefileurl) for each use of `import.meta.ROLLUP_FILE_URL_referenceId` and [`resolveImportMeta`](#resolveimportmeta) for all other accesses to `import.meta` in the current chunk | | Next: | [`renderDynamicImport`](#renderdynamicimport) for each dynamic import expression in the next chunk if there is another one, otherwise [`renderChunk`](#renderchunk) for the first chunk | Cf. [`output.intro/output.outro`](../configuration-options/index.md#output-intro-output-outro). ### outputOptions | | | | --: | :-- | | Type: | `(outputOptions: OutputOptions) => OutputOptions \| null` | | Kind: | sync, sequential | | Previous: | [`buildEnd`](#buildend) if this is the first time an output is generated, otherwise either [`generateBundle`](#generatebundle), [`writeBundle`](#writebundle) or [`renderError`](#rendererror) depending on the previously generated output. This is the first hook of the output generation phase | | Next: | [`renderStart`](#renderstart) | Replaces or manipulates the output options object passed to `bundle.generate()` or `bundle.write()`. Returning `null` does not replace anything. If you just need to read the output options, it is recommended to use the [`renderStart`](#renderstart) hook as this hook has access to the output options after the transformations from all `outputOptions` hooks have been taken into account. ### outro | | | | --: | :-- | | Type: | `string \| ((chunk: ChunkInfo) => string)` | | Kind: | async, sequential | | Previous: | [`resolveFileUrl`](#resolvefileurl) for each use of `import.meta.ROLLUP_FILE_URL_referenceId` and [`resolveImportMeta`](#resolveimportmeta) for all other accesses to `import.meta` in the current chunk | | Next: | [`renderDynamicImport`](#renderdynamicimport) for each dynamic import expression in the next chunk if there is another one, otherwise [`renderChunk`](#renderchunk) for the first chunk | Cf. [`output.intro/output.outro`](../configuration-options/index.md#output-intro-output-outro). ### renderChunk | | | | --: | :-- | | Type: | `RenderChunkHook` | | Kind: | async, sequential | | Previous: | [`banner`](#banner), [`footer`](#footer), [`intro`](#intro), [`outro`](#outro) of the last chunk | | Next: | [`augmentChunkHash`](#augmentchunkhash) | ```typescript type RenderChunkHook = ( code: string, chunk: RenderedChunk, options: NormalizedOutputOptions, meta: { chunks: Record } ) => { code: string; map?: SourceMapInput } | string | null; ``` Can be used to transform individual chunks. Called for each Rollup output chunk file. Returning `null` will apply no transformations. If you change code in this hook and want to support source maps, you need to return a `map` describing your changes, see [the section on source code transformations](#source-code-transformations). `chunk` contains additional information about the chunk using the same `ChunkInfo` type as the [`generateBundle`](#generatebundle) hook with the following differences: - `code` and `map` are not set. Instead, use the `code` parameter of this hook. - all referenced chunk file names that would contain hashes will contain hash placeholders instead. This includes `fileName`, `imports`, `importedBindings`, `dynamicImports` and `implicitlyLoadedBefore`. When you use such a placeholder file name or part of it in the code returned from this hook, Rollup will replace the placeholder with the actual hash before `generateBundle`, making sure the hash reflects the actual content of the final generated chunk including all referenced file hashes. `chunk` is mutable and changes applied in this hook will propagate to other plugins and to the generated bundle. That means if you add or remove imports or exports in this hook, you should update `imports`, `importedBindings` and/or `exports`. `meta.chunks` contains information about all the chunks Rollup is generating and gives you access to their `ChunkInfo`, again using placeholders for hashes. That means you can explore the entire chunk graph in this hook. ### renderDynamicImport | | | | --: | :-- | | Type: | `renderDynamicImportHook` | | Kind: | sync, first | | Previous: | [`renderStart`](#renderstart) if this is the first chunk, otherwise [`banner`](#banner), [`footer`](#footer), [`intro`](#intro), [`outro`](#outro) of the previous chunk | | Next: | [`resolveFileUrl`](#resolvefileurl) for each use of `import.meta.ROLLUP_FILE_URL_referenceId` and [`resolveImportMeta`](#resolveimportmeta) for all other accesses to `import.meta` in the current chunk | ```typescript type renderDynamicImportHook = (options: { customResolution: string | null; format: string; moduleId: string; targetModuleId: string | null; }) => { left: string; right: string } | null; ``` This hook provides fine-grained control over how dynamic imports are rendered by providing replacements for the code to the left (`import(`) and right (`)`) of the argument of the import expression. Returning `null` defers to other hooks of this type and ultimately renders a format-specific default. `format` is the rendered output format, `moduleId` the id of the module performing the dynamic import. If the import could be resolved to an internal or external id, then `targetModuleId` will be set to this id, otherwise it will be `null`. If the dynamic import contained a non-string expression that was resolved by a [`resolveDynamicImport`](#resolvedynamicimport) hook to a replacement string, then `customResolution` will contain that string. The following code will replace all dynamic imports with a custom handler, adding `import.meta.url` as a second argument to allow the handler to resolve relative imports correctly: ```js function dynamicImportPolyfillPlugin() { return { name: 'dynamic-import-polyfill', renderDynamicImport() { return { left: 'dynamicImportPolyfill(', right: ', import.meta.url)' }; } }; } // input import('./lib.js'); // output dynamicImportPolyfill('./lib.js', import.meta.url); ``` The next plugin will make sure all dynamic imports of `esm-lib` are marked as external and retained as import expressions to e.g. allow a CommonJS build to import an ES module in Node 13+, cf. how to [import ES modules from CommonJS](https://nodejs.org/api/esm.html#esm_import_expressions) in the Node documentation. ```js function retainImportExpressionPlugin() { return { name: 'retain-import-expression', resolveDynamicImport(specifier) { if (specifier === 'esm-lib') return false; return null; }, renderDynamicImport({ targetModuleId }) { if (targetModuleId === 'esm-lib') { return { left: 'import(', right: ')' }; } } }; } ``` Note that when this hook rewrites dynamic imports in non-ES formats, no interop code to make sure that e.g. the default export is available as `.default` is generated. It is the responsibility of the plugin to make sure the rewritten dynamic import returns a Promise that resolves to a proper namespace object. ### renderError | | | | --: | :-- | | Type: | `(error: Error) => void` | | Kind: | async, parallel | | Previous: | Any hook from [`renderStart`](#renderstart) to [`renderChunk`](#renderchunk) | | Next: | If it is called, this is the last hook of the output generation phase and may again be followed by [`outputOptions`](#outputoptions) if another output is generated | Called when Rollup encounters an error during `bundle.generate()` or `bundle.write()`. The error is passed to this hook. To get notified when generation completes successfully, use the `generateBundle` hook. ### renderStart | | | | --: | :-- | | Type: | `(outputOptions: OutputOptions, inputOptions: InputOptions) => void` | | Kind: | async, parallel | | Previous: | [`outputOptions`](#outputoptions) | | Next: | [`renderDynamicImport`](#renderdynamicimport) for each dynamic import expression in the first chunk | Called initially each time `bundle.generate()` or `bundle.write()` is called. To get notified when generation has completed, use the `generateBundle` and `renderError` hooks. This is the recommended hook to use when you need access to the output options passed to `bundle.generate()` or `bundle.write()` as it takes the transformations by all [`outputOptions`](#outputoptions) hooks into account and also contains the right default values for unset options. It also receives the input options passed to `rollup.rollup()` so that plugins that can be used as output plugins, i.e. plugins that only use `generate` phase hooks, can get access to them. ### resolveFileUrl | | | | --: | :-- | | Type: | `ResolveFileUrlHook` | | Kind: | sync, first | | Previous: | [`renderDynamicImport`](#renderdynamicimport) for each dynamic import expression in the current chunk | | Next: | [`banner`](#banner), [`footer`](#footer), [`intro`](#intro), [`outro`](#outro) in parallel for the current chunk | ```typescript type ResolveFileUrlHook = (options: { chunkId: string; fileName: string; format: InternalModuleFormat; moduleId: string; referenceId: string; relativePath: string; }) => string | NullValue; ``` Allows to customize how Rollup resolves URLs of files that were emitted by plugins via `this.emitFile`. By default, Rollup will generate code for `import.meta.ROLLUP_FILE_URL_referenceId` that should correctly generate absolute URLs of emitted files independent of the output format and the host system where the code is deployed. For that, all formats except CommonJS and UMD assume that they run in a browser environment where `URL` and `document` are available. In case that fails or to generate more optimized code, this hook can be used to customize this behaviour. To do that, the following information is available: - `chunkId`: The id of the chunk this file is referenced from. If the chunk file name would contain a hash, this id will contain a placeholder instead. Rollup will replace this placeholder with the actual file name if it ends up in the generated code. - `fileName`: The path and file name of the emitted file, relative to `output.dir` without a leading `./`. Again if this is a chunk that would have a hash in its name, it will contain a placeholder instead. - `format`: The rendered output format. - `moduleId`: The id of the original module this file is referenced from. Useful for conditionally resolving certain assets differently. - `referenceId`: The reference id of the file. - `relativePath`: The path and file name of the emitted file, relative to the chunk the file is referenced from. This will path will contain no leading `./` but may contain a leading `../`. The following plugin will always resolve all files relative to the current document: ```js function resolveToDocumentPlugin() { return { name: 'resolve-to-document', resolveFileUrl({ fileName }) { return `new URL('${fileName}', document.baseURI).href`; } }; } ``` ### resolveImportMeta | | | | --: | :-- | | Type: | `(property: string \| null, {chunkId: string, moduleId: string, format: string}) => string \| null` | | Kind: | sync, first | | Previous: | [`renderDynamicImport`](#renderdynamicimport) for each dynamic import expression in the current chunk | | Next: | [`banner`](#banner), [`footer`](#footer), [`intro`](#intro), [`outro`](#outro) in parallel for the current chunk | Allows to customize how Rollup handles `import.meta` and `import.meta.someProperty`, in particular `import.meta.url`. In ES modules, `import.meta` is an object and `import.meta.url` contains the URL of the current module, e.g. `http://server.net/bundle.js` for browsers or `file:///path/to/bundle.js` in Node. By default, for formats other than ES modules, Rollup replaces `import.meta.url` with code that attempts to match this behaviour by returning the dynamic URL of the current chunk. Note that all formats except CommonJS and UMD assume that they run in a browser environment where `URL` and `document` are available. For other properties, `import.meta.someProperty` is replaced with `undefined` while `import.meta` is replaced with an object containing a `url` property. This behaviour can be changed—also for ES modules—via this hook. For each occurrence of `import.meta<.someProperty>`, this hook is called with the name of the property or `null` if `import.meta` is accessed directly. For example, the following code will resolve `import.meta.url` using the relative path of the original module to the current working directory and again resolve this path against the base URL of the current document at runtime: ```js function importMetaUrlCurrentModulePlugin() { return { name: 'import-meta-url-current-module', resolveImportMeta(property, { moduleId }) { if (property === 'url') { return `new URL('${path.relative( process.cwd(), moduleId )}', document.baseURI).href`; } return null; } }; } ``` If the `chunkId` would contain a hash, it will contain a placeholder instead. If this placeholder ends up in the generated code, Rollup will replace it with the actual chunk hash. ### writeBundle | | | | --: | :-- | | Type: | `(options: OutputOptions, bundle: { [fileName: string]: AssetInfo \| ChunkInfo }) => void` | | Kind: | async, parallel | | Previous: | [`generateBundle`](#generatebundle) | | Next: | If it is called, this is the last hook of the output generation phase and may again be followed by [`outputOptions`](#outputoptions) if another output is generated | Called only at the end of `bundle.write()` once all files have been written. Similar to the [`generateBundle`](#generatebundle) hook, `bundle` provides the full list of files being written along with their details. ## Plugin Context A number of utility functions and informational bits can be accessed from within most [hooks](#build-hooks) via `this`: ### this.addWatchFile | | | | ----: | :--------------------- | | Type: | `(id: string) => void` | Adds additional files to be monitored in watch mode so that changes to these files will trigger rebuilds. `id` can be an absolute path to a file or directory or a path relative to the current working directory. This context function can only be used in hooks during the build phase, i.e. in `buildStart`, `load`, `resolveId`, and `transform`. **Note:** Usually in watch mode to improve rebuild speed, the `transform` hook will only be triggered for a given module if its contents actually changed. Using `this.addWatchFile` from within the `transform` hook will make sure the `transform` hook is also reevaluated for this module if the watched file changes. In general, it is recommended to use `this.addWatchFile` from within the hook that depends on the watched file. ### this.debug | | | | --: | :-- | | Type: | `(log: string \| RollupLog \| (() => RollupLog \| string), position?: number \| { column: number; line: number }) => void` | Generate a `"debug"` log. See [`this.warn`](#this-warn) for details. Debug logs always get `code: "PLUGIN_LOG"` added by Rollup. Make sure to add a distinctive `pluginCode` to those logs for easy filtering. These logs are only processed if the [`logLevel`](../configuration-options/index.md#loglevel) option is explicitly set to `"debug"`, otherwise it does nothing. Therefore, it is encouraged to add helpful debug logs to plugins as that can help spot issues while they will be efficiently muted by default. If you need to do expensive computations to generate the log, make sure to use the function form so that these computations are only performed if the log is actually processed. ```js function plugin() { return { name: 'test', transform(code, id) { this.debug( () => `transforming ${id},\n` + `module contains, ${code.split('\n').length} lines` ); } }; } ``` ### this.emitFile | | | | --: | :-- | | Type: | `(emittedFile: EmittedChunk \| EmittedPrebuiltChunk \| EmittedAsset) => string` | ```typescript interface EmittedChunk { type: 'chunk'; id: string; name?: string; fileName?: string; implicitlyLoadedAfterOneOf?: string[]; importer?: string; preserveSignature?: 'strict' | 'allow-extension' | 'exports-only' | false; } interface EmittedPrebuiltChunk { type: 'prebuilt-chunk'; fileName: string; code: string; exports?: string[]; map?: SourceMap; } interface EmittedAsset { type: 'asset'; name?: string; needsCodeReference?: boolean; fileName?: string; source?: string | Uint8Array; } ``` Emits a new file that is included in the build output and returns a `referenceId` that can be used in various places to reference the emitted file. You can emit chunks, prebuilt chunks or assets. When emitting chunks or assets, either a `name` or a `fileName` can be supplied. If a `fileName` is provided, it will be used unmodified as the name of the generated file, throwing an error if this causes a conflict. Otherwise, if a `name` is supplied, this will be used as substitution for `[name]` in the corresponding [`output.chunkFileNames`](../configuration-options/index.md#output-chunkfilenames) or [`output.assetFileNames`](../configuration-options/index.md#output-assetfilenames) pattern, possibly adding a unique number to the end of the file name to avoid conflicts. If neither a `name` nor `fileName` is supplied, a default name will be used. Prebuilt chunks must always have a `fileName`. You can reference the URL of an emitted file in any code returned by a [`load`](#load) or [`transform`](#transform) plugin hook via `import.meta.ROLLUP_FILE_URL_referenceId`. See [File URLs](#file-urls) for more details and an example. The generated code that replaces `import.meta.ROLLUP_FILE_URL_referenceId` can be customized via the [`resolveFileUrl`](#resolvefileurl) plugin hook. You can also use [`this.getFileName(referenceId)`](#this-getfilename) to determine the file name as soon as it is available. If the file name is not set explicitly, then - asset file names are available starting with the [`renderStart`](#renderstart) hook. For assets that are emitted later, the file name will be available immediately after emitting the asset. - chunk file names that do not contain a hash are available as soon as chunks are created after the `renderStart` hook. - if a chunk file name would contain a hash, using `getFileName` in any hook before [`generateBundle`](#generatebundle) will return a name containing a placeholder instead of the actual name. If you use this file name or parts of it in a chunk you transform in [`renderChunk`](#renderchunk), Rollup will replace the placeholder with the actual hash before `generateBundle`, making sure the hash reflects the actual content of the final generated chunk including all referenced file hashes. If the `type` is _`chunk`_, then this emits a new chunk with the given module `id` as entry point. To resolve it, the `id` will be passed through build hooks just like regular entry points, starting with [`resolveId`](#resolveid). If an `importer` is provided, this acts as the second parameter of `resolveId` and is important to properly resolve relative paths. If it is not provided, paths will be resolved relative to the current working directory. If a value for `preserveSignature` is provided, this will override [`preserveEntrySignatures`](../configuration-options/index.md#preserveentrysignatures) for this particular chunk. This will not result in duplicate modules in the graph, instead if necessary, existing chunks will be split or a facade chunk with reexports will be created. Chunks with a specified `fileName` will always generate separate chunks while other emitted chunks may be deduplicated with existing chunks even if the `name` does not match. If such a chunk is not deduplicated, the [`output.chunkFileNames`](../configuration-options/index.md#output-chunkfilenames) name pattern will be used. By default, Rollup assumes that emitted chunks are executed independent of other entry points, possibly even before any other code is executed. This means that if an emitted chunk shares a dependency with an existing entry point, Rollup will create an additional chunk for dependencies that are shared between those entry points. Providing a non-empty array of module ids for `implicitlyLoadedAfterOneOf` will change that behaviour by giving Rollup additional information to prevent this in some cases. Those ids will be resolved the same way as the `id` property, respecting the `importer` property if it is provided. Rollup will now assume that the emitted chunk is only executed if at least one of the entry points that lead to one of the ids in `implicitlyLoadedAfterOneOf` being loaded has already been executed, creating the same chunks as if the newly emitted chunk was only reachable via dynamic import from the modules in `implicitlyLoadedAfterOneOf`. Here is an example that uses this to create a simple HTML file with several scripts, creating optimized chunks to respect their execution order: ```js // rollup.config.js function generateHtmlPlugin() { let ref1, ref2, ref3; return { name: 'generate-html', buildStart() { ref1 = this.emitFile({ type: 'chunk', id: 'src/entry1' }); ref2 = this.emitFile({ type: 'chunk', id: 'src/entry2', implicitlyLoadedAfterOneOf: ['src/entry1'] }); ref3 = this.emitFile({ type: 'chunk', id: 'src/entry3', implicitlyLoadedAfterOneOf: ['src/entry2'] }); }, generateBundle() { this.emitFile({ type: 'asset', fileName: 'index.html', source: ` Title ` }); } }; } export default { input: [], preserveEntrySignatures: false, plugins: [generateHtmlPlugin()], output: { format: 'es', dir: 'dist' } }; ``` If there are no dynamic imports, this will create exactly three chunks where the first chunk contains all dependencies of `src/entry1`, the second chunk contains only the dependencies of `src/entry2` that are not contained in the first chunk, importing those from the first chunk, and again the same for the third chunk. Note that even though any module id can be used in `implicitlyLoadedAfterOneOf`, Rollup will throw an error if such an id cannot be uniquely associated with a chunk, e.g. because the `id` cannot be reached implicitly or explicitly from the existing static entry points, or because the file is completely tree-shaken. Using only entry points, either defined by the user or of previously emitted chunks, will always work, though. If the `type` is `prebuilt-chunk`, it emits a chunk with fixed contents provided by the `code` parameter. At the moment, `fileName` is also required to provide the name of the chunk. If it exports some variables, we should list these via the optional `exports`. Via `map` we can provide a sourcemap that corresponds to `code`. To reference a prebuilt chunk in imports, we need to mark the "module" as external in the [`resolveId`](#resolveid) hook as prebuilt chunks are not part of the module graph. Instead, they behave like assets with chunk meta-data: ```js function emitPrebuiltChunkPlugin() { return { name: 'emit-prebuilt-chunk', load(id) { if (id === '/my-prebuilt-chunk.js') { return { id, external: true }; } }, buildStart() { this.emitFile({ type: 'prebuilt-chunk', fileName: 'my-prebuilt-chunk.js', code: 'export const foo = "foo"', exports: ['foo'] }); } }; } ``` Then you can reference the prebuilt chunk in your code: ```js import { foo } from '/my-prebuilt-chunk.js'; ``` Currently, emitting a prebuilt chunk is a basic feature. Looking forward to your feedback. If the `type` is _`asset`_, then this emits an arbitrary new file with the given `source` as content. It is possible to defer setting the `source` via [`this.setAssetSource(referenceId, source)`](#this-setassetsource) to a later time to be able to reference a file during the build phase while setting the source separately for each output during the generate phase. Assets with a specified `fileName` will always generate separate files while other emitted assets may be deduplicated with existing assets if they have the same source even if the `name` does not match. If an asset without a `fileName` is not deduplicated, the [`output.assetFileNames`](../configuration-options/index.md#output-assetfilenames) name pattern will be used. If `needsCodeReference` is set to `true` and this asset is not referenced by any code in the output via `import.meta.ROLLUP_FILE_URL_referenceId`, then Rollup will not emit it. This also respects references removed via tree-shaking, i.e. if the corresponding `import.meta.ROLLUP_FILE_URL_referenceId` is part of the source code but is not actually used and the reference is removed by tree-shaking, then the asset is not emitted. ### this.error | | | | --: | :-- | | Type: | `(error: string \| RollupLog \| Error, position?: number \| { column: number; line: number }) => never` | Structurally equivalent to [`this.warn`](#this-warn), except that it will also abort the bundling process with an error. See the [`onLog`](../configuration-options/index.md#onlog) option for information about the `RollupLog` type. If an Error instance is passed, it will be used as-is, otherwise a new Error instance will be created with the given error message and all additional provided properties. In all hooks except the [`onLog`](#onlog) hook, the error will be augmented with `code: "PLUGIN_ERROR"` and `plugin: plugin.name`properties. If a`code`property already exists and the code does not start with`PLUGIN_`, it will be renamed to `pluginCode`. In the [`onLog`](#onlog) hook, this function is an easy way to turn warnings into errors while keeping all additional properties of the warning: ```js function myPlugin() { return { name: 'my-plugin', onLog(level, log) { if (level === 'warn' && log.code === 'THIS_IS_NOT_OK') { return this.error(log); } } }; } ``` When used in the `transform` hook, the `id` of the current module will also be added and a `position` can be supplied. This is a character index or file location which will be used to augment the log with `pos`, `loc` (a standard `{ file, line, column }` object) and `frame` (a snippet of code showing the location). ### this.getCombinedSourcemap | | | | ----: | :---------------- | | Type: | `() => SourceMap` | Get the combined source maps of all previous plugins. This context function can only be used in the [`transform`](#transform) plugin hook. ### this.getFileName | | | | ----: | :-------------------------------- | | Type: | `(referenceId: string) => string` | Get the file name of a chunk or asset that has been emitted via [`this.emitFile`](#this-emitfile). The file name will be relative to `outputOptions.dir`. ### this.getModuleIds | | | | ----: | :------------------------------- | | Type: | `() => IterableIterator` | Returns an `Iterator` that gives access to all module ids in the current graph. It can be iterated via ```js for (const moduleId of this.getModuleIds()) { /* ... */ } ``` or converted into an Array via `Array.from(this.getModuleIds())`. ### this.getModuleInfo | | | | ----: | :------------------------------------------- | | Type: | `(moduleId: string) => (ModuleInfo \| null)` | ```typescript interface ModuleInfo { id: string; // the id of the module, for convenience code: string | null; // the source code of the module, `null` if external or not yet available ast: ESTree.Program; // the parsed abstract syntax tree if available hasDefaultExport: boolean | null; // is there a default export, `null` if external or not yet available isEntry: boolean; // is this a user- or plugin-defined entry point isExternal: boolean; // for external modules that are referenced but not included in the graph isIncluded: boolean | null; // is the module included after tree-shaking, `null` if external or not yet available importedIds: string[]; // the module ids statically imported by this module importedIdResolutions: ResolvedId[]; // how statically imported ids were resolved, for use with this.load importers: string[]; // the ids of all modules that statically import this module exportedBindings: Record | null; // contains all exported variables associated with the path of `from`, `null` if external exports: string[] | null; // all exported variables, `null` if external dynamicallyImportedIds: string[]; // the module ids imported by this module via dynamic import() dynamicallyImportedIdResolutions: ResolvedId[]; // how ids imported via dynamic import() were resolved dynamicImporters: string[]; // the ids of all modules that import this module via dynamic import() implicitlyLoadedAfterOneOf: string[]; // implicit relationships, declared via this.emitFile implicitlyLoadedBefore: string[]; // implicit relationships, declared via this.emitFile assertions: { [key: string]: string }; // import assertions for this module meta: { [plugin: string]: any }; // custom module meta-data moduleSideEffects: boolean | 'no-treeshake'; // are imports of this module included if nothing is imported from it syntheticNamedExports: boolean | string; // final value of synthetic named exports } interface ResolvedId { id: string; // the id of the imported module external: boolean | 'absolute'; // is this module external, "absolute" means it will not be rendered as relative in the module assertions: { [key: string]: string }; // import assertions for this import meta: { [plugin: string]: any }; // custom module meta-data when resolving the module moduleSideEffects: boolean | 'no-treeshake'; // are side effects of the module observed, is tree-shaking enabled resolvedBy: string; // which plugin resolved this module, "rollup" if resolved by Rollup itself syntheticNamedExports: boolean | string; // does the module allow importing non-existing named exports } ``` Returns additional information about the module in question. During the build, this object represents currently available information about the module which may be inaccurate before the [`buildEnd`](#buildend) hook: - `id` and `isExternal` will never change. - `code`, `ast`, `hasDefaultExport`, `exports` and `exportedBindings` are only available after parsing, i.e. in the [`moduleParsed`](#moduleparsed) hook or after awaiting [`this.load`](#this-load). At that point, they will no longer change. - if `isEntry` is `true`, it will no longer change. It is however possible for modules to become entry points after they are parsed, either via [`this.emitFile`](#this-emitfile) or because a plugin inspects a potential entry point via [`this.load`](#this-load) in the [`resolveId`](#resolveid) hook when resolving an entry point. Therefore, it is not recommended relying on this flag in the [`transform`](#transform) hook. It will no longer change after `buildEnd`. - Similarly, `implicitlyLoadedAfterOneOf` can receive additional entries at any time before `buildEnd` via [`this.emitFile`](#this-emitfile). - `importers`, `dynamicImporters` and `implicitlyLoadedBefore` will start as empty arrays, which receive additional entries as new importers and implicit dependents are discovered. They will no longer change after `buildEnd`. - `isIncluded` is only available after `buildEnd`, at which point it will no longer change. - `importedIds`, `importedIdResolutions`, `dynamicallyImportedIds` and `dynamicallyImportedIdResolutions` are available when a module has been parsed and its dependencies have been resolved. This is the case in the `moduleParsed` hook or after awaiting [`this.load`](#this-load) with the `resolveDependencies` flag. At that point, they will no longer change. - `assertions`, `meta`, `moduleSideEffects` and `syntheticNamedExports` can be changed by [`load`](#load) and [`transform`](#transform) hooks. Moreover, while most properties are read-only, these properties are writable and changes will be picked up if they occur before the `buildEnd` hook is triggered. `meta` itself should not be overwritten, but it is ok to mutate its properties at any time to store meta information about a module. The advantage of doing this instead of keeping state in a plugin is that `meta` is persisted to and restored from the cache if it is used, e.g. when using watch mode from the CLI. Returns `null` if the module id cannot be found. ### this.getWatchFiles | | | | ----: | :--------------- | | Type: | `() => string[]` | Get ids of the files which has been watched previously. Include both files added by plugins with `this.addWatchFile` and files added implicitly by Rollup during the build. ### this.info | | | | --: | :-- | | Type: | `(log: string \| RollupLog \| (() => RollupLog \| string), position?: number \| { column: number; line: number }) => void` | Generate an `"info"` log. See [`this.warn`](#this-warn) for details. Info logs always get `code: "PLUGIN_LOG"` added by Rollup. As these logs are displayed by default, use them for information that is not a warning but makes sense to display to all users on every build. If the [`logLevel`](../configuration-options/index.md#loglevel) option is set to `"warn"` or `"silent"`, this method will do nothing. ### this.load | | | | ----: | :----- | | Type: | `Load` | ```typescript type Load = (options: { id: string; resolveDependencies?: boolean; assertions?: Record | null; meta?: CustomPluginOptions | null; moduleSideEffects?: boolean | 'no-treeshake' | null; syntheticNamedExports?: boolean | string | null; }) => Promise; ``` Loads and parses the module corresponding to the given id, attaching additional meta information to the module if provided. This will trigger the same [`load`](#load), [`transform`](#transform) and [`moduleParsed`](#moduleparsed) hooks that would be triggered if the module were imported by another module. This allows you to inspect the final content of modules before deciding how to resolve them in the [`resolveId`](#resolveid) hook and e.g. resolve to a proxy module instead. If the module becomes part of the graph later, there is no additional overhead from using this context function as the module will not be parsed again. The signature allows you to directly pass the return value of [`this.resolve`](#this-resolve) to this function as long as it is neither `null` nor external. The returned Promise will resolve once the module has been fully transformed and parsed but before any imports have been resolved. That means that the resulting `ModuleInfo` will have empty `importedIds`, `dynamicallyImportedIds`, `importedIdResolutions` and `dynamicallyImportedIdResolutions`. This helps to avoid deadlock situations when awaiting `this.load` in a `resolveId` hook. If you are interested in `importedIds` and `dynamicallyImportedIds`, you can either implement a `moduleParsed` hook or pass the `resolveDependencies` flag, which will make the Promise returned by `this.load` wait until all dependency ids have been resolved. Note that with regard to the `assertions`, `meta`, `moduleSideEffects` and `syntheticNamedExports` options, the same restrictions apply as for the `resolveId` hook: Their values only have an effect if the module has not been loaded yet. Thus, it is very important to use `this.resolve` first to find out if any plugins want to set special values for these options in their `resolveId` hook, and pass these options on to `this.load` if appropriate. The example below showcases how this can be handled to add a proxy module for modules containing a special code comment. Note the special handling for re-exporting the default export: ```js export default function addProxyPlugin() { return { async resolveId(source, importer, options) { if (importer?.endsWith('?proxy')) { // Do not proxy ids used in proxies return null; } // We make sure to pass on any resolveId options to // this.resolve to get the module id const resolution = await this.resolve(source, importer, { skipSelf: true, ...options }); // We can only pre-load existing and non-external ids if (resolution && !resolution.external) { // we pass on the entire resolution information const moduleInfo = await this.load(resolution); if (moduleInfo.code.includes('/* use proxy */')) { return `${resolution.id}?proxy`; } } // As we already fully resolved the module, there is no reason // to resolve it again return resolution; }, load(id) { if (id.endsWith('?proxy')) { const importee = id.slice(0, -'?proxy'.length); // Note that namespace reexports do not reexport default // exports let code = `console.log('proxy for ${importee}'); export * from ${JSON.stringify( importee )};`; // We know that while resolving the proxy, importee was // already fully loaded and parsed, so we can rely on // hasDefaultExport if (this.getModuleInfo(importee).hasDefaultExport) { code += `export { default } from ${JSON.stringify(importee)};`; } return code; } return null; } }; } ``` If the module was already loaded, `this.load` will just wait for the parsing to complete and then return its module information. If the module was not yet imported by another module, it will not automatically trigger loading other modules imported by this module. Instead, static and dynamic dependencies will only be loaded once this module has actually been imported at least once. While it is safe to use `this.load` in a `resolveId` hook, you should be very careful when awaiting it in a `load` or `transform` hook. If there are cyclic dependencies in the module graph, this can easily lead to a deadlock, so any plugin needs to manually take care to avoid waiting for `this.load` inside the `load` or `transform` of the any module that is in a cycle with the loaded module. Here is another, more elaborate example where we scan entire dependency sub-graphs via the `resolveDependencies` option and repeated calls to `this.load`. We use a `Set` of handled module ids to handle cyclic dependencies. The goal of the plugin is to add a log to each dynamically imported chunk that just lists all modules in the chunk. While this is just a toy example, the technique could be used to e.g. create a single style tag for all CSS imported in the sub-graph. ```js // The leading \0 instructs other plugins not to try to resolve, load or // transform our proxy modules const DYNAMIC_IMPORT_PROXY_PREFIX = '\0dynamic-import:'; export default function dynamicChunkLogsPlugin() { return { name: 'dynamic-chunk-logs', async resolveDynamicImport(specifier, importer) { // Ignore non-static targets if (!(typeof specifier === 'string')) return; // Get the id and initial meta information of the import target const resolved = await this.resolve(specifier, importer); // Ignore external targets. Explicit externals have the // "external" property while unresolved imports are "null". if (resolved && !resolved.external) { // We trigger loading the module without waiting for it // here because meta information attached by resolveId // hooks, that may be contained in "resolved" and that // plugins like "commonjs" may depend upon, is only // attached to a module the first time it is loaded. This // ensures that this meta information is not lost when we // later use "this.load" again in the load hook with just // the module id. this.load(resolved); return `${DYNAMIC_IMPORT_PROXY_PREFIX}${resolved.id}`; } }, async load(id) { // Ignore all files except our dynamic import proxies if (!id.startsWith('\0dynamic-import:')) return null; const actualId = id.slice(DYNAMIC_IMPORT_PROXY_PREFIX.length); // To allow loading modules in parallel while keeping // complexity low, we do not directly await each "this.load" // call but put their promises into an array where we await // them via an async for loop. const moduleInfoPromises = [ this.load({ id: actualId, resolveDependencies: true }) ]; // We track each loaded dependency here so that we do not load // a file twice and also do not get stuck when there are // circular dependencies. const dependencies = new Set([actualId]); // "importedIdResolutions" tracks the objects created by // resolveId hooks. We are using those instead of "importedIds" // so that again, important meta information is not lost. for await (const { importedIdResolutions } of moduleInfoPromises) { for (const resolved of importedIdResolutions) { if (!dependencies.has(resolved.id)) { dependencies.add(resolved.id); moduleInfoPromises.push( this.load({ ...resolved, resolveDependencies: true }) ); } } } // We log all modules in a dynamic chunk when it is loaded. let code = `console.log([${[...dependencies] .map(JSON.stringify) .join(', ')}]); export * from ${JSON.stringify(actualId)};`; // Namespace reexports do not reexport default exports, which // is why we reexport it manually if it exists if (this.getModuleInfo(actualId).hasDefaultExport) { code += `export { default } from ${JSON.stringify(actualId)};`; } return code; } }; } ``` ### this.meta | | | | ----: | :-------------------------------------------- | | Type: | `{rollupVersion: string, watchMode: boolean}` | An object containing potentially useful Rollup metadata: - `rollupVersion`: The currently running version of Rollup as define in `package.json`. - `watchMode`: `true` if Rollup was started via `rollup.watch(...)` or from the command line with `--watch`, `false` otherwise. `meta` is the only context property accessible from the [`options`](#options) hook. ### this.parse | | | | ----: | :-------------------------------------------------------------- | | Type: | `(code: string, acornOptions?: AcornOptions) => ESTree.Program` | Use Rollup's internal acorn instance to parse code to an AST. ### this.resolve | | | | ----: | :-------- | | Type: | `Resolve` | ```typescript type Resolve = ( source: string, importer?: string, options?: { skipSelf?: boolean; isEntry?: boolean; assertions?: { [key: string]: string }; custom?: { [plugin: string]: any }; } ) => ResolvedId; ``` ::: tip The return type **ResolvedId** of this hook is defined in [`this.getModuleInfo`](#this-getmoduleinfo). ::: Resolve imports to module ids (i.e. file names) using the same plugins that Rollup uses, and determine if an import should be external. If `null` is returned, the import could not be resolved by Rollup or any plugin but was not explicitly marked as external by the user. If an absolute external id is returned that should remain absolute in the output either via the [`makeAbsoluteExternalsRelative`](../configuration-options/index.md#makeabsoluteexternalsrelative) option or by explicit plugin choice in the [`resolveId`](#resolveid) hook, `external` will be `"absolute"` instead of `true`. If you pass `skipSelf: true`, then the `resolveId` hook of the plugin from which `this.resolve` is called will be skipped when resolving. When other plugins themselves also call `this.resolve` in their `resolveId` hooks with the _exact same `source` and `importer`_ while handling the original `this.resolve` call, then the `resolveId` hook of the original plugin will be skipped for those calls as well. The rationale here is that the plugin already stated that it "does not know" how to resolve this particular combination of `source` and `importer` at this point in time. If you do not want this behaviour, do not use `skipSelf` but implement your own infinite loop prevention mechanism if necessary. You can also pass an object of plugin-specific options via the `custom` option, see [custom resolver options](#custom-resolver-options) for details. The value for `isEntry` you pass here will be passed along to the [`resolveId`](#resolveid) hooks handling this call, otherwise `false` will be passed if there is an importer and `true` if there is not. If you pass an object for `assertions`, it will simulate resolving an import with an assertion, e.g. `assertions: {type: "json"}` simulates resolving `import "foo" assert {type: "json"}`. This will be passed to any [`resolveId`](#resolveid) hooks handling this call and may ultimately become part of the returned object. When calling this function from a `resolveId` hook, you should always check if it makes sense for you to pass along the `isEntry`, `custom` and `assertions` options. The value of `resolvedBy` refers to which plugin resolved this source. If it was resolved by Rollup itself, the value will be "rollup". If a `resolveId` hook in a plugin resolves this source, the value will be the name of the plugin unless it returned an explicit value for `resolvedBy`. This flag is only for debugging and documentation purposes and is not processed further by Rollup. ### this.setAssetSource | | | | ----: | :------------------------------------------------------------ | | Type: | `(referenceId: string, source: string \| Uint8Array) => void` | Set the deferred source of an asset. Note that you can also pass a Node `Buffer` as `source` as it is a sub-class of `Uint8Array`. ### this.warn | | | | --: | :-- | | Type: | `(log: string \| RollupLog \| (() => RollupLog \| string), position?: number \| { column: number; line: number }) => void` | Using this method will generate warnings for a build, which are logs with log level `"warn"`. See the [`onLog`](../configuration-options/index.md#onlog) option for information about the `RollupLog` type. To generate other logs, see also [`this.info`](#this-info) and [`this.debug`](#this-debug). To generate errors, see [`this.error`](#this-error). Just like internally generated warnings, these logs will be first passed to and filtered by plugin [`onLog`](#onlog) hooks before they are forwarded to custom [`onLog`](../configuration-options/index.md#onlog) or [`onwarn`](../configuration-options/index.md#onwarn) handlers or printed to the console. The `warning` argument can be a `string` or an object with (at minimum) a `message` property: ```js this.warn('hmm...'); // is equivalent to this.warn({ message: 'hmm...', pluginCode: 'CODE_TO_IDENTIFY_LOG', meta: 'Additional plugin specific information' }); ``` We encourage you to use objects with a `pluginCode` property as that will allow users to easily filter for those logs in an `onLog` handler. If you need to add additional information, you can use the `meta` property. If the log contains a `code` and does not yet have a `pluginCode` property, it will be renamed to `pluginCode` as plugin warnings always get a `code` of `PLUGIN_WARNING` added by Rollup. To prevent this behavior, plugins can instead use the normalized `onLog` option passed to the [`buildStart`](#buildstart) hook. Calling this option from a plugin will not change properties when passing the log to plugin `onLog` handlers and `onLog` or `onwarn` handlers. If you need to do expensive computations to generate a log, you can also pass a function returning either a `string` or a `RollupLog` object. This function will only be called if the log is not filtered by the [`logLevel`](../configuration-options/index.md#loglevel) option. ```js // This will only run if the logLevel is set to "debug" this.debug(() => generateExpensiveDebugLog()); ``` When used in the `transform` hook, the `id` of the current module will also be added and a `position` can be supplied. This is a character index or file location which will be used to augment the log with `pos`, `loc` (a standard `{ file, line, column }` object) and `frame` (a snippet of code showing the location). If the [`logLevel`](../configuration-options/index.md#loglevel) option is set to `"silent"`, this method will do nothing. ## Deprecated Context Functions â˜¢ï¸ These context utility functions have been deprecated and may be removed in a future Rollup version. - `this.moduleIds: IterableIterator` - _**Use [`this.getModuleIds`](#this-getmoduleids)**_ - An `Iterator` that gives access to all module ids in the current graph. It can be iterated via ```js for (const moduleId of this.moduleIds) { /* ... */ } ``` or converted into an Array via `Array.from(this.moduleIds)`. ## File URLs To reference a file URL reference from within JS code, use the `import.meta.ROLLUP_FILE_URL_referenceId` replacement. This will generate code that depends on the output format and generates a URL that points to the emitted file in the target environment. Note that all formats except CommonJS and UMD assume that they run in a browser environment where `URL` and `document` are available. The following example will detect imports of `.svg` files, emit the imported files as assets, and return their URLs to be used e.g. as the `src` attribute of an `img` tag: ```js function svgResolverPlugin() { return { name: 'svg-resolver', resolveId(source, importer) { if (source.endsWith('.svg')) { return path.resolve(path.dirname(importer), source); } }, load(id) { if (id.endsWith('.svg')) { const referenceId = this.emitFile({ type: 'asset', name: path.basename(id), source: fs.readFileSync(id) }); return `export default import.meta.ROLLUP_FILE_URL_${referenceId};`; } } }; } ``` Usage: ```js import logo from '../images/logo.svg'; const image = document.createElement('img'); image.src = logo; document.body.appendChild(image); ``` Sometimes, the code which referenced this asset is only used conditionally like in the following example: ```js import logo from '../images/logo.svg'; if (COMPILER_FLAG) { const image = document.createElement('img'); image.src = logo; document.body.appendChild(image); } ``` If a plugin replaces `COMPILER_FLAG` with `false`, then we will get an unexpected result: The unreferenced asset is still emitted but unused. We can resolve this problem by setting `needsCodeReference` to true when calling [`this.emitFile`](#this-emitfile), like in the following code: ```js function svgResolverPlugin() { return { /* ... */ load(id) { if (id.endsWith('.svg')) { const referenceId = this.emitFile({ type: 'asset', name: path.basename(id), needsCodeReference: true, source: fs.readFileSync(id) }); return `export default import.meta.ROLLUP_FILE_URL_${referenceId};`; } } }; } ``` Now the asset will only be added to the bundle if the reference `import.meta.ROLLUP_FILE_URL_referenceId` is actually used in the code. Similar to assets, emitted chunks can be referenced from within JS code via `import.meta.ROLLUP_FILE_URL_referenceId` as well. The following example will detect imports prefixed with `register-paint-worklet:` and generate the necessary code and separate chunk to generate a CSS paint worklet. Note that this will only work in modern browsers and will only work if the output format is set to `es`. ```js const REGISTER_WORKLET = 'register-paint-worklet:'; function registerPaintWorkletPlugin() { return { name: 'register-paint-worklet', load(id) { if (id.startsWith(REGISTER_WORKLET)) { return `CSS.paintWorklet.addModule(import.meta.ROLLUP_FILE_URL_${this.emitFile( { type: 'chunk', id: id.slice(REGISTER_WORKLET.length) } )});`; } }, resolveId(source, importer) { // We remove the prefix, resolve everything to absolute ids and // add the prefix again. This makes sure that you can use // relative imports to define worklets if (source.startsWith(REGISTER_WORKLET)) { return this.resolve( source.slice(REGISTER_WORKLET.length), importer ).then(resolvedId => REGISTER_WORKLET + resolvedId.id); } return null; } }; } ``` Usage: ```js // main.js import 'register-paint-worklet:./worklet.js'; import { color, size } from './config.js'; document.body.innerHTML += `

color: ${color}, size: ${size}

`; // worklet.js import { color, size } from './config.js'; registerPaint( 'vertical-lines', class { paint(ctx, geom) { for (let x = 0; x < geom.width / size; x++) { ctx.beginPath(); ctx.fillStyle = color; ctx.rect(x * size, 0, 2, geom.height); ctx.fill(); } } } ); // config.js export const color = 'greenyellow'; export const size = 6; ``` If you build this code, both the main chunk and the worklet will share the code from `config.js` via a shared chunk. This enables us to make use of the browser cache to reduce transmitted data and speed up loading the worklet. ## Transformers Transformer plugins (i.e. those that return a `transform` function for e.g. transpiling non-JS files) should support `options.include` and `options.exclude`, both of which can be a minimatch pattern or an array of minimatch patterns. If `options.include` is omitted or of zero length, files should be included by default; otherwise they should only be included if the ID matches one of the patterns. The `transform` hook, if returning an object, can also include an `ast` property. Only use this feature if you know what you're doing. Note that only the last AST in a chain of transforms will be used (and if there are transforms, any ASTs generated by the `load` hook will be discarded for the transformed modules.) ### Example Transformer (Use [@rollup/pluginutils](https://github.com/rollup/plugins/tree/master/packages/pluginutils) for commonly needed functions, and to implement a transformer in the recommended manner.) ```js import { createFilter } from '@rollup/pluginutils'; function transformCodePlugin(options = {}) { const filter = createFilter(options.include, options.exclude); return { name: 'transform-code', transform(code, id) { if (!filter(id)) return; // proceed with the transformation... return { code: generatedCode, map: generatedSourceMap }; } }; } ``` ### Source Code Transformations If a plugin transforms source code, it should generate a sourcemap automatically, unless there's a specific `sourceMap: false` option. Rollup only cares about the `mappings` property (everything else is handled automatically). [magic-string](https://github.com/Rich-Harris/magic-string) provides a simple way to generate such a map for elementary transformations like adding or removing code snippets. If it doesn't make sense to generate a sourcemap, (e.g. [rollup-plugin-string](https://github.com/TrySound/rollup-plugin-string)), return an empty sourcemap: ```js return { code: transformedCode, map: { mappings: '' } }; ``` If the transformation does not move code, you can preserve existing sourcemaps by returning `null`: ```js return { code: transformedCode, map: null }; ``` If you create a plugin that you think would be useful to others, please publish it to NPM and add submit it to [github.com/rollup/awesome](https://github.com/rollup/awesome)! ## Synthetic named exports It is possible to designate a fallback export for missing exports by setting the `syntheticNamedExports` option for a module in the [`resolveId`](#resolveid), [`load`](#load) or [`transform`](#transform) hook. If a string value is used for `syntheticNamedExports`, this module will fallback the resolution of any missing named exports to properties of the named export of the given name: **dep.js: (`{syntheticNamedExports: '__synthetic'}`)** ```js export const foo = 'explicit'; export const __synthetic = { foo: 'foo', bar: 'bar' }; ``` **main.js:** ```js import { foo, bar, baz, __synthetic } from './dep.js'; // logs "explicit" as non-synthetic exports take precedence console.log(foo); // logs "bar", picking the property from __synthetic console.log(bar); // logs "undefined" console.log(baz); // logs "{foo:'foo',bar:'bar'}" console.log(__synthetic); ``` When used as an entry point, only explicit exports will be exposed. The synthetic fallback export, i.e. `__synthetic` in the example, will not be exposed for string values of `syntheticNamedExports`. However, if the value is `true`, the default export will be exposed. This is the only notable difference between `syntheticNamedExports: true` and `syntheticNamedExports: 'default'`. ## Inter-plugin communication At some point when using many dedicated plugins, there may be the need for unrelated plugins to be able to exchange information during the build. There are several mechanisms through which Rollup makes this possible. ### Custom resolver options Assume you have a plugin that should resolve an import to different ids depending on how the import was generated by another plugin. One way to achieve this would be to rewrite the import to use special proxy ids, e.g. a transpiled import via `require("foo")` in a CommonJS file could become a regular import with a special id `import "foo?require=true"` so that a resolver plugin knows this. The problem here, however, is that this proxy id may or may not cause unintended side effects when passed to other resolvers because it does not really correspond to a file. Moreover, if the id is created by plugin `A` and the resolution happens in plugin `B`, it creates a dependency between these plugins so that `A` is not usable without `B`. Custom resolver option offer a solution here by allowing to pass additional options for plugins when manually resolving a module via `this resolve`. This happens without changing the id and thus without impairing the ability for other plugins to resolve the module correctly if the intended target plugin is not present. ```js function requestingPlugin() { return { name: 'requesting', async buildStart() { const resolution = await this.resolve('foo', undefined, { custom: { resolving: { specialResolution: true } } }); console.log(resolution.id); // "special" } }; } function resolvingPlugin() { return { name: 'resolving', resolveId(id, importer, { custom }) { if (custom.resolving?.specialResolution) { return 'special'; } return null; } }; } ``` Note the convention that custom options should be added using a property corresponding to the plugin name of the resolving plugin. It is responsibility of the resolving plugin to specify which options it respects. ### Custom module meta-data Plugins can annotate modules with custom meta-data which can be set by themselves and other plugins via the [`resolveId`](#resolveid), [`load`](#load), and [`transform`](#transform) hooks and accessed via [`this.getModuleInfo`](#this-getmoduleinfo), [`this.load`](#this-load) and the [`moduleParsed`](#moduleparsed) hook. This meta-data should always be JSON.stringifyable and will be persisted in the cache e.g. in watch mode. ```js function annotatingPlugin() { return { name: 'annotating', transform(code, id) { if (thisModuleIsSpecial(code, id)) { return { meta: { annotating: { special: true } } }; } } }; } function readingPlugin() { let parentApi; return { name: 'reading', buildEnd() { const specialModules = Array.from(this.getModuleIds()).filter( id => this.getModuleInfo(id).meta.annotating?.special ); // do something with this list } }; } ``` Note the convention that plugins that add or modify data should use a property corresponding to the plugin name, in this case `annotating`. On the other hand, any plugin can read all meta-data from other plugins via `this.getModuleInfo`. If several plugins add meta-data or meta-data is added in different hooks, then these `meta` objects will be merged shallowly. That means if plugin `first` adds `{meta: {first: {resolved: "first"}}}` in the resolveId hook and `{meta: {first: {loaded: "first"}}}` in the load hook while plugin `second` adds `{meta: {second: {transformed: "second"}}}` in the `transform` hook, then the resulting `meta` object will be `{first: {loaded: "first"}, second: {transformed: "second"}}`. Here the result of the `resolveId` hook will be overwritten by the result of the `load` hook as the plugin was both storing them under its `first` top-level property. The `transform` data of the other plugin on the other hand will be placed next to it. The `meta` object of a module is created as soon as Rollup starts loading a module and is updated for each lifecycle hook of the module. If you store a reference to this object, you can also update it manually. To access the meta object of a module that has not been loaded yet, you can trigger its creation and loading the module via [`this.load`](#this-load): ```js function plugin() { return { name: 'test', buildStart() { // trigger loading a module. We could also pass an initial // "meta" object here, but it would be ignored if the module // was already loaded via other means this.load({ id: 'my-id' }); // the module info is now available, we do not need to await // this.load const meta = this.getModuleInfo('my-id').meta; // we can also modify meta manually now meta.test = { some: 'data' }; } }; } ``` ### Direct plugin communication For any other kind of inter-plugin communication, we recommend the pattern below. Note that `api` will never conflict with any upcoming plugin hooks. ```js function parentPlugin() { return { name: 'parent', api: { //...methods and properties exposed for other plugins doSomething(...args) { // do something interesting } } // ...plugin hooks }; } function dependentPlugin() { let parentApi; return { name: 'dependent', buildStart({ plugins }) { const parentName = 'parent'; const parentPlugin = plugins.find( plugin => plugin.name === parentName ); if (!parentPlugin) { // or handle this silently if it is optional throw new Error( `This plugin depends on the "${parentName}" plugin.` ); } // now you can access the API methods in subsequent hooks parentApi = parentPlugin.api; }, transform(code, id) { if (thereIsAReasonToDoSomething(id)) { parentApi.doSomething(id); } } }; } ``` rollup-3.29.4/docs/public/000077500000000000000000000000001450520414700153365ustar00rootroot00000000000000rollup-3.29.4/docs/public/favicon.png000066400000000000000000000121151450520414700174710ustar00rootroot00000000000000‰PNG  IHDR€€Ã>aË pHYs  šœtEXtSoftwareAdobe ImageReadyqÉe<ÚIDATxÚì]Yp×u½¯gÁ ö ’ iQ‘±(%rdZŒíز­e'VœÄE}dqª\e'UùÈWR•ŸTåGY>GÎGâ¤R‘U¥¸ìXeвä0$‹Z,j!@ˆ A€ 0,3½½›÷f™î~¯§@?Öà g¦ƒ¾çž{ïyKD)íÔ©³ìçó¬÷ÁÖm3¬ß¨è¯°þLN¦6ëD$€_ŒOÁölW `xžáÛ»q–ø>ëÏ10Üh÷/«„ö’Þö±þ-Ö§sN‘!¶iãŒøÁ ÖŸ °½Y០Œðx€íÍçžc½?ÀömßÊ•mÀ!‚ œ þ"È/ íà½á±Áü㉑{!jÍn­ ’ùÜÍ{¬wš?g 8ÉŸ BP àÆàzÏì]ÆCÃÝ‰Š·†êS|bš™K/Ã;‹ rñNY°â)àB -A(91ü#Ãü¡ Žô z> -  ÏÓ™ò“©er>ëzñS\D:ÛJ51@#ÃïèüÆÉí©?¾a¬講* ë`fmi€ÄØ)0Â8· €?7 `Ð3\¾©*ÿ=ÕSÂ ë· !êÿѱ ýÚ±D"q;£ãú€ºÄ¼Ù°¼¥/áÕÐXŸ¥I†…ÜÅí#f4Aôh‰G¤3Ç‘N ÉQ€‹JG®£òòtG N¶"„°cë'÷«øùC¶†OOh銗0»ü 3ºð.¦g(â…­x$…L€zϸ=# íߣd’ã‘®ºw1¤0@¬fV”ùy™]½Z`‚T€Vÿ›ŒòØQKù«Óy¯/4m‰fÞÉH®Œn5x}ãWƒ#ÚA``BÁ‘ÃÑlÇŽd’ôîH©äÇ×P¹8û#€³!‚4>£x\z›¹z9kŸ}Õ€™ FƒW€Ãú<ÞM`ü—¢Z÷¡Þ8Øäúê²òÂ;Ë@à›V AE;z<[c|Nù‹ÿW2> ½õÏšÅøPep§Æ·;N_C˜þ©ÿ{K½ú–†£úýêÉoû©†($|øå#‰r†ÜÌóß±$y×þSsʇ&ž Ô_õŸkëþXϾ4ƒfd®“>sü_ý;Øöàâý-–í[RyæùË¿°ÿök½÷žéÈ“ëÅýæÇY?»rË$üÇRL[ýhÐødï‹!d·îÐß?¹ž ñÎc~ê=‹ñy¦?uÞPœy2º2r3p˜:…°_Sõ_Ýøæ'Ÿ 3î?{dzå¸FžöM«¬?ó£CÄ“½‡¥ç·.i‘Ô”ñï!d&}‡Gú*ã>®ÎX²ýb»{gFF_Á‘Z Ýó§ùvѸ¿# øÔ!by1s7ß«ZvŽ®™Y'Ù>±S鎲: ™ØÓ•Dؽ“–,Ã4ï±,…á=Š/úCæ‰ͼÿÜÑõ2õ³¶qËõW¶áÃù< ‘±öOÐ<õ›yËä:«,ɬc'¢¾è«B42þW®B"ÖU~AµÌêqÚv=Õ‹{~'c€jãç°JA‰Ù­8{Ü„‡{‚¢Ð–Ž&?±;fIüÒ7<+>Lâ=û[ôö ìâÔocü\g¯“›:ìx$Žnħà@ÁYX[_¿Ÿ'~‰Ò jŠgÕóù&~-–©6/ù°’/gèB̯gÛìG!ÃcŠ'#7œ`›øõYåÞµYXÂ’Á1%9zÊG5h*÷=Ÿ}ùŠ` a¸íi¿ @d™j(¢ô*ù×êPiü/ìQ¡#Ú]~Aܘ (-ç" Ä<Û߿۬5¾ioüܱ©|‰82¥r ŸG°_• P*Æ£€ŸÙ •e_n’‡õ—zá”ñA%zôl #ÅZ¿žçWËÃ@ÊÌ2²+¢ˆ3‘tɶè¹C÷ R1ί¥r³{E©¿´ ³Ð#»¢Ä<œ¨5zµñ‹,P¹ô"F`pDÙCÌÛ8Ñ xÿà¥ì[»%Fý6 Pì¸3æ±D}Ï7mŽ+–Ž£ õεúA~Y~‡yåÿù0¯×įŽÑ«»b!˜“z3ãG-&£²'‹lkäÖï$‡Êe³@fQ:õÛ½‡;¢`<Þ 8±&~UŸ¥±Ò¯05ˆ¸g¬ Žmú僦ņ|–šâ‰m†Ê÷’ ˜u‚ùñ`¯Rs7>î*,Ý6‰;@ßr€M¿E }b\…DEÙgdÔeïÆwÉ•÷²0²LÜ5rU7<ö—ýŒÞ6hvYJ lkäʾ=ÉOô¥~§F¯óö)¬×î+:ÂÍKºâVìiŽh>ýÜB!€8ïô7&–!B*ʾ•üv-’j~O€¨×˜ñç_É‚¡£§•Aõ>Ë ¸Öž @üÅIn´ïäÈTìoàe¨×–ú© -…žÅžzŸÞk¨öP¿3ÿß>h ô˜YðVöÙ=®­Pjg|Y9{œmOð‘-ðp/K¸zJ.‡ìêgïy÷þf¿@ØgΫ §}Q±§>äîMÐ ­Ã žàÖ²x¿—²Ï«Ñ±9õ›3N_Òˆ+ƒªr€¶U@Ofq¤s¨RUñäýͨßMPÕ6ÞÐðö‘)öØÇ+€îÉË3›lŸÛc”?æ_˜¹ãÍøÍ¨ßiP•ì­1ãß¹a÷õ<ºÎXüvûè-ô齫Ðí)_ðµüïw†z€@«ñï°do5…„@+6ÈÅÿn}!¨ø×v²‚ç—wÄ­™ÿ]ïÆMþКìÝ8¯]Ǧ[Áy{ìŽc±{'/ÿÙæ€ CÐ_ßµ ÒSºò|¬¿ÁªÞ¦Ô¨ß&éÃE“μ¦)ºÇ«Øcw\ pJ†YÚ7Tœ‡ùﱞÊ+^Fûœ&y©Ÿgú×/iŠ7¯w.ö؃îïÛ 2Qu =»‡[{¸tÙ²|“f]^âç4$T_ÿ@§ÓoèJ+6‚ÚÚß虼ü\{3‘¼Ÿ9þÇú‡KÎÏëýì¢7ãËHþXK_Vy¦¯ˆÎèõ Ž8àwe™ÍyL_Úg}øP/R9Ôï6À’ñ‰¬íßÜ2‡’¿ëÀ_¶/dÿ¾À¡ÄPÉõ8í»õ~¯;6¯/Fó(˜÷¿Ú%(þøEžáK¶{æêì.ÇþEïž/’ü©‹¯«¸t—zxäÕþìÌ`çd¦hÁUÍŒÿèH6?Ó§˜r«–5H©ù03þ\Aà7²ØŠàûez0pò¹dðÌ.Ã2ÖïVôà‘ÛI‘«{é*uϯíß#b™ÿïÉ.ÒZ ‡ ¡gÆÒÐé-½Àçù¹}¼ŽçW½—þ¹+˵ÆwÏ(Ĭ#‹ýOúQ¥·N‚{ÿC#–˜uéý^Æó«ÞKÿ¯ŠsÓålß{,Gá ø"£þ×6'\æô‰ÝKQJ÷çC=ínK óúªßÚ­Ïãwõ?í—Nç/\æ8ÈÒœcCƒ±ÝÍX¿ÈdÎB7§œñå…ÀÁ¿à¯ø)ÔÊ€` ŸÛm#ùî½ßãsÊÀ/j’J=b.ø0wø]ÙYkt@Àý¬â;Ð;l™ç§¥Ü_`Q,Sœ¹¢K(õÄÅžBÜÿ“îÉËÿ>7… @ Ÿ·z?ßÓÇ©ä+:¯OC¸þ²J*çì%öäò`Àì–4ØÓJ` ä¼°c¸T÷sÚw³¼K¤æWn¿l]°¤ØÃïG½/SÀ­¦z½BË´ëôó{­süÝ_ æO_ÑpuYÖÝ>¼‹=<æwþU+ïOà2þÓ“CYèŠ ”^à³|nç&¸¨CO§sS¦"‡æ½‹=ÜøÌó¿ÖŠ˜ßºàø‰1ýL”3ÿEwÞïq^Λôú¤uBGb3@†%|øí—4}p0 ñHy–¯‘e §þfyKú¦.4žÊÕ ±‡þBßäåÇ!ÀæP/þóY¾íRJ»z°î8ö .êXxECCIFv/öp‡Åû?Úøæôá‘4(¤·,ù®9ó~ÁE,é[^ ‰=É6ðú`s€÷1ï?:·H¾NE=,îãÍwÀĮ뷓ñý€ƒA!úqîý`õ~'’¯ÈdN5÷‰±Üéq ö¡Íš<D&€qv´îŸÂwöpCýu,\ÈÇý ÅÖïµüI#…nó}h8ÛÆ½˜ø¹õ~óúÔ·4º8bX¬ÕhK7‘EUÔ´ØÓìNãUC$Ñl€,àè>€˜Ršíƒ|g£í\upê744VpÇ™ ø€#ƒ)ëÜûÕÆÆ÷ÈEêo7±Ç~Àu5 ð¸# $ë/Çþl}ïYÔQAýí&ö¸=.(ðôèЂuþõº/5ÿúUÅçöù'ö¸Ü .ªÀÒ€]1¾±Ó(BáŸç_ïF‹:pÁÄ[׌@÷ìi&ö¸ý}4€#ƒÖBŸ—~N©ßEÍóu-ð={dÇY@o1 H«ý£–8wÔï€Ô·4Ì®ã¦{Ü‚ƒý™çŒSïÛ” z3ù!ß&Þ/²¨câÌÕÆÃ¼í&ö¸ùž˜›§)o'ÐÖàA«Åí6v\Ô±øºØAˆ=î~ò?û´yêÔ¾Mì‹'!´xµì+¸¨Ãœ2èÒm٦̭O,K9 ÿïw7è‰AÅb9»Ø/²Y3Ÿß7ié“÷ƒ×ÊÏÙŸ|š¶€ä1ÀHòþrò§×Nõ¼SÇêÍ"÷ú÷ÛL?h H€ñïü&{(¯ò­ÞÖMpQ«ùéÜuS`UJØý€µÓè3 ÈaBž¶¬ó«^ä)¸Yóü¤¦´Ï JþÝØè8ßY@VøbÉÒTµ&‚›5óš_l l!8ÜžÃQH; >²€"‰þ+öõUkï5ùc5ÿÜ5û{𓤡—õ€¢¿ÛWÁgÊׇZuÁ;u¤®hPovï&äÖüdx²œýköR¯àkùï6˜ÝÛÚÀŸ¸ïäàs. ˆÑÿÓÙÃxÙè†}½ï!ù»õ?šÀªžöäñ÷íš/, ÈäÓK@ðNêÛZiMßVäñzœß, ›Eì‘©´šÄP¬ÿMSèN°LéÍ7kgùl±G†~à¶ü’Å¢U3 Z½ßCpO×-äñjxé, ÈΕz.ÿÌiƒ.×™å³ÕÅAHa1˜ôÕPÅ[ò§"Ì^©?ËgŠ=-gÁ üHÍ¿rIE]Ç€ÕvbOKY@Ñ'_|™ô¿rûÀ¹xÍ×f=(ö¸nŸ ¶ ¤ôëìï~HÔ9¬Q¼yÑ~=(öxÉÄ@ô+/-³\à4@ì§Žòéü«ù[´…bãG(† ¢´oc|çÌYfìgYª&P¸&<Ï¿ýÓó)[[´ÿ`W» îòú{IEND®B`‚rollup-3.29.4/docs/public/manifest.json000066400000000000000000000005561450520414700200450ustar00rootroot00000000000000{ "name": "Rollup", "short_name": "Rollup", "display": "fullscreen", "background_color": "#ff3333", "theme_color": "#ff3333", "scope": "/", "icons": [ { "src": "/favicon.png", "type": "image/png", "sizes": "128x128" } ], "shortcuts" : [ { "name": "Guide", "url": "/introduction/" }, { "name": "REPL", "url": "/repl/" } ] } rollup-3.29.4/docs/public/rollup-logo.svg000066400000000000000000000073301450520414700203350ustar00rootroot00000000000000 rollup-3.29.4/docs/public/twitter-card.jpg000066400000000000000000001757021450520414700204650ustar00rootroot00000000000000ÿØÿá óExifMM*bj(1$r2–‡i¬Ø ü€' ü€'Adobe Photoshop CC 2017 (Macintosh)2017:03:25 20:35:32 ÿÿ ° v&.(6 µHHÿØÿí Adobe_CMÿîAdobed€ÿÛ„            ÿÀT "ÿÝ ÿÄ?   3!1AQa"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ ?õT’I%)$’IJI$’R’I$”¤’I%)$’IJI$’R’I$”¤’I%)$’IOÿÐõT’I%,H“ÀÔ®t}|èd‘Qú?üÉt66ï^?OóLþ¨üŠc,¡ÃÃZÞî·Â9 <ÐÌrñ~¬Ã‡„ðüüwÿAïÿçßDýÜûoÿ2Vp¾¸t ËE##еÚ^Ó\ÿmߢÿ¦¸~“ÓÆvAõ$cSâ4&›¡Žü×[ÿÔ‡›Õ:¿"œ`ÌlLw:¿BºëÚ¥ú_Qu»ãóÕxóy ¸}&…›ôîÜÏð®LHã€ÉÆ“Æ8a/èK‹û¯«$¹¨Ýzì¯S¥eA},õ1ž~ŒÇÕð.u~Ÿüÿà—\®Â\QÃæ0KYc—MïDí%$’IÌ*I$’R’I$”¤’I%)$’IJI$’SÿÑõT’I%1³ù·| ñúZãUmh.sƒCZ9$ÀkGõ—°?è;àWœô (-ËxÒ–†ÕÿGÓÿ¬³þš£ÏÌ@DžÒÿ¹w> ˜bÅÌÈôöèw?¬ éââ·˜À‚æK­püëüã¿ªßæ«þCGW8•Øm?Ï[$ÒØ‡’=?RßÜþ¿øE{ªõáÓ XïmL=Ïï;ù \ÝlÈËÉk7dä<5²@Ü÷{ZÝÎÚÆª¾9NG$‰×þsw—„‰–Y»â=ïæÿÛú‹KßõŽoQcž|‰®¶ÿÒ+ÑÖ7Õ¯«ì踎p³.øvE¾ß¡US£¯s¿ã>Ÿü6VȎçWâ\Ä3óPÖ—ïpþ“ƒõǦç´ßU,î·Ù~uµ†QQ¯w«U¶¹ÿηgøÚÏøOWôiêú݆çÔoÂÍÃĽÁ”gdS²‡8WNè{ïÆõÜïÑ;2ŒuÏáPüŸñ\ÆÓIÊÙaºÊÙ]9Ç'*¶·ü#ßEVþü*ÕúÏÖú/Qú±“…‘N}ÝR—càcÔö½ö[`ôêÙ^íß µÍ¶ÝßÑý?Ò)Nw]Ì̬}u5äZϳãb»mŽ™4½ÎuïÐïwÓôþšë¨êx÷õ,¾šÀñ~)²×6‘«éznßöûý«‰ëºWõå®vç7 8ùúÿª[´åâôÿ®}M¹×3íØ˜Å6¸4X)9lÈôÜïnú½J÷×ôÿ=%73~´tì'u&ÜÛɃ’CD“üפç=»¶†ß³b úãÓÚöYn6]=:×µ•uWÕŽ/-e/õ7úÕãÜ÷µµe]^-Ÿé½5Éõ¼Ìn£õÖü7‹é²¾žÚÞߣ`É¥ßá*±ûê®Ö{,ÿº?¬½w£e}WͦŒŠî¿;Ì\\FovE­ô)Æû'óìÈ®ëëTêýLoð¿Í¤§wª:¶tÌ·Úû+­´X_em­hc·>‡~mÍÿüµ•GÖ,\™ŒÌΧ“•‰]ÔPÐÛ2úÞu–¾š*ݹ¾¥·\Ï[#ùŸQ?"ŸØ}Gä×~v †[àç´º—m}¬úlõ¶ïfõƒ„Þœê:#[Ô-èÝaÝ#cå_¥}A­/ÆÛ–Ë(ɳÿ¦ô[éäTÌSù¿Q%=WKê¸ÝN—ÙKlªÊ_éäcÜÒËj°¿Óº¿ê=k™¾«üÛÕÕƒõ_©dfÙÔi½ôeœ;™Wí,Vì« š«{¥¾¥ÿ§ÆÝé_¶íŸõ y%)$’IOÿÒõT’I%1°Ã|Šâ›éâa1Žpki®^ï–ë_þrì²ku¸öÔžÇ5¤ñ$Bãú§Õ¿¬u¶š+©¬&lÝdEžÖ?Ûùë?ŸÃ<¹1F1<"̤‡JHNq€2‰õ—‹þùå2òŸ™ëÝ :VÓù¬E¿÷ç¡€{Ò5F­s”Õ¼>£ýaýÊ?íÓÿ¤”‡Ô¬¹Gýºô’^ÔÀ@Ððw±ó| {ØÅZ/eõªŽ«ÒêÊt ‡èò;Zß§ý—ÿ:Ïø;’循ô^·ÒríûH«ì—°o °¸‡·ù·µ»ù®sýÜ]J»ˆÈÀq%±·™ç±â‡11†Qž#êâýðSM4V*¡ª¶Ì1€5¢NçC[ü¤zgN£*ÌÊ1i«*éõoemmO©k[½ÿÚVROk!~%ž¨²Šßö€~æ4ú€ ­m²?Iµ¿¾£™ŸX«;¬ªÚw5—1¶4Þ °;ܬ$’œ¬=½S£eôüOKì¶ÖÏX³H©Í{ölsšÆ7e¸¯·§töæ;=¸´·1ãk²Em‘µ×mõ?é+ $§/­ôܼ¼;éé‡'8 r²­¬½Þ‰kë.kku^­ÕzŸ õ¬ô‘«èÝ8t¼~•‘C2ñqk®¦3!°SEU½Í{voÚ?u^I%0¦šh©´Ñ[jª±µ•°µ ~kXßkTÒI%)$’IOÿÓõT’I%)$’IJI$’R’I$”¤’I%)$’IJI$’R’I$”¤’I%)$’IOÿÔõT—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ÿÙÿíúPhotoshop 3.08BIM%8BIM:å printOutputPstSboolInteenumInteClrmprintSixteenBitbool printerNameTEXTprintProofSetupObjc Proof Setup proofSetupBltnenum builtinProof proofCMYK8BIM;-printOutputOptionsCptnboolClbrboolRgsMboolCrnCboolCntCboolLblsboolNgtvboolEmlDboolIntrboolBckgObjcRGBCRd doub@oàGrn doub@oàBl doub@oàBrdTUntF#RltBld UntF#RltRsltUntF#Pxl@R vectorDataboolPgPsenumPgPsPgPCLeftUntF#RltTop UntF#RltScl UntF#Prc@YcropWhenPrintingboolcropRectBottomlong cropRectLeftlong cropRectRightlong cropRectToplong8BIMíHH8BIM&?€8BIM 8BIM8BIMó 8BIM' 8BIMõH/fflff/ff¡™š2Z5-8BIMøpÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè8BIM8BIM8BIM08BIM-8BIM@@8BIM8BIMIv° Artboard 1°vnullboundsObjcRct1Top longLeftlongBtomlongvRghtlong°slicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongvRghtlong°urlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?ð8BIM8BIM8BIM Ñ Tà€ µÿØÿí Adobe_CMÿîAdobed€ÿÛ„            ÿÀT "ÿÝ ÿÄ?   3!1AQa"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ ?õT’I%)$’IJI$’R’I$”¤’I%)$’IJI$’R’I$”¤’I%)$’IOÿÐõT’I%,H“ÀÔ®t}|èd‘Qú?üÉt66ï^?OóLþ¨üŠc,¡ÃÃZÞî·Â9 <ÐÌrñ~¬Ã‡„ðüüwÿAïÿçßDýÜûoÿ2Vp¾¸t ËE##еÚ^Ó\ÿmߢÿ¦¸~“ÓÆvAõ$cSâ4&›¡Žü×[ÿÔ‡›Õ:¿"œ`ÌlLw:¿BºëÚ¥ú_Qu»ãóÕxóy ¸}&…›ôîÜÏð®LHã€ÉÆ“Æ8a/èK‹û¯«$¹¨Ýzì¯S¥eA},õ1ž~ŒÇÕð.u~Ÿüÿà—\®Â\QÃæ0KYc—MïDí%$’IÌ*I$’R’I$”¤’I%)$’IJI$’SÿÑõT’I%1³ù·| ñúZãUmh.sƒCZ9$ÀkGõ—°?è;àWœô (-ËxÒ–†ÕÿGÓÿ¬³þš£ÏÌ@DžÒÿ¹w> ˜bÅÌÈôöèw?¬ éââ·˜À‚æK­püëüã¿ªßæ«þCGW8•Øm?Ï[$ÒØ‡’=?RßÜþ¿øE{ªõáÓ XïmL=Ïï;ù \ÝlÈËÉk7dä<5²@Ü÷{ZÝÎÚÆª¾9NG$‰×þsw—„‰–Y»â=ïæÿÛú‹KßõŽoQcž|‰®¶ÿÒ+ÑÖ7Õ¯«ì踎p³.øvE¾ß¡US£¯s¿ã>Ÿü6VȎçWâ\Ä3óPÖ—ïpþ“ƒõǦç´ßU,î·Ù~uµ†QQ¯w«U¶¹ÿηgøÚÏøOWôiêú݆çÔoÂÍÃĽÁ”gdS²‡8WNè{ïÆõÜïÑ;2ŒuÏáPüŸñ\ÆÓIÊÙaºÊÙ]9Ç'*¶·ü#ßEVþü*ÕúÏÖú/Qú±“…‘N}ÝR—càcÔö½ö[`ôêÙ^íß µÍ¶ÝßÑý?Ò)Nw]Ì̬}u5äZϳãb»mŽ™4½ÎuïÐïwÓôþšë¨êx÷õ,¾šÀñ~)²×6‘«éznßöûý«‰ëºWõå®vç7 8ùúÿª[´åâôÿ®}M¹×3íØ˜Å6¸4X)9lÈôÜïnú½J÷×ôÿ=%73~´tì'u&ÜÛɃ’CD“üפç=»¶†ß³b úãÓÚöYn6]=:×µ•uWÕŽ/-e/õ7úÕãÜ÷µµe]^-Ÿé½5Éõ¼Ìn£õÖü7‹é²¾žÚÞߣ`É¥ßá*±ûê®Ö{,ÿº?¬½w£e}WͦŒŠî¿;Ì\\FovE­ô)Æû'óìÈ®ëëTêýLoð¿Í¤§wª:¶tÌ·Úû+­´X_em­hc·>‡~mÍÿüµ•GÖ,\™ŒÌΧ“•‰]ÔPÐÛ2úÞu–¾š*ݹ¾¥·\Ï[#ùŸQ?"ŸØ}Gä×~v †[àç´º—m}¬úlõ¶ïfõƒ„Þœê:#[Ô-èÝaÝ#cå_¥}A­/ÆÛ–Ë(ɳÿ¦ô[éäTÌSù¿Q%=WKê¸ÝN—ÙKlªÊ_éäcÜÒËj°¿Óº¿ê=k™¾«üÛÕÕƒõ_©dfÙÔi½ôeœ;™Wí,Vì« š«{¥¾¥ÿ§ÆÝé_¶íŸõ y%)$’IOÿÒõT’I%1°Ã|Šâ›éâa1Žpki®^ï–ë_þrì²ku¸öÔžÇ5¤ñ$Bãú§Õ¿¬u¶š+©¬&lÝdEžÖ?Ûùë?ŸÃ<¹1F1<"̤‡JHNq€2‰õ—‹þùå2òŸ™ëÝ :VÓù¬E¿÷ç¡€{Ò5F­s”Õ¼>£ýaýÊ?íÓÿ¤”‡Ô¬¹Gýºô’^ÔÀ@Ððw±ó| {ØÅZ/eõªŽ«ÒêÊt ‡èò;Zß§ý—ÿ:Ïø;’循ô^·ÒríûH«ì—°o °¸‡·ù·µ»ù®sýÜ]J»ˆÈÀq%±·™ç±â‡11†Qž#êâýðSM4V*¡ª¶Ì1€5¢NçC[ü¤zgN£*ÌÊ1i«*éõoemmO©k[½ÿÚVROk!~%ž¨²Šßö€~æ4ú€ ­m²?Iµ¿¾£™ŸX«;¬ªÚw5—1¶4Þ °;ܬ$’œ¬=½S£eôüOKì¶ÖÏX³H©Í{ölsšÆ7e¸¯·§töæ;=¸´·1ãk²Em‘µ×mõ?é+ $§/­ôܼ¼;éé‡'8 r²­¬½Þ‰kë.kku^­ÕzŸ õ¬ô‘«èÝ8t¼~•‘C2ñqk®¦3!°SEU½Í{voÚ?u^I%0¦šh©´Ñ[jª±µ•°µ ~kXßkTÒI%)$’IOÿÓõT’I%)$’IJI$’R’I$”¤’I%)$’IJI$’R’I$”¤’I%)$’IOÿÔõT—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ê¤—Ê©$§ÿÙ8BIM!]Adobe PhotoshopAdobe Photoshop CC 20178BIMÿá4http://ns.adobe.com/xap/1.0/ ÿîAdobed@ÿÛ„      ÿÀv°ÿÝ–ÿÄ¢  s!1AQa"q2‘¡±B#ÁRÑá3bð$r‚ñ%C4S’¢²csÂ5D'“£³6TdtÃÒâ&ƒ „”EF¤´VÓU(òãóÄÔäôeu…•¥µÅÕåõfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø)9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúm!1AQa"q‘2¡±ðÁÑá#BRbrñ3$4C‚’S%¢c²ÂsÒ5âDƒT“ &6E'dtU7ò£³Ã()Óã󄔤´ÄÔäôeu…•¥µÅÕåõFVfv†–¦¶ÆÖæöGWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúÿÚ ?ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÐûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÒûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÕûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÖûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wÿ×ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÐûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÒûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÕûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÖûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wÿ×ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÐûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÒûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WãïüæW¼ÉªþoëÞO¹Õ'ÿ ù^+ôÝ!¬î,ຒWA@Î^R9Àgí¦sÔË>˜Õxô¿[ÿÀ±t¸;®06c3)W«Ó9@z !ԗȹ¡}eØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»Lmu}ZÇÓZݘ„“‚y#àI©+Å…7=²qÉ(ò$8ùt˜rß#+ç`½šé?œšºOÑ_˜ÞcµŽ:q·ý%rðíJ~éÝôî3#¿Q§$‡Äºm_²]ªþ÷I„“ׂ ÿ¦µìÞ\ÿœÌüïЊ-þ«§yª ôuK(ÔñïûËO«¹>ìNlpûC«‡2%爵;´à=ìþ«û¸O ï„ÏÝ>1ò§ÒþMÿœñò­óÅmç(^ù}ÚŠú–›*ßA_æhœE"eæsq§öŸ¶Ë1¿êý/œvÇü5˜–‹fcî$zOºBâ~œfK¤v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®ÅQ–…þ•yo¨iw×mý«‰-o­exfÇFI†R3üAœ=¤ìÉšœ÷–+}¦ê:dßWÔ¬.tùÅkÌOí×ápX$'kƒS‹}áFç[Ñï"{kËs-¼‚’CÖÄOQøò-˜ôyñÈJˆê åú÷åWåW™Ã”ӡѮܷ:k}M‡Ê"="Oº›\©r˜>ÿÚôúj»gCÎg${§ëÿeõ²|ùæïÈ4h¯ü·r<ÉgÆ#‰}Èé½Du!éÛƒr'ösmT%ÏgÐ{'Ûí¯÷z‘áHí¾ð?Ÿ_Ò}}ÿ8Ëÿ9?6«5¯å—æëÃæÜZù{Ì—„«]8}ǯ¿Ÿ“ÿÁ'þ‘Áv—eÆñTñÇøGóñ×ðu”GÓÌz~ŸgTø3±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ÿÿ×ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«±Wb®Å]Š»L4­+PÖõ='J´{ÝFþA­¬b¬ÌÜ“°°JB"Ï ãêµX´¸¥—,„adŸÇÈs'`ýü«ü Ò/í#¿¼ê^j?Òµ*U 7ŠÜ‚›ûMì>¦Ï©9väŸý©ö¿7lLã…Ã;G¬¿¥?Ð93»Ôïõ;{£þòfHG_™ðªÕka€o¹îy\ie;rïyŸš¼éa¢iój¾bÕ"ÒôÈ>"@f5!­#l'4ð:®ÑÉáã“Ðrøþ²îôº— #rü|Ÿ ù³þr_Qæµòn•¾êš­øõgaO´©à„æ/_ŽƒØÌqZ™qèì>|ÏØôÚ~ňß!¿!úÿ±â§æ?Ÿ5©MCÍš›‰>Ü0ÎÖðŸùåü3§ÁÙ<ÑŠ#ágæl»lZ,0åò¿½ˆK4Ó·9æyž”ç#4ëÔ×3„DFœ¸ÄHÛ-WUÓ™[OÔîìY>Ë[Ìñ½vàG}ò¬˜qäú¢¼È㌹€Y®™ù©ùƒ¥í™îîTš²^•»¯µgÃè#5ÙûG—ž0=ÞŸºš%Ùø'Î{¶ûž¿å¯ùÉM^É’=wL~+=ŠÐÞ ™•‰öuÍVOg=ôùò–ãñð.¿Qìþ,œ¾ßÖ£u©~YþqÛ–71Øù…#ýΫn¾ÔdOZ£HŠh;åeë˜Þ.}!¬ñ¡Þ7ìGgêuý‰/Ýúñuåþiþø ¾ÖÿœxüÖ×.½ÊÿÌk…›Í:}¹+y”?(µ»@4å<+N`üL¿Ü3Kö¶FªÍÈ ó‡ëkå>ßû/§…öŸg Á#ûÌu¾Ÿ.™úzéõžtÏ•»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÐûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«±Wb®Å]НŠ)'’8a¦šf H 33P7$žƒiŒ¤" ¤heúù3ùWô¿Òš¬i'šµX‡Ö›cõH·C¾õÝÈêvè*tº­OˆhrÏÞÙ{S.ÖÍáb5‚oéŸç÷£ ß™¡Ö5]QlSÓŽs øGòæ?Ã4ºíhÀ(}Gìy=6˜å6y<¿Ì~`±òþ“©ù‡Y’ÎÂ#5Ì]@TPH«3ª+ÔŒÑi´ùu™†8ï)Á÷}ƒœ„ 9¿6¼÷ç½gÏÚÔº¦§+GjŒÃKÒÕ‰ŠÖ#O…zU&¥Iö ÅÙ}—‹³ñ@oÔõ‘ürÏK¥ŽpÇŸSÞÂÀÍ‹˜ð03pÌà`fà02x€¯ ²ÛËðJðM ŠhØ«+PU…## $(îðƒ±{ï‘?:õ.{ O2M,ÑY\Ås¦ëÐíugqýÜà€jËüÀTІFj' –žc.”ðo‡§Ã¸ýŽ«YÙ0È%¨Ê'é”O8Ÿ#ÝÓb H·íOåWæù•åzÎâ®”uD€ü` óAV¢H>%ÜÓu©*sÑ{#´ã¯ÃÆ6ÚQë~Þaù—Ú^ßdk%ˆƒÂw‰?Íî>c‘å|èXzNm}Ø«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å_ÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«±Wb®Å]о¹ÿœzü°cóþ»l ‚G–m$Á£]•>#¯»)Íf»Qüøþ§É?àƒí=^ƒ¿á„¸ý2øGùÁõ~¡|–0 FÚüOô¢Õê†_^”àÂrʺ0e’iYX¼ŽjÌs–œÌäe-Éw‘ˆˆ¡Éòüäßš$õ4/'ÛÈV>TÔ”tbKE“íG${©ðÎÿØ­©êßé|¿GÚô=‹ƒêÈ}Ãô¾L;סp€¼dIfà2,À^`.0˜ €ÀÈã"[}Eÿ8³ùÝ}ùOù…¥ÙêZƒ'‘¼Ë:XyŽÚFýÕ¿ªxÅx+²ú.C1þNc©ÌÎÍÎ4úŽ>B[KÝПwÝ}ïídzQí¸#y±ƒ(wšçó†Ãú\'£÷7;‡åÇb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»ÿÒûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«±Wb®Å^ùSù7æ™á³•]4M;Æ»rµŠ¿ JãJEûMû9ªÏáGÌòyŸj»~=‘¤3ÞKh?ç{£ÏßC«ôyÛO´Ž(cK[;8–8aB¤q âªª6@sù2ƒ)ç)æ™$“)$ó$ó%ƒ_^=íÃLÛ/HÓùW¶ršAÏ>#ðwXq q ƒÌv×çoç¥Ì—?šd Ä¥°´‚?²«k ²$ç¯{1ŒC³ñ×[?i{ÊiãñûËÉ@Íû²pÈ’ÌÀdY€­éH#ILl"vdIH6|ã±ýcò÷ü»vgjÏ€V<¾¸÷ ú‡vÒ³C”L_MæÉኻv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ÿÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«±Wbªö¶··6ÖV½ÅÝÜ© ­¼b¯$’0TUÉ$€–¼¹cŠs5‚I<€’ý+ü³ò=·|¯i¤¨I5)éq­]®þ¥ËP ý” û Ò¤ç=©ÎrÎút~mö—·'ÚúÉfÜ@mÝúO3òäk®_ú¯õHîâ5”Žíáôg7ÚZ®#áŽCŸ¿ö8z<#Œó,5Ns±Wç—çµ›ÚþgùÙiêZ\B|TÛF„ÿÁ+g®û/”O³ñùXûOè{.É—ž>W÷¼ˆfü»0‘l5Ñô«fþ añÊ~9;"´çØ ÆÕj#§Æg.Ÿo“d#Äi­/<¼<¿eYáPúY=MÂÔŠ·–¥wÚ­^ÙÈi»FpÔxÓ;«Ýû9üócáþ»¯ëø>zâA б;[`à03xÈ’ÌÀdY€¼ Y€¸ À}Åÿ8ç—òÿæµÿ“§•…‡Ÿ4ÙGÙúöœ­s ±=¢'_rFn;?n’hßõ¾eÿnÊžË=X$ù“¨‘þ›€ûƒö:ççb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š¿ÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«±Wb¯«?çÿ/þ³q'ŸuH+¡{/FàÑ¥û2ÜÄ ª/]ùt*3YÚèp‹åðEöƒ‚#Aˆï*3÷ ~?Qò®…õ¦§z,íÉSûé>‡ë?FsºÝOƒ ¹žO“iðø’ò ’I$Ôž§9—rìUØ«äùɯ-¿©åÿ6C)Á´»÷‚ÒÀ~šÈ+òÎÿØ­h¬šsýa÷Kô=`æú±Ÿxûè|œwoJ¢©bA,MIÀM3ïÞRÐSËúw«p£ô•è sâ‹Õc.þÿ!œ_iëN«%Gé/?7?*Mn/7%b¥MTŽ ŒÅ†7cª/7üÄÒßP´ó¤al|ɸeQEK´ÇÔ™ã8¥õCoó‡õ|"qÊX8Ÿ³ø~Çž›rÞà2-€/ ˜ €ÀÌeù}ægò_ž|¡æÔRã˚Ş¡,JhdŽ •䎣³ *~yf ¾Hϸ‚áv®€k´y´ço»ˆÀîþƒÊC+ « Á¸ÏC~."›Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»ÿÕûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«±VSäÏ*ßyÓÌšo—ìj­y%n®iQ ¼²žŸez îh;åY²ŒP2.¯¶{Wfig¨Ÿð‡ó¤y‰ù =¦š^a¡ivZVŸ¶ÓôÈ xÿ•#©=ÉêIêwÎk&K&R~gÕj2jóK.Cs™³ï?˜µýÙ¼¸y7ôÇÃø(þ¹Ëj³œÓ'§Geƒ‡ê‚Ìvçb®ÅX·œü·iæï-ê¾^¼!þ!œŠ˜¦SÊ)Ûì°ŽãnùÙÚÉhóÇ,„üÇQòrt™Î‚c£óGTÒïtmF÷JÔa6÷Ú|ÍÌG³)¦Ç¸=Aî3Ù°g†h 7 }Šc$D£È³¿"hY¹z•‚Ý©a· êÿ%íïòÍ7lkxGƒgŸ»»ã÷{Üý>#oGºº&»æƒ7o‹Cqq×|Ì„ìxÓË¡*Çwc3Û΂D„«t h{b¯Oü™ÿœ–ü¢üý¹×ìÿ,uëf,Åo6°·76b4ºi" Äh¦6éÓ{Ö*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb¬Bûó È:f²¾\Ô¼ñ iþ`vUM çSµŠð³ý-ÞA!'·Ã¾*ËñWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»ÿÖûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«±WÝß>C[òáó¡c̨²DPÙu‰Gpdûg~œvªæ‹_¨ãŸä>÷½¾íßÎê¿-Œþï¯ëO©ÿ7éçt/`Öï8 ´ŒüRo/²öNs}¥¨¡á޼Þ?GŠÏèÆ3Jì]Š»hš Rƒ•úå± ±‹çÿÍŸË|Ù5¶¿§Ò NÖ‰ª"ŠæÙ{­ò Øx»WavÜ´q8¥¼OÓå/ÔÞ‹±õƒ†9š‰<û¿cÌ¢¶†;hE (Ç@`3aFr2–例‹ ’{‹Ž»æL çãÆ”K/]ó&1rá_ùsvÑùESÆêÚXÈÿVŽ?â9‡Úp¼7ÜC¦ö“é/ù²ô~–ù“£.æÝAc^ú/­Ç´Äóÿ’©í›®ÈÔxÚhß8íòý”è´Y’͓ûv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»&¿ó‘¿úпŸù±<ÑÿukœUú3ÿ>”ÿ”‡ó»þÙÚüž½Å_¶8«±Wòkÿ9ÿ­ ùñÿ›Í÷V¹Å_£?óéOùH;¿í¡ÿÉëÜUûcŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUñßüç_æÏ˜ÿ'ÿç¼Á­ùJæM;Ì^b¾µòî¬BÜe²¢GšxØCˆbuFªÌtÅ_ÌÍÅÄ÷sÏuu<—7724·72±y$‘Éfwf$’I©'®*ýéÿŸ`~où·Ïß—þ{ò'šu+j?Ë+3ü=©]Èe™,uDº h]ªÌµ›©Ù[ˆøU@UúƒŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUÿ×ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUØ«Ôÿ(|Š|ñæËxn¢/¡é~¼ÛM$1<ÄxÉ€«)ð çKޤ,nAÂc’"Q6P•É%rð¨Å~ZÛK?™ƒéY[Èò·oŒpækøfjHG w—Aí6Q ' ç">ÍÚüíHþ»å÷õš€ç¿ÉÇñ'-ötž ÷Xý/1ÙWÃ/{ÃÀÎÛ€¸ À^`. fð2,À~ãÿÎÿë9þ]ÿÛßþê÷¹Üö?ø¤>?y~Qÿ‚_üäŸù'ÿLàú_6o ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUüšÿÎFÿëBþ|æÄóGýÕ®qWèÏüúSþRÎïûghòz÷~Øâ®Å_ɯüäoþ´/çÇþlO4ÝZç~ŒÿÏ¥?å!üîÿ¶v‡ÿ'¯qWíŽ*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WþzþNè?Ÿ–>cüµóïa²‘˧jñ y,¯mÜIopŠHåÅ…j9!e¨­qWá>«ÿ>×ÿœ¡±óÒ,4ZÒÌ…cóU¾¯mŸ Š;EpÑÝ ŽàB~ª«ö+þqþq–Çþq›òúëCŸS]ó™î#¿ó޵e·2Ä…!¶¶ ªÆC7p™™ˆPB*¯«1Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š¿ÿÐûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâ—üå¿þ´'æýº¿î“gžuÛ¿ã³ø¹ÙŸð(ÿœgKÿ%?é¬ß8f¡ôGb®Å]Š»v*ìUr£»*"—w *RIèÆÐHËôoòŸÈéäo)ÚÙÏ®³¨Òï[PŸU‡Ã!]¢_‡cJò#®sZÍG‹’úOΞÕöáí]l§û¸úaîþwùÇ~ú¡Ñ’ë7~¤‚ÙÁò{·ög7Úø¥À9½Õé1Pâ=RLÖ¹ŽÅ]Š©»Pa _.ˆoŒRé_®]äF)t¯×/ˆr#ºWË¢˜ÅŠkz‘®/FÍ%‘E#¸_‚Uù:ÐÓØí™Ú}FL?IýN×CÚô‡÷r¡ÝÌ|¿çÒþUiÍ/(µK˜á®ñ²#5?ÖGá›1Úóx‹z{Y”GxDŸyû¿k5Ò´}#ÊÚ|ÂÚ–ð 2ÞÞLÓ³¶Â€}03fÉ©˜½Ï@³]›]îzÈ{Ÿ,yãÌŸâ~âú*‹([éêE¤„žDx±%½«NÙÛvv“òØDO3¹÷»Í&ŸÁÆ#ׯ½‰™Î` €ÀÈã"K0‘fð03û™ÿ8[ÿÎ;þ\Æâ…¢Ô¥v—S»tölî»V–¼¿'Á&B^Ðjkúf8Ò³xgb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb¯ä×þr7ÿZóãÿ6'š?î­sŠ¿FçÒŸòþwÛ;Cÿ“׸«öÇv*þMç#õ¡>?óby£þê×8«ôgþ})ÿ)çwý³´?ù={Š¿lqWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å_ÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WâŸüå¸ÿ¬„üÀÿ·WýÒlóλ{üv÷!û/þóŒéä§ý5›ç Ô>ˆê`WSÛou*êUÔÅ~ü‚ò7øƒÌmæKøyi>[ex9Æ[ã¼J (}1ñö<;×vŽ£Ã‡æ~çöû·?'¥ü¶3û̼ü¡×ý7Ò<¸»ŸmÞÝ [w’¿øc,s™Ôæð O^ŠaÇÇ*ad–%‰©&¤žç9Òown5]Š´MqHAJýr؆èÅ.•òè‡"1K¥|¾!ÈŒRé_®]äF)t¯×/ˆr#5Ë×wvÖ6Ó^^N–ÖÖê^iä4UÄäá NB1K(@ÌÐKæ>þ`ÏæiNÓKÛhq6àì÷,§gqÙGU_¤ïJv]™ÙcL8ç¼ÏÙîýoE¢Ñ "Îòûžfnˆ ÀÀÌÃfà2,À^`/0Пäö‹þü¨ü¸ÑM¿Õf±òÞš·Ô\5²<äò$ÔÈÌiž‡¢‡Gú#îÝø¿ÚWæ»WU–ì³£ý"#þÆž™N‰Ø«±Wb®Å]Š»v*ìUæÞcüæüŸòv­>ƒæïÍo'y[]µT{W×tû¸ÖUx.'GPÊAñTg”ÿ5?,<ù{s§yóÊþsÔ,áúÍ݆…¬Yj3E ž«Çm4Œ«É€äE*@ÅYî*ñŸ?ÎD~GþWܽžÿ44 SŒÒ]®…Åò{½¥¸–eå)м–Ïþsãþq&úåm`üß·IXÐ5Æ“¬ÛÇÔ åšÅuþlUõ7—|Å¡ù·DÓ|ÉåVß[ÐuˆEÆ—«Z8’âmƒ££lU:Å]Š¡îîíl-¦¼¾¹ŠÎÒÝKÜ]Nëq¨êÌì@ÜœUóߘ¿ç.¿çü­;[jß>YyѸIuúL«w õ¸¡¡¯Nø«‡þ~ÿ8‹<© ~n¢¼†ŠdÑ5Ø×éwÓÕGÒqWªùGþrgþqÿÏrÅmåÍÿ+ßÞÜ0[}6kø¬î¤f€–÷F)XïÙqW¸‚ Š‚:Š·Š»v*ìUüšÿÎFÿëBþ|æÄóGýÕ®qWèÏüúSþRÎïûghòz÷~Øâ®Å_ɯüäoþ´/çÇþlO4ÝZç~ŒÿÏ¥?å!üîÿ¶v‡ÿ'¯qWíŽ*—꺶• é·Úι©ÚhÚ>— ÜêZµôÉomo c“É4Ò•DU–bÅ^SÿCÿ8õÿ—ãòïÿ 'þÊqW¦ù{Ì~^óniæ*kÚw™´ CÔú†¹¤ÝC{g?¥#E'¥< ñ¿ ‘¨v`AÜb©Î*ìUØ«±Wb¯)Õ=ÿ#´JûF×?9|£k\Ïm©i7ÞbÓ-îmæŒñx¦†[…te;`ÅSß)þh~ZyúâîÏÈ¿˜~Yó¥ÞŸÍk êözŒFÇŠ¼‰k,…"•ÅYÎ*…½½²Ó,®õFî?OÓá’æþþæEŠ!‰KÉ,²9 ŠŠ f&€nqW‘ÿÐÆÿÎ=åøü»ÿ£Iÿ²œUê¿¡y£I³×¼³­Xy‹BÔUŸOִ˘®í'UbŒbžtpH4=Aªmбï2ù·Ê¾LÓ›Wó™t¯+iHhÚ–¯y ”øz“º-~œUóv³ÿ9Ïÿ8£¡LÐ^þqéÓº?Ú}–¥¨¥Ez=•¬ÊFÝA¦*­¡ÿÎpÎ*y†e‚Ãó—J·w$Ôí¯ô´Úƒw¿¶G^çõUô–æ_.y¯NWò¶¿¦ù“I˜ÒSJº†òÝÏù2À·è8ªuŠ»v*ìUØ«±Wb®ÅPZ–¥§hÚuþ¯«ßÛiZN•m-橪^J[Û[À†IfšY ¢""–fb§y7ý oüã×þ_Ë¿ü*4Ÿû)Å^“åÏ4ykÎ:L÷”|Ŧy§BºgKmkH»†úÒF‰ŠH{wtb¬ ŽØª{Š»v*†¼¼´Óíg½¿º†ÆÊÙ —7w±E¬îäÄœUó瘿ç.ç<­;Ûjß>Xyân2ǧ]þ“*Õ¡VúŠÏBPzwÅX}¿üçŸüâ]ÌÓA窼 ÅÚ]/W‰ © ÉdªÃnªHÅ^Óä¿ÏÉßÌYc¶ò?æw–¼Í}/ØÒìµ+w¼ù›Râaô¦*õîCöWü çÒÿÉOúk7ÎTöÍ;莦*êPêb­Óu1[EXØÝjW¶šu”Fâòúd‚ÖêòHÁUE|IÁ)‹<ƒV|ðÁŽY&j1“ÜåúWä¯+Yù3ËZniÅšÖ>W·PÍpûË!ï¹ØW¢ÐvÎ[Q˜å™‘~lí®ÔÉÚz¹ê'Ôì;¢9—>ógªÍNëëTÖ(~÷=ÎsšÌþ$èrÓcàŽüÊ]˜nC±Wb¨i_'Ù—ÊùtC‘¥Ò¾_äF)l¯—D9Š_+õËâˆÅ/v©Ë@rIu½wMòõ„š†§p!…6ï#öD^äÿ·¶dé´ÓÔO‚ÏÝïnÆYeQ|­ç;ê~m¹ã!6ºT,M¦œ§ogþÓ~®ÝëÚè;;’;o#Ìþ¯'£Ói#„m¹ïa`fÁÌx€¼ À\E˜ €ÀÌà`f5ü¹ò³ù×ϾNò’óãæbÎÊáÑy†YTM%<>L}†[§ÅâåŒ;È»¶µã³ô9µ'üœ%!æ@4>&ƒú&ÏH~$v*ìUØ«±Wb®Å]Š»v*þm?çã?úÕþyÿ¶v‰ÿtÛ|Uì¿óêBó“ó’KbIèé LUÿ9ÿ9÷æ?7k:×åŸä–·&ƒäk{-gΖR÷Xu»ò/ì-仿òn¹ek¬·3é×1Æ¿6hÀ«VdetbŽ„`hA8«îÈ/ùÏoΟɫ« /^Õ§üÊòN©såÝjf–ԯߔ±>Ê9xÇ@ƒ®*ýüüŸüâò/ç—’¬<õä Sëú]Ñ1^ÙJ]ØÝ(Kk¸oNE¨=H`C)e •^£Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ÿÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WâÇüå¨ÿ¬‚óÿýº¿î“gžqÛßã¹>îCöOü çÒÿÉOúk7ÎTÍ;èn¦*êb®¦+n¦+mÓ[}Aÿ8ïäŸ^îëÎ×ðþêȵ¦†}©˜RiGúªxÒ¥»®j{OQCÃy¾aÿ>Ûà„tXÎòõOÝü1øÏ¸w¾©Ô®¾¯ i$¿ {ç9­fs/•éññËÈ1LÑ;7b®ÅTݨ0€Ê!/•òè‡"1K¥~¹|C‘¥Ò¿\º!ÈŒRé_/ˆr#ºGË¢ˆ†æ¿7éžS²3Ý·­y(?RÓRSâzñPz±üNÙ°Ðè2j¥QØg»öù9šm,³¶ï”<Áæ-SÌ×í©ÏÌî-í×háCû(½½ÏSß;}.“š0óÔ½1Å„” Èr\@/0 ‰,À^`.0˜¹?ç|Œúçæn«çYýGȺs,ý{SW·ŒPîG '­:>9½ì yŒúD}§oºß'ÿ‚ÿk 7fCH>¬òßú˜êGý—Âß®¹Ø¿4»v*ìUØ«±Wb®Å]Š»6ŸóñŸýjÿ<ÿÛ;Dÿºm¾*ðOÊŸÍ‹ÿÊß-þoÁ¢ÜIi®þaye<¯cy *ðAs{×’:r·…ãApGLUíó‰¿ó†¾lÿœ“¿—\¾»“Ê–EȃVó7§ÊâîU£=®žŒ8³€G'o…*6cð_·¿—ÿó†_ó—VVöÚoå^¯Þ@É­y–Önä‘H"ZÝ«ÇTº‘ì*ô Wþqëò[·6Ú§äÇ’.ãâʬt=d@Ô¯§"  ÝHÅ^åO*yÈþ]Ò¼§å]2=˺?WÒt¸™Ù ‹‘n dfjÆ•8«óÏþ~ ÿ9guùC ÅùQù}¨‹Ì_7Zu­Z š>—%R¨bâçp‡ª /³Û?¤’I$’MI=ñWê×üâßüûƒQóÖ›¦yûóÎâ÷Ë>[¿D¹Ñü‹h}Nîø’KÉOÕ£qJ ©s¥U~¼yòò_òÒÚ o#þXù{AkuຂYG5ó S÷—³‰.$ëÕä8«Öe†)â’âI¡•JËŠYOPAØŒUóßæWüâ‡üã÷æµ­Ä^iü²ÑàÔ'SÇÌ:D ¦j(äP?Ömm!^ KÍ|Tâ¯Ä¿ùËùÁ6ÿÎ=Ã/œ¼±}?¿+^aº«DÿJ25#KôŒpdj… U-³$d¨e_y{Ì:ß”õÝ'ÌÞ[Ôçѵí ê+Ý'T¶n2Á<,OMˆèv=Ø«úkÿœCÿœ’Óÿç$?,¡Ö.}/>ydŧùóGŠVä©1ÞB•$Cr™Aû,*xr*¾¬Å]Š¿“_ùÈßýh_ÏüØžhÿºµÎ*ýÿŸJÊCùÝÿlíþO^â¯ÛUØ«ù5ÿœÿÖ…üøÿ͉æû«\â¯ÑŸùô§ü¤?ßöÎÐÿäõî*ý±Å^ÿ9Wÿ¬Ùùãÿ€f­ÿPÏŠ¿”ìUý2Ͼ¿õÿ(ÿíÿÿuýG}™Š»v*ìUØ«ùNÿœ«ÿÖ“üñÿÀÏWÿ¨—Å_sϦÿòaþmà;eÿQg~åâ¯2üëÿÉ5ù·ÿ€f½ÿtéñWò9Š¿Iüùÿ99{äoùÃOÉOÈÏ$j-iæ?8è7÷>yÔ jIk£Í©^Æ–ˆÃì½ÝŸq¥)(!WÊßóŸóŽ?˜_ó‘¾k“ËÞL¶KM3M /™|×xXéð¹¢óey‡„kñ5 ÙC0Uû¿ù;ÿ8ÿ8ùùQei-÷•¡üÈóDAZëÌ~g‰.ÐÊæ ­´JuøYÇy•Å_biÚV—£Û‹M#MµÒíÔZÚBFú‘…«Í<óù ù3ù•k5¯ÿ,ü¿¯zâ{%”pÞ.Ô¬wî#4ª8Å_ÿó”¿óî ï"éz—Ÿ¿"îo¼Íåý=çYò%Ý'Ô­!Z³Ëe*7(ƒ¬l¾ fÖŠ¿(qWîgüû—þrº÷ÎVƒòóT{Ï1è–¦oËÝjêNRÞØ@µ–ÂFmÚKu£5$ÅÈméŽJ¿Y1Wb®Å]Š»v*ñŸùÈßýg¯Ïü×~hÿºMÎ*þMqWô—ÿ>æÿÖPò?ý´u¿û©OоåÅ_%ÿÎi~{Ü~AþHëî‰8‡Î~g™t&I@Æ«”v’ï<(=N¶lUüÄÜÜÜ^\Oyy<—WwR<×WS9y$‘Égwv$³1$’MIÅ_²¿ó‰óî­ Sòþù•ùûmq{.±wºå²»ÛG»€ñK©¼edgpCT¨Q´…‰(Š¿\ü³å)ù/NM#ÉþYÒ¼­¥ tí&Î8~‡„€úÓdX«ç¿ÍïùÅ¿ÉÎË+Èüåä{õ«”a›ô¸’ËV‰ÏGúÔJ ¼NáfŸäâ¯çÇþr‹þq‡ÍŸós‡HÔ®»å xI7“üÚ‘úkudzL•añr–¤C.ÆTÃþpóþrPÿœ}üÜÒ5K›×O!ù¢Xt¯Ì <’c6ŽôKÀ»þòÑ›Ô •æƒíœUý@++ªº0tpYMA¡]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»ÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wâßüåš×þrÏçþÙ_÷J³Ï7íóþ“áþä?dÀ¨ÿ͵¥ÿ’ŸôÖo8fšßB·qÆÖÛá¢Ûã­»† [N|½ Þù“ZÓ´==9]ê3‘ÙEêò57⊠aÉc‰‘èáv†¿‹O<ù>˜ ÷÷æNÁúG¡é^]ÑôýOONËLaŠ´ñµ˜Õ˜÷$ç-—!œŒ¥ÕùÃ]«É¬Ï<Ù ÊfÏêCòI¯nMÌìõøÃö×9ÝFodôèåaÇÁBe ®ÅV“AˆHAJýr؆èÅ.•úåñDb—Êýrè‡"1Ke|º!ÈŒRé_®_äF/7ó¿žì|§nbN7zÌë[[ì ÿ»%#¢ø§ï#oÙÝ™=T¯”3ú²ÒhÎcgh¾SÔµ;ýbömCR¹{«¹Í^F=eQÐØ ³·Ã†b!@=jó&•äß,ù‡ÍºäÿVѼ±¦Ýjº¬ýJ[ÙÄÓJ@îx¡ ïŠ¿’ŸÍÌ-só[óÍ¿˜~c™¥Õ|רË{,lÅÄ1ã²ûD4ÿ%F*ûßþ}¿ÿ8ßeù›çkÿͯ8ië{äÿË‹˜£Ðì'NP_k…D¨Z»2Ú!Y ž®ÑõUûûŠ»v*ìU¨iö½…ÙA©iš”[j}Ìk,3Ã*”’9#pU•”A#1ó˜ßóÿ8óùÁ¨è\R#ù’3¬yáË9[I¬–ŽíZ½´€¦ä±NÛ¾*Šÿœ&üæ¸ü™üýò•õÍë[ùSÎ'—<ß b"6÷Î ‡õyøIÊ•âGÚ8«úyÅ]Š¿“_ùÈßýh_ÏüØžhÿºµÎ*ýÿŸJÊCùÝÿlíþO^â¯ÛUØ«ù5ÿœÿÖ…üøÿ͉æû«\â¯ÑŸùô§ü¤?ßöÎÐÿäõî*ý±Å^ÿ9Wÿ¬Ùùãÿ€f­ÿPÏŠ¿”ìUý2Ͼ¿õÿ(ÿíÿÿuýG}™Š»v*ìUØ«ùNÿœ«ÿÖ“üñÿÀÏWÿ¨—Å_sϦÿòaþmà;eÿQg~åâ¯2üëÿÉ5ù·ÿ€f½ÿtéñWò9г"ù7Ì_™¾uò¿‘|»_kþh¾·Ó4ÄrJ§2›øÇÌz*‚{b¯êŸòOò{ÊŸ‘—zåç”­ÀµÓ#õ5=M” õ éúÅÜäuil+ð¨T ŒU뫱Wb®Å_óñÿùÆ«/ËO7Øþoù7O[/'þa]ɘtøØë…L¥¥â+HgY:£~vù+Íúß<ÛåÏ;ynèÙë¾VÔ-õ-.}øú¶î+€G$jqe×[?—ÞtÒÿ1¼å>h ®—æý&ÓV´‰˜3Ä·Q,†'#nQ’Q½ÁÅY†*ìUØ«±Wb¯ÿœÿÖzüøÿÍwæû¤Üâ¯ä×Ióîoýe#ÿÛG[ÿº”ø«î\Uø›ÿ?hÖ®¤óäÏ—9²ÙZiÚ¾¤cáin&·„´‰VSÖ5}Á¦lû'GùœÂþ˜î@øýÖððDö˜v/fÈc5›5Âãùóÿ4Iô~Ýgvü–ìUØ«±Wb®Å]Š»v*ìUØ«ù´ÿŸŒÿëWùçþÙÚ'ýÓmñV¿çÝ:%¾±ÿ9U䛋•YAÓõ}J(ÜTÆXÓÅL܇¸Å_Òf*ìUØ«à¿ùùž$òüã&·¦[N`¼óö±§ùz6BCúEšúà ~ËEhÑ·j5;â¯çTó‰—ÿ•¿ó?•þYH7÷<:μhµþª>¹8r>ÑŒÊ"ùPØ«èÜUØ«±Wb®Å_œ_óóŸË˜|×ùkçxmÃê¿–Zͽظ¬,57K+˜Ç³JÐ9ÿS= A‚ A±Wõ§ù çwüÈü–ü¯ó¼óýb÷Ì>[°ŸU˜’I¾HV+ÍÎæ“£ŒU똫ù5ÿœÿÖ…üøÿ͉æû«\â¯ÑŸùô§ü¤?ßöÎÐÿäõî*ý±Å]Š¿“_ùÈßýh_ÏüØžhÿºµÎ*ýÿŸJÊCùÝÿlíþO^â¯ÛUàó•úÍŸž?øjßõ ø«ùNÅ_Ó'üûëÿYòþßÿ÷_ÔqWÙ˜«±Wb®Å]Š¿”ïùÊ¿ýi?Ïü õú‰|U÷7üúoÿ&æ×þ¶_õqWî^*ó/οü“_›økß÷NŸ#˜«õkþ}Yùg·ù‰ç¯Í+ûq$~FÓbÒ´'q²ßjÜýYc?ͼ,‡Ú\Uû­Š»v*ìUØ«Áç'¿-¡üØü†üÌòaƒ×¿¹Ñ§¾Ð@Z°Ôtñõ»@½Ç)bHý–?,Uü¤â¯èoþ}çy<Ëÿ8ë/–®f/qùæ+í6ݪÂÒì%üGÄRâUêâ¯Ñ\UØ«±Wb®Å^3ÿ9ÿ¬õùñÿšïÍ÷I¹Å_É®*þ’ÿçÜßúÊGÿ¶Ž·ÿu)ñWܸ«òCþ~½ä+ÝGʕߙp4–¾XÔ/´]i×~ ©¤RÛ;ÊÕÖ¾.£¸Å_‹žUó.­äß3y{ÍÚ â×[ò¾¥k«i 9*\ÙʳDY{ŽH*;±Wõÿ8ñÿ9#ùÿ9å]oË„Vžd¶š¼—4‹õÝ:}•ê^ßÝÊ£‹+Åù(Uô&*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»ÿÖûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WãGüår×ó÷ϧþÙ÷J³Ï2ö„ÿ‡dÿ7ýÈ~Áÿaÿ›oKÿ%?é¬ß§¼¿{]í&NÞ×ÏS+úaæÀrøŸª\÷46빚óÅ]Š»v*ìUØ«±Wb®Å]Š¿›OùøÏþµží¢Ý6ßN¿çÚ_úÔ:WþºÇüšLUýâ®Å]Š¿!?çíZ³CåŸÉMIDÔuMjý¢¡ø”6‘¯M¾´zï¾ÝñWã'–ô¯Ó¾bÐ4NA?Lj6¶<ÉâÖ&XëPŸkÀâ¯ìN8ã†8á†5Š(”$Q ªª(`è1Uø«±Wb®Å]мþrF‹^ÿœrüïÓåÕãä­fò—-5¤—q¼âZ{ö=1WòŠ¿¤ïù÷N®úŸüâ‘m˶‡­XTÖ ~‘žáEI5 œà6튾âÅ_ɯüäoþ´/çÇþlO4ÝZç~ŒÿÏ¥?å!üîÿ¶v‡ÿ'¯qWíŽ*ìUüšÿÎFÿëBþ|æÄóGýÕ®qWèÏüúSþRÎïûghòz÷~Øâ¯ÿœ«ÿÖlüñÿÀ3Vÿ¨gÅ_Êv*þ™?çß_úÈ”öÿÿºþ£Š¾ÌÅ]Š»v*ìUü§ÎUÿëIþxÿàg«ÿÔK⯹¿çÓù0ÿ6¿ð²ÿ¨³Š¿rñW™~uÿäšüÛÿÀ3^ÿºtø«ùÅ_ÐgüúãBMÿœxÖµscóüæmªa·¶´·EÛ²²9ñ8«ô“v*ìUØ«±Wb¯äó#E‡Ë˜ž}òíº*[èbÕ4èG kw,*Ú€Å_¬_óé=ZN_žz–hiåûûuÛŠ·ûŠSãV>ìUû5Š»v*ìUØ«Æç#õž¿>?ó]ù£þé78«ù5Å_Ò_üû›ÿYCÈÿöÑÖÿî¥>*û—aþò'–¿3|›æ!ù¾Àj>]ó5›Ùê6û·Ibb #pŸ {b¯æ{þrOþqWóþqËÌWë6Rk^F¼‡–¼õk5¬ñ±&8®(?qpíFÝMJ]ñWÎú˜5ß+ê¶zï–µ«ï/kz{ú–:¾›q%­Ô-Ò±Í +©ùU÷oåßüü£þr3ÉqCeæ­#ó'Oˆ*®ZúWŠ‹Ùn¬šÍþT«!Å_hù#þ~·ùk©aüÀü·×¼©pä,—zDðjöÀ÷võ>¥*eG#ß®*û'ÈŸó—¿óߘƼ»ùµ¢A}pBÇ¥ë6‘rÎÝi °zþ§*ö®*úA%D’7Y#‘CG"U”Š‚ê*»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«ÿ×ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wã‡üåZWóïχþÙ÷K´Ï/öˆÿ‡äÿ7ýÈ~¾ÿqÿ›sKÿ%?é¬ß=z~Ù¤·¿âoÓÆÑÄß§í‚׉¿OGì_ÉO' @:íÜtÔ¼À«$uÇh7Œ ¿n¼ÎûŽ>¥×çã—ä>÷ǽµíÍê|F-½óëòú}ü]ïSÕn(«n§vø¤ùv ÖæÛ€|^WMøŠGš×1تÖ4„€‚•ò؆èÅ.•úåñDb—Jýrè‡&1K¥|¾!ÈŒX¼ágå--®æã5ôõM:Ê»Èôê{…^¬~ޤf׳´ÕäáÌ÷~×c£ÒœÒ®ƒ›ãmGQ½Õï®uBv¹¼ºnsJÝû@tè±G (¨„@ Àɶ€¼ À^`.0Œ‰fà03x€¸ €TEgeTRÌÄP*I=ò~¼ÿÎ$ÿÎ97åÖ›ætÿOÏZÌt½:uô›9@¨*ERâQ³þÒ)ôö&@{ÇìÏx™¬òò¯û;ßš?à•íÈí\‡C¤•éà}R²È}ðN’—«z‰}¹›çÉ]Š»v*ìUØ«±Wb®Å]Š»v*þm?çã?úÕþyÿ¶v‰ÿtÛ|U:ÿŸiëPé_øëòi1WôcŠ»v*ülÿŸ¸C+Cùp˜b4Ç$ƒH4’£éßv*ü“ü¼t‹ÏþF’GXãÌcI#T]ÆI$ô_ø«±Wb®Å]Š»yOçÅÔv‘ßœ×Ó+4V~EóòªX¬zeà VƒÇ$¸«ú6ÿŸjÃ,_ó‹šÈ…ç_Ö$í œ!#ý’‘ôb¯¾±Wòkÿ9ÿ­ ùñÿ›Í÷V¹Å_£?óéOùH;¿í¡ÿÉëÜUûcŠ»&¿ó‘¿úпŸù±<ÑÿukœUú3ÿ>”ÿ”‡ó»þÙÚüž½Å_¶8«À?ç*ÿõ›?<ð Õ¿êñWòŠ¿¦Où÷×þ²åý¿ÿ⯳1Wb®Å]Š»)ßó•úÒž?øêÿõø«îoùôßþL?ͯül¿ê,â¯Ü¼Uæ_ù&¿6ÿð ׿î>*þG1WôYÿ>Κ)çlR7öÞeÕãGì¹hœþÅÁúqWè&*ìUØ«±Wb®Å_ÉGçåâê?ž¿:‚/¿óç˜î+Ê‚]NáÀ¯zW~”Ï¥νùá F1¥†‚­%Í-ñŸÄÓ势kñWb®Å]Š»xÏüäoþ³×çÇþk¿4Ý&ç&¸«úKÿŸsë(yþÚ:ßýÔ§Å_râ®ÅRýWIÒµÝ:óG×4ËMgIÔ#0ßéwХŴñž©,R†GSàE1Wç§æ¯üû7ò3ÏÜj^G½Ô¿*µYÙ Ó饖sRßR¸pë¿EŠd@6 ÒŠ¾ó×üú÷óû˾´þNÕ<»ù‡hµô-­îŽ›|ôþh¯B[­{¤UñŸž¿!ÿ9¿,ýgó×å—˜¼¹i}MVâÆV±Û¯ȃ۵;ÑÎ*òlUíÿ•_ó‘ß?’×0ÉùçÝKKÓ£pÒyry>·¥Ê+V e?8n…”+Ó£ Uûgÿ8©ÿ9÷å?Ï+Û"yòÊßÈß™·CÓÓÖ7?¢µy7<-Fg†SM¡‘/Øv'ˆUúŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ÿÿÐûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wã×üå2WóãÏgþÙ÷K´Ï+öÿ‡äÿ7ýÈ~¹ÿÿ›wMÿ%?é¬ß?z~Ù£â{Þ&ý<¼Mú~Øñ#‰œþ^ùHù³Ì¶–2¡:u·úN¨Ý½Èø+Q»’m÷¯l£Q›Ã=]´=­üŸ¤”ÇÖ}1þ±ëðý_q3Gm Ž%¢¢ìsÙ' ‹áàË̱i$idyÕœÔæŽr2$ž®Ê1dRÖ*†•òq ±Š]+åñDb—JùtC‘¥Ò¾_äF,cÌí—ôË­WQ—Ó·¶]”}·söQvc°üvÌÝ&šzŒ‚ææéðK,„bø«Ìžb¿óF«>©~Ô/ðÛ[T†!öQ~]Ïs¾z&I .1üOyïzÌcŠ"1H€Ì–ð˜ ÀÀÌàbÌÃ"K0‘fð03x€­ 2Ï,pAM4ÌPgf4UU’NÀ y¤‘I4õ7þqsþq@ùeôïÌŸÌû0€—>XòœëQ§´—7hŸXCý×Výí}_döGeÊ7è;¼ÏŸ—O/žÿà…ÿ͉h;>_»å<ƒøûãüÏçKøùFóú âŽÅ]Š»v*ìUØ«±Wb®Å]Š»v*þm?çã?úÕþyÿ¶v‰ÿtÛ|U:ÿŸiëPé_øëòi1WôcŠ»v*ü·ÿŸ«ùfMCòsÈ>iŠ#!òßšþ©pÀTÇ£g5\šl=KxׯR1WàäKm479Žhd†AÕYMT‘«ûò?™í|ëä¿(ùÆÉ‘­<Õ£Xêöå W…íºNÜôçN¸«)Å]Š»v*ìUòWüç7›bòüâ׿½ÓL±\ë–è61r•õKˆ­¥E¯q ÈçÙN*þa1Wôÿÿ87å©<­ÿ8­ùCe4^œúŽ›q¬Ê{²ê·“ÞÄÇaþê™öñ늾±Å_ɯüäoþ´/çÇþlO4ÝZç~ŒÿÏ¥?å!üîÿ¶v‡ÿ'¯qWíŽ*ìUüšÿÎFÿëBþ|æÄóGýÕ®qWèÏüúSþRÎïûghòz÷~Øâ¯ÿœ«ÿÖlüñÿÀ3Vÿ¨gÅ_Êv*þ˜¿çßÿ8‰ùLªêÍkË"‚ Vý=¨5¡}Š»v*ìUØ«ù?ÿœ˜Ô Õ?ç"?;ïmˆhÏìq8 †_K0GfãQ튾õÿŸMÿäÃüÚÿÀvËþ¢Î*ýËÅ^eù×ÿ’kóoÿÍ{þéÓâ¯äs~åϧüåçåÿæ^Sõ^¶×`‰XµKanÜZ+XÔø8«õ›v*ìUØ«±T—Ìší•ü½¯y›TOLòîu©ê2tã¤-4‡CŠ¿[R¹Öu]OX¼ Ýê·s^]°2NæG ù±Å_¶ÿóé¿-Iiä/Íß7²½¯iúDo¾çJµ’r:ÓoÒ Å_­8«±Wb®Å]мgþr7ÿYëóãÿ5ßš?î“sŠ¿“\Uý%ÿϹ¿õ”<ÿmoþêS⯹qWb®Å]Š»v*ùëó3þqSòóf ‘æïËM jw5'Ìz\#MÔƒ‘³›«_Mä+Ô y¯ŠœUø¿ÿ9eÿ8æ?È]>çϾHÔ®<éùe ŠºŒ—£SÒ=F†èF%ˆ±ÕEZFEb«óêÞâ{IີžKk›i[k˜˜¤‘È„2º2ATÓQ_󇟜·Ÿž_¾Ró~±0¸óFœfÐüÛ0§ï/ì_XÓö§…£™€ä ±WÔ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wä'üåWó×Ï'þÙŸ÷L´Ï'ö˜ÿ®?Íÿr­?àdæÞÓÉOúk7z~Ù¢â{Î&ý<Ž&ý?lx—‰ö/åg•‡–¼·×ðÔõ®7WµdJ~æ#Óì©©¡'4ú¼Ür¡È>;íOj~{VcèÇégøÄý€3-Nã“ì»Éóì3I¬Ëg„:]<+Ô”æ ’ìUJF ÉÎ!/•úåÑ ñŠ]+åÑDb—Jù|C‘¥WWÁ³M"Å *^Y\ÑUTT’NÀ—ÂD̹8àI ø×óβù·T1Û;&‰`Ål!Üz‡¡™‡‹v¯AîNzevpÒc³õž©ë4zQ‚>g›Ï€Í«œð03p¼ À^2$³p`.0˜ ·ÉžGó_æ·—|¡Ü뺴ã—ÕàŒq‚Ë4ŒBD€ ;R7ß-Ây¥ÃeÁí>ÕÒöfŸUc€êzžà9ÈùKõÇþqûþqCËŸ”âÛÌÞik4yüQ¡» M–šiÒÑÏ^²°²ª|\»Îìˆi½sõOìïÖüÛí§üõµz}5âÓuÇ“úõÊ?Ð8Ëjõæn_2v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb¯æÓþ~3ÿ­_çŸûghŸ÷M·ÅS¯ùö—þµ•ÿ€î±ÿ&“F8«±Wb¯žÿç*¿,füÝüüÉòU”XÖn4èyz *í¦ºÞ[Æ”èeh½/“b¯åOBŸóíOÎ[=þJ¿åΣxÌÿ•S›DÈç.vÍ-œ£ÄFÞ¤&ƒá •ûC~Žb®Å]Š»v*üRÿŸ¨~rÛ_ê^NüÑîÖS¡¸ó'œÒ6¯ ™bh´øa’IH=D‘œUùQäO'jߘ^tò¯‘´(Ìš¿›u[]*Çj…{©V?Q·T“h$â¯ë³ËÚŸåCòÖ“¡¥y{O¶Ó4Ø’ÞÒ%†%úÅSŒUüšÿÎFÿëBþ|æÄóGýÕ®qWèÏüúSþRÎïûghòz÷~Øâ®Å_ɯüäoþ´/çÇþlO4ÝZç~ŒÿÏ¥?å!üîÿ¶v‡ÿ'¯qWíŽ*òÏÏ-_4þK~nyrÞ/Zë\òn¹eegךÂd„…¨©AõÅ_É*þÿç×~wµ×¿!uŸ&™Wô—¼Çp¯l:‹=MVê úÓzëþÇ~”â®Å]Š»`šŸ˜:OåWåÏœÿ15·Aaå-*{ó·^e^6öêšy™"_ò˜b¯äkP¿»ÕoïµKùšæûR¸–êöá¾Ô“LåÝϹbN*ýYÿŸMÿäÃüÚÿÀvËþ¢Î*ýËÅ^eù×ÿ’kóoÿÍ{þéÓâ¯äs}ÿ8=ùÕoù)ù÷åíGY¼[?(ùÂ6òçš§‘¸Å7n†ÞåÉ!TCp‘³1éæÿÖPò?ý´u¿û©OоåÅ_š?™_óò¿&þYþ`yËòûUü­×®ïü«ÝiW±]Û$sýZB‹2+ …‘@`cнþq“þs;Êó“>`ó/–´_*êUÔ¼»§G©úz…Ä3ˆQ †1ôÙ’µþaоËÅ]Š»v*’ù“ËúW›|½®ù[]¶[ÍÌv:f­jÀ%½ÔM«¸#ucÛwÖ¦ÆöòÈȲ›9ä€Ê¿eŒlV£ØÓ~çϧîîŸò³óBÁÉú•·š¡žÜoOV{–_o³1WêÆ*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUÿÒûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WäüäêWóÇÎçÇôoýÓ-sÈý§?ëŽ_óÜÅú¿þ’ÿ›Mÿ%?é¤Þ "öÍÜñ7éx—‰è—UÿyŠq=7LãsQðµîã;y°Ü(l£>nù—Ÿö“µ%¥<'×=£úOÀ}´úîyD1<‡öFÃÄöÍ&Lœ%ò(GˆÓf,Ř՘ԜÓI²ì@¦°*Ö4@H_-ˆoŒRé_®]äF)t¯×/ˆr#ºWË¢ˆÅóWæ÷žL¯'•4©¾#ôÕ¬7íÕ¾ï‡`ömcú¿¯õ|ûž‹³4œ#Ä—3Ëõ¼ ê]Ð €ÀÌà`fð03pÀY€¸ ‹0˜ €ÀÌ«þI~^ÚþiþhyOÈ·÷ÒiÖÔó6¡uXAio-Ô© ÊÒ"ªH!I© ­œj3G4èè=ªí™v7ffÖB"R€+”„ù+"ÅV9¿sü‹ùwä¿Ë]t/%hú!® @´×+ñÏ;–’VßbÌh6gy§ÓcÁbƒò?lvæ·µóxÚ¼†réÝÝ¢=Ã~gvk—º—b®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUüÚÏÆõ«üóÿlíþé¶øªuÿ>ÒÿÖ¡Ò¿ðÖ?äÒb¯èÇv*ìUØ«ù¹ÿœ÷ÿœx¹ü–üÝ¿ó&‹§´_—Ÿ™3ͪèSÆ´†ÒúFç{a¶ÉÁÛÔv›µàÔUó§ä_ç?š!?1ôOÌO*°škmõ"F+¡a1{YiÙ€M ô%qWôçù/ùãùyùóåo7yYKØŠ¢ë,¤%þ›p¦ ¸*J0 €Â¨àU—|UëØ«±Wb¯“?ç)¿ç,|“ÿ8áåk”{›msó/T¶oð§’Ñù?6%ÕèCX­Ðï¹ %8§í2ªþh|Õæ{ÎÞdÖüÛæF]_Ì>b¼–ÿWÔf?³ÌŘÐP(¢¨( *ýcÿŸbÎ<]]j·ßó¾hÓÚ=;OŽ}+òá&Jz÷2VëøëO†$å‘PY¤î˜«ö»v*þMç#õ¡>?óby£þê×8«ôgþ})ÿ)çwý³´?ù={Š¿lqWb¯ä×þr7ÿZóãÿ6'š?î­sŠ¿FçÒŸòþwÛ;Cÿ“׸«öÇh€À‚PƒÐŒUü¡ÿÎIþT]~K~uù÷ÈR[4eŽ¥%ß–Xî$Òo žÉƒt%bpNެ;b¬÷þpïþr.OùÇ?Í{}sRõgò/™âM+Ï6qv[bᢼíIlÿ$¡uµqWôÑåÿ0h~kÑtÏ1ùkUµ×4fºÒõk9X'‰ú2:Ôàv;â©Æ*ìU yyg§Z\ßêPØØÙDóÞ^Ü:ÅQF ;ÈîBª¨$šŠ¿ŸÿùÏoùÌOÎJ/Êßˋ֗òÓËWž¾«­&Ë­êUQãîm ©áÚF<éEŒâ¯ÏËÚÇ•õ6Ñõë4ÝR;{K©lfdHïm£»‡šõV1J¤©ÜÅ_©Ÿóé¿ü˜›_øÙÔYÅ_¹x«Ì¿:ÿòM~mÿà¯Ý:|UüŽb¯AÖÿ.uÍò÷É?™oŸË^tºÔ´è.•M ¾Ó% $ÇÇ£¡4¯Æø Å_±Ÿó‚?ó›z?˜tMòWów[Nóv–±éÞGóM넇T¶U ÌÎh·)NÌGª8®òÿx«õv*ìUäœÿß—ÿþO¹ó‡Ÿõt²€,‰£é÷Ú•Ê/!oi »ªMA«²ñWóùïùÕæŸÏßÌgóÍ$A%å-´M7/§Â[еˆšW"ÌÔ™è9SzŸüáüãõ×çïça}hïäO(ɳ竲§Ókxœ¬¹l9]ȼ( xzŽ>Æ*þž@ Å[Å^?ù£ùûù;ù,¶¿ò³|ý§y^âõ=[=5Ä·7²ÇR¾¢YÚG4å*å•ڸ«_•ߟÿ“Ÿä~YyÿMóEÍœ~µÞ˜ž­µôqT/ªÖwqÃ8J9pãSJâ¯aÅ]мgþr7ÿYëóãÿ5ßš?î“sŠ¿“\Uý%ÿϹ¿õ”<ÿmoþêS⯹qWóáÿ?2ü£¼ògçt?™¶ÄywóNÎ9‚=SOŠ;k¨š›ñˆ¥ý¢ÏO²qWÊ_óŽZäæï–?1m#’ïN´v²óF•®ô»ª-ÌB¤ËA$u4õkµqWõ!äþUk:“j¾zó¥ÆŸä }bKÙ‡ÖøuZò;«Å+É×.¸«úDÿŸuþZÞþ^ÿÎ7h·ú¤ßRüÅÔn<ÒкékqVö`Ôtx-ÖUö“}ÙŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»ÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wäïüä¼|¿;|ê|FÿÝ6×<{Ú©Wieÿ7ýÌ_ª?ào*ì ?ùÿôÒo ô½³žâ{~6Ä>Ø8—õŸå÷——|¿K CP¥ÍýEK‚3Pà»ã\×gÉÅ/säÞÐvçuDƒèŽÑý'â~ÊOµù¸„†=Ûçý™§Õä³Â::ì¡ivb7µŠ¡¥|²!¶1K¥~¹tC‘¥Ò¿\º!ÈŒRÙ_®_äF/-üÉóªyWH)jàë:ˆhôôëÀti˜x-v¯Sí\ÝöGg~k'«è?Ôí»?IãJÏÒ?øåÝåw’Gi$‘‹I#Y˜š’IêNwà(=@ ‹0˜ ÀÀÌÀ`fð2%˜ €ÀÌà`fà03=òט5O)ùƒEó6‰?Õµmòí>b*°8uä½M(ÀìFÇ%$±ÈJ<Á·[¢Å­Á=>QpÉ<ˆ¯Ÿqèþƒ?/üé¥þby/ËžuÑö±ó š\¬$ò0Ê*“ÀÍE«C*´l@¡*i¶z.›|€¡k$š5Ü´¥LŒ‰sOù¨öÅ^»7üý»NªÖÿ‘7/zUyÃ'˜ÑbV#⤃Mf Ÿ¯¶*ù×ó+þ~mùóçk;Éö:?å•„êÈnôøÚ÷Râ„ «ªÆ»td…Xu ÒŠ¿=µgWó©{­ëú¥Þ·¬êR™µZþg¸¹žFêòË!gb|IÅ_mÎ#ÿÎy·óûU±óWší®¼±ùCg0{ÍaÔÅs«„?¾œn ^jq]øòqÄ*þ‹´- GòÆ‹¥ywËútF‡¢ZÅe¤évÊ-áP‘ÆŠ:˜ªmŠ»&¿ó‘¿úпŸù±<ÑÿukœUú3ÿ>”ÿ”‡ó»þÙÚüž½Å_¶8«±Wòkÿ9ÿ­ ùñÿ›Í÷V¹Å_£?óéOùH;¿í¡ÿÉëÜUûcŠ»|ÿ9Ïÿ8£'üä”,üÍäÛxWóOÉPȺB»ÿJXd“Oy `ļ%Å”•X*þsµ;PÑïït­ZÆ}3SÓ¦{mCNº¡ž £b¯‘¸ ¬¤P‚*1W¸þKÎMþrþAÎãò÷ÍOq/­åMAÞ—;íÉ»ŸÝ³Pñ29rÅ_~hóöŸ4[Z"y£òWKÖ/‚%Æ•¬Ï¦Ä[¹Ok|À{s??ó]ù£þé78«ù5Å_Ò_üû›ÿYCÈÿöÑÖÿî¥>*û—x÷ç·ä¯•???.5Ëß5¡Š+Ê\èºÄj};Pˆ0‚ê*õ+È«-G$fZŽUÅ_ÌçWäoæä/›î|¡çí!­%«>‘­Âì5+pE'´œ¨7”ÑìÀUù3ÿ9ùµù ©Éùqæ‰të;ÉV][Ë—*.tËÒ¢Ÿ¿¶}¹PSšp6 1Wég“çìÀZÅæå;Õ×Ôü½©q‰Ï~6—q±J{ÎßÕW£Oÿ?^ü¢X­-|ß4ãû¸åkÐïÝÖáÈÛü“оüÄÿŸ¬~`jö·?–Ÿ—š_“ ¨Q5½Våµk¤'ýÙB;xQ‡ƒ‰¶*üÍó¿Ÿ<ãù“æ+Ï6yïÌw¾hó õãS¾“›ðZñŽ5XÑjx¢£°«íÏùÂÿù½ó³]Òüýçý2}'ò{Kg¤á¡—_xš¢ÚØÕÉ–QMª‘žudUýA6ÐÃmm [ÛۢǨDDAEUQ@€ UWv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ÿÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WåOüäòº|æiÿVïû§ZçŒûWÿyÍÿqê?øõ‡Oþý4›Ã¨<3{kg?—Þ_æ¿ M+ 2—7uV þî3±u¨+Ë>º/h{Còºb"}SØ~“ði§g˜CIÜ„xžÙ«É>’ù„#ÄiŽX’MI5'5Ûž5ЍÈôÉÎ!/•òè‡"1K¥|º!ÈŒRé_/ˆr#=­jöz.yª_ËéZÙÆd•»ŸQܱØËÓiåšb—3’B#™|=æO0^yŸXºÕï~œñ‚j±D¿aä:øšžùé:=,t؆8ôûO{×àÂ1@DtHÀ̇ à`fà02x€¸`%˜ Àȳp€¼ À^`.0¢¿ó‚šRÕ5ŸÊMVâ–úÇ©«ùS‘éu®[®Äþò$P¦ýÛ:Ogµ•#„õÜ{ú–ÿÄ?àÇì牆§Œo †Oê“è—ÂG‡¼ñG¤_§ùÖ?=;v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb¯ÉùËùÀŸÎÏoÎß2~dùGÌžNÓ´-b×N‚ÚÓW¼Ô!»V´´ŠÞBéo§Ü ‘G;xtÅSùÄ?ùÁOÍÏÈÎ[/Ì?8ù‹Ê–‹m¥_ؽ®w5Ñ’éP„¸ÓíÓˆ#޾Ç~¯â®Å]Š»v*’yË^^ó~}åß5h–>bÐu$ôïô}FîmåPj9Ç e4 iPwâ¯Ì_ÍŸùõŸåç˜n.µOÊ_7ÞyæR]|¹©#jzmIûJ].b_vi~X«â?3ÿÏ´¿ç(4)$]'Iòÿ#_±.‘«Ã O†¦,¨|YÅXgýëþróÿ-ýÏôûÈâ¯Nòüû þr+]š#æ;¯,ù"Ó—úI¼¿kË€½ÌqXÇ4l}šUùâ¯ÐÉŸùö¿ä·åÍÍžµç«›ÍŸ0Z0’(u(–×GGR?£ÑäõiЉ¥t?ÉŠ¿D-íà´‚ [X#¶µ¶b¶¶‰BGhª"¨1UlUØ«±WâæÇüûSó×Ïš™~xÒ<×ä;m'Î^kÖuÍ.ÞòÿSKˆíõé®bY–=.D@+0¡=qWÕÿóƒŸó‰_˜ÿóŒú¯æ-÷žõ¯-êÑyºÓMƒM]æòvF³{†Ê.¬í@J)Ä·zÓ~‡â®Å_ˆ?›óíOÏ_=þiþeùãHó_í´Ÿ9y¯Y×4»{ËýM.#·Ôo¦¹‰fXô¹8I`¬À„õÅ_WÿÎÎ%~cÿÎ3꿘·Þ{Ö¼·«EæëM6 5t›ÉÙÍîC(º³µ(§ÝëLUúŠ»v*ù_óûþp÷òsþrI©y—J“Aó¢Ä"¶óÆŒVÒQå ˜îTPÞ)`»#®*ü®óïüú×ó³B¸žO"y—Ëþ|Ó7Õ’YJ¿eg”3 ûOмYÿçßó—hî«ùL²ª± "ëÚõµh}Æ*Ìü«ÿ>Ñÿœ×ç‰5­/@òD k4ú¶­ ÁPô]0^Ô‘ÐVž$b¯¿ÿ$ÿçÙŸ•~B»³×¿3µi55»VE£É´ÑúRÛ”’\q?ïÇßµÅ_¥VÖÖövðYÙÁ­¥¬i ­¬(8ã@@ ª@1Wã¿üäüûÓó£ó‡ó·Ïß™>Yó?’¬t/4ÝÛϧÚjwºŒWh±ZA R6d”dŠ9Ú˜«Ûÿççÿ2ÿç¼ÕçsÏZç–ukO3iVö6è77“È’C9•Œ‚êÊÔ§JkÛ~â¯2üëÿÉ5ù·ÿ€f½ÿtéñWò9Š¿£ùö—þ²ö•ÿ±ÿ'S}ù‡ùiäOÍ.\ùOóË^iЮO?ª]©çƒa,!Y! ƒÆÊÔ¨­ Å_“ßšŸóêi{Còcó4˼~ZóZ0ôû…ŽþÒ6,;ÐTws×|ªϺÿç,ôû¦·´ü¼³×"Ri{c®i)|…ÝÕ¼Ÿzb«´Ÿù÷Wüå–£r ¼ü¿²Ðb$Vöû\Òž!ר´º¸~ßËŠ¾¹ü«ÿŸR²\[ßþs~bG4•i|·å4oÞ¼_P¼H Nôq±Å_«—_–>Bü¦òå¿•?/<¯eå}à´OÞO%(e¸™‹I4„l^Ff¦Õ «<Å]Š»~%ÎPÿϸ|ý¨ùçÌ>{üŒO×t_3ÞͨÜù"k˜¬.¬nnÉ2ÛIpÉnð—,T !9b¨_ùÆ_ùö÷濞4/9~{Acåÿ/ynîB/&ÁuýÞ¡q "ŠáíÚX@s£³0æ~ßâ®Å^3ÿ9ÿ¬õùñÿšïÍ÷I¹Å_É®*þ’ÿçÜßúÊGÿ¶Ž·ÿu)ñWܸ«±Vçß˯#þhyzçÊ¿˜X±óVƒty5ô|½7¡XdR²E ÑãeaØâ¯ËOÍ?ùõ6‹}qq¨þNþaI¡‰ 4~Zó4Mu–5 õ¸¢/@żU|y¯Ï·ÿç*´yš-?ÊZGš‘Z‚çKÖ¬£Fî¡%›S渫Où÷ÇüåÛº+~S,JÌHÚöƒÅA=O@šaн[Ê?óëÏùÈ-nHßÌú·•ü•iÈ Ö{É/®€ñH­"x›é™qWßÿ“?óíßÉËk‹mcÎ’\~my†Ü« ÕâH4ˆÝiñ.šŒáûÔO$‹Óá|Uú 1[ÅDA,pÃ…DEUU(ÅU1Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å_ÿÕûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WåWüä—þNŸ9ÿÛ»þéÖ¹ã>ÖÆž_óÜEú‹þ_ñƒ§ÿ?þšMá¹Î½³êO èCCòý¿«íB—7•ä>5Ž+JæiñKÜùooëÿ7ª4}1Ø~“ñ?e'·ósq? kçý™©Õd³ÃÜëðÆ… 3¹k $ ¯–Ä7Æ)l¯—D9Š]+õËâˆÅ.•òè‡"1|™ù³çOÓš‘Ðl%®—¥H~±"¦¸õ>ÝvgxñeõK—ý¯SÙÚO apÉ"+à{Bþ€¿.üñ¥þdy+˾uÑÇ =zÕfkbÜš ””žj-LR+!4¡¥FÇ=#K¨Ž£rG‘Ú‰ûw±òöF».“/ÕŽUÎã/ó¢A®—LÓ/uÅ]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb¯2üëÿÉ5ù·ÿ€f½ÿtéñWò9Š¿£ùö—þ²ö•ÿ±ÿ'S}ÿŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«Ä?ç&.íì¿ç=¦¹GùÌP+ò\iÓÃú]ÀÅ_Éö*þ”?çÝPKüâoåü’!Tº½×%·m¾$­ÔdÿÁ!F*ûƒv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«ÿÖûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WåWüä—þNŸ9ÿÛ»þéÖ¹ã>ÖÆž_óÜEú‹þ_ñƒ§ÿ?þšMçÞFÐÿNù‚Ö)SŸúMíEAT"ˆküÍ@G…s˜Í>Û¾íÝwå4² ú¥é¿öÓê9¤FÎ{ ‡¿lÕN|1·Ëc#Lt’I$ÔÉÍQ6ç4vÅP²¾YÛ¥Ò¿\º!ÈŒRé_®_äÆ)t¯—D9‹È?4üçþÒ ”¼uYY-ÊŸŠº<¾Ç²ûïÛ7ý‰Ùÿ˜ÉÅ!èÚz×û]Çfé*þG1Wôcÿ>ÒÿÖ^Ò¿ð"Ö?äêb¯¿ñWb®Å]Š»v*ìUØ«±Wb®Å]Š»~JÏÄÿç+<œ¾BÔ?#<æ _0ùÌÓžv½Ó¥A§Ø[È“›c4d¡šiU•IâÃвâ¯ÃÅVvTE.î@U¤“Њ¿¬/ùÇËûÊßȯÊï"ßBmõ=A·:Õ¹ÿußÝÖêñ7þYæq^þ¦*öÌUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb¯ÿ×ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WåWüä—þNŸ9ÿÛ»þéÖ¹ã>ÖÆž_óÜEú‹þ_ñƒ§ÿ?þšM?üµÑ?Eè+{*qºÖ«ÔB¤ß쳎ÔÎå]γÚ]o©àN=¾?Åú¾ ÂúZ°ˆ—vùœÔêgg…ÓaTb·(Èô(†q t¯×.ˆr#ºWë—Ä9Š]+õË¢ˆÅë:µ¦§ÝêwÒúV¶q™%næä€îs/O‚Y¦!d¹˜0œ’ËáÏ1k·~eÖ/5{ÃG¹oÜÃZˆ¢$kìÞwÏIÒi£¦Ä1ǧÚ{ÞÊ#¢Ld9/ ˜ ÀÀÌÀdY€¼ À\`/0˜ ÆÌÀdY€¼ À\`':·©yk[Ò|ãÜMWD»†ûN¸@áÐv"£pv#l–<’Ç!(óÚ5št¾ÎëxfpË”·þ¿1÷y¾ÿfN}<;Oõbôdþ¡>™›#\®§Ýê&v/Í®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±T©¦XkZf££j¶©}¥êÖ³YjVRn“[Ά9cjSfV â¯?èM¿ç¿òÊùwþEKÿU1W´ùÈMüµÐcò¿‘<½iå/Å4—éV@¬BYdp“V#}ñVaŠ»v*ìUØ«±Wb®Å]Š»v*ļùäó#Éþaò/š`–çËÞg´k-Vehdh˜ƒðÈ›©\UñîŸÿ>ÞÿœV²“Ï•5}Yy#z7zÕê­Ô¯ú<µ¡Þ¾Å_@~_Î6~D~VÜC}ä_ÊÝ EÔíˆ6ÚËÀo/ã"‡à¼¼i§]Àèø«ÛñWb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ÿÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÃzÒ8~qþaë’© 1Ó­-+Qð.hÒ â>ƒží¼ÿ×<‘þ¯ûˆ¾ÕØÚËì=&ÓŽGßâLÓó ì”UŒ~ÖíòÎS=©Êéi4Ì7% +å‘ ±Š]+õËâˆÅ.•úåÑDb—JùtC‘¼×óÍËåmIaqúRû”d{T1„x 5ùÐwÍÏdè?5–Ò7?«âí{?KãO~CŸê|hÌò;I#‘Égv5$É$õ'=ªÀ`fð1fð03pÈ–`."Ìà`fð03p€¼ À\D³x€¸ €^`.0˜ ®‹«ê>_Õô½wH¸6š¦w ît ð8’6¡¨4e0É(HJ;l5jô˜õxgƒ(â„âc!ß #äýöü´óÖŸù•äo.yÓM8µ»E’æÔ~¯r„Çq$}9U–´Ü ô9éº=Lu8£uoQó~ö±2ö/heÑäÜã–ÇùÑ;Æ_çDƒåË£:Ì—HìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å_ÿÒûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«LÊŠÌÌTÌM©' )öˆüÍ«¶»¯jº©'Üìa¨‰h‘¡gÍý³Ú]¬ÉŸ¤¥·õFÑû}‡³´¿•ÓÃpßßÌý¬.gõ$fíÐ|†s™%Å"]Ä#B’=†Ø„¾WËâˆÅ.•úåÑDb—JùtC‘¥7w1[Ã,óȱC4“JÆŠª¢¬Äž€™àd@Ë•ŽDÍñ?üÑ/šõë‹ú°±‡÷:d'n0©Ø‘âçâ?wlô^ÎÑ .§sïý_¤ÓŒ0ë×ÞÄ€Ì÷0À`dð03pÈ’ÌàdY€¸ À^,À^`.0Œ‰fà2,À^`.0˜ €ÀÌã,À\E˜¾¿ç?4Dy‹Uü®Õ.8Øy›–£åÞGdÔ ÷ñ ¿ÝЧ-ÍŽƒvΛٽoÎr–ãß׿>çÃàÕìÏæ4°í“þlÍ{§gh¿Qó´~fv*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb¯ÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ« üÄÕ¿DyGV™„×h,íüyOðµ=Âr?Fs~Öë¿)Ù¹d þvÇý—qØ:_Ìk  xù»ýôøÖwáÔì>œùë,ª/­B6Rwj ÂÌ+õËbãºWËâˆÅ.•òè‡"1K¥~¹|C‘¾~üãówÕíÓÊö2ÒâñDº«)ÝaýˆÏ»Ï·³gSìþƒŠ^4†Ã—¿¿áøäô•¥ÿ(~­ó€×;à˜ €ÀÌà`,À\E˜ ÀÀÌÀ`dð03x€¸dK0‘fð1fð03p€¼ À\2$³x`.0]WÔ<¿«ézî“pm5MîÝ:é@&9àq$mCPhÊ69,y%ŽBQ؃a§W¤Å«Á<G2DÆC¾2GÉûßùgçÍ3ó/Èþ_óž–QcÕ핯m¹k´øn-Ø c Š7B3Óôz¨êqG$z‘ê…=¤ì,½‰ÚtyyÂ[çDï>FÇ0Îó)Ñ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«ÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«Àÿ;õ&…¤«}¦–îtùgñ|òïø$êèaÀ<ä~èÿ¾{c´ûäÊ|¢>óú8ݽ8¯†ç<‡<®ƒè‚Q+õÊâ¸Å-•òø‡"1K¥|º!ÈŒRé_®_äF,WÌÚý¯—t‹ÝZìÕ-“÷QV†IdAó?w\ÎÑée¨È!¿`ïs´ºsšb!ñ£uªßÝêW²n¯eifvì<èaž‹q@B<€{ pAM´à`fà03xÈ–`.0˜ €ÀÌà`fð03p`.0 ÀÀÌÀ`fñ€³p`/0 Ào_vÿÎ~hþ‚óN¥ùgª\ðÒüÛ[Í™¢Ç©@Ÿ€zð¯ÚnÙÓ{7­ðò2å-Ç¿ö¸>ÿ¯f?5£‡ib¼>™ùã‘Øÿ™#òœ‰äýOÎÙùØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å_ÿÕûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«åOÎ £?œ"j,¬à„\¥ÿóÿà›Äí>æB#ï—ûçÓ=”Çâ¿çHŸÑú'w%dm¾ìóùï'±Å’™_®N!ËŒRé_®]äF)t¯—Ä9Š]+åÑDbù3ó[ÍŸ§5Ñ6’rÓtgdbÃ%ÇGop¿d}>9Üö&‡ÀÅâKê—Ø?üž«³´¾,ó?sÊ€ÍÛ²p€¼ À\0`/"ÌÀ`fð03p€¼ À\2%˜ ÀÀÌÀ`fð03x€¸ €\E°à`dð03¼ Š£ô­RÿDÔôígK¹{=OI¹ŠóO»íE<$×ÝYAÉÂfŽÄ ­6=V)áÊ8¡8˜È±¢>!ûÛù[çëÌß!ùsÎv<#:µ°ý!h†¿W¼ˆúw0ï½E F¿x9áÝ@ŽÕ™=cùúSöTƒ¡‘?{ħ’¬ÇÄœáÀÝìa’É_®[äÆ)t¯—Ä9Š]+õË¢ˆÅ噞nÿ è­ ¬”Õµ@ÐÙS¬kOÞKþÄr=ówØúÌe¹}1Üþøèíû;KâÎÏ ù®ýó¼z€˜ €ÀÌã"Y€¸ ‹0˜ €ÀÈà`fà03xÀK0‘fð03p€¼ À^`.ÌÀ`fð03vNÅ]Š»}Ûÿ8Aù£ú Í:—åž©sÃKómo4f‹¥|h:ë½ÿj4Q»gMìÞ·ÃÈpË”·ÿÚ>àøwü½˜üÖŽ¥ˆzðúgçŽGcþdÊr'“õ?;gæb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š¿ÿ×ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«À¿;¼µ=ŵŸ™í#2}E>«©ªŠ‘bÑÉòVbÌg™ÿÁ ±å–0Ö@_á—õnâ~}áî=ŽíÂRÓH×ñ÷õ*¯q|•;Q˜xžAÃEõ( ’Ù_.ˆrcºWë—D9ŠI©jÚu¥Íõä¢ÚYå=•EOÏØfNRÉ!‹%ÊÈÎB#™|Qæ¯0Üù£ZºÕgªFçÓ³·'û¨Wì/Ϲ÷'=E¤Ž—€øù—°Óà`"ø”䀼 À\0`."Ìà`fð03p€¼ À\2%˜ Àȳp¼ À\`/0 ³x`.0àfìUØ«±Wb¨Ý7Q¾Ò5 [Lº’ËRÓ."»Óï"ªÚí’òØ;¨] ¹D©bQfÂ’jV„ç¨hµ#S†9;ÇÛÈý¯Â~Óö$»´ó艿T|H>f$_³üÊt.Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š¿ÿÐûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUتœÑEq°OÍ ÈÑÍ €ÊÊÂŒ¬Ähr3„g Q‘ ¡#%Dr|µç¯È‹ÿ¬O¨y2D¹·–:,îD'´R5‡€bñ9å¹ÿü‚g&ˆƒüÑÕ'b=ä2úWbûk„cÕ‚þ ,xƒî¿px]÷åïŸ-d1Iå ]ØmX-%à¢V_Ç8ùû;Ú8Í>2ûE‡µÃÛÝŸ1c>?Œ„~ÃH3òƒóZ‘V,ÜYFÔç=ù[UP{•”«ŸRs?Iì§ig;b1òôýûüƒ^§Ú¾ÌÓ 9„t}_vß2„óÇüáïæ›b†ÆßÍþ]Ót´+$Ðvï,ƒq̈⧠ñß·f{—K딢eñÛÝ·ÚâèÿàŸÙº{'RÍÿŠy¯ýÛóþ§.ÀÝÿÕÜ çïÌþ§aÿ'{³ÿÔrÿ±ÿŠ]ÿDøüÅÿ©ãËŸð7õGòçGæS!ÿÏÿQËþÇþ)¿ú'Ïæ/ýNþ\û®ÿêŽ?Èÿ·õ2ðaìïõ ¿ìâÿDúüÆÿ©ßËuçýQÁüŸùÑûS!ÿ.ÎÿPËþÇþ)¿ú'ßæ7ýNÞ[û¯?ê†ô?ŸùÑûS!ÿ>ÍÿPËþÇþ)¿ú'çæ?ýN¾[ÿ§Ïú¡úÏüèý¿©#þ ›þ¡—ýüSôOïÌú|·ÿOŸõCô=ŸùÑûS!ÿnÍÿPËþÇþ)¿ú'ÿæ?ýNž[ÿ§Ïú¡ƒýfþt~ßÔËþO?fÿ¨eÿaÿ»þ„óþ§O-ÿÓçýPÇýæþt~ßÔÈÁ£³?Ô2ÿ°ÿŠwýæ?ýN~Zûï?ê†ô9›ùÑûS!ÿžÌÿPÍþÃþ)wýæ?ýN~Zûï?ìŸúÍüèý¿©?òzû3ýC7ûø¦ÿèA?1ÿêrò×ßyÿdøÿ¡¼ßÎÛú™ø6vgú†oöñMÿЂþcÿÔå忾óþÉð¡¼ßÎÛú™ÉíìÏõ ßì?â—Ѓ~cÿÔå忾óþÉñÿCY¿·õ'þOweÿ¨fÿaÿßý?æ?ýN>[ûï?ìŸúÏüèý¿©—üŸËÿPÍþÃþ)wýGæ?ýN>[ûï?ìŸúÏüøý¿©—üŸËÿPÍþÃþ)¿úŸÌúœ|·÷ÞÙ>ô1ŸùñûRäùv_ü£æÿaÿßýWæ7ýN>[ûï?ìŸô1ŸùñûS/ù>—ÿ(ù¿ØÅ7ÿBùÿS–þûÏû'Áþ†3ÿ>?oêOüŸNËÿ”|ßì?âÿBùÿS–þûÏû'Çý gþ|~ßÔ¿ò};/þQó°ÿŠwý_æ?ýN>[ûï?ìŸô1ŸùñûRÿÉôì¿ùGÍþÃþ)ßô!˜ÿõ8ùoï¼ÿ²|ÐÆçÇíýKÿ'Ó²ÿå7ûø§Ð…þcÿÔã忾óþÉñÿCÿŸ·õ/üŸNËÿ”|ßì?â‘v?óx’îÔ¼ó¡ZØ3RêâÚ+›‰‘|R'HU±uùä£ì¾[ÞqâSVø:öx8ôÙLºcñ Èô¥ú7ä?&i?—žOÐ<™¢sm7A¶ô"–SY%vf’Y_·)$vrÀ¶Î»K§ŽŸqÇϻۻc]—Yš¸òÛ£å€;ößv]—º—b®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å_ÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÒûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÕûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÖûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wÿ×ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÐûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÒûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÕûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÖûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wÿ×ûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÐûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÑûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÒûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÓûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÔûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÕûùŠ»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±Wb®Å]Š»v*ìUØ«±WÿÙrollup-3.29.4/docs/public/vitejs-logo.svg000066400000000000000000000027621450520414700203300ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/000077500000000000000000000000001450520414700150225ustar00rootroot00000000000000rollup-3.29.4/docs/repl/components/000077500000000000000000000000001450520414700172075ustar00rootroot00000000000000rollup-3.29.4/docs/repl/components/BundleOptions.vue000066400000000000000000000103151450520414700225150ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/InputHeader.vue000066400000000000000000000041601450520414700221410ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/OutputStatus.vue000066400000000000000000000034361450520414700224420ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/ReplEditor.vue000066400000000000000000000045361450520414700220110ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/ReplInput.vue000066400000000000000000000032611450520414700216540ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/ReplMain.vue000066400000000000000000000063001450520414700214360ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/ReplModule.vue000066400000000000000000000101021450520414700217720ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/ReplOutput.vue000066400000000000000000000015761450520414700220640ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/RollupVersion.vue000066400000000000000000000023261450520414700225560ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/SelectOption.vue000066400000000000000000000016771450520414700223530ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/components/StatusMessage.vue000066400000000000000000000026611450520414700225250ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/examples/000077500000000000000000000000001450520414700166405ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/00/000077500000000000000000000000001450520414700170575ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/00/example.json000066400000000000000000000001031450520414700213770ustar00rootroot00000000000000{ "title": "Tree-shaking", "options": { "treeshake": true } } rollup-3.29.4/docs/repl/examples/00/modules/000077500000000000000000000000001450520414700205275ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/00/modules/main.js000066400000000000000000000001211450520414700220030ustar00rootroot00000000000000// TREE-SHAKING import { cube } from './maths.js'; console.log(cube(5)); // 125 rollup-3.29.4/docs/repl/examples/00/modules/maths.js000066400000000000000000000010041450520414700221740ustar00rootroot00000000000000// maths.js // This function isn't used anywhere, so // Rollup excludes it from the bundle... export const square = x => x * x; // This function gets included // rewrite this as `square(x) * x` // and see what happens! export const cube = x => x * x * x; // This "side effect" creates a global // variable and will not be removed. window.effect1 = 'created'; const includeEffect = false; if (includeEffect) { // On the other hand, this is never // executed and thus removed. window.effect1 = 'not created'; } rollup-3.29.4/docs/repl/examples/01/000077500000000000000000000000001450520414700170605ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/01/example.json000066400000000000000000000001711450520414700214050ustar00rootroot00000000000000{ "title": "Named exports", "options": { "output": { "exports": "auto", "esModule": "if-default-prop" } } } rollup-3.29.4/docs/repl/examples/01/modules/000077500000000000000000000000001450520414700205305ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/01/modules/main.js000066400000000000000000000004311450520414700220100ustar00rootroot00000000000000// NAMED EXPORTS // There are many ways to export bindings // from an ES2015 module export var foo = 1; export function bar() { // try changing this to `foo++` // when generating CommonJS return foo; } function baz() { return bar(); } export { baz }; export * from './qux'; rollup-3.29.4/docs/repl/examples/01/modules/qux.js000066400000000000000000000000321450520414700216760ustar00rootroot00000000000000export const qux = 'QUX'; rollup-3.29.4/docs/repl/examples/02/000077500000000000000000000000001450520414700170615ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/02/example.json000066400000000000000000000001731450520414700214100ustar00rootroot00000000000000{ "title": "Default exports", "options": { "output": { "exports": "auto", "esModule": "if-default-prop" } } } rollup-3.29.4/docs/repl/examples/02/modules/000077500000000000000000000000001450520414700205315ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/02/modules/answer.js000066400000000000000000000001141450520414700223620ustar00rootroot00000000000000// Internal default exports are turned // into variables export default 42; rollup-3.29.4/docs/repl/examples/02/modules/main.js000066400000000000000000000002761450520414700220200ustar00rootroot00000000000000// DEFAULT EXPORTS // Default exports from the 'entry module' are // exported from the bundle import answer from './answer.js'; export default () => console.log('the answer is ' + answer); rollup-3.29.4/docs/repl/examples/03/000077500000000000000000000000001450520414700170625ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/03/example.json000066400000000000000000000000421450520414700214040ustar00rootroot00000000000000{ "title": "Static namespaces" } rollup-3.29.4/docs/repl/examples/03/modules/000077500000000000000000000000001450520414700205325ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/03/modules/assert.js000066400000000000000000000006101450520414700223660ustar00rootroot00000000000000export function equal(a, b, message) { if (!message) message = format('%s does not equal %s', a, b); if (a != b) throw new Error(message); } export function ok(value, message) { if (!message) message = format('%s is not truthy', value); if (!value) throw new Error(message); } export function format(string_, ...arguments_) { return string_.replace(/%s/g, () => arguments_.shift()); } rollup-3.29.4/docs/repl/examples/03/modules/main.js000066400000000000000000000003651450520414700220200ustar00rootroot00000000000000// STATIC NAMESPACES // ES6 modules let you import all of another module's // exports as a namespace... import * as assert from './assert'; // ...but we can statically resolve this to the // original function definition assert.equal(1 + 1, 2); rollup-3.29.4/docs/repl/examples/04/000077500000000000000000000000001450520414700170635ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/04/example.json000066400000000000000000000001331450520414700214060ustar00rootroot00000000000000{ "title": "Dynamic namespaces", "options": { "output": { "freeze": "true" } } } rollup-3.29.4/docs/repl/examples/04/modules/000077500000000000000000000000001450520414700205335ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/04/modules/constants.js000066400000000000000000000001571450520414700231100ustar00rootroot00000000000000export const Ï€ = 3.141_59; export const e = 2.718_28; export const φ = 1.618_03; export const λ = 1.303_57; rollup-3.29.4/docs/repl/examples/04/modules/main.js000066400000000000000000000005301450520414700220130ustar00rootroot00000000000000// DYNAMIC NAMESPACES // In some cases, you don't know which exports will // be accessed until you actually run the code. In // these cases, Rollup creates a namespace object // for dynamic lookup import * as constants from './constants'; for (const key of Object.keys(constants)) { console.log(`The value of ${key} is ${constants[key]}`); } rollup-3.29.4/docs/repl/examples/05/000077500000000000000000000000001450520414700170645ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/05/example.json000066400000000000000000000002301450520414700214050ustar00rootroot00000000000000{ "title": "External imports", "options": { "output": { "globals": { "jquery": "$", "$": "jquery" }, "interop": "default" } } } rollup-3.29.4/docs/repl/examples/05/modules/000077500000000000000000000000001450520414700205345ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/05/modules/main.js000066400000000000000000000002771450520414700220240ustar00rootroot00000000000000// EXTERNAL IMPORTS // You can import external modules into your bundle – // it doesn't matter if they're ES2015 or legacy import $ from 'jquery'; $('body').html('

Hello world!

'); rollup-3.29.4/docs/repl/examples/06/000077500000000000000000000000001450520414700170655ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/06/example.json000066400000000000000000000001451450520414700214130ustar00rootroot00000000000000{ "title": "Dynamic imports", "options": { "output": { "inlineDynamicImports": false } } } rollup-3.29.4/docs/repl/examples/06/modules/000077500000000000000000000000001450520414700205355ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/06/modules/main.js000066400000000000000000000005611450520414700220210ustar00rootroot00000000000000// DYNAMIC IMPORTS // Rollup supports automatic chunking and lazy-loading // via dynamic imports utilizing the import mechanism // of the host system. import square from './square.js'; // Directly use some math console.log(square(2)); // Dynamically import the rest import('./maths.js').then(maths => { console.log(maths.square(5)); console.log(maths.cube(5)); }); rollup-3.29.4/docs/repl/examples/06/modules/maths.js000066400000000000000000000001751450520414700222120ustar00rootroot00000000000000import square from './square.js'; export { default as square } from './square.js'; export const cube = x => square(x) * x; rollup-3.29.4/docs/repl/examples/06/modules/square.js000066400000000000000000000001771450520414700224000ustar00rootroot00000000000000// Modules shared between the entry chunk and the // dynamic chunk are merged into the entry chunk. export default x => x * x; rollup-3.29.4/docs/repl/examples/07/000077500000000000000000000000001450520414700170665ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/07/example.json000066400000000000000000000003101450520414700214060ustar00rootroot00000000000000{ "title": "Multiple Entry Modules", "entryModules": ["main.js", "otherEntry.js"], "options": { "output": { "minifyInternalExports": false, "preserveModules": false } } } rollup-3.29.4/docs/repl/examples/07/modules/000077500000000000000000000000001450520414700205365ustar00rootroot00000000000000rollup-3.29.4/docs/repl/examples/07/modules/cube.js000066400000000000000000000003521450520414700220120ustar00rootroot00000000000000import square from './square.js'; // Everything used by both entry modules will become // a separate chunk that is imported by both entry // chunks to avoid code duplication export default function cube(x) { return square(x) * x; } rollup-3.29.4/docs/repl/examples/07/modules/hyperCube.js000066400000000000000000000002611450520414700230210ustar00rootroot00000000000000import cube from './cube.js'; // This is only imported by one entry module and // shares a chunk with that module export default function hyperCube(x) { return cube(x) * x; } rollup-3.29.4/docs/repl/examples/07/modules/main.js000066400000000000000000000001361450520414700220200ustar00rootroot00000000000000// MULTIPLE ENTRY MODULES import hyperCube from './hyperCube.js'; console.log(hyperCube(5)); rollup-3.29.4/docs/repl/examples/07/modules/otherEntry.js000066400000000000000000000001431450520414700232350ustar00rootroot00000000000000// Additional entry modules create new chunks import cube from './cube.js'; console.log(cube(5)); rollup-3.29.4/docs/repl/examples/07/modules/square.js000066400000000000000000000001451450520414700223740ustar00rootroot00000000000000// This is also shared between the entry chunks export default function square(x) { return x * x; } rollup-3.29.4/docs/repl/font/000077500000000000000000000000001450520414700157705ustar00rootroot00000000000000rollup-3.29.4/docs/repl/font/fontello.eot000077500000000000000000000141541450520414700203330ustar00rootroot00000000000000lÄLPÈ(‹fontelloRegularVersion 1.0fontello€pGSUB ‹%züTOS/2>!IPVcmapéBœ¨Äcvt ×ÿ ¬ fpgmŠ‘Y Ì pgasp ¤glyfŽïlRhead»(¹À6hhea=Pø$hmtx,ÿõ loca;Ì<maxpò ÄP nameÌ!pÍpostBâí @aprepåA+¼<† 0>DFLTlatnliga†z¼Œz¼à1PfEd@èèRÿjZS—,`Z, `.èÿÿèÿÿ dèèèèèèèèèèèèèèÿ±Mÿ$†@GK°PX@'ooocRWK@&ooooRWKY@!  +7'34#"3276'#5'762Ë2ƒ3H_ þÑ /èþ0èM]è];ƒ3ƒ32; l l  z g ¬ "ü¦" ­ "&"Sj j  ×ÿüî####‹(È_<õ èØYòŒØYòŒÿõÿióSRÿjèÿõÿõóèYèèèÿõ„Î@x¾)4sd pÞ55=DL T_ +g ’ j¥   - = M c Vs &ÉCopyright (C) 2019 by original authors @ fontello.comfontelloRegularfontellofontelloVersion 1.0fontelloGenerated by svg2ttf from Fontello project.http://fontello.comCopyright (C) 2019 by original authors @ fontello.comfontelloRegularfontellofontelloVersion 1.0fontelloGenerated by svg2ttf from Fontello project.http://fontello.com  pencilcancelplusminusokerror attentionÿÿSÿiSÿi°, °UXEY K¸QK°SZX°4°(Y`f ŠUX°%a¹cc#b!!°Y°C#D²C`B-°,° `f-°, d °ÀP°&Z²( CEcER[X!#!ŠX °PPX!°@Y °8PX!°8YY ± CEcEad°(PX!± CEcE °0PX!°0Y °ÀPX f ŠŠa ° PX` ° PX!° ` °6PX!°6``YYY°+YY#°PXeYY-°, E °%ad °CPX°#B°#B!!Y°`-°,#!#! d±bB °#B± CEc± C°`Ec°*! °C Ра+±0%°&QX`PaRYX#Y! °@SX°+!°@Y#°PXeY-°,°C+²C`B-°,°#B# °#Ba°bf°c°`°*-°, E ° Cc¸b °PX°@`Yf°c`D°`-°,² CEB*!²C`B-° ,°C#D²C`B-° , E °+#°C°%` EŠ#a d ° PX!°°0PX° °@YY#°PXeY°%#aDD°`-° , E °+#°C°%` EŠ#a d°$PX°°@Y#°PXeY°%#aDD°`-° , °#B² EX!#!Y*!-° ,±E°daD-°,°` ° CJ°PX ° #BY° CJ°RX ° #BY-°, °bf°c ¸cŠ#a°C` Š` °#B#-°,KTX±dDY$° e#x-°,KQXKSX±dDY!Y$°e#x-°,±CUX±C°aB°+Y°C°%B± %B± %B°# °%PX±C`°%BŠŠ Š#a°*!#°a Š#a°*!±C`°%B°%a°*!Y° CG° CG`°b °PX°@`Yf°c ° Cc¸b °PX°@`Yf°c`±#D°C°>²C`B-°,±ETX°#B E° #B° #°`B `°aµBBŠ`±+°r+"Y-°,±+-°,±+-°,±+-°,±+-°,±+-°,±+-°,±+-°,±+-°,±+-°,± +-°,° +±ETX°#B E° #B° #°`B `°aµBBŠ`±+°r+"Y-°,±+-° ,±+-°!,±+-°",±+-°#,±+-°$,±+-°%,±+-°&,±+-°',±+-°(,± +-°), <°`-°*, `°` C#°`C°%a°`°)*!-°+,°*+°**-°,, G ° Cc¸b °PX°@`Yf°c`#a8# ŠUX G ° Cc¸b °PX°@`Yf°c`#a8!Y-°-,±ETX°°,*°0"Y-°.,° +±ETX°°,*°0"Y-°/, 5°`-°0,°Ec¸b °PX°@`Yf°c°+° Cc¸b °PX°@`Yf°c°+°´D>#8±/*-°1, < G ° Cc¸b °PX°@`Yf°c`°Ca8-°2,.<-°3, < G ° Cc¸b °PX°@`Yf°c`°Ca°Cc8-°4,±% . G°#B°%IŠŠG#G#a Xb!Y°#B²3*-°5,°°%°%G#G#a° C+eŠ.# <Š8-°6,°°%°% .G#G#a °#B° C+ °`PX °@QX³  ³&YBB# °C Š#G#G#a#F`°C°b °PX°@`Yf°c` °+ ŠŠa °C`d#°CadPX°Ca°C`Y°%°b °PX°@`Yf°ca# °&#Fa8#°CF°%°CG#G#a` °C°b °PX°@`Yf°c`# °+#°C`°+°%a°%°b °PX°@`Yf°c°&a °%`d#°%`dPX!#!Y# °&#Fa8Y-°7,° °& .G#G#a#<8-°8,° °#B F#G°+#a8-°9,°°%°%G#G#a°TX. <#!°%°%G#G#a °%°%G#G#a°%°%I°%a¹cc# Xb!Yc¸b °PX°@`Yf°c`#.# <Š8#!Y-°:,° °C .G#G#a `° `f°b °PX°@`Yf°c# <Š8-°;,# .F°%FRX ,°5+# .F°%FRX +-°S,²>+-°T,²>+-°U,²>+-°V,²@+-°W,²@+-°X,²@+-°Y,²@+-°Z,²C+-°[,²C+-°\,²C+-°],²C+-°^,²?+-°_,²?+-°`,²?+-°a,²?+-°b,°7+.±++-°c,°7+°;+-°d,°7+°<+-°e,°°7+°=+-°f,°8+.±++-°g,°8+°;+-°h,°8+°<+-°i,°8+°=+-°j,°9+.±++-°k,°9+°;+-°l,°9+°<+-°m,°9+°=+-°n,°:+.±++-°o,°:+°;+-°p,°:+°<+-°q,°:+°=+-°r,³ EX!#!YB+°e°$Px°0-K¸ÈRX±ŽY°¹cp±B²*±B³ *±B³*±BºÀ *±Bº@ *±D±$ˆQX°@ˆX±dD±&ˆQXº€@ˆcTX±DYYYY³  *¸ÿ…°±Drollup-3.29.4/docs/repl/font/fontello.svg000077500000000000000000000046271450520414700203470ustar00rootroot00000000000000 Copyright (C) 2019 by original authors @ fontello.com rollup-3.29.4/docs/repl/font/fontello.ttf000077500000000000000000000137041450520414700203410ustar00rootroot00000000000000€pGSUB ‹%züTOS/2>!IPVcmapéBœ¨Äcvt ×ÿ ¬ fpgmŠ‘Y Ì pgasp ¤glyfŽïlRhead»(¹À6hhea=Pø$hmtx,ÿõ loca;Ì<maxpò ÄP nameÌ!pÍpostBâí @aprepåA+¼<† 0>DFLTlatnliga†z¼Œz¼à1PfEd@èèRÿjZS—,`Z, `.èÿÿèÿÿ dèèèèèèèèèèèèèèÿ±Mÿ$†@GK°PX@'ooocRWK@&ooooRWKY@!  +7'34#"3276'#5'762Ë2ƒ3H_ þÑ /èþ0èM]è];ƒ3ƒ32; l l  z g ¬ "ü¦" ­ "&"Sj j  ×ÿüî####‹(È_<õ èØYòŒØYòŒÿõÿióSRÿjèÿõÿõóèYèèèÿõ„Î@x¾)4sd pÞ55=DL T_ +g ’ j¥   - = M c Vs &ÉCopyright (C) 2019 by original authors @ fontello.comfontelloRegularfontellofontelloVersion 1.0fontelloGenerated by svg2ttf from Fontello project.http://fontello.comCopyright (C) 2019 by original authors @ fontello.comfontelloRegularfontellofontelloVersion 1.0fontelloGenerated by svg2ttf from Fontello project.http://fontello.com  pencilcancelplusminusokerror attentionÿÿSÿiSÿi°, °UXEY K¸QK°SZX°4°(Y`f ŠUX°%a¹cc#b!!°Y°C#D²C`B-°,° `f-°, d °ÀP°&Z²( CEcER[X!#!ŠX °PPX!°@Y °8PX!°8YY ± CEcEad°(PX!± CEcE °0PX!°0Y °ÀPX f ŠŠa ° PX` ° PX!° ` °6PX!°6``YYY°+YY#°PXeYY-°, E °%ad °CPX°#B°#B!!Y°`-°,#!#! d±bB °#B± CEc± C°`Ec°*! °C Ра+±0%°&QX`PaRYX#Y! °@SX°+!°@Y#°PXeY-°,°C+²C`B-°,°#B# °#Ba°bf°c°`°*-°, E ° Cc¸b °PX°@`Yf°c`D°`-°,² CEB*!²C`B-° ,°C#D²C`B-° , E °+#°C°%` EŠ#a d ° PX!°°0PX° °@YY#°PXeY°%#aDD°`-° , E °+#°C°%` EŠ#a d°$PX°°@Y#°PXeY°%#aDD°`-° , °#B² EX!#!Y*!-° ,±E°daD-°,°` ° CJ°PX ° #BY° CJ°RX ° #BY-°, °bf°c ¸cŠ#a°C` Š` °#B#-°,KTX±dDY$° e#x-°,KQXKSX±dDY!Y$°e#x-°,±CUX±C°aB°+Y°C°%B± %B± %B°# °%PX±C`°%BŠŠ Š#a°*!#°a Š#a°*!±C`°%B°%a°*!Y° CG° CG`°b °PX°@`Yf°c ° Cc¸b °PX°@`Yf°c`±#D°C°>²C`B-°,±ETX°#B E° #B° #°`B `°aµBBŠ`±+°r+"Y-°,±+-°,±+-°,±+-°,±+-°,±+-°,±+-°,±+-°,±+-°,±+-°,± +-°,° +±ETX°#B E° #B° #°`B `°aµBBŠ`±+°r+"Y-°,±+-° ,±+-°!,±+-°",±+-°#,±+-°$,±+-°%,±+-°&,±+-°',±+-°(,± +-°), <°`-°*, `°` C#°`C°%a°`°)*!-°+,°*+°**-°,, G ° Cc¸b °PX°@`Yf°c`#a8# ŠUX G ° Cc¸b °PX°@`Yf°c`#a8!Y-°-,±ETX°°,*°0"Y-°.,° +±ETX°°,*°0"Y-°/, 5°`-°0,°Ec¸b °PX°@`Yf°c°+° Cc¸b °PX°@`Yf°c°+°´D>#8±/*-°1, < G ° Cc¸b °PX°@`Yf°c`°Ca8-°2,.<-°3, < G ° Cc¸b °PX°@`Yf°c`°Ca°Cc8-°4,±% . G°#B°%IŠŠG#G#a Xb!Y°#B²3*-°5,°°%°%G#G#a° C+eŠ.# <Š8-°6,°°%°% .G#G#a °#B° C+ °`PX °@QX³  ³&YBB# °C Š#G#G#a#F`°C°b °PX°@`Yf°c` °+ ŠŠa °C`d#°CadPX°Ca°C`Y°%°b °PX°@`Yf°ca# °&#Fa8#°CF°%°CG#G#a` °C°b °PX°@`Yf°c`# °+#°C`°+°%a°%°b °PX°@`Yf°c°&a °%`d#°%`dPX!#!Y# °&#Fa8Y-°7,° °& .G#G#a#<8-°8,° °#B F#G°+#a8-°9,°°%°%G#G#a°TX. <#!°%°%G#G#a °%°%G#G#a°%°%I°%a¹cc# Xb!Yc¸b °PX°@`Yf°c`#.# <Š8#!Y-°:,° °C .G#G#a `° `f°b °PX°@`Yf°c# <Š8-°;,# .F°%FRX ,°5+# .F°%FRX +-°S,²>+-°T,²>+-°U,²>+-°V,²@+-°W,²@+-°X,²@+-°Y,²@+-°Z,²C+-°[,²C+-°\,²C+-°],²C+-°^,²?+-°_,²?+-°`,²?+-°a,²?+-°b,°7+.±++-°c,°7+°;+-°d,°7+°<+-°e,°°7+°=+-°f,°8+.±++-°g,°8+°;+-°h,°8+°<+-°i,°8+°=+-°j,°9+.±++-°k,°9+°;+-°l,°9+°<+-°m,°9+°=+-°n,°:+.±++-°o,°:+°;+-°p,°:+°<+-°q,°:+°=+-°r,³ EX!#!YB+°e°$Px°0-K¸ÈRX±ŽY°¹cp±B²*±B³ *±B³*±BºÀ *±Bº@ *±D±$ˆQX°@ˆX±dD±&ˆQXº€@ˆcTX±DYYYY³  *¸ÿ…°±Drollup-3.29.4/docs/repl/font/fontello.woff000077500000000000000000000070001450520414700204750ustar00rootroot00000000000000wOFFÄGSUBX;T ‹%zOS/2”CV>!IcmapØgÄéBœcvt @ ×ÿfpgmT pŠ‘Ygaspäglyfì1RŽïhead 26»(¹hhea T$=Phmtx t ,ÿõloca Œ;Ìmaxp   ò Äname ÀwÍÌ!post 8IaBâíprep „z†åA+¼xœc`d``àb0`°c`rqó aàËI,Écb`a€<2›1'3=‘Æʱ€i fƒˆ&;Hxœc`dncœÀÀÊÀÀTÅ´‡¡B3>`0ddŠ2°23`i®) /^°1ýÏbˆbf˜fÉë »xœí‘Á €@ ç4ÞXŠX/Ÿ.tS†YØ%ä±`»0h˜SiË|fÍÜ8rÇ"÷þÖãˆ)qÍYÐÝÑ Ôý’3 ö˜>üñÞ)– xËzG%œ)as4IÚ0r`%e‹*©õ®˜8åuZÄ[Â~íÚÑ—ÎhãPwb<[[9QÉñhR§™LÚIÍ£) ¢”t&x̯(?¢I^mc5‰•GÓ8fÆ„D"-ÜKSA,;±¤)Í£½¹¦¹v-Z¤ÉõÜ£÷ôæV¸¹ÓSÚô³FV§b:Ø Óéiä/ñiÚå"Eéúé~LâAÖ2‘-6ÔƒoýÒË×–…רîíó+¨}ÖDð¤ûÐOÕ) L…˜UˆV@b­kY–ÉÕ¬©ÈÔwCšV¾¬ÓŠrǾŒqý_33–˜¾ß‰Ó³#.=síKÓ|›u=š×©ÅrqfyN§Y–ïë4ÇòæYž×éK[§£,?ÔiåG:cyA štßÁ‹0ä0„¥CX^‚!, a¹CXaË%ÂòcÂr†°¼¬eÕÔSIãÚ™XlB`b޹ÌEåj*¹TB»hTjCžn•TϪe ^<ò†9°H—Èš_1ΕFåøÖ-o;WÀ±êoŽö9ñRÖ‹…?ÿÕÖT%½bÍÓ«ð†žl'ª6©xtM—ÏU=ºþ_TTX ôH…X(ʲlpg"„:†j •CÌlÌ<´ëuËšŸÃý71BPýø7 ܃NYIYíà¬Õ×Û²Ü;ƒr8,I17óúVø"#³Ò~‘YÊž|pŒJeØj­¼Ù'1™Þ$Ïq[Q6HÚØÎ‰ ó€yó&aêª äNᆠøanÁy'\¢z£,‡îEìó(¤ü[§âDö¨hŒÀ³Ùa¯ïBÊoq $4ù¥~ T¡©5Ð4Rn¨_ÆÙºmBÆô#*vò¬âÃÇ÷•’m„|¤ˆÕ££ŸÖ^¢NªÜ~f—ï¾Á 51{ßtqÊ»ZÉ2GmS·•SךCãU‡êæQõ½ãì9kšnº'z_ÓªÛÁÅ\,°ömÒR&Ôõa… ¢ËÅ¥Pêe4Iï¸ÐïPŠÿ«úØ|ž+U…Ñq$ßNÔ·Ñç` üØGõÐ÷cèr .Ï÷šŸnôál™®¢ë§è70k­¹YºÜÐtâ!G­Ž¸Ê |§qz¤¹é!àcÝâÀ&€ÅàݵŒæS£ùŒ9>ÀçÌaÐdƒ-æ0ØfÎÀsì2‡Ás|Áœu€/™Ã dƒˆ9 ž0'xÊ_1‡Á×Ìað sî|Ë1s$Ìa°¯éÖ0Ì-^Ð] ¶AU SOXÜÃâPSeÈþކý½AÌþÁ ¦þ¨éöú/ õgƒ˜ú‹ALýUÓ!õ7^êï1õƒ˜úL¿Ëe¿Œ|— ”]l>çï‰÷ÛÅ@¹ÿÿxœe“MoE†«úcfvÙdfÇÝ=vŒÍîŒ=ÚÈŽvöÉææDq¤(‰'²  6\¹Zä'Dâè͉HáÄÈC„µ ·qZG‰Ha6Õ»ŽrðaÞžª.uU?U `ò¿Ä&à€‚X;E´ŒL.™Ó®àl3Al^|^Þ.2L€q6ÚÐæ'¢x…×A ¸¸X¤'#ap2ðF4óQàW<*ÃQ®Ô­¨Ÿ¹:רIb­òv{Y„I•Y¿×~ Í/íýü<~X“¢üUœ’×ùò¸<7æ—ÔîxWm˜}åæûù{›Ì©‰òPâšøf\®á÷Kz÷hGë}`+ƒÉßlÄîåb1^\ 792`º!|ªÞTJÈùÖ*åwâut­¤0³bë™EÛ‘a#+8lv ^Û¾pàß6ög8ôOúk6`ZÓsò7 wˆ¦àb@N¼-‘ðk´pØfHp·’|5ÉGži¡VN–¸Iœö»$Y·Óëç$Ø6‘ÎÛ†‡ 3n˜[¦cê6ËÑ-ú±ÆÏÖ{dÈ«Ž½¦aÃm=”6Ä?Á‡ùB[¯Ùîo[~[ÝœI3Kßš×!,XB“Ïù3~<¨SÎõâ,%r,NÊX;Œá6Ur /„a¨C=7§æBW.´ê ¹ ¯¯ÌJ/HWœ¨ÛÔ˜âø¶(/wÊ?¾áÚhTŽ>f ÷cÊʧå^ù”aúøîvˆçÙ“ÿ=>ù—ÞÞ?ü ñlBÝ¢½X§×RAê)# ’KÆ¿²5SÃ?" ô\v@Êš¼½›eé´ß«ÝNÚÂØYBe¢¼ÝËæ:™u¸ŽŽ”铇£qO£k›’öñ}¶Qu¿t«SÁªtÝoOVjîg^ÍÕ®Äá‹ûa\Ñ Tâ4¾ú…W­z$Xû ÑŽ#¼‰ôÐaÁ‹¿’¤¢ ’„‡u¥^‚϶(xœc`d``ân±›ñü6_¸™_EnD~êÑÿ¿þÏdþÌ är00DyÖRxœc`d``úŸ$_üÿúÿ+óg  ൻ’xœc~ÁÀÀ Ä‚Hø ÿÿ A9„Î@x¾)4sd pxœuËNÂ@†ÿ‘‹ ‰MÜ:+1–Kâ ltC [SJiKJ‡L^Ãwða| ŸÅŸv0b›é|ç›3gNÀ5¾!?O9 œ1Êù§èY.Ð?[.’_,—PÅ›å2ý»å X®â¬ ŠçŒø´,p%.-ŸàBÜY.Ð?Z.’{–K¸¯–Ëôžå &"µ\Žø¨ÕVGAhdmP—íf«#§[©¨¢Ä¥»6¡Ò©ì˹JŒÇÊñÔrÏc?XǮއûyâë4R‰l9ͽù‰¯]ãÏvÕÓMÐ6f.çZ-åÐfÈ•V ß3Nh̪Ûhü=(¬°…FÄ« a Q£­sn£‰:¤)3$3ó¬ \Ä4.ÖÜf+)ã>ÇœQBë3#&;ðø]ù1)àþ˜UôÑêa0‹ÍiÓ 4'Íî´‹ÁÂffpÙ¨ÂØ±Á¡#b#sŠËF5oG#‹CGrHHI$læabäÑÚÁø¿uKïF& v#ôrollup-3.29.4/docs/repl/helpers/000077500000000000000000000000001450520414700164645ustar00rootroot00000000000000rollup-3.29.4/docs/repl/helpers/editor.ts000066400000000000000000000077641450520414700203400ustar00rootroot00000000000000import { closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete'; import { defaultKeymap, history, historyKeymap } from '@codemirror/commands'; import { javascript } from '@codemirror/lang-javascript'; import { HighlightStyle, indentOnInput, syntaxHighlighting } from '@codemirror/language'; import type { StateEffectType } from '@codemirror/state'; import { EditorState, StateEffect, StateField } from '@codemirror/state'; import type { ViewUpdate } from '@codemirror/view'; import { Decoration, dropCursor, EditorView, keymap, lineNumbers } from '@codemirror/view'; import { tags } from '@lezer/highlight'; export type AddWarnings = StateEffectType<{ messages: { message: string; pos: number }[]; type: 'error' | 'warning'; }>; export const addWarnings: AddWarnings = StateEffect.define<{ messages: { message: string; pos: number }[]; type: 'error' | 'warning'; }>(); const warningsField = StateField.define({ create() { return Decoration.none; }, provide: field => EditorView.decorations.from(field), update(warnings, transaction) { let hasWarning = false; for (const effect of transaction.effects) { if (effect.is(addWarnings)) { if (!hasWarning) { hasWarning = true; warnings = Decoration.none; } warnings = warnings.update({ add: effect.value.messages .sort((a, b) => a.pos - b.pos) .map(({ pos, message }) => Decoration.mark({ attributes: { class: `cm-rollup-${effect.value.type}`, title: message } }).range(pos, pos + 1) ) }); } } return warnings; } }); const theme = EditorView.baseTheme({ '&.cm-editor.cm-focused': { outline: 'none' }, '.cm-content': { caretColor: 'var(--vp-c-neutral)', color: '#A6ACCD', fontFamily: 'var(--vp-font-family-mono)', fontSize: '14px', height: '100%', lineHeight: '24px', padding: '8px' }, '.cm-gutters': { backgroundColor: 'var(--vp-code-block-bg)', border: 'none', borderBottomLeftRadius: '8px', borderRight: '1px solid var(--vp-code-block-divider-color)', borderTopLeftRadius: '8px', color: 'var(--vp-code-line-number-color)', minWidth: '32px' }, '.cm-gutters .cm-gutterElement': { textAlign: 'center' }, '.cm-lineNumbers': { alignItems: 'center', width: '100%' }, '.cm-rollup-error': { backgroundColor: 'var(--error-background)', color: 'var(--error-color)', margin: '-1px', padding: '1px' }, '.cm-rollup-warning': { backgroundColor: 'var(--warning-background)', color: 'var(--warning-color)', margin: '-1px', padding: '1px' }, '.cm-scroller': { borderBottomLeftRadius: '8px', borderBottomRightRadius: '8px', fontFamily: 'var(--vp-font-family-mono)', fontSize: '14px', fontWeight: '400', lineHeight: '24px', marginTop: '2px' } }); const highlightStyle = HighlightStyle.define([ { color: '#676E95', fontStyle: 'italic', tag: tags.comment }, { color: '#C3E88D', tag: tags.string }, { color: '#FF9CAC', tag: tags.literal }, // names { color: '#A6ACCD', tag: tags.name }, { color: '#f07178', tag: tags.variableName }, { color: '#82AAFF', tag: tags.propertyName }, // punctuation { color: '#89DDFF', tag: tags.punctuation }, { color: '#89DDFF', tag: tags.operator }, // keywords { color: '#89DDFF', tag: tags.keyword }, { color: '#C792EA', tag: tags.definitionKeyword } ]); export const createEditor = ( parent: HTMLElement, document_: string, onUpdate: ( update: ViewUpdate & { changedRanges: { fromA: number; fromB: number; toA: number; toB: number; }[]; } ) => void, readonly: boolean ) => new EditorView({ doc: document_, extensions: [ lineNumbers(), history(), dropCursor(), indentOnInput(), syntaxHighlighting(highlightStyle, { fallback: true }), closeBrackets(), keymap.of([...closeBracketsKeymap, ...defaultKeymap, ...historyKeymap]), javascript(), EditorState.readOnly.of(readonly), EditorView.lineWrapping, EditorState.tabSize.of(2), EditorView.updateListener.of(onUpdate as any), warningsField, theme ], parent }); rollup-3.29.4/docs/repl/helpers/importRollup.ts000066400000000000000000000010541450520414700215440ustar00rootroot00000000000000export * from '../../../src/browser-entry'; import type * as Rollup from '../../../src/browser-entry'; let updateListener: null | ((instance: typeof Rollup) => void) = null; export const onUpdate = (listener: (instance: typeof Rollup) => void) => { updateListener = listener; }; if (import.meta.hot) { // This will enable HMR for any changes within the Rollup sources import.meta.hot.accept(newModule => { if (newModule && updateListener) { newModule.onUpdate(updateListener); updateListener(newModule as unknown as typeof Rollup); } }); } rollup-3.29.4/docs/repl/helpers/messages.ts000066400000000000000000000002031450520414700206360ustar00rootroot00000000000000export function getFileNameFromMessage({ id, loc }: { id?: string; loc?: { file?: string } }) { return (loc && loc.file) || id; } rollup-3.29.4/docs/repl/helpers/path.ts000066400000000000000000000034361450520414700177760ustar00rootroot00000000000000export const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/; export const relativePath = /^\.?\.\//; export function isAbsolute(path: string) { return absolutePath.test(path); } export function isRelative(path: string) { return relativePath.test(path); } export function basename(path: string) { return path.split(/(\/|\\)/).pop(); } export function dirname(path: string) { const match = /([/\\])[^/\\]*$/.exec(path); if (!match) return '.'; const directory = path.slice(0, -match[0].length); // If `dir` is the empty string, we're at root. return directory || '/'; } export function extname(path: string) { const match = /\.[^.]+$/.exec(basename(path)!); if (!match) return ''; return match[0]; } export function relative(from: string, to: string) { const fromParts = from.split(/[/\\]/).filter(Boolean); const toParts = to.split(/[/\\]/).filter(Boolean); while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) { fromParts.shift(); toParts.shift(); } while (toParts[0] === '.' || toParts[0] === '..') { const toPart = toParts.shift(); if (toPart === '..') { fromParts.pop(); } } while (fromParts.pop()) { toParts.unshift('..'); } return toParts.join('/'); } const ANY_SLASH_REGEX = /[/\\]/; const TRAILING_SLASH_REGEX = /[/\\]$/; export function resolve(...paths: string[]) { let resolvedParts = paths.shift()!.replace(TRAILING_SLASH_REGEX, '').split(ANY_SLASH_REGEX); for (const path of paths) { const parts = path.replace(TRAILING_SLASH_REGEX, '').split(ANY_SLASH_REGEX); if (isAbsolute(path)) { resolvedParts = parts; } else { while (parts[0] === '.' || parts[0] === '..') { const part = parts.shift(); if (part === '..') { resolvedParts.pop(); } } resolvedParts.push(...parts); } } return resolvedParts.join('/'); } rollup-3.29.4/docs/repl/helpers/query.ts000066400000000000000000000072151450520414700202060ustar00rootroot00000000000000import { watch } from 'vue'; import type { OutputOptions, RollupOptions } from '../../../src/rollup/types'; import type { Module } from '../../types'; import { useModules } from '../stores/modules'; import { useOptions } from '../stores/options'; import { useRollup } from '../stores/rollup'; export async function useUpdateStoresFromQuery() { // Necessary for SSR if (typeof window === 'undefined') return; const modulesStore = useModules(); const optionsStore = useOptions(); const rollupStore = useRollup(); const urlParameters = new URLSearchParams(location.search); const query = Object.fromEntries(urlParameters as unknown as Iterable<[string, string]>); try { if (query.shareable) { const json = decodeURIComponent(atob(query.shareable)); const { modules: queryModules, options: queryOptions, example }: { example: string; modules: Module[]; options: RollupOptions | OutputOptions; } = JSON.parse(json); modulesStore.set(queryModules, example); optionsStore.setAll('output' in queryOptions ? queryOptions : { output: queryOptions }); } else if (query.gist) { const result = await ( await fetch(`https://api.github.com/gists/${query.gist}`, { headers: { Accept: 'application/vnd.github.v3+json' }, method: 'GET' }) ).json(); const entryModules = query.entry ? query.entry.split(',') : []; modulesStore.set( [ result.files['main.js'] || { content: '', filename: 'main.js' }, ...Object.keys(result.files) .filter(fileName => fileName !== 'main.js') .map(fileName => result.files[fileName]) ].map(module => ({ code: module.content, isEntry: entryModules.includes(module.filename), name: module.filename })), '' ); } else if (modulesStore.modules.length === 0) { modulesStore.selectExample('00'); } } catch (error) { console.error(error); modulesStore.selectExample('00'); } if (query.pr) { if (/^\d+$/.test(query.pr)) { rollupStore.requestRollup({ type: 'pr', version: query.pr }); } else { rollupStore.requestError(new Error(`Unexpected pull request number in URL: ${query.pr}`)); } } else if (import.meta.env.DEV && (query.local || !query.version)) { rollupStore.requestRollup({ type: 'local', version: undefined }); } else { if (!query.version || /^\d+\.\d+\.\d+(-\d+)?$/.test(query.version)) { rollupStore.requestRollup({ type: 'version', version: query.version }); } else { rollupStore.requestError(new Error(`Unexpected Rollup version in URL: ${query.version}`)); } } } export function useSyncQueryWithStores() { const modulesStore = useModules(); const optionsStore = useOptions(); const rollupStore = useRollup(); watch( [ () => modulesStore.modules, () => optionsStore.optionsObject, () => modulesStore.selectedExample, () => rollupStore.request, () => rollupStore.loaded.instance?.VERSION ], ([modules, options, selectedExample, rollupRequest, rollupVersion]) => { const parameters: Record = {}; if (rollupRequest?.type === 'pr') { parameters.pr = rollupRequest.version; } else if (import.meta.env.DEV && rollupRequest?.type === 'local') { parameters.local = 'true'; } else { const version = rollupVersion || rollupRequest?.version; if (version) { parameters.version = version; } } const json = JSON.stringify({ example: selectedExample, modules, options }); parameters.shareable = btoa(encodeURIComponent(json)); const queryString = Object.keys(parameters) .map(key => `${key}=${parameters[key]}`) .join('&'); const url = `?${queryString}`; history.replaceState({}, '', url); }, { deep: true } ); } rollup-3.29.4/docs/repl/helpers/rollupVersion.ts000066400000000000000000000004231450520414700217160ustar00rootroot00000000000000export const isRollupVersionAtLeast = (version: string, major: number, minor: number) => { if (!version) return true; const [currentMajor, currentMinor] = version.split('.').map(Number); return currentMajor > major || (currentMajor === major && currentMinor >= minor); }; rollup-3.29.4/docs/repl/images/000077500000000000000000000000001450520414700162675ustar00rootroot00000000000000rollup-3.29.4/docs/repl/images/select-arrow-dark.svg000066400000000000000000000004771450520414700223460ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/images/select-arrow.svg000066400000000000000000000004661450520414700214250ustar00rootroot00000000000000 rollup-3.29.4/docs/repl/index.md000066400000000000000000000002041450520414700164470ustar00rootroot00000000000000--- layout: home title: REPL --- rollup-3.29.4/docs/repl/stores/000077500000000000000000000000001450520414700163415ustar00rootroot00000000000000rollup-3.29.4/docs/repl/stores/currentSection.ts000066400000000000000000000004051450520414700217170ustar00rootroot00000000000000import { defineStore } from 'pinia'; import { ref } from 'vue'; export const useCurrentSection = defineStore('currentSection', () => { const section = ref(null); return { section, set(value: string) { section.value = value; } }; }); rollup-3.29.4/docs/repl/stores/drawerOpen.ts000066400000000000000000000004621450520414700210210ustar00rootroot00000000000000import { defineStore } from 'pinia'; import { ref } from 'vue'; export const useDrawerOpen = defineStore('drawerOpen', () => { const isOpen = ref(false); const toggle = () => { isOpen.value = !isOpen.value; }; const close = () => { isOpen.value = false; }; return { close, isOpen, toggle }; }); rollup-3.29.4/docs/repl/stores/modules.ts000066400000000000000000000026101450520414700203600ustar00rootroot00000000000000import examplesById from 'examples.json'; import { defineStore } from 'pinia'; import { ref, watch } from 'vue'; import type { Module } from '../../types'; import { useOptions } from './options'; const areModulesEqual = (modulesA: Module[], modulesB: Module[]) => modulesA.length === modulesB.length && modulesA.every( (module, index) => module.name === modulesB[index].name && module.code === modulesB[index].code && module.isEntry === modulesB[index].isEntry ); export const useModules = defineStore('modules', () => { const optionsStore = useOptions(); const modules = ref([]); const selectedExample = ref(null); watch( modules, modulesValue => { if ( selectedExample.value && !( examplesById[selectedExample.value] && areModulesEqual(modulesValue, examplesById[selectedExample.value].modules) ) ) { selectedExample.value = null; } }, { deep: true } ); return { modules, selectedExample, selectExample(value: string) { const { modules: exampleModules, options } = examplesById[value]; modules.value = exampleModules.map((module: Module) => ({ ...module })); selectedExample.value = value; if (options) { optionsStore.setAll(options); } }, set(newModules: Module[], newSelectedExample: string) { selectedExample.value = newSelectedExample; modules.value = newModules; } }; }); rollup-3.29.4/docs/repl/stores/options.ts000066400000000000000000000442641450520414700204160ustar00rootroot00000000000000import { defineStore } from 'pinia'; import type { Ref } from 'vue'; import { computed, ref, shallowRef, watchEffect } from 'vue'; import type { RollupOptions } from '../../../src/rollup/types'; import { useModules } from './modules'; import { useRollupOutput } from './rollupOutput'; interface BaseOptionType { available: Ref; defaultValue: T | undefined; name: string; required: Ref; type: string; value: Ref; } interface OptionTypeSelect extends BaseOptionType { options: Ref; type: 'select'; } interface OptionTypeString extends BaseOptionType { placeholder: string | null; type: 'string'; } interface OptionTypeStringMapping extends BaseOptionType> { keys: Ref; type: 'string-mapping'; } interface OptionTypeNumber extends BaseOptionType { placeholder: string | null; type: 'number'; } type OptionType = | OptionTypeSelect | OptionTypeString | OptionTypeStringMapping | OptionTypeNumber; const mapOptions = { number({ defaultValue, name, placeholder, required, value }: OptionTypeNumber) { return { name, placeholder, removable: !required.value, type: 'number', value: value.value === undefined ? defaultValue : value.value } as const; }, select({ defaultValue, name, options, required, value }: OptionTypeSelect) { return { name, options: options.value, removable: !required.value, type: 'select', value: value.value === undefined || !options.value.includes(value.value) ? defaultValue : value.value } as const; }, string({ defaultValue, name, placeholder, required, value }: OptionTypeString) { return { name, placeholder, removable: !required.value, type: 'string', value: value.value === undefined ? defaultValue : value.value } as const; }, 'string-mapping'({ defaultValue, keys, name, required, value }: OptionTypeStringMapping) { return { keys: keys.value, name, removable: !required.value, type: 'string-mapping', value: value.value === undefined ? defaultValue : value.value } as const; } }; type Option = ReturnType<(typeof mapOptions)[keyof typeof mapOptions]>; const alwaysTrue = computed(() => true); const alwaysFalse = computed(() => false); const allFormats = ['es', 'amd', 'cjs', 'iife', 'umd', 'system']; const codeSplittingFormats = ['es', 'amd', 'cjs', 'system']; const amdFormats = new Set(['amd', 'umd']); const iifeFormats = new Set(['iife', 'umd']); const interopFormats = new Set(['amd', 'cjs', 'iife', 'umd']); const isOptionShown = ({ required, available, value }: OptionType) => available.value && (required.value || value.value !== undefined); export const useOptions = defineStore('options2', () => { const rollupOutputStore = useRollupOutput(); const modulesStore = useModules(); const outputHasMultipleChunks = computed(() => rollupOutputStore.output?.output.length > 1); const isAmdFormat = computed(() => { const { value } = optionOutputFormat.value; return value != null && amdFormats.has(value); }); const isIifeFormat = computed(() => { const { value } = optionOutputFormat.value; return value != null && iifeFormats.has(value); }); const isInteropFormat = computed(() => { const { value } = optionOutputFormat.value; return value != null && interopFormats.has(value); }); const externalImports = computed(() => rollupOutputStore.output?.externalImports || []); const isTreeshakeEnabled = computed(() => [undefined, true].includes(optionTreeshake.value.value as any) ); const optionContext = getString({ defaultValue: 'undefined', name: 'context' }); const optionOutputAmdAutoId = getBoolean({ available: () => isAmdFormat.value, name: 'output.amd.autoId' }); const optionOutputAmdBasePath = getString({ available: optionOutputAmdAutoId.value, name: 'output.amd.basePath' }); const optionOutputAmdDefine = getString({ available: isAmdFormat, defaultValue: 'define', name: 'output.amd.define' }); const optionOutputAmdForceJsExtensionForImports = getBoolean({ available: isAmdFormat, name: 'output.amd.forceJsExtensionForImports' }); const optionOutputAmdId = getString({ available: () => isAmdFormat.value && !outputHasMultipleChunks.value && !optionOutputAmdAutoId.value.value, name: 'output.amd.id', placeholder: 'leave blank for anonymous module' }); const optionOutputBanner = getString({ name: 'output.banner' }); const optionOutputChunkFileNames = getString({ available: alwaysTrue, defaultValue: '[name]-[hash].js', name: 'output.chunkFileNames' }); const optionOutputCompact = getBoolean({ name: 'output.compact' }); const optionOutputDynamicImportInCjs = getBoolean({ available: () => optionOutputFormat.value.value === 'cjs', defaultValue: true, name: 'output.dynamicImportInCjs' }); const optionOutputEntryFileNames = getString({ available: alwaysTrue, defaultValue: '[name].js', name: 'output.entryFileNames' }); const optionOutputEsModule = getSelect({ available: isInteropFormat, defaultValue: 'if-default-prop', name: 'output.esModule', options: () => [false, true, 'if-default-prop'] }); const optionOutputExperimentalMinChunkSize = getNumber({ defaultValue: 0, name: 'output.experimentalMinChunkSize' }); const optionOutputExports = getSelect({ available: isInteropFormat, defaultValue: 'auto', name: 'output.exports', options: () => ['auto', 'default', 'named', 'none'] }); const optionOutputExtend = getBoolean({ available: isIifeFormat, name: 'output.extend' }); const optionOutputExternalLiveBindings = getBoolean({ available: isInteropFormat, defaultValue: true, name: 'output.externalLiveBindings' }); const optionOutputExternalImportAssertions = getBoolean({ available: () => optionOutputFormat.value.value === 'es', defaultValue: true, name: 'output.externalImportAssertions' }); const optionOutputFreeze = getBoolean({ defaultValue: true, name: 'output.freeze' }); const optionOutputFooter = getString({ name: 'output.footer' }); const optionOutputFormat = getSelect({ defaultValue: 'es', name: 'output.format', options: () => optionOutputPreserveModules.value.value === true || outputHasMultipleChunks.value ? codeSplittingFormats : allFormats, required: () => true }); const optionOutputGeneratedCodeArrowFunctions = getBoolean({ name: 'output.generatedCode.arrowFunctions' }); const optionOutputGeneratedCodeConstBindings = getBoolean({ name: 'output.generatedCode.constBindings' }); const optionOutputGeneratedCodeObjectShorthand = getBoolean({ name: 'output.generatedCode.objectShorthand' }); const optionOutputGeneratedCodePreset = getSelect({ defaultValue: null, name: 'output.generatedCode.preset', options: () => [null, 'es5', 'es2015'] }); const optionOutputGeneratedCodeReservedNamesAsProperties = getBoolean({ defaultValue: true, name: 'output.generatedCode.reservedNamesAsProps' }); const optionOutputGeneratedCodeSymbols = getBoolean({ name: 'output.generatedCode.symbols' }); const optionOutputGlobals = getStringMapping({ available: () => isIifeFormat.value && externalImports.value.length > 0, keys: externalImports, name: 'output.globals', required: () => true }); const optionOutputHoistTransitiveImports = getBoolean({ available: alwaysTrue, defaultValue: true, name: 'output.hoistTransitiveImports' }); const optionOutputIndent = getBoolean({ available: () => ['amd', 'iife', 'umd', 'system'].includes(optionOutputFormat.value.value!), defaultValue: true, name: 'output.indent' }); const optionOutputInlineDynamicImports = getBoolean({ available: () => { const modules = modulesStore.modules; if (!modules) return false; let entryPoints = 0; for (const { isEntry } of modules) { if (isEntry) { entryPoints++; if (entryPoints > 1) { return false; } } } return true; }, name: 'output.inlineDynamicImports' }); const optionOutputInterop = getSelect({ available: () => { const { value } = optionOutputFormat.value; return value != null && interopFormats.has(value); }, defaultValue: 'default', name: 'output.interop', options: () => ['compat', 'auto', 'esModule', 'default', 'defaultOnly'] }); const optionOutputIntro = getString({ name: 'output.intro' }); const optionOutputMinifyInternalExports = getBoolean({ available: alwaysTrue, name: 'output.minifyInternalExports' }); const optionOutputNoConflict = getBoolean({ available: () => optionOutputFormat.value.value === 'umd', name: 'output.noConflice' }); const optionOutputName = getString({ available: isIifeFormat, defaultValue: 'myBundle', name: 'output.name', required: () => rollupOutputStore.output.output[0]?.exports.length > 0 }); const optionOutputOutro = getString({ name: 'output.outro' }); const optionOutputPaths = getStringMapping({ available: () => externalImports.value.length > 0 && optionOutputFormat.value.value !== 'iife', keys: externalImports, name: 'output.paths' }); const optionOutputPreserveModules = getBoolean({ available: () => { const { value } = optionOutputFormat.value; return value == null || codeSplittingFormats.includes(value); }, name: 'output.preserveModules' }); const optionOutputPreserveModulesRoot = getString({ available: optionOutputPreserveModules.value, name: 'output.preserveModulesRoot' }); const optionOutputSanitizeFileName = getBoolean({ available: alwaysTrue, defaultValue: true, name: 'output.sanitizeFileName' }); const optionOutputSourcemap = getBoolean({ name: 'output.sourcemap' }); const optionOutputSourcemapBaseUrl = getString({ available: optionOutputSourcemap.value, name: 'output.sourcemapBaseUrl' }); const optionOutputSourcemapExcludeSources = getBoolean({ available: optionOutputSourcemap.value, name: 'output.sourcemapExcludeSources' }); const optionOutputSourcemapFileNames = getString({ available: alwaysTrue, defaultValue: undefined, name: 'output.sourcemapFileNames' }); const optionOutputStrict = getBoolean({ available: () => optionOutputFormat.value.value !== undefined && optionOutputFormat.value.value !== 'es', defaultValue: true, name: 'output.strict' }); const optionOutputSystemNullSetters = getBoolean({ available: () => optionOutputFormat.value.value === 'system', defaultValue: true, name: 'output.systemNullSetters' }); const optionOutputValidate = getBoolean({ name: 'output.validate' }); const optionPreserveEntrySignatures = getSelect({ available: alwaysTrue, defaultValue: 'exports-only', name: 'preserveEntrySignatures', options: () => ['strict', 'allow-extension', 'exports-only', false] }); const optionShimMissingExports = getBoolean({ defaultValue: false, name: 'shimMissingExports' }); const optionTreeshake = getSelect({ defaultValue: true, name: 'treeshake', options: () => [false, true, 'smallest', 'safest', 'recommended'] }); const optionTreeshakeAnnotations = getBoolean({ available: isTreeshakeEnabled, defaultValue: true, name: 'treeshake.annotations' }); const optionTreeshakeCorrectVariableValueBeforeDeclaration = getBoolean({ available: isTreeshakeEnabled, defaultValue: false, name: 'treeshake.correctVarValueBeforeDeclaration' }); const optionTreeshakeModuleSideEffects = getSelect({ available: isTreeshakeEnabled, defaultValue: true, name: 'treeshake.moduleSideEffects', options: () => [false, true, 'no-external'] }); const optionTreeshakePreset = getSelect({ available: isTreeshakeEnabled, defaultValue: null, name: 'treeshake.preset', options: () => [null, 'smallest', 'safest', 'recommended'] }); const optionTreeshakePropertyReadSideEffects = getSelect({ available: isTreeshakeEnabled, defaultValue: true, name: 'treeshake.propertyReadSideEffects', options: () => [false, true, 'always'] }); const optionTreeshakeTryCatchDeoptimization = getBoolean({ available: isTreeshakeEnabled, defaultValue: true, name: 'treeshake.tryCatchDeoptimization' }); const optionTreeshakeUnknownGlobalSideEffects = getBoolean({ available: isTreeshakeEnabled, defaultValue: true, name: 'treeshake.unknownGlobalSideEffects' }); const optionList: OptionType[] = [ optionContext, optionOutputAmdAutoId, optionOutputAmdBasePath, optionOutputAmdDefine, optionOutputAmdForceJsExtensionForImports, optionOutputAmdId, optionOutputBanner, optionOutputChunkFileNames, optionOutputCompact, optionOutputDynamicImportInCjs, optionOutputEntryFileNames, optionOutputEsModule, optionOutputExperimentalMinChunkSize, optionOutputExports, optionOutputExtend, optionOutputExternalLiveBindings, optionOutputExternalImportAssertions, optionOutputFreeze, optionOutputFooter, optionOutputFormat, optionOutputGeneratedCodeArrowFunctions, optionOutputGeneratedCodeConstBindings, optionOutputGeneratedCodeObjectShorthand, optionOutputGeneratedCodePreset, optionOutputGeneratedCodeReservedNamesAsProperties, optionOutputGeneratedCodeSymbols, optionOutputGlobals, optionOutputHoistTransitiveImports, optionOutputIndent, optionOutputInlineDynamicImports, optionOutputInterop, optionOutputIntro, optionOutputMinifyInternalExports, optionOutputNoConflict, optionOutputName, optionOutputOutro, optionOutputPaths, optionOutputPreserveModules, optionOutputPreserveModulesRoot, optionOutputSourcemap, optionOutputSourcemapFileNames, optionOutputSanitizeFileName, optionOutputSourcemapBaseUrl, optionOutputSourcemapExcludeSources, optionOutputStrict, optionOutputValidate, optionPreserveEntrySignatures, optionOutputSystemNullSetters, optionShimMissingExports, optionTreeshake, optionTreeshakeAnnotations, optionTreeshakeCorrectVariableValueBeforeDeclaration, optionTreeshakeModuleSideEffects, optionTreeshakePreset, optionTreeshakePropertyReadSideEffects, optionTreeshakeTryCatchDeoptimization, optionTreeshakeUnknownGlobalSideEffects ]; const options = computed(() => optionList .filter(isOptionShown) .map((option: OptionType) => mapOptions[option.type](option as any)) ); return { additionalAvailableOptions: computed(() => optionList .filter(option => option.available.value && !isOptionShown(option)) .map(({ name }) => name) ), addOption(optionName: string) { const option = optionList.find(({ name }) => name === optionName)!; option.value.value = option.defaultValue; }, options, optionsObject: getOptionsObject(options), set(name: string, value: any) { optionList.find(option => option.name === name)!.value.value = value; }, setAll(options: RollupOptions) { for (const { name, value } of optionList) { const path = name.split('.'); let key: string | undefined; let subOptions: any = options; while ((key = path.shift())) { subOptions = subOptions?.[key]; } value.value = name === 'treeshake' && typeof subOptions === 'object' ? true : subOptions; } } }; }); function getBoolean({ available, defaultValue, name }: { available?: (() => boolean) | Ref; defaultValue?: boolean; name: string; }): OptionTypeSelect { return getSelect({ available, defaultValue: defaultValue || false, name, options: () => [false, true] }); } function getSelect({ available, defaultValue, name, options, required }: { available?: (() => boolean) | Ref; defaultValue: T; name: string; options: () => T[]; required?: () => boolean; }): OptionTypeSelect { return { available: typeof available === 'function' ? computed(available) : available || alwaysTrue, defaultValue, name, options: computed(options), required: required ? computed(required) : alwaysFalse, type: 'select', value: ref(undefined) }; } function getString({ available, defaultValue, name, placeholder, required }: { available?: (() => boolean) | Ref; defaultValue?: string; name: string; placeholder?: string; required?: () => boolean; }): OptionTypeString { return { available: typeof available === 'function' ? computed(available) : available || alwaysTrue, defaultValue: defaultValue ?? '', name, placeholder: placeholder || null, required: required ? computed(required) : alwaysFalse, type: 'string', value: ref(undefined) }; } function getStringMapping({ available, keys, name, required }: { available?: () => boolean; keys: Ref; name: string; placeholder?: string; required?: () => boolean; }): OptionTypeStringMapping { return { available: available ? computed(available) : alwaysTrue, defaultValue: {}, keys, name, required: required ? computed(required) : alwaysFalse, type: 'string-mapping', value: shallowRef(undefined) }; } function getNumber({ available, defaultValue, name, placeholder, required }: { available?: (() => boolean) | Ref; defaultValue?: number; name: string; placeholder?: string; required?: () => boolean; }): OptionTypeNumber { return { available: typeof available === 'function' ? computed(available) : available || alwaysTrue, defaultValue: defaultValue ?? 0, name, placeholder: placeholder || null, required: required ? computed(required) : alwaysFalse, type: 'number', value: ref(undefined) }; } function getOptionsObject(options: Ref): Ref { let previousOptions = options.value.filter(({ value }) => value !== undefined); const result = shallowRef({}); watchEffect( () => { const filteredOptions = options.value.filter(({ value }) => value !== undefined); if ( filteredOptions.length === previousOptions.length && filteredOptions.every( ({ name, value }, index) => name === previousOptions[index].name && value === previousOptions[index].value ) ) { return; } previousOptions = filteredOptions; const object = {}; for (const { name, value } of filteredOptions) { const path = name.split('.'); const valueKey = path.pop()!; let key: string | undefined; let subOptions: any = object; while ((key = path.shift())) { // Special logic to handle treeshake option if (subOptions[key] === true) { subOptions[key] = {}; } subOptions = subOptions[key] ??= {}; } subOptions[valueKey] = value; } result.value = object; }, { flush: 'post' } ); return result; } rollup-3.29.4/docs/repl/stores/rollup.ts000066400000000000000000000054761450520414700202420ustar00rootroot00000000000000import { defineStore } from 'pinia'; import { ref } from 'vue'; import type { RollupBuild, RollupOptions } from '../../../src/rollup/types'; import type * as Rollup from '../helpers/importRollup'; import { isRollupVersionAtLeast } from '../helpers/rollupVersion'; function getRollupUrl({ type, version }: RollupRequest) { if (type === 'pr') { return `https://rollup-ci-artefacts.s3.amazonaws.com/${version}/rollup.browser.js`; } else if (version) { if (isRollupVersionAtLeast(version, 4, 0)) { return `https://unpkg.com/@rollup/browser@${version}/dist/rollup.browser.js`; } if (isRollupVersionAtLeast(version, 3, 0)) { return `https://unpkg.com/@rollup/browser@${version}`; } if (isRollupVersionAtLeast(version, 1, 0)) { return `https://unpkg.com/rollup@${version}/dist/rollup.browser.js`; } throw new Error('The REPL only supports Rollup versions >= 1.0.0.'); } return 'https://unpkg.com/@rollup/browser'; } function loadRollup(rollupRequest: RollupRequest): Promise { if (import.meta.env.DEV && rollupRequest.type === 'local') { return import('../helpers/importRollup'); } const url = getRollupUrl(rollupRequest); return new Promise((fulfil, reject) => { const script = document.createElement('script'); script.src = url; script.addEventListener('load', () => { fulfil((window as any).rollup); }); script.addEventListener('error', () => { reject( new Error( rollupRequest.type === 'pr' ? `Could not load Rollup from PR #${rollupRequest.version}.` : `Could not load Rollup from ${url}.` ) ); }); document.querySelector('head')!.append(script); }); } interface LoadedRollup { error: false; instance: { VERSION: string; rollup: (options: RollupOptions) => Promise; }; } export type RequestedRollupInstance = | LoadedRollup | { [key in keyof LoadedRollup]: key extends 'error' ? false | Error : null; }; type RollupRequest = | { type: 'version' | 'local'; version: string | undefined; } | { type: 'pr'; version: string }; export const useRollup = defineStore('rollup', () => { const loaded = ref({ error: false, instance: null }); const request = ref(null); async function requestRollup(rollupRequest: RollupRequest) { try { request.value = rollupRequest; const instance = await loadRollup(rollupRequest); if (import.meta.env.DEV) { instance.onUpdate(newInstance => { loaded.value = { error: false, instance: newInstance }; }); } loaded.value = { error: false, instance }; } catch (error) { loaded.value = { error: error as Error, instance: null }; } } function requestError(error: Error) { loaded.value = { error, instance: null }; } return { loaded, request, requestError, requestRollup }; }); rollup-3.29.4/docs/repl/stores/rollupOutput.ts000066400000000000000000000123471450520414700214560ustar00rootroot00000000000000import { defineStore } from 'pinia'; import { ref, watch } from 'vue'; import type { OutputOptions, RollupError, RollupLog, RollupOptions, RollupOutput } from '../../../src/rollup/types'; import type { Module } from '../../types'; import { getFileNameFromMessage } from '../helpers/messages'; import { dirname, resolve } from '../helpers/path'; import { useModules } from './modules'; import { useOptions } from './options'; import type { RequestedRollupInstance } from './rollup'; import { useRollup } from './rollup'; interface GeneratedRollupOutput { error: RollupError | null; externalImports: string[]; output: RollupOutput['output'] | never[]; warnings: RollupLog[]; } interface BundleRequest { modules: Module[]; options: OutputOptions; rollup: RequestedRollupInstance; setOutput(output: GeneratedRollupOutput): void; } function logWarning(message: RollupLog) { console.group(getFileNameFromMessage(message) || 'general error'); console.warn(message.stack || message.message, { ...message }); console.groupEnd(); } function hashOptionsAndRollupVersion({ options, rollup: { instance } }: BundleRequest) { return JSON.stringify({ o: options, v: instance?.VERSION }); } const LEADING_SLASH_REGEX = /^[/\\]/; async function bundle({ rollup: { instance }, modules, options, setOutput }: BundleRequest) { if (modules.length === 0 || !instance) { return; } if (import.meta.env.PROD) { console.clear(); } console.group(`running Rollup version ${instance.VERSION}`); const modulesById = new Map(); for (const module of modules) { modulesById.set(module.name, module); } const warnings: RollupLog[] = []; const externalImports = new Set(); const rollupOptions: RollupOptions = { ...options, input: modules.filter((module, index) => index === 0 || module.isEntry).map(({ name }) => name), onwarn(warning) { warnings.push(warning); logWarning(warning); }, plugins: [ { buildStart() { externalImports.clear(); }, load(id) { return (modulesById.get(id) || modulesById.get(id.replace(LEADING_SLASH_REGEX, ''))) ?.code; }, name: 'browser-resolve', resolveId(importee, importer) { if (!importer) { return resolve('/', importee); } if (importee[0] !== '.') { externalImports.add(importee); return false; } let resolved = resolve('/', dirname(importer), importee); if (modulesById.has(resolved.replace(LEADING_SLASH_REGEX, ''))) return resolved; resolved += '.js'; if (modulesById.has(resolved.replace(LEADING_SLASH_REGEX, ''))) return resolved; throw new Error(`Could not resolve '${importee}' from '${importer}'.`); } } ] }; console.log('%coptions:', 'font-weight: bold; color: blue', rollupOptions); try { const generated = await ( await instance.rollup(rollupOptions) ).generate((rollupOptions as { output?: OutputOptions }).output || {}); console.log('%coutput:', 'font-weight: bold; color: green', generated.output); setOutput({ error: null, externalImports: [...externalImports].sort((a, b) => (a < b ? -1 : 1)), output: generated.output, warnings }); } catch (error) { console.log( '%cerror:', 'font-weight: bold; color: red', error, JSON.parse(JSON.stringify(error)) ); setOutput({ error: error as Error, externalImports: [], output: [], warnings }); logWarning(error as Error); } console.groupEnd(); } export const useRollupOutput = defineStore('rollupOutput', () => { const rollupStore = useRollup(); const modulesStore = useModules(); const optionsStore = useOptions(); const output = ref({ error: null, externalImports: [], output: [], warnings: [] }); let bundleDebounceTimeout: ReturnType | undefined; let nextBundleRequest: BundleRequest | null = null; let completedRequestHash = ''; // TODO instead of debouncing we should bundle in a worker function requestBundle(bundleRequest: BundleRequest) { // We are currently bundling, queue this request for when we are done if (nextBundleRequest) { nextBundleRequest = bundleRequest; return; } // Otherwise, restart the debounce-timeout clearTimeout(bundleDebounceTimeout); if (bundleRequest.rollup.error) { bundleRequest.setOutput({ error: bundleRequest.rollup.error, externalImports: [], output: [], warnings: [] }); return; } if (!bundleRequest.rollup.instance) { return; } bundleDebounceTimeout = setTimeout( async () => { nextBundleRequest = bundleRequest; await bundle(bundleRequest); completedRequestHash = hashOptionsAndRollupVersion(bundleRequest); const currentBundleRequest = nextBundleRequest; nextBundleRequest = null; if (currentBundleRequest !== bundleRequest) { requestBundle(currentBundleRequest); } }, // Do not debounce on Rollup version or options change completedRequestHash === hashOptionsAndRollupVersion(bundleRequest) ? 100 : 0 ); } watch( [() => rollupStore.loaded, () => modulesStore.modules, () => optionsStore.optionsObject], ([rollup, modules, options]: any) => requestBundle({ modules, options, rollup, setOutput(value: GeneratedRollupOutput) { output.value = value; } }), { deep: true } ); return { output }; }); rollup-3.29.4/docs/tools/000077500000000000000000000000001450520414700152205ustar00rootroot00000000000000rollup-3.29.4/docs/tools/index.md000077500000000000000000000173171450520414700166650ustar00rootroot00000000000000--- title: Integrating Rollup With Other Tools --- # {{ $frontmatter.title }} [[toc]] ## With NPM Packages At some point, it's likely that your project will depend on packages installed from NPM into your `node_modules` folder. Unlike other bundlers such as Webpack and Browserify, Rollup doesn't know "out of the box" how to handle these dependencies - we need to add some configuration. Let's add a simple dependency called [the-answer](https://www.npmjs.com/package/the-answer), which exports the answer to the question of life, the universe and everything: ```shell npm install the-answer # or `npm i the-answer` ``` If we update our `src/main.js` file… ```js // src/main.js import answer from 'the-answer'; export default function () { console.log('the answer is ' + answer); } ``` …and run Rollup… ```shell npm run build ``` …we'll see a warning like this: ``` (!) Unresolved dependencies https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency the-answer (imported by main.js) ``` The resulting `bundle.js` will still work in Node.js, because the `import` declaration gets turned into a CommonJS `require` statement, but `the-answer` does _not_ get included in the bundle. For that, we need a plugin. ### @rollup/plugin-node-resolve The [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve) plugin teaches Rollup how to find external modules. Install it… ```shell npm install --save-dev @rollup/plugin-node-resolve ``` …and add it to your config file: ```js // rollup.config.js import resolve from '@rollup/plugin-node-resolve'; export default { input: 'src/main.js', output: { file: 'bundle.js', format: 'cjs' }, plugins: [resolve()] }; ``` This time, when you `npm run build`, no warning is emitted — the bundle contains the imported module. ### @rollup/plugin-commonjs Some libraries expose ES modules that you can import as-is — `the-answer` is one such module. But at the moment, the majority of packages on NPM are exposed as CommonJS modules instead. Until that changes, we need to convert CommonJS to ES2015 before Rollup can process them. The [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/master/packages/commonjs) plugin does exactly that. Note that most of the time `@rollup/plugin-commonjs` should go _before_ other plugins that transform your modules — this is to prevent other plugins from making changes that break the CommonJS detection. An exception for this rule is the Babel plugin, if you're using it then place it before the commonjs one. ## Peer dependencies Let's say that you're building a library that has a peer dependency, such as React or Lodash. If you set up externals as described above, your rollup will bundle _all_ imports: ```js import answer from 'the-answer'; import _ from 'lodash'; ``` You can finely tune which imports are bundled and which are treated as external. For this example, we'll treat `lodash` as external, but not `the-answer`. Here is the config file: ```js // rollup.config.js import resolve from '@rollup/plugin-node-resolve'; export default { input: 'src/main.js', output: { file: 'bundle.js', format: 'cjs' }, plugins: [ resolve({ // pass custom options to the resolve plugin moduleDirectories: ['node_modules'] }) ], // indicate which modules should be treated as external external: ['lodash'] }; ``` Voilà, `lodash` will now be treated as external, and not be bundled with your library. The `external` key accepts either an array of module names, or a function which takes the module name and returns true if it should be treated as external. For example: ```js export default { // ... external: id => /lodash/.test(id) }; ``` You might use this form if you're using [babel-plugin-lodash](https://github.com/lodash/babel-plugin-lodash) to cherry-pick `lodash` modules. In this case, Babel will convert your import statements to look like this: ```js import _merge from 'lodash/merge'; ``` The array form of `external` does not handle wildcards, so this import will only be treated as external in the functional form. ## Babel Many developers use [Babel](https://babeljs.io/) in their projects in order to use the latest JavaScript features that aren't yet supported by browsers and Node.js. The easiest way to use both Babel and Rollup is with [@rollup/plugin-babel](https://github.com/rollup/plugins/tree/master/packages/babel). First, install the plugin: ```shell npm i -D @rollup/plugin-babel @rollup/plugin-node-resolve ``` Add it to `rollup.config.js`: ```js // rollup.config.js import resolve from '@rollup/plugin-node-resolve'; import babel from '@rollup/plugin-babel'; export default { input: 'src/main.js', output: { file: 'bundle.js', format: 'cjs' }, plugins: [resolve(), babel({ babelHelpers: 'bundled' })] }; ``` Before Babel will actually compile your code, it needs to be configured. Create a new file, `src/.babelrc.json`: ```json { "presets": ["@babel/env"] } ``` We're putting our `.babelrc.json` file in `src`, rather than the project root. This allows us to have a different `.babelrc.json` for things like tests, if we need that later – See the [Babel documentation](https://babeljs.io/docs/en/config-files#project-wide-configuration) for more information on both project wide and file relative configuration. Now, before we run rollup, we need to install [`babel-core`](https://babeljs.io/docs/en/babel-core) and the [`env`](https://babeljs.io/docs/en/babel-preset-env) preset: ```shell npm i -D @babel/core @babel/preset-env ``` Running Rollup now will create a bundle - except we're not actually using any ES2015 features. Let's change that by editing `src/main.js`: ```js // src/main.js import answer from 'the-answer'; export default () => { console.log(`the answer is ${answer}`); }; ``` Run Rollup with `npm run build`, and check the bundle: ```js 'use strict'; var index = 42; var main = function () { console.log('the answer is ' + index); }; module.exports = main; ``` ## Gulp Rollup returns Promises which are understood by gulp so integration is relatively painless. The syntax is very similar to the configuration file, but the properties are split across two different operations corresponding to the [JavaScript API](../javascript-api/index.md): ```js const gulp = require('gulp'); const rollup = require('rollup'); const rollupTypescript = require('@rollup/plugin-typescript'); gulp.task('build', () => { return rollup .rollup({ input: './src/main.ts', plugins: [rollupTypescript()] }) .then(bundle => { return bundle.write({ file: './dist/library.js', format: 'umd', name: 'library', sourcemap: true }); }); }); ``` You may also use the `async/await` syntax: ```js const gulp = require('gulp'); const rollup = require('rollup'); const rollupTypescript = require('@rollup/plugin-typescript'); gulp.task('build', async function () { const bundle = await rollup.rollup({ input: './src/main.ts', plugins: [rollupTypescript()] }); await bundle.write({ file: './dist/library.js', format: 'umd', name: 'library', sourcemap: true }); }); ``` ## Deno If you like to run Rollup in Deno you can use [esm.sh](https://esm.sh/) like so: ```js import {rollup} from "https://esm.sh/rollup@2.61.1"; const bundle = await rollup({ //... ``` Alternatively you can install rollup from npm and use the [node compatibility layer](https://deno.land/std@0.110.0/node): ```js import {createRequire} from "https://deno.land/std@0.110.0/node/module.ts"; const require = createRequire(import.meta.url); const {rollup} = require("rollup"); const bundle = await rollup({ //... ``` Be sure to run deno with the `--unstable` flag. And don't forget `--allow-read` and `--allow-write` if you plan on using `bundle.write()`. rollup-3.29.4/docs/troubleshooting/000077500000000000000000000000001450520414700173075ustar00rootroot00000000000000rollup-3.29.4/docs/troubleshooting/index.md000066400000000000000000000174201450520414700207440ustar00rootroot00000000000000--- title: Troubleshooting --- # {{ $frontmatter.title }} [[toc]] If you get stuck, please try discussing the issue on the [Rollup Discord](https://is.gd/rollup_chat) or posting a question to [Stackoverflow](https://stackoverflow.com/questions/tagged/rollupjs). If you've found a bug, or Rollup can't meet your needs, please try [raising an issue](https://github.com/rollup/rollup/issues). Lastly, you may try contacting [@RollupJS](https://twitter.com/RollupJS) on Twitter. ## Avoiding `eval` You probably already know that '`eval` is evil', at least according to some people. But it's particularly harmful with Rollup, because of how it works – unlike other module bundlers, which wrap each module in a function, Rollup puts all your code in the same scope. That's more efficient, but it means that the shared scope is 'polluted' whenever you use `eval`, whereas with a different bundler, modules that _didn't_ use eval would not be polluted. A minifier can't mangle variable names in polluted code, because it can't guarantee that the code to be evaluated doesn't reference those variable names. Furthermore, **it poses a security risk** in that a malicious module could access another module's private variables with `eval('SUPER_SEKRIT')`. Luckily, unless you _really do_ intend for the evaluated code to have access to local variables (in which case you're probably doing something wrong!), you can achieve the same effect in one of two ways: ### eval2 = eval Simply 'copying' `eval` provides you with a function that does exactly the same thing, but which runs in the global scope rather than the local one: ```js var eval2 = eval; (function () { var foo = 42; eval('console.log("with eval:",foo)'); // logs 'with eval: 42' eval2('console.log("with eval2:",foo)'); // throws ReferenceError })(); ``` ### `new Function` Using the [Function constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) generates a function from the supplied string. Again, it runs in the global scope. If you need to call the function repeatedly, this is much, _much_ faster than using `eval`. ## Tree-shaking doesn't seem to be working Sometimes, you'll end up with code in your bundle that doesn't seem like it should be there. For example, if you import a utility from `lodash-es`, you might expect that you'll get the bare minimum of code necessary for that utility to work. But Rollup has to be conservative about what code it removes in order to guarantee that the end result will run correctly. If an imported module appears to have _side effects_, either on bits of the module that you're using or on the global environment, Rollup plays it safe and includes those side effects. Because static analysis in a dynamic language like JavaScript is hard, there will occasionally be false positives. Lodash is a good example of a module that _looks_ like it has lots of side effects, even in places that it doesn't. You can often mitigate those false positives by importing submodules (e.g. `import map from 'lodash-es/map'` rather than `import { map } from 'lodash-es'`). Rollup's static analysis will improve over time, but it will never be perfect in all cases – that's just JavaScript. ## Error: "[name] is not exported by [module]" Occasionally you will see an error message like this: > 'foo' is not exported by bar.js (imported by baz.js) Import declarations must have corresponding export declarations in the imported module. For example, if you have `import a from './a.js'` in a module, and a.js doesn't have an `export default` declaration, or `import {foo} from './b.js'`, and b.js doesn't export `foo`, Rollup cannot bundle the code. This error frequently occurs with CommonJS modules converted by [rollup-plugin-commonjs](https://github.com/rollup/rollup-plugin-commonjs), this package has been deprecated and is no longer maintained. Please use [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/master/packages/commonjs#custom-named-exports). ## Error: "this is undefined" In a JavaScript module, `this` is `undefined` at the top level (i.e., outside functions). Because of that, Rollup will rewrite any `this` references to `undefined` so that the resulting behaviour matches what will happen when modules are natively supported. There are occasional valid reasons for `this` to mean something else. If you're getting errors in your bundle, you can use `options.context` and `options.moduleContext` to change this behaviour. ## Warning: "Sourcemap is likely to be incorrect" You'll see this warning if you generate a sourcemap with your bundle (`sourcemap: true` or `sourcemap: 'inline'`) but you're using one or more plugins that transformed code without generating a sourcemap for the transformation. Usually, a plugin will only omit the sourcemap if it (the plugin, not the bundle) was configured with `sourcemap: false` – so all you need to do is change that. If the plugin doesn't generate a sourcemap, consider raising an issue with the plugin author. ## Warning: "Treating [module] as external dependency" Rollup will only resolve _relative_ module IDs by default. This means that an import statement like this… ```js import moment from 'moment'; ``` …won't result in `moment` being included in your bundle – instead, it will be an external dependency that is required at runtime. If that's what you want, you can suppress this warning with the `external` option, which makes your intentions explicit: ```js // rollup.config.js export default { entry: 'src/index.js', dest: 'bundle.js', format: 'cjs', external: ['moment'] // <-- suppresses the warning }; ``` If you _do_ want to include the module in your bundle, you need to tell Rollup how to find it. In most cases, this is a question of using [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve). Some modules, like `events` or `util`, are built in to Node.js. If you want to include those (for example, so that your bundle runs in the browser), you may need to include [rollup-plugin-polyfill-node](https://github.com/FredKSchott/rollup-plugin-polyfill-node). ## Error: "EMFILE: too many open files" For large projects, you may run into an EMFILE error when running Rollup in watch mode on macOS. If you experience this, disabling FSEvents may eliminate the problem: ```js // rollup.config.js export default { ..., watch: { chokidar: { useFsEvents: false } } }; ``` ## Error: JavaScript heap out of memory As Rollup needs to keep all module information in memory simultaneously to be able to analyze relevant side effects for tree-shaking, it is possible that bundling large projects reaches Node's memory limit. If this happens, it can help to increase this limit by running Rollup via ```shell node --max-old-space-size=8192 node_modules/rollup/dist/bin/rollup -c ``` increasing `--max-old-space-size` as needed. Note that this number can safely surpass your available physical memory. In that case, Node will start paging memory to disk as needed. You may reduce memory pressure by introducing code splitting by using dynamic imports, importing just specific modules rather than whole dependencies, disabling sourcemaps, or increasing the size of your swap space. ## Error: Node tried to load your configuration file as CommonJS even though it is likely an ES module By default, Rollup will use Node's native module mechanism to load your Rollup configuration. That means if you use ES imports and exports in your configuration, you either need to define `"type": "module"` in your `package.json` file or use the `.mjs` extension for your configuration. See also [Configuration Files](../command-line-interface/index.md#configuration-files) and [Caveats when using native Node ES modules](../command-line-interface/index.md#caveats-when-using-native-node-es-modules) for more information. rollup-3.29.4/docs/tsconfig.json000066400000000000000000000006271450520414700165740ustar00rootroot00000000000000{ "compilerOptions": { "module": "esnext", "target": "esnext", "moduleResolution": "node", "esModuleInterop": true, "strict": true, "skipLibCheck": true, "noUnusedLocals": true, "resolveJsonModule": true, "jsx": "preserve", "lib": ["ESNext", "DOM"], "types": ["vite/client"], "isolatedModules": true }, "exclude": ["**/node_modules/**", "**/dist/**"] } rollup-3.29.4/docs/tutorial/000077500000000000000000000000001450520414700157235ustar00rootroot00000000000000rollup-3.29.4/docs/tutorial/index.md000077500000000000000000000302461450520414700173640ustar00rootroot00000000000000--- title: Tutorial --- # {{ $frontmatter.title }} [[toc]] ## Creating Your First Bundle _Before we begin, you'll need to have [Node.js](https://nodejs.org) installed so that you can use [NPM](https://npmjs.com). You'll also need to know how to access the [command line](https://www.codecademy.com/learn/learn-the-command-line) on your machine._ The easiest way to use Rollup is via the Command Line Interface (or CLI). For now, we'll install it globally (later on we'll learn how to install it locally to your project so that your build process is portable, but don't worry about that yet). Type this into the command line: ```shell npm install rollup --global # or `npm i rollup -g` for short ``` You can now run the `rollup` command. Try it! ```shell rollup ``` Because no arguments were passed, Rollup prints usage instructions. This is the same as running `rollup --help`, or `rollup -h`. Let's create a simple project: ```shell mkdir -p my-rollup-project/src cd my-rollup-project ``` First, we need an _entry point_. Paste this into a new file called `src/main.js`: ```js // src/main.js import foo from './foo.js'; export default function () { console.log(foo); } ``` Then, let's create the `foo.js` module that our entry point imports: ```js // src/foo.js export default 'hello world!'; ``` Now we're ready to create a bundle: ```shell rollup src/main.js -f cjs ``` The `-f` option (short for `--format`) specifies what kind of bundle we're creating — in this case, CommonJS (which will run in Node.js). Because we didn't specify an output file, it will be printed straight to `stdout`: ```js 'use strict'; const foo = 'hello world!'; const main = function () { console.log(foo); }; module.exports = main; ``` You can save the bundle as a file like so: ```shell rollup src/main.js -o bundle.js -f cjs ``` (You could also do `rollup src/main.js -f cjs > bundle.js`, but as we'll see later, this is less flexible if you're generating sourcemaps.) Try running the code: ``` node > var myBundle = require('./bundle.js'); > myBundle(); 'hello world!' ``` Congratulations! You've created your first bundle with Rollup. ## Using Config Files So far, so good, but as we start adding more options it becomes a bit of a nuisance to type out the command. To save repeating ourselves, we can create a config file containing all the options we need. A config file is written in JavaScript and is more flexible than the raw CLI. Create a file in the project root called `rollup.config.mjs`, and add the following code: ```js // rollup.config.mjs export default { input: 'src/main.js', output: { file: 'bundle.js', format: 'cjs' } }; ``` (Note that you can use CJS modules and therefore `module.exports = {/* config */}`) To use the config file, we use the `--config` or `-c` flag: ```shell rm bundle.js # so we can check the command works! rollup -c ``` You can override any of the options in the config file with the equivalent command line options: ```shell rollup -c -o bundle-2.js # `-o` is equivalent to `--file` (formerly "output") ``` _Note: Rollup itself processes the config file, which is why we're able to use `export default` syntax – the code isn't being transpiled with Babel or anything similar, so you can only use ES2015 features that are supported in the version of Node.js that you're running._ You can, if you like, specify a different config file from the default `rollup.config.mjs`: ```shell rollup --config rollup.config.dev.mjs rollup --config rollup.config.prod.mjs ``` ## Installing Rollup locally When working within teams or distributed environments it can be wise to add Rollup as a _local_ dependency. Installing Rollup locally prevents the requirement that multiple contributors install Rollup separately as an extra step, and ensures that all contributors are using the same version of Rollup. To install Rollup locally with NPM: ```shell npm install rollup --save-dev ``` Or with Yarn: ```shell yarn -D add rollup ``` After installing, Rollup can be run within the root directory of your project: ```shell npx rollup --config ``` Or with Yarn: ```shell yarn rollup --config ``` Once installed, it's common practice to add a single build script to `package.json`, providing a convenient command for all contributors. e.g. ```json { "scripts": { "build": "rollup --config" } } ``` _Note: Once installed locally, both NPM and Yarn will resolve the dependency's bin file and execute Rollup when called from a package script._ ## Using plugins So far, we've created a simple bundle from an entry point and a module imported via a relative path. As you build more complex bundles, you'll often need more flexibility – importing modules installed with NPM, compiling code with Babel, working with JSON files and so on. For that, we use _plugins_, which change the behaviour of Rollup at key points in the bundling process. A list of awesome plugins is maintained on [the Rollup Awesome List](https://github.com/rollup/awesome). For this tutorial, we'll use [@rollup/plugin-json](https://github.com/rollup/plugins/tree/master/packages/json), which allows Rollup to import data from a JSON file. Create a file in the project root called `package.json`, and add the following content: ```json { "name": "rollup-tutorial", "version": "1.0.0", "scripts": { "build": "rollup -c" } } ``` Install @rollup/plugin-json as a development dependency: ```shell npm install --save-dev @rollup/plugin-json ``` (We're using `--save-dev` rather than `--save` because our code doesn't actually depend on the plugin when it runs – only when we're building the bundle.) Update your `src/main.js` file so that it imports from your package.json instead of `src/foo.js`: ```js // src/main.js import { version } from '../package.json'; export default function () { console.log('version ' + version); } ``` Edit your `rollup.config.mjs` file to include the JSON plugin: ```js // rollup.config.mjs import json from '@rollup/plugin-json'; export default { input: 'src/main.js', output: { file: 'bundle.js', format: 'cjs' }, plugins: [json()] }; ``` Run Rollup with `npm run build`. The result should look like this: ```js 'use strict'; var version = '1.0.0'; function main() { console.log('version ' + version); } module.exports = main; ``` _Note: Only the data we actually need gets imported – `name` and `devDependencies` and other parts of `package.json` are ignored. That's **tree-shaking** in action._ ## Using output plugins Some plugins can also be applied specifically to some outputs. See [plugin hooks](../plugin-development/index.md#build-hooks) for the technical details of what output-specific plugins can do. In a nut-shell, those plugins can only modify code after the main analysis of Rollup has completed. Rollup will warn if an incompatible plugin is used as an output-specific plugin. One possible use-case is minification of bundles to be consumed in a browser. Let us extend the previous example to provide a minified build together with the non-minified one. To that end, we install `@rollup/plugin-terser`: ```shell npm install --save-dev @rollup/plugin-terser ``` Edit your `rollup.config.mjs` file to add a second minified output. As format, we choose `iife`. This format wraps the code so that it can be consumed via a `script` tag in the browser while avoiding unwanted interactions with other code. As we have an export, we need to provide the name of a global variable that will be created by our bundle so that other code can access our export via this variable. ```js // rollup.config.mjs import json from '@rollup/plugin-json'; import terser from '@rollup/plugin-terser'; export default { input: 'src/main.js', output: [ { file: 'bundle.js', format: 'cjs' }, { file: 'bundle.min.js', format: 'iife', name: 'version', plugins: [terser()] } ], plugins: [json()] }; ``` Besides `bundle.js`, Rollup will now create a second file `bundle.min.js`: ```js var version = (function () { 'use strict'; var n = '1.0.0'; return function () { console.log('version ' + n); }; })(); ``` ## Code Splitting For code splitting, there are cases where Rollup splits code into chunks automatically, like dynamic loading or multiple entry points, and there is a way to explicitly tell Rollup which modules to split into separate chunks via the [`output.manualChunks`](../configuration-options/index.md#output-manualchunks) option. To use the code splitting feature to achieve the lazy dynamic loading (where some imported module(s) is only loaded after executing a function), we go back to the original example and modify `src/main.js` to load `src/foo.js` dynamically instead of statically: ```js // src/main.js export default function () { import('./foo.js').then(({ default: foo }) => console.log(foo)); } ``` Rollup will use the dynamic import to create a separate chunk that is only loaded on demand. In order for Rollup to know where to place the second chunk, instead of passing the `--file` option we set a folder to output to with the `--dir` option: ```shell rollup src/main.js -f cjs -d dist ``` This will create a folder `dist` containing two files, `main.js` and `chunk-[hash].js`, where `[hash]` is a content based hash string. You can supply your own naming patterns by specifying the [`output.chunkFileNames`](../configuration-options/index.md#output-chunkfilenames) and [`output.entryFileNames`](../configuration-options/index.md#output-entryfilenames) options. You can still run your code as before with the same output, albeit a little slower as loading and parsing of `./foo.js` will only commence once we call the exported function for the first time. ```shell node -e "require('./dist/main.js')()" ``` If we do not use the `--dir` option, Rollup will again print the chunks to `stdout`, adding comments to highlight the chunk boundaries: ```js //→ main.js: 'use strict'; function main() { Promise.resolve(require('./chunk-b8774ea3.js')).then(({ default: foo }) => console.log(foo) ); } module.exports = main; //→ chunk-b8774ea3.js: ('use strict'); var foo = 'hello world!'; exports.default = foo; ``` This is useful if you want to load and parse expensive features only once they are used. A different use for code-splitting is the ability to specify several entry points that share some dependencies. Again we extend our example to add a second entry point `src/main2.js` that statically imports `src/foo.js` just like we did in the original example: ```js // src/main2.js import foo from './foo.js'; export default function () { console.log(foo); } ``` If we supply both entry points to rollup, three chunks are created: ```shell rollup src/main.js src/main2.js -f cjs ``` will output ```js //→ main.js: 'use strict'; function main() { Promise.resolve(require('./chunk-b8774ea3.js')).then(({ default: foo }) => console.log(foo) ); } module.exports = main; //→ main2.js: ('use strict'); var foo_js = require('./chunk-b8774ea3.js'); function main2() { console.log(foo_js.default); } module.exports = main2; //→ chunk-b8774ea3.js: ('use strict'); var foo = 'hello world!'; exports.default = foo; ``` Notice how both entry points import the same shared chunk. Rollup will never duplicate code and instead create additional chunks to only ever load the bare minimum necessary. Again, passing the `--dir` option will write the files to disk. You can build the same code for the browser via native ES modules, an AMD loader or SystemJS. For example, with `-f es` for native modules: ```shell rollup src/main.js src/main2.js -f es -d dist ``` ```html ``` Or alternatively, for SystemJS with `-f system`: ```shell rollup src/main.js src/main2.js -f system -d dist ``` Install SystemJS via ```shell npm install --save-dev systemjs ``` And then load either or both entry points in an HTML page as needed: ```html ``` See [rollup-starter-code-splitting](https://github.com/rollup/rollup-starter-code-splitting) for an example on how to set up a web app that uses native ES modules on browsers that support them with a fallback to SystemJS if necessary. rollup-3.29.4/docs/types.d.ts000066400000000000000000000003631450520414700160200ustar00rootroot00000000000000import type { RollupOptions } from '../../src/rollup/types'; export interface Module { code: string; isEntry: boolean; name: string; } export interface Example { id: string; modules: Module[]; options: RollupOptions; title: string; } rollup-3.29.4/markdownlint.json000066400000000000000000000000671450520414700165370ustar00rootroot00000000000000{ "default": false, "blanks-around-fences": true } rollup-3.29.4/package-lock.json000066400000000000000000013472211450520414700163560ustar00rootroot00000000000000{ "name": "rollup", "version": "3.29.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", "version": "3.29.4", "license": "MIT", "bin": { "rollup": "dist/bin/rollup" }, "devDependencies": { "@codemirror/commands": "^6.2.5", "@codemirror/lang-javascript": "^6.2.1", "@codemirror/language": "^6.9.0", "@codemirror/search": "^6.5.3", "@codemirror/state": "^6.2.1", "@codemirror/view": "^6.19.0", "@jridgewell/sourcemap-codec": "^1.4.15", "@mermaid-js/mermaid-cli": "^10.4.0", "@rollup/plugin-alias": "^5.0.0", "@rollup/plugin-buble": "^1.0.2", "@rollup/plugin-commonjs": "^25.0.4", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.2.1", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-terser": "^0.4.3", "@rollup/plugin-typescript": "11.1.2", "@rollup/pluginutils": "^5.0.4", "@types/estree": "1.0.1", "@types/mocha": "^10.0.1", "@types/node": "~14.18.61", "@types/yargs-parser": "^21.0.0", "@typescript-eslint/eslint-plugin": "^6.7.2", "@typescript-eslint/parser": "^6.7.2", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "acorn": "^8.10.0", "acorn-import-assertions": "^1.9.0", "acorn-jsx": "^5.3.2", "acorn-walk": "^8.2.0", "buble": "^0.20.0", "builtin-modules": "^3.3.0", "chokidar": "^3.5.3", "colorette": "^2.0.20", "concurrently": "^8.2.1", "core-js": "^3.32.2", "date-time": "^4.0.0", "es5-shim": "^4.6.7", "es6-shim": "^0.35.8", "eslint": "^8.49.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.28.1", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-unicorn": "^48.0.1", "eslint-plugin-vue": "^9.17.0", "fixturify": "^3.0.0", "flru": "^1.0.2", "fs-extra": "^11.1.1", "github-api": "^3.4.0", "hash.js": "^1.1.7", "husky": "^8.0.3", "inquirer": "^9.2.11", "is-reference": "^3.0.2", "lint-staged": "^14.0.1", "locate-character": "^3.0.0", "magic-string": "^0.30.3", "mocha": "^10.2.0", "nyc": "^15.1.0", "pinia": "^2.1.6", "prettier": "^3.0.3", "pretty-bytes": "^6.1.1", "pretty-ms": "^8.0.0", "requirejs": "^2.3.6", "rollup": "^3.29.2", "rollup-plugin-license": "^3.1.0", "rollup-plugin-string": "^3.0.0", "rollup-plugin-thatworks": "^1.0.4", "semver": "^7.5.4", "shx": "^0.3.4", "signal-exit": "^4.1.0", "source-map": "^0.7.4", "source-map-support": "^0.5.21", "systemjs": "^6.14.2", "terser": "^5.19.4", "tslib": "^2.6.2", "typescript": "^5.2.2", "vite": "^4.4.9", "vitepress": "^1.0.0-rc.14", "vue": "^3.3.4", "weak-napi": "^2.0.2", "yargs-parser": "^21.1.1" }, "engines": { "node": ">=14.18.0", "npm": ">=8.0.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/@algolia/autocomplete-core": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz", "integrity": "sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==", "dev": true, "dependencies": { "@algolia/autocomplete-plugin-algolia-insights": "1.9.3", "@algolia/autocomplete-shared": "1.9.3" } }, "node_modules/@algolia/autocomplete-plugin-algolia-insights": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.9.3.tgz", "integrity": "sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==", "dev": true, "dependencies": { "@algolia/autocomplete-shared": "1.9.3" }, "peerDependencies": { "search-insights": ">= 1 < 3" } }, "node_modules/@algolia/autocomplete-preset-algolia": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.9.3.tgz", "integrity": "sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==", "dev": true, "dependencies": { "@algolia/autocomplete-shared": "1.9.3" }, "peerDependencies": { "@algolia/client-search": ">= 4.9.1 < 6", "algoliasearch": ">= 4.9.1 < 6" } }, "node_modules/@algolia/autocomplete-shared": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.9.3.tgz", "integrity": "sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==", "dev": true, "peerDependencies": { "@algolia/client-search": ">= 4.9.1 < 6", "algoliasearch": ">= 4.9.1 < 6" } }, "node_modules/@algolia/cache-browser-local-storage": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.20.0.tgz", "integrity": "sha512-uujahcBt4DxduBTvYdwO3sBfHuJvJokiC3BP1+O70fglmE1ShkH8lpXqZBac1rrU3FnNYSUs4pL9lBdTKeRPOQ==", "dev": true, "dependencies": { "@algolia/cache-common": "4.20.0" } }, "node_modules/@algolia/cache-common": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.20.0.tgz", "integrity": "sha512-vCfxauaZutL3NImzB2G9LjLt36vKAckc6DhMp05An14kVo8F1Yofb6SIl6U3SaEz8pG2QOB9ptwM5c+zGevwIQ==", "dev": true }, "node_modules/@algolia/cache-in-memory": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.20.0.tgz", "integrity": "sha512-Wm9ak/IaacAZXS4mB3+qF/KCoVSBV6aLgIGFEtQtJwjv64g4ePMapORGmCyulCFwfePaRAtcaTbMcJF+voc/bg==", "dev": true, "dependencies": { "@algolia/cache-common": "4.20.0" } }, "node_modules/@algolia/client-account": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.20.0.tgz", "integrity": "sha512-GGToLQvrwo7am4zVkZTnKa72pheQeez/16sURDWm7Seyz+HUxKi3BM6fthVVPUEBhtJ0reyVtuK9ArmnaKl10Q==", "dev": true, "dependencies": { "@algolia/client-common": "4.20.0", "@algolia/client-search": "4.20.0", "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-analytics": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.20.0.tgz", "integrity": "sha512-EIr+PdFMOallRdBTHHdKI3CstslgLORQG7844Mq84ib5oVFRVASuuPmG4bXBgiDbcsMLUeOC6zRVJhv1KWI0ug==", "dev": true, "dependencies": { "@algolia/client-common": "4.20.0", "@algolia/client-search": "4.20.0", "@algolia/requester-common": "4.20.0", "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-common": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.20.0.tgz", "integrity": "sha512-P3WgMdEss915p+knMMSd/fwiHRHKvDu4DYRrCRaBrsfFw7EQHon+EbRSm4QisS9NYdxbS04kcvNoavVGthyfqQ==", "dev": true, "dependencies": { "@algolia/requester-common": "4.20.0", "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-personalization": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.20.0.tgz", "integrity": "sha512-N9+zx0tWOQsLc3K4PVRDV8GUeOLAY0i445En79Pr3zWB+m67V+n/8w4Kw1C5LlbHDDJcyhMMIlqezh6BEk7xAQ==", "dev": true, "dependencies": { "@algolia/client-common": "4.20.0", "@algolia/requester-common": "4.20.0", "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/client-search": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.20.0.tgz", "integrity": "sha512-zgwqnMvhWLdpzKTpd3sGmMlr4c+iS7eyyLGiaO51zDZWGMkpgoNVmltkzdBwxOVXz0RsFMznIxB9zuarUv4TZg==", "dev": true, "dependencies": { "@algolia/client-common": "4.20.0", "@algolia/requester-common": "4.20.0", "@algolia/transporter": "4.20.0" } }, "node_modules/@algolia/logger-common": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.20.0.tgz", "integrity": "sha512-xouigCMB5WJYEwvoWW5XDv7Z9f0A8VoXJc3VKwlHJw/je+3p2RcDXfksLI4G4lIVncFUYMZx30tP/rsdlvvzHQ==", "dev": true }, "node_modules/@algolia/logger-console": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.20.0.tgz", "integrity": "sha512-THlIGG1g/FS63z0StQqDhT6bprUczBI8wnLT3JWvfAQDZX5P6fCg7dG+pIrUBpDIHGszgkqYEqECaKKsdNKOUA==", "dev": true, "dependencies": { "@algolia/logger-common": "4.20.0" } }, "node_modules/@algolia/requester-browser-xhr": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.20.0.tgz", "integrity": "sha512-HbzoSjcjuUmYOkcHECkVTwAelmvTlgs48N6Owt4FnTOQdwn0b8pdht9eMgishvk8+F8bal354nhx/xOoTfwiAw==", "dev": true, "dependencies": { "@algolia/requester-common": "4.20.0" } }, "node_modules/@algolia/requester-common": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.20.0.tgz", "integrity": "sha512-9h6ye6RY/BkfmeJp7Z8gyyeMrmmWsMOCRBXQDs4mZKKsyVlfIVICpcSibbeYcuUdurLhIlrOUkH3rQEgZzonng==", "dev": true }, "node_modules/@algolia/requester-node-http": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.20.0.tgz", "integrity": "sha512-ocJ66L60ABSSTRFnCHIEZpNHv6qTxsBwJEPfYaSBsLQodm0F9ptvalFkHMpvj5DfE22oZrcrLbOYM2bdPJRHng==", "dev": true, "dependencies": { "@algolia/requester-common": "4.20.0" } }, "node_modules/@algolia/transporter": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.20.0.tgz", "integrity": "sha512-Lsii1pGWOAISbzeyuf+r/GPhvHMPHSPrTDWNcIzOE1SG1inlJHICaVe2ikuoRjcpgxZNU54Jl+if15SUCsaTUg==", "dev": true, "dependencies": { "@algolia/cache-common": "4.20.0", "@algolia/logger-common": "4.20.0", "@algolia/requester-common": "4.20.0" } }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/code-frame": { "version": "7.22.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { "@babel/highlight": "^7.22.13", "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/code-frame/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "dependencies": { "color-convert": "^1.9.0" }, "engines": { "node": ">=4" } }, "node_modules/@babel/code-frame/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" }, "engines": { "node": ">=4" } }, "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/@babel/code-frame/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/@babel/code-frame/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { "has-flag": "^3.0.0" }, "engines": { "node": ">=4" } }, "node_modules/@babel/compat-data": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz", "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.20.tgz", "integrity": "sha512-Y6jd1ahLubuYweD/zJH+vvOY141v4f9igNQAQ+MBgq9JlHS2iTsZKn1aMsb3vGccZsXI16VzTBw52Xx0DWmtnA==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.22.13", "@babel/generator": "^7.22.15", "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-module-transforms": "^7.22.20", "@babel/helpers": "^7.22.15", "@babel/parser": "^7.22.16", "@babel/template": "^7.22.15", "@babel/traverse": "^7.22.20", "@babel/types": "^7.22.19", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/babel" } }, "node_modules/@babel/generator": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz", "integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==", "dev": true, "dependencies": { "@babel/types": "^7.22.15", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/generator/node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, "bin": { "jsesc": "bin/jsesc" }, "engines": { "node": ">=4" } }, "node_modules/@babel/helper-compilation-targets": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", "dev": true, "dependencies": { "@babel/compat-data": "^7.22.9", "@babel/helper-validator-option": "^7.22.15", "browserslist": "^4.21.9", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "dependencies": { "@babel/template": "^7.22.5", "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", "dev": true, "dependencies": { "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.20.tgz", "integrity": "sha512-dLT7JVWIUUxKOs1UnJUBR3S70YK+pKX6AbJgB2vMIvEkZkrfJDbYDJesnPshtKV4LhDOR3Oc5YULeDizRek+5A==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", "@babel/helper-simple-access": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-simple-access": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.22.6", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.15.tgz", "integrity": "sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==", "dev": true, "dependencies": { "@babel/template": "^7.22.15", "@babel/traverse": "^7.22.15", "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "dependencies": { "color-convert": "^1.9.0" }, "engines": { "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" }, "engines": { "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { "has-flag": "^3.0.0" }, "engines": { "node": ">=4" } }, "node_modules/@babel/parser": { "version": "7.22.16", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", "dev": true, "bin": { "parser": "bin/babel-parser.js" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/runtime": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/parser": "^7.22.15", "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.20.tgz", "integrity": "sha512-eU260mPZbU7mZ0N+X10pxXhQFMGTeLb9eFS0mxehS8HZp9o1uSnFeWQuG1UPrlxgA7QoUzFhOnilHDp0AXCyHw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/generator": "^7.22.15", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.22.5", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", "@babel/parser": "^7.22.16", "@babel/types": "^7.22.19", "debug": "^4.1.0", "globals": "^11.1.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse/node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/@babel/types": { "version": "7.22.19", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.19.tgz", "integrity": "sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.19", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@codemirror/autocomplete": { "version": "6.9.1", "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.9.1.tgz", "integrity": "sha512-yma56tqD7khIZK4gy4X5lX3/k5ArMiCGat7HEWRF/8L2kqOjVdp2qKZqpcJjwTIjSj6fqKAHqi7IjtH3QFE+Bw==", "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.17.0", "@lezer/common": "^1.0.0" }, "peerDependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", "@lezer/common": "^1.0.0" } }, "node_modules/@codemirror/commands": { "version": "6.2.5", "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.5.tgz", "integrity": "sha512-dSi7ow2P2YgPBZflR9AJoaTHvqmeGIgkhignYMd5zK5y6DANTvxKxp6eMEpIDUJkRAaOY/TFZ4jP1ADIO/GLVA==", "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.2.0", "@codemirror/view": "^6.0.0", "@lezer/common": "^1.0.0" } }, "node_modules/@codemirror/lang-javascript": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.1.tgz", "integrity": "sha512-jlFOXTejVyiQCW3EQwvKH0m99bUYIw40oPmFjSX2VS78yzfe0HELZ+NEo9Yfo1MkGRpGlj3Gnu4rdxV1EnAs5A==", "dev": true, "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/language": "^6.6.0", "@codemirror/lint": "^6.0.0", "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.17.0", "@lezer/common": "^1.0.0", "@lezer/javascript": "^1.0.0" } }, "node_modules/@codemirror/language": { "version": "6.9.1", "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.1.tgz", "integrity": "sha512-lWRP3Y9IUdOms6DXuBpoWwjkR7yRmnS0hKYCbSfPz9v6Em1A1UCRujAkDiCrdYfs1Z0Eu4dGtwovNPStIfkgNA==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", "@lezer/common": "^1.1.0", "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.0.0", "style-mod": "^4.0.0" } }, "node_modules/@codemirror/lint": { "version": "6.4.2", "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.2.tgz", "integrity": "sha512-wzRkluWb1ptPKdzlsrbwwjYCPLgzU6N88YBAmlZi8WFyuiEduSd05MnJYNogzyc8rPK7pj6m95ptUApc8sHKVA==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", "crelt": "^1.0.5" } }, "node_modules/@codemirror/search": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.4.tgz", "integrity": "sha512-YoTrvjv9e8EbPs58opjZKyJ3ewFrVSUzQ/4WXlULQLSDDr1nGPJ67mMXFNNVYwdFhybzhrzrtqgHmtpJwIF+8g==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", "crelt": "^1.0.5" } }, "node_modules/@codemirror/state": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.2.1.tgz", "integrity": "sha512-RupHSZ8+OjNT38zU9fKH2sv+Dnlr8Eb8sl4NOnnqz95mCFTZUaiRP8Xv5MeeaG0px2b8Bnfe7YGwCV3nsBhbuw==", "dev": true }, "node_modules/@codemirror/view": { "version": "6.20.0", "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.20.0.tgz", "integrity": "sha512-N+lSr/UybTnSnvSLjzbAWe600x3DhBj3Lerk/BMllB6wDMzgW6OgNI/5eOGnbBAwY8lxxyHQmv/R5ER35nlVmg==", "dev": true, "dependencies": { "@codemirror/state": "^6.1.4", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "node_modules/@docsearch/css": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.5.2.tgz", "integrity": "sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==", "dev": true }, "node_modules/@docsearch/js": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/@docsearch/js/-/js-3.5.2.tgz", "integrity": "sha512-p1YFTCDflk8ieHgFJYfmyHBki1D61+U9idwrLh+GQQMrBSP3DLGKpy0XUJtPjAOPltcVbqsTjiPFfH7JImjUNg==", "dev": true, "dependencies": { "@docsearch/react": "3.5.2", "preact": "^10.0.0" } }, "node_modules/@docsearch/react": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.5.2.tgz", "integrity": "sha512-9Ahcrs5z2jq/DcAvYtvlqEBHImbm4YJI8M9y0x6Tqg598P40HTEkX7hsMcIuThI+hTFxRGZ9hll0Wygm2yEjng==", "dev": true, "dependencies": { "@algolia/autocomplete-core": "1.9.3", "@algolia/autocomplete-preset-algolia": "1.9.3", "@docsearch/css": "3.5.2", "algoliasearch": "^4.19.1" }, "peerDependencies": { "@types/react": ">= 16.8.0 < 19.0.0", "react": ">= 16.8.0 < 19.0.0", "react-dom": ">= 16.8.0 < 19.0.0", "search-insights": ">= 1 < 3" }, "peerDependenciesMeta": { "@types/react": { "optional": true }, "react": { "optional": true }, "react-dom": { "optional": true }, "search-insights": { "optional": true } } }, "node_modules/@esbuild/android-arm": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", "cpu": [ "arm" ], "dev": true, "optional": true, "os": [ "android" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/android-arm64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", "cpu": [ "arm64" ], "dev": true, "optional": true, "os": [ "android" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/android-x64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ "android" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/darwin-arm64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "cpu": [ "arm64" ], "dev": true, "optional": true, "os": [ "darwin" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/darwin-x64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ "darwin" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/freebsd-arm64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", "cpu": [ "arm64" ], "dev": true, "optional": true, "os": [ "freebsd" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/freebsd-x64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ "freebsd" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-arm": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", "cpu": [ "arm" ], "dev": true, "optional": true, "os": [ "linux" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-arm64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", "cpu": [ "arm64" ], "dev": true, "optional": true, "os": [ "linux" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-ia32": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", "cpu": [ "ia32" ], "dev": true, "optional": true, "os": [ "linux" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-loong64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", "cpu": [ "loong64" ], "dev": true, "optional": true, "os": [ "linux" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-mips64el": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", "cpu": [ "mips64el" ], "dev": true, "optional": true, "os": [ "linux" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-ppc64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", "cpu": [ "ppc64" ], "dev": true, "optional": true, "os": [ "linux" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-riscv64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", "cpu": [ "riscv64" ], "dev": true, "optional": true, "os": [ "linux" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-s390x": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", "cpu": [ "s390x" ], "dev": true, "optional": true, "os": [ "linux" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/linux-x64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ "linux" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/netbsd-x64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ "netbsd" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/openbsd-x64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ "openbsd" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/sunos-x64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ "sunos" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/win32-arm64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", "cpu": [ "arm64" ], "dev": true, "optional": true, "os": [ "win32" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/win32-ia32": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", "cpu": [ "ia32" ], "dev": true, "optional": true, "os": [ "win32" ], "engines": { "node": ">=12" } }, "node_modules/@esbuild/win32-x64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ "win32" ], "engines": { "node": ">=12" } }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "node_modules/@eslint-community/regexpp": { "version": "4.8.1", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.1.tgz", "integrity": "sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint/js": { "version": "8.49.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.11", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "engines": { "node": ">=12.22" }, "funding": { "type": "github", "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" }, "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { "p-locate": "^4.1.0" }, "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { "p-try": "^2.0.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { "p-limit": "^2.2.0" }, "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.19", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@lezer/common": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.0.tgz", "integrity": "sha512-XPIN3cYDXsoJI/oDWoR2tD++juVrhgIago9xyKhZ7IhGlzdDM9QgC8D8saKNCz5pindGcznFr2HBSsEQSWnSjw==", "dev": true }, "node_modules/@lezer/highlight": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.1.6.tgz", "integrity": "sha512-cmSJYa2us+r3SePpRCjN5ymCqCPv+zyXmDl0ciWtVaNiORT/MxM7ZgOMQZADD0o51qOaOg24qc/zBViOIwAjJg==", "dev": true, "dependencies": { "@lezer/common": "^1.0.0" } }, "node_modules/@lezer/javascript": { "version": "1.4.7", "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.7.tgz", "integrity": "sha512-OVWlK0YEi7HM+9JRWtRkir8qvcg0/kVYg2TAMHlVtl6DU1C9yK1waEOLBMztZsV/axRJxsqfJKhzYz+bxZme5g==", "dev": true, "dependencies": { "@lezer/highlight": "^1.1.3", "@lezer/lr": "^1.3.0" } }, "node_modules/@lezer/lr": { "version": "1.3.11", "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.11.tgz", "integrity": "sha512-W7IZXXyi6BfVredTDk3jHe1V6zUcdjRcUlvTsrWGOvIOU2eg3sfEDtTDFHo1TRxZhtQGX1EyHHUXoXvJNSxcnA==", "dev": true, "dependencies": { "@lezer/common": "^1.0.0" } }, "node_modules/@ljharb/through": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.9.tgz", "integrity": "sha512-yN599ZBuMPPK4tdoToLlvgJB4CLK8fGl7ntfy0Wn7U6ttNvHYurd81bfUiK/6sMkiIwm65R6ck4L6+Y3DfVbNQ==", "dev": true, "engines": { "node": ">= 0.4" } }, "node_modules/@mermaid-js/mermaid-cli": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/@mermaid-js/mermaid-cli/-/mermaid-cli-10.4.0.tgz", "integrity": "sha512-sXohfGD6xgR8VEKvLdvSCndFaFNVTlyXjgZlJ3x8U3/J0V2VTfLIZO94Gt8KUPUccFWci8dRYDGG0fQerB+aIA==", "dev": true, "dependencies": { "chalk": "^5.0.1", "commander": "^10.0.0", "puppeteer": "^19.0.0" }, "bin": { "mmdc": "src/cli.js" }, "engines": { "node": "^14.13 || >=16.0" } }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" }, "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" }, "engines": { "node": ">= 8" } }, "node_modules/@pkgr/utils": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "fast-glob": "^3.3.0", "is-glob": "^4.0.3", "open": "^9.1.0", "picocolors": "^1.0.0", "tslib": "^2.6.0" }, "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/unts" } }, "node_modules/@puppeteer/browsers": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-0.5.0.tgz", "integrity": "sha512-Uw6oB7VvmPRLE4iKsjuOh8zgDabhNX67dzo8U/BB0f9527qx+4eeUs+korU98OhG5C4ubg7ufBgVi63XYwS6TQ==", "dev": true, "dependencies": { "debug": "4.3.4", "extract-zip": "2.0.1", "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", "tar-fs": "2.1.1", "unbzip2-stream": "1.4.3", "yargs": "17.7.1" }, "bin": { "browsers": "lib/cjs/main-cli.js" }, "engines": { "node": ">=14.1.0" }, "peerDependencies": { "typescript": ">= 4.7.4" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@puppeteer/browsers/node_modules/yargs": { "version": "17.7.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz", "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==", "dev": true, "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" }, "engines": { "node": ">=12" } }, "node_modules/@rollup/plugin-alias": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.0.0.tgz", "integrity": "sha512-l9hY5chSCjuFRPsnRm16twWBiSApl2uYFLsepQYwtBuAxNMQ/1dJqADld40P0Jkqm65GRTLy/AC6hnpVebtLsA==", "dev": true, "dependencies": { "slash": "^4.0.0" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@rollup/plugin-buble": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-1.0.2.tgz", "integrity": "sha512-Hz9+AigRWwS93vmorrVrhyG9SdSCZAkBDx614w09iFQYFUAP2HmdUrQyZsb1WO2n+iDvPFznrTE16la+eGNcEQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", "@types/buble": "^0.19.2", "buble": "^0.20.0" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@rollup/plugin-commonjs": { "version": "25.0.4", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.4.tgz", "integrity": "sha512-L92Vz9WUZXDnlQQl3EwbypJR4+DM2EbsO+/KOcEkP4Mc6Ct453EeDB2uH9lgRwj4w5yflgNpq9pHOiY8aoUXBQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", "commondir": "^1.0.1", "estree-walker": "^2.0.2", "glob": "^8.0.3", "is-reference": "1.2.1", "magic-string": "^0.27.0" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^2.68.0||^3.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@rollup/plugin-commonjs/node_modules/is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", "dev": true, "dependencies": { "@types/estree": "*" } }, "node_modules/@rollup/plugin-commonjs/node_modules/magic-string": { "version": "0.27.0", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.13" }, "engines": { "node": ">=12" } }, "node_modules/@rollup/plugin-json": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.0.0.tgz", "integrity": "sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@rollup/plugin-node-resolve": { "version": "15.2.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.1.tgz", "integrity": "sha512-nsbUg588+GDSu8/NS8T4UAshO6xeaOfINNuXeVHcKV02LJtoRaM1SiOacClw4kws1SFiNhdLGxlbMY9ga/zs/w==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", "@types/resolve": "1.20.2", "deepmerge": "^4.2.2", "is-builtin-module": "^3.2.1", "is-module": "^1.0.0", "resolve": "^1.22.1" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^2.78.0||^3.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@rollup/plugin-replace": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.2.tgz", "integrity": "sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", "magic-string": "^0.27.0" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@rollup/plugin-replace/node_modules/magic-string": { "version": "0.27.0", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.13" }, "engines": { "node": ">=12" } }, "node_modules/@rollup/plugin-terser": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.3.tgz", "integrity": "sha512-EF0oejTMtkyhrkwCdg0HJ0IpkcaVg1MMSf2olHb2Jp+1mnLM04OhjpJWGma4HobiDTF0WCyViWuvadyE9ch2XA==", "dev": true, "dependencies": { "serialize-javascript": "^6.0.1", "smob": "^1.0.0", "terser": "^5.17.4" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^2.x || ^3.x" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@rollup/plugin-typescript": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.2.tgz", "integrity": "sha512-0ghSOCMcA7fl1JM+0gYRf+Q/HWyg+zg7/gDSc+fRLmlJWcW5K1I+CLRzaRhXf4Y3DRyPnnDo4M2ktw+a6JcDEg==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", "resolve": "^1.22.1" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^2.14.0||^3.0.0", "tslib": "*", "typescript": ">=3.7.0" }, "peerDependenciesMeta": { "rollup": { "optional": true }, "tslib": { "optional": true } } }, "node_modules/@rollup/pluginutils": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.4.tgz", "integrity": "sha512-0KJnIoRI8A+a1dqOYLxH8vBf8bphDmty5QvIm2hqm7oFCFYKCAZWWd2hXgMibaPsNDhI0AtpYfQZJG47pt/k4g==", "dev": true, "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", "picomatch": "^2.3.1" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0" }, "peerDependenciesMeta": { "rollup": { "optional": true } } }, "node_modules/@types/buble": { "version": "0.19.2", "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", "dev": true, "dependencies": { "magic-string": "^0.25.0" } }, "node_modules/@types/buble/node_modules/magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", "dev": true, "dependencies": { "sourcemap-codec": "^1.4.8" } }, "node_modules/@types/estree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", "dev": true }, "node_modules/@types/fs-extra": { "version": "9.0.13", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz", "integrity": "sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==", "dev": true, "dependencies": { "@types/minimatch": "^5.1.2", "@types/node": "*" } }, "node_modules/@types/glob/node_modules/@types/minimatch": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", "dev": true }, "node_modules/@types/json-schema": { "version": "7.0.13", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==", "dev": true }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "node_modules/@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", "dev": true }, "node_modules/@types/mocha": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", "dev": true }, "node_modules/@types/node": { "version": "14.18.62", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.62.tgz", "integrity": "sha512-53Fhb08qfKwSNCIUtysIqw0ye+v1d5QCdL2kl8liKQFlOZTAo+nEYr/FztzMaHBFwB5H0ugF0PF0gmtojaNNiQ==", "dev": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, "node_modules/@types/resolve": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", "dev": true }, "node_modules/@types/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==", "dev": true, "dependencies": { "@types/glob": "*", "@types/node": "*" } }, "node_modules/@types/semver": { "version": "7.5.2", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.2.tgz", "integrity": "sha512-7aqorHYgdNO4DM36stTiGO3DvKoex9TQRwsJU6vMaFGyqpBA1MNZkz+PG3gaNUPpTAOYhT1WR7M1JyA3fbS9Cw==", "dev": true }, "node_modules/@types/web-bluetooth": { "version": "0.0.17", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.17.tgz", "integrity": "sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==", "dev": true }, "node_modules/@types/yargs-parser": { "version": "21.0.0", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, "node_modules/@types/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", "dev": true, "optional": true, "dependencies": { "@types/node": "*" } }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.2.tgz", "integrity": "sha512-ooaHxlmSgZTM6CHYAFRlifqh1OAr3PAQEwi7lhYhaegbnXrnh7CDcHmc3+ihhbQC7H0i4JF0psI5ehzkF6Yl6Q==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", "@typescript-eslint/scope-manager": "6.7.2", "@typescript-eslint/type-utils": "6.7.2", "@typescript-eslint/utils": "6.7.2", "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", "natural-compare": "^1.4.0", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@typescript-eslint/parser": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.2.tgz", "integrity": "sha512-KA3E4ox0ws+SPyxQf9iSI25R6b4Ne78ORhNHeVKrPQnoYsb9UhieoiRoJgrzgEeKGOXhcY1i8YtOeCHHTDa6Fw==", "dev": true, "dependencies": { "@typescript-eslint/scope-manager": "6.7.2", "@typescript-eslint/types": "6.7.2", "@typescript-eslint/typescript-estree": "6.7.2", "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4" }, "engines": { "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@typescript-eslint/scope-manager": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.2.tgz", "integrity": "sha512-bgi6plgyZjEqapr7u2mhxGR6E8WCzKNUFWNh6fkpVe9+yzRZeYtDTbsIBzKbcxI+r1qVWt6VIoMSNZ4r2A+6Yw==", "dev": true, "dependencies": { "@typescript-eslint/types": "6.7.2", "@typescript-eslint/visitor-keys": "6.7.2" }, "engines": { "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/type-utils": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.2.tgz", "integrity": "sha512-36F4fOYIROYRl0qj95dYKx6kybddLtsbmPIYNK0OBeXv2j9L5nZ17j9jmfy+bIDHKQgn2EZX+cofsqi8NPATBQ==", "dev": true, "dependencies": { "@typescript-eslint/typescript-estree": "6.7.2", "@typescript-eslint/utils": "6.7.2", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@typescript-eslint/types": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.2.tgz", "integrity": "sha512-flJYwMYgnUNDAN9/GAI3l8+wTmvTYdv64fcH8aoJK76Y+1FCZ08RtI5zDerM/FYT5DMkAc+19E4aLmd5KqdFyg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/typescript-estree": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.2.tgz", "integrity": "sha512-kiJKVMLkoSciGyFU0TOY0fRxnp9qq1AzVOHNeN1+B9erKFCJ4Z8WdjAkKQPP+b1pWStGFqezMLltxO+308dJTQ==", "dev": true, "dependencies": { "@typescript-eslint/types": "6.7.2", "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@typescript-eslint/utils": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.2.tgz", "integrity": "sha512-ZCcBJug/TS6fXRTsoTkgnsvyWSiXwMNiPzBUani7hDidBdj1779qwM1FIAmpH4lvlOZNF3EScsxxuGifjpLSWQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", "@typescript-eslint/scope-manager": "6.7.2", "@typescript-eslint/types": "6.7.2", "@typescript-eslint/typescript-estree": "6.7.2", "semver": "^7.5.4" }, "engines": { "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { "version": "6.7.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.2.tgz", "integrity": "sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ==", "dev": true, "dependencies": { "@typescript-eslint/types": "6.7.2", "eslint-visitor-keys": "^3.4.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@vue/compiler-core": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", "dev": true, "dependencies": { "@babel/parser": "^7.21.3", "@vue/shared": "3.3.4", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-dom": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", "dev": true, "dependencies": { "@vue/compiler-core": "3.3.4", "@vue/shared": "3.3.4" } }, "node_modules/@vue/compiler-sfc": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", "dev": true, "dependencies": { "@babel/parser": "^7.20.15", "@vue/compiler-core": "3.3.4", "@vue/compiler-dom": "3.3.4", "@vue/compiler-ssr": "3.3.4", "@vue/reactivity-transform": "3.3.4", "@vue/shared": "3.3.4", "estree-walker": "^2.0.2", "magic-string": "^0.30.0", "postcss": "^8.1.10", "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-ssr": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", "dev": true, "dependencies": { "@vue/compiler-dom": "3.3.4", "@vue/shared": "3.3.4" } }, "node_modules/@vue/devtools-api": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.5.0.tgz", "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==", "dev": true }, "node_modules/@vue/eslint-config-prettier": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@vue/eslint-config-prettier/-/eslint-config-prettier-8.0.0.tgz", "integrity": "sha512-55dPqtC4PM/yBjhAr+yEw6+7KzzdkBuLmnhBrDfp4I48+wy+Giqqj9yUr5T2uD/BkBROjjmqnLZmXRdOx/VtQg==", "dev": true, "dependencies": { "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^5.0.0" }, "peerDependencies": { "eslint": ">= 8.0.0", "prettier": ">= 3.0.0" } }, "node_modules/@vue/eslint-config-prettier/node_modules/eslint-config-prettier": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, "peerDependencies": { "eslint": ">=7.0.0" } }, "node_modules/@vue/eslint-config-typescript": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-12.0.0.tgz", "integrity": "sha512-StxLFet2Qe97T8+7L8pGlhYBBr8Eg05LPuTDVopQV6il+SK6qqom59BA/rcFipUef2jD8P2X44Vd8tMFytfvlg==", "dev": true, "dependencies": { "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", "vue-eslint-parser": "^9.3.1" }, "engines": { "node": "^14.17.0 || >=16.0.0" }, "peerDependencies": { "eslint": "^6.2.0 || ^7.0.0 || ^8.0.0", "eslint-plugin-vue": "^9.0.0", "typescript": "*" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/@vue/reactivity": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", "dev": true, "dependencies": { "@vue/shared": "3.3.4" } }, "node_modules/@vue/reactivity-transform": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", "dev": true, "dependencies": { "@babel/parser": "^7.20.15", "@vue/compiler-core": "3.3.4", "@vue/shared": "3.3.4", "estree-walker": "^2.0.2", "magic-string": "^0.30.0" } }, "node_modules/@vue/runtime-core": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.4.tgz", "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", "dev": true, "dependencies": { "@vue/reactivity": "3.3.4", "@vue/shared": "3.3.4" } }, "node_modules/@vue/runtime-dom": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", "dev": true, "dependencies": { "@vue/runtime-core": "3.3.4", "@vue/shared": "3.3.4", "csstype": "^3.1.1" } }, "node_modules/@vue/server-renderer": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.4.tgz", "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", "dev": true, "dependencies": { "@vue/compiler-ssr": "3.3.4", "@vue/shared": "3.3.4" }, "peerDependencies": { "vue": "3.3.4" } }, "node_modules/@vue/shared": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==", "dev": true }, "node_modules/@vueuse/core": { "version": "10.4.1", "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.4.1.tgz", "integrity": "sha512-DkHIfMIoSIBjMgRRvdIvxsyboRZQmImofLyOHADqiVbQVilP8VVHDhBX2ZqoItOgu7dWa8oXiNnScOdPLhdEXg==", "dev": true, "dependencies": { "@types/web-bluetooth": "^0.0.17", "@vueuse/metadata": "10.4.1", "@vueuse/shared": "10.4.1", "vue-demi": ">=0.14.5" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@vueuse/core/node_modules/vue-demi": { "version": "0.14.6", "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", "dev": true, "hasInstallScript": true, "bin": { "vue-demi-fix": "bin/vue-demi-fix.js", "vue-demi-switch": "bin/vue-demi-switch.js" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/antfu" }, "peerDependencies": { "@vue/composition-api": "^1.0.0-rc.1", "vue": "^3.0.0-0 || ^2.6.0" }, "peerDependenciesMeta": { "@vue/composition-api": { "optional": true } } }, "node_modules/@vueuse/integrations": { "version": "10.4.1", "resolved": "https://registry.npmjs.org/@vueuse/integrations/-/integrations-10.4.1.tgz", "integrity": "sha512-uRBPyG5Lxoh1A/J+boiioPT3ELEAPEo4t8W6Mr4yTKIQBeW/FcbsotZNPr4k9uz+3QEksMmflWloS9wCnypM7g==", "dev": true, "dependencies": { "@vueuse/core": "10.4.1", "@vueuse/shared": "10.4.1", "vue-demi": ">=0.14.5" }, "funding": { "url": "https://github.com/sponsors/antfu" }, "peerDependencies": { "async-validator": "*", "axios": "*", "change-case": "*", "drauu": "*", "focus-trap": "*", "fuse.js": "*", "idb-keyval": "*", "jwt-decode": "*", "nprogress": "*", "qrcode": "*", "sortablejs": "*", "universal-cookie": "*" }, "peerDependenciesMeta": { "async-validator": { "optional": true }, "axios": { "optional": true }, "change-case": { "optional": true }, "drauu": { "optional": true }, "focus-trap": { "optional": true }, "fuse.js": { "optional": true }, "idb-keyval": { "optional": true }, "jwt-decode": { "optional": true }, "nprogress": { "optional": true }, "qrcode": { "optional": true }, "sortablejs": { "optional": true }, "universal-cookie": { "optional": true } } }, "node_modules/@vueuse/integrations/node_modules/vue-demi": { "version": "0.14.6", "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", "dev": true, "hasInstallScript": true, "bin": { "vue-demi-fix": "bin/vue-demi-fix.js", "vue-demi-switch": "bin/vue-demi-switch.js" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/antfu" }, "peerDependencies": { "@vue/composition-api": "^1.0.0-rc.1", "vue": "^3.0.0-0 || ^2.6.0" }, "peerDependenciesMeta": { "@vue/composition-api": { "optional": true } } }, "node_modules/@vueuse/metadata": { "version": "10.4.1", "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.4.1.tgz", "integrity": "sha512-2Sc8X+iVzeuMGHr6O2j4gv/zxvQGGOYETYXEc41h0iZXIRnRbJZGmY/QP8dvzqUelf8vg0p/yEA5VpCEu+WpZg==", "dev": true, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@vueuse/shared": { "version": "10.4.1", "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.4.1.tgz", "integrity": "sha512-vz5hbAM4qA0lDKmcr2y3pPdU+2EVw/yzfRsBdu+6+USGa4PxqSQRYIUC9/NcT06y+ZgaTsyURw2I9qOFaaXHAg==", "dev": true, "dependencies": { "vue-demi": ">=0.14.5" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/@vueuse/shared/node_modules/vue-demi": { "version": "0.14.6", "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", "dev": true, "hasInstallScript": true, "bin": { "vue-demi-fix": "bin/vue-demi-fix.js", "vue-demi-switch": "bin/vue-demi-switch.js" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/antfu" }, "peerDependencies": { "@vue/composition-api": "^1.0.0-rc.1", "vue": "^3.0.0-0 || ^2.6.0" }, "peerDependenciesMeta": { "@vue/composition-api": { "optional": true } } }, "node_modules/acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, "bin": { "acorn": "bin/acorn" }, "engines": { "node": ">=0.4.0" } }, "node_modules/acorn-import-assertions": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", "dev": true, "peerDependencies": { "acorn": "^8" } }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "dependencies": { "debug": "4" }, "engines": { "node": ">= 6.0.0" } }, "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/algoliasearch": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.20.0.tgz", "integrity": "sha512-y+UHEjnOItoNy0bYO+WWmLWBlPwDjKHW6mNHrPi0NkuhpQOOEbrkwQH/wgKFDLh7qlKjzoKeiRtlpewDPDG23g==", "dev": true, "dependencies": { "@algolia/cache-browser-local-storage": "4.20.0", "@algolia/cache-common": "4.20.0", "@algolia/cache-in-memory": "4.20.0", "@algolia/client-account": "4.20.0", "@algolia/client-analytics": "4.20.0", "@algolia/client-common": "4.20.0", "@algolia/client-personalization": "4.20.0", "@algolia/client-search": "4.20.0", "@algolia/logger-common": "4.20.0", "@algolia/logger-console": "4.20.0", "@algolia/requester-browser-xhr": "4.20.0", "@algolia/requester-common": "4.20.0", "@algolia/requester-node-http": "4.20.0", "@algolia/transporter": "4.20.0" } }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "dependencies": { "type-fest": "^0.21.3" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-escapes/node_modules/type-fest": { "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/ansi-sequence-parser": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", "dev": true }, "node_modules/ansi-styles": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" }, "engines": { "node": ">= 8" } }, "node_modules/append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, "dependencies": { "default-require-extensions": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "node_modules/array-buffer-byte-length": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "is-array-buffer": "^3.0.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/array-includes": { "version": "3.1.7", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1", "get-intrinsic": "^1.2.1", "is-string": "^1.0.7" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/array.prototype.findlastindex": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0", "get-intrinsic": "^1.2.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array.prototype.flat": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array.prototype.flatmap": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/arraybuffer.prototype.slice": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1", "get-intrinsic": "^1.2.1", "is-array-buffer": "^3.0.2", "is-shared-array-buffer": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dev": true, "dependencies": { "follow-redirects": "^1.14.0" } }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] }, "node_modules/big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", "dev": true, "engines": { "node": ">=0.6" } }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "dev": true }, "node_modules/bplist-parser": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", "dev": true, "dependencies": { "big-integer": "^1.6.44" }, "engines": { "node": ">= 5.10.0" } }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "dependencies": { "fill-range": "^7.0.1" }, "engines": { "node": ">=8" } }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "node_modules/browserslist": { "version": "4.21.11", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.11.tgz", "integrity": "sha512-xn1UXOKUz7DjdGlg9RrUr0GGiWzI97UQJnugHtH0OLDfJB7jMgoIkYvRIEO1l9EeEERVqeqLYOcFBW9ldjypbQ==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "dependencies": { "caniuse-lite": "^1.0.30001538", "electron-to-chromium": "^1.4.526", "node-releases": "^2.0.13", "update-browserslist-db": "^1.0.13" }, "bin": { "browserslist": "cli.js" }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, "node_modules/buble": { "version": "0.20.0", "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", "dev": true, "dependencies": { "acorn": "^6.4.1", "acorn-dynamic-import": "^4.0.0", "acorn-jsx": "^5.2.0", "chalk": "^2.4.2", "magic-string": "^0.25.7", "minimist": "^1.2.5", "regexpu-core": "4.5.4" }, "bin": { "buble": "bin/buble" } }, "node_modules/buble/node_modules/acorn": { "version": "6.4.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", "dev": true, "bin": { "acorn": "bin/acorn" }, "engines": { "node": ">=0.4.0" } }, "node_modules/buble/node_modules/acorn-dynamic-import": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", "deprecated": "This is probably built in to whatever tool you're using. If you still need it... idk", "dev": true, "peerDependencies": { "acorn": "^6.0.0" } }, "node_modules/buble/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "dependencies": { "color-convert": "^1.9.0" }, "engines": { "node": ">=4" } }, "node_modules/buble/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" }, "engines": { "node": ">=4" } }, "node_modules/buble/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/buble/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/buble/node_modules/magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", "dev": true, "dependencies": { "sourcemap-codec": "^1.4.8" } }, "node_modules/buble/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { "has-flag": "^3.0.0" }, "engines": { "node": ">=4" } }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ], "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, "engines": { "node": "*" } }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, "node_modules/builtin-modules": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/bundle-name": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==", "dev": true, "dependencies": { "run-applescript": "^5.0.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "dependencies": { "hasha": "^5.0.0", "make-dir": "^3.0.0", "package-hash": "^4.0.0", "write-file-atomic": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/caniuse-lite": { "version": "1.0.30001538", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz", "integrity": "sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ] }, "node_modules/chalk": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "funding": [ { "type": "individual", "url": "https://paulmillr.com/funding/" } ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "engines": { "node": ">= 8.10.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "node_modules/chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, "node_modules/chromium-bidi": { "version": "0.4.7", "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.7.tgz", "integrity": "sha512-6+mJuFXwTMU6I3vYLs6IL8A1DyQTPjCfIL971X0aMPVGRbGnNfl6i6Cl0NMbxi2bRYLGESt9T2ZIMRM5PAEcIQ==", "dev": true, "dependencies": { "mitt": "3.0.0" }, "peerDependencies": { "devtools-protocol": "*" } }, "node_modules/ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/sibiraj-s" } ], "engines": { "node": ">=8" } }, "node_modules/clean-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", "dev": true, "dependencies": { "escape-string-regexp": "^1.0.5" }, "engines": { "node": ">=4" } }, "node_modules/clean-regexp/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "dependencies": { "restore-cursor": "^3.1.0" }, "engines": { "node": ">=8" } }, "node_modules/cli-spinners": { "version": "2.9.1", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.1.tgz", "integrity": "sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ==", "dev": true, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-truncate": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", "dev": true, "dependencies": { "slice-ansi": "^5.0.0", "string-width": "^5.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-truncate/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/cli-truncate/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "node_modules/cli-truncate/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-truncate/node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/cli-width": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", "dev": true, "engines": { "node": ">= 12" } }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" }, "engines": { "node": ">=12" } }, "node_modules/cliui/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/cliui/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/cliui/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "dev": true, "engines": { "node": ">=0.8" } }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "dependencies": { "color-name": "1.1.3" } }, "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/colorette": { "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, "node_modules/commander": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "engines": { "node": ">=14" } }, "node_modules/commenting": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/commenting/-/commenting-1.1.0.tgz", "integrity": "sha512-YeNK4tavZwtH7jEgK1ZINXzLKm6DZdEMfsaaieOsCAN0S8vsY7UeuO3Q7d/M018EFgE+IeUAuBOKkFccBZsUZA==", "dev": true }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "node_modules/concurrently": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.2.1.tgz", "integrity": "sha512-nVraf3aXOpIcNud5pB9M82p1tynmZkrSGQ1p6X/VY8cJ+2LMVqAgXsJxYYefACSHbTYlm92O1xuhdGTjwoEvbQ==", "dev": true, "dependencies": { "chalk": "^4.1.2", "date-fns": "^2.30.0", "lodash": "^4.17.21", "rxjs": "^7.8.1", "shell-quote": "^1.8.1", "spawn-command": "0.0.2", "supports-color": "^8.1.1", "tree-kill": "^1.2.2", "yargs": "^17.7.2" }, "bin": { "conc": "dist/bin/concurrently.js", "concurrently": "dist/bin/concurrently.js" }, "engines": { "node": "^14.13.0 || >=16.0.0" }, "funding": { "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" } }, "node_modules/concurrently/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/concurrently/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/concurrently/node_modules/chalk/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/concurrently/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/concurrently/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, "node_modules/core-js": { "version": "3.32.2", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.32.2.tgz", "integrity": "sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ==", "dev": true, "hasInstallScript": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" } }, "node_modules/cosmiconfig": { "version": "8.1.3", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz", "integrity": "sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==", "dev": true, "dependencies": { "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "parse-json": "^5.0.0", "path-type": "^4.0.0" }, "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/d-fischer" } }, "node_modules/crelt": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", "dev": true }, "node_modules/cross-fetch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", "dev": true, "dependencies": { "node-fetch": "2.6.7" } }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" }, "engines": { "node": ">= 8" } }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "dev": true, "bin": { "cssesc": "bin/cssesc" }, "engines": { "node": ">=4" } }, "node_modules/csstype": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", "dev": true }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", "dev": true, "dependencies": { "@babel/runtime": "^7.21.0" }, "engines": { "node": ">=0.11" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/date-fns" } }, "node_modules/date-time": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/date-time/-/date-time-4.0.0.tgz", "integrity": "sha512-I53Xcn8FBobcKFcNUfZUSE6O3HeRdp1IOLWyHkipi5S07sEZbTwP+xTrPp5Ch6q6iyFkC06B14+bm96FrdfIEA==", "dev": true, "dependencies": { "time-zone": "^2.0.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { "ms": "2.1.2" }, "engines": { "node": ">=6.0" }, "peerDependenciesMeta": { "supports-color": { "optional": true } } }, "node_modules/decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/default-browser": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz", "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==", "dev": true, "dependencies": { "bundle-name": "^3.0.0", "default-browser-id": "^3.0.0", "execa": "^7.1.1", "titleize": "^3.0.0" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/default-browser-id": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz", "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==", "dev": true, "dependencies": { "bplist-parser": "^0.2.0", "untildify": "^4.0.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/default-require-extensions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", "dev": true, "dependencies": { "strip-bom": "^4.0.0" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/defaults": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dev": true, "dependencies": { "clone": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/define-data-property": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", "dev": true, "dependencies": { "get-intrinsic": "^1.2.1", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/define-lazy-prop": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/define-properties": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/devtools-protocol": { "version": "0.0.1107588", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1107588.tgz", "integrity": "sha512-yIR+pG9x65Xko7bErCUSQaDLrO/P1p3JUzEk7JCU4DowPcGHkTGUGQapcfcLc4qj0UaALwZ+cr0riFgiqpixcg==", "dev": true }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, "engines": { "node": ">=0.3.1" } }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "dependencies": { "path-type": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "dependencies": { "esutils": "^2.0.2" }, "engines": { "node": ">=6.0.0" } }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, "node_modules/electron-to-chromium": { "version": "1.4.527", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.527.tgz", "integrity": "sha512-EafxEiEDzk2aLrdbtVczylHflHdHkNrpGNHIgDyA63sUQLQVS2ayj2hPw3RsVB42qkwURH+T2OxV7kGPUuYszA==", "dev": true }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "dependencies": { "once": "^1.4.0" } }, "node_modules/ensure-posix-path": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ensure-posix-path/-/ensure-posix-path-1.1.1.tgz", "integrity": "sha512-VWU0/zXzVbeJNXvME/5EmLuEj2TauvoaTz6aFYK1Z92JCBlDlZ3Gu0tuGR42kpW1754ywTs+QB0g5TP0oj9Zaw==", "dev": true }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } }, "node_modules/es-abstract": { "version": "1.22.2", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", "integrity": "sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "arraybuffer.prototype.slice": "^1.0.2", "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.6", "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", "globalthis": "^1.0.3", "gopd": "^1.0.1", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "internal-slot": "^1.0.5", "is-array-buffer": "^3.0.2", "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", "is-typed-array": "^1.1.12", "is-weakref": "^1.0.2", "object-inspect": "^1.12.3", "object-keys": "^1.1.1", "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.5.1", "safe-array-concat": "^1.0.1", "safe-regex-test": "^1.0.0", "string.prototype.trim": "^1.2.8", "string.prototype.trimend": "^1.0.7", "string.prototype.trimstart": "^1.0.7", "typed-array-buffer": "^1.0.0", "typed-array-byte-length": "^1.0.0", "typed-array-byte-offset": "^1.0.0", "typed-array-length": "^1.0.4", "unbox-primitive": "^1.0.2", "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/es-set-tostringtag": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", "dev": true, "dependencies": { "get-intrinsic": "^1.1.3", "has": "^1.0.3", "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-shim-unscopables": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", "dev": true, "dependencies": { "has": "^1.0.3" } }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", "is-symbol": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/es5-shim": { "version": "4.6.7", "resolved": "https://registry.npmjs.org/es5-shim/-/es5-shim-4.6.7.tgz", "integrity": "sha512-jg21/dmlrNQI7JyyA2w7n+yifSxBng0ZralnSfVZjoCawgNTCnS+yBCyVM9DL5itm7SUnDGgv7hcq2XCZX4iRQ==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, "node_modules/es6-shim": { "version": "0.35.8", "resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.35.8.tgz", "integrity": "sha512-Twf7I2v4/1tLoIXMT8HlqaBSS5H2wQTs2wx3MNYCI8K1R1/clXyCazrcVCPm/FuO9cyV8+leEaZOWD5C253NDg==", "dev": true }, "node_modules/esbuild": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" }, "engines": { "node": ">=12" }, "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" } }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint": { "version": "8.49.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", "@eslint/js": "8.49.0", "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.2", "eslint-visitor-keys": "^3.4.3", "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3", "strip-ansi": "^6.0.1", "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-config-prettier": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, "peerDependencies": { "eslint": ">=7.0.0" } }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", "resolve": "^1.22.4" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-module-utils": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "dependencies": { "debug": "^3.2.7" }, "engines": { "node": ">=4" }, "peerDependenciesMeta": { "eslint": { "optional": true } } }, "node_modules/eslint-module-utils/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import": { "version": "2.28.1", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz", "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==", "dev": true, "dependencies": { "array-includes": "^3.1.6", "array.prototype.findlastindex": "^1.2.2", "array.prototype.flat": "^1.3.1", "array.prototype.flatmap": "^1.3.1", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.7", "eslint-module-utils": "^2.8.0", "has": "^1.0.3", "is-core-module": "^2.13.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", "object.fromentries": "^2.0.6", "object.groupby": "^1.0.0", "object.values": "^1.1.6", "semver": "^6.3.1", "tsconfig-paths": "^3.14.2" }, "engines": { "node": ">=4" }, "peerDependencies": { "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" } }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import/node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "dependencies": { "esutils": "^2.0.2" }, "engines": { "node": ">=0.10.0" } }, "node_modules/eslint-plugin-prettier": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz", "integrity": "sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.8.5" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/prettier" }, "peerDependencies": { "@types/eslint": ">=8.0.0", "eslint": ">=8.0.0", "prettier": ">=3.0.0" }, "peerDependenciesMeta": { "@types/eslint": { "optional": true }, "eslint-config-prettier": { "optional": true } } }, "node_modules/eslint-plugin-unicorn": { "version": "48.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-48.0.1.tgz", "integrity": "sha512-FW+4r20myG/DqFcCSzoumaddKBicIPeFnTrifon2mWIzlfyvzwyqZjqVP7m4Cqr/ZYisS2aiLghkUWaPg6vtCw==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.5", "@eslint-community/eslint-utils": "^4.4.0", "ci-info": "^3.8.0", "clean-regexp": "^1.0.0", "esquery": "^1.5.0", "indent-string": "^4.0.0", "is-builtin-module": "^3.2.1", "jsesc": "^3.0.2", "lodash": "^4.17.21", "pluralize": "^8.0.0", "read-pkg-up": "^7.0.1", "regexp-tree": "^0.1.27", "regjsparser": "^0.10.0", "semver": "^7.5.4", "strip-indent": "^3.0.0" }, "engines": { "node": ">=16" }, "funding": { "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" }, "peerDependencies": { "eslint": ">=8.44.0" } }, "node_modules/eslint-plugin-vue": { "version": "9.17.0", "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.17.0.tgz", "integrity": "sha512-r7Bp79pxQk9I5XDP0k2dpUC7Ots3OSWgvGZNu3BxmKK6Zg7NgVtcOB6OCna5Kb9oQwJPl5hq183WD0SY5tZtIQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "natural-compare": "^1.4.0", "nth-check": "^2.1.1", "postcss-selector-parser": "^6.0.13", "semver": "^7.5.4", "vue-eslint-parser": "^9.3.1", "xml-name-validator": "^4.0.0" }, "engines": { "node": "^14.17.0 || >=16.0.0" }, "peerDependencies": { "eslint": "^6.2.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/eslint/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/eslint/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { "is-glob": "^4.0.3" }, "engines": { "node": ">=10.13.0" } }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" }, "engines": { "node": ">=4" } }, "node_modules/esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" }, "engines": { "node": ">=0.10" } }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "dependencies": { "estraverse": "^5.2.0" }, "engines": { "node": ">=4.0" } }, "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", "dev": true }, "node_modules/execa": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.1", "human-signals": "^4.3.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", "signal-exit": "^3.0.7", "strip-final-newline": "^3.0.0" }, "engines": { "node": "^14.18.0 || ^16.14.0 || >=18.0.0" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, "node_modules/execa/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "dependencies": { "chardet": "^0.7.0", "iconv-lite": "^0.4.24", "tmp": "^0.0.33" }, "engines": { "node": ">=4" } }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" }, "bin": { "extract-zip": "cli.js" }, "engines": { "node": ">= 10.17.0" }, "optionalDependencies": { "@types/yauzl": "^2.9.1" } }, "node_modules/extract-zip/node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "dependencies": { "pump": "^3.0.0" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "node_modules/fast-diff": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true }, "node_modules/fast-glob": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" }, "engines": { "node": ">=8.6.0" } }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "node_modules/fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", "dev": true, "dependencies": { "reusify": "^1.0.4" } }, "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, "dependencies": { "pend": "~1.2.0" } }, "node_modules/figures": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "dev": true, "dependencies": { "escape-string-regexp": "^5.0.0", "is-unicode-supported": "^1.2.0" }, "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/figures/node_modules/escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "dependencies": { "flat-cache": "^3.0.4" }, "engines": { "node": "^10.12.0 || >=12.0.0" } }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/find-cache-dir": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, "dependencies": { "commondir": "^1.0.1", "make-dir": "^3.0.2", "pkg-dir": "^4.1.0" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/fixturify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/fixturify/-/fixturify-3.0.0.tgz", "integrity": "sha512-PFOf/DT9/t2NCiVyiQ5cBMJtGZfWh3aeOV8XVqQQOPBlTv8r6l0k75/hm36JOaiJlrWFk/8aYFyOKAvOkrkjrw==", "dev": true, "dependencies": { "@types/fs-extra": "^9.0.13", "@types/minimatch": "^3.0.3", "@types/rimraf": "^3.0.2", "fs-extra": "^10.1.0", "matcher-collection": "^2.0.1", "walk-sync": "^3.0.0" }, "engines": { "node": "14.* || >= 16.*" } }, "node_modules/fixturify/node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" }, "engines": { "node": ">=12" } }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, "bin": { "flat": "cli.js" } }, "node_modules/flat-cache": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", "dev": true, "dependencies": { "flatted": "^3.2.7", "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { "node": ">=12.0.0" } }, "node_modules/flatted": { "version": "3.2.9", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", "dev": true }, "node_modules/flru": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/flru/-/flru-1.0.2.tgz", "integrity": "sha512-kWyh8ADvHBFz6ua5xYOPnUroZTT/bwWfrCeL0Wj1dzG4/YOmOcfJ99W8dOVyyynJN35rZ9aCOtHChqQovV7yog==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/focus-trap": { "version": "7.5.2", "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.5.2.tgz", "integrity": "sha512-p6vGNNWLDGwJCiEjkSK6oERj/hEyI9ITsSwIUICBoKLlWiTWXJRfQibCwcoi50rTZdbi87qDtUlMCmQwsGSgPw==", "dev": true, "dependencies": { "tabbable": "^6.2.0" } }, "node_modules/follow-redirects": { "version": "1.15.3", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", "dev": true, "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], "engines": { "node": ">=4.0" }, "peerDependenciesMeta": { "debug": { "optional": true } } }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "dependencies": { "is-callable": "^1.1.3" } }, "node_modules/foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^3.0.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/foreground-child/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/fromentries": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true }, "node_modules/fs-extra": { "version": "11.1.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" }, "engines": { "node": ">=14.14" } }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "hasInstallScript": true, "optional": true, "os": [ "darwin" ], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "node_modules/function.prototype.name": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1", "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, "engines": { "node": ">=8.0.0" } }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/get-symbol-description": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-symbol-from-current-process-h": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-from-current-process-h/-/get-symbol-from-current-process-h-1.0.2.tgz", "integrity": "sha512-syloC6fsCt62ELLrr1VKBM1ggOpMdetX9hTrdW77UQdcApPHLmf7CI7OKcN1c9kYuNxKcDe4iJ4FY9sX3aw2xw==", "dev": true }, "node_modules/get-uv-event-loop-napi-h": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/get-uv-event-loop-napi-h/-/get-uv-event-loop-napi-h-1.0.6.tgz", "integrity": "sha512-t5c9VNR84nRoF+eLiz6wFrEp1SE2Acg0wS+Ysa2zF0eROes+LzOfuTaVHxGy8AbS8rq7FHEJzjnCZo1BupwdJg==", "dev": true, "dependencies": { "get-symbol-from-current-process-h": "^1.0.1" } }, "node_modules/github-api": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/github-api/-/github-api-3.4.0.tgz", "integrity": "sha512-2yYqYS6Uy4br1nw0D3VrlYWxtGTkUhIZrumBrcBwKdBOzMT8roAe8IvI6kjIOkxqxapKR5GkEsHtz3Du/voOpA==", "dev": true, "dependencies": { "axios": "^0.21.1", "debug": "^2.2.0", "js-base64": "^2.1.9", "utf8": "^2.1.1" } }, "node_modules/github-api/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "dependencies": { "ms": "2.0.0" } }, "node_modules/github-api/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, "node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", "once": "^1.3.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { "is-glob": "^4.0.1" }, "engines": { "node": ">= 6" } }, "node_modules/glob/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/glob/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" } }, "node_modules/globals": { "version": "13.22.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", "dev": true, "dependencies": { "type-fest": "^0.20.2" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globalthis": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", "dev": true, "dependencies": { "define-properties": "^1.1.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.2.9", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globby/node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "dependencies": { "function-bind": "^1.1.1" }, "engines": { "node": ">= 0.4.0" } }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/has-property-descriptors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", "dev": true, "dependencies": { "get-intrinsic": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-tostringtag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dev": true, "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, "node_modules/hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, "dependencies": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hasha/node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hasha/node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, "bin": { "he": "bin/he" } }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "dependencies": { "agent-base": "6", "debug": "4" }, "engines": { "node": ">= 6" } }, "node_modules/human-signals": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", "dev": true, "engines": { "node": ">=14.18.0" } }, "node_modules/husky": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", "dev": true, "bin": { "husky": "lib/bin.js" }, "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/typicode" } }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, "engines": { "node": ">=0.10.0" } }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] }, "node_modules/ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" } }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { "node": ">=0.8.19" } }, "node_modules/indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "node_modules/inquirer": { "version": "9.2.11", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.11.tgz", "integrity": "sha512-B2LafrnnhbRzCWfAdOXisUzL89Kg8cVJlYmhqoi3flSiV/TveO+nsXwgKr9h9PIo+J1hz7nBSk6gegRIMBBf7g==", "dev": true, "dependencies": { "@ljharb/through": "^2.3.9", "ansi-escapes": "^4.3.2", "chalk": "^5.3.0", "cli-cursor": "^3.1.0", "cli-width": "^4.1.0", "external-editor": "^3.1.0", "figures": "^5.0.0", "lodash": "^4.17.21", "mute-stream": "1.0.0", "ora": "^5.4.1", "run-async": "^3.0.0", "rxjs": "^7.8.1", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "wrap-ansi": "^6.2.0" }, "engines": { "node": ">=14.18.0" } }, "node_modules/internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "dependencies": { "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" }, "engines": { "node": ">= 0.4" } }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true, "engines": { "node": ">= 0.10" } }, "node_modules/is-array-buffer": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.0", "is-typed-array": "^1.1.10" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, "dependencies": { "has-bigints": "^1.0.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, "engines": { "node": ">=8" } }, "node_modules/is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-builtin-module": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", "dev": true, "dependencies": { "builtin-modules": "^3.3.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-core-module": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "dependencies": { "has": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", "dev": true, "bin": { "is-docker": "cli.js" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, "engines": { "node": ">=0.10.0" } }, "node_modules/is-inside-container": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", "dev": true, "dependencies": { "is-docker": "^3.0.0" }, "bin": { "is-inside-container": "cli.js" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-interactive": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", "dev": true }, "node_modules/is-negative-zero": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/is-reference": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", "dev": true, "dependencies": { "@types/estree": "*" } }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, "dependencies": { "call-bind": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-symbol": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-typed-array": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", "dev": true, "dependencies": { "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, "node_modules/is-unicode-supported": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, "dependencies": { "is-docker": "^2.0.0" }, "engines": { "node": ">=8" } }, "node_modules/is-wsl/node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, "bin": { "is-docker": "cli.js" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-hook": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, "dependencies": { "append-transform": "^2.0.0" }, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-instrument": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "dependencies": { "@babel/core": "^7.7.5", "@istanbuljs/schema": "^0.1.2", "istanbul-lib-coverage": "^3.0.0", "semver": "^6.3.0" }, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-processinfo": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", "dev": true, "dependencies": { "archy": "^1.0.0", "cross-spawn": "^7.0.3", "istanbul-lib-coverage": "^3.2.0", "p-map": "^3.0.0", "rimraf": "^3.0.0", "uuid": "^8.3.2" }, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-report": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", "supports-color": "^7.1.0" }, "engines": { "node": ">=10" } }, "node_modules/istanbul-lib-report/node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "dependencies": { "semver": "^7.5.3" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" }, "engines": { "node": ">=10" } }, "node_modules/istanbul-lib-source-maps/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/istanbul-reports": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/js-base64": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", "dev": true }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "node_modules/jsesc": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, "bin": { "jsesc": "bin/jsesc" }, "engines": { "node": ">=6" } }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" }, "engines": { "node": ">=6" } }, "node_modules/jsonc-parser": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "node_modules/keyv": { "version": "4.5.3", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", "dev": true, "dependencies": { "json-buffer": "3.0.1" } }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, "node_modules/lint-staged": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-14.0.1.tgz", "integrity": "sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==", "dev": true, "dependencies": { "chalk": "5.3.0", "commander": "11.0.0", "debug": "4.3.4", "execa": "7.2.0", "lilconfig": "2.1.0", "listr2": "6.6.1", "micromatch": "4.0.5", "pidtree": "0.6.0", "string-argv": "0.3.2", "yaml": "2.3.1" }, "bin": { "lint-staged": "bin/lint-staged.js" }, "engines": { "node": "^16.14.0 || >=18.0.0" }, "funding": { "url": "https://opencollective.com/lint-staged" } }, "node_modules/lint-staged/node_modules/commander": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", "dev": true, "engines": { "node": ">=16" } }, "node_modules/listr2": { "version": "6.6.1", "resolved": "https://registry.npmjs.org/listr2/-/listr2-6.6.1.tgz", "integrity": "sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==", "dev": true, "dependencies": { "cli-truncate": "^3.1.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", "log-update": "^5.0.1", "rfdc": "^1.3.0", "wrap-ansi": "^8.1.0" }, "engines": { "node": ">=16.0.0" }, "peerDependencies": { "enquirer": ">= 2.3.0 < 3" }, "peerDependenciesMeta": { "enquirer": { "optional": true } } }, "node_modules/listr2/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/listr2/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "node_modules/listr2/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/listr2/node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/listr2/node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/locate-character": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", "dev": true }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { "p-locate": "^5.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "node_modules/lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", "dev": true }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-symbols/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/log-symbols/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/log-symbols/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/log-symbols/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/log-symbols/node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-symbols/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/log-update": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", "dev": true, "dependencies": { "ansi-escapes": "^5.0.0", "cli-cursor": "^4.0.0", "slice-ansi": "^5.0.0", "strip-ansi": "^7.0.1", "wrap-ansi": "^8.0.1" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/ansi-escapes": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, "dependencies": { "type-fest": "^1.0.2" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/log-update/node_modules/cli-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, "dependencies": { "restore-cursor": "^4.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "node_modules/log-update/node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/log-update/node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/restore-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/log-update/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/log-update/node_modules/type-fest": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "dependencies": { "yallist": "^3.0.2" } }, "node_modules/magic-string": { "version": "0.30.3", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, "engines": { "node": ">=12" } }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "dependencies": { "semver": "^6.0.0" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mark.js": { "version": "8.11.1", "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", "integrity": "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==", "dev": true }, "node_modules/matcher-collection": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-2.0.1.tgz", "integrity": "sha512-daE62nS2ZQsDg9raM0IlZzLmI2u+7ZapXBwdoeBUKAYERPDDIc0qNqA8E0Rp2D+gspKR7BgIFP52GeujaGXWeQ==", "dev": true, "dependencies": { "@types/minimatch": "^3.0.3", "minimatch": "^3.0.2" }, "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "engines": { "node": ">= 8" } }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", "dev": true }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { "node": "*" } }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/minisearch": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/minisearch/-/minisearch-6.1.0.tgz", "integrity": "sha512-PNxA/X8pWk+TiqPbsoIYH0GQ5Di7m6326/lwU/S4mlo4wGQddIcf/V//1f9TB0V4j59b57b+HZxt8h3iMROGvg==", "dev": true }, "node_modules/mitt": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.0.tgz", "integrity": "sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==", "dev": true }, "node_modules/mkdirp": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", "dev": true, "bin": { "mkdirp": "dist/cjs/src/bin.js" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mkdirp-classic": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", "dev": true }, "node_modules/mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", "chokidar": "3.5.3", "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", "glob": "7.2.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", "mocha": "bin/mocha.js" }, "engines": { "node": ">= 14.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/mocha/node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "node_modules/mocha/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/mocha/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/mocha/node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mocha/node_modules/glob/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { "node": "*" } }, "node_modules/mocha/node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" } }, "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/mocha/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/mocha/node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/mocha/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/mocha/node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" }, "engines": { "node": ">=10" } }, "node_modules/mocha/node_modules/yargs-parser": { "version": "20.2.4", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/moment": { "version": "2.29.4", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", "dev": true, "engines": { "node": "*" } }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "node_modules/mute-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", "dev": true, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" }, "engines": { "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, "node_modules/node-addon-api": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", "dev": true }, "node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", "dev": true, "dependencies": { "whatwg-url": "^5.0.0" }, "engines": { "node": "4.x || >=6.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "peerDependenciesMeta": { "encoding": { "optional": true } } }, "node_modules/node-gyp-build": { "version": "4.6.1", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", "dev": true, "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", "node-gyp-build-test": "build-test.js" } }, "node_modules/node-preload": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, "dependencies": { "process-on-spawn": "^1.0.0" }, "engines": { "node": ">=8" } }, "node_modules/node-releases": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", "dev": true }, "node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" } }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/npm-run-path": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, "dependencies": { "path-key": "^4.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm-run-path/node_modules/path-key": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", "dev": true, "dependencies": { "boolbase": "^1.0.0" }, "funding": { "url": "https://github.com/fb55/nth-check?sponsor=1" } }, "node_modules/nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "dependencies": { "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.2", "caching-transform": "^4.0.0", "convert-source-map": "^1.7.0", "decamelize": "^1.2.0", "find-cache-dir": "^3.2.0", "find-up": "^4.1.0", "foreground-child": "^2.0.0", "get-package-type": "^0.1.0", "glob": "^7.1.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", "istanbul-lib-instrument": "^4.0.0", "istanbul-lib-processinfo": "^2.0.2", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", "make-dir": "^3.0.0", "node-preload": "^0.2.1", "p-map": "^3.0.0", "process-on-spawn": "^1.0.0", "resolve-from": "^5.0.0", "rimraf": "^3.0.0", "signal-exit": "^3.0.2", "spawn-wrap": "^2.0.0", "test-exclude": "^6.0.0", "yargs": "^15.0.2" }, "bin": { "nyc": "bin/nyc.js" }, "engines": { "node": ">=8.9" } }, "node_modules/nyc/node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, "node_modules/nyc/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/nyc/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { "p-locate": "^4.1.0" }, "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { "p-try": "^2.0.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/nyc/node_modules/p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { "p-limit": "^2.2.0" }, "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/nyc/node_modules/y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true }, "node_modules/nyc/node_modules/yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" }, "engines": { "node": ">=8" } }, "node_modules/nyc/node_modules/yargs-parser": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" }, "engines": { "node": ">=6" } }, "node_modules/object-inspect": { "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.fromentries": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.groupby": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1", "get-intrinsic": "^1.2.1" } }, "node_modules/object.values": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "dependencies": { "wrappy": "1" } }, "node_modules/onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "dependencies": { "mimic-fn": "^4.0.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/open": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz", "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==", "dev": true, "dependencies": { "default-browser": "^4.0.0", "define-lazy-prop": "^3.0.0", "is-inside-container": "^1.0.0", "is-wsl": "^2.2.0" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, "dependencies": { "bl": "^4.1.0", "chalk": "^4.1.0", "cli-cursor": "^3.1.0", "cli-spinners": "^2.5.0", "is-interactive": "^1.0.0", "is-unicode-supported": "^0.1.0", "log-symbols": "^4.1.0", "strip-ansi": "^6.0.0", "wcwidth": "^1.0.1" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ora/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/ora/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/ora/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/ora/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/ora/node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ora/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { "p-limit": "^3.0.2" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-map": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "dependencies": { "aggregate-error": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/package-hash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, "dependencies": { "graceful-fs": "^4.1.15", "hasha": "^5.0.0", "lodash.flattendeep": "^4.4.0", "release-zalgo": "^1.0.0" }, "engines": { "node": ">=8" } }, "node_modules/package-name-regex": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/package-name-regex/-/package-name-regex-2.0.6.tgz", "integrity": "sha512-gFL35q7kbE/zBaPA3UKhp2vSzcPYx2ecbYuwv1ucE9Il6IIgBDweBlH8D68UFGZic2MkllKa2KHCfC1IQBQUYA==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/dword-design" } }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "dependencies": { "callsites": "^3.0.0" }, "engines": { "node": ">=6" } }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/parse-ms": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-3.0.0.tgz", "integrity": "sha512-Tpb8Z7r7XbbtBTrM9UhpkzzaMrqA2VXMT3YChzYltwV3P3pM6t8wl7TvpMnSTosz1aQAdVib7kdoys7vYOPerw==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "engines": { "node": ">=8.6" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pidtree": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", "dev": true, "bin": { "pidtree": "bin/pidtree.js" }, "engines": { "node": ">=0.10" } }, "node_modules/pinia": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.1.6.tgz", "integrity": "sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==", "dev": true, "dependencies": { "@vue/devtools-api": "^6.5.0", "vue-demi": ">=0.14.5" }, "funding": { "url": "https://github.com/sponsors/posva" }, "peerDependencies": { "@vue/composition-api": "^1.4.0", "typescript": ">=4.4.4", "vue": "^2.6.14 || ^3.3.0" }, "peerDependenciesMeta": { "@vue/composition-api": { "optional": true }, "typescript": { "optional": true } } }, "node_modules/pinia/node_modules/vue-demi": { "version": "0.14.6", "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", "dev": true, "hasInstallScript": true, "bin": { "vue-demi-fix": "bin/vue-demi-fix.js", "vue-demi-switch": "bin/vue-demi-switch.js" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/antfu" }, "peerDependencies": { "@vue/composition-api": "^1.0.0-rc.1", "vue": "^3.0.0-0 || ^2.6.0" }, "peerDependenciesMeta": { "@vue/composition-api": { "optional": true } } }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "dependencies": { "find-up": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/pkg-dir/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/pkg-dir/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { "p-locate": "^4.1.0" }, "engines": { "node": ">=8" } }, "node_modules/pkg-dir/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { "p-try": "^2.0.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/pkg-dir/node_modules/p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { "p-limit": "^2.2.0" }, "engines": { "node": ">=8" } }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/postcss": { "version": "8.4.30", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/postcss/" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/postcss-selector-parser": { "version": "6.0.13", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", "dev": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" }, "engines": { "node": ">=4" } }, "node_modules/postcss/node_modules/nanoid": { "version": "3.3.6", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], "bin": { "nanoid": "bin/nanoid.cjs" }, "engines": { "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, "node_modules/preact": { "version": "10.17.1", "resolved": "https://registry.npmjs.org/preact/-/preact-10.17.1.tgz", "integrity": "sha512-X9BODrvQ4Ekwv9GURm9AKAGaomqXmip7NQTZgY7gcNmr7XE83adOMJvd3N42id1tMFU7ojiynRsYnY6/BRFxLA==", "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" } }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/prettier": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" }, "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-linter-helpers": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, "dependencies": { "fast-diff": "^1.1.2" }, "engines": { "node": ">=6.0.0" } }, "node_modules/pretty-bytes": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-6.1.1.tgz", "integrity": "sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==", "dev": true, "engines": { "node": "^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/pretty-ms": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-8.0.0.tgz", "integrity": "sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q==", "dev": true, "dependencies": { "parse-ms": "^3.0.0" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/process-on-spawn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", "dev": true, "dependencies": { "fromentries": "^1.2.0" }, "engines": { "node": ">=8" } }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/puppeteer": { "version": "19.11.1", "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-19.11.1.tgz", "integrity": "sha512-39olGaX2djYUdhaQQHDZ0T0GwEp+5f9UB9HmEP0qHfdQHIq0xGQZuAZ5TLnJIc/88SrPLpEflPC+xUqOTv3c5g==", "dev": true, "hasInstallScript": true, "dependencies": { "@puppeteer/browsers": "0.5.0", "cosmiconfig": "8.1.3", "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", "puppeteer-core": "19.11.1" } }, "node_modules/puppeteer-core": { "version": "19.11.1", "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-19.11.1.tgz", "integrity": "sha512-qcuC2Uf0Fwdj9wNtaTZ2OvYRraXpAK+puwwVW8ofOhOgLPZyz1c68tsorfIZyCUOpyBisjr+xByu7BMbEYMepA==", "dev": true, "dependencies": { "@puppeteer/browsers": "0.5.0", "chromium-bidi": "0.4.7", "cross-fetch": "3.1.5", "debug": "4.3.4", "devtools-protocol": "0.0.1107588", "extract-zip": "2.0.1", "https-proxy-agent": "5.0.1", "proxy-from-env": "1.1.0", "tar-fs": "2.1.1", "unbzip2-stream": "1.4.3", "ws": "8.13.0" }, "engines": { "node": ">=14.14.0" }, "peerDependencies": { "typescript": ">= 4.7.4" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "dependencies": { "safe-buffer": "^5.1.0" } }, "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "dependencies": { "@types/normalize-package-data": "^2.4.0", "normalize-package-data": "^2.5.0", "parse-json": "^5.0.0", "type-fest": "^0.6.0" }, "engines": { "node": ">=8" } }, "node_modules/read-pkg-up": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "dependencies": { "find-up": "^4.1.0", "read-pkg": "^5.2.0", "type-fest": "^0.8.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/read-pkg-up/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/read-pkg-up/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { "p-locate": "^4.1.0" }, "engines": { "node": ">=8" } }, "node_modules/read-pkg-up/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { "p-try": "^2.0.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/read-pkg-up/node_modules/p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { "p-limit": "^2.2.0" }, "engines": { "node": ">=8" } }, "node_modules/read-pkg-up/node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" }, "engines": { "node": ">= 6" } }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "dependencies": { "picomatch": "^2.2.1" }, "engines": { "node": ">=8.10.0" } }, "node_modules/rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, "dependencies": { "resolve": "^1.1.6" }, "engines": { "node": ">= 0.10" } }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", "dev": true }, "node_modules/regenerate-unicode-properties": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", "dev": true, "dependencies": { "regenerate": "^1.4.0" }, "engines": { "node": ">=4" } }, "node_modules/regenerator-runtime": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", "dev": true }, "node_modules/regexp-tree": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", "dev": true, "bin": { "regexp-tree": "bin/regexp-tree" } }, "node_modules/regexp.prototype.flags": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "set-function-name": "^2.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/regexpu-core": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", "dev": true, "dependencies": { "regenerate": "^1.4.0", "regenerate-unicode-properties": "^8.0.2", "regjsgen": "^0.5.0", "regjsparser": "^0.6.0", "unicode-match-property-ecmascript": "^1.0.4", "unicode-match-property-value-ecmascript": "^1.1.0" }, "engines": { "node": ">=4" } }, "node_modules/regexpu-core/node_modules/jsesc": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", "dev": true, "bin": { "jsesc": "bin/jsesc" } }, "node_modules/regexpu-core/node_modules/regjsparser": { "version": "0.6.9", "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", "dev": true, "dependencies": { "jsesc": "~0.5.0" }, "bin": { "regjsparser": "bin/parser" } }, "node_modules/regjsgen": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", "dev": true }, "node_modules/regjsparser": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.10.0.tgz", "integrity": "sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==", "dev": true, "dependencies": { "jsesc": "~0.5.0" }, "bin": { "regjsparser": "bin/parser" } }, "node_modules/regjsparser/node_modules/jsesc": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", "dev": true, "bin": { "jsesc": "bin/jsesc" } }, "node_modules/release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", "dev": true, "dependencies": { "es6-error": "^4.0.1" }, "engines": { "node": ">=4" } }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "node_modules/requirejs": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", "dev": true, "bin": { "r_js": "bin/r.js", "r.js": "bin/r.js" }, "engines": { "node": ">=0.4.0" } }, "node_modules/resolve": { "version": "1.22.6", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" }, "engines": { "node": ">=8" } }, "node_modules/restore-cursor/node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/restore-cursor/node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/restore-cursor/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, "node_modules/rfdc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", "dev": true }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rimraf/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rollup": { "version": "3.29.2", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.2.tgz", "integrity": "sha512-CJouHoZ27v6siztc21eEQGo0kIcE5D1gVPA571ez0mMYb25LGYGKnVNXpEj5MGlepmDWGXNjDB5q7uNiPHC11A==", "dev": true, "bin": { "rollup": "dist/bin/rollup" }, "engines": { "node": ">=14.18.0", "npm": ">=8.0.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "node_modules/rollup-plugin-license": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-3.1.0.tgz", "integrity": "sha512-Cny2H2hJ7K+VdcJkH1pNcYRVhqIhZNu/fPusedW53fNZQOIwpXiznJ220EFvDkJbFUEkLqIDsDB5bEr/N9qfqw==", "dev": true, "dependencies": { "commenting": "~1.1.0", "glob": "~7.2.0", "lodash": "~4.17.21", "magic-string": "~0.30.0", "mkdirp": "~3.0.0", "moment": "~2.29.3", "package-name-regex": "~2.0.6", "spdx-expression-validate": "~2.0.0", "spdx-satisfies": "~5.0.1" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { "rollup": "^1.0.0 || ^2.0.0 || ^3.0.0" } }, "node_modules/rollup-plugin-license/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rollup-plugin-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/rollup-plugin-string/-/rollup-plugin-string-3.0.0.tgz", "integrity": "sha512-vqyzgn9QefAgeKi+Y4A7jETeIAU1zQmS6VotH6bzm/zmUQEnYkpIGRaOBPY41oiWYV4JyBoGAaBjYMYuv+6wVw==", "dev": true, "dependencies": { "rollup-pluginutils": "^2.4.1" } }, "node_modules/rollup-plugin-thatworks": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/rollup-plugin-thatworks/-/rollup-plugin-thatworks-1.0.4.tgz", "integrity": "sha512-RxlYx/oolwXW7akleFzRmJ8gQrWUK4NSZw8E+LHJTWHiA1mhseIMurz8IkyDAG4fwensXHocNYvKUHivhN9EXw==", "dev": true, "engines": { "node": ">= 12" } }, "node_modules/rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", "dev": true, "dependencies": { "estree-walker": "^0.6.1" } }, "node_modules/rollup-pluginutils/node_modules/estree-walker": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true }, "node_modules/run-applescript": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==", "dev": true, "dependencies": { "execa": "^5.0.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/run-applescript/node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.1", "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, "node_modules/run-applescript/node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, "engines": { "node": ">=10.17.0" } }, "node_modules/run-applescript/node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/run-applescript/node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/run-applescript/node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "dependencies": { "path-key": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/run-applescript/node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/run-applescript/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/run-applescript/node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/run-async": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", "dev": true, "engines": { "node": ">=0.12.0" } }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ], "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dev": true, "dependencies": { "tslib": "^2.1.0" } }, "node_modules/safe-array-concat": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, "engines": { "node": ">=0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] }, "node_modules/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", "is-regex": "^1.1.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "node_modules/search-insights": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.8.2.tgz", "integrity": "sha512-PxA9M5Q2bpBelVvJ3oDZR8nuY00Z6qwOxL53wNpgzV28M/D6u9WUbImDckjLSILBF8F1hn/mgyuUaOPtjow4Qw==", "dev": true, "peer": true }, "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" }, "engines": { "node": ">=10" } }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { "yallist": "^4.0.0" }, "engines": { "node": ">=10" } }, "node_modules/semver/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "node_modules/serialize-javascript": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", "dev": true, "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, "node_modules/set-function-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", "dev": true, "dependencies": { "define-data-property": "^1.0.1", "functions-have-names": "^1.2.3", "has-property-descriptors": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/setimmediate-napi": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/setimmediate-napi/-/setimmediate-napi-1.0.6.tgz", "integrity": "sha512-sdNXN15Av1jPXuSal4Mk4tEAKn0+8lfF9Z50/negaQMrAIO9c1qM0eiCh8fT6gctp0RiCObk+6/Xfn5RMGdZoA==", "dev": true, "dependencies": { "get-symbol-from-current-process-h": "^1.0.1", "get-uv-event-loop-napi-h": "^1.0.5" } }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/shell-quote": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/shelljs": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, "dependencies": { "glob": "^7.0.0", "interpret": "^1.0.0", "rechoir": "^0.6.2" }, "bin": { "shjs": "bin/shjs" }, "engines": { "node": ">=4" } }, "node_modules/shelljs/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/shiki": { "version": "0.14.4", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.4.tgz", "integrity": "sha512-IXCRip2IQzKwxArNNq1S+On4KPML3Yyn8Zzs/xRgcgOWIr8ntIK3IKzjFPfjy/7kt9ZMjc+FItfqHRBg8b6tNQ==", "dev": true, "dependencies": { "ansi-sequence-parser": "^1.1.0", "jsonc-parser": "^3.2.0", "vscode-oniguruma": "^1.7.0", "vscode-textmate": "^8.0.0" } }, "node_modules/shx": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", "dev": true, "dependencies": { "minimist": "^1.2.3", "shelljs": "^0.8.5" }, "bin": { "shx": "lib/cli.js" }, "engines": { "node": ">=6" } }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dev": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", "object-inspect": "^1.9.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/slice-ansi": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "dev": true, "dependencies": { "ansi-styles": "^6.0.0", "is-fullwidth-code-point": "^4.0.0" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/smob": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.1.tgz", "integrity": "sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==", "dev": true }, "node_modules/source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "dev": true, "engines": { "node": ">= 8" } }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "node_modules/source-map-support/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "deprecated": "Please use @jridgewell/sourcemap-codec instead", "dev": true }, "node_modules/spawn-command": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==", "dev": true }, "node_modules/spawn-wrap": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, "dependencies": { "foreground-child": "^2.0.0", "is-windows": "^1.0.2", "make-dir": "^3.0.0", "rimraf": "^3.0.0", "signal-exit": "^3.0.2", "which": "^2.0.1" }, "engines": { "node": ">=8" } }, "node_modules/spawn-wrap/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/spdx-compare": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz", "integrity": "sha512-C1mDZOX0hnu0ep9dfmuoi03+eOdDoz2yvK79RxbcrVEG1NO1Ph35yW102DHWKN4pk80nwCgeMmSY5L25VE4D9A==", "dev": true, "dependencies": { "array-find-index": "^1.0.2", "spdx-expression-parse": "^3.0.0", "spdx-ranges": "^2.0.0" } }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "dev": true, "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, "node_modules/spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "node_modules/spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "node_modules/spdx-expression-validate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-validate/-/spdx-expression-validate-2.0.0.tgz", "integrity": "sha512-b3wydZLM+Tc6CFvaRDBOF9d76oGIHNCLYFeHbftFXUWjnfZWganmDmvtM5sm1cRwJc/VDBMLyGGrsLFd1vOxbg==", "dev": true, "dependencies": { "spdx-expression-parse": "^3.0.0" } }, "node_modules/spdx-license-ids": { "version": "3.0.15", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz", "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==", "dev": true }, "node_modules/spdx-ranges": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.1.tgz", "integrity": "sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA==", "dev": true }, "node_modules/spdx-satisfies": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-5.0.1.tgz", "integrity": "sha512-Nwor6W6gzFp8XX4neaKQ7ChV4wmpSh2sSDemMFSzHxpTw460jxFYeOn+jq4ybnSSw/5sc3pjka9MQPouksQNpw==", "dev": true, "dependencies": { "spdx-compare": "^1.0.0", "spdx-expression-parse": "^3.0.0", "spdx-ranges": "^2.0.0" } }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", "dev": true, "engines": { "node": ">=0.6.19" } }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/string-width/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/string.prototype.trim": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimend": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", "dev": true, "dependencies": { "min-indent": "^1.0.0" }, "engines": { "node": ">=8" } }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/style-mod": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.0.tgz", "integrity": "sha512-Ca5ib8HrFn+f+0n4N4ScTIA9iTOQ7MaGS1ylHcoVqW9J7w2w8PzN6g9gKmTYgGEBH8e120+RCmhpje6jC5uGWA==", "dev": true }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/synckit": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", "dev": true, "dependencies": { "@pkgr/utils": "^2.3.1", "tslib": "^2.5.0" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/unts" } }, "node_modules/systemjs": { "version": "6.14.2", "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.14.2.tgz", "integrity": "sha512-1TlOwvKWdXxAY9vba+huLu99zrQURDWA8pUTYsRIYDZYQbGyK+pyEP4h4dlySsqo7ozyJBmYD20F+iUHhAltEg==", "dev": true }, "node_modules/tabbable": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==", "dev": true }, "node_modules/tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", "dev": true, "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.1.4" } }, "node_modules/tar-stream": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "dev": true, "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" }, "engines": { "node": ">=6" } }, "node_modules/terser": { "version": "5.20.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", "integrity": "sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" }, "engines": { "node": ">=10" } }, "node_modules/terser/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", "minimatch": "^3.0.4" }, "engines": { "node": ">=8" } }, "node_modules/test-exclude/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, "node_modules/time-zone": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-2.0.0.tgz", "integrity": "sha512-2cp/YLRm7ly33CzvySyXqo/QEOu4KMn6fCof0gpqosWY3PEJUJJhXP/Cb2wXFUuCzWWJYEmPvdHNzjLlfXC49A==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/titleize": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", "dev": true, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "dependencies": { "os-tmpdir": "~1.0.2" }, "engines": { "node": ">=0.6.0" } }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "dependencies": { "is-number": "^7.0.0" }, "engines": { "node": ">=8.0" } }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true, "bin": { "tree-kill": "cli.js" } }, "node_modules/ts-api-utils": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", "dev": true, "engines": { "node": ">=16.13.0" }, "peerDependencies": { "typescript": ">=4.2.0" } }, "node_modules/tsconfig-paths": { "version": "3.14.2", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "node_modules/tsconfig-paths/node_modules/json5": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" }, "bin": { "json5": "lib/cli.js" } }, "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "dependencies": { "prelude-ls": "^1.2.1" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/typed-array-buffer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1", "is-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "for-each": "^0.3.3", "has-proto": "^1.0.1", "is-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typed-array-byte-offset": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "has-proto": "^1.0.1", "is-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typed-array-length": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "for-each": "^0.3.3", "is-typed-array": "^1.1.9" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, "dependencies": { "is-typedarray": "^1.0.0" } }, "node_modules/typescript": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=14.17" } }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/unbzip2-stream": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", "dev": true, "dependencies": { "buffer": "^5.2.1", "through": "^2.3.8" } }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/unicode-match-property-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", "dev": true, "dependencies": { "unicode-canonical-property-names-ecmascript": "^1.0.4", "unicode-property-aliases-ecmascript": "^1.0.4" }, "engines": { "node": ">=4" } }, "node_modules/unicode-match-property-value-ecmascript": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/unicode-property-aliases-ecmascript": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", "dev": true, "engines": { "node": ">= 10.0.0" } }, "node_modules/untildify": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/update-browserslist-db": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0" }, "bin": { "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" } }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "dependencies": { "punycode": "^2.1.0" } }, "node_modules/utf8": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", "integrity": "sha512-QXo+O/QkLP/x1nyi54uQiG0XrODxdysuQvE5dtVqv7F5K2Qb6FsN+qbr6KhF5wQ20tfcV3VQp0/2x1e1MRSPWg==", "dev": true }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, "node_modules/vite": { "version": "4.4.9", "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", "dev": true, "dependencies": { "esbuild": "^0.18.10", "postcss": "^8.4.27", "rollup": "^3.27.1" }, "bin": { "vite": "bin/vite.js" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" }, "optionalDependencies": { "fsevents": "~2.3.2" }, "peerDependencies": { "@types/node": ">= 14", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, "less": { "optional": true }, "lightningcss": { "optional": true }, "sass": { "optional": true }, "stylus": { "optional": true }, "sugarss": { "optional": true }, "terser": { "optional": true } } }, "node_modules/vitepress": { "version": "1.0.0-rc.15", "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-1.0.0-rc.15.tgz", "integrity": "sha512-5criiHoEibkT/du7t6wQ2xQVsuTNuirQZbMAi0M9Hp0YzJoJvEX68Ej9p2PtNC84bYb/CxAh5QkMtMutk03lHw==", "dev": true, "dependencies": { "@docsearch/css": "^3.5.2", "@docsearch/js": "^3.5.2", "@vue/devtools-api": "^6.5.0", "@vueuse/core": "^10.4.1", "@vueuse/integrations": "^10.4.1", "focus-trap": "^7.5.2", "mark.js": "8.11.1", "minisearch": "^6.1.0", "shiki": "^0.14.4", "vite": "^4.4.9", "vue": "^3.3.4" }, "bin": { "vitepress": "bin/vitepress.js" }, "peerDependencies": { "markdown-it-mathjax3": "^4.3.2" }, "peerDependenciesMeta": { "markdown-it-mathjax3": { "optional": true } } }, "node_modules/vscode-oniguruma": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", "dev": true }, "node_modules/vscode-textmate": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", "dev": true }, "node_modules/vue": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", "dev": true, "dependencies": { "@vue/compiler-dom": "3.3.4", "@vue/compiler-sfc": "3.3.4", "@vue/runtime-dom": "3.3.4", "@vue/server-renderer": "3.3.4", "@vue/shared": "3.3.4" } }, "node_modules/vue-eslint-parser": { "version": "9.3.1", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.3.1.tgz", "integrity": "sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==", "dev": true, "dependencies": { "debug": "^4.3.4", "eslint-scope": "^7.1.1", "eslint-visitor-keys": "^3.3.0", "espree": "^9.3.1", "esquery": "^1.4.0", "lodash": "^4.17.21", "semver": "^7.3.6" }, "engines": { "node": "^14.17.0 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/mysticatea" }, "peerDependencies": { "eslint": ">=6.0.0" } }, "node_modules/w3c-keyname": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", "dev": true }, "node_modules/walk-sync": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/walk-sync/-/walk-sync-3.0.0.tgz", "integrity": "sha512-41TvKmDGVpm2iuH7o+DAOt06yyu/cSHpX3uzAwetzASvlNtVddgIjXIb2DfB/Wa20B1Jo86+1Dv1CraSU7hWdw==", "dev": true, "dependencies": { "@types/minimatch": "^3.0.4", "ensure-posix-path": "^1.1.0", "matcher-collection": "^2.0.1", "minimatch": "^3.0.4" }, "engines": { "node": "10.* || >= 12.*" } }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "dev": true, "dependencies": { "defaults": "^1.0.3" } }, "node_modules/weak-napi": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/weak-napi/-/weak-napi-2.0.2.tgz", "integrity": "sha512-LcOSVFrghtVXf4QH+DLIy8iPiCktV7lVbqRDYP+bDPpLzC41RCHQPMyQOnPpWO41Ie4CmnDxS+mbL72r5xFMMQ==", "dev": true, "hasInstallScript": true, "dependencies": { "node-addon-api": "^3.0.0", "node-gyp-build": "^4.2.1", "setimmediate-napi": "^1.0.3" } }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "dev": true }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "bin/node-which" }, "engines": { "node": ">= 8" } }, "node_modules/which-boxed-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", "is-number-object": "^1.0.4", "is-string": "^1.0.5", "is-symbol": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-module": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", "dev": true }, "node_modules/which-typed-array": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { "node": ">=8" } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/wrap-ansi/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "node_modules/write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, "dependencies": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", "signal-exit": "^3.0.2", "typedarray-to-buffer": "^3.1.5" } }, "node_modules/write-file-atomic/node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "dev": true, "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { "optional": true }, "utf-8-validate": { "optional": true } } }, "node_modules/xml-name-validator": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", "dev": true, "engines": { "node": ">=12" } }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "node_modules/yaml": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", "dev": true, "engines": { "node": ">= 14" } }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" }, "engines": { "node": ">=12" } }, "node_modules/yargs-parser": { "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "engines": { "node": ">=12" } }, "node_modules/yargs-unparser": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", "flat": "^5.0.2", "is-plain-obj": "^2.1.0" }, "engines": { "node": ">=10" } }, "node_modules/yargs-unparser/node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/yargs-unparser/node_modules/decamelize": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" } }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } } } } rollup-3.29.4/package.json000066400000000000000000000147241450520414700154260ustar00rootroot00000000000000{ "name": "rollup", "version": "3.29.4", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", "types": "dist/rollup.d.ts", "bin": { "rollup": "dist/bin/rollup" }, "scripts": { "build": "rollup --config rollup.config.ts --configPlugin typescript", "dev": "vitepress dev docs", "build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest", "build:bootstrap": "node dist/bin/rollup --config rollup.config.ts --configPlugin typescript", "build:docs": "vitepress build docs", "preview:docs": "vitepress preview docs", "ci:lint": "concurrently 'npm:lint:js:nofix' 'npm:lint:markdown:nofix'", "ci:test": "npm run build:cjs && npm run build:bootstrap && npm run test:all", "ci:test:only": "npm run build:cjs && npm run build:bootstrap && npm run test:only", "ci:coverage": "npm run build:cjs && npm run build:bootstrap && nyc --reporter lcovonly mocha", "lint": "concurrently -c red,green 'npm:lint:js' 'npm:lint:markdown'", "lint:js": "eslint . --fix --cache", "lint:js:nofix": "eslint . --cache", "lint:markdown": "prettier --write \"**/*.md\"", "lint:markdown:nofix": "prettier --check \"**/*.md\"", "perf": "npm run build:cjs && node --expose-gc scripts/perf.js", "perf:init": "node scripts/perf-init.js", "prepare": "husky install && node scripts/check-release.js || npm run build", "prepublishOnly": "node scripts/check-release.js", "release": "node scripts/release.js", "release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published", "test": "npm run build && npm run test:all", "test:update-snapshots": "node scripts/update-snapshots.js", "test:cjs": "npm run build:cjs && npm run test:only", "test:quick": "mocha -b test/test.js", "test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:leak' 'npm:test:package' 'npm:test:options'", "test:coverage": "npm run build:cjs && shx rm -rf coverage/* && nyc --reporter html mocha test/test.js", "test:coverage:browser": "npm run build && shx rm -rf coverage/* && nyc mocha test/browser/index.js", "test:leak": "node --expose-gc test/leak/index.js", "test:package": "node scripts/test-package.js", "test:options": "node scripts/test-options.js", "test:only": "mocha test/test.js", "test:typescript": "shx rm -rf test/typescript/dist && shx cp -r dist test/typescript/ && tsc --noEmit -p test/typescript && tsc --noEmit", "test:browser": "mocha test/browser/index.js", "watch": "rollup --config rollup.config.ts --configPlugin typescript --watch" }, "repository": "rollup/rollup", "keywords": [ "modules", "bundler", "bundling", "es6", "optimizer" ], "author": "Rich Harris", "license": "MIT", "bugs": { "url": "https://github.com/rollup/rollup/issues" }, "homepage": "https://rollupjs.org/", "optionalDependencies": { "fsevents": "~2.3.2" }, "devDependenciesComments": { "@rollup/plugin-typescript": "It appears that 11.1.3 breaks sourcemaps" }, "devDependencies": { "@codemirror/commands": "^6.2.5", "@codemirror/lang-javascript": "^6.2.1", "@codemirror/language": "^6.9.0", "@codemirror/search": "^6.5.3", "@codemirror/state": "^6.2.1", "@codemirror/view": "^6.19.0", "@jridgewell/sourcemap-codec": "^1.4.15", "@mermaid-js/mermaid-cli": "^10.4.0", "@rollup/plugin-alias": "^5.0.0", "@rollup/plugin-buble": "^1.0.2", "@rollup/plugin-commonjs": "^25.0.4", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.2.1", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-terser": "^0.4.3", "@rollup/plugin-typescript": "11.1.2", "@rollup/pluginutils": "^5.0.4", "@types/estree": "1.0.1", "@types/mocha": "^10.0.1", "@types/node": "~14.18.61", "@types/yargs-parser": "^21.0.0", "@typescript-eslint/eslint-plugin": "^6.7.2", "@typescript-eslint/parser": "^6.7.2", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "acorn": "^8.10.0", "acorn-import-assertions": "^1.9.0", "acorn-jsx": "^5.3.2", "acorn-walk": "^8.2.0", "buble": "^0.20.0", "builtin-modules": "^3.3.0", "chokidar": "^3.5.3", "colorette": "^2.0.20", "concurrently": "^8.2.1", "core-js": "^3.32.2", "date-time": "^4.0.0", "es5-shim": "^4.6.7", "es6-shim": "^0.35.8", "eslint": "^8.49.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.28.1", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-unicorn": "^48.0.1", "eslint-plugin-vue": "^9.17.0", "fixturify": "^3.0.0", "flru": "^1.0.2", "fs-extra": "^11.1.1", "github-api": "^3.4.0", "hash.js": "^1.1.7", "husky": "^8.0.3", "inquirer": "^9.2.11", "is-reference": "^3.0.2", "lint-staged": "^14.0.1", "locate-character": "^3.0.0", "magic-string": "^0.30.3", "mocha": "^10.2.0", "nyc": "^15.1.0", "pinia": "^2.1.6", "prettier": "^3.0.3", "pretty-bytes": "^6.1.1", "pretty-ms": "^8.0.0", "requirejs": "^2.3.6", "rollup": "^3.29.2", "rollup-plugin-license": "^3.1.0", "rollup-plugin-string": "^3.0.0", "rollup-plugin-thatworks": "^1.0.4", "semver": "^7.5.4", "shx": "^0.3.4", "signal-exit": "^4.1.0", "source-map": "^0.7.4", "source-map-support": "^0.5.21", "systemjs": "^6.14.2", "terser": "^5.19.4", "tslib": "^2.6.2", "typescript": "^5.2.2", "vite": "^4.4.9", "vitepress": "^1.0.0-rc.14", "vue": "^3.3.4", "weak-napi": "^2.0.2", "yargs-parser": "^21.1.1" }, "overrides": { "semver": "^7.5.4" }, "files": [ "dist/**/*.js", "dist/*.d.ts", "dist/bin/rollup", "dist/es/package.json" ], "engines": { "node": ">=14.18.0", "npm": ">=8.0.0" }, "exports": { ".": { "types": "./dist/rollup.d.ts", "require": "./dist/rollup.js", "import": "./dist/es/rollup.js" }, "./loadConfigFile": { "types": "./dist/loadConfigFile.d.ts", "require": "./dist/loadConfigFile.js", "default": "./dist/loadConfigFile.js" }, "./getLogFilter": { "types": "./dist/getLogFilter.d.ts", "require": "./dist/getLogFilter.js", "import": "./dist/es/getLogFilter.js" }, "./dist/*": "./dist/*" } } rollup-3.29.4/renovate.json000066400000000000000000000015111450520414700156440ustar00rootroot00000000000000{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:recommended"], "dependencyDashboard": true, "configMigration": true, "rangeStrategy": "bump", "packageRules": [ { "matchPackageNames": ["node", "npm", "fsevents", "@rollup/plugin-typescript"], "enabled": false }, { "matchPackageNames": ["@types/node"], "matchUpdateTypes": ["major", "minor"], "enabled": false }, { "matchUpdateTypes": ["minor", "patch", "lockFileMaintenance"], "automergeSchedule": ["after 10am on Friday"], "groupName": "minor/patch updates" } ], "automerge": true, "internalChecksFilter": "strict", "lockFileMaintenance": { "enabled": true, "schedule": ["before 4am on Friday"] }, "minimumReleaseAge": "3 days", "schedule": ["before 4am on Friday"], "automergeStrategy": "squash" } rollup-3.29.4/rollup.config.ts000066400000000000000000000110501450520414700162560ustar00rootroot00000000000000import { fileURLToPath } from 'node:url'; import alias from '@rollup/plugin-alias'; import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; import { nodeResolve } from '@rollup/plugin-node-resolve'; import replace from '@rollup/plugin-replace'; import terser from '@rollup/plugin-terser'; import typescript from '@rollup/plugin-typescript'; import type { Plugin, RollupOptions, WarningHandlerWithDefault } from 'rollup'; import { string } from 'rollup-plugin-string'; import addCliEntry from './build-plugins/add-cli-entry'; import { moduleAliases } from './build-plugins/aliases'; import cleanBeforeWrite from './build-plugins/clean-before-write'; import { copyBrowserTypes, copyNodeTypes } from './build-plugins/copy-types'; import emitModulePackageFile from './build-plugins/emit-module-package-file'; import esmDynamicImport from './build-plugins/esm-dynamic-import'; import { fsEventsReplacement } from './build-plugins/fs-events-replacement'; import getLicenseHandler from './build-plugins/generate-license-file'; import getBanner from './build-plugins/get-banner'; import replaceBrowserModules from './build-plugins/replace-browser-modules'; const onwarn: WarningHandlerWithDefault = warning => { // eslint-disable-next-line no-console console.error( 'Building Rollup produced warnings that need to be resolved. ' + 'Please keep in mind that the browser build may never have external dependencies!' ); // eslint-disable-next-line unicorn/error-message throw Object.assign(new Error(), warning); }; const treeshake = { moduleSideEffects: false, propertyReadSideEffects: false, tryCatchDeoptimization: false }; const nodePlugins: readonly Plugin[] = [ replace(fsEventsReplacement), alias(moduleAliases), nodeResolve(), json(), string({ include: '**/*.md' }), commonjs({ ignoreTryCatch: false, include: 'node_modules/**' }), typescript(), cleanBeforeWrite('dist') ]; export default async function ( command: Record ): Promise { const { collectLicenses, writeLicense } = getLicenseHandler( fileURLToPath(new URL('.', import.meta.url)) ); const commonJSBuild: RollupOptions = { // 'fsevents' is a dependency of 'chokidar' that cannot be bundled as it contains binary code external: ['fsevents'], input: { 'getLogFilter.js': 'src/utils/getLogFilter.ts', 'loadConfigFile.js': 'cli/run/loadConfigFile.ts', 'rollup.js': 'src/node-entry.ts' }, onwarn, output: { banner: getBanner, chunkFileNames: 'shared/[name].js', dir: 'dist', entryFileNames: '[name]', exports: 'named', externalLiveBindings: false, format: 'cjs', freeze: false, generatedCode: 'es2015', interop: 'default', sourcemap: true }, plugins: [ ...nodePlugins, addCliEntry(), esmDynamicImport(), !command.configTest && collectLicenses(), !command.configTest && copyNodeTypes() ], strictDeprecations: true, treeshake }; if (command.configTest) { return commonJSBuild; } const esmBuild: RollupOptions = { ...commonJSBuild, input: { 'getLogFilter.js': 'src/utils/getLogFilter.ts', 'rollup.js': 'src/node-entry.ts' }, output: { ...commonJSBuild.output, dir: 'dist/es', format: 'es', minifyInternalExports: false, sourcemap: false }, plugins: [...nodePlugins, emitModulePackageFile(), collectLicenses(), writeLicense()] }; const { collectLicenses: collectLicensesBrowser, writeLicense: writeLicenseBrowser } = getLicenseHandler(fileURLToPath(new URL('browser', import.meta.url))); const browserBuilds: RollupOptions = { input: 'src/browser-entry.ts', onwarn, output: [ { banner: getBanner, file: 'browser/dist/rollup.browser.js', format: 'umd', name: 'rollup', plugins: [copyBrowserTypes()], sourcemap: true }, { banner: getBanner, file: 'browser/dist/es/rollup.browser.js', format: 'es', plugins: [emitModulePackageFile()] } ], plugins: [ replaceBrowserModules(), alias(moduleAliases), nodeResolve({ browser: true }), json(), commonjs(), typescript(), terser({ module: true, output: { comments: 'some' } }), collectLicensesBrowser(), writeLicenseBrowser(), cleanBeforeWrite('browser/dist'), { closeBundle() { // On CI, macOS runs sometimes do not close properly. This is a hack // to fix this until the problem is understood. console.log('Force quit.'); setTimeout(() => process.exit(0)); }, name: 'force-close' } ], strictDeprecations: true, treeshake }; return [commonJSBuild, esmBuild, browserBuilds]; } rollup-3.29.4/scripts/000077500000000000000000000000001450520414700146175ustar00rootroot00000000000000rollup-3.29.4/scripts/check-release.js000077500000000000000000000001661450520414700176560ustar00rootroot00000000000000#!/usr/bin/env node import { env, exit } from 'node:process'; if (env.ROLLUP_RELEASE !== 'releasing') { exit(1); } rollup-3.29.4/scripts/colors.js000066400000000000000000000004111450520414700164520ustar00rootroot00000000000000import { env } from 'node:process'; import { createColors } from 'colorette'; // @see https://no-color.org // @see https://www.npmjs.com/package/chalk export const { bold, cyan, green, red } = createColors({ useColor: env.FORCE_COLOR !== '0' && !env.NO_COLOR }); rollup-3.29.4/scripts/find-config.js000066400000000000000000000007731450520414700173470ustar00rootroot00000000000000import { readdir } from 'node:fs/promises'; import { resolve } from 'node:path'; export async function findConfigFileName(targetDirectory) { const filesInWorkingDirectory = new Set(await readdir(targetDirectory)); for (const extension of ['mjs', 'cjs', 'ts', 'js']) { const fileName = `rollup.config.${extension}`; if (filesInWorkingDirectory.has(fileName)) return resolve(targetDirectory, fileName); } throw new Error('The repository needs to have a file "rollup.config.js" at the top level.'); } rollup-3.29.4/scripts/helpers.js000066400000000000000000000023601450520414700166200ustar00rootroot00000000000000import { spawn } from 'node:child_process'; import { bold, cyan, green } from './colors.js'; export function runWithEcho(command, parameters, options) { return new Promise((resolve, reject) => { const cmdString = formatCommand(command, parameters); console.error(bold(`\n${cyan`Run>`} ${cmdString}`)); const childProcess = spawn(command, parameters, options); childProcess.stdout.pipe(process.stdout); childProcess.stderr.pipe(process.stderr); childProcess.on('close', code => { if (code) { reject(new Error(`"${cmdString}" exited with code ${code}.`)); } else { console.error(bold(`${green`Finished>`} ${cmdString}\n`)); resolve(); } }); }); } export function runAndGetStdout(command, parameters) { return new Promise((resolve, reject) => { const childProcess = spawn(command, parameters); let stdout = ''; childProcess.stderr.pipe(process.stderr); childProcess.stdout.on('data', data => (stdout += String(data))); childProcess.on('close', code => { if (code) { reject(new Error(`"${formatCommand(command, parameters)}" exited with code ${code}.`)); } else { resolve(stdout.trim()); } }); }); } function formatCommand(command, parameters) { return [command, ...parameters].join(' '); } rollup-3.29.4/scripts/package.json000066400000000000000000000000271450520414700171040ustar00rootroot00000000000000{ "type": "module" } rollup-3.29.4/scripts/perf-init.js000066400000000000000000000023541450520414700170560ustar00rootroot00000000000000/* eslint-disable no-console */ import { rmSync } from 'node:fs'; import { argv, chdir, exit } from 'node:process'; import { fileURLToPath } from 'node:url'; import { findConfigFileName } from './find-config.js'; import { runWithEcho } from './helpers.js'; const TARGET_DIR = fileURLToPath(new URL('../perf', import.meta.url).href); const VALID_REPO = /^([^\s#/]+\/[^\s#/]+)(#([^\s#/]+))?$/; const repoWithBranch = argv[2]; if (argv.length !== 3 || !VALID_REPO.test(repoWithBranch)) { console.error( 'You need to provide a GitHub repo in the form / or /#branch, e.g. ' + '"npm run perf:init rollup/rollup"' ); exit(1); } console.error(`Cleaning up '${TARGET_DIR}'...`); rmSync(TARGET_DIR, { force: true, recursive: true }); const [, repo, , branch] = VALID_REPO.exec(repoWithBranch); const gitArguments = ['clone', '--depth', 1, '--progress']; if (branch) { console.error(`Cloning branch "${branch}" of "${repo}"...`); gitArguments.push('--branch', branch); } else { console.error(`Cloning "${repo}"...`); } gitArguments.push(`https://github.com/${repo}.git`, TARGET_DIR); await runWithEcho('git', gitArguments); await findConfigFileName(TARGET_DIR); chdir(TARGET_DIR); await runWithEcho('npm', ['install']); rollup-3.29.4/scripts/perf.js000066400000000000000000000147451450520414700161240ustar00rootroot00000000000000/* global gc */ import { readFileSync, writeFileSync } from 'node:fs'; import { argv, chdir, cwd, exit } from 'node:process'; import { fileURLToPath } from 'node:url'; import { createColors } from 'colorette'; import prettyBytes from 'pretty-bytes'; // eslint-disable-next-line import/no-unresolved import { loadConfigFile } from '../dist/loadConfigFile.js'; // eslint-disable-next-line import/no-unresolved import { rollup } from '../dist/rollup.js'; import { findConfigFileName } from './find-config.js'; const initialDirectory = cwd(); const targetDirectory = fileURLToPath(new URL('../perf', import.meta.url).href); const perfFile = fileURLToPath(new URL('../perf/rollup.perf.json', import.meta.url).href); const { bold, underline, cyan, red, green } = createColors(); const MIN_ABSOLUTE_TIME_DEVIATION = 10; const RELATIVE_DEVIATION_FOR_COLORING = 5; chdir(targetDirectory); const configFile = await findConfigFileName(targetDirectory); const configs = await loadConfigFile( configFile, configFile.endsWith('.ts') ? { configPlugin: 'typescript' } : {} ); let numberOfRunsToAverage = 6; let numberOfDiscardedResults = 3; if (argv.length >= 3) { numberOfRunsToAverage = Number.parseInt(argv[2]); if (argv.length >= 4) { numberOfDiscardedResults = Number.parseInt(argv[3]); } } if (!(numberOfDiscardedResults >= 0) || !(numberOfDiscardedResults < numberOfRunsToAverage)) { console.error( `Invalid parameters: runs = ${numberOfRunsToAverage}, discarded = ${numberOfDiscardedResults}.\n` + 'Usage: "npm run perf [ []]"\n' + 'where 0 <= < ' ); exit(1); } console.info( bold( `Calculating the average of ${cyan(numberOfRunsToAverage)} runs discarding the ${cyan( numberOfDiscardedResults )} largest results.\n` ) + 'Run "npm run perf " to change that.' ); await calculatePrintAndPersistTimings(configs.options[0], await getExistingTimings()); function getSingleAverage(times, runs, discarded) { const actualDiscarded = Math.min(discarded, runs - 1); return ( times .sort() .reverse() .slice(actualDiscarded) .reduce((sum, time) => sum + time, 0) / (runs - actualDiscarded) ); } function getAverage(accumulatedMeasurements, runs, discarded) { const average = {}; for (const label of Object.keys(accumulatedMeasurements)) { average[label] = { memory: getSingleAverage( accumulatedMeasurements[label].map(timing => timing[2]), runs, discarded ), time: getSingleAverage( accumulatedMeasurements[label].map(timing => timing[0]), runs, discarded ) }; } return average; } async function calculatePrintAndPersistTimings(config, existingTimings) { const timings = await buildAndGetTimings(config); for (const label of Object.keys(timings)) { timings[label] = [timings[label]]; } for (let currentRun = 1; currentRun < numberOfRunsToAverage; currentRun++) { const numberOfLinesToClear = printMeasurements( getAverage(timings, currentRun, numberOfDiscardedResults), existingTimings, /^#/ ); console.info(`Completed run ${currentRun}.`); const currentTimings = await buildAndGetTimings(config); clearLines(numberOfLinesToClear); for (const label of Object.keys(timings)) { if (currentTimings.hasOwnProperty(label)) { timings[label].push(currentTimings[label]); } else { delete timings[label]; } } } const averageTimings = getAverage(timings, numberOfRunsToAverage, numberOfDiscardedResults); printMeasurements(averageTimings, existingTimings); if (Object.keys(existingTimings).length === 0) persistTimings(averageTimings); } async function buildAndGetTimings(config) { config.perf = true; if (Array.isArray(config.output)) { config.output = config.output[0]; } gc(); chdir(targetDirectory); const bundle = await rollup(config); chdir(initialDirectory); await bundle.generate(config.output); return bundle.getTimings(); } function printMeasurements(average, existingAverage, filter = /.*/) { const printedLabels = Object.keys(average).filter(label => filter.test(label)); console.info(''); for (const label of printedLabels) { let color = identity; if (label[0] === '#') { color = bold; if (label[1] !== '#') { color = underline; } } console.info( color( `${label}: ${getFormattedTime( average[label].time, existingAverage[label] && existingAverage[label].time )}, ${getFormattedMemory( average[label].memory, existingAverage[label] && existingAverage[label].memory )}` ) ); } return printedLabels.length + 2; } function clearLines(numberOfLines) { console.info('\u001B[A' + '\u001B[2K\u001B[A'.repeat(numberOfLines)); } function getExistingTimings() { try { const timings = JSON.parse(readFileSync(perfFile, 'utf8')); console.info( bold(`Comparing with ${cyan(perfFile)}. Delete this file to create a new base line.`) ); return timings; } catch { return {}; } } function persistTimings(timings) { try { writeFileSync(perfFile, JSON.stringify(timings, null, 2), 'utf8'); console.info(bold(`Saving performance information to new reference file ${cyan(perfFile)}.`)); } catch { console.error(bold(`Could not persist performance information in ${cyan(perfFile)}.`)); exit(1); } } function getFormattedTime(currentTime, persistedTime = currentTime) { let color = identity, formattedTime = `${currentTime.toFixed(0)}ms`; const absoluteDeviation = Math.abs(currentTime - persistedTime); if (absoluteDeviation > MIN_ABSOLUTE_TIME_DEVIATION) { const sign = currentTime >= persistedTime ? '+' : '-'; const relativeDeviation = 100 * (absoluteDeviation / persistedTime); formattedTime += ` (${sign}${absoluteDeviation.toFixed( 0 )}ms, ${sign}${relativeDeviation.toFixed(1)}%)`; if (relativeDeviation > RELATIVE_DEVIATION_FOR_COLORING) { color = currentTime >= persistedTime ? red : green; } } return color(formattedTime); } function getFormattedMemory(currentMemory, persistedMemory = currentMemory) { let color = identity, formattedMemory = prettyBytes(currentMemory); const absoluteDeviation = Math.abs(currentMemory - persistedMemory); const sign = currentMemory >= persistedMemory ? '+' : '-'; const relativeDeviation = 100 * (absoluteDeviation / persistedMemory); if (relativeDeviation > RELATIVE_DEVIATION_FOR_COLORING) { formattedMemory += ` (${sign}${relativeDeviation.toFixed(0)}%)`; color = currentMemory >= persistedMemory ? red : green; } return color(formattedMemory); } function identity(x) { return x; } rollup-3.29.4/scripts/release.js000077500000000000000000000247631450520414700166140ustar00rootroot00000000000000#!/usr/bin/env node import { readFile, writeFile } from 'node:fs/promises'; import { chdir, exit } from 'node:process'; import { fileURLToPath } from 'node:url'; import GitHub from 'github-api'; import inquirer from 'inquirer'; import semverInc from 'semver/functions/inc.js'; import semverParse from 'semver/functions/parse.js'; import semverPreRelease from 'semver/functions/prerelease.js'; import { cyan } from './colors.js'; import { runAndGetStdout, runWithEcho } from './helpers.js'; // We execute everything from the main directory chdir(fileURLToPath(new URL('..', import.meta.url))); const MAIN_BRANCH = 'master'; const MAIN_PACKAGE = 'package.json'; const MAIN_LOCKFILE = 'package-lock.json'; const BROWSER_PACKAGE = 'browser/package.json'; const CHANGELOG = 'CHANGELOG.md'; const DOCUMENTATION_BRANCH = 'documentation-published'; const [gh, currentBranch] = await Promise.all([ getGithubApi(), runAndGetStdout('git', ['branch', '--show-current']), runWithEcho('git', ['pull', '--ff-only']) ]); const [mainPackage, mainLockFile, browserPackage, repo, issues, changelog] = await Promise.all([ readJson(MAIN_PACKAGE), readJson(MAIN_LOCKFILE), readJson(BROWSER_PACKAGE), gh.getRepo('rollup', 'rollup'), gh.getIssues('rollup', 'rollup'), readFile(CHANGELOG, 'utf8') ]); const isMainBranch = currentBranch === MAIN_BRANCH; const [newVersion, includedPRs] = await Promise.all([ getNewVersion(mainPackage, isMainBranch), getIncludedPRs(changelog, repo, currentBranch, isMainBranch) ]); let changelogEntry, gitTag; try { if (isMainBranch) { await addStubChangelogEntry(newVersion, repo, changelog, includedPRs); } await updatePackages(mainPackage, mainLockFile, browserPackage, newVersion); await installDependenciesBuildAndTest(); changelogEntry = isMainBranch ? await waitForChangelogUpdate(newVersion) : ''; gitTag = `v${newVersion}`; await commitChanges(newVersion, gitTag, isMainBranch); } catch (error) { console.error(`Error during release, rolling back changes: ${error.message}`); await runWithEcho('git', ['reset', '--hard']); throw error; } await releasePackages(newVersion); await pushChanges(gitTag); if (changelogEntry) { await createReleaseNotes(changelogEntry, gitTag); } await postReleaseComments(includedPRs, issues, newVersion); async function getGithubApi() { const GITHUB_TOKEN = '.github_token'; try { const token = (await readFile(GITHUB_TOKEN, 'utf8')).trim(); return new GitHub({ token }); } catch (error) { if (error.code === 'ENOENT') { console.error( `Could not find GitHub token file. Please create "${GITHUB_TOKEN}" containing a token with the following permissions: - public_repo` ); exit(1); } else { throw error; } } } async function readJson(file) { const content = await readFile(file, 'utf8'); return JSON.parse(content); } async function getNewVersion(mainPackage, isMainBranch) { const { version } = mainPackage; const availableIncrements = isMainBranch ? ['patch', 'minor'] : semverPreRelease(version) ? ['prerelease'] : ['premajor', 'preminor', 'prepatch']; const { newVersion } = await inquirer.prompt([ { choices: availableIncrements.map(increment => { const value = semverInc(version, increment); return { name: `${increment} (${value})`, short: increment, value }; }), message: `Select type of release (currently "${version}" on branch "${currentBranch}"):`, name: 'newVersion', type: 'list' } ]); return newVersion; } async function addStubChangelogEntry(version, repo, changelog, includedPRs) { const { currentVersion, index } = getFirstChangelogEntry(changelog); if (currentVersion === version) { console.error( `Changelog entry for version "${version}" already exists. Please remove the entry and commit the change before trying again.` ); exit(1); } await writeFile( CHANGELOG, changelog.slice(0, index) + getNewLogEntry(version, includedPRs) + '\n\n' + changelog.slice(index) ); console.log( cyan(`A stub for the release notes was added to the beginning of "${CHANGELOG}". Please edit this file to add useful information about bug fixes, features and breaking changes in the release while the tests are running.`) ); } function getFirstChangelogEntry(changelog) { const match = changelog.match( /(?## (?\d+\.\d+\.\d+)[\S\s]*?)\n+## (?\d+\.\d+\.\d+)/ ); if (!match) { throw new Error('Could not detect any changelog entry.'); } const { groups: { text, currentVersion, previousVersion }, index } = match; return { currentVersion, index, previousVersion, text }; } async function getIncludedPRs(changelog, repo, currentBranch, isMainBranch) { const { currentVersion } = getFirstChangelogEntry(changelog); const commits = await runAndGetStdout('git', [ '--no-pager', 'log', `v${currentVersion}..HEAD`, '--pretty=tformat:%s' ]); const getPrRegExp = /^(.+)\s\(#(\d+)\)$/gm; const prs = []; let match; while ((match = getPrRegExp.exec(commits))) { prs.push({ pr: match[2], text: match[1].split('\n')[0] }); } if (!isMainBranch) { const { data: basePrs } = await repo.listPullRequests({ head: `rollup:${currentBranch}`, state: 'open' }); for (const { number, title } of basePrs) { prs.push({ pr: number, text: title }); } } prs.sort((a, b) => (a.pr > b.pr ? 1 : -1)); return Promise.all( prs.map(async ({ pr, text }) => { const { data } = await repo.getPullRequest(pr); const bodyWithoutComments = data.body.replace(//g, ''); const closedIssuesRegexp = /([Ff]ix(es|ed)?|([Cc]lose|[Rr]esolve)[ds]?) #(\d+)/g; const closed = []; while ((match = closedIssuesRegexp.exec(bodyWithoutComments))) { closed.push(match[4]); } return { author: data.user.login, closed, pr, text }; }) ); } function getNewLogEntry(version, prs) { if (prs.length === 0) { throw new Error(`Release does not contain any PRs`); } const firstPr = prs[0].pr; const date = new Date().toISOString().slice(0, 10); const { minor, patch } = semverParse(version); let sections = getDummyLogSection('Bug Fixes', firstPr); if (patch === 0) { sections = getDummyLogSection('Features', firstPr) + sections; if (minor === 0) { sections = getDummyLogSection('Breaking Changes', firstPr) + sections; } } return `## ${version} _${date}_ ${sections}### Pull Requests ${prs .map( ({ text, pr, author }) => `- [#${pr}](https://github.com/rollup/rollup/pull/${pr}): ${text} (@${author})` ) .join('\n')}`; } function getDummyLogSection(headline, pr) { return `### ${headline} - [replace me] (#${pr}) `; } async function installDependenciesBuildAndTest() { await Promise.all([runWithEcho('npm', ['ci']), runWithEcho('npm', ['audit'])]); await Promise.all([ runWithEcho('npm', ['run', 'ci:lint']), runWithEcho('npm', ['run', 'build:bootstrap']) ]); await runWithEcho('npm', ['run', 'test:all']); } async function waitForChangelogUpdate(version) { let changelogEntry = ''; while (true) { await runWithEcho('npx', ['prettier', '--write', CHANGELOG]); const changelog = await readFile(CHANGELOG, 'utf8'); const { text: newEntry } = getFirstChangelogEntry(changelog); if (newEntry === changelogEntry) { console.log(cyan('No further changes, continuing release.')); break; } changelogEntry = newEntry; console.log(cyan('You generated the following changelog entry:\n') + changelogEntry); await inquirer.prompt([ { choices: ['ok'], message: `Please edit the changelog or confirm the changelog is acceptable to continue to release "${version}".`, name: 'ok', type: 'list' } ]); } return changelogEntry; } function updatePackages(mainPackage, mainLockFile, browserPackage, newVersion) { return Promise.all([ writeFile(MAIN_PACKAGE, updatePackageVersionAndGetString(mainPackage, newVersion)), writeFile(MAIN_LOCKFILE, updateLockFileVersionAndGetString(mainLockFile, newVersion)), writeFile(BROWSER_PACKAGE, updatePackageVersionAndGetString(browserPackage, newVersion)) ]); } function updatePackageVersionAndGetString(packageContent, version) { packageContent.version = version; return JSON.stringify(packageContent, null, 2) + '\n'; } function updateLockFileVersionAndGetString(lockfileContent, version) { lockfileContent.version = version; lockfileContent.packages[''].version = version; return JSON.stringify(lockfileContent, null, 2) + '\n'; } async function commitChanges(newVersion, gitTag, isMainBranch) { await runWithEcho('git', [ 'add', MAIN_PACKAGE, MAIN_LOCKFILE, BROWSER_PACKAGE, ...(isMainBranch ? [CHANGELOG] : []) ]); await runWithEcho('git', ['commit', '-m', newVersion]); await runWithEcho('git', ['tag', gitTag]); isMainBranch && (await runWithEcho('git', ['branch', DOCUMENTATION_BRANCH, '--force', gitTag])); } function releasePackages(newVersion) { const releaseEnvironment = { ...process.env, ROLLUP_RELEASE: 'releasing' }; const releaseTag = semverPreRelease(newVersion) ? ['--tag', 'beta'] : []; const parameters = ['publish', '--access', 'public', ...releaseTag]; return Promise.all([ runWithEcho('npm', parameters, { cwd: new URL('..', import.meta.url), env: releaseEnvironment }), runWithEcho('npm', parameters, { cwd: new URL('../browser', import.meta.url), env: releaseEnvironment }) ]); } function pushChanges(gitTag) { return Promise.all([ runWithEcho('git', ['push', 'origin', 'HEAD']), runWithEcho('git', ['push', 'origin', gitTag]), isMainBranch && runWithEcho('git', ['push', '--force', 'origin', DOCUMENTATION_BRANCH]) ]); } function createReleaseNotes(changelog, tag) { return repo.createRelease({ body: changelog, name: tag, tag_name: tag }); } function postReleaseComments(includedPRs, issues, version) { const isPreRelease = semverPreRelease(newVersion); const installNote = isPreRelease ? `Note that this is a pre-release, so to test it, you need to install Rollup via \`npm install rollup@${newVersion}\` or \`npm install rollup@beta\`. It will likely become part of a regular release later.` : 'You can test it via `npm install rollup`.'; return Promise.all( includedPRs.map(({ pr, closed }) => Promise.all([ issues .createIssueComment( pr, `This PR has been released as part of rollup@${version}. ${installNote}` ) .then(() => console.log(cyan(`Added release comment to #${pr}.`))), ...closed.map(closedPr => issues .createIssueComment( closedPr, `This issue has been resolved via #${pr} as part of rollup@${version}. ${installNote}` ) .then(() => console.log(cyan(`Added fix comment to #${closedPr} via #${pr}.`))) ) ]) ) ); } rollup-3.29.4/scripts/test-options.js000066400000000000000000000052171450520414700176320ustar00rootroot00000000000000import { readFile } from 'node:fs/promises'; const [optionsText, helpText, commandReferenceText] = await Promise.all([ readFile(new URL('../docs/configuration-options/index.md', import.meta.url), 'utf8'), readFile(new URL('../cli/help.md', import.meta.url), 'utf8'), readFile(new URL('../docs/command-line-interface/index.md', import.meta.url), 'utf8') ]); const optionSections = optionsText.split('\n## '); let searchedOptions = ''; for (const section of optionSections.slice(1)) { if (!(section.startsWith('Experimental') || section.startsWith('Deprecated'))) { searchedOptions += section; } } const findCliOptionRegExp = /CLI: (`(-(\w)[^`]*)`\/)?`(--([\w.]+)[^`]*)`/g; const allCliOptions = []; let match; while ((match = findCliOptionRegExp.exec(searchedOptions)) !== null) { allCliOptions.push({ long: match[5], short: match[3] }); } const findOptionInHelpRegExp = /^(-(\w), )?--(no-)?([\w.]+)/gm; const cliOptionsInHelp = new Map(); while ((match = findOptionInHelpRegExp.exec(helpText)) !== null) { cliOptionsInHelp.set(match[4], match[2]); } let failed = false; for (const { long, short } of allCliOptions) { if (!cliOptionsInHelp.has(long)) { failed = true; console.error(`Could find neither --${long} nor --no-${long} in help.md.`); } const optionInHelp = cliOptionsInHelp.get(long); if (short !== optionInHelp) { failed = true; console.error( `Inconsistent option with shortcut. Expected -${short}/--${long}, got -${optionInHelp.short}/--${optionInHelp.long}.` ); } } if (failed) { process.exit(1); } let current = null; for (const [long, short] of cliOptionsInHelp) { if (!short) { if (current && long < current) { console.error( `Options in help.md are not sorted properly. "${long}" should occur before "${current}".` ); process.exit(1); } current = long; } } const splitHelpText = helpText.split('\n'); for (const line of splitHelpText) { if (line.length > 80) { console.error(`The following line in help.md exceeds the limit of 80 characters:\n${line}`); process.exit(1); } } const helpOptionLines = splitHelpText.filter(line => line.startsWith('-')); const cliFlagsText = commandReferenceText .split('\n## ') .find(text => text.startsWith('Command line flags')); const optionListLines = cliFlagsText .match(/```\n([\S\s]*?)\n```/)[1] .split('\n') .filter(line => line.startsWith('-')); for (const [index, line] of helpOptionLines.entries()) { const optionListLine = optionListLines[index]; if (line !== optionListLine) { console.error( `The command lines in command-line-interface/index.md do not match help.md. Expected line:\n${line}\n\nReceived line:\n${optionListLine}` ); process.exit(1); } } rollup-3.29.4/scripts/test-package.js000066400000000000000000000012351450520414700175260ustar00rootroot00000000000000import { readFile } from 'node:fs/promises'; const package_ = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8')); const chokidarPackage = JSON.parse( await readFile(new URL('../node_modules/chokidar/package.json', import.meta.url), 'utf8') ); const chokidarFsevents = chokidarPackage.dependencies.fsevents || chokidarPackage.optionalDependencies.fsevents; const packageFsevents = package_.optionalDependencies.fsevents; if (chokidarFsevents !== packageFsevents) { throw new Error( `The dependency "fsevents" should exist with the same version range "${chokidarFsevents}" as it has for chokidar but it has "${packageFsevents}".` ); } rollup-3.29.4/scripts/update-snapshots.js000077500000000000000000000032341450520414700204640ustar00rootroot00000000000000#!/usr/bin/env node import { readdirSync } from 'node:fs'; import { dirname, join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import fs from 'fs-extra'; const basePath = resolve(dirname(fileURLToPath(import.meta.url)), '../test'); const formPath = join(basePath, 'form/samples'); const formDirectoriesToHandle = readdirSync(formPath); for (const directory of formDirectoriesToHandle) { const testPath = join(formPath, directory); const testFiles = readdirSync(testPath); if (!testFiles.includes('_config.js')) { formDirectoriesToHandle.push(...testFiles.map(filename => join(directory, filename))); } else if (testFiles.includes('_actual')) { const expectedPath = join(testPath, '_expected'); fs.removeSync(expectedPath); fs.copySync(join(testPath, '_actual'), expectedPath); } else if (testFiles.includes('_actual.js')) { fs.copySync(join(testPath, '_actual.js'), join(testPath, '_expected.js')); } else { throw new Error(`Could not find test output in ${testPath}`); } } const chunkingPath = join(basePath, 'chunking-form/samples'); const chunkingDirectoriesToHandle = readdirSync(chunkingPath); for (const directory of chunkingDirectoriesToHandle) { const testPath = join(chunkingPath, directory); const testFiles = readdirSync(testPath); if (!testFiles.includes('_config.js')) { chunkingDirectoriesToHandle.push(...testFiles.map(filename => join(directory, filename))); } else if (testFiles.includes('_actual')) { const expectedPath = join(testPath, '_expected'); fs.removeSync(expectedPath); fs.copySync(join(testPath, '_actual'), expectedPath); } else { throw new Error(`Could not find test output in ${testPath}`); } } rollup-3.29.4/src/000077500000000000000000000000001450520414700137175ustar00rootroot00000000000000rollup-3.29.4/src/Bundle.ts000066400000000000000000000232451450520414700155060ustar00rootroot00000000000000import Chunk from './Chunk'; import ExternalChunk from './ExternalChunk'; import ExternalModule from './ExternalModule'; import type Graph from './Graph'; import Module from './Module'; import type { GetManualChunk, LogHandler, NormalizedInputOptions, NormalizedOutputOptions, OutputBundle } from './rollup/types'; import type { PluginDriver } from './utils/PluginDriver'; import { getChunkAssignments } from './utils/chunkAssignment'; import commondir from './utils/commondir'; import { sortByExecutionOrder } from './utils/executionOrder'; import { getGenerateCodeSnippets } from './utils/generateCodeSnippets'; import type { HashPlaceholderGenerator } from './utils/hashPlaceholders'; import { getHashPlaceholderGenerator } from './utils/hashPlaceholders'; import { LOGLEVEL_WARN } from './utils/logging'; import { error, logCannotAssignModuleToChunk, logChunkInvalid, logInvalidOption } from './utils/logs'; import type { OutputBundleWithPlaceholders } from './utils/outputBundle'; import { getOutputBundle, removeUnreferencedAssets } from './utils/outputBundle'; import { isAbsolute } from './utils/path'; import { renderChunks } from './utils/renderChunks'; import { timeEnd, timeStart } from './utils/timers'; import { URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_FORMAT, URL_OUTPUT_SOURCEMAPFILE } from './utils/urls'; export default class Bundle { private readonly facadeChunkByModule = new Map(); private readonly includedNamespaces = new Set(); constructor( private readonly outputOptions: NormalizedOutputOptions, private readonly unsetOptions: ReadonlySet, private readonly inputOptions: NormalizedInputOptions, private readonly pluginDriver: PluginDriver, private readonly graph: Graph ) {} async generate(isWrite: boolean): Promise { timeStart('GENERATE', 1); const outputBundleBase: OutputBundle = Object.create(null); const outputBundle = getOutputBundle(outputBundleBase); this.pluginDriver.setOutputBundle(outputBundle, this.outputOptions); try { timeStart('initialize render', 2); await this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]); timeEnd('initialize render', 2); timeStart('generate chunks', 2); const getHashPlaceholder = getHashPlaceholderGenerator(); const chunks = await this.generateChunks(outputBundle, getHashPlaceholder); if (chunks.length > 1) { validateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onLog); } this.pluginDriver.setChunkInformation(this.facadeChunkByModule); for (const chunk of chunks) { chunk.generateExports(); } timeEnd('generate chunks', 2); await renderChunks( chunks, outputBundle, this.pluginDriver, this.outputOptions, this.inputOptions.onLog ); } catch (error_: any) { await this.pluginDriver.hookParallel('renderError', [error_]); throw error_; } removeUnreferencedAssets(outputBundle); timeStart('generate bundle', 2); await this.pluginDriver.hookSeq('generateBundle', [ this.outputOptions, outputBundle as OutputBundle, isWrite ]); this.finaliseAssets(outputBundle); timeEnd('generate bundle', 2); timeEnd('GENERATE', 1); return outputBundleBase; } private async addManualChunks( manualChunks: Record ): Promise> { const manualChunkAliasByEntry = new Map(); const chunkEntries = await Promise.all( Object.entries(manualChunks).map(async ([alias, files]) => ({ alias, entries: await this.graph.moduleLoader.addAdditionalModules(files, true) })) ); for (const { alias, entries } of chunkEntries) { for (const entry of entries) { addModuleToManualChunk(alias, entry, manualChunkAliasByEntry); } } return manualChunkAliasByEntry; } private assignManualChunks(getManualChunk: GetManualChunk): Map { // eslint-disable-next-line unicorn/prefer-module const manualChunkAliasesWithEntry: [alias: string, module: Module][] = []; const manualChunksApi = { getModuleIds: () => this.graph.modulesById.keys(), getModuleInfo: this.graph.getModuleInfo }; for (const module of this.graph.modulesById.values()) { if (module instanceof Module) { const manualChunkAlias = getManualChunk(module.id, manualChunksApi); if (typeof manualChunkAlias === 'string') { manualChunkAliasesWithEntry.push([manualChunkAlias, module]); } } } manualChunkAliasesWithEntry.sort(([aliasA], [aliasB]) => aliasA > aliasB ? 1 : aliasA < aliasB ? -1 : 0 ); const manualChunkAliasByEntry = new Map(); for (const [alias, module] of manualChunkAliasesWithEntry) { addModuleToManualChunk(alias, module, manualChunkAliasByEntry); } return manualChunkAliasByEntry; } private finaliseAssets(bundle: OutputBundleWithPlaceholders): void { if (this.outputOptions.validate) { for (const file of Object.values(bundle)) { if ('code' in file) { try { this.graph.contextParse(file.code, { ecmaVersion: 'latest' }); } catch (error_: any) { this.inputOptions.onLog(LOGLEVEL_WARN, logChunkInvalid(file, error_)); } } } } this.pluginDriver.finaliseAssets(); } private async generateChunks( bundle: OutputBundleWithPlaceholders, getHashPlaceholder: HashPlaceholderGenerator ): Promise { const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions; const manualChunkAliasByEntry = typeof manualChunks === 'object' ? await this.addManualChunks(manualChunks) : this.assignManualChunks(manualChunks); const snippets = getGenerateCodeSnippets(this.outputOptions); const includedModules = getIncludedModules(this.graph.modulesById); const inputBase = commondir(getAbsoluteEntryModulePaths(includedModules, preserveModules)); const externalChunkByModule = getExternalChunkByModule( this.graph.modulesById, this.outputOptions, inputBase ); const chunks: Chunk[] = []; const chunkByModule = new Map(); for (const { alias, modules } of inlineDynamicImports ? [{ alias: null, modules: includedModules }] : preserveModules ? includedModules.map(module => ({ alias: null, modules: [module] })) : getChunkAssignments( this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, this.inputOptions.onLog )) { sortByExecutionOrder(modules); const chunk = new Chunk( modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias, getHashPlaceholder, bundle, inputBase, snippets ); chunks.push(chunk); } for (const chunk of chunks) { chunk.link(); } const facades: Chunk[] = []; for (const chunk of chunks) { facades.push(...chunk.generateFacades()); } return [...chunks, ...facades]; } } function validateOptionsForMultiChunkOutput( outputOptions: NormalizedOutputOptions, log: LogHandler ) { if (outputOptions.format === 'umd' || outputOptions.format === 'iife') return error( logInvalidOption( 'output.format', URL_OUTPUT_FORMAT, 'UMD and IIFE output formats are not supported for code-splitting builds', outputOptions.format ) ); if (typeof outputOptions.file === 'string') return error( logInvalidOption( 'output.file', URL_OUTPUT_DIR, 'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option' ) ); if (outputOptions.sourcemapFile) return error( logInvalidOption( 'output.sourcemapFile', URL_OUTPUT_SOURCEMAPFILE, '"output.sourcemapFile" is only supported for single-file builds' ) ); if (!outputOptions.amd.autoId && outputOptions.amd.id) log( LOGLEVEL_WARN, logInvalidOption( 'output.amd.id', URL_OUTPUT_AMD_ID, 'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead' ) ); } function getIncludedModules(modulesById: ReadonlyMap): Module[] { const includedModules: Module[] = []; for (const module of modulesById.values()) { if ( module instanceof Module && (module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0) ) { includedModules.push(module); } } return includedModules; } function getAbsoluteEntryModulePaths( includedModules: readonly Module[], preserveModules: boolean ): string[] { const absoluteEntryModulePaths: string[] = []; for (const module of includedModules) { if ((module.info.isEntry || preserveModules) && isAbsolute(module.id)) { absoluteEntryModulePaths.push(module.id); } } return absoluteEntryModulePaths; } function getExternalChunkByModule( modulesById: ReadonlyMap, outputOptions: NormalizedOutputOptions, inputBase: string ): Map { const externalChunkByModule = new Map(); for (const module of modulesById.values()) { if (module instanceof ExternalModule) { externalChunkByModule.set(module, new ExternalChunk(module, outputOptions, inputBase)); } } return externalChunkByModule; } function addModuleToManualChunk( alias: string, module: Module, manualChunkAliasByEntry: Map ): void { const existingAlias = manualChunkAliasByEntry.get(module); if (typeof existingAlias === 'string' && existingAlias !== alias) { return error(logCannotAssignModuleToChunk(module.id, alias, existingAlias)); } manualChunkAliasByEntry.set(module, alias); } rollup-3.29.4/src/Chunk.ts000066400000000000000000001400321450520414700153370ustar00rootroot00000000000000import MagicString, { Bundle as MagicStringBundle, type SourceMap } from 'magic-string'; import { relative } from '../browser/src/path'; import ExternalChunk from './ExternalChunk'; import ExternalModule from './ExternalModule'; import Module from './Module'; import ExportDefaultDeclaration from './ast/nodes/ExportDefaultDeclaration'; import FunctionDeclaration from './ast/nodes/FunctionDeclaration'; import type ImportExpression from './ast/nodes/ImportExpression'; import { formatsMaybeAccessDocumentCurrentScript } from './ast/nodes/MetaProperty'; import type ChildScope from './ast/scopes/ChildScope'; import ExportDefaultVariable from './ast/variables/ExportDefaultVariable'; import LocalVariable from './ast/variables/LocalVariable'; import NamespaceVariable from './ast/variables/NamespaceVariable'; import SyntheticNamedExportVariable from './ast/variables/SyntheticNamedExportVariable'; import type Variable from './ast/variables/Variable'; import finalisers from './finalisers/index'; import type { GetInterop, GlobalsOption, InternalModuleFormat, LogHandler, NormalizedInputOptions, NormalizedOutputOptions, OutputChunk, PreRenderedChunk, RenderedChunk, RenderedModule } from './rollup/types'; import type { PluginDriver } from './utils/PluginDriver'; import { createAddons } from './utils/addons'; import { deconflictChunk, type DependenciesToBeDeconflicted } from './utils/deconflictChunk'; import { escapeId } from './utils/escapeId'; import { assignExportsToMangledNames, assignExportsToNames } from './utils/exportNames'; import type { GenerateCodeSnippets } from './utils/generateCodeSnippets'; import getExportMode from './utils/getExportMode'; import getIndentString from './utils/getIndentString'; import { getNewArray, getOrCreate } from './utils/getOrCreate'; import { getStaticDependencies } from './utils/getStaticDependencies'; import type { HashPlaceholderGenerator } from './utils/hashPlaceholders'; import { replacePlaceholders } from './utils/hashPlaceholders'; import { makeLegal } from './utils/identifierHelpers'; import { defaultInteropHelpersByInteropType, DOCUMENT_CURRENT_SCRIPT, HELPER_NAMES, isDefaultAProperty, namespaceInteropHelpersByInteropType } from './utils/interopHelpers'; import { LOGLEVEL_WARN } from './utils/logging'; import { error, logCyclicCrossChunkReexport, logEmptyChunk, logMissingGlobalName, logUnexpectedNamedImport, logUnexpectedNamespaceReexport } from './utils/logs'; import type { OutputBundleWithPlaceholders } from './utils/outputBundle'; import { FILE_PLACEHOLDER } from './utils/outputBundle'; import { basename, extname, isAbsolute, normalize, resolve } from './utils/path'; import { getAliasName, getImportPath } from './utils/relativeId'; import type { RenderOptions } from './utils/renderHelpers'; import { makeUnique, renderNamePattern } from './utils/renderNamePattern'; import { MISSING_EXPORT_SHIM_VARIABLE } from './utils/variableNames'; export interface ModuleDeclarations { dependencies: ChunkDependency[]; exports: ChunkExports; } type PreliminaryFileName = PreliminaryFileNameWithPlaceholder | FixedPreliminaryFileName; export interface ChunkRenderResult { chunk: Chunk; magicString: MagicStringBundle; preliminaryFileName: PreliminaryFileName; preliminarySourcemapFileName: PreliminaryFileName | null; usedModules: Module[]; } interface PreliminaryFileNameWithPlaceholder { fileName: string; hashPlaceholder: string; } interface FixedPreliminaryFileName { fileName: string; hashPlaceholder: null; } export type ResolvedDynamicImport = ( | { chunk: Chunk; externalChunk: null; facadeChunk: Chunk | undefined; resolution: Module } | { chunk: null; externalChunk: ExternalChunk; facadeChunk: null; resolution: ExternalModule } | { chunk: null; externalChunk: null; facadeChunk: null; resolution: string | null } ) & { node: ImportExpression }; export interface ChunkDependency { assertions: string | null; defaultVariableName: string | undefined; globalName: string | false | undefined; importPath: string; imports: ImportSpecifier[] | null; isChunk: boolean; name: string; namedExportsMode: boolean; namespaceVariableName: string | undefined; reexports: ReexportSpecifier[] | null; } export type ChunkExports = { exported: string; expression: string | null; hoisted: boolean; local: string; }[]; export interface ReexportSpecifier { imported: string; needsLiveBinding: boolean; reexported: string; } export interface ImportSpecifier { imported: string; local: string; } interface FacadeName { fileName?: string; name?: string; } type RenderedDependencies = Map; const NON_ASSET_EXTENSIONS = new Set([ '.js', '.jsx', '.ts', '.tsx', '.mjs', '.mts', '.cjs', '.cts' ]); function getGlobalName( chunk: ExternalChunk, globals: GlobalsOption, hasExports: boolean, log: LogHandler ): string | undefined { const globalName = typeof globals === 'function' ? globals(chunk.id) : globals[chunk.id]; if (globalName) { return globalName; } if (hasExports) { log(LOGLEVEL_WARN, logMissingGlobalName(chunk.id, chunk.variableName)); return chunk.variableName; } } export default class Chunk { // placeholder declaration, only relevant for ExternalChunk defaultVariableName?: undefined; readonly entryModules: Module[] = []; execIndex: number; exportMode: 'none' | 'named' | 'default' = 'named'; facadeModule: Module | null = null; namespaceVariableName = ''; suggestedVariableName: string; variableName = ''; private readonly accessedGlobalsByScope = new Map>(); private dependencies = new Set(); private readonly dynamicEntryModules: Module[] = []; private dynamicName: string | null = null; private readonly exportNamesByVariable = new Map(); private readonly exports = new Set(); private readonly exportsByName = new Map(); private fileName: string | null = null; private implicitEntryModules: Module[] = []; private readonly implicitlyLoadedBefore = new Set(); private readonly imports = new Set(); private includedDynamicImports: ResolvedDynamicImport[] | null = null; private readonly includedReexportsByModule = new Map(); // This may be updated in the constructor private readonly isEmpty: boolean = true; private name: string | null = null; private needsExportsShim = false; private preRenderedChunkInfo: PreRenderedChunk | null = null; private preliminaryFileName: PreliminaryFileName | null = null; private preliminarySourcemapFileName: PreliminaryFileName | null = null; private renderedChunkInfo: RenderedChunk | null = null; private renderedDependencies: Map | null = null; private readonly renderedModules: { [moduleId: string]: RenderedModule; } = Object.create(null); private sortedExportNames: string[] | null = null; private strictFacade = false; constructor( private readonly orderedModules: readonly Module[], private readonly inputOptions: NormalizedInputOptions, private readonly outputOptions: NormalizedOutputOptions, private readonly unsetOptions: ReadonlySet, private readonly pluginDriver: PluginDriver, private readonly modulesById: ReadonlyMap, private readonly chunkByModule: Map, private readonly externalChunkByModule: ReadonlyMap, private readonly facadeChunkByModule: Map, private readonly includedNamespaces: Set, private readonly manualChunkAlias: string | null, private readonly getPlaceholder: HashPlaceholderGenerator, private readonly bundle: OutputBundleWithPlaceholders, private readonly inputBase: string, private readonly snippets: GenerateCodeSnippets ) { this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity; const chunkModules = new Set(orderedModules); for (const module of orderedModules) { chunkByModule.set(module, this); if (module.namespace.included && !outputOptions.preserveModules) { includedNamespaces.add(module); } if (this.isEmpty && module.isIncluded()) { this.isEmpty = false; } if (module.info.isEntry || outputOptions.preserveModules) { this.entryModules.push(module); } for (const importer of module.includedDynamicImporters) { if (!chunkModules.has(importer)) { this.dynamicEntryModules.push(module); // Modules with synthetic exports need an artificial namespace for dynamic imports if (module.info.syntheticNamedExports) { includedNamespaces.add(module); this.exports.add(module.namespace); } } } if (module.implicitlyLoadedAfter.size > 0) { this.implicitEntryModules.push(module); } } this.suggestedVariableName = makeLegal(this.generateVariableName()); } private static generateFacade( inputOptions: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, unsetOptions: ReadonlySet, pluginDriver: PluginDriver, modulesById: ReadonlyMap, chunkByModule: Map, externalChunkByModule: ReadonlyMap, facadeChunkByModule: Map, includedNamespaces: Set, facadedModule: Module, facadeName: FacadeName, getPlaceholder: HashPlaceholderGenerator, bundle: OutputBundleWithPlaceholders, inputBase: string, snippets: GenerateCodeSnippets ): Chunk { const chunk = new Chunk( [], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, null, getPlaceholder, bundle, inputBase, snippets ); chunk.assignFacadeName(facadeName, facadedModule); if (!facadeChunkByModule.has(facadedModule)) { facadeChunkByModule.set(facadedModule, chunk); } for (const dependency of facadedModule.getDependenciesToBeIncluded()) { chunk.dependencies.add( dependency instanceof Module ? chunkByModule.get(dependency)! : externalChunkByModule.get(dependency)! ); } if ( !chunk.dependencies.has(chunkByModule.get(facadedModule)!) && facadedModule.info.moduleSideEffects && facadedModule.hasEffects() ) { chunk.dependencies.add(chunkByModule.get(facadedModule)!); } chunk.ensureReexportsAreAvailableForModule(facadedModule); chunk.facadeModule = facadedModule; chunk.strictFacade = true; return chunk; } canModuleBeFacade(module: Module, exposedVariables: ReadonlySet): boolean { const moduleExportNamesByVariable = module.getExportNamesByVariable(); // All exports of this chunk need to be exposed by the candidate module for (const exposedVariable of this.exports) { if (!moduleExportNamesByVariable.has(exposedVariable)) { return false; } } // Additionally, we need to expose namespaces of dynamic entries that are not the facade module and exports from other entry modules for (const exposedVariable of exposedVariables) { if ( !( exposedVariable.module === module || moduleExportNamesByVariable.has(exposedVariable) || (exposedVariable instanceof SyntheticNamedExportVariable && moduleExportNamesByVariable.has(exposedVariable.getBaseVariable())) ) ) { return false; } } return true; } finalizeChunk( code: string, map: SourceMap | null, sourcemapFileName: string | null, hashesByPlaceholder: Map ): OutputChunk { const renderedChunkInfo = this.getRenderedChunkInfo(); const finalize = (code: string) => replacePlaceholders(code, hashesByPlaceholder); const preliminaryFileName = renderedChunkInfo.fileName; const fileName = (this.fileName = finalize(preliminaryFileName)); return { ...renderedChunkInfo, code, dynamicImports: renderedChunkInfo.dynamicImports.map(finalize), fileName, implicitlyLoadedBefore: renderedChunkInfo.implicitlyLoadedBefore.map(finalize), importedBindings: Object.fromEntries( Object.entries(renderedChunkInfo.importedBindings).map(([fileName, bindings]) => [ finalize(fileName), bindings ]) ), imports: renderedChunkInfo.imports.map(finalize), map, preliminaryFileName, referencedFiles: renderedChunkInfo.referencedFiles.map(finalize), sourcemapFileName }; } generateExports(): void { this.sortedExportNames = null; const remainingExports = new Set(this.exports); if ( this.facadeModule !== null && (this.facadeModule.preserveSignature !== false || this.strictFacade) ) { const exportNamesByVariable = this.facadeModule.getExportNamesByVariable(); for (const [variable, exportNames] of exportNamesByVariable) { this.exportNamesByVariable.set(variable, [...exportNames]); for (const exportName of exportNames) { this.exportsByName.set(exportName, variable); } remainingExports.delete(variable); } } if (this.outputOptions.minifyInternalExports) { assignExportsToMangledNames(remainingExports, this.exportsByName, this.exportNamesByVariable); } else { assignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable); } if (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry)) this.exportMode = getExportMode( this, this.outputOptions, this.facadeModule!.id, this.inputOptions.onLog ); } generateFacades(): Chunk[] { const facades: Chunk[] = []; const entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]); const exposedVariables = new Set( this.dynamicEntryModules.map(({ namespace }) => namespace) ); for (const module of entryModules) { if (module.preserveSignature) { for (const exportedVariable of module.getExportNamesByVariable().keys()) { // We need to expose all entry exports from this chunk if (this.chunkByModule.get(exportedVariable.module as Module) === this) { exposedVariables.add(exportedVariable); } } } } for (const module of entryModules) { // eslint-disable-next-line unicorn/prefer-spread const requiredFacades: FacadeName[] = Array.from( new Set( module.chunkNames.filter(({ isUserDefined }) => isUserDefined).map(({ name }) => name) ), // mapping must run after Set 'name' dedupe name => ({ name }) ); if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) { requiredFacades.push({}); } // eslint-disable-next-line unicorn/prefer-spread requiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName }))); if (requiredFacades.length === 0) { requiredFacades.push({}); } if (!this.facadeModule) { const needsStrictFacade = !this.outputOptions.preserveModules && (module.preserveSignature === 'strict' || (module.preserveSignature === 'exports-only' && module.getExportNamesByVariable().size > 0)); if (!needsStrictFacade || this.canModuleBeFacade(module, exposedVariables)) { this.facadeModule = module; this.facadeChunkByModule.set(module, this); if (module.preserveSignature) { this.strictFacade = needsStrictFacade; } this.assignFacadeName( requiredFacades.shift()!, module, this.outputOptions.preserveModules ); } } for (const facadeName of requiredFacades) { facades.push( Chunk.generateFacade( this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName, this.getPlaceholder, this.bundle, this.inputBase, this.snippets ) ); } } for (const module of this.dynamicEntryModules) { if (module.info.syntheticNamedExports) continue; if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) { this.facadeModule = module; this.facadeChunkByModule.set(module, this); this.strictFacade = true; this.dynamicName = getChunkNameFromModule(module); } else if ( this.facadeModule === module && !this.strictFacade && this.canModuleBeFacade(module, exposedVariables) ) { this.strictFacade = true; } else if (!this.facadeChunkByModule.get(module)?.strictFacade) { this.includedNamespaces.add(module); this.exports.add(module.namespace); } } if (!this.outputOptions.preserveModules) { this.addNecessaryImportsForFacades(); } return facades; } getChunkName(): string { return (this.name ??= this.outputOptions.sanitizeFileName(this.getFallbackChunkName())); } getExportNames(): string[] { return (this.sortedExportNames ??= [...this.exportsByName.keys()].sort()); } getFileName(): string { return this.fileName || this.getPreliminaryFileName().fileName; } getImportPath(importer: string): string { return escapeId( getImportPath( importer, this.getFileName(), this.outputOptions.format === 'amd' && !this.outputOptions.amd.forceJsExtensionForImports, true ) ); } getPreliminaryFileName(): PreliminaryFileName { if (this.preliminaryFileName) { return this.preliminaryFileName; } let fileName: string; let hashPlaceholder: string | null = null; const { chunkFileNames, entryFileNames, file, format, preserveModules } = this.outputOptions; if (file) { fileName = basename(file); } else if (this.fileName === null) { const [pattern, patternName] = preserveModules || this.facadeModule?.isUserDefinedEntryPoint ? [entryFileNames, 'output.entryFileNames'] : [chunkFileNames, 'output.chunkFileNames']; fileName = renderNamePattern( typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, { format: () => format, hash: size => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)), name: () => this.getChunkName() } ); if (!hashPlaceholder) { fileName = makeUnique(fileName, this.bundle); } } else { fileName = this.fileName; } if (!hashPlaceholder) { this.bundle[fileName] = FILE_PLACEHOLDER; } // Caching is essential to not conflict with the file name reservation above return (this.preliminaryFileName = { fileName, hashPlaceholder }); } getPreliminarySourcemapFileName(): PreliminaryFileName | null { if (this.preliminarySourcemapFileName) { return this.preliminarySourcemapFileName; } let sourcemapFileName: string | null = null; let hashPlaceholder: string | null = null; const { sourcemapFileNames, format } = this.outputOptions; if (sourcemapFileNames) { const [pattern, patternName] = [sourcemapFileNames, 'output.sourcemapFileNames']; sourcemapFileName = renderNamePattern( typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, { chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || '', format: () => format, hash: size => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)), name: () => this.getChunkName() } ); if (!hashPlaceholder) { sourcemapFileName = makeUnique(sourcemapFileName, this.bundle); } } else { return null; } return (this.preliminarySourcemapFileName = { fileName: sourcemapFileName, hashPlaceholder }); } public getRenderedChunkInfo(): RenderedChunk { if (this.renderedChunkInfo) { return this.renderedChunkInfo; } return (this.renderedChunkInfo = { ...this.getPreRenderedChunkInfo(), dynamicImports: this.getDynamicDependencies().map(resolveFileName), fileName: this.getFileName(), // eslint-disable-next-line unicorn/prefer-spread implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, resolveFileName), importedBindings: getImportedBindingsPerDependency( this.getRenderedDependencies(), resolveFileName ), // eslint-disable-next-line unicorn/prefer-spread imports: Array.from(this.dependencies, resolveFileName), modules: this.renderedModules, referencedFiles: this.getReferencedFiles() }); } getVariableExportName(variable: Variable): string { if (this.outputOptions.preserveModules && variable instanceof NamespaceVariable) { return '*'; } return this.exportNamesByVariable.get(variable)![0]; } link(): void { this.dependencies = getStaticDependencies( this, this.orderedModules, this.chunkByModule, this.externalChunkByModule ); for (const module of this.orderedModules) { this.addImplicitlyLoadedBeforeFromModule(module); this.setUpChunkImportsAndExportsForModule(module); } } async render(): Promise { const { dependencies, exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this; const { format, hoistTransitiveImports, preserveModules } = outputOptions; // for static and dynamic entry points, add transitive dependencies to this // chunk's dependencies to avoid loading latency if (hoistTransitiveImports && !preserveModules && facadeModule !== null) { for (const dep of dependencies) { if (dep instanceof Chunk) this.inlineChunkDependencies(dep); } } const preliminaryFileName = this.getPreliminaryFileName(); const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName(); const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName); const renderedDependencies = [...this.getRenderedDependencies().values()]; const renderedExports = exportMode === 'none' ? [] : this.getChunkExportDeclarations(format); let hasExports = renderedExports.length > 0; let hasDefaultExport = false; for (const renderedDependence of renderedDependencies) { const { reexports } = renderedDependence; if (reexports?.length) { hasExports = true; if (!hasDefaultExport && reexports.some(reexport => reexport.reexported === 'default')) { hasDefaultExport = true; } if (format === 'es') { renderedDependence.reexports = reexports.filter( // eslint-disable-next-line unicorn/prefer-array-some ({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported) ); } } } if (!hasDefaultExport) { for (const { exported } of renderedExports) { if (exported === 'default') { hasDefaultExport = true; break; } } } const { intro, outro, banner, footer } = await createAddons( outputOptions, pluginDriver, this.getRenderedChunkInfo() ); finalisers[format]( renderedSource, { accessedGlobals, dependencies: renderedDependencies, exports: renderedExports, hasDefaultExport, hasExports, id: preliminaryFileName.fileName, indent, intro, isEntryFacade: preserveModules || (facadeModule !== null && facadeModule.info.isEntry), isModuleFacade: facadeModule !== null, log: onLog, namedExportsMode: exportMode !== 'default', outro, snippets, usesTopLevelAwait }, outputOptions ); if (banner) magicString.prepend(banner); if (footer) magicString.append(footer); return { chunk: this, magicString, preliminaryFileName, preliminarySourcemapFileName, usedModules }; } private addImplicitlyLoadedBeforeFromModule(baseModule: Module): void { const { chunkByModule, implicitlyLoadedBefore } = this; for (const module of baseModule.implicitlyLoadedBefore) { const chunk = chunkByModule.get(module); if (chunk && chunk !== this) { implicitlyLoadedBefore.add(chunk); } } } private addNecessaryImportsForFacades() { for (const [module, variables] of this.includedReexportsByModule) { if (this.includedNamespaces.has(module)) { for (const variable of variables) { this.imports.add(variable); } } } } private assignFacadeName( { fileName, name }: FacadeName, facadedModule: Module, preservePath?: boolean ): void { if (fileName) { this.fileName = fileName; } else { this.name = this.outputOptions.sanitizeFileName( name || (preservePath ? this.getPreserveModulesChunkNameFromModule(facadedModule) : getChunkNameFromModule(facadedModule)) ); } } private checkCircularDependencyImport(variable: Variable, importingModule: Module): void { const variableModule = variable.module; if (variableModule instanceof Module) { const exportChunk = this.chunkByModule.get(variableModule); let alternativeReexportModule; do { alternativeReexportModule = importingModule.alternativeReexportModules.get(variable); if (alternativeReexportModule) { const exportingChunk = this.chunkByModule.get(alternativeReexportModule); if (exportingChunk !== exportChunk) { this.inputOptions.onLog( LOGLEVEL_WARN, logCyclicCrossChunkReexport( // Namespaces do not have an export name variableModule.getExportNamesByVariable().get(variable)?.[0] || '*', variableModule.id, alternativeReexportModule.id, importingModule.id, this.outputOptions.preserveModules ) ); } importingModule = alternativeReexportModule; } } while (alternativeReexportModule); } } private ensureReexportsAreAvailableForModule(module: Module): void { const includedReexports: Variable[] = []; const map = module.getExportNamesByVariable(); for (const exportedVariable of map.keys()) { const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable; const importedVariable = isSynthetic ? exportedVariable.getBaseVariable() : exportedVariable; this.checkCircularDependencyImport(importedVariable, module); // When preserving modules, we do not create namespace objects but directly // use the actual namespaces, which would be broken by this logic. if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) { const exportingModule = importedVariable.module; if (exportingModule instanceof Module) { const chunk = this.chunkByModule.get(exportingModule); if (chunk && chunk !== this) { chunk.exports.add(importedVariable); includedReexports.push(importedVariable); if (isSynthetic) { this.imports.add(importedVariable); } } } } } if (includedReexports.length > 0) { this.includedReexportsByModule.set(module, includedReexports); } } private generateVariableName(): string { if (this.manualChunkAlias) { return this.manualChunkAlias; } const moduleForNaming = this.entryModules[0] || this.implicitEntryModules[0] || this.dynamicEntryModules[0] || this.orderedModules[this.orderedModules.length - 1]; if (moduleForNaming) { return getChunkNameFromModule(moduleForNaming); } return 'chunk'; } private getChunkExportDeclarations(format: InternalModuleFormat): ChunkExports { const exports: ChunkExports = []; for (const exportName of this.getExportNames()) { if (exportName[0] === '*') continue; const variable = this.exportsByName.get(exportName)!; if (!(variable instanceof SyntheticNamedExportVariable)) { const module = variable.module; if (module) { const chunk = this.chunkByModule.get(module as Module); if (chunk !== this) { if (!chunk || format !== 'es') { continue; } const chunkDep = this.renderedDependencies!.get(chunk)!; if (!chunkDep) { continue; } const { imports, reexports } = chunkDep; const importedByReexported = reexports?.find( ({ reexported }) => reexported === exportName ); const isImported = imports?.find( ({ imported }) => imported === importedByReexported?.imported ); if (!isImported) { continue; } } } } let expression = null; let hoisted = false; let local = variable.getName(this.snippets.getPropertyAccess); if (variable instanceof LocalVariable) { for (const declaration of variable.declarations) { if ( declaration.parent instanceof FunctionDeclaration || (declaration instanceof ExportDefaultDeclaration && declaration.declaration instanceof FunctionDeclaration) ) { hoisted = true; break; } } } else if (variable instanceof SyntheticNamedExportVariable) { expression = local; if (format === 'es') { local = variable.renderName!; } } exports.push({ exported: exportName, expression, hoisted, local }); } return exports; } private getDependenciesToBeDeconflicted( addNonNamespacesAndInteropHelpers: boolean, addDependenciesWithoutBindings: boolean, interop: GetInterop ): DependenciesToBeDeconflicted { const dependencies = new Set(); const deconflictedDefault = new Set(); const deconflictedNamespace = new Set(); for (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) { if (addNonNamespacesAndInteropHelpers || variable.isNamespace) { const module = variable.module!; if (module instanceof ExternalModule) { const chunk = this.externalChunkByModule.get(module)!; dependencies.add(chunk); if (addNonNamespacesAndInteropHelpers) { if (variable.name === 'default') { if (defaultInteropHelpersByInteropType[interop(module.id)]) { deconflictedDefault.add(chunk); } } else if ( variable.name === '*' && namespaceInteropHelpersByInteropType[interop(module.id)] ) { deconflictedNamespace.add(chunk); } } } else { const chunk = this.chunkByModule.get(module)!; if (chunk !== this) { dependencies.add(chunk); if ( addNonNamespacesAndInteropHelpers && chunk.exportMode === 'default' && variable.isNamespace ) { deconflictedNamespace.add(chunk); } } } } } if (addDependenciesWithoutBindings) { for (const dependency of this.dependencies) { dependencies.add(dependency); } } return { deconflictedDefault, deconflictedNamespace, dependencies }; } private getDynamicDependencies(): (Chunk | ExternalChunk)[] { return this.getIncludedDynamicImports() .map( resolvedDynamicImport => resolvedDynamicImport.facadeChunk || resolvedDynamicImport.chunk || resolvedDynamicImport.externalChunk || resolvedDynamicImport.resolution ) .filter( (resolution): resolution is Chunk | ExternalChunk => resolution !== this && (resolution instanceof Chunk || resolution instanceof ExternalChunk) ); } private getDynamicImportStringAndAssertions( resolution: ExternalModule | string | null, fileName: string ): [importPath: string, assertions: string | null | true] { if (resolution instanceof ExternalModule) { const chunk = this.externalChunkByModule.get(resolution)!; return [`'${chunk.getImportPath(fileName)}'`, chunk.getImportAssertions(this.snippets)]; } return [ resolution || '', (this.outputOptions.format === 'es' && this.outputOptions.externalImportAssertions) || null ]; } private getFallbackChunkName(): string { if (this.manualChunkAlias) { return this.manualChunkAlias; } if (this.dynamicName) { return this.dynamicName; } if (this.fileName) { return getAliasName(this.fileName); } return getAliasName(this.orderedModules[this.orderedModules.length - 1].id); } private getImportSpecifiers(): Map { const { interop } = this.outputOptions; const importsByDependency = new Map(); for (const variable of this.imports) { const module = variable.module!; let dependency: Chunk | ExternalChunk; let imported: string; if (module instanceof ExternalModule) { dependency = this.externalChunkByModule.get(module)!; imported = variable.name; if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { return error(logUnexpectedNamedImport(module.id, imported, false)); } } else { dependency = this.chunkByModule.get(module)!; imported = dependency.getVariableExportName(variable); } getOrCreate(importsByDependency, dependency, getNewArray).push({ imported, local: variable.getName(this.snippets.getPropertyAccess) }); } return importsByDependency; } private getIncludedDynamicImports(): ResolvedDynamicImport[] { if (this.includedDynamicImports) { return this.includedDynamicImports; } const includedDynamicImports: ResolvedDynamicImport[] = []; for (const module of this.orderedModules) { for (const { node, resolution } of module.dynamicImports) { if (!node.included) { continue; } includedDynamicImports.push( resolution instanceof Module ? { chunk: this.chunkByModule.get(resolution)!, externalChunk: null, facadeChunk: this.facadeChunkByModule.get(resolution), node, resolution } : resolution instanceof ExternalModule ? { chunk: null, externalChunk: this.externalChunkByModule.get(resolution)!, facadeChunk: null, node, resolution } : { chunk: null, externalChunk: null, facadeChunk: null, node, resolution } ); } } return (this.includedDynamicImports = includedDynamicImports); } private getPreRenderedChunkInfo(): PreRenderedChunk { if (this.preRenderedChunkInfo) { return this.preRenderedChunkInfo; } const { dynamicEntryModules, facadeModule, implicitEntryModules, orderedModules } = this; return (this.preRenderedChunkInfo = { exports: this.getExportNames(), facadeModuleId: facadeModule && facadeModule.id, isDynamicEntry: dynamicEntryModules.length > 0, isEntry: !!facadeModule?.info.isEntry, isImplicitEntry: implicitEntryModules.length > 0, moduleIds: orderedModules.map(({ id }) => id), name: this.getChunkName(), type: 'chunk' }); } private getPreserveModulesChunkNameFromModule(module: Module): string { const predefinedChunkName = getPredefinedChunkNameFromModule(module); if (predefinedChunkName) return predefinedChunkName; const { preserveModulesRoot, sanitizeFileName } = this.outputOptions; const sanitizedId = sanitizeFileName(normalize(module.id.split(QUERY_HASH_REGEX, 1)[0])); const extensionName = extname(sanitizedId); const idWithoutExtension = NON_ASSET_EXTENSIONS.has(extensionName) ? sanitizedId.slice(0, -extensionName.length) : sanitizedId; if (isAbsolute(idWithoutExtension)) { return preserveModulesRoot && resolve(idWithoutExtension).startsWith(preserveModulesRoot) ? idWithoutExtension.slice(preserveModulesRoot.length).replace(/^[/\\]/, '') : relative(this.inputBase, idWithoutExtension); } else { return `_virtual/${basename(idWithoutExtension)}`; } } private getReexportSpecifiers(): Map { const { externalLiveBindings, interop } = this.outputOptions; const reexportSpecifiers = new Map(); for (let exportName of this.getExportNames()) { let dependency: Chunk | ExternalChunk; let imported: string; let needsLiveBinding = false; if (exportName[0] === '*') { const id = exportName.slice(1); if (interop(id) === 'defaultOnly') { this.inputOptions.onLog(LOGLEVEL_WARN, logUnexpectedNamespaceReexport(id)); } needsLiveBinding = externalLiveBindings; dependency = this.externalChunkByModule.get(this.modulesById.get(id) as ExternalModule)!; imported = exportName = '*'; } else { const variable = this.exportsByName.get(exportName)!; if (variable instanceof SyntheticNamedExportVariable) continue; const module = variable.module!; if (module instanceof Module) { dependency = this.chunkByModule.get(module)!; if (dependency === this) continue; imported = dependency.getVariableExportName(variable); needsLiveBinding = variable.isReassigned; } else { dependency = this.externalChunkByModule.get(module)!; imported = variable.name; if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { return error(logUnexpectedNamedImport(module.id, imported, true)); } needsLiveBinding = externalLiveBindings && (imported !== 'default' || isDefaultAProperty(interop(module.id), true)); } } getOrCreate(reexportSpecifiers, dependency, getNewArray).push({ imported, needsLiveBinding, reexported: exportName }); } return reexportSpecifiers; } private getReferencedFiles(): string[] { const referencedFiles = new Set(); for (const module of this.orderedModules) { for (const meta of module.importMetas) { const fileName = meta.getReferencedFileName(this.pluginDriver); if (fileName) { referencedFiles.add(fileName); } } } return [...referencedFiles]; } private getRenderedDependencies(): RenderedDependencies { if (this.renderedDependencies) { return this.renderedDependencies; } const importSpecifiers = this.getImportSpecifiers(); const reexportSpecifiers = this.getReexportSpecifiers(); const renderedDependencies = new Map(); const fileName = this.getFileName(); for (const dep of this.dependencies) { const imports = importSpecifiers.get(dep) || null; const reexports = reexportSpecifiers.get(dep) || null; const namedExportsMode = dep instanceof ExternalChunk || dep.exportMode !== 'default'; const importPath = dep.getImportPath(fileName); renderedDependencies.set(dep, { assertions: dep instanceof ExternalChunk ? dep.getImportAssertions(this.snippets) : null, defaultVariableName: dep.defaultVariableName, globalName: dep instanceof ExternalChunk && (this.outputOptions.format === 'umd' || this.outputOptions.format === 'iife') && getGlobalName( dep, this.outputOptions.globals, (imports || reexports) !== null, this.inputOptions.onLog ), importPath, imports, isChunk: dep instanceof Chunk, name: dep.variableName, namedExportsMode, namespaceVariableName: dep.namespaceVariableName, reexports }); } return (this.renderedDependencies = renderedDependencies); } private inlineChunkDependencies(chunk: Chunk): void { for (const dep of chunk.dependencies) { if (this.dependencies.has(dep)) continue; this.dependencies.add(dep); if (dep instanceof Chunk) { this.inlineChunkDependencies(dep); } } } // This method changes properties on the AST before rendering and must not be async private renderModules(fileName: string) { const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this; const { compact, dynamicImportFunction, format, freeze, namespaceToStringTag } = outputOptions; const { _, cnst, n } = snippets; this.setDynamicImportResolutions(fileName); this.setImportMetaResolutions(fileName); this.setIdentifierRenderResolutions(); const magicString = new MagicStringBundle({ separator: `${n}${n}` }); const indent = getIndentString(orderedModules, outputOptions); const usedModules: Module[] = []; let hoistedSource = ''; const accessedGlobals = new Set(); const renderedModuleSources = new Map(); const renderOptions: RenderOptions = { accessedDocumentCurrentScript: false, dynamicImportFunction, exportNamesByVariable, format, freeze, indent, namespaceToStringTag, pluginDriver, snippets, useOriginalName: null }; let usesTopLevelAwait = false; for (const module of orderedModules) { let renderedLength = 0; let source: MagicString | undefined; if (module.isIncluded() || includedNamespaces.has(module)) { const rendered = module.render(renderOptions); if ( !renderOptions.accessedDocumentCurrentScript && formatsMaybeAccessDocumentCurrentScript.includes(format) ) { // eslint-disable-next-line unicorn/consistent-destructuring this.accessedGlobalsByScope.get(module.scope)?.delete(DOCUMENT_CURRENT_SCRIPT); } renderOptions.accessedDocumentCurrentScript = false; ({ source } = rendered); usesTopLevelAwait ||= rendered.usesTopLevelAwait; renderedLength = source.length(); if (renderedLength) { if (compact && source.lastLine().includes('//')) source.append('\n'); renderedModuleSources.set(module, source); magicString.addSource(source); usedModules.push(module); } const namespace = module.namespace; if (includedNamespaces.has(module)) { const rendered = namespace.renderBlock(renderOptions); if (namespace.renderFirst()) hoistedSource += n + rendered; else magicString.addSource(new MagicString(rendered)); } const accessedGlobalVariables = accessedGlobalsByScope.get(module.scope); if (accessedGlobalVariables) { for (const name of accessedGlobalVariables) { accessedGlobals.add(name); } } } const { renderedExports, removedExports } = module.getRenderedExports(); renderedModules[module.id] = { get code() { return source?.toString() ?? null; }, originalLength: module.originalCode.length, removedExports, renderedExports, renderedLength }; } if (hoistedSource) magicString.prepend(hoistedSource + n + n); // eslint-disable-next-line unicorn/consistent-destructuring if (this.needsExportsShim) { magicString.prepend(`${n}${cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`); } const renderedSource = compact ? magicString : magicString.trim(); if (isEmpty && this.getExportNames().length === 0 && dependencies.size === 0) { onLog(LOGLEVEL_WARN, logEmptyChunk(this.getChunkName())); } return { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait }; } private setDynamicImportResolutions(fileName: string) { const { accessedGlobalsByScope, outputOptions, pluginDriver, snippets } = this; for (const resolvedDynamicImport of this.getIncludedDynamicImports()) { if (resolvedDynamicImport.chunk) { const { chunk, facadeChunk, node, resolution } = resolvedDynamicImport; if (chunk === this) { node.setInternalResolution(resolution.namespace); } else { node.setExternalResolution( (facadeChunk || chunk).exportMode, resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, `'${(facadeChunk || chunk).getImportPath(fileName)}'`, !facadeChunk?.strictFacade && chunk.exportNamesByVariable.get(resolution.namespace)![0], null ); } } else { const { node, resolution } = resolvedDynamicImport; const [resolutionString, assertions] = this.getDynamicImportStringAndAssertions( resolution, fileName ); node.setExternalResolution( 'external', resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, false, assertions ); } } } private setIdentifierRenderResolutions() { const { format, interop, namespaceToStringTag, preserveModules, externalLiveBindings } = this.outputOptions; const syntheticExports = new Set(); for (const exportName of this.getExportNames()) { const exportVariable = this.exportsByName.get(exportName)!; if ( format !== 'es' && format !== 'system' && exportVariable.isReassigned && !exportVariable.isId ) { exportVariable.setRenderNames('exports', exportName); } else if (exportVariable instanceof SyntheticNamedExportVariable) { syntheticExports.add(exportVariable); } else { exportVariable.setRenderNames(null, null); } } for (const module of this.orderedModules) { if (module.needsExportShim) { this.needsExportsShim = true; break; } } const usedNames = new Set(['Object', 'Promise']); if (this.needsExportsShim) { usedNames.add(MISSING_EXPORT_SHIM_VARIABLE); } if (namespaceToStringTag) { usedNames.add('Symbol'); } switch (format) { case 'system': { usedNames.add('module').add('exports'); break; } case 'es': { break; } case 'cjs': { usedNames.add('module').add('require').add('__filename').add('__dirname'); } // fallthrough default: { usedNames.add('exports'); for (const helper of HELPER_NAMES) { usedNames.add(helper); } } } deconflictChunk( this.orderedModules, this.getDependenciesToBeDeconflicted( format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop ), this.imports, usedNames, format, interop, preserveModules, externalLiveBindings, this.chunkByModule, this.externalChunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces ); } private setImportMetaResolutions(fileName: string) { const { accessedGlobalsByScope, includedNamespaces, orderedModules, outputOptions: { format } } = this; for (const module of orderedModules) { for (const importMeta of module.importMetas) { importMeta.setResolution(format, accessedGlobalsByScope, fileName); } if (includedNamespaces.has(module)) { module.namespace.prepare(accessedGlobalsByScope); } } } private setUpChunkImportsAndExportsForModule(module: Module): void { const moduleImports = new Set(module.includedImports); // when we are not preserving modules, we need to make all namespace variables available for // rendering the namespace object if (!this.outputOptions.preserveModules && this.includedNamespaces.has(module)) { const memberVariables = module.namespace.getMemberVariables(); for (const variable of Object.values(memberVariables)) { if (variable.included) { moduleImports.add(variable); } } } for (let variable of moduleImports) { if (variable instanceof ExportDefaultVariable) { variable = variable.getOriginalVariable(); } if (variable instanceof SyntheticNamedExportVariable) { variable = variable.getBaseVariable(); } const chunk = this.chunkByModule.get(variable.module as Module); if (chunk !== this) { this.imports.add(variable); if (variable.module instanceof Module) { this.checkCircularDependencyImport(variable, module); // When preserving modules, we do not create namespace objects but directly // use the actual namespaces, which would be broken by this logic. if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules)) { chunk!.exports.add(variable); } } } } if ( this.includedNamespaces.has(module) || (module.info.isEntry && module.preserveSignature !== false) || module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this) ) { this.ensureReexportsAreAvailableForModule(module); } for (const { node, resolution } of module.dynamicImports) { if ( node.included && resolution instanceof Module && this.chunkByModule.get(resolution) === this && !this.includedNamespaces.has(resolution) ) { this.includedNamespaces.add(resolution); this.ensureReexportsAreAvailableForModule(resolution); } } } } function getChunkNameFromModule(module: Module): string { return getPredefinedChunkNameFromModule(module) ?? getAliasName(module.id); } function getPredefinedChunkNameFromModule(module: Module): string { return ( module.chunkNames.find(({ isUserDefined }) => isUserDefined)?.name ?? module.chunkNames[0]?.name ); } function getImportedBindingsPerDependency( renderedDependencies: RenderedDependencies, resolveFileName: (dependency: Chunk | ExternalChunk) => string ): { [imported: string]: string[]; } { const importedBindingsPerDependency: { [imported: string]: string[] } = {}; for (const [dependency, declaration] of renderedDependencies) { const specifiers = new Set(); if (declaration.imports) { for (const { imported } of declaration.imports) { specifiers.add(imported); } } if (declaration.reexports) { for (const { imported } of declaration.reexports) { specifiers.add(imported); } } importedBindingsPerDependency[resolveFileName(dependency)] = [...specifiers]; } return importedBindingsPerDependency; } const QUERY_HASH_REGEX = /[#?]/; const resolveFileName = (dependency: Chunk | ExternalChunk): string => dependency.getFileName(); rollup-3.29.4/src/ExternalChunk.ts000066400000000000000000000042101450520414700170370ustar00rootroot00000000000000import type ExternalModule from './ExternalModule'; import type { ModuleInfo, NormalizedOutputOptions } from './rollup/types'; import { escapeId } from './utils/escapeId'; import type { GenerateCodeSnippets } from './utils/generateCodeSnippets'; import { normalize, relative } from './utils/path'; import { getImportPath } from './utils/relativeId'; export default class ExternalChunk { defaultVariableName = ''; id: string; namespaceVariableName = ''; suggestedVariableName: string; variableName = ''; private fileName: string | null = null; private importAssertions: string | null = null; private moduleInfo: ModuleInfo; private renormalizeRenderPath: boolean; constructor( module: ExternalModule, private options: NormalizedOutputOptions, private inputBase: string ) { this.id = module.id; this.moduleInfo = module.info; this.renormalizeRenderPath = module.renormalizeRenderPath; this.suggestedVariableName = module.suggestedVariableName; } getFileName(): string { if (this.fileName) { return this.fileName; } const { paths } = this.options; return (this.fileName = (typeof paths === 'function' ? paths(this.id) : paths[this.id]) || (this.renormalizeRenderPath ? normalize(relative(this.inputBase, this.id)) : this.id)); } getImportAssertions(snippets: GenerateCodeSnippets): string | null { return (this.importAssertions ||= formatAssertions( this.options.format === 'es' && this.options.externalImportAssertions && this.moduleInfo.assertions, snippets )); } getImportPath(importer: string): string { return escapeId( this.renormalizeRenderPath ? getImportPath(importer, this.getFileName(), this.options.format === 'amd', false) : this.getFileName() ); } } function formatAssertions( assertions: Record | null | void | false, { getObject }: GenerateCodeSnippets ): string | null { if (!assertions) { return null; } const assertionEntries: [key: string, value: string][] = Object.entries(assertions).map( ([key, value]) => [key, `'${value}'`] ); if (assertionEntries.length > 0) { return getObject(assertionEntries, { lineBreakIndent: null }); } return null; } rollup-3.29.4/src/ExternalModule.ts000066400000000000000000000070611450520414700172230ustar00rootroot00000000000000import ExternalVariable from './ast/variables/ExternalVariable'; import type { CustomPluginOptions, ModuleInfo, NormalizedInputOptions } from './rollup/types'; import { EMPTY_ARRAY } from './utils/blank'; import { makeLegal } from './utils/identifierHelpers'; import { LOGLEVEL_WARN } from './utils/logging'; import { logUnusedExternalImports, warnDeprecation } from './utils/logs'; import { URL_THIS_GETMODULEINFO } from './utils/urls'; export default class ExternalModule { readonly dynamicImporters: string[] = []; execIndex = Infinity; readonly exportedVariables = new Map(); readonly importers: string[] = []; readonly info: ModuleInfo; reexported = false; suggestedVariableName: string; used = false; private readonly declarations = new Map(); private mostCommonSuggestion = 0; private readonly nameSuggestions = new Map(); constructor( private readonly options: NormalizedInputOptions, public readonly id: string, moduleSideEffects: boolean | 'no-treeshake', meta: CustomPluginOptions, public readonly renormalizeRenderPath: boolean, assertions: Record ) { this.suggestedVariableName = makeLegal(id.split(/[/\\]/).pop()!); const { importers, dynamicImporters } = this; const info: ModuleInfo = (this.info = { assertions, ast: null, code: null, dynamicallyImportedIdResolutions: EMPTY_ARRAY, dynamicallyImportedIds: EMPTY_ARRAY, get dynamicImporters() { return dynamicImporters.sort(); }, exportedBindings: null, exports: null, hasDefaultExport: null, get hasModuleSideEffects() { warnDeprecation( 'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options ); return info.moduleSideEffects; }, id, implicitlyLoadedAfterOneOf: EMPTY_ARRAY, implicitlyLoadedBefore: EMPTY_ARRAY, importedIdResolutions: EMPTY_ARRAY, importedIds: EMPTY_ARRAY, get importers() { return importers.sort(); }, isEntry: false, isExternal: true, isIncluded: null, meta, moduleSideEffects, syntheticNamedExports: false }); // Hide the deprecated key so that it only warns when accessed explicitly Object.defineProperty(this.info, 'hasModuleSideEffects', { enumerable: false }); } getVariableForExportName(name: string): [variable: ExternalVariable] { const declaration = this.declarations.get(name); if (declaration) return [declaration]; const externalVariable = new ExternalVariable(this, name); this.declarations.set(name, externalVariable); this.exportedVariables.set(externalVariable, name); return [externalVariable]; } suggestName(name: string): void { const value = (this.nameSuggestions.get(name) ?? 0) + 1; this.nameSuggestions.set(name, value); if (value > this.mostCommonSuggestion) { this.mostCommonSuggestion = value; this.suggestedVariableName = name; } } warnUnusedImports(): void { const unused = [...this.declarations] .filter( ([name, declaration]) => name !== '*' && !declaration.included && !this.reexported && !declaration.referenced ) .map(([name]) => name); if (unused.length === 0) return; const importersSet = new Set(); for (const name of unused) { for (const importer of this.declarations.get(name)!.module.importers) { importersSet.add(importer); } } const importersArray = [...importersSet]; this.options.onLog(LOGLEVEL_WARN, logUnusedExternalImports(this.id, unused, importersArray)); } } rollup-3.29.4/src/Graph.ts000066400000000000000000000204701450520414700153330ustar00rootroot00000000000000import * as acorn from 'acorn'; import flru from 'flru'; import type ExternalModule from './ExternalModule'; import Module from './Module'; import { ModuleLoader, type UnresolvedModule } from './ModuleLoader'; import GlobalScope from './ast/scopes/GlobalScope'; import { PathTracker } from './ast/utils/PathTracker'; import type { ModuleInfo, ModuleJSON, NormalizedInputOptions, RollupCache, RollupWatcher, SerializablePluginCache, WatchChangeHook } from './rollup/types'; import { PluginDriver } from './utils/PluginDriver'; import Queue from './utils/Queue'; import { BuildPhase } from './utils/buildPhase'; import { addAnnotations } from './utils/commentAnnotations'; import { analyseModuleExecution } from './utils/executionOrder'; import { LOGLEVEL_WARN } from './utils/logging'; import { error, logCircularDependency, logImplicitDependantIsNotIncluded, logMissingExport } from './utils/logs'; import type { PureFunctions } from './utils/pureFunctions'; import { getPureFunctions } from './utils/pureFunctions'; import { timeEnd, timeStart } from './utils/timers'; import { markModuleAndImpureDependenciesAsExecuted } from './utils/traverseStaticDependencies'; function normalizeEntryModules( entryModules: readonly string[] | Record ): UnresolvedModule[] { if (Array.isArray(entryModules)) { return entryModules.map(id => ({ fileName: null, id, implicitlyLoadedAfter: [], importer: undefined, name: null })); } return Object.entries(entryModules).map(([name, id]) => ({ fileName: null, id, implicitlyLoadedAfter: [], importer: undefined, name })); } export default class Graph { readonly acornParser: typeof acorn.Parser; readonly astLru = flru(5); readonly cachedModules = new Map(); readonly deoptimizationTracker = new PathTracker(); entryModules: Module[] = []; readonly fileOperationQueue: Queue; readonly moduleLoader: ModuleLoader; readonly modulesById = new Map(); needsTreeshakingPass = false; phase: BuildPhase = BuildPhase.LOAD_AND_PARSE; readonly pluginDriver: PluginDriver; readonly pureFunctions: PureFunctions; readonly scope = new GlobalScope(); readonly watchFiles: Record = Object.create(null); watchMode = false; private readonly externalModules: ExternalModule[] = []; private implicitEntryModules: Module[] = []; private modules: Module[] = []; private declare pluginCache?: Record; constructor( private readonly options: NormalizedInputOptions, watcher: RollupWatcher | null ) { if (options.cache !== false) { if (options.cache?.modules) { for (const module of options.cache.modules) this.cachedModules.set(module.id, module); } this.pluginCache = options.cache?.plugins || Object.create(null); // increment access counter for (const name in this.pluginCache) { const cache = this.pluginCache[name]; for (const value of Object.values(cache)) value[0]++; } } if (watcher) { this.watchMode = true; const handleChange = (...parameters: Parameters) => this.pluginDriver.hookParallel('watchChange', parameters); const handleClose = () => this.pluginDriver.hookParallel('closeWatcher', []); watcher.onCurrentRun('change', handleChange); watcher.onCurrentRun('close', handleClose); } this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache); this.acornParser = acorn.Parser.extend(...(options.acornInjectPlugins as any[])); this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver); this.fileOperationQueue = new Queue(options.maxParallelFileOps); this.pureFunctions = getPureFunctions(options); } async build(): Promise { timeStart('generate module graph', 2); await this.generateModuleGraph(); timeEnd('generate module graph', 2); timeStart('sort and bind modules', 2); this.phase = BuildPhase.ANALYSE; this.sortModules(); timeEnd('sort and bind modules', 2); timeStart('mark included statements', 2); this.includeStatements(); timeEnd('mark included statements', 2); this.phase = BuildPhase.GENERATE; } contextParse(code: string, options: Partial = {}): acorn.Node { const onCommentOrig = options.onComment; const comments: acorn.Comment[] = []; options.onComment = onCommentOrig && typeof onCommentOrig == 'function' ? (block, text, start, end, ...parameters) => { comments.push({ end, start, type: block ? 'Block' : 'Line', value: text }); return onCommentOrig.call(options, block, text, start, end, ...parameters); } : comments; const ast = this.acornParser.parse(code, { ...(this.options.acorn as unknown as acorn.Options), ...options }); if (typeof onCommentOrig == 'object') { onCommentOrig.push(...comments); } options.onComment = onCommentOrig; addAnnotations(comments, ast, code); return ast; } getCache(): RollupCache { // handle plugin cache eviction for (const name in this.pluginCache) { const cache = this.pluginCache[name]; let allDeleted = true; for (const [key, value] of Object.entries(cache)) { if (value[0] >= this.options.experimentalCacheExpiry) delete cache[key]; else allDeleted = false; } if (allDeleted) delete this.pluginCache[name]; } return { modules: this.modules.map(module => module.toJSON()), plugins: this.pluginCache }; } getModuleInfo = (moduleId: string): ModuleInfo | null => { const foundModule = this.modulesById.get(moduleId); if (!foundModule) return null; return foundModule.info; }; private async generateModuleGraph(): Promise { ({ entryModules: this.entryModules, implicitEntryModules: this.implicitEntryModules } = await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input), true)); if (this.entryModules.length === 0) { throw new Error('You must supply options.input to rollup'); } for (const module of this.modulesById.values()) { if (module instanceof Module) { this.modules.push(module); } else { this.externalModules.push(module); } } } private includeStatements(): void { const entryModules = [...this.entryModules, ...this.implicitEntryModules]; for (const module of entryModules) { markModuleAndImpureDependenciesAsExecuted(module); } if (this.options.treeshake) { let treeshakingPass = 1; do { timeStart(`treeshaking pass ${treeshakingPass}`, 3); this.needsTreeshakingPass = false; for (const module of this.modules) { if (module.isExecuted) { if (module.info.moduleSideEffects === 'no-treeshake') { module.includeAllInBundle(); } else { module.include(); } } } if (treeshakingPass === 1) { // We only include exports after the first pass to avoid issues with // the TDZ detection logic for (const module of entryModules) { if (module.preserveSignature !== false) { module.includeAllExports(false); this.needsTreeshakingPass = true; } } } timeEnd(`treeshaking pass ${treeshakingPass++}`, 3); } while (this.needsTreeshakingPass); } else { for (const module of this.modules) module.includeAllInBundle(); } for (const externalModule of this.externalModules) externalModule.warnUnusedImports(); for (const module of this.implicitEntryModules) { for (const dependant of module.implicitlyLoadedAfter) { if (!(dependant.info.isEntry || dependant.isIncluded())) { error(logImplicitDependantIsNotIncluded(dependant)); } } } } private sortModules(): void { const { orderedModules, cyclePaths } = analyseModuleExecution(this.entryModules); for (const cyclePath of cyclePaths) { this.options.onLog(LOGLEVEL_WARN, logCircularDependency(cyclePath)); } this.modules = orderedModules; for (const module of this.modules) { module.bindReferences(); } this.warnForMissingExports(); } private warnForMissingExports(): void { for (const module of this.modules) { for (const importDescription of module.importDescriptions.values()) { if ( importDescription.name !== '*' && !importDescription.module.getVariableForExportName(importDescription.name)[0] ) { module.log( LOGLEVEL_WARN, logMissingExport(importDescription.name, module.id, importDescription.module.id), importDescription.start ); } } } } } rollup-3.29.4/src/Module.ts000066400000000000000000001262071450520414700155240ustar00rootroot00000000000000import { extractAssignedNames } from '@rollup/pluginutils'; import type * as acorn from 'acorn'; import { locate } from 'locate-character'; import MagicString from 'magic-string'; import ExternalModule from './ExternalModule'; import type Graph from './Graph'; import { createInclusionContext } from './ast/ExecutionContext'; import { nodeConstructors } from './ast/nodes'; import ExportAllDeclaration from './ast/nodes/ExportAllDeclaration'; import ExportDefaultDeclaration from './ast/nodes/ExportDefaultDeclaration'; import type ExportNamedDeclaration from './ast/nodes/ExportNamedDeclaration'; import Identifier from './ast/nodes/Identifier'; import type ImportDeclaration from './ast/nodes/ImportDeclaration'; import ImportDefaultSpecifier from './ast/nodes/ImportDefaultSpecifier'; import type ImportExpression from './ast/nodes/ImportExpression'; import ImportNamespaceSpecifier from './ast/nodes/ImportNamespaceSpecifier'; import Literal from './ast/nodes/Literal'; import type MetaProperty from './ast/nodes/MetaProperty'; import Program from './ast/nodes/Program'; import TemplateLiteral from './ast/nodes/TemplateLiteral'; import VariableDeclaration from './ast/nodes/VariableDeclaration'; import type { ExpressionNode, NodeBase } from './ast/nodes/shared/Node'; import ModuleScope from './ast/scopes/ModuleScope'; import { type PathTracker, UNKNOWN_PATH } from './ast/utils/PathTracker'; import ExportDefaultVariable from './ast/variables/ExportDefaultVariable'; import ExportShimVariable from './ast/variables/ExportShimVariable'; import ExternalVariable from './ast/variables/ExternalVariable'; import NamespaceVariable from './ast/variables/NamespaceVariable'; import SyntheticNamedExportVariable from './ast/variables/SyntheticNamedExportVariable'; import type Variable from './ast/variables/Variable'; import type { CustomPluginOptions, DecodedSourceMapOrMissing, EmittedFile, ExistingDecodedSourceMap, LogLevel, ModuleInfo, ModuleJSON, ModuleOptions, NormalizedInputOptions, PartialNull, PreserveEntrySignaturesOption, ResolvedId, ResolvedIdMap, RollupError, RollupLog, TransformModuleJSON } from './rollup/types'; import { EMPTY_OBJECT } from './utils/blank'; import { BuildPhase } from './utils/buildPhase'; import { decodedSourcemap, resetSourcemapCache } from './utils/decodedSourcemap'; import { getId } from './utils/getId'; import { getNewSet, getOrCreate } from './utils/getOrCreate'; import { getOriginalLocation } from './utils/getOriginalLocation'; import { makeLegal } from './utils/identifierHelpers'; import { LOGLEVEL_WARN } from './utils/logging'; import { augmentCodeLocation, error, logAmbiguousExternalNamespaces, logCircularReexport, logInconsistentImportAssertions, logInvalidFormatForTopLevelAwait, logInvalidSourcemapForError, logMissingExport, logNamespaceConflict, logParseError, logShimmedExport, logSyntheticNamedExportsNeedNamespaceExport, warnDeprecation } from './utils/logs'; import { doAssertionsDiffer, getAssertionsFromImportExportDeclaration } from './utils/parseAssertions'; import { basename, extname } from './utils/path'; import type { PureFunctions } from './utils/pureFunctions'; import type { RenderOptions } from './utils/renderHelpers'; import { timeEnd, timeStart } from './utils/timers'; import { markModuleAndImpureDependenciesAsExecuted } from './utils/traverseStaticDependencies'; import { URL_THIS_GETMODULEINFO } from './utils/urls'; import { MISSING_EXPORT_SHIM_VARIABLE } from './utils/variableNames'; interface ImportDescription { module: Module | ExternalModule; name: string; source: string; start: number; } interface ExportDescription { identifier: string | null; localName: string; } interface ReexportDescription { localName: string; module: Module | ExternalModule; source: string; start: number; } export interface AstContext { addDynamicImport: (node: ImportExpression) => void; addExport: ( node: ExportAllDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration ) => void; addImport: (node: ImportDeclaration) => void; addImportMeta: (node: MetaProperty) => void; code: string; deoptimizationTracker: PathTracker; error: (properties: RollupLog, pos: number) => never; fileName: string; getExports: () => string[]; getModuleExecIndex: () => number; getModuleName: () => string; getNodeConstructor: (name: string) => typeof NodeBase; getReexports: () => string[]; importDescriptions: Map; includeAllExports: () => void; includeDynamicImport: (node: ImportExpression) => void; includeVariableInModule: (variable: Variable) => void; log: (level: LogLevel, properties: RollupLog, pos: number) => void; magicString: MagicString; manualPureFunctions: PureFunctions; module: Module; // not to be used for tree-shaking moduleContext: string; options: NormalizedInputOptions; requestTreeshakingPass: () => void; traceExport: (name: string) => Variable | null; traceVariable: (name: string) => Variable | null; usesTopLevelAwait: boolean; } export interface DynamicImport { argument: string | ExpressionNode; id: string | null; node: ImportExpression; resolution: Module | ExternalModule | string | null; } const MISSING_EXPORT_SHIM_DESCRIPTION: ExportDescription = { identifier: null, localName: MISSING_EXPORT_SHIM_VARIABLE }; function getVariableForExportNameRecursive( target: Module | ExternalModule, name: string, importerForSideEffects: Module | undefined, isExportAllSearch: boolean | undefined, searchedNamesAndModules = new Map>() ): [variable: Variable | null, indirectExternal?: boolean] { const searchedModules = searchedNamesAndModules.get(name); if (searchedModules) { if (searchedModules.has(target)) { return isExportAllSearch ? [null] : error(logCircularReexport(name, target.id)); } searchedModules.add(target); } else { searchedNamesAndModules.set(name, new Set([target])); } return target.getVariableForExportName(name, { importerForSideEffects, isExportAllSearch, searchedNamesAndModules }); } function getAndExtendSideEffectModules(variable: Variable, module: Module): Set { const sideEffectModules = getOrCreate( module.sideEffectDependenciesByVariable, variable, getNewSet ); let currentVariable: Variable | null = variable; const referencedVariables = new Set([currentVariable]); while (true) { const importingModule = currentVariable.module! as Module; currentVariable = currentVariable instanceof ExportDefaultVariable ? currentVariable.getDirectOriginalVariable() : currentVariable instanceof SyntheticNamedExportVariable ? currentVariable.syntheticNamespace : null; if (!currentVariable || referencedVariables.has(currentVariable)) { break; } referencedVariables.add(currentVariable); sideEffectModules.add(importingModule); const originalSideEffects = importingModule.sideEffectDependenciesByVariable.get(currentVariable); if (originalSideEffects) { for (const module of originalSideEffects) { sideEffectModules.add(module); } } } return sideEffectModules; } export default class Module { readonly alternativeReexportModules = new Map(); readonly chunkFileNames = new Set(); chunkNames: { isUserDefined: boolean; name: string; priority: number; }[] = []; readonly cycles = new Set(); readonly dependencies = new Set(); readonly dynamicDependencies = new Set(); readonly dynamicImporters: string[] = []; readonly dynamicImports: DynamicImport[] = []; excludeFromSourcemap: boolean; execIndex = Infinity; readonly implicitlyLoadedAfter = new Set(); readonly implicitlyLoadedBefore = new Set(); readonly importDescriptions = new Map(); readonly importMetas: MetaProperty[] = []; importedFromNotTreeshaken = false; readonly importers: string[] = []; readonly includedDynamicImporters: Module[] = []; readonly includedImports = new Set(); readonly info: ModuleInfo; isExecuted = false; isUserDefinedEntryPoint = false; declare magicString: MagicString; declare namespace: NamespaceVariable; needsExportShim = false; declare originalCode: string; declare originalSourcemap: ExistingDecodedSourceMap | null; preserveSignature: PreserveEntrySignaturesOption; declare resolvedIds: ResolvedIdMap; declare scope: ModuleScope; readonly sideEffectDependenciesByVariable = new Map>(); declare sourcemapChain: DecodedSourceMapOrMissing[]; readonly sourcesWithAssertions = new Map>(); declare transformFiles?: EmittedFile[]; private allExportNames: Set | null = null; private ast: Program | null = null; private declare astContext: AstContext; private readonly context: string; private declare customTransformCache: boolean; private readonly exportAllModules: (Module | ExternalModule)[] = []; private readonly exportAllSources = new Set(); private exportNamesByVariable: Map | null = null; private readonly exportShimVariable = new ExportShimVariable(this); private readonly exports = new Map(); private readonly namespaceReexportsByName = new Map< string, [variable: Variable | null, indirectExternal?: boolean] >(); private readonly reexportDescriptions = new Map(); private relevantDependencies: Set | null = null; private readonly syntheticExports = new Map(); private syntheticNamespace: Variable | null | undefined = null; private transformDependencies: string[] = []; private transitiveReexports: string[] | null = null; constructor( private readonly graph: Graph, public readonly id: string, private readonly options: NormalizedInputOptions, isEntry: boolean, moduleSideEffects: boolean | 'no-treeshake', syntheticNamedExports: boolean | string, meta: CustomPluginOptions, assertions: Record ) { this.excludeFromSourcemap = /\0/.test(id); this.context = options.moduleContext(id); this.preserveSignature = this.options.preserveEntrySignatures; // eslint-disable-next-line @typescript-eslint/no-this-alias const module = this; const { dynamicImports, dynamicImporters, exportAllSources, exports, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAssertions } = this; this.info = { assertions, ast: null, code: null, get dynamicallyImportedIdResolutions() { return dynamicImports .map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument]) .filter(Boolean) as ResolvedId[]; }, get dynamicallyImportedIds() { // We cannot use this.dynamicDependencies because this is needed before // dynamicDependencies are populated return dynamicImports.map(({ id }) => id).filter((id): id is string => id != null); }, get dynamicImporters() { return dynamicImporters.sort(); }, get exportedBindings() { const exportBindings: Record = { '.': [...exports.keys()] }; for (const [name, { source }] of reexportDescriptions) { (exportBindings[source] ??= []).push(name); } for (const source of exportAllSources) { (exportBindings[source] ??= []).push('*'); } return exportBindings; }, get exports() { return [ ...exports.keys(), ...reexportDescriptions.keys(), ...[...exportAllSources].map(() => '*') ]; }, get hasDefaultExport() { // This information is only valid after parsing if (!module.ast) { return null; } return module.exports.has('default') || reexportDescriptions.has('default'); }, get hasModuleSideEffects() { warnDeprecation( 'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options ); return this.moduleSideEffects; }, id, get implicitlyLoadedAfterOneOf() { // eslint-disable-next-line unicorn/prefer-spread return Array.from(implicitlyLoadedAfter, getId).sort(); }, get implicitlyLoadedBefore() { // eslint-disable-next-line unicorn/prefer-spread return Array.from(implicitlyLoadedBefore, getId).sort(); }, get importedIdResolutions() { // eslint-disable-next-line unicorn/prefer-spread return Array.from( sourcesWithAssertions.keys(), source => module.resolvedIds[source] ).filter(Boolean); }, get importedIds() { // We cannot use this.dependencies because this is needed before // dependencies are populated // eslint-disable-next-line unicorn/prefer-spread return Array.from( sourcesWithAssertions.keys(), source => module.resolvedIds[source]?.id ).filter(Boolean); }, get importers() { return importers.sort(); }, isEntry, isExternal: false, get isIncluded() { if (graph.phase !== BuildPhase.GENERATE) { return null; } return module.isIncluded(); }, meta: { ...meta }, moduleSideEffects, syntheticNamedExports }; // Hide the deprecated key so that it only warns when accessed explicitly // eslint-disable-next-line unicorn/consistent-destructuring Object.defineProperty(this.info, 'hasModuleSideEffects', { enumerable: false }); } basename(): string { const base = basename(this.id); const extension = extname(this.id); return makeLegal(extension ? base.slice(0, -extension.length) : base); } bindReferences(): void { this.ast!.bind(); } error(properties: RollupError, pos: number): never { this.addLocationToLogProps(properties, pos); return error(properties); } // sum up the length of all ast nodes that are included estimateSize(): number { let size = 0; for (const node of this.ast!.body) { if (node.included) { size += node.end - node.start; } } return size; } getAllExportNames(): Set { if (this.allExportNames) { return this.allExportNames; } this.allExportNames = new Set([...this.exports.keys(), ...this.reexportDescriptions.keys()]); for (const module of this.exportAllModules) { if (module instanceof ExternalModule) { this.allExportNames.add(`*${module.id}`); continue; } for (const name of module.getAllExportNames()) { if (name !== 'default') this.allExportNames.add(name); } } // We do not count the synthetic namespace as a regular export to hide it // from entry signatures and namespace objects if (typeof this.info.syntheticNamedExports === 'string') { this.allExportNames.delete(this.info.syntheticNamedExports); } return this.allExportNames; } getDependenciesToBeIncluded(): Set { if (this.relevantDependencies) return this.relevantDependencies; this.relevantDependencies = new Set(); const necessaryDependencies = new Set(); const alwaysCheckedDependencies = new Set(); const dependencyVariables = new Set(this.includedImports); if ( this.info.isEntry || this.includedDynamicImporters.length > 0 || this.namespace.included || this.implicitlyLoadedAfter.size > 0 ) { for (const exportName of [...this.getReexports(), ...this.getExports()]) { const [exportedVariable] = this.getVariableForExportName(exportName); if (exportedVariable?.included) { dependencyVariables.add(exportedVariable); } } } for (let variable of dependencyVariables) { const sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable); if (sideEffectDependencies) { for (const module of sideEffectDependencies) { alwaysCheckedDependencies.add(module); } } if (variable instanceof SyntheticNamedExportVariable) { variable = variable.getBaseVariable(); } else if (variable instanceof ExportDefaultVariable) { variable = variable.getOriginalVariable(); } necessaryDependencies.add(variable.module!); } if (!this.options.treeshake || this.info.moduleSideEffects === 'no-treeshake') { for (const dependency of this.dependencies) { this.relevantDependencies.add(dependency); } } else { this.addRelevantSideEffectDependencies( this.relevantDependencies, necessaryDependencies, alwaysCheckedDependencies ); } for (const dependency of necessaryDependencies) { this.relevantDependencies.add(dependency); } return this.relevantDependencies; } getExportNamesByVariable(): Map { if (this.exportNamesByVariable) { return this.exportNamesByVariable; } const exportNamesByVariable = new Map(); for (const exportName of this.getAllExportNames()) { let [tracedVariable] = this.getVariableForExportName(exportName); if (tracedVariable instanceof ExportDefaultVariable) { tracedVariable = tracedVariable.getOriginalVariable(); } if ( !tracedVariable || !(tracedVariable.included || tracedVariable instanceof ExternalVariable) ) { continue; } const existingExportNames = exportNamesByVariable.get(tracedVariable); if (existingExportNames) { existingExportNames.push(exportName); } else { exportNamesByVariable.set(tracedVariable, [exportName]); } } return (this.exportNamesByVariable = exportNamesByVariable); } getExports(): string[] { return [...this.exports.keys()]; } getReexports(): string[] { if (this.transitiveReexports) { return this.transitiveReexports; } // to avoid infinite recursion when using circular `export * from X` this.transitiveReexports = []; const reexports = new Set(this.reexportDescriptions.keys()); for (const module of this.exportAllModules) { if (module instanceof ExternalModule) { reexports.add(`*${module.id}`); } else { for (const name of [...module.getReexports(), ...module.getExports()]) { if (name !== 'default') reexports.add(name); } } } return (this.transitiveReexports = [...reexports]); } getRenderedExports(): { removedExports: string[]; renderedExports: string[] } { // only direct exports are counted here, not reexports at all const renderedExports: string[] = []; const removedExports: string[] = []; for (const exportName of this.exports.keys()) { const [variable] = this.getVariableForExportName(exportName); (variable && variable.included ? renderedExports : removedExports).push(exportName); } return { removedExports, renderedExports }; } getSyntheticNamespace(): Variable { if (this.syntheticNamespace === null) { this.syntheticNamespace = undefined; [this.syntheticNamespace] = this.getVariableForExportName( typeof this.info.syntheticNamedExports === 'string' ? this.info.syntheticNamedExports : 'default', { onlyExplicit: true } ); } if (!this.syntheticNamespace) { return error( logSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports) ); } return this.syntheticNamespace; } getVariableForExportName( name: string, { importerForSideEffects, isExportAllSearch, onlyExplicit, searchedNamesAndModules }: { importerForSideEffects?: Module; isExportAllSearch?: boolean; onlyExplicit?: boolean; searchedNamesAndModules?: Map>; } = EMPTY_OBJECT ): [variable: Variable | null, indirectExternal?: boolean] { if (name[0] === '*') { if (name.length === 1) { // export * from './other' return [this.namespace]; } // export * from 'external' const module = this.graph.modulesById.get(name.slice(1)) as ExternalModule; return module.getVariableForExportName('*'); } // export { foo } from './other' const reexportDeclaration = this.reexportDescriptions.get(name); if (reexportDeclaration) { const [variable] = getVariableForExportNameRecursive( reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules ); if (!variable) { return this.error( logMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start ); } if (importerForSideEffects) { setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); if (this.info.moduleSideEffects) { getOrCreate( importerForSideEffects.sideEffectDependenciesByVariable, variable, getNewSet ).add(this); } } return [variable]; } const exportDeclaration = this.exports.get(name); if (exportDeclaration) { if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) { return [this.exportShimVariable]; } const name = exportDeclaration.localName; const variable = this.traceVariable(name, { importerForSideEffects, searchedNamesAndModules })!; if (importerForSideEffects) { setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); getOrCreate( importerForSideEffects.sideEffectDependenciesByVariable, variable, getNewSet ).add(this); } return [variable]; } if (onlyExplicit) { return [null]; } if (name !== 'default') { const foundNamespaceReexport = this.namespaceReexportsByName.get(name) ?? this.getVariableFromNamespaceReexports( name, importerForSideEffects, searchedNamesAndModules ); this.namespaceReexportsByName.set(name, foundNamespaceReexport); if (foundNamespaceReexport[0]) { return foundNamespaceReexport; } } if (this.info.syntheticNamedExports) { return [ getOrCreate( this.syntheticExports, name, () => new SyntheticNamedExportVariable(this.astContext, name, this.getSyntheticNamespace()) ) ]; } // we don't want to create shims when we are just // probing export * modules for exports if (!isExportAllSearch && this.options.shimMissingExports) { this.shimMissingExport(name); return [this.exportShimVariable]; } return [null]; } hasEffects(): boolean { return this.info.moduleSideEffects === 'no-treeshake' || this.ast!.hasCachedEffects(); } include(): void { const context = createInclusionContext(); if (this.ast!.shouldBeIncluded(context)) this.ast!.include(context, false); } includeAllExports(includeNamespaceMembers: boolean): void { if (!this.isExecuted) { markModuleAndImpureDependenciesAsExecuted(this); this.graph.needsTreeshakingPass = true; } for (const exportName of this.exports.keys()) { if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) { const variable = this.getVariableForExportName(exportName)[0]!; variable.deoptimizePath(UNKNOWN_PATH); if (!variable.included) { this.includeVariable(variable); } } } for (const name of this.getReexports()) { const [variable] = this.getVariableForExportName(name); if (variable) { variable.deoptimizePath(UNKNOWN_PATH); if (!variable.included) { this.includeVariable(variable); } if (variable instanceof ExternalVariable) { variable.module.reexported = true; } } } if (includeNamespaceMembers) { this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces()); } } includeAllInBundle(): void { this.ast!.include(createInclusionContext(), true); this.includeAllExports(false); } includeExportsByNames(names: readonly string[]): void { if (!this.isExecuted) { markModuleAndImpureDependenciesAsExecuted(this); this.graph.needsTreeshakingPass = true; } let includeNamespaceMembers = false; for (const name of names) { const variable = this.getVariableForExportName(name)[0]; if (variable) { variable.deoptimizePath(UNKNOWN_PATH); if (!variable.included) { this.includeVariable(variable); } } if (!this.exports.has(name) && !this.reexportDescriptions.has(name)) { includeNamespaceMembers = true; } } if (includeNamespaceMembers) { this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces()); } } isIncluded(): boolean | null { // Modules where this.ast is missing have been loaded via this.load and are // not yet fully processed, hence they cannot be included. return ( this.ast && (this.ast.included || this.namespace.included || this.importedFromNotTreeshaken || this.exportShimVariable.included) ); } linkImports(): void { this.addModulesToImportDescriptions(this.importDescriptions); this.addModulesToImportDescriptions(this.reexportDescriptions); const externalExportAllModules: ExternalModule[] = []; for (const source of this.exportAllSources) { const module = this.graph.modulesById.get(this.resolvedIds[source].id)!; if (module instanceof ExternalModule) { externalExportAllModules.push(module); continue; } this.exportAllModules.push(module); } this.exportAllModules.push(...externalExportAllModules); } log(level: LogLevel, properties: RollupLog, pos: number): void { this.addLocationToLogProps(properties, pos); this.options.onLog(level, properties); } render(options: RenderOptions): { source: MagicString; usesTopLevelAwait: boolean } { const source = this.magicString.clone(); this.ast!.render(source, options); source.trim(); const { usesTopLevelAwait } = this.astContext; if (usesTopLevelAwait && options.format !== 'es' && options.format !== 'system') { return error(logInvalidFormatForTopLevelAwait(this.id, options.format)); } return { source, usesTopLevelAwait }; } setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }: TransformModuleJSON & { resolvedIds?: ResolvedIdMap; transformFiles?: EmittedFile[] | undefined; }): void { timeStart('generate ast', 3); this.info.code = code; this.originalCode = originalCode; // We need to call decodedSourcemap on the input in case they were hydrated from json in the cache and don't // have the lazy evaluation cache configured. Right now this isn't enforced by the type system because the // RollupCache stores `ExistingDecodedSourcemap` instead of `ExistingRawSourcemap` this.originalSourcemap = decodedSourcemap(originalSourcemap); this.sourcemapChain = sourcemapChain.map(mapOrMissing => mapOrMissing.missing ? mapOrMissing : decodedSourcemap(mapOrMissing) ); // If coming from cache and this value is already fully decoded, we want to re-encode here to save memory. resetSourcemapCache(this.originalSourcemap, this.sourcemapChain); if (transformFiles) { this.transformFiles = transformFiles; } this.transformDependencies = transformDependencies; this.customTransformCache = customTransformCache; this.updateOptions(moduleOptions); const moduleAst = ast ?? this.tryParse(); timeEnd('generate ast', 3); timeStart('analyze ast', 3); this.resolvedIds = resolvedIds ?? Object.create(null); // By default, `id` is the file name. Custom resolvers and loaders // can change that, but it makes sense to use it for the source file name const fileName = this.id; this.magicString = new MagicString(code, { filename: (this.excludeFromSourcemap ? null : fileName)!, // don't include plugin helpers in sourcemap indentExclusionRanges: [] }); this.astContext = { addDynamicImport: this.addDynamicImport.bind(this), addExport: this.addExport.bind(this), addImport: this.addImport.bind(this), addImportMeta: this.addImportMeta.bind(this), code, // Only needed for debugging deoptimizationTracker: this.graph.deoptimizationTracker, error: this.error.bind(this), fileName, // Needed for warnings getExports: this.getExports.bind(this), getModuleExecIndex: () => this.execIndex, getModuleName: this.basename.bind(this), getNodeConstructor: (name: string) => nodeConstructors[name] || nodeConstructors.UnknownNode, getReexports: this.getReexports.bind(this), importDescriptions: this.importDescriptions, includeAllExports: () => this.includeAllExports(true), includeDynamicImport: this.includeDynamicImport.bind(this), includeVariableInModule: this.includeVariableInModule.bind(this), log: this.log.bind(this), magicString: this.magicString, manualPureFunctions: this.graph.pureFunctions, module: this, moduleContext: this.context, options: this.options, requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true), traceExport: (name: string) => this.getVariableForExportName(name)[0], traceVariable: this.traceVariable.bind(this), usesTopLevelAwait: false }; this.scope = new ModuleScope(this.graph.scope, this.astContext); this.namespace = new NamespaceVariable(this.astContext); this.ast = new Program(moduleAst, { context: this.astContext, type: 'Module' }, this.scope); // Assign AST directly if has existing one as there's no way to drop it from memory. // If cache is enabled, also assign directly as otherwise it takes more CPU and memory to re-compute. if (ast || this.options.cache !== false) { this.info.ast = moduleAst; } else { // Make lazy and apply LRU cache to not hog the memory Object.defineProperty(this.info, 'ast', { get: () => { if (this.graph.astLru.has(fileName)) { return this.graph.astLru.get(fileName)!; } else { const parsedAst = this.tryParse(); this.graph.astLru.set(fileName, parsedAst); return parsedAst; } } }); } timeEnd('analyze ast', 3); } toJSON(): ModuleJSON { return { assertions: this.info.assertions, ast: this.info.ast!, code: this.info.code!, customTransformCache: this.customTransformCache, // eslint-disable-next-line unicorn/prefer-spread dependencies: Array.from(this.dependencies, getId), id: this.id, meta: this.info.meta, moduleSideEffects: this.info.moduleSideEffects, originalCode: this.originalCode, originalSourcemap: this.originalSourcemap, resolvedIds: this.resolvedIds, sourcemapChain: this.sourcemapChain, syntheticNamedExports: this.info.syntheticNamedExports, transformDependencies: this.transformDependencies, transformFiles: this.transformFiles }; } traceVariable( name: string, { importerForSideEffects, isExportAllSearch, searchedNamesAndModules }: { importerForSideEffects?: Module; isExportAllSearch?: boolean; searchedNamesAndModules?: Map>; } = EMPTY_OBJECT ): Variable | null { const localVariable = this.scope.variables.get(name); if (localVariable) { return localVariable; } const importDescription = this.importDescriptions.get(name); if (importDescription) { const otherModule = importDescription.module; if (otherModule instanceof Module && importDescription.name === '*') { return otherModule.namespace; } const [declaration] = getVariableForExportNameRecursive( otherModule, importDescription.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules ); if (!declaration) { return this.error( logMissingExport(importDescription.name, this.id, otherModule.id), importDescription.start ); } return declaration; } return null; } updateOptions({ meta, moduleSideEffects, syntheticNamedExports }: Partial>): void { if (moduleSideEffects != null) { this.info.moduleSideEffects = moduleSideEffects; } if (syntheticNamedExports != null) { this.info.syntheticNamedExports = syntheticNamedExports; } if (meta != null) { Object.assign(this.info.meta, meta); } } private addDynamicImport(node: ImportExpression) { let argument: ExpressionNode | string = node.source; if (argument instanceof TemplateLiteral) { if (argument.quasis.length === 1 && argument.quasis[0].value.cooked) { argument = argument.quasis[0].value.cooked; } } else if (argument instanceof Literal && typeof argument.value === 'string') { argument = argument.value; } this.dynamicImports.push({ argument, id: null, node, resolution: null }); } private addExport( node: ExportAllDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration ): void { if (node instanceof ExportDefaultDeclaration) { // export default foo; this.exports.set('default', { identifier: node.variable.getAssignedVariableName(), localName: 'default' }); } else if (node instanceof ExportAllDeclaration) { const source = node.source.value; this.addSource(source, node); if (node.exported) { // export * as name from './other' const name = node.exported.name; this.reexportDescriptions.set(name, { localName: '*', module: null as never, // filled in later, source, start: node.start }); } else { // export * from './other' this.exportAllSources.add(source); } } else if (node.source instanceof Literal) { // export { name } from './other' const source = node.source.value; this.addSource(source, node); for (const { exported, local, start } of node.specifiers) { const name = exported instanceof Literal ? exported.value : exported.name; this.reexportDescriptions.set(name, { localName: local instanceof Literal ? local.value : local.name, module: null as never, // filled in later, source, start }); } } else if (node.declaration) { const declaration = node.declaration; if (declaration instanceof VariableDeclaration) { // export var { foo, bar } = ... // export var foo = 1, bar = 2; for (const declarator of declaration.declarations) { for (const localName of extractAssignedNames(declarator.id)) { this.exports.set(localName, { identifier: null, localName }); } } } else { // export function foo () {} const localName = (declaration.id as Identifier).name; this.exports.set(localName, { identifier: null, localName }); } } else { // export { foo, bar, baz } for (const { local, exported } of node.specifiers) { // except for reexports, local must be an Identifier const localName = (local as Identifier).name; const exportedName = exported instanceof Identifier ? exported.name : exported.value; this.exports.set(exportedName, { identifier: null, localName }); } } } private addImport(node: ImportDeclaration): void { const source = node.source.value; this.addSource(source, node); for (const specifier of node.specifiers) { const name = specifier instanceof ImportDefaultSpecifier ? 'default' : specifier instanceof ImportNamespaceSpecifier ? '*' : specifier.imported instanceof Identifier ? specifier.imported.name : specifier.imported.value; this.importDescriptions.set(specifier.local.name, { module: null as never, // filled in later name, source, start: specifier.start }); } } private addImportMeta(node: MetaProperty): void { this.importMetas.push(node); } private addLocationToLogProps(properties: RollupLog, pos: number): void { properties.id = this.id; properties.pos = pos; let code = this.info.code; const location = locate(code!, pos, { offsetLine: 1 }); if (location) { let { column, line } = location; try { ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line })); code = this.originalCode; } catch (error_: any) { this.options.onLog( LOGLEVEL_WARN, logInvalidSourcemapForError(error_, this.id, column, line, pos) ); } augmentCodeLocation(properties, { column, line }, code!, this.id); } } private addModulesToImportDescriptions( importDescription: ReadonlyMap ): void { for (const specifier of importDescription.values()) { const { id } = this.resolvedIds[specifier.source]; specifier.module = this.graph.modulesById.get(id)!; } } private addRelevantSideEffectDependencies( relevantDependencies: Set, necessaryDependencies: ReadonlySet, alwaysCheckedDependencies: ReadonlySet ): void { const handledDependencies = new Set(); const addSideEffectDependencies = ( possibleDependencies: ReadonlySet ) => { for (const dependency of possibleDependencies) { if (handledDependencies.has(dependency)) { continue; } handledDependencies.add(dependency); if (necessaryDependencies.has(dependency)) { relevantDependencies.add(dependency); continue; } if (!(dependency.info.moduleSideEffects || alwaysCheckedDependencies.has(dependency))) { continue; } if (dependency instanceof ExternalModule || dependency.hasEffects()) { relevantDependencies.add(dependency); continue; } addSideEffectDependencies(dependency.dependencies); } }; addSideEffectDependencies(this.dependencies); addSideEffectDependencies(alwaysCheckedDependencies); } private addSource( source: string, declaration: ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration ) { const parsedAssertions = getAssertionsFromImportExportDeclaration(declaration.assertions); const existingAssertions = this.sourcesWithAssertions.get(source); if (existingAssertions) { if (doAssertionsDiffer(existingAssertions, parsedAssertions)) { this.log( LOGLEVEL_WARN, logInconsistentImportAssertions(existingAssertions, parsedAssertions, source, this.id), declaration.start ); } } else { this.sourcesWithAssertions.set(source, parsedAssertions); } } private getVariableFromNamespaceReexports( name: string, importerForSideEffects?: Module, searchedNamesAndModules?: Map> ): [variable: Variable | null, indirectExternal?: boolean] { let foundSyntheticDeclaration: SyntheticNamedExportVariable | null = null; const foundInternalDeclarations = new Map(); const foundExternalDeclarations = new Set(); for (const module of this.exportAllModules) { // Synthetic namespaces should not hide "regular" exports of the same name if (module.info.syntheticNamedExports === name) { continue; } const [variable, indirectExternal] = getVariableForExportNameRecursive( module, name, importerForSideEffects, true, // We are creating a copy to handle the case where the same binding is // imported through different namespace reexports gracefully copyNameToModulesMap(searchedNamesAndModules) ); if (module instanceof ExternalModule || indirectExternal) { foundExternalDeclarations.add(variable as ExternalVariable); } else if (variable instanceof SyntheticNamedExportVariable) { if (!foundSyntheticDeclaration) { foundSyntheticDeclaration = variable; } } else if (variable) { foundInternalDeclarations.set(variable, module); } } if (foundInternalDeclarations.size > 0) { const foundDeclarationList = [...foundInternalDeclarations]; const usedDeclaration = foundDeclarationList[0][0]; if (foundDeclarationList.length === 1) { return [usedDeclaration]; } this.options.onLog( LOGLEVEL_WARN, logNamespaceConflict( name, this.id, foundDeclarationList.map(([, module]) => module.id) ) ); // TODO we are pretending it was not found while it should behave like "undefined" return [null]; } if (foundExternalDeclarations.size > 0) { const foundDeclarationList = [...foundExternalDeclarations]; const usedDeclaration = foundDeclarationList[0]; if (foundDeclarationList.length > 1) { this.options.onLog( LOGLEVEL_WARN, logAmbiguousExternalNamespaces( name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id) ) ); } return [usedDeclaration, true]; } if (foundSyntheticDeclaration) { return [foundSyntheticDeclaration]; } return [null]; } private includeAndGetAdditionalMergedNamespaces(): Variable[] { const externalNamespaces = new Set(); const syntheticNamespaces = new Set(); for (const module of [this, ...this.exportAllModules]) { if (module instanceof ExternalModule) { const [externalVariable] = module.getVariableForExportName('*'); externalVariable.include(); this.includedImports.add(externalVariable); externalNamespaces.add(externalVariable); } else if (module.info.syntheticNamedExports) { const syntheticNamespace = module.getSyntheticNamespace(); syntheticNamespace.include(); this.includedImports.add(syntheticNamespace); syntheticNamespaces.add(syntheticNamespace); } } return [...syntheticNamespaces, ...externalNamespaces]; } private includeDynamicImport(node: ImportExpression): void { const resolution = ( this.dynamicImports.find(dynamicImport => dynamicImport.node === node) as { resolution: string | Module | ExternalModule | undefined; } ).resolution; if (resolution instanceof Module) { resolution.includedDynamicImporters.push(this); const importedNames = this.options.treeshake ? node.getDeterministicImportedNames() : undefined; if (importedNames) { resolution.includeExportsByNames(importedNames); } else { resolution.includeAllExports(true); } } } private includeVariable(variable: Variable): void { const variableModule = variable.module; if (variable.included) { if (variableModule instanceof Module && variableModule !== this) { getAndExtendSideEffectModules(variable, this); } } else { variable.include(); this.graph.needsTreeshakingPass = true; if (variableModule instanceof Module) { if (!variableModule.isExecuted) { markModuleAndImpureDependenciesAsExecuted(variableModule); } if (variableModule !== this) { const sideEffectModules = getAndExtendSideEffectModules(variable, this); for (const module of sideEffectModules) { if (!module.isExecuted) { markModuleAndImpureDependenciesAsExecuted(module); } } } } } } private includeVariableInModule(variable: Variable): void { this.includeVariable(variable); const variableModule = variable.module; if (variableModule && variableModule !== this) { this.includedImports.add(variable); } } private shimMissingExport(name: string): void { this.options.onLog(LOGLEVEL_WARN, logShimmedExport(this.id, name)); this.exports.set(name, MISSING_EXPORT_SHIM_DESCRIPTION); } private tryParse(): acorn.Node { try { return this.graph.contextParse(this.info.code!); } catch (error_: any) { return this.error(logParseError(error_, this.id), error_.pos); } } } // if there is a cyclic import in the reexport chain, we should not // import from the original module but from the cyclic module to not // mess up execution order. function setAlternativeExporterIfCyclic( variable: Variable, importer: Module, reexporter: Module ): void { if (variable.module instanceof Module && variable.module !== reexporter) { const exporterCycles = variable.module.cycles; if (exporterCycles.size > 0) { const importerCycles = reexporter.cycles; for (const cycleSymbol of importerCycles) { if (exporterCycles.has(cycleSymbol)) { importer.alternativeReexportModules.set(variable, reexporter); break; } } } } } const copyNameToModulesMap = ( searchedNamesAndModules?: Map> ): Map> | undefined => searchedNamesAndModules && // eslint-disable-next-line unicorn/prefer-spread new Map(Array.from(searchedNamesAndModules, ([name, modules]) => [name, new Set(modules)])); rollup-3.29.4/src/ModuleLoader.ts000066400000000000000000000574741450520414700166640ustar00rootroot00000000000000import type * as acorn from 'acorn'; import ExternalModule from './ExternalModule'; import type Graph from './Graph'; import Module, { type DynamicImport } from './Module'; import type { CustomPluginOptions, EmittedChunk, HasModuleSideEffects, LoadResult, ModuleInfo, ModuleOptions, NormalizedInputOptions, PartialNull, Plugin, ResolvedId, ResolveIdResult } from './rollup/types'; import type { PluginDriver } from './utils/PluginDriver'; import { EMPTY_OBJECT } from './utils/blank'; import { readFile } from './utils/fs'; import { LOGLEVEL_WARN } from './utils/logging'; import { error, logBadLoader, logEntryCannotBeExternal, logExternalModulesCannotBeIncludedInManualChunks, logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logImplicitDependantCannotBeExternal, logInconsistentImportAssertions, logInternalIdCannotBeExternal, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal } from './utils/logs'; import { doAssertionsDiffer, getAssertionsFromImportExpression } from './utils/parseAssertions'; import { isAbsolute, isRelative, resolve } from './utils/path'; import relativeId from './utils/relativeId'; import { resolveId } from './utils/resolveId'; import transform from './utils/transform'; export interface UnresolvedModule { fileName: string | null; id: string; importer: string | undefined; name: string | null; } export type ModuleLoaderResolveId = ( source: string, importer: string | undefined, customOptions: CustomPluginOptions | undefined, isEntry: boolean | undefined, assertions: Record, skip?: readonly { importer: string | undefined; plugin: Plugin; source: string }[] | null ) => Promise; type NormalizedResolveIdWithoutDefaults = Partial> & { external?: boolean | 'absolute'; id: string; resolvedBy?: string; }; type ResolveStaticDependencyPromise = Promise; type ResolveDynamicDependencyPromise = Promise< readonly [dynamicImport: DynamicImport, resolvedId: ResolvedId | string | null] >; type LoadModulePromise = Promise< [ resolveStaticDependencies: ResolveStaticDependencyPromise[], resolveDynamicDependencies: ResolveDynamicDependencyPromise[], loadAndResolveDependencies: Promise ] >; type PreloadType = boolean | 'resolveDependencies'; const RESOLVE_DEPENDENCIES: PreloadType = 'resolveDependencies'; export class ModuleLoader { private readonly hasModuleSideEffects: HasModuleSideEffects; private readonly implicitEntryModules = new Set(); private readonly indexedEntryModules: { index: number; module: Module }[] = []; private latestLoadModulesPromise: Promise = Promise.resolve(); private readonly moduleLoadPromises = new Map(); private readonly modulesWithLoadedDependencies = new Set(); private nextChunkNamePriority = 0; private nextEntryModuleIndex = 0; constructor( private readonly graph: Graph, private readonly modulesById: Map, private readonly options: NormalizedInputOptions, private readonly pluginDriver: PluginDriver ) { this.hasModuleSideEffects = options.treeshake ? options.treeshake.moduleSideEffects : () => true; } async addAdditionalModules( unresolvedModules: readonly string[], isAddForManualChunks: boolean ): Promise { const result = this.extendLoadModulesPromise( Promise.all( unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null, isAddForManualChunks) ) ) ); await this.awaitLoadModulesPromise(); return result; } async addEntryModules( unresolvedEntryModules: readonly UnresolvedModule[], isUserDefined: boolean ): Promise<{ entryModules: Module[]; implicitEntryModules: Module[]; newEntryModules: Module[]; }> { const firstEntryModuleIndex = this.nextEntryModuleIndex; this.nextEntryModuleIndex += unresolvedEntryModules.length; const firstChunkNamePriority = this.nextChunkNamePriority; this.nextChunkNamePriority += unresolvedEntryModules.length; const newEntryModules = await this.extendLoadModulesPromise( Promise.all( unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null) ) ).then(entryModules => { for (const [index, entryModule] of entryModules.entries()) { entryModule.isUserDefinedEntryPoint = entryModule.isUserDefinedEntryPoint || isUserDefined; addChunkNamesToModule( entryModule, unresolvedEntryModules[index], isUserDefined, firstChunkNamePriority + index ); const existingIndexedModule = this.indexedEntryModules.find( indexedModule => indexedModule.module === entryModule ); if (existingIndexedModule) { existingIndexedModule.index = Math.min( existingIndexedModule.index, firstEntryModuleIndex + index ); } else { this.indexedEntryModules.push({ index: firstEntryModuleIndex + index, module: entryModule }); } } this.indexedEntryModules.sort(({ index: indexA }, { index: indexB }) => indexA > indexB ? 1 : -1 ); return entryModules; }) ); await this.awaitLoadModulesPromise(); return { entryModules: this.indexedEntryModules.map(({ module }) => module), implicitEntryModules: [...this.implicitEntryModules], newEntryModules }; } async emitChunk({ fileName, id, importer, name, implicitlyLoadedAfterOneOf, preserveSignature }: EmittedChunk): Promise { const unresolvedModule: UnresolvedModule = { fileName: fileName || null, id, importer, name: name || null }; const module = implicitlyLoadedAfterOneOf ? await this.addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfterOneOf) : (await this.addEntryModules([unresolvedModule], false)).newEntryModules[0]; if (preserveSignature != null) { module.preserveSignature = preserveSignature; } return module; } public async preloadModule( resolvedId: { id: string; resolveDependencies?: boolean } & Partial> ): Promise { const module = await this.fetchModule( this.getResolvedIdWithDefaults(resolvedId, EMPTY_OBJECT)!, undefined, false, resolvedId.resolveDependencies ? RESOLVE_DEPENDENCIES : true ); return module.info; } resolveId: ModuleLoaderResolveId = async ( source, importer, customOptions, isEntry, assertions, skip = null ) => this.getResolvedIdWithDefaults( this.getNormalizedResolvedIdWithoutDefaults( this.options.external(source, importer, false) ? false : await resolveId( source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer, assertions ), importer, source ), assertions ); private addEntryWithImplicitDependants( unresolvedModule: UnresolvedModule, implicitlyLoadedAfter: readonly string[] ): Promise { const chunkNamePriority = this.nextChunkNamePriority++; return this.extendLoadModulesPromise( this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then( async entryModule => { addChunkNamesToModule(entryModule, unresolvedModule, false, chunkNamePriority); if (!entryModule.info.isEntry) { this.implicitEntryModules.add(entryModule); const implicitlyLoadedAfterModules = await Promise.all( implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id) ) ); for (const module of implicitlyLoadedAfterModules) { entryModule.implicitlyLoadedAfter.add(module); } for (const dependant of entryModule.implicitlyLoadedAfter) { dependant.implicitlyLoadedBefore.add(entryModule); } } return entryModule; } ) ); } private async addModuleSource( id: string, importer: string | undefined, module: Module ): Promise { let source: LoadResult; try { source = await this.graph.fileOperationQueue.run( async () => (await this.pluginDriver.hookFirst('load', [id])) ?? (await readFile(id, 'utf8')) ); } catch (error_: any) { let message = `Could not load ${id}`; if (importer) message += ` (imported by ${relativeId(importer)})`; message += `: ${error_.message}`; error_.message = message; throw error_; } const sourceDescription = typeof source === 'string' ? { code: source } : source != null && typeof source === 'object' && typeof source.code === 'string' ? source : error(logBadLoader(id)); const cachedModule = this.graph.cachedModules.get(id); if ( cachedModule && !cachedModule.customTransformCache && cachedModule.originalCode === sourceDescription.code && !(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [ { ast: cachedModule.ast, code: cachedModule.code, id: cachedModule.id, meta: cachedModule.meta, moduleSideEffects: cachedModule.moduleSideEffects, resolvedSources: cachedModule.resolvedIds, syntheticNamedExports: cachedModule.syntheticNamedExports } ])) ) { if (cachedModule.transformFiles) { for (const emittedFile of cachedModule.transformFiles) this.pluginDriver.emitFile(emittedFile); } module.setSource(cachedModule); } else { module.updateOptions(sourceDescription); module.setSource( await transform(sourceDescription, module, this.pluginDriver, this.options.onLog) ); } } private async awaitLoadModulesPromise(): Promise { let startingPromise; do { startingPromise = this.latestLoadModulesPromise; await startingPromise; } while (startingPromise !== this.latestLoadModulesPromise); } private extendLoadModulesPromise(loadNewModulesPromise: Promise): Promise { this.latestLoadModulesPromise = Promise.all([ loadNewModulesPromise, this.latestLoadModulesPromise ]); this.latestLoadModulesPromise.catch(() => { /* Avoid unhandled Promise rejections */ }); return loadNewModulesPromise; } private async fetchDynamicDependencies( module: Module, resolveDynamicImportPromises: readonly ResolveDynamicDependencyPromise[] ): Promise { const dependencies = await Promise.all( resolveDynamicImportPromises.map(resolveDynamicImportPromise => resolveDynamicImportPromise.then(async ([dynamicImport, resolvedId]) => { if (resolvedId === null) return null; if (typeof resolvedId === 'string') { dynamicImport.resolution = resolvedId; return null; } return (dynamicImport.resolution = await this.fetchResolvedDependency( relativeId(resolvedId.id), module.id, resolvedId )); }) ) ); for (const dependency of dependencies) { if (dependency) { module.dynamicDependencies.add(dependency); dependency.dynamicImporters.push(module.id); } } } // If this is a preload, then this method always waits for the dependencies of // the module to be resolved. // Otherwise, if the module does not exist, it waits for the module and all // its dependencies to be loaded. // Otherwise, it returns immediately. private async fetchModule( { assertions, id, meta, moduleSideEffects, syntheticNamedExports }: ResolvedId, importer: string | undefined, isEntry: boolean, isPreload: PreloadType ): Promise { const existingModule = this.modulesById.get(id); if (existingModule instanceof Module) { if (importer && doAssertionsDiffer(assertions, existingModule.info.assertions)) { this.options.onLog( LOGLEVEL_WARN, logInconsistentImportAssertions(existingModule.info.assertions, assertions, id, importer) ); } await this.handleExistingModule(existingModule, isEntry, isPreload); return existingModule; } if (existingModule instanceof ExternalModule) { return error(logExternalModulesCannotBeTransformedToModules(existingModule.id)); } const module = new Module( this.graph, id, this.options, isEntry, moduleSideEffects, syntheticNamedExports, meta, assertions ); this.modulesById.set(id, module); this.graph.watchFiles[id] = true; const loadPromise: LoadModulePromise = this.addModuleSource(id, importer, module).then(() => [ this.getResolveStaticDependencyPromises(module), this.getResolveDynamicImportPromises(module), loadAndResolveDependenciesPromise ]); const loadAndResolveDependenciesPromise = waitForDependencyResolution(loadPromise).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info]) ); loadAndResolveDependenciesPromise.catch(() => { /* avoid unhandled promise rejections */ }); this.moduleLoadPromises.set(module, loadPromise); const resolveDependencyPromises = await loadPromise; if (!isPreload) { await this.fetchModuleDependencies(module, ...resolveDependencyPromises); } else if (isPreload === RESOLVE_DEPENDENCIES) { await loadAndResolveDependenciesPromise; } return module; } private async fetchModuleDependencies( module: Module, resolveStaticDependencyPromises: readonly ResolveStaticDependencyPromise[], resolveDynamicDependencyPromises: readonly ResolveDynamicDependencyPromise[], loadAndResolveDependenciesPromise: Promise ): Promise { if (this.modulesWithLoadedDependencies.has(module)) { return; } this.modulesWithLoadedDependencies.add(module); await Promise.all([ this.fetchStaticDependencies(module, resolveStaticDependencyPromises), this.fetchDynamicDependencies(module, resolveDynamicDependencyPromises) ]); module.linkImports(); // To handle errors when resolving dependencies or in moduleParsed await loadAndResolveDependenciesPromise; } private fetchResolvedDependency( source: string, importer: string, resolvedId: ResolvedId ): Promise { if (resolvedId.external) { const { assertions, external, id, moduleSideEffects, meta } = resolvedId; let externalModule = this.modulesById.get(id); if (!externalModule) { externalModule = new ExternalModule( this.options, id, moduleSideEffects, meta, external !== 'absolute' && isAbsolute(id), assertions ); this.modulesById.set(id, externalModule); } else if (!(externalModule instanceof ExternalModule)) { return error(logInternalIdCannotBeExternal(source, importer)); } else if (doAssertionsDiffer(externalModule.info.assertions, assertions)) { this.options.onLog( LOGLEVEL_WARN, logInconsistentImportAssertions( externalModule.info.assertions, assertions, source, importer ) ); } return Promise.resolve(externalModule); } return this.fetchModule(resolvedId, importer, false, false); } private async fetchStaticDependencies( module: Module, resolveStaticDependencyPromises: readonly ResolveStaticDependencyPromise[] ): Promise { for (const dependency of await Promise.all( resolveStaticDependencyPromises.map(resolveStaticDependencyPromise => resolveStaticDependencyPromise.then(([source, resolvedId]) => this.fetchResolvedDependency(source, module.id, resolvedId) ) ) )) { module.dependencies.add(dependency); dependency.importers.push(module.id); } if (!this.options.treeshake || module.info.moduleSideEffects === 'no-treeshake') { for (const dependency of module.dependencies) { if (dependency instanceof Module) { dependency.importedFromNotTreeshaken = true; } } } } private getNormalizedResolvedIdWithoutDefaults( resolveIdResult: ResolveIdResult, importer: string | undefined, source: string ): NormalizedResolveIdWithoutDefaults | null { const { makeAbsoluteExternalsRelative } = this.options; if (resolveIdResult) { if (typeof resolveIdResult === 'object') { const external = resolveIdResult.external || this.options.external(resolveIdResult.id, importer, true); return { ...resolveIdResult, external: external && (external === 'relative' || !isAbsolute(resolveIdResult.id) || (external === true && isNotAbsoluteExternal(resolveIdResult.id, source, makeAbsoluteExternalsRelative)) || 'absolute') }; } const external = this.options.external(resolveIdResult, importer, true); return { external: external && (isNotAbsoluteExternal(resolveIdResult, source, makeAbsoluteExternalsRelative) || 'absolute'), id: external && makeAbsoluteExternalsRelative ? normalizeRelativeExternalId(resolveIdResult, importer) : resolveIdResult }; } const id = makeAbsoluteExternalsRelative ? normalizeRelativeExternalId(source, importer) : source; if (resolveIdResult !== false && !this.options.external(id, importer, true)) { return null; } return { external: isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) || 'absolute', id }; } private getResolveDynamicImportPromises(module: Module): ResolveDynamicDependencyPromise[] { return module.dynamicImports.map(async dynamicImport => { const resolvedId = await this.resolveDynamicImport( module, typeof dynamicImport.argument === 'string' ? dynamicImport.argument : dynamicImport.argument.esTreeNode!, module.id, getAssertionsFromImportExpression(dynamicImport.node) ); if (resolvedId && typeof resolvedId === 'object') { dynamicImport.id = resolvedId.id; } return [dynamicImport, resolvedId] as const; }); } private getResolveStaticDependencyPromises(module: Module): ResolveStaticDependencyPromise[] { // eslint-disable-next-line unicorn/prefer-spread return Array.from( module.sourcesWithAssertions, async ([source, assertions]) => [ source, (module.resolvedIds[source] = module.resolvedIds[source] || this.handleInvalidResolvedId( await this.resolveId(source, module.id, EMPTY_OBJECT, false, assertions), source, module.id, assertions )) ] as const ); } private getResolvedIdWithDefaults( resolvedId: NormalizedResolveIdWithoutDefaults | null, assertions: Record ): ResolvedId | null { if (!resolvedId) { return null; } const external = resolvedId.external || false; return { assertions: resolvedId.assertions || assertions, external, id: resolvedId.id, meta: resolvedId.meta || {}, moduleSideEffects: resolvedId.moduleSideEffects ?? this.hasModuleSideEffects(resolvedId.id, !!external), resolvedBy: resolvedId.resolvedBy ?? 'rollup', syntheticNamedExports: resolvedId.syntheticNamedExports ?? false }; } private async handleExistingModule(module: Module, isEntry: boolean, isPreload: PreloadType) { const loadPromise = this.moduleLoadPromises.get(module)!; if (isPreload) { return isPreload === RESOLVE_DEPENDENCIES ? waitForDependencyResolution(loadPromise) : loadPromise; } if (isEntry) { module.info.isEntry = true; this.implicitEntryModules.delete(module); for (const dependant of module.implicitlyLoadedAfter) { dependant.implicitlyLoadedBefore.delete(module); } module.implicitlyLoadedAfter.clear(); } return this.fetchModuleDependencies(module, ...(await loadPromise)); } private handleInvalidResolvedId( resolvedId: ResolvedId | null, source: string, importer: string, assertions: Record ): ResolvedId { if (resolvedId === null) { if (isRelative(source)) { return error(logUnresolvedImport(source, importer)); } this.options.onLog(LOGLEVEL_WARN, logUnresolvedImportTreatedAsExternal(source, importer)); return { assertions, external: true, id: source, meta: {}, moduleSideEffects: this.hasModuleSideEffects(source, true), resolvedBy: 'rollup', syntheticNamedExports: false }; } else if (resolvedId.external && resolvedId.syntheticNamedExports) { this.options.onLog(LOGLEVEL_WARN, logExternalSyntheticExports(source, importer)); } return resolvedId; } private async loadEntryModule( unresolvedId: string, isEntry: boolean, importer: string | undefined, implicitlyLoadedBefore: string | null, isLoadForManualChunks = false ): Promise { const resolveIdResult = await resolveId( unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT, true, EMPTY_OBJECT ); if (resolveIdResult == null) { return error( implicitlyLoadedBefore === null ? logUnresolvedEntry(unresolvedId) : logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) ); } const isExternalModules = typeof resolveIdResult === 'object' && resolveIdResult.external; if (resolveIdResult === false || isExternalModules) { return error( implicitlyLoadedBefore === null ? isExternalModules && isLoadForManualChunks ? logExternalModulesCannotBeIncludedInManualChunks(unresolvedId) : logEntryCannotBeExternal(unresolvedId) : logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) ); } return this.fetchModule( this.getResolvedIdWithDefaults( typeof resolveIdResult === 'object' ? (resolveIdResult as NormalizedResolveIdWithoutDefaults) : { id: resolveIdResult }, EMPTY_OBJECT )!, undefined, isEntry, false ); } private async resolveDynamicImport( module: Module, specifier: string | acorn.Node, importer: string, assertions: Record ): Promise { const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [ specifier, importer, { assertions } ]); if (typeof specifier !== 'string') { if (typeof resolution === 'string') { return resolution; } if (!resolution) { return null; } return this.getResolvedIdWithDefaults( resolution as NormalizedResolveIdWithoutDefaults, assertions ); } if (resolution == null) { const existingResolution = module.resolvedIds[specifier]; if (existingResolution) { if (doAssertionsDiffer(existingResolution.assertions, assertions)) { this.options.onLog( LOGLEVEL_WARN, logInconsistentImportAssertions( existingResolution.assertions, assertions, specifier, importer ) ); } return existingResolution; } return (module.resolvedIds[specifier] = this.handleInvalidResolvedId( await this.resolveId(specifier, module.id, EMPTY_OBJECT, false, assertions), specifier, module.id, assertions )); } return this.handleInvalidResolvedId( this.getResolvedIdWithDefaults( this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier), assertions ), specifier, importer, assertions ); } } function normalizeRelativeExternalId(source: string, importer: string | undefined): string { return isRelative(source) ? importer ? resolve(importer, '..', source) : resolve(source) : source; } function addChunkNamesToModule( module: Module, { fileName, name }: UnresolvedModule, isUserDefined: boolean, priority: number ): void { if (fileName !== null) { module.chunkFileNames.add(fileName); } else if (name !== null) { // Always keep chunkNames sorted by priority let namePosition = 0; while (module.chunkNames[namePosition]?.priority < priority) namePosition++; module.chunkNames.splice(namePosition, 0, { isUserDefined, name, priority }); } } function isNotAbsoluteExternal( id: string, source: string, makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource' ): boolean { return ( makeAbsoluteExternalsRelative === true || (makeAbsoluteExternalsRelative === 'ifRelativeSource' && isRelative(source)) || !isAbsolute(id) ); } async function waitForDependencyResolution(loadPromise: LoadModulePromise) { const [resolveStaticDependencyPromises, resolveDynamicImportPromises] = await loadPromise; return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]); } rollup-3.29.4/src/ast/000077500000000000000000000000001450520414700145065ustar00rootroot00000000000000rollup-3.29.4/src/ast/DeoptimizableEntity.ts000066400000000000000000000001031450520414700210350ustar00rootroot00000000000000export interface DeoptimizableEntity { deoptimizeCache(): void; } rollup-3.29.4/src/ast/Entity.ts000066400000000000000000000013531450520414700163340ustar00rootroot00000000000000import type { HasEffectsContext } from './ExecutionContext'; import type { NodeInteractionAssigned } from './NodeInteractions'; import type { ObjectPath } from './utils/PathTracker'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Entity {} export interface WritableEntity extends Entity { /** * Reassign a given path of an object. * E.g., node.deoptimizePath(['x', 'y']) is called when something * is assigned to node.x.y. If the path is [UnknownKey], then the return * expression of this node is reassigned as well. */ deoptimizePath(path: ObjectPath): void; hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteractionAssigned, context: HasEffectsContext ): boolean; } rollup-3.29.4/src/ast/ExecutionContext.ts000066400000000000000000000030751450520414700203730ustar00rootroot00000000000000import type { Entity } from './Entity'; import type { ExpressionEntity } from './nodes/shared/Expression'; import { DiscriminatedPathTracker, PathTracker } from './utils/PathTracker'; import type ThisVariable from './variables/ThisVariable'; interface ExecutionContextIgnore { breaks: boolean; continues: boolean; labels: Set; returnYield: boolean; this: boolean; } interface ControlFlowContext { brokenFlow: boolean; hasBreak: boolean; hasContinue: boolean; includedLabels: Set; } export interface InclusionContext extends ControlFlowContext { includedCallArguments: Set; } export interface HasEffectsContext extends ControlFlowContext { accessed: PathTracker; assigned: PathTracker; brokenFlow: boolean; called: DiscriminatedPathTracker; ignore: ExecutionContextIgnore; instantiated: DiscriminatedPathTracker; replacedVariableInits: Map; } export function createInclusionContext(): InclusionContext { return { brokenFlow: false, hasBreak: false, hasContinue: false, includedCallArguments: new Set(), includedLabels: new Set() }; } export function createHasEffectsContext(): HasEffectsContext { return { accessed: new PathTracker(), assigned: new PathTracker(), brokenFlow: false, called: new DiscriminatedPathTracker(), hasBreak: false, hasContinue: false, ignore: { breaks: false, continues: false, labels: new Set(), returnYield: false, this: false }, includedLabels: new Set(), instantiated: new DiscriminatedPathTracker(), replacedVariableInits: new Map() }; } rollup-3.29.4/src/ast/NodeInteractions.ts000066400000000000000000000032741450520414700203340ustar00rootroot00000000000000import type SpreadElement from './nodes/SpreadElement'; import type { ExpressionEntity } from './nodes/shared/Expression'; import { UNKNOWN_EXPRESSION } from './nodes/shared/Expression'; export const INTERACTION_ACCESSED = 0; export const INTERACTION_ASSIGNED = 1; export const INTERACTION_CALLED = 2; // The first argument is the "this" context export interface NodeInteractionAccessed { args: readonly [ExpressionEntity | null]; type: typeof INTERACTION_ACCESSED; } export const NODE_INTERACTION_UNKNOWN_ACCESS: NodeInteractionAccessed = { args: [null], type: INTERACTION_ACCESSED }; // The first argument is the "this" context, the second argument the assigned expression export interface NodeInteractionAssigned { args: readonly [ExpressionEntity | null, ExpressionEntity]; type: typeof INTERACTION_ASSIGNED; } export const NODE_INTERACTION_UNKNOWN_ASSIGNMENT: NodeInteractionAssigned = { args: [null, UNKNOWN_EXPRESSION], type: INTERACTION_ASSIGNED }; // The first argument is the "this" context, the other arguments are the actual arguments export interface NodeInteractionCalled { args: readonly [ExpressionEntity | null, ...(ExpressionEntity | SpreadElement)[]]; type: typeof INTERACTION_CALLED; withNew: boolean; } // While this is technically a call without arguments, we can compare against // this reference in places where precise values or this argument would make a // difference export const NODE_INTERACTION_UNKNOWN_CALL: NodeInteractionCalled = { args: [null], type: INTERACTION_CALLED, withNew: false }; // For tracking, interactions are uniquely determined by their .args export type NodeInteraction = | NodeInteractionAccessed | NodeInteractionAssigned | NodeInteractionCalled; rollup-3.29.4/src/ast/keys.ts000066400000000000000000000010471450520414700160330ustar00rootroot00000000000000import type { GenericEsTreeNode } from './nodes/shared/Node'; export const keys: { [name: string]: string[]; } = { // TODO this should be removed once ImportExpression follows official ESTree // specs with "null" as default ImportExpression: ['arguments'], Literal: [], Program: ['body'] }; export function getAndCreateKeys(esTreeNode: GenericEsTreeNode): string[] { keys[esTreeNode.type] = Object.keys(esTreeNode).filter( key => typeof esTreeNode[key] === 'object' && key.charCodeAt(0) !== 95 /* _ */ ); return keys[esTreeNode.type]; } rollup-3.29.4/src/ast/nodes/000077500000000000000000000000001450520414700156165ustar00rootroot00000000000000rollup-3.29.4/src/ast/nodes/ArrayExpression.ts000066400000000000000000000064341450520414700213330ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { type ObjectPath, type PathTracker, UNKNOWN_PATH, UnknownInteger } from '../utils/PathTracker'; import { UNDEFINED_EXPRESSION, UNKNOWN_LITERAL_NUMBER } from '../values'; import type * as NodeType from './NodeType'; import SpreadElement from './SpreadElement'; import { ARRAY_PROTOTYPE } from './shared/ArrayPrototype'; import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; import { ObjectEntity, type ObjectProperty } from './shared/ObjectEntity'; export default class ArrayExpression extends NodeBase { declare elements: readonly (ExpressionNode | SpreadElement | null)[]; declare type: NodeType.tArrayExpression; private objectEntity: ObjectEntity | null = null; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath( interaction, path, recursionTracker ); } deoptimizePath(path: ObjectPath): void { this.getObjectEntity().deoptimizePath(path); } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.getObjectEntity().getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); } protected applyDeoptimizations(): void { this.deoptimized = true; let hasSpread = false; for (let index = 0; index < this.elements.length; index++) { const element = this.elements[index]; if (element && (hasSpread || element instanceof SpreadElement)) { hasSpread = true; element.deoptimizePath(UNKNOWN_PATH); } } this.context.requestTreeshakingPass(); } private getObjectEntity(): ObjectEntity { if (this.objectEntity !== null) { return this.objectEntity; } const properties: ObjectProperty[] = [ { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } ]; let hasSpread = false; for (let index = 0; index < this.elements.length; index++) { const element = this.elements[index]; if (hasSpread || element instanceof SpreadElement) { if (element) { hasSpread = true; properties.unshift({ key: UnknownInteger, kind: 'init', property: element }); } } else if (element) { properties.push({ key: String(index), kind: 'init', property: element }); } else { properties.push({ key: String(index), kind: 'init', property: UNDEFINED_EXPRESSION }); } } return (this.objectEntity = new ObjectEntity(properties, ARRAY_PROTOTYPE)); } } rollup-3.29.4/src/ast/nodes/ArrayPattern.ts000066400000000000000000000034501450520414700206040ustar00rootroot00000000000000import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteractionAssigned } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import { NodeBase } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; export default class ArrayPattern extends NodeBase implements PatternNode { declare elements: (PatternNode | null)[]; declare type: NodeType.tArrayPattern; addExportedVariables( variables: readonly Variable[], exportNamesByVariable: ReadonlyMap ): void { for (const element of this.elements) { element?.addExportedVariables(variables, exportNamesByVariable); } } declare(kind: string): LocalVariable[] { const variables: LocalVariable[] = []; for (const element of this.elements) { if (element !== null) { variables.push(...element.declare(kind, UNKNOWN_EXPRESSION)); } } return variables; } // Patterns can only be deoptimized at the empty path at the moment deoptimizePath(): void { for (const element of this.elements) { element?.deoptimizePath(EMPTY_PATH); } } // Patterns are only checked at the emtpy path at the moment hasEffectsOnInteractionAtPath( _path: ObjectPath, interaction: NodeInteractionAssigned, context: HasEffectsContext ): boolean { for (const element of this.elements) { if (element?.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) return true; } return false; } markDeclarationReached(): void { for (const element of this.elements) { element?.markDeclarationReached(); } } } rollup-3.29.4/src/ast/nodes/ArrowFunctionExpression.ts000066400000000000000000000046621450520414700230560ustar00rootroot00000000000000import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_CALLED } from '../NodeInteractions'; import ReturnValueScope from '../scopes/ReturnValueScope'; import type Scope from '../scopes/Scope'; import { type ObjectPath } from '../utils/PathTracker'; import type BlockStatement from './BlockStatement'; import Identifier from './Identifier'; import type * as NodeType from './NodeType'; import FunctionBase from './shared/FunctionBase'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; import { ObjectEntity } from './shared/ObjectEntity'; import { OBJECT_PROTOTYPE } from './shared/ObjectPrototype'; import type { PatternNode } from './shared/Pattern'; export default class ArrowFunctionExpression extends FunctionBase { declare async: boolean; declare body: BlockStatement | ExpressionNode; declare params: readonly PatternNode[]; declare preventChildBlockScope: true; declare scope: ReturnValueScope; declare type: NodeType.tArrowFunctionExpression; protected objectEntity: ObjectEntity | null = null; createScope(parentScope: Scope): void { this.scope = new ReturnValueScope(parentScope, this.context); } hasEffects(): boolean { if (!this.deoptimized) this.applyDeoptimizations(); return false; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) { return true; } if (this.annotationNoSideEffects) { return false; } if (interaction.type === INTERACTION_CALLED) { const { ignore, brokenFlow } = context; context.ignore = { breaks: false, continues: false, labels: new Set(), returnYield: true, this: false }; if (this.body.hasEffects(context)) return true; context.ignore = ignore; context.brokenFlow = brokenFlow; } return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { super.include(context, includeChildrenRecursively); for (const parameter of this.params) { if (!(parameter instanceof Identifier)) { parameter.include(context, includeChildrenRecursively); } } } protected getObjectEntity(): ObjectEntity { if (this.objectEntity !== null) { return this.objectEntity; } return (this.objectEntity = new ObjectEntity([], OBJECT_PROTOTYPE)); } } rollup-3.29.4/src/ast/nodes/AssignmentExpression.ts000066400000000000000000000110331450520414700223540ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import { findFirstOccurrenceOutsideComment, findNonWhiteSpace, type NodeRenderOptions, removeLineBreaks, type RenderOptions } from '../../utils/renderHelpers'; import { renderSystemExportExpression, renderSystemExportFunction, renderSystemExportSequenceAfterExpression } from '../../utils/systemJsRendering'; import { createHasEffectsContext, type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker'; import type Variable from '../variables/Variable'; import Identifier from './Identifier'; import * as NodeType from './NodeType'; import ObjectPattern from './ObjectPattern'; import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; export default class AssignmentExpression extends NodeBase { declare left: ExpressionNode | PatternNode; declare operator: | '=' | '+=' | '-=' | '*=' | '/=' | '%=' | '<<=' | '>>=' | '>>>=' | '|=' | '^=' | '&=' | '**='; declare right: ExpressionNode; declare type: NodeType.tAssignmentExpression; hasEffects(context: HasEffectsContext): boolean { const { deoptimized, left, operator, right } = this; if (!deoptimized) this.applyDeoptimizations(); // MemberExpressions do not access the property before assignments if the // operator is '='. return ( right.hasEffects(context) || left.hasEffectsAsAssignmentTarget(context, operator !== '=') ); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { return this.right.hasEffectsOnInteractionAtPath(path, interaction, context); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { const { deoptimized, left, right, operator } = this; if (!deoptimized) this.applyDeoptimizations(); this.included = true; if ( includeChildrenRecursively || operator !== '=' || left.included || left.hasEffectsAsAssignmentTarget(createHasEffectsContext(), false) ) { left.includeAsAssignmentTarget(context, includeChildrenRecursively, operator !== '='); } right.include(context, includeChildrenRecursively); } initialise(): void { this.left.setAssignedValue(this.right); } render( code: MagicString, options: RenderOptions, { preventASI, renderedParentType, renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { const { left, right, start, end, parent } = this; if (left.included) { left.render(code, options); right.render(code, options); } else { const inclusionStart = findNonWhiteSpace( code.original, findFirstOccurrenceOutsideComment(code.original, '=', left.end) + 1 ); code.remove(start, inclusionStart); if (preventASI) { removeLineBreaks(code, inclusionStart, right.start); } right.render(code, options, { renderedParentType: renderedParentType || parent.type, renderedSurroundingElement: renderedSurroundingElement || parent.type }); } if (options.format === 'system') { if (left instanceof Identifier) { const variable = left.variable!; const exportNames = options.exportNamesByVariable.get(variable); if (exportNames) { if (exportNames.length === 1) { renderSystemExportExpression(variable, start, end, code, options); } else { renderSystemExportSequenceAfterExpression( variable, start, end, parent.type !== NodeType.ExpressionStatement, code, options ); } return; } } else { const systemPatternExports: Variable[] = []; left.addExportedVariables(systemPatternExports, options.exportNamesByVariable); if (systemPatternExports.length > 0) { renderSystemExportFunction( systemPatternExports, start, end, renderedSurroundingElement === NodeType.ExpressionStatement, code, options ); return; } } } if ( left.included && left instanceof ObjectPattern && (renderedSurroundingElement === NodeType.ExpressionStatement || renderedSurroundingElement === NodeType.ArrowFunctionExpression) ) { code.appendRight(start, '('); code.prependLeft(end, ')'); } } protected applyDeoptimizations(): void { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.right.deoptimizePath(UNKNOWN_PATH); this.context.requestTreeshakingPass(); } } rollup-3.29.4/src/ast/nodes/AssignmentPattern.ts000066400000000000000000000040221450520414700216320ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteractionAssigned } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; import type { ExpressionEntity } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; export default class AssignmentPattern extends NodeBase implements PatternNode { declare left: PatternNode; declare right: ExpressionNode; declare type: NodeType.tAssignmentPattern; addExportedVariables( variables: readonly Variable[], exportNamesByVariable: ReadonlyMap ): void { this.left.addExportedVariables(variables, exportNamesByVariable); } declare(kind: string, init: ExpressionEntity): LocalVariable[] { return this.left.declare(kind, init); } deoptimizePath(path: ObjectPath): void { path.length === 0 && this.left.deoptimizePath(path); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteractionAssigned, context: HasEffectsContext ): boolean { return ( path.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context) ); } markDeclarationReached(): void { this.left.markDeclarationReached(); } render( code: MagicString, options: RenderOptions, { isShorthandProperty }: NodeRenderOptions = BLANK ): void { this.left.render(code, options, { isShorthandProperty }); this.right.render(code, options); } protected applyDeoptimizations(): void { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.right.deoptimizePath(UNKNOWN_PATH); this.context.requestTreeshakingPass(); } } rollup-3.29.4/src/ast/nodes/AwaitExpression.ts000066400000000000000000000021621450520414700213140ustar00rootroot00000000000000import type { InclusionContext } from '../ExecutionContext'; import ArrowFunctionExpression from './ArrowFunctionExpression'; import type * as NodeType from './NodeType'; import FunctionNode from './shared/FunctionNode'; import { type ExpressionNode, type IncludeChildren, type Node, NodeBase } from './shared/Node'; export default class AwaitExpression extends NodeBase { declare argument: ExpressionNode; declare type: NodeType.tAwaitExpression; hasEffects(): boolean { if (!this.deoptimized) this.applyDeoptimizations(); return true; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!this.deoptimized) this.applyDeoptimizations(); if (!this.included) { this.included = true; checkTopLevelAwait: if (!this.context.usesTopLevelAwait) { let parent = this.parent; do { if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression) break checkTopLevelAwait; } while ((parent = (parent as Node).parent as Node)); this.context.usesTopLevelAwait = true; } } this.argument.include(context, includeChildrenRecursively); } } rollup-3.29.4/src/ast/nodes/BinaryExpression.ts000066400000000000000000000074441450520414700215030ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, type PathTracker, SHARED_RECURSION_TRACKER } from '../utils/PathTracker'; import ExpressionStatement from './ExpressionStatement'; import type { LiteralValue } from './Literal'; import type * as NodeType from './NodeType'; import { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; type Operator = | '!=' | '!==' | '%' | '&' | '*' | '**' | '+' | '-' | '/' | '<' | '<<' | '<=' | '==' | '===' | '>' | '>=' | '>>' | '>>>' | '^' | '|' | 'in' | 'instanceof'; const binaryOperators: { [operator in Operator]?: (left: LiteralValue, right: LiteralValue) => LiteralValueOrUnknown; } = { '!=': (left, right) => left != right, '!==': (left, right) => left !== right, '%': (left: any, right: any) => left % right, '&': (left: any, right: any) => left & right, '*': (left: any, right: any) => left * right, // At the moment, "**" will be transpiled to Math.pow '**': (left: any, right: any) => left ** right, '+': (left: any, right: any) => left + right, '-': (left: any, right: any) => left - right, '/': (left: any, right: any) => left / right, '<': (left, right) => left! < right!, '<<': (left: any, right: any) => left << right, '<=': (left, right) => left! <= right!, '==': (left, right) => left == right, '===': (left, right) => left === right, '>': (left, right) => left! > right!, '>=': (left, right) => left! >= right!, '>>': (left: any, right: any) => left >> right, '>>>': (left: any, right: any) => left >>> right, '^': (left: any, right: any) => left ^ right, '|': (left: any, right: any) => left | right // We use the fallback for cases where we return something unknown // in: () => UnknownValue, // instanceof: () => UnknownValue, }; export default class BinaryExpression extends NodeBase implements DeoptimizableEntity { declare left: ExpressionNode; declare operator: keyof typeof binaryOperators; declare right: ExpressionNode; declare type: NodeType.tBinaryExpression; deoptimizeCache(): void {} getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (path.length > 0) return UnknownValue; const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); if (typeof leftValue === 'symbol') return UnknownValue; const rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); if (typeof rightValue === 'symbol') return UnknownValue; const operatorFunction = binaryOperators[this.operator]; if (!operatorFunction) return UnknownValue; return operatorFunction(leftValue, rightValue); } hasEffects(context: HasEffectsContext): boolean { // support some implicit type coercion runtime errors if ( this.operator === '+' && this.parent instanceof ExpressionStatement && this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '' ) { return true; } return super.hasEffects(context); } hasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean { return type !== INTERACTION_ACCESSED || path.length > 1; } render( code: MagicString, options: RenderOptions, { renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { this.left.render(code, options, { renderedSurroundingElement }); this.right.render(code, options); } } rollup-3.29.4/src/ast/nodes/BlockStatement.ts000066400000000000000000000044301450520414700211060ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { type RenderOptions, renderStatementList } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type ChildScope from '../scopes/ChildScope'; import type Scope from '../scopes/Scope'; import ExpressionStatement from './ExpressionStatement'; import * as NodeType from './NodeType'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import { type IncludeChildren, type Node, StatementBase, type StatementNode } from './shared/Node'; export default class BlockStatement extends StatementBase { declare body: readonly StatementNode[]; declare type: NodeType.tBlockStatement; private declare deoptimizeBody: boolean; private directlyIncluded = false; addImplicitReturnExpressionToScope(): void { const lastStatement = this.body[this.body.length - 1]; if (!lastStatement || lastStatement.type !== NodeType.ReturnStatement) { this.scope.addReturnExpression(UNKNOWN_EXPRESSION); } } createScope(parentScope: Scope): void { this.scope = (this.parent as Node).preventChildBlockScope ? (parentScope as ChildScope) : new BlockScope(parentScope); } hasEffects(context: HasEffectsContext): boolean { if (this.deoptimizeBody) return true; for (const node of this.body) { if (context.brokenFlow) break; if (node.hasEffects(context)) return true; } return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!(this.deoptimizeBody && this.directlyIncluded)) { this.included = true; this.directlyIncluded = true; if (this.deoptimizeBody) includeChildrenRecursively = true; for (const node of this.body) { if (includeChildrenRecursively || node.shouldBeIncluded(context)) node.include(context, includeChildrenRecursively); } } } initialise(): void { const firstBodyStatement = this.body[0]; this.deoptimizeBody = firstBodyStatement instanceof ExpressionStatement && firstBodyStatement.directive === 'use asm'; } render(code: MagicString, options: RenderOptions): void { if (this.body.length > 0) { renderStatementList(this.body, code, this.start + 1, this.end - 1, options); } else { super.render(code, options); } } } rollup-3.29.4/src/ast/nodes/BreakStatement.ts000066400000000000000000000016251450520414700211030ustar00rootroot00000000000000import { type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; import { StatementBase } from './shared/Node'; export default class BreakStatement extends StatementBase { declare label: Identifier | null; declare type: NodeType.tBreakStatement; hasEffects(context: HasEffectsContext): boolean { if (this.label) { if (!context.ignore.labels.has(this.label.name)) return true; context.includedLabels.add(this.label.name); } else { if (!context.ignore.breaks) return true; context.hasBreak = true; } context.brokenFlow = true; return false; } include(context: InclusionContext): void { this.included = true; if (this.label) { this.label.include(); context.includedLabels.add(this.label.name); } else { context.hasBreak = true; } context.brokenFlow = true; } } rollup-3.29.4/src/ast/nodes/CallExpression.ts000066400000000000000000000103231450520414700211200ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import { LOGLEVEL_WARN } from '../../utils/logging'; import { logCannotCallNamespace, logEval } from '../../utils/logs'; import { renderCallArguments } from '../../utils/renderCallArguments'; import { type NodeRenderOptions, type RenderOptions } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import { INTERACTION_CALLED } from '../NodeInteractions'; import { EMPTY_PATH, type PathTracker, SHARED_RECURSION_TRACKER } from '../utils/PathTracker'; import Identifier from './Identifier'; import MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import type SpreadElement from './SpreadElement'; import type Super from './Super'; import CallExpressionBase from './shared/CallExpressionBase'; import { type ExpressionEntity, UNKNOWN_RETURN_EXPRESSION } from './shared/Expression'; import type { ChainElement, ExpressionNode, IncludeChildren } from './shared/Node'; import { INCLUDE_PARAMETERS } from './shared/Node'; export default class CallExpression extends CallExpressionBase implements DeoptimizableEntity, ChainElement { declare arguments: (ExpressionNode | SpreadElement)[]; declare callee: ExpressionNode | Super; declare optional: boolean; declare type: NodeType.tCallExpression; bind(): void { super.bind(); if (this.callee instanceof Identifier) { const variable = this.scope.findVariable(this.callee.name); if (variable.isNamespace) { this.context.log(LOGLEVEL_WARN, logCannotCallNamespace(this.callee.name), this.start); } if (this.callee.name === 'eval') { this.context.log(LOGLEVEL_WARN, logEval(this.context.module.id), this.start); } } this.interaction = { args: [ this.callee instanceof MemberExpression && !this.callee.variable ? this.callee.object : null, ...this.arguments ], type: INTERACTION_CALLED, withNew: false }; } hasEffects(context: HasEffectsContext): boolean { try { for (const argument of this.arguments) { if (argument.hasEffects(context)) return true; } if (this.annotationPure) { return false; } return ( this.callee.hasEffects(context) || this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context) ); } finally { if (!this.deoptimized) this.applyDeoptimizations(); } } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!this.deoptimized) this.applyDeoptimizations(); if (includeChildrenRecursively) { super.include(context, includeChildrenRecursively); if ( includeChildrenRecursively === INCLUDE_PARAMETERS && this.callee instanceof Identifier && this.callee.variable ) { this.callee.variable.markCalledFromTryStatement(); } } else { this.included = true; this.callee.include(context, false); } this.callee.includeCallArguments(context, this.arguments); } isSkippedAsOptional(origin: DeoptimizableEntity): boolean { return ( (this.callee as ExpressionNode).isSkippedAsOptional?.(origin) || (this.optional && this.callee.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, origin) == null) ); } render( code: MagicString, options: RenderOptions, { renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { this.callee.render(code, options, { isCalleeOfRenderedParent: true, renderedSurroundingElement }); renderCallArguments(code, options, this); } protected applyDeoptimizations(): void { this.deoptimized = true; this.callee.deoptimizeArgumentsOnInteractionAtPath( this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER ); this.context.requestTreeshakingPass(); } protected getReturnExpression( recursionTracker: PathTracker = SHARED_RECURSION_TRACKER ): [expression: ExpressionEntity, isPure: boolean] { if (this.returnExpression === null) { this.returnExpression = UNKNOWN_RETURN_EXPRESSION; return (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath( EMPTY_PATH, this.interaction, recursionTracker, this )); } return this.returnExpression; } } rollup-3.29.4/src/ast/nodes/CatchClause.ts000066400000000000000000000022621450520414700203470ustar00rootroot00000000000000import CatchScope from '../scopes/CatchScope'; import type Scope from '../scopes/Scope'; import type BlockStatement from './BlockStatement'; import type * as NodeType from './NodeType'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import { type GenericEsTreeNode, NodeBase } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; export default class CatchClause extends NodeBase { declare body: BlockStatement; declare param: PatternNode | null; declare preventChildBlockScope: true; declare scope: CatchScope; declare type: NodeType.tCatchClause; createScope(parentScope: Scope): void { this.scope = new CatchScope(parentScope, this.context); } parseNode(esTreeNode: GenericEsTreeNode): void { // Parameters need to be declared first as the logic is that initializers // of hoisted body variables are associated with parameters of the same // name instead of the variable const { param } = esTreeNode; if (param) { (this.param as GenericEsTreeNode) = new (this.context.getNodeConstructor(param.type))( param, this, this.scope ); this.param!.declare('parameter', UNKNOWN_EXPRESSION); } super.parseNode(esTreeNode); } } rollup-3.29.4/src/ast/nodes/ChainExpression.ts000066400000000000000000000022521450520414700212710ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext } from '../ExecutionContext'; import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import type CallExpression from './CallExpression'; import type MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import type { LiteralValueOrUnknown } from './shared/Expression'; import { NodeBase } from './shared/Node'; export default class ChainExpression extends NodeBase implements DeoptimizableEntity { declare expression: CallExpression | MemberExpression; declare type: NodeType.tChainExpression; // deoptimizations are not relevant as we are not caching values deoptimizeCache(): void {} getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (this.expression.isSkippedAsOptional(origin)) return undefined; return this.expression.getLiteralValueAtPath(path, recursionTracker, origin); } hasEffects(context: HasEffectsContext): boolean { if (this.expression.isSkippedAsOptional(this)) return false; return this.expression.hasEffects(context); } } rollup-3.29.4/src/ast/nodes/ClassBody.ts000066400000000000000000000026511450520414700200550ustar00rootroot00000000000000import type { InclusionContext } from '../ExecutionContext'; import ClassBodyScope from '../scopes/ClassBodyScope'; import type Scope from '../scopes/Scope'; import type MethodDefinition from './MethodDefinition'; import type * as NodeType from './NodeType'; import type PropertyDefinition from './PropertyDefinition'; import type ClassNode from './shared/ClassNode'; import { type GenericEsTreeNode, type IncludeChildren, NodeBase } from './shared/Node'; export default class ClassBody extends NodeBase { declare body: (MethodDefinition | PropertyDefinition)[]; declare scope: ClassBodyScope; declare type: NodeType.tClassBody; createScope(parentScope: Scope): void { this.scope = new ClassBodyScope(parentScope, this.parent as ClassNode, this.context); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; this.context.includeVariableInModule(this.scope.thisVariable); for (const definition of this.body) { definition.include(context, includeChildrenRecursively); } } parseNode(esTreeNode: GenericEsTreeNode): void { const body: NodeBase[] = (this.body = []); for (const definition of esTreeNode.body) { body.push( new (this.context.getNodeConstructor(definition.type))( definition, this, definition.static ? this.scope : this.scope.instanceScope ) ); } super.parseNode(esTreeNode); } protected applyDeoptimizations() {} } rollup-3.29.4/src/ast/nodes/ClassDeclaration.ts000066400000000000000000000041421450520414700214020ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import { getSystemExportStatement } from '../../utils/systemJsRendering'; import type ChildScope from '../scopes/ChildScope'; import type Variable from '../variables/Variable'; import Identifier, { type IdentifierWithVariable } from './Identifier'; import type * as NodeType from './NodeType'; import ClassNode from './shared/ClassNode'; import type { GenericEsTreeNode } from './shared/Node'; export default class ClassDeclaration extends ClassNode { declare id: IdentifierWithVariable | null; declare type: NodeType.tClassDeclaration; initialise(): void { super.initialise(); if (this.id !== null) { this.id.variable.isId = true; } } parseNode(esTreeNode: GenericEsTreeNode): void { if (esTreeNode.id !== null) { this.id = new Identifier( esTreeNode.id, this, this.scope.parent as ChildScope ) as IdentifierWithVariable; } super.parseNode(esTreeNode); } render(code: MagicString, options: RenderOptions): void { const { exportNamesByVariable, format, snippets: { _, getPropertyAccess } } = options; if (this.id) { const { variable, name } = this.id; if (format === 'system' && exportNamesByVariable.has(variable)) { code.appendLeft(this.end, `${_}${getSystemExportStatement([variable], options)};`); } const renderedVariable = variable.getName(getPropertyAccess); if (renderedVariable !== name) { this.superClass?.render(code, options); this.body.render(code, { ...options, useOriginalName: (_variable: Variable) => _variable === variable }); code.prependRight(this.start, `let ${renderedVariable}${_}=${_}`); code.prependLeft(this.end, ';'); return; } } super.render(code, options); } protected applyDeoptimizations(): void { super.applyDeoptimizations(); const { id, scope } = this; if (id) { const { name, variable } = id; for (const accessedVariable of scope.accessedOutsideVariables.values()) { if (accessedVariable !== variable) { accessedVariable.forbidName(name); } } } } } rollup-3.29.4/src/ast/nodes/ClassExpression.ts000066400000000000000000000012321450520414700213110ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import * as NodeType from './NodeType'; import ClassNode from './shared/ClassNode'; export default class ClassExpression extends ClassNode { declare type: NodeType.tClassExpression; render( code: MagicString, options: RenderOptions, { renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { super.render(code, options); if (renderedSurroundingElement === NodeType.ExpressionStatement) { code.appendRight(this.start, '('); code.prependLeft(this.end, ')'); } } } rollup-3.29.4/src/ast/nodes/ConditionalExpression.ts000066400000000000000000000154731450520414700225230ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK, EMPTY_ARRAY } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import { findFirstOccurrenceOutsideComment, findNonWhiteSpace, removeLineBreaks } from '../../utils/renderHelpers'; import { removeAnnotations } from '../../utils/treeshakeNode'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import { EMPTY_PATH, SHARED_RECURSION_TRACKER, UNKNOWN_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import type SpreadElement from './SpreadElement'; import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; import { UnknownValue } from './shared/Expression'; import { MultiExpression } from './shared/MultiExpression'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; import { NodeBase } from './shared/Node'; export default class ConditionalExpression extends NodeBase implements DeoptimizableEntity { declare alternate: ExpressionNode; declare consequent: ExpressionNode; declare test: ExpressionNode; declare type: NodeType.tConditionalExpression; private expressionsToBeDeoptimized: DeoptimizableEntity[] = []; private isBranchResolutionAnalysed = false; private usedBranch: ExpressionNode | null = null; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.consequent.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); this.alternate.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } deoptimizeCache(): void { if (this.usedBranch !== null) { const unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent; this.usedBranch = null; unusedBranch.deoptimizePath(UNKNOWN_PATH); const { expressionsToBeDeoptimized } = this; this.expressionsToBeDeoptimized = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } } } deoptimizePath(path: ObjectPath): void { const usedBranch = this.getUsedBranch(); if (usedBranch) { usedBranch.deoptimizePath(path); } else { this.consequent.deoptimizePath(path); this.alternate.deoptimizePath(path); } } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { const usedBranch = this.getUsedBranch(); if (!usedBranch) return UnknownValue; this.expressionsToBeDeoptimized.push(origin); return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { const usedBranch = this.getUsedBranch(); if (!usedBranch) return [ new MultiExpression([ this.consequent.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin )[0], this.alternate.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin )[0] ]), false ]; this.expressionsToBeDeoptimized.push(origin); return usedBranch.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); } hasEffects(context: HasEffectsContext): boolean { if (this.test.hasEffects(context)) return true; const usedBranch = this.getUsedBranch(); if (!usedBranch) { return this.consequent.hasEffects(context) || this.alternate.hasEffects(context); } return usedBranch.hasEffects(context); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { const usedBranch = this.getUsedBranch(); if (!usedBranch) { return ( this.consequent.hasEffectsOnInteractionAtPath(path, interaction, context) || this.alternate.hasEffectsOnInteractionAtPath(path, interaction, context) ); } return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; const usedBranch = this.getUsedBranch(); if (includeChildrenRecursively || this.test.shouldBeIncluded(context) || usedBranch === null) { this.test.include(context, includeChildrenRecursively); this.consequent.include(context, includeChildrenRecursively); this.alternate.include(context, includeChildrenRecursively); } else { usedBranch.include(context, includeChildrenRecursively); } } includeCallArguments( context: InclusionContext, parameters: readonly (ExpressionEntity | SpreadElement)[] ): void { const usedBranch = this.getUsedBranch(); if (usedBranch) { usedBranch.includeCallArguments(context, parameters); } else { this.consequent.includeCallArguments(context, parameters); this.alternate.includeCallArguments(context, parameters); } } render( code: MagicString, options: RenderOptions, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { const usedBranch = this.getUsedBranch(); if (this.test.included) { this.test.render(code, options, { renderedSurroundingElement }); this.consequent.render(code, options); this.alternate.render(code, options); } else { const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end); const inclusionStart = findNonWhiteSpace( code.original, (this.consequent.included ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end) : colonPos) + 1 ); if (preventASI) { removeLineBreaks(code, inclusionStart, usedBranch!.start); } code.remove(this.start, inclusionStart); if (this.consequent.included) { code.remove(colonPos, this.end); } removeAnnotations(this, code); usedBranch!.render(code, options, { isCalleeOfRenderedParent, preventASI: true, renderedParentType: renderedParentType || this.parent.type, renderedSurroundingElement: renderedSurroundingElement || this.parent.type }); } } private getUsedBranch() { if (this.isBranchResolutionAnalysed) { return this.usedBranch; } this.isBranchResolutionAnalysed = true; const testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); return typeof testValue === 'symbol' ? null : (this.usedBranch = testValue ? this.consequent : this.alternate); } } rollup-3.29.4/src/ast/nodes/ContinueStatement.ts000066400000000000000000000016441450520414700216440ustar00rootroot00000000000000import { type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; import { StatementBase } from './shared/Node'; export default class ContinueStatement extends StatementBase { declare label: Identifier | null; declare type: NodeType.tContinueStatement; hasEffects(context: HasEffectsContext): boolean { if (this.label) { if (!context.ignore.labels.has(this.label.name)) return true; context.includedLabels.add(this.label.name); } else { if (!context.ignore.continues) return true; context.hasContinue = true; } context.brokenFlow = true; return false; } include(context: InclusionContext): void { this.included = true; if (this.label) { this.label.include(); context.includedLabels.add(this.label.name); } else { context.hasContinue = true; } context.brokenFlow = true; } } rollup-3.29.4/src/ast/nodes/DoWhileStatement.ts000066400000000000000000000015521450520414700214110ustar00rootroot00000000000000import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; import { type ExpressionNode, type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; export default class DoWhileStatement extends StatementBase { declare body: StatementNode; declare test: ExpressionNode; declare type: NodeType.tDoWhileStatement; hasEffects(context: HasEffectsContext): boolean { if (this.test.hasEffects(context)) return true; return hasLoopBodyEffects(context, this.body); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; this.test.include(context, includeChildrenRecursively); includeLoopBody(context, this.body, includeChildrenRecursively); } } rollup-3.29.4/src/ast/nodes/EmptyStatement.ts000066400000000000000000000003611450520414700211510ustar00rootroot00000000000000import type * as NodeType from './NodeType'; import { StatementBase } from './shared/Node'; export default class EmptyStatement extends StatementBase { declare type: NodeType.tEmptyStatement; hasEffects(): boolean { return false; } } rollup-3.29.4/src/ast/nodes/ExportAllDeclaration.ts000066400000000000000000000017151450520414700222520ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type Identifier from './Identifier'; import type ImportAttribute from './ImportAttribute'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ExportAllDeclaration extends NodeBase { declare assertions: ImportAttribute[]; declare exported: Identifier | null; declare needsBoundaries: true; declare source: Literal; declare type: NodeType.tExportAllDeclaration; hasEffects(): boolean { return false; } initialise(): void { this.context.addExport(this); } render(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { code.remove(nodeRenderOptions!.start!, nodeRenderOptions!.end!); } protected applyDeoptimizations() {} } ExportAllDeclaration.prototype.needsBoundaries = true; rollup-3.29.4/src/ast/nodes/ExportDefaultDeclaration.ts000066400000000000000000000126771450520414700231370ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { findFirstOccurrenceOutsideComment, findNonWhiteSpace, type NodeRenderOptions, type RenderOptions } from '../../utils/renderHelpers'; import { getSystemExportStatement } from '../../utils/systemJsRendering'; import { treeshakeNode } from '../../utils/treeshakeNode'; import type { InclusionContext } from '../ExecutionContext'; import type ModuleScope from '../scopes/ModuleScope'; import type ExportDefaultVariable from '../variables/ExportDefaultVariable'; import ClassDeclaration from './ClassDeclaration'; import FunctionDeclaration from './FunctionDeclaration'; import type Identifier from './Identifier'; import * as NodeType from './NodeType'; import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node'; // The header ends at the first non-white-space after "default" function getDeclarationStart(code: string, start: number): number { return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7); } function getFunctionIdInsertPosition(code: string, start: number): number { const declarationEnd = findFirstOccurrenceOutsideComment(code, 'function', start) + 'function'.length; code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, '(', declarationEnd)); const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*'); if (generatorStarPos === -1) { return declarationEnd; } return declarationEnd + generatorStarPos + 1; } export default class ExportDefaultDeclaration extends NodeBase { declare declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode; declare needsBoundaries: true; declare scope: ModuleScope; declare type: NodeType.tExportDefaultDeclaration; declare variable: ExportDefaultVariable; private declare declarationName: string | undefined; include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { super.include(context, includeChildrenRecursively); if (includeChildrenRecursively) { this.context.includeVariableInModule(this.variable); } } initialise(): void { const declaration = this.declaration as FunctionDeclaration | ClassDeclaration; this.declarationName = (declaration.id && declaration.id.name) || (this.declaration as Identifier).name; this.variable = this.scope.addExportDefaultDeclaration( this.declarationName || this.context.getModuleName(), this, this.context ); this.context.addExport(this); } render(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { const { start, end } = nodeRenderOptions as { end: number; start: number }; const declarationStart = getDeclarationStart(code.original, this.start); if (this.declaration instanceof FunctionDeclaration) { this.renderNamedDeclaration( code, declarationStart, this.declaration.id === null ? getFunctionIdInsertPosition(code.original, declarationStart) : null, options ); } else if (this.declaration instanceof ClassDeclaration) { this.renderNamedDeclaration( code, declarationStart, this.declaration.id === null ? findFirstOccurrenceOutsideComment(code.original, 'class', start) + 'class'.length : null, options ); } else if (this.variable.getOriginalVariable() !== this.variable) { // Remove altogether to prevent re-declaring the same variable treeshakeNode(this, code, start, end); return; } else if (this.variable.included) { this.renderVariableDeclaration(code, declarationStart, options); } else { code.remove(this.start, declarationStart); this.declaration.render(code, options, { renderedSurroundingElement: NodeType.ExpressionStatement }); if (code.original[this.end - 1] !== ';') { code.appendLeft(this.end, ';'); } return; } this.declaration.render(code, options); } protected applyDeoptimizations() {} private renderNamedDeclaration( code: MagicString, declarationStart: number, idInsertPosition: number | null, options: RenderOptions ): void { const { exportNamesByVariable, format, snippets: { getPropertyAccess } } = options; const name = this.variable.getName(getPropertyAccess); // Remove `export default` code.remove(this.start, declarationStart); if (idInsertPosition !== null) { code.appendLeft(idInsertPosition, ` ${name}`); } if ( format === 'system' && this.declaration instanceof ClassDeclaration && exportNamesByVariable.has(this.variable) ) { code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`); } } private renderVariableDeclaration( code: MagicString, declarationStart: number, { format, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }: RenderOptions ): void { const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/ const systemExportNames = format === 'system' && exportNamesByVariable.get(this.variable); if (systemExportNames) { code.overwrite( this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', ` ); code.appendRight( hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';') ); } else { code.overwrite( this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = ` ); if (!hasTrailingSemicolon) { code.appendLeft(this.end, ';'); } } } } ExportDefaultDeclaration.prototype.needsBoundaries = true; rollup-3.29.4/src/ast/nodes/ExportNamedDeclaration.ts000066400000000000000000000032401450520414700225610ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext } from '../ExecutionContext'; import type ClassDeclaration from './ClassDeclaration'; import type ExportSpecifier from './ExportSpecifier'; import type FunctionDeclaration from './FunctionDeclaration'; import type ImportAttribute from './ImportAttribute'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; import type VariableDeclaration from './VariableDeclaration'; import { type Node, NodeBase } from './shared/Node'; export default class ExportNamedDeclaration extends NodeBase { declare assertions: ImportAttribute[]; declare declaration: FunctionDeclaration | ClassDeclaration | VariableDeclaration | null; declare needsBoundaries: true; declare source: Literal | null; declare specifiers: readonly ExportSpecifier[]; declare type: NodeType.tExportNamedDeclaration; bind(): void { // Do not bind specifiers this.declaration?.bind(); } hasEffects(context: HasEffectsContext): boolean { return !!this.declaration?.hasEffects(context); } initialise(): void { this.context.addExport(this); } render(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { const { start, end } = nodeRenderOptions as { end: number; start: number }; if (this.declaration === null) { code.remove(start, end); } else { code.remove(this.start, this.declaration.start); (this.declaration as Node).render(code, options, { end, start }); } } protected applyDeoptimizations() {} } ExportNamedDeclaration.prototype.needsBoundaries = true; rollup-3.29.4/src/ast/nodes/ExportSpecifier.ts000066400000000000000000000006231450520414700213020ustar00rootroot00000000000000import type Identifier from './Identifier'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ExportSpecifier extends NodeBase { declare exported: Identifier | Literal; declare local: Identifier | Literal; declare type: NodeType.tExportSpecifier; protected applyDeoptimizations() {} } rollup-3.29.4/src/ast/nodes/ExpressionStatement.ts000066400000000000000000000023671450520414700222220ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { LOGLEVEL_WARN } from '../../utils/logging'; import { logModuleLevelDirective } from '../../utils/logs'; import type { RenderOptions } from '../../utils/renderHelpers'; import type { InclusionContext } from '../ExecutionContext'; import * as NodeType from './NodeType'; import { type ExpressionNode, StatementBase } from './shared/Node'; export default class ExpressionStatement extends StatementBase { declare directive?: string; declare expression: ExpressionNode; initialise(): void { if ( this.directive && this.directive !== 'use strict' && this.parent.type === NodeType.Program ) { this.context.log( LOGLEVEL_WARN, // This is necessary, because either way (deleting or not) can lead to errors. logModuleLevelDirective(this.directive, this.context.module.id), this.start ); } } render(code: MagicString, options: RenderOptions): void { super.render(code, options); if (this.included) this.insertSemicolon(code); } shouldBeIncluded(context: InclusionContext): boolean { if (this.directive && this.directive !== 'use strict') return this.parent.type !== NodeType.Program; return super.shouldBeIncluded(context); } protected applyDeoptimizations() {} } rollup-3.29.4/src/ast/nodes/ForInStatement.ts000066400000000000000000000046041450520414700210740ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type Scope from '../scopes/Scope'; import { EMPTY_PATH } from '../utils/PathTracker'; import type MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import type VariableDeclaration from './VariableDeclaration'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import { type ExpressionNode, type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; export default class ForInStatement extends StatementBase { declare body: StatementNode; declare left: VariableDeclaration | PatternNode | MemberExpression; declare right: ExpressionNode; declare type: NodeType.tForInStatement; createScope(parentScope: Scope): void { this.scope = new BlockScope(parentScope); } hasEffects(context: HasEffectsContext): boolean { const { body, deoptimized, left, right } = this; if (!deoptimized) this.applyDeoptimizations(); if (left.hasEffectsAsAssignmentTarget(context, false) || right.hasEffects(context)) return true; return hasLoopBodyEffects(context, body); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { const { body, deoptimized, left, right } = this; if (!deoptimized) this.applyDeoptimizations(); this.included = true; left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); right.include(context, includeChildrenRecursively); includeLoopBody(context, body, includeChildrenRecursively); } initialise() { this.left.setAssignedValue(UNKNOWN_EXPRESSION); } render(code: MagicString, options: RenderOptions): void { this.left.render(code, options, NO_SEMICOLON); this.right.render(code, options, NO_SEMICOLON); // handle no space between "in" and the right side if (code.original.charCodeAt(this.right.start - 1) === 110 /* n */) { code.prependLeft(this.right.start, ' '); } this.body.render(code, options); } protected applyDeoptimizations(): void { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.context.requestTreeshakingPass(); } } rollup-3.29.4/src/ast/nodes/ForOfStatement.ts000066400000000000000000000044351450520414700210740ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers'; import type { InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type Scope from '../scopes/Scope'; import { EMPTY_PATH, UNKNOWN_PATH } from '../utils/PathTracker'; import type MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import type VariableDeclaration from './VariableDeclaration'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import { type ExpressionNode, type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; import { includeLoopBody } from './shared/loops'; export default class ForOfStatement extends StatementBase { declare await: boolean; declare body: StatementNode; declare left: VariableDeclaration | PatternNode | MemberExpression; declare right: ExpressionNode; declare type: NodeType.tForOfStatement; createScope(parentScope: Scope): void { this.scope = new BlockScope(parentScope); } hasEffects(): boolean { if (!this.deoptimized) this.applyDeoptimizations(); // Placeholder until proper Symbol.Iterator support return true; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { const { body, deoptimized, left, right } = this; if (!deoptimized) this.applyDeoptimizations(); this.included = true; left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); right.include(context, includeChildrenRecursively); includeLoopBody(context, body, includeChildrenRecursively); } initialise() { this.left.setAssignedValue(UNKNOWN_EXPRESSION); } render(code: MagicString, options: RenderOptions): void { this.left.render(code, options, NO_SEMICOLON); this.right.render(code, options, NO_SEMICOLON); // handle no space between "of" and the right side if (code.original.charCodeAt(this.right.start - 1) === 102 /* f */) { code.prependLeft(this.right.start, ' '); } this.body.render(code, options); } protected applyDeoptimizations(): void { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.right.deoptimizePath(UNKNOWN_PATH); this.context.requestTreeshakingPass(); } } rollup-3.29.4/src/ast/nodes/ForStatement.ts000066400000000000000000000034451450520414700206070ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type Scope from '../scopes/Scope'; import type * as NodeType from './NodeType'; import type VariableDeclaration from './VariableDeclaration'; import { type ExpressionNode, type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; export default class ForStatement extends StatementBase { declare body: StatementNode; declare init: VariableDeclaration | ExpressionNode | null; declare test: ExpressionNode | null; declare type: NodeType.tForStatement; declare update: ExpressionNode | null; createScope(parentScope: Scope): void { this.scope = new BlockScope(parentScope); } hasEffects(context: HasEffectsContext): boolean { if ( this.init?.hasEffects(context) || this.test?.hasEffects(context) || this.update?.hasEffects(context) ) { return true; } return hasLoopBodyEffects(context, this.body); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; this.init?.include(context, includeChildrenRecursively, { asSingleStatement: true }); this.test?.include(context, includeChildrenRecursively); this.update?.include(context, includeChildrenRecursively); includeLoopBody(context, this.body, includeChildrenRecursively); } render(code: MagicString, options: RenderOptions): void { this.init?.render(code, options, NO_SEMICOLON); this.test?.render(code, options, NO_SEMICOLON); this.update?.render(code, options, NO_SEMICOLON); this.body.render(code, options); } } rollup-3.29.4/src/ast/nodes/FunctionDeclaration.ts000066400000000000000000000013521450520414700221220ustar00rootroot00000000000000import type ChildScope from '../scopes/ChildScope'; import Identifier, { type IdentifierWithVariable } from './Identifier'; import type * as NodeType from './NodeType'; import FunctionNode from './shared/FunctionNode'; import type { GenericEsTreeNode } from './shared/Node'; export default class FunctionDeclaration extends FunctionNode { declare type: NodeType.tFunctionDeclaration; initialise(): void { super.initialise(); if (this.id !== null) { this.id.variable.isId = true; } } parseNode(esTreeNode: GenericEsTreeNode): void { if (esTreeNode.id !== null) { this.id = new Identifier( esTreeNode.id, this, this.scope.parent as ChildScope ) as IdentifierWithVariable; } super.parseNode(esTreeNode); } } rollup-3.29.4/src/ast/nodes/FunctionExpression.ts000066400000000000000000000012511450520414700220320ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import * as NodeType from './NodeType'; import FunctionNode from './shared/FunctionNode'; export default class FunctionExpression extends FunctionNode { declare type: NodeType.tFunctionExpression; render( code: MagicString, options: RenderOptions, { renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { super.render(code, options); if (renderedSurroundingElement === NodeType.ExpressionStatement) { code.appendRight(this.start, '('); code.prependLeft(this.end, ')'); } } } rollup-3.29.4/src/ast/nodes/Identifier.ts000066400000000000000000000224751450520414700202620ustar00rootroot00000000000000import isReference, { type NodeWithFieldDefinition } from 'is-reference'; import type MagicString from 'magic-string'; import type { NormalizedTreeshakingOptions } from '../../rollup/types'; import { BLANK } from '../../utils/blank'; import { logIllegalImportReassignment } from '../../utils/logs'; import { PureFunctionKey } from '../../utils/pureFunctions'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_ASSIGNED, INTERACTION_CALLED, NODE_INTERACTION_UNKNOWN_ACCESS } from '../NodeInteractions'; import type FunctionScope from '../scopes/FunctionScope'; import { EMPTY_PATH, type ObjectPath, type PathTracker } from '../utils/PathTracker'; import GlobalVariable from '../variables/GlobalVariable'; import LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import * as NodeType from './NodeType'; import type SpreadElement from './SpreadElement'; import { type ExpressionEntity, type LiteralValueOrUnknown, UNKNOWN_EXPRESSION } from './shared/Expression'; import { NodeBase } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; export type IdentifierWithVariable = Identifier & { variable: Variable }; const tdzVariableKinds = { __proto__: null, class: true, const: true, let: true, var: true }; export default class Identifier extends NodeBase implements PatternNode { declare name: string; declare type: NodeType.tIdentifier; variable: Variable | null = null; private isTDZAccess: boolean | null = null; addExportedVariables( variables: Variable[], exportNamesByVariable: ReadonlyMap ): void { if (exportNamesByVariable.has(this.variable!)) { variables.push(this.variable!); } } bind(): void { if (!this.variable && isReference(this, this.parent as NodeWithFieldDefinition)) { this.variable = this.scope.findVariable(this.name); this.variable.addReference(this); } } declare(kind: string, init: ExpressionEntity): LocalVariable[] { let variable: LocalVariable; const { treeshake } = this.context.options; switch (kind) { case 'var': { variable = this.scope.addDeclaration(this, this.context, init, true); if (treeshake && treeshake.correctVarValueBeforeDeclaration) { // Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here. variable.markInitializersForDeoptimization(); } break; } case 'function': { // in strict mode, functions are only hoisted within a scope but not across block scopes variable = this.scope.addDeclaration(this, this.context, init, false); break; } case 'let': case 'const': case 'class': { variable = this.scope.addDeclaration(this, this.context, init, false); break; } case 'parameter': { variable = (this.scope as FunctionScope).addParameterDeclaration(this); break; } /* istanbul ignore next */ default: { /* istanbul ignore next */ throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`); } } variable.kind = kind; return [(this.variable = variable)]; } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.variable!.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } deoptimizePath(path: ObjectPath): void { if (path.length === 0 && !this.scope.contains(this.name)) { this.disallowImportReassignment(); } // We keep conditional chaining because an unknown Node could have an // Identifier as property that might be deoptimized by default this.variable?.deoptimizePath(path); } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getVariableRespectingTDZ()!.getLiteralValueAtPath(path, recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { const [expression, isPure] = this.getVariableRespectingTDZ()!.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); return [expression, isPure || this.isPureFunction(path)]; } hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); if (this.isPossibleTDZ() && this.variable!.kind !== 'var') { return true; } return ( (this.context.options.treeshake as NormalizedTreeshakingOptions).unknownGlobalSideEffects && this.variable instanceof GlobalVariable && !this.isPureFunction(EMPTY_PATH) && this.variable.hasEffectsOnInteractionAtPath( EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context ) ); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { switch (interaction.type) { case INTERACTION_ACCESSED: { return ( this.variable !== null && !this.isPureFunction(path) && this.getVariableRespectingTDZ()!.hasEffectsOnInteractionAtPath(path, interaction, context) ); } case INTERACTION_ASSIGNED: { return ( path.length > 0 ? this.getVariableRespectingTDZ() : this.variable )!.hasEffectsOnInteractionAtPath(path, interaction, context); } case INTERACTION_CALLED: { return ( !this.isPureFunction(path) && this.getVariableRespectingTDZ()!.hasEffectsOnInteractionAtPath(path, interaction, context) ); } } } include(): void { if (!this.deoptimized) this.applyDeoptimizations(); if (!this.included) { this.included = true; if (this.variable !== null) { this.context.includeVariableInModule(this.variable); } } } includeCallArguments( context: InclusionContext, parameters: readonly (ExpressionEntity | SpreadElement)[] ): void { this.variable!.includeCallArguments(context, parameters); } isPossibleTDZ(): boolean { // return cached value to avoid issues with the next tree-shaking pass if (this.isTDZAccess !== null) return this.isTDZAccess; if ( !( this.variable instanceof LocalVariable && this.variable.kind && this.variable.kind in tdzVariableKinds && // we ignore possible TDZs due to circular module dependencies as // otherwise we get many false positives this.variable.module === this.context.module ) ) { return (this.isTDZAccess = false); } let decl_id; if ( this.variable.declarations && this.variable.declarations.length === 1 && (decl_id = this.variable.declarations[0] as any) && this.start < decl_id.start && closestParentFunctionOrProgram(this) === closestParentFunctionOrProgram(decl_id) ) { // a variable accessed before its declaration // in the same function or at top level of module return (this.isTDZAccess = true); } if (!this.variable.initReached) { // Either a const/let TDZ violation or // var use before declaration was encountered. return (this.isTDZAccess = true); } return (this.isTDZAccess = false); } markDeclarationReached(): void { this.variable!.initReached = true; } render( code: MagicString, { snippets: { getPropertyAccess }, useOriginalName }: RenderOptions, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty }: NodeRenderOptions = BLANK ): void { if (this.variable) { const name = this.variable.getName(getPropertyAccess, useOriginalName); if (name !== this.name) { code.overwrite(this.start, this.end, name, { contentOnly: true, storeName: true }); if (isShorthandProperty) { code.prependRight(this.start, `${this.name}: `); } } // In strict mode, any variable named "eval" must be the actual "eval" function if ( name === 'eval' && renderedParentType === NodeType.CallExpression && isCalleeOfRenderedParent ) { code.appendRight(this.start, '0, '); } } } protected applyDeoptimizations(): void { this.deoptimized = true; if (this.variable instanceof LocalVariable) { this.variable.consolidateInitializers(); this.context.requestTreeshakingPass(); } } private disallowImportReassignment(): never { return this.context.error( logIllegalImportReassignment(this.name, this.context.module.id), this.start ); } private getVariableRespectingTDZ(): ExpressionEntity | null { if (this.isPossibleTDZ()) { return UNKNOWN_EXPRESSION; } return this.variable; } private isPureFunction(path: ObjectPath) { let currentPureFunction = this.context.manualPureFunctions[this.name]; for (const segment of path) { if (currentPureFunction) { if (currentPureFunction[PureFunctionKey]) { return true; } currentPureFunction = currentPureFunction[segment as string]; } else { return false; } } return currentPureFunction?.[PureFunctionKey] as boolean; } } function closestParentFunctionOrProgram(node: any): any { while (node && !/^Program|Function/.test(node.type)) { node = node.parent; } // one of: ArrowFunctionExpression, FunctionDeclaration, FunctionExpression or Program return node; } rollup-3.29.4/src/ast/nodes/IfStatement.ts000066400000000000000000000163261450520414700204210ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import { type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; import TrackingScope from '../scopes/TrackingScope'; import { EMPTY_PATH, SHARED_RECURSION_TRACKER } from '../utils/PathTracker'; import BlockStatement from './BlockStatement'; import type Identifier from './Identifier'; import * as NodeType from './NodeType'; import { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression'; import { type ExpressionNode, type GenericEsTreeNode, type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; const unset = Symbol('unset'); export default class IfStatement extends StatementBase implements DeoptimizableEntity { declare alternate: StatementNode | null; declare consequent: StatementNode; declare test: ExpressionNode; declare type: NodeType.tIfStatement; private declare alternateScope?: TrackingScope; private declare consequentScope: TrackingScope; private testValue: LiteralValueOrUnknown | typeof unset = unset; deoptimizeCache(): void { this.testValue = UnknownValue; } hasEffects(context: HasEffectsContext): boolean { if (this.test.hasEffects(context)) { return true; } const testValue = this.getTestValue(); if (typeof testValue === 'symbol') { const { brokenFlow } = context; if (this.consequent.hasEffects(context)) return true; // eslint-disable-next-line unicorn/consistent-destructuring const consequentBrokenFlow = context.brokenFlow; context.brokenFlow = brokenFlow; if (this.alternate === null) return false; if (this.alternate.hasEffects(context)) return true; // eslint-disable-next-line unicorn/consistent-destructuring context.brokenFlow = context.brokenFlow && consequentBrokenFlow; return false; } return testValue ? this.consequent.hasEffects(context) : !!this.alternate?.hasEffects(context); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; if (includeChildrenRecursively) { this.includeRecursively(includeChildrenRecursively, context); } else { const testValue = this.getTestValue(); if (typeof testValue === 'symbol') { this.includeUnknownTest(context); } else { this.includeKnownTest(context, testValue); } } } parseNode(esTreeNode: GenericEsTreeNode): void { this.consequentScope = new TrackingScope(this.scope); this.consequent = new (this.context.getNodeConstructor(esTreeNode.consequent.type))( esTreeNode.consequent, this, this.consequentScope ); if (esTreeNode.alternate) { this.alternateScope = new TrackingScope(this.scope); this.alternate = new (this.context.getNodeConstructor(esTreeNode.alternate.type))( esTreeNode.alternate, this, this.alternateScope ); } super.parseNode(esTreeNode); } render(code: MagicString, options: RenderOptions): void { const { snippets: { getPropertyAccess } } = options; // Note that unknown test values are always included const testValue = this.getTestValue(); const hoistedDeclarations: Identifier[] = []; const includesIfElse = this.test.included; const noTreeshake = !this.context.options.treeshake; if (includesIfElse) { this.test.render(code, options); } else { code.remove(this.start, this.consequent.start); } if (this.consequent.included && (noTreeshake || typeof testValue === 'symbol' || testValue)) { this.consequent.render(code, options); } else { code.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : ''); hoistedDeclarations.push(...this.consequentScope.hoistedDeclarations); } if (this.alternate) { if (this.alternate.included && (noTreeshake || typeof testValue === 'symbol' || !testValue)) { if (includesIfElse) { if (code.original.charCodeAt(this.alternate.start - 1) === 101) { code.prependLeft(this.alternate.start, ' '); } } else { code.remove(this.consequent.end, this.alternate.start); } this.alternate.render(code, options); } else { if (includesIfElse && this.shouldKeepAlternateBranch()) { code.overwrite(this.alternate.start, this.end, ';'); } else { code.remove(this.consequent.end, this.end); } hoistedDeclarations.push(...this.alternateScope!.hoistedDeclarations); } } this.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess); } protected applyDeoptimizations() {} private getTestValue(): LiteralValueOrUnknown { if (this.testValue === unset) { return (this.testValue = this.test.getLiteralValueAtPath( EMPTY_PATH, SHARED_RECURSION_TRACKER, this )); } return this.testValue; } private includeKnownTest(context: InclusionContext, testValue: LiteralValueOrUnknown) { if (this.test.shouldBeIncluded(context)) { this.test.include(context, false); } if (testValue && this.consequent.shouldBeIncluded(context)) { this.consequent.include(context, false, { asSingleStatement: true }); } if (!testValue && this.alternate?.shouldBeIncluded(context)) { this.alternate.include(context, false, { asSingleStatement: true }); } } private includeRecursively( includeChildrenRecursively: true | 'variables', context: InclusionContext ) { this.test.include(context, includeChildrenRecursively); this.consequent.include(context, includeChildrenRecursively); this.alternate?.include(context, includeChildrenRecursively); } private includeUnknownTest(context: InclusionContext) { this.test.include(context, false); const { brokenFlow } = context; let consequentBrokenFlow = false; if (this.consequent.shouldBeIncluded(context)) { this.consequent.include(context, false, { asSingleStatement: true }); // eslint-disable-next-line unicorn/consistent-destructuring consequentBrokenFlow = context.brokenFlow; context.brokenFlow = brokenFlow; } if (this.alternate?.shouldBeIncluded(context)) { this.alternate.include(context, false, { asSingleStatement: true }); // eslint-disable-next-line unicorn/consistent-destructuring context.brokenFlow = context.brokenFlow && consequentBrokenFlow; } } private renderHoistedDeclarations( hoistedDeclarations: readonly Identifier[], code: MagicString, getPropertyAccess: (name: string) => string ) { const hoistedVariables = [ ...new Set( hoistedDeclarations.map(identifier => { const variable = identifier.variable!; return variable.included ? variable.getName(getPropertyAccess) : ''; }) ) ] .filter(Boolean) .join(', '); if (hoistedVariables) { const parentType = this.parent.type; const needsBraces = parentType !== NodeType.Program && parentType !== NodeType.BlockStatement; code.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVariables}; `); if (needsBraces) { code.appendLeft(this.end, ` }`); } } } private shouldKeepAlternateBranch() { let currentParent = this.parent; do { if (currentParent instanceof IfStatement && currentParent.alternate) { return true; } if (currentParent instanceof BlockStatement) { return false; } currentParent = (currentParent as any).parent; } while (currentParent); return false; } } rollup-3.29.4/src/ast/nodes/ImportAttribute.ts000066400000000000000000000005331450520414700213250ustar00rootroot00000000000000import type Identifier from './Identifier'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ImportAttribute extends NodeBase { declare key: Identifier | Literal; declare type: NodeType.tImportAttribute; declare value: Literal; } rollup-3.29.4/src/ast/nodes/ImportDeclaration.ts000066400000000000000000000023161450520414700216100ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type ImportAttribute from './ImportAttribute'; import type ImportDefaultSpecifier from './ImportDefaultSpecifier'; import type ImportNamespaceSpecifier from './ImportNamespaceSpecifier'; import type ImportSpecifier from './ImportSpecifier'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ImportDeclaration extends NodeBase { declare assertions?: ImportAttribute[]; declare needsBoundaries: true; declare source: Literal; declare specifiers: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[]; declare type: NodeType.tImportDeclaration; // Do not bind specifiers or assertions bind(): void {} hasEffects(): boolean { return false; } initialise(): void { this.context.addImport(this); } render(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { code.remove(nodeRenderOptions!.start!, nodeRenderOptions!.end!); } protected applyDeoptimizations() {} } ImportDeclaration.prototype.needsBoundaries = true; rollup-3.29.4/src/ast/nodes/ImportDefaultSpecifier.ts000066400000000000000000000004701450520414700226000ustar00rootroot00000000000000import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ImportDefaultSpecifier extends NodeBase { declare local: Identifier; declare type: NodeType.tImportDefaultSpecifier; protected applyDeoptimizations() {} } rollup-3.29.4/src/ast/nodes/ImportExpression.ts000066400000000000000000000277411450520414700215330ustar00rootroot00000000000000import type MagicString from 'magic-string'; import ExternalModule from '../../ExternalModule'; import type Module from '../../Module'; import type { GetInterop, NormalizedOutputOptions } from '../../rollup/types'; import type { PluginDriver } from '../../utils/PluginDriver'; import { EMPTY_ARRAY } from '../../utils/blank'; import type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets'; import { INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, namespaceInteropHelpersByInteropType } from '../../utils/interopHelpers'; import { findFirstOccurrenceOutsideComment, type RenderOptions } from '../../utils/renderHelpers'; import type { InclusionContext } from '../ExecutionContext'; import type ChildScope from '../scopes/ChildScope'; import type NamespaceVariable from '../variables/NamespaceVariable'; import ArrowFunctionExpression from './ArrowFunctionExpression'; import AwaitExpression from './AwaitExpression'; import CallExpression from './CallExpression'; import ExpressionStatement from './ExpressionStatement'; import FunctionExpression from './FunctionExpression'; import Identifier from './Identifier'; import MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import type ObjectExpression from './ObjectExpression'; import ObjectPattern from './ObjectPattern'; import VariableDeclarator from './VariableDeclarator'; import { type ExpressionNode, type GenericEsTreeNode, type IncludeChildren, NodeBase } from './shared/Node'; interface DynamicImportMechanism { left: string; right: string; } // TODO once ImportExpression follows official ESTree specs with "null" as // default, keys.ts should be updated export default class ImportExpression extends NodeBase { declare arguments: ObjectExpression[] | undefined; inlineNamespace: NamespaceVariable | null = null; declare source: ExpressionNode; declare type: NodeType.tImportExpression; private assertions: string | null | true = null; private mechanism: DynamicImportMechanism | null = null; private namespaceExportName: string | false | undefined = undefined; private resolution: Module | ExternalModule | string | null = null; private resolutionString: string | null = null; // Do not bind assertions bind(): void { this.source.bind(); } /** * Get imported variables for deterministic usage, valid cases are: * * - `const { foo } = await import('bar')`. * - `(await import('bar')).foo` * - `import('bar').then(({ foo }) => {})` * * Returns empty array if it's side-effect only import. * Returns undefined if it's not fully deterministic. */ getDeterministicImportedNames(): readonly string[] | undefined { const parent1 = this.parent; // Side-effect only: import('bar') if (parent1 instanceof ExpressionStatement) { return EMPTY_ARRAY; } if (parent1 instanceof AwaitExpression) { const parent2 = parent1.parent; // Side-effect only: await import('bar') if (parent2 instanceof ExpressionStatement) { return EMPTY_ARRAY; } // Case 1: const { foo } = await import('bar') if (parent2 instanceof VariableDeclarator) { const declaration = parent2.id; return declaration instanceof ObjectPattern ? getDeterministicObjectDestructure(declaration) : undefined; } // Case 2: (await import('bar')).foo if (parent2 instanceof MemberExpression) { const id = parent2.property; if (!parent2.computed && id instanceof Identifier) { return [id.name]; } } return; } // Case 3: import('bar').then(({ foo }) => {}) if (parent1 instanceof MemberExpression) { const callExpression = parent1.parent; const property = parent1.property; if (!(callExpression instanceof CallExpression) || !(property instanceof Identifier)) { return; } const memberName = property.name; // side-effect only, when only chaining .catch or .finally if ( callExpression.parent instanceof ExpressionStatement && ['catch', 'finally'].includes(memberName) ) { return EMPTY_ARRAY; } if (memberName !== 'then') return; // Side-effect only: import('bar').then() if (callExpression.arguments.length === 0) { return EMPTY_ARRAY; } const argument = callExpression.arguments[0]; if ( callExpression.arguments.length !== 1 || !(argument instanceof ArrowFunctionExpression || argument instanceof FunctionExpression) ) { return; } // Side-effect only: import('bar').then(() => {}) if (argument.params.length === 0) { return EMPTY_ARRAY; } const declaration = argument.params[0]; if (argument.params.length === 1 && declaration instanceof ObjectPattern) { return getDeterministicObjectDestructure(declaration); } return; } } hasEffects(): boolean { return true; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!this.included) { this.included = true; this.context.includeDynamicImport(this); this.scope.addAccessedDynamicImport(this); } this.source.include(context, includeChildrenRecursively); } initialise(): void { this.context.addDynamicImport(this); } parseNode(esTreeNode: GenericEsTreeNode): void { // Keep the source AST to be used by renderDynamicImport super.parseNode(esTreeNode, ['source']); } render(code: MagicString, options: RenderOptions): void { const { snippets: { _, getDirectReturnFunction, getObject, getPropertyAccess } } = options; if (this.inlineNamespace) { const [left, right] = getDirectReturnFunction([], { functionReturn: true, lineBreakIndent: null, name: null }); code.overwrite( this.start, this.end, `Promise.resolve().then(${left}${this.inlineNamespace.getName(getPropertyAccess)}${right})` ); return; } if (this.mechanism) { code.overwrite( this.start, findFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1, this.mechanism.left ); code.overwrite(this.end - 1, this.end, this.mechanism.right); } if (this.resolutionString) { code.overwrite(this.source.start, this.source.end, this.resolutionString); if (this.namespaceExportName) { const [left, right] = getDirectReturnFunction(['n'], { functionReturn: true, lineBreakIndent: null, name: null }); code.prependLeft(this.end, `.then(${left}n.${this.namespaceExportName}${right})`); } } else { this.source.render(code, options); } if (this.assertions !== true) { if (this.arguments) { code.overwrite(this.source.end, this.end - 1, '', { contentOnly: true }); } if (this.assertions) { code.appendLeft( this.end - 1, `,${_}${getObject([['assert', this.assertions]], { lineBreakIndent: null })}` ); } } } setExternalResolution( exportMode: 'none' | 'named' | 'default' | 'external', resolution: Module | ExternalModule | string | null, options: NormalizedOutputOptions, snippets: GenerateCodeSnippets, pluginDriver: PluginDriver, accessedGlobalsByScope: Map>, resolutionString: string, namespaceExportName: string | false | undefined, assertions: string | null | true ): void { const { format } = options; this.inlineNamespace = null; this.resolution = resolution; this.resolutionString = resolutionString; this.namespaceExportName = namespaceExportName; this.assertions = assertions; const accessedGlobals = [...(accessedImportGlobals[format] || [])]; let helper: string | null; ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper( resolution, exportMode, options, snippets, pluginDriver )); if (helper) { accessedGlobals.push(helper); } if (accessedGlobals.length > 0) { this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); } } setInternalResolution(inlineNamespace: NamespaceVariable): void { this.inlineNamespace = inlineNamespace; } protected applyDeoptimizations() {} private getDynamicImportMechanismAndHelper( resolution: Module | ExternalModule | string | null, exportMode: 'none' | 'named' | 'default' | 'external', { compact, dynamicImportFunction, dynamicImportInCjs, format, generatedCode: { arrowFunctions }, interop }: NormalizedOutputOptions, { _, getDirectReturnFunction, getDirectReturnIifeLeft }: GenerateCodeSnippets, pluginDriver: PluginDriver ): { helper: string | null; mechanism: DynamicImportMechanism | null } { const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [ { customResolution: typeof this.resolution === 'string' ? this.resolution : null, format, moduleId: this.context.module.id, targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null } ]); if (mechanism) { return { helper: null, mechanism }; } const hasDynamicTarget = !this.resolution || typeof this.resolution === 'string'; switch (format) { case 'cjs': { if ( dynamicImportInCjs && (!resolution || typeof resolution === 'string' || resolution instanceof ExternalModule) ) { return { helper: null, mechanism: null }; } const helper = getInteropHelper(resolution, exportMode, interop); let left = `require(`; let right = `)`; if (helper) { left = `/*#__PURE__*/${helper}(${left}`; right += ')'; } const [functionLeft, functionRight] = getDirectReturnFunction([], { functionReturn: true, lineBreakIndent: null, name: null }); left = `Promise.resolve().then(${functionLeft}${left}`; right += `${functionRight})`; if (!arrowFunctions && hasDynamicTarget) { left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { needsArrowReturnParens: false, needsWrappedFunction: true }); right = ')'; } return { helper, mechanism: { left, right } }; } case 'amd': { const resolve = compact ? 'c' : 'resolve'; const reject = compact ? 'e' : 'reject'; const helper = getInteropHelper(resolution, exportMode, interop); const [resolveLeft, resolveRight] = getDirectReturnFunction(['m'], { functionReturn: false, lineBreakIndent: null, name: null }); const resolveNamespace = helper ? `${resolveLeft}${resolve}(/*#__PURE__*/${helper}(m))${resolveRight}` : resolve; const [handlerLeft, handlerRight] = getDirectReturnFunction([resolve, reject], { functionReturn: false, lineBreakIndent: null, name: null }); let left = `new Promise(${handlerLeft}require([`; let right = `],${_}${resolveNamespace},${_}${reject})${handlerRight})`; if (!arrowFunctions && hasDynamicTarget) { left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { needsArrowReturnParens: false, needsWrappedFunction: true }); right = ')'; } return { helper, mechanism: { left, right } }; } case 'system': { return { helper: null, mechanism: { left: 'module.import(', right: ')' } }; } case 'es': { if (dynamicImportFunction) { return { helper: null, mechanism: { left: `${dynamicImportFunction}(`, right: ')' } }; } } } return { helper: null, mechanism: null }; } } function getInteropHelper( resolution: Module | ExternalModule | string | null, exportMode: 'none' | 'named' | 'default' | 'external', interop: GetInterop ): string | null { return exportMode === 'external' ? namespaceInteropHelpersByInteropType[ interop(resolution instanceof ExternalModule ? resolution.id : null) ] : exportMode === 'default' ? INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE : null; } const accessedImportGlobals: Record = { amd: ['require'], cjs: ['require'], system: ['module'] }; function getDeterministicObjectDestructure(objectPattern: ObjectPattern): string[] | undefined { const variables: string[] = []; for (const property of objectPattern.properties) { if (property.type === 'RestElement' || property.computed || property.key.type !== 'Identifier') return; variables.push((property.key as Identifier).name); } return variables; } rollup-3.29.4/src/ast/nodes/ImportNamespaceSpecifier.ts000066400000000000000000000004741450520414700231140ustar00rootroot00000000000000import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ImportNamespaceSpecifier extends NodeBase { declare local: Identifier; declare type: NodeType.tImportNamespaceSpecifier; protected applyDeoptimizations() {} } rollup-3.29.4/src/ast/nodes/ImportSpecifier.ts000066400000000000000000000006011450520414700212670ustar00rootroot00000000000000import type Identifier from './Identifier'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ImportSpecifier extends NodeBase { declare imported: Identifier | Literal; declare local: Identifier; declare type: NodeType.tImportSpecifier; protected applyDeoptimizations() {} } rollup-3.29.4/src/ast/nodes/LabeledStatement.ts000066400000000000000000000033271450520414700214100ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { findFirstOccurrenceOutsideComment, findNonWhiteSpace, type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; import { type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; export default class LabeledStatement extends StatementBase { declare body: StatementNode; declare label: Identifier; declare type: NodeType.tLabeledStatement; hasEffects(context: HasEffectsContext): boolean { const brokenFlow = context.brokenFlow; context.ignore.labels.add(this.label.name); if (this.body.hasEffects(context)) return true; context.ignore.labels.delete(this.label.name); if (context.includedLabels.has(this.label.name)) { context.includedLabels.delete(this.label.name); context.brokenFlow = brokenFlow; } return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; const brokenFlow = context.brokenFlow; this.body.include(context, includeChildrenRecursively); if (includeChildrenRecursively || context.includedLabels.has(this.label.name)) { this.label.include(); context.includedLabels.delete(this.label.name); context.brokenFlow = brokenFlow; } } render(code: MagicString, options: RenderOptions): void { if (this.label.included) { this.label.render(code, options); } else { code.remove( this.start, findNonWhiteSpace( code.original, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1 ) ); } this.body.render(code, options); } } rollup-3.29.4/src/ast/nodes/Literal.ts000066400000000000000000000054121450520414700175640ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_ASSIGNED, INTERACTION_CALLED } from '../NodeInteractions'; import type { ObjectPath } from '../utils/PathTracker'; import { getLiteralMembersForValue, getMemberReturnExpressionWhenCalled, hasMemberEffectWhenCalled, type MemberDescription } from '../values'; import type * as NodeType from './NodeType'; import { type ExpressionEntity, type LiteralValueOrUnknown, UNKNOWN_RETURN_EXPRESSION, UnknownValue } from './shared/Expression'; import { type GenericEsTreeNode, NodeBase } from './shared/Node'; export type LiteralValue = string | boolean | null | number | RegExp | undefined; export default class Literal extends NodeBase { declare regex?: { flags: string; pattern: string; }; declare type: NodeType.tLiteral; declare value: T; private declare members: { [key: string]: MemberDescription }; deoptimizeArgumentsOnInteractionAtPath(): void {} getLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown { if ( path.length > 0 || // unknown literals can also be null but do not start with an "n" (this.value === null && this.context.code.charCodeAt(this.start) !== 110) || typeof this.value === 'bigint' || // to support shims for regular expressions this.context.code.charCodeAt(this.start) === 47 ) { return UnknownValue; } return this.value; } getReturnExpressionWhenCalledAtPath( path: ObjectPath ): [expression: ExpressionEntity, isPure: boolean] { if (path.length !== 1) return UNKNOWN_RETURN_EXPRESSION; return getMemberReturnExpressionWhenCalled(this.members, path[0]); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { switch (interaction.type) { case INTERACTION_ACCESSED: { return path.length > (this.value === null ? 0 : 1); } case INTERACTION_ASSIGNED: { return true; } case INTERACTION_CALLED: { if ( this.included && this.value instanceof RegExp && (this.value.global || this.value.sticky) ) { return true; } return ( path.length !== 1 || hasMemberEffectWhenCalled(this.members, path[0], interaction, context) ); } } } initialise(): void { this.members = getLiteralMembersForValue(this.value); } parseNode(esTreeNode: GenericEsTreeNode): void { this.value = esTreeNode.value; this.regex = esTreeNode.regex; super.parseNode(esTreeNode); } render(code: MagicString): void { if (typeof this.value === 'string') { (code.indentExclusionRanges as [number, number][]).push([this.start + 1, this.end - 1]); } } } rollup-3.29.4/src/ast/nodes/LogicalExpression.ts000066400000000000000000000145551450520414700216320ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK, EMPTY_ARRAY } from '../../utils/blank'; import { findFirstOccurrenceOutsideComment, findNonWhiteSpace, type NodeRenderOptions, removeLineBreaks, type RenderOptions } from '../../utils/renderHelpers'; import { removeAnnotations } from '../../utils/treeshakeNode'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, type PathTracker, SHARED_RECURSION_TRACKER, UNKNOWN_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import { type ExpressionEntity, type LiteralValueOrUnknown, UnknownValue } from './shared/Expression'; import { MultiExpression } from './shared/MultiExpression'; import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node'; export type LogicalOperator = '||' | '&&' | '??'; export default class LogicalExpression extends NodeBase implements DeoptimizableEntity { declare left: ExpressionNode; declare operator: LogicalOperator; declare right: ExpressionNode; declare type: NodeType.tLogicalExpression; // We collect deoptimization information if usedBranch !== null private expressionsToBeDeoptimized: DeoptimizableEntity[] = []; private isBranchResolutionAnalysed = false; private usedBranch: ExpressionNode | null = null; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.left.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); this.right.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } deoptimizeCache(): void { if (this.usedBranch) { const unusedBranch = this.usedBranch === this.left ? this.right : this.left; this.usedBranch = null; unusedBranch.deoptimizePath(UNKNOWN_PATH); const { context, expressionsToBeDeoptimized } = this; this.expressionsToBeDeoptimized = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } // Request another pass because we need to ensure "include" runs again if // it is rendered context.requestTreeshakingPass(); } } deoptimizePath(path: ObjectPath): void { const usedBranch = this.getUsedBranch(); if (usedBranch) { usedBranch.deoptimizePath(path); } else { this.left.deoptimizePath(path); this.right.deoptimizePath(path); } } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { const usedBranch = this.getUsedBranch(); if (!usedBranch) return UnknownValue; this.expressionsToBeDeoptimized.push(origin); return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { const usedBranch = this.getUsedBranch(); if (!usedBranch) return [ new MultiExpression([ this.left.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin )[0], this.right.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin )[0] ]), false ]; this.expressionsToBeDeoptimized.push(origin); return usedBranch.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); } hasEffects(context: HasEffectsContext): boolean { if (this.left.hasEffects(context)) { return true; } if (this.getUsedBranch() !== this.left) { return this.right.hasEffects(context); } return false; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { const usedBranch = this.getUsedBranch(); if (!usedBranch) { return ( this.left.hasEffectsOnInteractionAtPath(path, interaction, context) || this.right.hasEffectsOnInteractionAtPath(path, interaction, context) ); } return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; const usedBranch = this.getUsedBranch(); if ( includeChildrenRecursively || (usedBranch === this.right && this.left.shouldBeIncluded(context)) || !usedBranch ) { this.left.include(context, includeChildrenRecursively); this.right.include(context, includeChildrenRecursively); } else { usedBranch.include(context, includeChildrenRecursively); } } render( code: MagicString, options: RenderOptions, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { if (!this.left.included || !this.right.included) { const operatorPos = findFirstOccurrenceOutsideComment( code.original, this.operator, this.left.end ); if (this.right.included) { const removePos = findNonWhiteSpace(code.original, operatorPos + 2); code.remove(this.start, removePos); if (preventASI) { removeLineBreaks(code, removePos, this.right.start); } } else { code.remove(operatorPos, this.end); } removeAnnotations(this, code); this.getUsedBranch()!.render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType: renderedParentType || this.parent.type, renderedSurroundingElement: renderedSurroundingElement || this.parent.type }); } else { this.left.render(code, options, { preventASI, renderedSurroundingElement }); this.right.render(code, options); } } private getUsedBranch() { if (!this.isBranchResolutionAnalysed) { this.isBranchResolutionAnalysed = true; const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); if (typeof leftValue === 'symbol') { return null; } else { this.usedBranch = (this.operator === '||' && leftValue) || (this.operator === '&&' && !leftValue) || (this.operator === '??' && leftValue != null) ? this.left : this.right; } } return this.usedBranch; } } rollup-3.29.4/src/ast/nodes/MemberExpression.ts000066400000000000000000000332761450520414700214700ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { AstContext } from '../../Module'; import type { NormalizedTreeshakingOptions } from '../../rollup/types'; import { BLANK, EMPTY_ARRAY } from '../../utils/blank'; import { LOGLEVEL_WARN } from '../../utils/logging'; import { logIllegalImportReassignment, logMissingExport } from '../../utils/logs'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionAccessed, NodeInteractionAssigned, NodeInteractionCalled } from '../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_ASSIGNED } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, type ObjectPathKey, type PathTracker, SHARED_RECURSION_TRACKER, SymbolToStringTag, UNKNOWN_PATH, UnknownKey, UnknownNonAccessorKey } from '../utils/PathTracker'; import { UNDEFINED_EXPRESSION } from '../values'; import ExternalVariable from '../variables/ExternalVariable'; import type NamespaceVariable from '../variables/NamespaceVariable'; import type Variable from '../variables/Variable'; import Identifier from './Identifier'; import Literal from './Literal'; import type * as NodeType from './NodeType'; import type PrivateIdentifier from './PrivateIdentifier'; import type SpreadElement from './SpreadElement'; import type Super from './Super'; import { deoptimizeInteraction, type ExpressionEntity, type LiteralValueOrUnknown, UNKNOWN_RETURN_EXPRESSION, UnknownValue } from './shared/Expression'; import type { ChainElement, ExpressionNode, IncludeChildren } from './shared/Node'; import { NodeBase } from './shared/Node'; // To avoid infinite recursions const MAX_PATH_DEPTH = 7; function getResolvablePropertyKey(memberExpression: MemberExpression): string | null { return memberExpression.computed ? getResolvableComputedPropertyKey(memberExpression.property) : (memberExpression.property as Identifier).name; } function getResolvableComputedPropertyKey(propertyKey: ExpressionNode): string | null { if (propertyKey instanceof Literal) { return String(propertyKey.value); } return null; } type PathWithPositions = { key: string; pos: number }[]; function getPathIfNotComputed(memberExpression: MemberExpression): PathWithPositions | null { const nextPathKey = memberExpression.propertyKey; const object = memberExpression.object; if (typeof nextPathKey === 'string') { if (object instanceof Identifier) { return [ { key: object.name, pos: object.start }, { key: nextPathKey, pos: memberExpression.property.start } ]; } if (object instanceof MemberExpression) { const parentPath = getPathIfNotComputed(object); return ( parentPath && [...parentPath, { key: nextPathKey, pos: memberExpression.property.start }] ); } } return null; } function getStringFromPath(path: PathWithPositions): string { let pathString = path[0].key; for (let index = 1; index < path.length; index++) { pathString += '.' + path[index].key; } return pathString; } export default class MemberExpression extends NodeBase implements DeoptimizableEntity, ChainElement { declare computed: boolean; declare object: ExpressionNode | Super; declare optional: boolean; declare property: ExpressionNode | PrivateIdentifier; declare propertyKey: ObjectPathKey | null; declare type: NodeType.tMemberExpression; variable: Variable | null = null; protected declare assignmentInteraction: NodeInteractionAssigned; private declare accessInteraction: NodeInteractionAccessed; private assignmentDeoptimized = false; private bound = false; private expressionsToBeDeoptimized: DeoptimizableEntity[] = []; private isUndefined = false; bind(): void { this.bound = true; const path = getPathIfNotComputed(this); const baseVariable = path && this.scope.findVariable(path[0].key); if (baseVariable?.isNamespace) { const resolvedVariable = resolveNamespaceVariables( baseVariable, path!.slice(1), this.context ); if (!resolvedVariable) { super.bind(); } else if (resolvedVariable === 'undefined') { this.isUndefined = true; } else { this.variable = resolvedVariable; this.scope.addNamespaceMemberAccess(getStringFromPath(path!), resolvedVariable); } } else { super.bind(); } } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { if (this.variable) { this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } else if (!this.isUndefined) { if (path.length < MAX_PATH_DEPTH) { this.object.deoptimizeArgumentsOnInteractionAtPath( interaction, [this.getPropertyKey(), ...path], recursionTracker ); } else { deoptimizeInteraction(interaction); } } } deoptimizeCache(): void { const { expressionsToBeDeoptimized, object } = this; this.expressionsToBeDeoptimized = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; this.propertyKey = UnknownKey; object.deoptimizePath(UNKNOWN_PATH); for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } } deoptimizePath(path: ObjectPath): void { if (path.length === 0) this.disallowNamespaceReassignment(); if (this.variable) { this.variable.deoptimizePath(path); } else if (!this.isUndefined && path.length < MAX_PATH_DEPTH) { const propertyKey = this.getPropertyKey(); this.object.deoptimizePath([ propertyKey === UnknownKey ? UnknownNonAccessorKey : propertyKey, ...path ]); } } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (this.variable) { return this.variable.getLiteralValueAtPath(path, recursionTracker, origin); } if (this.isUndefined) { return undefined; } if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { this.expressionsToBeDeoptimized.push(origin); return this.object.getLiteralValueAtPath( [this.getPropertyKey(), ...path], recursionTracker, origin ); } return UnknownValue; } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { if (this.variable) { return this.variable.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); } if (this.isUndefined) { return [UNDEFINED_EXPRESSION, false]; } if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { this.expressionsToBeDeoptimized.push(origin); return this.object.getReturnExpressionWhenCalledAtPath( [this.getPropertyKey(), ...path], interaction, recursionTracker, origin ); } return UNKNOWN_RETURN_EXPRESSION; } hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); return ( this.property.hasEffects(context) || this.object.hasEffects(context) || this.hasAccessEffect(context) ); } hasEffectsAsAssignmentTarget(context: HasEffectsContext, checkAccess: boolean): boolean { if (checkAccess && !this.deoptimized) this.applyDeoptimizations(); if (!this.assignmentDeoptimized) this.applyAssignmentDeoptimization(); return ( this.property.hasEffects(context) || this.object.hasEffects(context) || (checkAccess && this.hasAccessEffect(context)) || this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context) ); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (this.variable) { return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); } if (this.isUndefined) { return true; } if (path.length < MAX_PATH_DEPTH) { return this.object.hasEffectsOnInteractionAtPath( [this.getPropertyKey(), ...path], interaction, context ); } return true; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!this.deoptimized) this.applyDeoptimizations(); this.includeProperties(context, includeChildrenRecursively); } includeAsAssignmentTarget( context: InclusionContext, includeChildrenRecursively: IncludeChildren, deoptimizeAccess: boolean ): void { if (!this.assignmentDeoptimized) this.applyAssignmentDeoptimization(); if (deoptimizeAccess) { this.include(context, includeChildrenRecursively); } else { this.includeProperties(context, includeChildrenRecursively); } } includeCallArguments( context: InclusionContext, parameters: readonly (ExpressionEntity | SpreadElement)[] ): void { if (this.variable) { this.variable.includeCallArguments(context, parameters); } else { super.includeCallArguments(context, parameters); } } initialise(): void { this.propertyKey = getResolvablePropertyKey(this); this.accessInteraction = { args: [this.object], type: INTERACTION_ACCESSED }; } isSkippedAsOptional(origin: DeoptimizableEntity): boolean { return ( !this.variable && !this.isUndefined && ((this.object as ExpressionNode).isSkippedAsOptional?.(origin) || (this.optional && this.object.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, origin) == null)) ); } render( code: MagicString, options: RenderOptions, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { if (this.variable || this.isUndefined) { const { snippets: { getPropertyAccess } } = options; let replacement = this.variable ? this.variable.getName(getPropertyAccess) : 'undefined'; if (renderedParentType && isCalleeOfRenderedParent) replacement = '0, ' + replacement; code.overwrite(this.start, this.end, replacement!, { contentOnly: true, storeName: true }); } else { if (renderedParentType && isCalleeOfRenderedParent) { code.appendRight(this.start, '0, '); } this.object.render(code, options, { renderedSurroundingElement }); this.property.render(code, options); } } setAssignedValue(value: ExpressionEntity) { this.assignmentInteraction = { args: [this.object, value], type: INTERACTION_ASSIGNED }; } protected applyDeoptimizations(): void { this.deoptimized = true; const { propertyReadSideEffects } = this.context.options .treeshake as NormalizedTreeshakingOptions; if ( // Namespaces are not bound and should not be deoptimized this.bound && propertyReadSideEffects && !(this.variable || this.isUndefined) ) { const propertyKey = this.getPropertyKey(); this.object.deoptimizeArgumentsOnInteractionAtPath( this.accessInteraction, [propertyKey], SHARED_RECURSION_TRACKER ); this.context.requestTreeshakingPass(); } } private applyAssignmentDeoptimization(): void { this.assignmentDeoptimized = true; const { propertyReadSideEffects } = this.context.options .treeshake as NormalizedTreeshakingOptions; if ( // Namespaces are not bound and should not be deoptimized this.bound && propertyReadSideEffects && !(this.variable || this.isUndefined) ) { this.object.deoptimizeArgumentsOnInteractionAtPath( this.assignmentInteraction, [this.getPropertyKey()], SHARED_RECURSION_TRACKER ); this.context.requestTreeshakingPass(); } } private disallowNamespaceReassignment() { if (this.object instanceof Identifier) { const variable = this.scope.findVariable(this.object.name); if (variable.isNamespace) { if (this.variable) { this.context.includeVariableInModule(this.variable); } this.context.log( LOGLEVEL_WARN, logIllegalImportReassignment(this.object.name, this.context.module.id), this.start ); } } } private getPropertyKey(): ObjectPathKey { if (this.propertyKey === null) { this.propertyKey = UnknownKey; const value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); return (this.propertyKey = value === SymbolToStringTag ? value : typeof value === 'symbol' ? UnknownKey : String(value)); } return this.propertyKey; } private hasAccessEffect(context: HasEffectsContext) { const { propertyReadSideEffects } = this.context.options .treeshake as NormalizedTreeshakingOptions; return ( !(this.variable || this.isUndefined) && propertyReadSideEffects && (propertyReadSideEffects === 'always' || this.object.hasEffectsOnInteractionAtPath( [this.getPropertyKey()], this.accessInteraction, context )) ); } private includeProperties( context: InclusionContext, includeChildrenRecursively: IncludeChildren ) { if (!this.included) { this.included = true; if (this.variable) { this.context.includeVariableInModule(this.variable); } } this.object.include(context, includeChildrenRecursively); this.property.include(context, includeChildrenRecursively); } } function resolveNamespaceVariables( baseVariable: Variable, path: PathWithPositions, astContext: AstContext ): Variable | 'undefined' | null { if (path.length === 0) return baseVariable; if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable) return null; const exportName = path[0].key; const variable = (baseVariable as NamespaceVariable).context.traceExport(exportName); if (!variable) { if (path.length === 1) { const fileName = (baseVariable as NamespaceVariable).context.fileName; astContext.log( LOGLEVEL_WARN, logMissingExport(exportName, astContext.module.id, fileName), path[0].pos ); return 'undefined'; } return null; } return resolveNamespaceVariables(variable, path.slice(1), astContext); } rollup-3.29.4/src/ast/nodes/MetaProperty.ts000066400000000000000000000167441450520414700206350ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { InternalModuleFormat } from '../../rollup/types'; import type { PluginDriver } from '../../utils/PluginDriver'; import { escapeId } from '../../utils/escapeId'; import type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets'; import { DOCUMENT_CURRENT_SCRIPT } from '../../utils/interopHelpers'; import { dirname, normalize, relative } from '../../utils/path'; import type { RenderOptions } from '../../utils/renderHelpers'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import type ChildScope from '../scopes/ChildScope'; import type { ObjectPath } from '../utils/PathTracker'; import type Identifier from './Identifier'; import MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; const FILE_PREFIX = 'ROLLUP_FILE_URL_'; const IMPORT = 'import'; export default class MetaProperty extends NodeBase { declare meta: Identifier; declare property: Identifier; declare type: NodeType.tMetaProperty; private metaProperty: string | null = null; private preliminaryChunkId: string | null = null; private referenceId: string | null = null; getReferencedFileName(outputPluginDriver: PluginDriver): string | null { const { meta: { name }, metaProperty } = this; if (name === IMPORT && metaProperty?.startsWith(FILE_PREFIX)) { return outputPluginDriver.getFileName(metaProperty.slice(FILE_PREFIX.length)); } return null; } hasEffects(): boolean { return false; } hasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean { return path.length > 1 || type !== INTERACTION_ACCESSED; } include(): void { if (!this.included) { this.included = true; if (this.meta.name === IMPORT) { this.context.addImportMeta(this); const parent = this.parent; const metaProperty = (this.metaProperty = parent instanceof MemberExpression && typeof parent.propertyKey === 'string' ? parent.propertyKey : null); if (metaProperty?.startsWith(FILE_PREFIX)) { this.referenceId = metaProperty.slice(FILE_PREFIX.length); } } } } render(code: MagicString, renderOptions: RenderOptions): void { const { format, pluginDriver, snippets } = renderOptions; const { context: { module }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this; const { id: moduleId } = module; if (name !== IMPORT) return; const chunkId = preliminaryChunkId!; if (referenceId) { const fileName = pluginDriver.getFileName(referenceId); const relativePath = normalize(relative(dirname(chunkId), fileName)); const replacement = pluginDriver.hookFirstSync('resolveFileUrl', [ { chunkId, fileName, format, moduleId, referenceId, relativePath } ]) || relativeUrlMechanisms[format](relativePath); code.overwrite( (parent as MemberExpression).start, (parent as MemberExpression).end, replacement, { contentOnly: true } ); return; } let replacement = pluginDriver.hookFirstSync('resolveImportMeta', [ metaProperty, { chunkId, format, moduleId } ]); if (!replacement) { replacement = importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets }); renderOptions.accessedDocumentCurrentScript ||= formatsMaybeAccessDocumentCurrentScript.includes(format) && replacement !== 'undefined'; } if (typeof replacement === 'string') { if (parent instanceof MemberExpression) { code.overwrite(parent.start, parent.end, replacement, { contentOnly: true }); } else { code.overwrite(start, end, replacement, { contentOnly: true }); } } } setResolution( format: InternalModuleFormat, accessedGlobalsByScope: Map>, preliminaryChunkId: string ): void { this.preliminaryChunkId = preliminaryChunkId; const accessedGlobals = ( this.metaProperty?.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals )[format]; if (accessedGlobals.length > 0) { this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); } } } export const formatsMaybeAccessDocumentCurrentScript = ['cjs', 'iife', 'umd']; const accessedMetaUrlGlobals = { amd: ['document', 'module', 'URL'], cjs: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT], es: [], iife: ['document', 'URL', DOCUMENT_CURRENT_SCRIPT], system: ['module'], umd: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT] }; const accessedFileUrlGlobals = { amd: ['document', 'require', 'URL'], cjs: ['document', 'require', 'URL'], es: [], iife: ['document', 'URL'], system: ['module', 'URL'], umd: ['document', 'require', 'URL'] }; const getResolveUrl = (path: string, URL = 'URL') => `new ${URL}(${path}).href`; const getRelativeUrlFromDocument = (relativePath: string, umd = false) => getResolveUrl( `'${escapeId(relativePath)}', ${ umd ? `typeof document === 'undefined' ? location.href : ` : '' }document.currentScript && document.currentScript.src || document.baseURI` ); const getGenericImportMetaMechanism = (getUrl: (chunkId: string) => string) => (property: string | null, { chunkId }: { chunkId: string }) => { const urlMechanism = getUrl(chunkId); return property === null ? `({ url: ${urlMechanism} })` : property === 'url' ? urlMechanism : 'undefined'; }; const getFileUrlFromFullPath = (path: string) => `require('u' + 'rl').pathToFileURL(${path}).href`; const getFileUrlFromRelativePath = (path: string) => getFileUrlFromFullPath(`__dirname + '/${path}'`); const getUrlFromDocument = (chunkId: string, umd = false) => `${ umd ? `typeof document === 'undefined' ? location.href : ` : '' }(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId( chunkId )}', document.baseURI).href)`; const relativeUrlMechanisms: Record string> = { amd: relativePath => { if (relativePath[0] !== '.') relativePath = './' + relativePath; return getResolveUrl(`require.toUrl('${relativePath}'), document.baseURI`); }, cjs: relativePath => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath( relativePath )} : ${getRelativeUrlFromDocument(relativePath)})`, es: relativePath => getResolveUrl(`'${relativePath}', import.meta.url`), iife: relativePath => getRelativeUrlFromDocument(relativePath), system: relativePath => getResolveUrl(`'${relativePath}', module.meta.url`), umd: relativePath => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath( relativePath )} : ${getRelativeUrlFromDocument(relativePath, true)})` }; const importMetaMechanisms: Record< string, (property: string | null, options: { chunkId: string; snippets: GenerateCodeSnippets }) => string > = { amd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)), cjs: getGenericImportMetaMechanism( chunkId => `(typeof document === 'undefined' ? ${getFileUrlFromFullPath( '__filename' )} : ${getUrlFromDocument(chunkId)})` ), iife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)), system: (property, { snippets: { getPropertyAccess } }) => property === null ? `module.meta` : `module.meta${getPropertyAccess(property)}`, umd: getGenericImportMetaMechanism( chunkId => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromFullPath( '__filename' )} : ${getUrlFromDocument(chunkId, true)})` ) }; rollup-3.29.4/src/ast/nodes/MethodDefinition.ts000066400000000000000000000010761450520414700214230ustar00rootroot00000000000000import type FunctionExpression from './FunctionExpression'; import type * as NodeType from './NodeType'; import type PrivateIdentifier from './PrivateIdentifier'; import MethodBase from './shared/MethodBase'; import type { ExpressionNode } from './shared/Node'; export default class MethodDefinition extends MethodBase { declare key: ExpressionNode | PrivateIdentifier; declare kind: 'constructor' | 'method' | 'get' | 'set'; declare static: boolean; declare type: NodeType.tMethodDefinition; declare value: FunctionExpression; protected applyDeoptimizations() {} } rollup-3.29.4/src/ast/nodes/NewExpression.ts000066400000000000000000000044761450520414700210120ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { renderCallArguments } from '../../utils/renderCallArguments'; import type { RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_CALLED } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, SHARED_RECURSION_TRACKER } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; import { NodeBase } from './shared/Node'; export default class NewExpression extends NodeBase { declare arguments: ExpressionNode[]; declare callee: ExpressionNode; declare type: NodeType.tNewExpression; private declare interaction: NodeInteractionCalled; hasEffects(context: HasEffectsContext): boolean { try { for (const argument of this.arguments) { if (argument.hasEffects(context)) return true; } if (this.annotationPure) { return false; } return ( this.callee.hasEffects(context) || this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context) ); } finally { if (!this.deoptimized) this.applyDeoptimizations(); } } hasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean { return path.length > 0 || type !== INTERACTION_ACCESSED; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!this.deoptimized) this.applyDeoptimizations(); if (includeChildrenRecursively) { super.include(context, includeChildrenRecursively); } else { this.included = true; this.callee.include(context, false); } this.callee.includeCallArguments(context, this.arguments); } initialise(): void { this.interaction = { args: [null, ...this.arguments], type: INTERACTION_CALLED, withNew: true }; } render(code: MagicString, options: RenderOptions) { this.callee.render(code, options); renderCallArguments(code, options, this); } protected applyDeoptimizations(): void { this.deoptimized = true; this.callee.deoptimizeArgumentsOnInteractionAtPath( this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER ); this.context.requestTreeshakingPass(); } } rollup-3.29.4/src/ast/nodes/NodeType.ts000066400000000000000000000203361450520414700177210ustar00rootroot00000000000000export type tArrayExpression = 'ArrayExpression'; export type tArrayPattern = 'ArrayPattern'; export type tArrowFunctionExpression = 'ArrowFunctionExpression'; export type tAssignmentExpression = 'AssignmentExpression'; export type tAssignmentPattern = 'AssignmentPattern'; export type tAwaitExpression = 'AwaitExpression'; export type tBinaryExpression = 'BinaryExpression'; export type tBlockStatement = 'BlockStatement'; export type tBreakStatement = 'BreakStatement'; export type tCallExpression = 'CallExpression'; export type tCatchClause = 'CatchClause'; export type tChainExpression = 'ChainExpression'; export type tClassBody = 'ClassBody'; export type tClassDeclaration = 'ClassDeclaration'; export type tClassExpression = 'ClassExpression'; export type tConditionalExpression = 'ConditionalExpression'; export type tContinueStatement = 'ContinueStatement'; export type tDoWhileStatement = 'DoWhileStatement'; export type tEmptyStatement = 'EmptyStatement'; export type tExportAllDeclaration = 'ExportAllDeclaration'; export type tExportDefaultDeclaration = 'ExportDefaultDeclaration'; export type tExportNamedDeclaration = 'ExportNamedDeclaration'; export type tExportSpecifier = 'ExportSpecifier'; export type tExpressionStatement = 'ExpressionStatement'; export type tForStatement = 'ForStatement'; export type tForInStatement = 'ForInStatement'; export type tForOfStatement = 'ForOfStatement'; export type tFunctionDeclaration = 'FunctionDeclaration'; export type tFunctionExpression = 'FunctionExpression'; export type tIdentifier = 'Identifier'; export type tIfStatement = 'IfStatement'; export type tImport = 'Import'; export type tImportAttribute = 'ImportAttribute'; export type tImportDeclaration = 'ImportDeclaration'; export type tImportExpression = 'ImportExpression'; export type tImportDefaultSpecifier = 'ImportDefaultSpecifier'; export type tImportNamespaceSpecifier = 'ImportNamespaceSpecifier'; export type tImportSpecifier = 'ImportSpecifier'; export type tLabeledStatement = 'LabeledStatement'; export type tLiteral = 'Literal'; export type tLogicalExpression = 'LogicalExpression'; export type tMemberExpression = 'MemberExpression'; export type tMetaProperty = 'MetaProperty'; export type tMethodDefinition = 'MethodDefinition'; export type tNewExpression = 'NewExpression'; export type tObjectExpression = 'ObjectExpression'; export type tObjectPattern = 'ObjectPattern'; export type tPrivateIdentifier = 'PrivateIdentifier'; export type tProgram = 'Program'; export type tProperty = 'Property'; export type tPropertyDefinition = 'PropertyDefinition'; export type tRestElement = 'RestElement'; export type tReturnStatement = 'ReturnStatement'; export type tSequenceExpression = 'SequenceExpression'; export type tSpreadElement = 'SpreadElement'; export type tStaticBlock = 'StaticBlock'; export type tSuper = 'Super'; export type tSwitchCase = 'SwitchCase'; export type tSwitchStatement = 'SwitchStatement'; export type tTaggedTemplateExpression = 'TaggedTemplateExpression'; export type tTemplateElement = 'TemplateElement'; export type tTemplateLiteral = 'TemplateLiteral'; export type tThisExpression = 'ThisExpression'; export type tThrowStatement = 'ThrowStatement'; export type tTryStatement = 'TryStatement'; export type tUnaryExpression = 'UnaryExpression'; export type tUpdateExpression = 'UpdateExpression'; export type tVariableDeclarator = 'VariableDeclarator'; export type tVariableDeclaration = 'VariableDeclaration'; export type tWhileStatement = 'WhileStatement'; export type tYieldExpression = 'YieldExpression'; export const ArrayExpression: tArrayExpression = 'ArrayExpression'; export const ArrayPattern: tArrayPattern = 'ArrayPattern'; export const ArrowFunctionExpression: tArrowFunctionExpression = 'ArrowFunctionExpression'; export const AssignmentExpression: tAssignmentExpression = 'AssignmentExpression'; export const AssignmentPattern: tAssignmentPattern = 'AssignmentPattern'; export const AwaitExpression: tAwaitExpression = 'AwaitExpression'; export const BinaryExpression: tBinaryExpression = 'BinaryExpression'; export const BlockStatement: tBlockStatement = 'BlockStatement'; export const BreakStatement: tBreakStatement = 'BreakStatement'; export const CallExpression: tCallExpression = 'CallExpression'; export const CatchClause: tCatchClause = 'CatchClause'; export const ChainExpression: tChainExpression = 'ChainExpression'; export const ClassBody: tClassBody = 'ClassBody'; export const ClassDeclaration: tClassDeclaration = 'ClassDeclaration'; export const ClassExpression: tClassExpression = 'ClassExpression'; export const ConditionalExpression: tConditionalExpression = 'ConditionalExpression'; export const ContinueStatement: tContinueStatement = 'ContinueStatement'; export const DoWhileStatement: tDoWhileStatement = 'DoWhileStatement'; export const EmptyStatement: tEmptyStatement = 'EmptyStatement'; export const ExportAllDeclaration: tExportAllDeclaration = 'ExportAllDeclaration'; export const ExportDefaultDeclaration: tExportDefaultDeclaration = 'ExportDefaultDeclaration'; export const ExportNamedDeclaration: tExportNamedDeclaration = 'ExportNamedDeclaration'; export const ExportSpecifier: tExportSpecifier = 'ExportSpecifier'; export const ExpressionStatement: tExpressionStatement = 'ExpressionStatement'; export const ForStatement: tForStatement = 'ForStatement'; export const ForInStatement: tForInStatement = 'ForInStatement'; export const ForOfStatement: tForOfStatement = 'ForOfStatement'; export const FunctionDeclaration: tFunctionDeclaration = 'FunctionDeclaration'; export const FunctionExpression: tFunctionExpression = 'FunctionExpression'; export const Identifier: tIdentifier = 'Identifier'; export const IfStatement: tIfStatement = 'IfStatement'; export const Import: tImport = 'Import'; export const ImportAttribute: tImportAttribute = 'ImportAttribute'; export const ImportDeclaration: tImportDeclaration = 'ImportDeclaration'; export const ImportExpression: tImportExpression = 'ImportExpression'; export const ImportDefaultSpecifier: tImportDefaultSpecifier = 'ImportDefaultSpecifier'; export const ImportNamespaceSpecifier: tImportNamespaceSpecifier = 'ImportNamespaceSpecifier'; export const ImportSpecifier: tImportSpecifier = 'ImportSpecifier'; export const LabeledStatement: tLabeledStatement = 'LabeledStatement'; export const Literal: tLiteral = 'Literal'; export const LogicalExpression: tLogicalExpression = 'LogicalExpression'; export const MemberExpression: tMemberExpression = 'MemberExpression'; export const MetaProperty: tMetaProperty = 'MetaProperty'; export const MethodDefinition: tMethodDefinition = 'MethodDefinition'; export const NewExpression: tNewExpression = 'NewExpression'; export const ObjectExpression: tObjectExpression = 'ObjectExpression'; export const ObjectPattern: tObjectPattern = 'ObjectPattern'; export const PrivateIdentifier: tPrivateIdentifier = 'PrivateIdentifier'; export const Program: tProgram = 'Program'; export const Property: tProperty = 'Property'; export const PropertyDefinition: tPropertyDefinition = 'PropertyDefinition'; export const RestElement: tRestElement = 'RestElement'; export const ReturnStatement: tReturnStatement = 'ReturnStatement'; export const SequenceExpression: tSequenceExpression = 'SequenceExpression'; export const SpreadElement: tSpreadElement = 'SpreadElement'; export const StaticBlock: tStaticBlock = 'StaticBlock'; export const Super: tSuper = 'Super'; export const SwitchCase: tSwitchCase = 'SwitchCase'; export const SwitchStatement: tSwitchStatement = 'SwitchStatement'; export const TaggedTemplateExpression: tTaggedTemplateExpression = 'TaggedTemplateExpression'; export const TemplateElement: tTemplateElement = 'TemplateElement'; export const TemplateLiteral: tTemplateLiteral = 'TemplateLiteral'; export const ThisExpression: tThisExpression = 'ThisExpression'; export const ThrowStatement: tThrowStatement = 'ThrowStatement'; export const TryStatement: tTryStatement = 'TryStatement'; export const UnaryExpression: tUnaryExpression = 'UnaryExpression'; export const UpdateExpression: tUpdateExpression = 'UpdateExpression'; export const VariableDeclarator: tVariableDeclarator = 'VariableDeclarator'; export const VariableDeclaration: tVariableDeclaration = 'VariableDeclaration'; export const WhileStatement: tWhileStatement = 'WhileStatement'; export const YieldExpression: tYieldExpression = 'YieldExpression'; rollup-3.29.4/src/ast/nodes/ObjectExpression.ts000066400000000000000000000100021450520414700214450ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, type PathTracker, SHARED_RECURSION_TRACKER, UnknownKey } from '../utils/PathTracker'; import Identifier from './Identifier'; import Literal from './Literal'; import * as NodeType from './NodeType'; import type Property from './Property'; import SpreadElement from './SpreadElement'; import { type ExpressionEntity, type LiteralValueOrUnknown } from './shared/Expression'; import { NodeBase } from './shared/Node'; import { ObjectEntity, type ObjectProperty } from './shared/ObjectEntity'; import { OBJECT_PROTOTYPE } from './shared/ObjectPrototype'; export default class ObjectExpression extends NodeBase implements DeoptimizableEntity { declare properties: readonly (Property | SpreadElement)[]; declare type: NodeType.tObjectExpression; private objectEntity: ObjectEntity | null = null; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath( interaction, path, recursionTracker ); } deoptimizeCache(): void { this.getObjectEntity().deoptimizeAllProperties(); } deoptimizePath(path: ObjectPath): void { this.getObjectEntity().deoptimizePath(path); } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.getObjectEntity().getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); } render( code: MagicString, options: RenderOptions, { renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { super.render(code, options); if ( renderedSurroundingElement === NodeType.ExpressionStatement || renderedSurroundingElement === NodeType.ArrowFunctionExpression ) { code.appendRight(this.start, '('); code.prependLeft(this.end, ')'); } } protected applyDeoptimizations() {} private getObjectEntity(): ObjectEntity { if (this.objectEntity !== null) { return this.objectEntity; } let prototype: ExpressionEntity | null = OBJECT_PROTOTYPE; const properties: ObjectProperty[] = []; for (const property of this.properties) { if (property instanceof SpreadElement) { properties.push({ key: UnknownKey, kind: 'init', property }); continue; } let key: string; if (property.computed) { const keyValue = property.key.getLiteralValueAtPath( EMPTY_PATH, SHARED_RECURSION_TRACKER, this ); if (typeof keyValue === 'symbol') { properties.push({ key: UnknownKey, kind: property.kind, property }); continue; } else { key = String(keyValue); } } else { key = property.key instanceof Identifier ? property.key.name : String((property.key as Literal).value); if (key === '__proto__' && property.kind === 'init') { prototype = property.value instanceof Literal && property.value.value === null ? null : property.value; continue; } } properties.push({ key, kind: property.kind, property }); } return (this.objectEntity = new ObjectEntity(properties, prototype)); } } rollup-3.29.4/src/ast/nodes/ObjectPattern.ts000066400000000000000000000041271450520414700207360ustar00rootroot00000000000000import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteractionAssigned } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import * as NodeType from './NodeType'; import type Property from './Property'; import type RestElement from './RestElement'; import type { ExpressionEntity } from './shared/Expression'; import { NodeBase } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; export default class ObjectPattern extends NodeBase implements PatternNode { declare properties: readonly (Property | RestElement)[]; declare type: NodeType.tObjectPattern; addExportedVariables( variables: readonly Variable[], exportNamesByVariable: ReadonlyMap ): void { for (const property of this.properties) { if (property.type === NodeType.Property) { (property.value as unknown as PatternNode).addExportedVariables( variables, exportNamesByVariable ); } else { property.argument.addExportedVariables(variables, exportNamesByVariable); } } } declare(kind: string, init: ExpressionEntity): LocalVariable[] { const variables: LocalVariable[] = []; for (const property of this.properties) { variables.push(...property.declare(kind, init)); } return variables; } deoptimizePath(path: ObjectPath): void { if (path.length === 0) { for (const property of this.properties) { property.deoptimizePath(path); } } } hasEffectsOnInteractionAtPath( // At the moment, this is only triggered for assignment left-hand sides, // where the path is empty _path: ObjectPath, interaction: NodeInteractionAssigned, context: HasEffectsContext ): boolean { for (const property of this.properties) { if (property.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) return true; } return false; } markDeclarationReached(): void { for (const property of this.properties) { property.markDeclarationReached(); } } } rollup-3.29.4/src/ast/nodes/PrivateIdentifier.ts000066400000000000000000000003271450520414700216050ustar00rootroot00000000000000import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class PrivateIdentifier extends NodeBase { declare name: string; declare type: NodeType.tPrivateIdentifier; } rollup-3.29.4/src/ast/nodes/Program.ts000066400000000000000000000050531450520414700176000ustar00rootroot00000000000000import { locate } from 'locate-character'; import type MagicString from 'magic-string'; import { LOGLEVEL_INFO } from '../../utils/logging'; import { logFirstSideEffect } from '../../utils/logs'; import { findFirstLineBreakOutsideComment, type RenderOptions, renderStatementList } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import { createHasEffectsContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; import { type IncludeChildren, NodeBase, type StatementNode } from './shared/Node'; export default class Program extends NodeBase { declare body: readonly StatementNode[]; declare sourceType: 'module'; declare type: NodeType.tProgram; private hasCachedEffect: boolean | null = null; private hasLoggedEffect = false; hasCachedEffects(): boolean { if (!this.included) { return false; } return this.hasCachedEffect === null ? (this.hasCachedEffect = this.hasEffects(createHasEffectsContext())) : this.hasCachedEffect; } hasEffects(context: HasEffectsContext): boolean { for (const node of this.body) { if (node.hasEffects(context)) { if (this.context.options.experimentalLogSideEffects && !this.hasLoggedEffect) { this.hasLoggedEffect = true; const { code, log, module } = this.context; log( LOGLEVEL_INFO, logFirstSideEffect(code, module.id, locate(code, node.start, { offsetLine: 1 })!), node.start ); } return (this.hasCachedEffect = true); } } return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; for (const node of this.body) { if (includeChildrenRecursively || node.shouldBeIncluded(context)) { node.include(context, includeChildrenRecursively); } } } render(code: MagicString, options: RenderOptions): void { let start = this.start; if (code.original.startsWith('#!')) { start = Math.min(code.original.indexOf('\n') + 1, this.end); code.remove(0, start); } if (this.body.length > 0) { // Keep all consecutive lines that start with a comment while (code.original[start] === '/' && /[*/]/.test(code.original[start + 1])) { const firstLineBreak = findFirstLineBreakOutsideComment( code.original.slice(start, this.body[0].start) ); if (firstLineBreak[0] === -1) { break; } start += firstLineBreak[1]; } renderStatementList(this.body, code, start, this.end, options); } else { super.render(code, options); } } protected applyDeoptimizations() {} } rollup-3.29.4/src/ast/nodes/Property.ts000066400000000000000000000037551450520414700200240ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { NormalizedTreeshakingOptions } from '../../rollup/types'; import type { RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext } from '../ExecutionContext'; import { UnknownKey } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import type * as NodeType from './NodeType'; import { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression'; import MethodBase from './shared/MethodBase'; import type { ExpressionNode } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; export default class Property extends MethodBase implements PatternNode { declare key: ExpressionNode; declare kind: 'init' | 'get' | 'set'; declare method: boolean; declare shorthand: boolean; declare type: NodeType.tProperty; private declarationInit: ExpressionEntity | null = null; declare(kind: string, init: ExpressionEntity): LocalVariable[] { this.declarationInit = init; return (this.value as PatternNode).declare(kind, UNKNOWN_EXPRESSION); } hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); const propertyReadSideEffects = (this.context.options.treeshake as NormalizedTreeshakingOptions) .propertyReadSideEffects; return ( (this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') || this.key.hasEffects(context) || this.value.hasEffects(context) ); } markDeclarationReached(): void { (this.value as PatternNode).markDeclarationReached(); } render(code: MagicString, options: RenderOptions): void { if (!this.shorthand) { this.key.render(code, options); } this.value.render(code, options, { isShorthandProperty: this.shorthand }); } protected applyDeoptimizations(): void { this.deoptimized = true; if (this.declarationInit !== null) { this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); this.context.requestTreeshakingPass(); } } } rollup-3.29.4/src/ast/nodes/PropertyDefinition.ts000066400000000000000000000041711450520414700220260ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import type PrivateIdentifier from './PrivateIdentifier'; import { type ExpressionEntity, type LiteralValueOrUnknown, UNKNOWN_RETURN_EXPRESSION, UnknownValue } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; export default class PropertyDefinition extends NodeBase { declare computed: boolean; declare key: ExpressionNode | PrivateIdentifier; declare static: boolean; declare type: NodeType.tPropertyDefinition; declare value: ExpressionNode | null; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.value?.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } deoptimizePath(path: ObjectPath): void { this.value?.deoptimizePath(path); } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.value ? this.value.getLiteralValueAtPath(path, recursionTracker, origin) : UnknownValue; } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.value ? this.value.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) : UNKNOWN_RETURN_EXPRESSION; } hasEffects(context: HasEffectsContext): boolean { return this.key.hasEffects(context) || (this.static && !!this.value?.hasEffects(context)); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { return !this.value || this.value.hasEffectsOnInteractionAtPath(path, interaction, context); } protected applyDeoptimizations() {} } rollup-3.29.4/src/ast/nodes/RestElement.ts000066400000000000000000000033771450520414700204270ustar00rootroot00000000000000import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteractionAssigned } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, UnknownKey } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; import { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression'; import { NodeBase } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; export default class RestElement extends NodeBase implements PatternNode { declare argument: PatternNode; declare type: NodeType.tRestElement; private declarationInit: ExpressionEntity | null = null; addExportedVariables( variables: readonly Variable[], exportNamesByVariable: ReadonlyMap ): void { this.argument.addExportedVariables(variables, exportNamesByVariable); } declare(kind: string, init: ExpressionEntity): LocalVariable[] { this.declarationInit = init; return this.argument.declare(kind, UNKNOWN_EXPRESSION); } deoptimizePath(path: ObjectPath): void { path.length === 0 && this.argument.deoptimizePath(EMPTY_PATH); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteractionAssigned, context: HasEffectsContext ): boolean { return ( path.length > 0 || this.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context) ); } markDeclarationReached(): void { this.argument.markDeclarationReached(); } protected applyDeoptimizations(): void { this.deoptimized = true; if (this.declarationInit !== null) { this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); this.context.requestTreeshakingPass(); } } } rollup-3.29.4/src/ast/nodes/ReturnStatement.ts000066400000000000000000000024221450520414700213320ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import { type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node'; export default class ReturnStatement extends StatementBase { declare argument: ExpressionNode | null; declare type: NodeType.tReturnStatement; hasEffects(context: HasEffectsContext): boolean { if (!context.ignore.returnYield || this.argument?.hasEffects(context)) return true; context.brokenFlow = true; return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; this.argument?.include(context, includeChildrenRecursively); context.brokenFlow = true; } initialise(): void { this.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION); } render(code: MagicString, options: RenderOptions): void { if (this.argument) { this.argument.render(code, options, { preventASI: true }); if (this.argument.start === this.start + 6 /* 'return'.length */) { code.prependLeft(this.start + 6, ' '); } } } } rollup-3.29.4/src/ast/nodes/SequenceExpression.ts000066400000000000000000000070701450520414700220220ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import { getCommaSeparatedNodesWithBoundaries, type NodeRenderOptions, removeLineBreaks, type RenderOptions } from '../../utils/renderHelpers'; import { treeshakeNode } from '../../utils/treeshakeNode'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import ExpressionStatement from './ExpressionStatement'; import type * as NodeType from './NodeType'; import type { LiteralValueOrUnknown } from './shared/Expression'; import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node'; export default class SequenceExpression extends NodeBase { declare expressions: ExpressionNode[]; declare type: NodeType.tSequenceExpression; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.expressions[this.expressions.length - 1].deoptimizeArgumentsOnInteractionAtPath( interaction, path, recursionTracker ); } deoptimizePath(path: ObjectPath): void { this.expressions[this.expressions.length - 1].deoptimizePath(path); } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.expressions[this.expressions.length - 1].getLiteralValueAtPath( path, recursionTracker, origin ); } hasEffects(context: HasEffectsContext): boolean { for (const expression of this.expressions) { if (expression.hasEffects(context)) return true; } return false; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { return this.expressions[this.expressions.length - 1].hasEffectsOnInteractionAtPath( path, interaction, context ); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; const lastExpression = this.expressions[this.expressions.length - 1]; for (const expression of this.expressions) { if ( includeChildrenRecursively || (expression === lastExpression && !(this.parent instanceof ExpressionStatement)) || expression.shouldBeIncluded(context) ) expression.include(context, includeChildrenRecursively); } } render( code: MagicString, options: RenderOptions, { renderedParentType, isCalleeOfRenderedParent, preventASI }: NodeRenderOptions = BLANK ): void { let includedNodes = 0; let lastSeparatorPos: number | null = null; const lastNode = this.expressions[this.expressions.length - 1]; for (const { node, separator, start, end } of getCommaSeparatedNodesWithBoundaries( this.expressions, code, this.start, this.end )) { if (!node.included) { treeshakeNode(node, code, start, end); continue; } includedNodes++; lastSeparatorPos = separator; if (includedNodes === 1 && preventASI) { removeLineBreaks(code, start, node.start); } if (includedNodes === 1) { const parentType = renderedParentType || this.parent.type; node.render(code, options, { isCalleeOfRenderedParent: isCalleeOfRenderedParent && node === lastNode, renderedParentType: parentType, renderedSurroundingElement: parentType }); } else { node.render(code, options); } } if (lastSeparatorPos) { code.remove(lastSeparatorPos, this.end); } } } rollup-3.29.4/src/ast/nodes/SpreadElement.ts000066400000000000000000000032451450520414700207220ustar00rootroot00000000000000import type { NormalizedTreeshakingOptions } from '../../rollup/types'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { NODE_INTERACTION_UNKNOWN_ACCESS } from '../NodeInteractions'; import { type ObjectPath, type PathTracker, UNKNOWN_PATH, UnknownKey } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import { type ExpressionNode, NodeBase } from './shared/Node'; export default class SpreadElement extends NodeBase { declare argument: ExpressionNode; declare type: NodeType.tSpreadElement; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { if (path.length > 0) { this.argument.deoptimizeArgumentsOnInteractionAtPath( interaction, [UnknownKey, ...path], recursionTracker ); } } hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); const { propertyReadSideEffects } = this.context.options .treeshake as NormalizedTreeshakingOptions; return ( this.argument.hasEffects(context) || (propertyReadSideEffects && (propertyReadSideEffects === 'always' || this.argument.hasEffectsOnInteractionAtPath( UNKNOWN_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context ))) ); } protected applyDeoptimizations(): void { this.deoptimized = true; // Only properties of properties of the argument could become subject to reassignment // This will also reassign the return values of iterators this.argument.deoptimizePath([UnknownKey, UnknownKey]); this.context.requestTreeshakingPass(); } } rollup-3.29.4/src/ast/nodes/StaticBlock.ts000066400000000000000000000027071450520414700203760ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { findFirstOccurrenceOutsideComment, type RenderOptions, renderStatementList } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type Scope from '../scopes/Scope'; import type * as NodeType from './NodeType'; import { type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; export default class StaticBlock extends StatementBase { declare body: readonly StatementNode[]; declare type: NodeType.tStaticBlock; createScope(parentScope: Scope): void { this.scope = new BlockScope(parentScope); } hasEffects(context: HasEffectsContext): boolean { for (const node of this.body) { if (node.hasEffects(context)) return true; } return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; for (const node of this.body) { if (includeChildrenRecursively || node.shouldBeIncluded(context)) node.include(context, includeChildrenRecursively); } } render(code: MagicString, options: RenderOptions): void { if (this.body.length > 0) { const bodyStartPos = findFirstOccurrenceOutsideComment(code.original.slice(this.start, this.end), '{') + 1; renderStatementList(this.body, code, this.start + bodyStartPos, this.end - 1, options); } else { super.render(code, options); } } } rollup-3.29.4/src/ast/nodes/Super.ts000066400000000000000000000015731450520414700172720ustar00rootroot00000000000000import type { NodeInteraction } from '../NodeInteractions'; import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class Super extends NodeBase { declare type: NodeType.tSuper; declare variable: Variable; bind(): void { this.variable = this.scope.findVariable('this'); } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ) { this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } deoptimizePath(path: ObjectPath): void { this.variable.deoptimizePath(path); } include(): void { if (!this.included) { this.included = true; this.context.includeVariableInModule(this.variable); } } } rollup-3.29.4/src/ast/nodes/SwitchCase.ts000066400000000000000000000034461450520414700202320ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { findFirstOccurrenceOutsideComment, type NodeRenderOptions, type RenderOptions, renderStatementList } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; import { type ExpressionNode, type IncludeChildren, NodeBase, type StatementNode } from './shared/Node'; export default class SwitchCase extends NodeBase { declare consequent: readonly StatementNode[]; declare needsBoundaries: true; declare test: ExpressionNode | null; declare type: NodeType.tSwitchCase; hasEffects(context: HasEffectsContext): boolean { if (this.test?.hasEffects(context)) return true; for (const node of this.consequent) { if (context.brokenFlow) break; if (node.hasEffects(context)) return true; } return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; this.test?.include(context, includeChildrenRecursively); for (const node of this.consequent) { if (includeChildrenRecursively || node.shouldBeIncluded(context)) node.include(context, includeChildrenRecursively); } } render(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { if (this.consequent.length > 0) { this.test && this.test.render(code, options); const testEnd = this.test ? this.test.end : findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7; const consequentStart = findFirstOccurrenceOutsideComment(code.original, ':', testEnd) + 1; renderStatementList(this.consequent, code, consequentStart, nodeRenderOptions!.end!, options); } else { super.render(code, options); } } } SwitchCase.prototype.needsBoundaries = true; rollup-3.29.4/src/ast/nodes/SwitchStatement.ts000066400000000000000000000071631450520414700213230ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { type RenderOptions, renderStatementList } from '../../utils/renderHelpers'; import { createHasEffectsContext, type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type ChildScope from '../scopes/ChildScope'; import type Scope from '../scopes/Scope'; import type * as NodeType from './NodeType'; import type SwitchCase from './SwitchCase'; import type { ExpressionNode, GenericEsTreeNode, IncludeChildren } from './shared/Node'; import { StatementBase } from './shared/Node'; export default class SwitchStatement extends StatementBase { declare cases: readonly SwitchCase[]; declare discriminant: ExpressionNode; declare type: NodeType.tSwitchStatement; private declare defaultCase: number | null; private declare parentScope: ChildScope; createScope(parentScope: Scope): void { this.parentScope = parentScope as ChildScope; this.scope = new BlockScope(parentScope); } hasEffects(context: HasEffectsContext): boolean { if (this.discriminant.hasEffects(context)) return true; const { brokenFlow, hasBreak, ignore } = context; const { breaks } = ignore; ignore.breaks = true; context.hasBreak = false; let onlyHasBrokenFlow = true; for (const switchCase of this.cases) { if (switchCase.hasEffects(context)) return true; // eslint-disable-next-line unicorn/consistent-destructuring onlyHasBrokenFlow &&= context.brokenFlow && !context.hasBreak; context.hasBreak = false; context.brokenFlow = brokenFlow; } if (this.defaultCase !== null) { context.brokenFlow = onlyHasBrokenFlow; } ignore.breaks = breaks; context.hasBreak = hasBreak; return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; this.discriminant.include(context, includeChildrenRecursively); const { brokenFlow, hasBreak } = context; context.hasBreak = false; let onlyHasBrokenFlow = true; let isCaseIncluded = includeChildrenRecursively || (this.defaultCase !== null && this.defaultCase < this.cases.length - 1); for (let caseIndex = this.cases.length - 1; caseIndex >= 0; caseIndex--) { const switchCase = this.cases[caseIndex]; if (switchCase.included) { isCaseIncluded = true; } if (!isCaseIncluded) { const hasEffectsContext = createHasEffectsContext(); hasEffectsContext.ignore.breaks = true; isCaseIncluded = switchCase.hasEffects(hasEffectsContext); } if (isCaseIncluded) { switchCase.include(context, includeChildrenRecursively); // eslint-disable-next-line unicorn/consistent-destructuring onlyHasBrokenFlow &&= context.brokenFlow && !context.hasBreak; context.hasBreak = false; context.brokenFlow = brokenFlow; } else { onlyHasBrokenFlow = brokenFlow; } } if (isCaseIncluded && this.defaultCase !== null) { context.brokenFlow = onlyHasBrokenFlow; } context.hasBreak = hasBreak; } initialise(): void { for (let caseIndex = 0; caseIndex < this.cases.length; caseIndex++) { if (this.cases[caseIndex].test === null) { this.defaultCase = caseIndex; return; } } this.defaultCase = null; } parseNode(esTreeNode: GenericEsTreeNode) { this.discriminant = new (this.context.getNodeConstructor(esTreeNode.discriminant.type))( esTreeNode.discriminant, this, this.parentScope ); super.parseNode(esTreeNode); } render(code: MagicString, options: RenderOptions): void { this.discriminant.render(code, options); if (this.cases.length > 0) { renderStatementList(this.cases, code, this.cases[0].start, this.end - 1, options); } } } rollup-3.29.4/src/ast/nodes/TaggedTemplateExpression.ts000066400000000000000000000070111450520414700231340ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { LOGLEVEL_WARN } from '../../utils/logging'; import { logCannotCallNamespace } from '../../utils/logs'; import { type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import { INTERACTION_CALLED } from '../NodeInteractions'; import type { PathTracker } from '../utils/PathTracker'; import { EMPTY_PATH, SHARED_RECURSION_TRACKER } from '../utils/PathTracker'; import type Identifier from './Identifier'; import MemberExpression from './MemberExpression'; import * as NodeType from './NodeType'; import type TemplateLiteral from './TemplateLiteral'; import CallExpressionBase from './shared/CallExpressionBase'; import type { ExpressionEntity } from './shared/Expression'; import { UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION } from './shared/Expression'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; export default class TaggedTemplateExpression extends CallExpressionBase { declare quasi: TemplateLiteral; declare tag: ExpressionNode; declare type: NodeType.tTaggedTemplateExpression; private declare args: ExpressionEntity[]; bind(): void { super.bind(); if (this.tag.type === NodeType.Identifier) { const name = (this.tag as Identifier).name; const variable = this.scope.findVariable(name); if (variable.isNamespace) { this.context.log(LOGLEVEL_WARN, logCannotCallNamespace(name), this.start); } } } hasEffects(context: HasEffectsContext): boolean { try { for (const argument of this.quasi.expressions) { if (argument.hasEffects(context)) return true; } return ( this.tag.hasEffects(context) || this.tag.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context) ); } finally { if (!this.deoptimized) this.applyDeoptimizations(); } } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!this.deoptimized) this.applyDeoptimizations(); if (includeChildrenRecursively) { super.include(context, includeChildrenRecursively); } else { this.included = true; this.tag.include(context, includeChildrenRecursively); this.quasi.include(context, includeChildrenRecursively); } this.tag.includeCallArguments(context, this.args); const [returnExpression] = this.getReturnExpression(); if (!returnExpression.included) { returnExpression.include(context, false); } } initialise(): void { this.args = [UNKNOWN_EXPRESSION, ...this.quasi.expressions]; this.interaction = { args: [ this.tag instanceof MemberExpression && !this.tag.variable ? this.tag.object : null, ...this.args ], type: INTERACTION_CALLED, withNew: false }; } render(code: MagicString, options: RenderOptions): void { this.tag.render(code, options, { isCalleeOfRenderedParent: true }); this.quasi.render(code, options); } protected applyDeoptimizations(): void { this.deoptimized = true; this.tag.deoptimizeArgumentsOnInteractionAtPath( this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER ); this.context.requestTreeshakingPass(); } protected getReturnExpression( recursionTracker: PathTracker = SHARED_RECURSION_TRACKER ): [expression: ExpressionEntity, isPure: boolean] { if (this.returnExpression === null) { this.returnExpression = UNKNOWN_RETURN_EXPRESSION; return (this.returnExpression = this.tag.getReturnExpressionWhenCalledAtPath( EMPTY_PATH, this.interaction, recursionTracker, this )); } return this.returnExpression; } } rollup-3.29.4/src/ast/nodes/TemplateElement.ts000066400000000000000000000010771450520414700212600ustar00rootroot00000000000000import type * as NodeType from './NodeType'; import { type GenericEsTreeNode, NodeBase } from './shared/Node'; export default class TemplateElement extends NodeBase { declare tail: boolean; declare type: NodeType.tTemplateElement; declare value: { cooked: string | null; raw: string; }; // Do not try to bind value bind(): void {} hasEffects(): boolean { return false; } include(): void { this.included = true; } parseNode(esTreeNode: GenericEsTreeNode): void { this.value = esTreeNode.value; super.parseNode(esTreeNode); } render(): void {} } rollup-3.29.4/src/ast/nodes/TemplateLiteral.ts000066400000000000000000000040101450520414700212510ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_CALLED } from '../NodeInteractions'; import type { ObjectPath } from '../utils/PathTracker'; import { getMemberReturnExpressionWhenCalled, hasMemberEffectWhenCalled, literalStringMembers } from '../values'; import type * as NodeType from './NodeType'; import type TemplateElement from './TemplateElement'; import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; import { UNKNOWN_RETURN_EXPRESSION, UnknownValue } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; export default class TemplateLiteral extends NodeBase { declare expressions: ExpressionNode[]; declare quasis: TemplateElement[]; declare type: NodeType.tTemplateLiteral; deoptimizeArgumentsOnInteractionAtPath(): void {} getLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown { if (path.length > 0 || this.quasis.length !== 1) { return UnknownValue; } return this.quasis[0].value.cooked; } getReturnExpressionWhenCalledAtPath( path: ObjectPath ): [expression: ExpressionEntity, isPure: boolean] { if (path.length !== 1) { return UNKNOWN_RETURN_EXPRESSION; } return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (interaction.type === INTERACTION_ACCESSED) { return path.length > 1; } if (interaction.type === INTERACTION_CALLED && path.length === 1) { return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); } return true; } render(code: MagicString, options: RenderOptions): void { (code.indentExclusionRanges as [number, number][]).push([this.start, this.end]); super.render(code, options); } } rollup-3.29.4/src/ast/nodes/ThisExpression.ts000066400000000000000000000037171450520414700211650ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { LOGLEVEL_WARN } from '../../utils/logging'; import { logThisIsUndefined } from '../../utils/logs'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import ModuleScope from '../scopes/ModuleScope'; import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; export default class ThisExpression extends NodeBase { declare type: NodeType.tThisExpression; declare variable: Variable; private declare alias: string | null; bind(): void { this.variable = this.scope.findVariable('this'); } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } deoptimizePath(path: ObjectPath): void { this.variable.deoptimizePath(path); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (path.length === 0) { return interaction.type !== INTERACTION_ACCESSED; } return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); } include(): void { if (!this.included) { this.included = true; this.context.includeVariableInModule(this.variable); } } initialise(): void { this.alias = this.scope.findLexicalBoundary() instanceof ModuleScope ? this.context.moduleContext : null; if (this.alias === 'undefined') { this.context.log(LOGLEVEL_WARN, logThisIsUndefined(), this.start); } } render(code: MagicString): void { if (this.alias !== null) { code.overwrite(this.start, this.end, this.alias, { contentOnly: false, storeName: true }); } } } rollup-3.29.4/src/ast/nodes/ThrowStatement.ts000066400000000000000000000016471450520414700211660ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import { type InclusionContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; import { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node'; export default class ThrowStatement extends StatementBase { declare argument: ExpressionNode; declare type: NodeType.tThrowStatement; hasEffects(): boolean { return true; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; this.argument.include(context, includeChildrenRecursively); context.brokenFlow = true; } render(code: MagicString, options: RenderOptions): void { this.argument.render(code, options, { preventASI: true }); if (this.argument.start === this.start + 5 /* 'throw'.length */) { code.prependLeft(this.start + 5, ' '); } } } rollup-3.29.4/src/ast/nodes/TryStatement.ts000066400000000000000000000036301450520414700206330ustar00rootroot00000000000000import type { NormalizedTreeshakingOptions } from '../../rollup/types'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type BlockStatement from './BlockStatement'; import type CatchClause from './CatchClause'; import type * as NodeType from './NodeType'; import { INCLUDE_PARAMETERS, type IncludeChildren, StatementBase } from './shared/Node'; export default class TryStatement extends StatementBase { declare block: BlockStatement; declare finalizer: BlockStatement | null; declare handler: CatchClause | null; declare type: NodeType.tTryStatement; private directlyIncluded = false; private includedLabelsAfterBlock: string[] | null = null; hasEffects(context: HasEffectsContext): boolean { return ( ((this.context.options.treeshake as NormalizedTreeshakingOptions).tryCatchDeoptimization ? this.block.body.length > 0 : this.block.hasEffects(context)) || !!this.finalizer?.hasEffects(context) ); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { const tryCatchDeoptimization = (this.context.options.treeshake as NormalizedTreeshakingOptions) ?.tryCatchDeoptimization; const { brokenFlow, includedLabels } = context; if (!this.directlyIncluded || !tryCatchDeoptimization) { this.included = true; this.directlyIncluded = true; this.block.include( context, tryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively ); if (includedLabels.size > 0) { this.includedLabelsAfterBlock = [...includedLabels]; } context.brokenFlow = brokenFlow; } else if (this.includedLabelsAfterBlock) { for (const label of this.includedLabelsAfterBlock) { includedLabels.add(label); } } if (this.handler !== null) { this.handler.include(context, includeChildrenRecursively); context.brokenFlow = brokenFlow; } this.finalizer?.include(context, includeChildrenRecursively); } } rollup-3.29.4/src/ast/nodes/UnaryExpression.ts000066400000000000000000000046221450520414700213500ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED, NODE_INTERACTION_UNKNOWN_ASSIGNMENT } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, type PathTracker } from '../utils/PathTracker'; import Identifier from './Identifier'; import type { LiteralValue } from './Literal'; import type * as NodeType from './NodeType'; import { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; const unaryOperators: { [operator: string]: (value: LiteralValue) => LiteralValueOrUnknown; } = { '!': value => !value, '+': value => +(value as NonNullable), '-': value => -(value as NonNullable), delete: () => UnknownValue, typeof: value => typeof value, void: () => undefined, '~': value => ~(value as NonNullable) }; export default class UnaryExpression extends NodeBase { declare argument: ExpressionNode; declare operator: '!' | '+' | '-' | 'delete' | 'typeof' | 'void' | '~'; declare prefix: boolean; declare type: NodeType.tUnaryExpression; getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (path.length > 0) return UnknownValue; const argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); if (typeof argumentValue === 'symbol') return UnknownValue; return unaryOperators[this.operator](argumentValue); } hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); if (this.operator === 'typeof' && this.argument instanceof Identifier) return false; return ( this.argument.hasEffects(context) || (this.operator === 'delete' && this.argument.hasEffectsOnInteractionAtPath( EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context )) ); } hasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean { return type !== INTERACTION_ACCESSED || path.length > (this.operator === 'void' ? 0 : 1); } protected applyDeoptimizations(): void { this.deoptimized = true; if (this.operator === 'delete') { this.argument.deoptimizePath(EMPTY_PATH); this.context.requestTreeshakingPass(); } } } rollup-3.29.4/src/ast/nodes/UnknownNode.ts000066400000000000000000000004311450520414700204310ustar00rootroot00000000000000import type { InclusionContext } from '../ExecutionContext'; import { NodeBase } from './shared/Node'; export default class UnknownNode extends NodeBase { hasEffects(): boolean { return true; } include(context: InclusionContext): void { super.include(context, true); } } rollup-3.29.4/src/ast/nodes/UpdateExpression.ts000066400000000000000000000057071450520414700215010ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import { renderSystemExportExpression, renderSystemExportSequenceAfterExpression, renderSystemExportSequenceBeforeExpression } from '../../utils/systemJsRendering'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionAssigned } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker'; import Identifier from './Identifier'; import * as NodeType from './NodeType'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import { NodeBase } from './shared/Node'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; export default class UpdateExpression extends NodeBase { declare argument: ExpressionNode; declare operator: '++' | '--'; declare prefix: boolean; declare type: NodeType.tUpdateExpression; private declare interaction: NodeInteractionAssigned; hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); return this.argument.hasEffectsAsAssignmentTarget(context, true); } hasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean { return path.length > 1 || type !== INTERACTION_ACCESSED; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) { if (!this.deoptimized) this.applyDeoptimizations(); this.included = true; this.argument.includeAsAssignmentTarget(context, includeChildrenRecursively, true); } initialise() { this.argument.setAssignedValue(UNKNOWN_EXPRESSION); } render(code: MagicString, options: RenderOptions): void { const { exportNamesByVariable, format, snippets: { _ } } = options; this.argument.render(code, options); if (format === 'system') { const variable = this.argument.variable!; const exportNames = exportNamesByVariable.get(variable); if (exportNames) { if (this.prefix) { if (exportNames.length === 1) { renderSystemExportExpression(variable, this.start, this.end, code, options); } else { renderSystemExportSequenceAfterExpression( variable, this.start, this.end, this.parent.type !== NodeType.ExpressionStatement, code, options ); } } else { const operator = this.operator[0]; renderSystemExportSequenceBeforeExpression( variable, this.start, this.end, this.parent.type !== NodeType.ExpressionStatement, code, options, `${_}${operator}${_}1` ); } } } } protected applyDeoptimizations(): void { this.deoptimized = true; this.argument.deoptimizePath(EMPTY_PATH); if (this.argument instanceof Identifier) { const variable = this.scope.findVariable(this.argument.name); variable.isReassigned = true; } this.context.requestTreeshakingPass(); } } rollup-3.29.4/src/ast/nodes/VariableDeclaration.ts000066400000000000000000000177671450520414700221030ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import { isReassignedExportsMember } from '../../utils/reassignedExportsMember'; import { findFirstOccurrenceOutsideComment, findNonWhiteSpace, getCommaSeparatedNodesWithBoundaries, type NodeRenderOptions, type RenderOptions } from '../../utils/renderHelpers'; import { getSystemExportStatement, renderSystemExportExpression } from '../../utils/systemJsRendering'; import type { InclusionContext } from '../ExecutionContext'; import { EMPTY_PATH } from '../utils/PathTracker'; import type Variable from '../variables/Variable'; import ArrayPattern from './ArrayPattern'; import Identifier, { type IdentifierWithVariable } from './Identifier'; import * as NodeType from './NodeType'; import ObjectPattern from './ObjectPattern'; import type VariableDeclarator from './VariableDeclarator'; import type { InclusionOptions } from './shared/Expression'; import { type IncludeChildren, NodeBase } from './shared/Node'; function areAllDeclarationsIncludedAndNotExported( declarations: readonly VariableDeclarator[], exportNamesByVariable: ReadonlyMap ): boolean { for (const declarator of declarations) { if (!declarator.id.included) return false; if (declarator.id.type === NodeType.Identifier) { if (exportNamesByVariable.has(declarator.id.variable!)) return false; } else { const exportedVariables: Variable[] = []; declarator.id.addExportedVariables(exportedVariables, exportNamesByVariable); if (exportedVariables.length > 0) return false; } } return true; } export default class VariableDeclaration extends NodeBase { declare declarations: readonly VariableDeclarator[]; declare kind: 'var' | 'let' | 'const'; declare type: NodeType.tVariableDeclaration; deoptimizePath(): void { for (const declarator of this.declarations) { declarator.deoptimizePath(EMPTY_PATH); } } hasEffectsOnInteractionAtPath(): boolean { return false; } include( context: InclusionContext, includeChildrenRecursively: IncludeChildren, { asSingleStatement }: InclusionOptions = BLANK ): void { this.included = true; for (const declarator of this.declarations) { if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) declarator.include(context, includeChildrenRecursively); const { id, init } = declarator; if (asSingleStatement) { id.include(context, includeChildrenRecursively); } if ( init && id.included && !init.included && (id instanceof ObjectPattern || id instanceof ArrayPattern) ) { init.include(context, includeChildrenRecursively); } } } initialise(): void { for (const declarator of this.declarations) { declarator.declareDeclarator(this.kind); } } render( code: MagicString, options: RenderOptions, nodeRenderOptions: NodeRenderOptions = BLANK ): void { if ( areAllDeclarationsIncludedAndNotExported(this.declarations, options.exportNamesByVariable) ) { for (const declarator of this.declarations) { declarator.render(code, options); } if ( !nodeRenderOptions.isNoStatement && code.original.charCodeAt(this.end - 1) !== 59 /*";"*/ ) { code.appendLeft(this.end, ';'); } } else { this.renderReplacedDeclarations(code, options); } } protected applyDeoptimizations() {} private renderDeclarationEnd( code: MagicString, separatorString: string, lastSeparatorPos: number | null, actualContentEnd: number, renderedContentEnd: number, systemPatternExports: readonly Variable[], options: RenderOptions ): void { if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) { code.remove(this.end - 1, this.end); } separatorString += ';'; if (lastSeparatorPos === null) { code.appendLeft(renderedContentEnd, separatorString); } else { if ( code.original.charCodeAt(actualContentEnd - 1) === 10 /*"\n"*/ && (code.original.charCodeAt(this.end) === 10 /*"\n"*/ || code.original.charCodeAt(this.end) === 13) /*"\r"*/ ) { actualContentEnd--; if (code.original.charCodeAt(actualContentEnd) === 13 /*"\r"*/) { actualContentEnd--; } } if (actualContentEnd === lastSeparatorPos + 1) { code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString); } else { code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString); code.remove(actualContentEnd, renderedContentEnd); } } if (systemPatternExports.length > 0) { code.appendLeft( renderedContentEnd, ` ${getSystemExportStatement(systemPatternExports, options)};` ); } } private renderReplacedDeclarations(code: MagicString, options: RenderOptions): void { const separatedNodes = getCommaSeparatedNodesWithBoundaries( this.declarations, code, this.start + this.kind.length, this.end - (code.original.charCodeAt(this.end - 1) === 59 /*";"*/ ? 1 : 0) ); let actualContentEnd: number | undefined, renderedContentEnd: number; renderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length); let lastSeparatorPos = renderedContentEnd - 1; code.remove(this.start, lastSeparatorPos); let isInDeclaration = false; let hasRenderedContent = false; let separatorString = '', leadingString, nextSeparatorString; const aggregatedSystemExports: Variable[] = []; const singleSystemExport = gatherSystemExportsAndGetSingleExport( separatedNodes, options, aggregatedSystemExports ); for (const { node, start, separator, contentEnd, end } of separatedNodes) { if (!node.included) { code.remove(start, end); continue; } node.render(code, options); leadingString = ''; nextSeparatorString = ''; if ( !node.id.included || (node.id instanceof Identifier && isReassignedExportsMember( (node.id as IdentifierWithVariable).variable, options.exportNamesByVariable )) ) { if (hasRenderedContent) { separatorString += ';'; } isInDeclaration = false; } else { if (singleSystemExport && singleSystemExport === node.id.variable) { const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end); renderSystemExportExpression( singleSystemExport, findNonWhiteSpace(code.original, operatorPos + 1), separator === null ? contentEnd : separator, code, options ); } if (isInDeclaration) { separatorString += ','; } else { if (hasRenderedContent) { separatorString += ';'; } leadingString += `${this.kind} `; isInDeclaration = true; } } if (renderedContentEnd === lastSeparatorPos + 1) { code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString + leadingString); } else { code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString); code.appendLeft(renderedContentEnd, leadingString); } actualContentEnd = contentEnd; renderedContentEnd = end; hasRenderedContent = true; lastSeparatorPos = separator!; separatorString = nextSeparatorString; } this.renderDeclarationEnd( code, separatorString, lastSeparatorPos, actualContentEnd!, renderedContentEnd, aggregatedSystemExports, options ); } } function gatherSystemExportsAndGetSingleExport( separatedNodes: readonly { node: VariableDeclarator; }[], options: RenderOptions, aggregatedSystemExports: Variable[] ): Variable | null { let singleSystemExport: Variable | null = null; if (options.format === 'system') { for (const { node } of separatedNodes) { if ( node.id instanceof Identifier && node.init && aggregatedSystemExports.length === 0 && options.exportNamesByVariable.get(node.id.variable!)?.length === 1 ) { singleSystemExport = node.id.variable!; aggregatedSystemExports.push(singleSystemExport); } else { node.id.addExportedVariables(aggregatedSystemExports, options.exportNamesByVariable); } } if (aggregatedSystemExports.length > 1) { singleSystemExport = null; } else if (singleSystemExport) { aggregatedSystemExports.length = 0; } } return singleSystemExport; } rollup-3.29.4/src/ast/nodes/VariableDeclarator.ts000066400000000000000000000061431450520414700217200ustar00rootroot00000000000000import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import { isReassignedExportsMember } from '../../utils/reassignedExportsMember'; import { findFirstOccurrenceOutsideComment, findNonWhiteSpace, type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { ObjectPath } from '../utils/PathTracker'; import { UNDEFINED_EXPRESSION } from '../values'; import ClassExpression from './ClassExpression'; import Identifier from './Identifier'; import * as NodeType from './NodeType'; import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; export default class VariableDeclarator extends NodeBase { declare id: PatternNode; declare init: ExpressionNode | null; declare type: NodeType.tVariableDeclarator; declareDeclarator(kind: string): void { this.id.declare(kind, this.init || UNDEFINED_EXPRESSION); } deoptimizePath(path: ObjectPath): void { this.id.deoptimizePath(path); } hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); const initEffect = this.init?.hasEffects(context); this.id.markDeclarationReached(); return initEffect || this.id.hasEffects(context); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { const { deoptimized, id, init } = this; if (!deoptimized) this.applyDeoptimizations(); this.included = true; init?.include(context, includeChildrenRecursively); id.markDeclarationReached(); if (includeChildrenRecursively || id.shouldBeIncluded(context)) { id.include(context, includeChildrenRecursively); } } render(code: MagicString, options: RenderOptions): void { const { exportNamesByVariable, snippets: { _, getPropertyAccess } } = options; const { end, id, init, start } = this; const renderId = id.included; if (renderId) { id.render(code, options); } else { const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', id.end); code.remove(start, findNonWhiteSpace(code.original, operatorPos + 1)); } if (init) { if (id instanceof Identifier && init instanceof ClassExpression && !init.id) { const renderedVariable = id.variable!.getName(getPropertyAccess); if (renderedVariable !== id.name) { code.appendLeft(init.start + 5, ` ${id.name}`); } } init.render( code, options, renderId ? BLANK : { renderedSurroundingElement: NodeType.ExpressionStatement } ); } else if ( id instanceof Identifier && isReassignedExportsMember(id.variable!, exportNamesByVariable) ) { code.appendLeft(end, `${_}=${_}void 0`); } } protected applyDeoptimizations() { this.deoptimized = true; const { id, init } = this; if (init && id instanceof Identifier && init instanceof ClassExpression && !init.id) { const { name, variable } = id; for (const accessedVariable of init.scope.accessedOutsideVariables.values()) { if (accessedVariable !== variable) { accessedVariable.forbidName(name); } } } } } rollup-3.29.4/src/ast/nodes/WhileStatement.ts000066400000000000000000000015461450520414700211310ustar00rootroot00000000000000import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; import { type ExpressionNode, type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; export default class WhileStatement extends StatementBase { declare body: StatementNode; declare test: ExpressionNode; declare type: NodeType.tWhileStatement; hasEffects(context: HasEffectsContext): boolean { if (this.test.hasEffects(context)) return true; return hasLoopBodyEffects(context, this.body); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; this.test.include(context, includeChildrenRecursively); includeLoopBody(context, this.body, includeChildrenRecursively); } } rollup-3.29.4/src/ast/nodes/YieldExpression.ts000066400000000000000000000016141450520414700213160ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; import { type ExpressionNode, NodeBase } from './shared/Node'; export default class YieldExpression extends NodeBase { declare argument: ExpressionNode | null; declare delegate: boolean; declare type: NodeType.tYieldExpression; hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); return !(context.ignore.returnYield && !this.argument?.hasEffects(context)); } render(code: MagicString, options: RenderOptions): void { if (this.argument) { this.argument.render(code, options, { preventASI: true }); if (this.argument.start === this.start + 5 /* 'yield'.length */) { code.prependLeft(this.start + 5, ' '); } } } } rollup-3.29.4/src/ast/nodes/index.ts000066400000000000000000000114641450520414700173030ustar00rootroot00000000000000import ArrayExpression from './ArrayExpression'; import ArrayPattern from './ArrayPattern'; import ArrowFunctionExpression from './ArrowFunctionExpression'; import AssignmentExpression from './AssignmentExpression'; import AssignmentPattern from './AssignmentPattern'; import AwaitExpression from './AwaitExpression'; import BinaryExpression from './BinaryExpression'; import BlockStatement from './BlockStatement'; import BreakStatement from './BreakStatement'; import CallExpression from './CallExpression'; import CatchClause from './CatchClause'; import ChainExpression from './ChainExpression'; import ClassBody from './ClassBody'; import ClassDeclaration from './ClassDeclaration'; import ClassExpression from './ClassExpression'; import ConditionalExpression from './ConditionalExpression'; import ContinueStatement from './ContinueStatement'; import DoWhileStatement from './DoWhileStatement'; import EmptyStatement from './EmptyStatement'; import ExportAllDeclaration from './ExportAllDeclaration'; import ExportDefaultDeclaration from './ExportDefaultDeclaration'; import ExportNamedDeclaration from './ExportNamedDeclaration'; import ExportSpecifier from './ExportSpecifier'; import ExpressionStatement from './ExpressionStatement'; import ForInStatement from './ForInStatement'; import ForOfStatement from './ForOfStatement'; import ForStatement from './ForStatement'; import FunctionDeclaration from './FunctionDeclaration'; import FunctionExpression from './FunctionExpression'; import Identifier from './Identifier'; import IfStatement from './IfStatement'; import ImportAttribute from './ImportAttribute'; import ImportDeclaration from './ImportDeclaration'; import ImportDefaultSpecifier from './ImportDefaultSpecifier'; import ImportExpression from './ImportExpression'; import ImportNamespaceSpecifier from './ImportNamespaceSpecifier'; import ImportSpecifier from './ImportSpecifier'; import LabeledStatement from './LabeledStatement'; import Literal from './Literal'; import LogicalExpression from './LogicalExpression'; import MemberExpression from './MemberExpression'; import MetaProperty from './MetaProperty'; import MethodDefinition from './MethodDefinition'; import NewExpression from './NewExpression'; import ObjectExpression from './ObjectExpression'; import ObjectPattern from './ObjectPattern'; import PrivateIdentifier from './PrivateIdentifier'; import Program from './Program'; import Property from './Property'; import PropertyDefinition from './PropertyDefinition'; import RestElement from './RestElement'; import ReturnStatement from './ReturnStatement'; import SequenceExpression from './SequenceExpression'; import SpreadElement from './SpreadElement'; import StaticBlock from './StaticBlock'; import Super from './Super'; import SwitchCase from './SwitchCase'; import SwitchStatement from './SwitchStatement'; import TaggedTemplateExpression from './TaggedTemplateExpression'; import TemplateElement from './TemplateElement'; import TemplateLiteral from './TemplateLiteral'; import ThisExpression from './ThisExpression'; import ThrowStatement from './ThrowStatement'; import TryStatement from './TryStatement'; import UnaryExpression from './UnaryExpression'; import UnknownNode from './UnknownNode'; import UpdateExpression from './UpdateExpression'; import VariableDeclaration from './VariableDeclaration'; import VariableDeclarator from './VariableDeclarator'; import WhileStatement from './WhileStatement'; import YieldExpression from './YieldExpression'; import type { NodeBase } from './shared/Node'; export const nodeConstructors: { [name: string]: typeof NodeBase; } = { ArrayExpression, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentPattern, AwaitExpression, BinaryExpression, BlockStatement, BreakStatement, CallExpression, CatchClause, ChainExpression, ClassBody, ClassDeclaration, ClassExpression, ConditionalExpression, ContinueStatement, DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDefaultDeclaration, ExportNamedDeclaration, ExportSpecifier, ExpressionStatement, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, Identifier, IfStatement, ImportAttribute, ImportDeclaration, ImportDefaultSpecifier, ImportExpression, ImportNamespaceSpecifier, ImportSpecifier, LabeledStatement, Literal, LogicalExpression, MemberExpression, MetaProperty, MethodDefinition, NewExpression, ObjectExpression, ObjectPattern, PrivateIdentifier, Program, Property, PropertyDefinition, RestElement, ReturnStatement, SequenceExpression, SpreadElement, StaticBlock, Super, SwitchCase, SwitchStatement, TaggedTemplateExpression, TemplateElement, TemplateLiteral, ThisExpression, ThrowStatement, TryStatement, UnaryExpression, UnknownNode, UpdateExpression, VariableDeclaration, VariableDeclarator, WhileStatement, YieldExpression }; rollup-3.29.4/src/ast/nodes/shared/000077500000000000000000000000001450520414700170645ustar00rootroot00000000000000rollup-3.29.4/src/ast/nodes/shared/ArrayPrototype.ts000066400000000000000000000113431450520414700224420ustar00rootroot00000000000000import { UnknownInteger } from '../../utils/PathTracker'; import { UNKNOWN_LITERAL_BOOLEAN, UNKNOWN_LITERAL_NUMBER } from '../../values'; import { type ExpressionEntity, UNKNOWN_EXPRESSION } from './Expression'; import { Method, METHOD_RETURNS_BOOLEAN, METHOD_RETURNS_NUMBER, METHOD_RETURNS_STRING, METHOD_RETURNS_UNKNOWN } from './MethodTypes'; import { ObjectEntity, type ObjectProperty, type PropertyMap } from './ObjectEntity'; import { OBJECT_PROTOTYPE } from './ObjectPrototype'; const NEW_ARRAY_PROPERTIES: ObjectProperty[] = [ { key: UnknownInteger, kind: 'init', property: UNKNOWN_EXPRESSION }, { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } ]; const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN: [ExpressionEntity] = [ new Method({ callsArgs: [0], mutatesSelfAsArray: 'deopt-only', returns: null, returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN }) ]; const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER: [ExpressionEntity] = [ new Method({ callsArgs: [0], mutatesSelfAsArray: 'deopt-only', returns: null, returnsPrimitive: UNKNOWN_LITERAL_NUMBER }) ]; const METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY: [ExpressionEntity] = [ new Method({ callsArgs: null, mutatesSelfAsArray: true, returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), returnsPrimitive: null }) ]; const METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY: [ExpressionEntity] = [ new Method({ callsArgs: null, mutatesSelfAsArray: 'deopt-only', returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), returnsPrimitive: null }) ]; const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY: [ExpressionEntity] = [ new Method({ callsArgs: [0], mutatesSelfAsArray: 'deopt-only', returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), returnsPrimitive: null }) ]; const METHOD_MUTATES_SELF_RETURNS_NUMBER: [ExpressionEntity] = [ new Method({ callsArgs: null, mutatesSelfAsArray: true, returns: null, returnsPrimitive: UNKNOWN_LITERAL_NUMBER }) ]; const METHOD_MUTATES_SELF_RETURNS_UNKNOWN: [ExpressionEntity] = [ new Method({ callsArgs: null, mutatesSelfAsArray: true, returns: null, returnsPrimitive: UNKNOWN_EXPRESSION }) ]; const METHOD_DEOPTS_SELF_RETURNS_UNKNOWN: [ExpressionEntity] = [ new Method({ callsArgs: null, mutatesSelfAsArray: 'deopt-only', returns: null, returnsPrimitive: UNKNOWN_EXPRESSION }) ]; const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN: [ExpressionEntity] = [ new Method({ callsArgs: [0], mutatesSelfAsArray: 'deopt-only', returns: null, returnsPrimitive: UNKNOWN_EXPRESSION }) ]; const METHOD_MUTATES_SELF_RETURNS_SELF: [ExpressionEntity] = [ new Method({ callsArgs: null, mutatesSelfAsArray: true, returns: 'self', returnsPrimitive: null }) ]; const METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF: [ExpressionEntity] = [ new Method({ callsArgs: [0], mutatesSelfAsArray: true, returns: 'self', returnsPrimitive: null }) ]; export const ARRAY_PROTOTYPE = new ObjectEntity( { __proto__: null, // We assume that accessors have effects as we do not track the accessed value afterwards at: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN, concat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, copyWithin: METHOD_MUTATES_SELF_RETURNS_SELF, entries: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, every: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, fill: METHOD_MUTATES_SELF_RETURNS_SELF, filter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, find: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, findIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, findLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, findLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, flat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, flatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, forEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, includes: METHOD_RETURNS_BOOLEAN, indexOf: METHOD_RETURNS_NUMBER, join: METHOD_RETURNS_STRING, keys: METHOD_RETURNS_UNKNOWN, lastIndexOf: METHOD_RETURNS_NUMBER, map: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, pop: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, push: METHOD_MUTATES_SELF_RETURNS_NUMBER, reduce: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, reduceRight: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, reverse: METHOD_MUTATES_SELF_RETURNS_SELF, shift: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, slice: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, some: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, sort: METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF, splice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY, toLocaleString: METHOD_RETURNS_STRING, toString: METHOD_RETURNS_STRING, unshift: METHOD_MUTATES_SELF_RETURNS_NUMBER, values: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN } as unknown as PropertyMap, OBJECT_PROTOTYPE, true ); rollup-3.29.4/src/ast/nodes/shared/CallExpressionBase.ts000066400000000000000000000120641450520414700231650ustar00rootroot00000000000000import { EMPTY_ARRAY, EMPTY_SET } from '../../../utils/blank'; import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import { INTERACTION_ASSIGNED, INTERACTION_CALLED } from '../../NodeInteractions'; import { type ObjectPath, type PathTracker, UNKNOWN_PATH } from '../../utils/PathTracker'; import { type ExpressionEntity, type LiteralValueOrUnknown, UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION, UnknownValue } from './Expression'; import { NodeBase } from './Node'; export default abstract class CallExpressionBase extends NodeBase implements DeoptimizableEntity { protected declare interaction: NodeInteractionCalled; protected returnExpression: [expression: ExpressionEntity, isPure: boolean] | null = null; private deoptimizableDependentExpressions: DeoptimizableEntity[] = []; private expressionsToBeDeoptimized = new Set(); deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { const { args } = interaction; const [returnExpression, isPure] = this.getReturnExpression(recursionTracker); if (isPure) return; const deoptimizedExpressions = args.filter( expression => !!expression && expression !== UNKNOWN_EXPRESSION ) as ExpressionEntity[]; if (deoptimizedExpressions.length === 0) return; if (returnExpression === UNKNOWN_EXPRESSION) { for (const expression of deoptimizedExpressions) { expression.deoptimizePath(UNKNOWN_PATH); } } else { recursionTracker.withTrackedEntityAtPath( path, returnExpression, () => { for (const expression of deoptimizedExpressions) { this.expressionsToBeDeoptimized.add(expression); } returnExpression.deoptimizeArgumentsOnInteractionAtPath( interaction, path, recursionTracker ); }, null ); } } deoptimizeCache(): void { if (this.returnExpression?.[0] !== UNKNOWN_EXPRESSION) { this.returnExpression = UNKNOWN_RETURN_EXPRESSION; const { deoptimizableDependentExpressions, expressionsToBeDeoptimized } = this; this.expressionsToBeDeoptimized = EMPTY_SET; this.deoptimizableDependentExpressions = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; for (const expression of deoptimizableDependentExpressions) { expression.deoptimizeCache(); } for (const expression of expressionsToBeDeoptimized) { expression.deoptimizePath(UNKNOWN_PATH); } } } deoptimizePath(path: ObjectPath): void { if ( path.length === 0 || this.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this) ) { return; } const [returnExpression] = this.getReturnExpression(); if (returnExpression !== UNKNOWN_EXPRESSION) { returnExpression.deoptimizePath(path); } } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { const [returnExpression] = this.getReturnExpression(recursionTracker); if (returnExpression === UNKNOWN_EXPRESSION) { return UnknownValue; } return recursionTracker.withTrackedEntityAtPath( path, returnExpression, () => { this.deoptimizableDependentExpressions.push(origin); return returnExpression.getLiteralValueAtPath(path, recursionTracker, origin); }, UnknownValue ); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { const returnExpression = this.getReturnExpression(recursionTracker); if (returnExpression[0] === UNKNOWN_EXPRESSION) { return returnExpression; } return recursionTracker.withTrackedEntityAtPath( path, returnExpression, () => { this.deoptimizableDependentExpressions.push(origin); const [expression, isPure] = returnExpression[0].getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); return [expression, isPure || returnExpression[1]]; }, UNKNOWN_RETURN_EXPRESSION ); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { const { type } = interaction; if (type === INTERACTION_CALLED) { const { args, withNew } = interaction; if ( (withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked( path, args, this ) ) { return false; } } else if ( (type === INTERACTION_ASSIGNED ? context.assigned : context.accessed ).trackEntityAtPathAndGetIfTracked(path, this) ) { return false; } const [returnExpression, isPure] = this.getReturnExpression(); return ( (type === INTERACTION_ASSIGNED || !isPure) && returnExpression.hasEffectsOnInteractionAtPath(path, interaction, context) ); } protected abstract getReturnExpression( recursionTracker?: PathTracker ): [expression: ExpressionEntity, isPure: boolean]; } rollup-3.29.4/src/ast/nodes/shared/ClassNode.ts000066400000000000000000000133611450520414700213130ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import { INTERACTION_CALLED } from '../../NodeInteractions'; import ChildScope from '../../scopes/ChildScope'; import type Scope from '../../scopes/Scope'; import { EMPTY_PATH, type ObjectPath, type PathTracker, SHARED_RECURSION_TRACKER, UNKNOWN_PATH, UnknownKey } from '../../utils/PathTracker'; import type ClassBody from '../ClassBody'; import Identifier from '../Identifier'; import type Literal from '../Literal'; import MethodDefinition from '../MethodDefinition'; import { type ExpressionEntity, type LiteralValueOrUnknown } from './Expression'; import { type ExpressionNode, type IncludeChildren, NodeBase } from './Node'; import { ObjectEntity, type ObjectProperty } from './ObjectEntity'; import { ObjectMember } from './ObjectMember'; import { OBJECT_PROTOTYPE } from './ObjectPrototype'; export default class ClassNode extends NodeBase implements DeoptimizableEntity { declare body: ClassBody; declare id: Identifier | null; declare superClass: ExpressionNode | null; private declare classConstructor: MethodDefinition | null; private objectEntity: ObjectEntity | null = null; createScope(parentScope: Scope): void { this.scope = new ChildScope(parentScope); } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath( interaction, path, recursionTracker ); } deoptimizeCache(): void { this.getObjectEntity().deoptimizeAllProperties(); } deoptimizePath(path: ObjectPath): void { this.getObjectEntity().deoptimizePath(path); } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.getObjectEntity().getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); } hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); const initEffect = this.superClass?.hasEffects(context) || this.body.hasEffects(context); this.id?.markDeclarationReached(); return initEffect || super.hasEffects(context); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { return interaction.type === INTERACTION_CALLED && path.length === 0 ? !interaction.withNew || (this.classConstructor === null ? this.superClass?.hasEffectsOnInteractionAtPath(path, interaction, context) : this.classConstructor.hasEffectsOnInteractionAtPath(path, interaction, context)) || false : this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!this.deoptimized) this.applyDeoptimizations(); this.included = true; this.superClass?.include(context, includeChildrenRecursively); this.body.include(context, includeChildrenRecursively); if (this.id) { this.id.markDeclarationReached(); this.id.include(); } } initialise(): void { this.id?.declare('class', this); for (const method of this.body.body) { if (method instanceof MethodDefinition && method.kind === 'constructor') { this.classConstructor = method; return; } } this.classConstructor = null; } protected applyDeoptimizations(): void { this.deoptimized = true; for (const definition of this.body.body) { if ( !( definition.static || (definition instanceof MethodDefinition && definition.kind === 'constructor') ) ) { // Calls to methods are not tracked, ensure that the return value is deoptimized definition.deoptimizePath(UNKNOWN_PATH); } } this.context.requestTreeshakingPass(); } private getObjectEntity(): ObjectEntity { if (this.objectEntity !== null) { return this.objectEntity; } const staticProperties: ObjectProperty[] = []; const dynamicMethods: ObjectProperty[] = []; for (const definition of this.body.body) { const properties = definition.static ? staticProperties : dynamicMethods; const definitionKind = (definition as MethodDefinition | { kind: undefined }).kind; // Note that class fields do not end up on the prototype if (properties === dynamicMethods && !definitionKind) continue; const kind = definitionKind === 'set' || definitionKind === 'get' ? definitionKind : 'init'; let key: string; if (definition.computed) { const keyValue = definition.key.getLiteralValueAtPath( EMPTY_PATH, SHARED_RECURSION_TRACKER, this ); if (typeof keyValue === 'symbol') { properties.push({ key: UnknownKey, kind, property: definition }); continue; } else { key = String(keyValue); } } else { key = definition.key instanceof Identifier ? definition.key.name : String((definition.key as Literal).value); } properties.push({ key, kind, property: definition }); } staticProperties.unshift({ key: 'prototype', kind: 'init', property: new ObjectEntity( dynamicMethods, this.superClass ? new ObjectMember(this.superClass, 'prototype') : OBJECT_PROTOTYPE ) }); return (this.objectEntity = new ObjectEntity( staticProperties, this.superClass || OBJECT_PROTOTYPE )); } } rollup-3.29.4/src/ast/nodes/shared/Expression.ts000066400000000000000000000055351450520414700216030ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { WritableEntity } from '../../Entity'; import type { HasEffectsContext, InclusionContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import type { ObjectPath, PathTracker, SymbolToStringTag } from '../../utils/PathTracker'; import { UNKNOWN_PATH } from '../../utils/PathTracker'; import type { LiteralValue } from '../Literal'; import type SpreadElement from '../SpreadElement'; import type { IncludeChildren } from './Node'; export const UnknownValue = Symbol('Unknown Value'); export const UnknownTruthyValue = Symbol('Unknown Truthy Value'); export type LiteralValueOrUnknown = | LiteralValue | typeof UnknownValue | typeof UnknownTruthyValue | typeof SymbolToStringTag; export interface InclusionOptions { /** * Include the id of a declarator even if unused to ensure it is a valid * statement. */ asSingleStatement?: boolean; } export class ExpressionEntity implements WritableEntity { included = false; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, _path: ObjectPath, _recursionTracker: PathTracker ): void { deoptimizeInteraction(interaction); } deoptimizePath(_path: ObjectPath): void {} /** * If possible it returns a stringifyable literal value for this node that * can be used for inlining or comparing values. Otherwise, it should return * UnknownValue. */ getLiteralValueAtPath( _path: ObjectPath, _recursionTracker: PathTracker, _origin: DeoptimizableEntity ): LiteralValueOrUnknown { return UnknownValue; } getReturnExpressionWhenCalledAtPath( _path: ObjectPath, _interaction: NodeInteractionCalled, _recursionTracker: PathTracker, _origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return UNKNOWN_RETURN_EXPRESSION; } hasEffectsOnInteractionAtPath( _path: ObjectPath, _interaction: NodeInteraction, _context: HasEffectsContext ): boolean { return true; } include( _context: InclusionContext, _includeChildrenRecursively: IncludeChildren, _options?: InclusionOptions ): void { this.included = true; } includeCallArguments( context: InclusionContext, parameters: readonly (ExpressionEntity | SpreadElement)[] ): void { for (const argument of parameters) { argument.include(context, false); } } shouldBeIncluded(_context: InclusionContext): boolean { return true; } } export const UNKNOWN_EXPRESSION: ExpressionEntity = new (class UnknownExpression extends ExpressionEntity {})(); export const UNKNOWN_RETURN_EXPRESSION: [expression: ExpressionEntity, isPure: boolean] = [ UNKNOWN_EXPRESSION, false ]; export const deoptimizeInteraction = (interaction: NodeInteraction) => { for (const argument of interaction.args) { argument?.deoptimizePath(UNKNOWN_PATH); } }; rollup-3.29.4/src/ast/nodes/shared/FunctionBase.ts000066400000000000000000000146211450520414700220200ustar00rootroot00000000000000import type { NormalizedTreeshakingOptions } from '../../../rollup/types'; import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import { type HasEffectsContext, type InclusionContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import { INTERACTION_CALLED, NODE_INTERACTION_UNKNOWN_ACCESS, NODE_INTERACTION_UNKNOWN_CALL } from '../../NodeInteractions'; import type ReturnValueScope from '../../scopes/ReturnValueScope'; import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; import { UNKNOWN_PATH, UnknownKey } from '../../utils/PathTracker'; import type ParameterVariable from '../../variables/ParameterVariable'; import BlockStatement from '../BlockStatement'; import Identifier from '../Identifier'; import * as NodeType from '../NodeType'; import RestElement from '../RestElement'; import type SpreadElement from '../SpreadElement'; import type { ExpressionEntity, LiteralValueOrUnknown } from './Expression'; import { UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION } from './Expression'; import { type ExpressionNode, type GenericEsTreeNode, type IncludeChildren, NodeBase } from './Node'; import type { ObjectEntity } from './ObjectEntity'; import type { PatternNode } from './Pattern'; export default abstract class FunctionBase extends NodeBase { declare async: boolean; declare body: BlockStatement | ExpressionNode; declare params: readonly PatternNode[]; declare preventChildBlockScope: true; declare scope: ReturnValueScope; protected objectEntity: ObjectEntity | null = null; private deoptimizedReturn = false; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { if (interaction.type === INTERACTION_CALLED) { const { parameters } = this.scope; const { args } = interaction; let hasRest = false; for (let position = 0; position < args.length - 1; position++) { const parameter = this.params[position]; // Only the "this" argument arg[0] can be null const argument = args[position + 1]!; if (hasRest || parameter instanceof RestElement) { hasRest = true; argument.deoptimizePath(UNKNOWN_PATH); } else if (parameter instanceof Identifier) { parameters[position][0].addEntityToBeDeoptimized(argument); this.addArgumentToBeDeoptimized(argument); } else if (parameter) { argument.deoptimizePath(UNKNOWN_PATH); } else { this.addArgumentToBeDeoptimized(argument); } } } else { this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath( interaction, path, recursionTracker ); } } deoptimizePath(path: ObjectPath): void { this.getObjectEntity().deoptimizePath(path); if (path.length === 1 && path[0] === UnknownKey) { // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track // which means the return expression and parameters need to be reassigned this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); for (const parameterList of this.scope.parameters) { for (const parameter of parameterList) { parameter.deoptimizePath(UNKNOWN_PATH); } } } } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { if (path.length > 0) { return this.getObjectEntity().getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); } if (this.async) { if (!this.deoptimizedReturn) { this.deoptimizedReturn = true; this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); this.context.requestTreeshakingPass(); } return UNKNOWN_RETURN_EXPRESSION; } return [this.scope.getReturnExpression(), false]; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (path.length > 0 || interaction.type !== INTERACTION_CALLED) { return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); } if (this.annotationNoSideEffects) { return false; } if (this.async) { const { propertyReadSideEffects } = this.context.options .treeshake as NormalizedTreeshakingOptions; const returnExpression = this.scope.getReturnExpression(); if ( returnExpression.hasEffectsOnInteractionAtPath( ['then'], NODE_INTERACTION_UNKNOWN_CALL, context ) || (propertyReadSideEffects && (propertyReadSideEffects === 'always' || returnExpression.hasEffectsOnInteractionAtPath( ['then'], NODE_INTERACTION_UNKNOWN_ACCESS, context ))) ) { return true; } } for (const parameter of this.params) { if (parameter.hasEffects(context)) return true; } return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { if (!this.deoptimized) this.applyDeoptimizations(); this.included = true; const { brokenFlow } = context; context.brokenFlow = false; this.body.include(context, includeChildrenRecursively); context.brokenFlow = brokenFlow; } includeCallArguments( context: InclusionContext, parameters: readonly (ExpressionEntity | SpreadElement)[] ): void { this.scope.includeCallArguments(context, parameters); } initialise(): void { this.scope.addParameterVariables( this.params.map( parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION) as ParameterVariable[] ), this.params[this.params.length - 1] instanceof RestElement ); if (this.body instanceof BlockStatement) { this.body.addImplicitReturnExpressionToScope(); } else { this.scope.addReturnExpression(this.body); } } parseNode(esTreeNode: GenericEsTreeNode): void { if (esTreeNode.body.type === NodeType.BlockStatement) { this.body = new BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope); } super.parseNode(esTreeNode); } protected addArgumentToBeDeoptimized(_argument: ExpressionEntity) {} protected applyDeoptimizations() {} protected abstract getObjectEntity(): ObjectEntity; } FunctionBase.prototype.preventChildBlockScope = true; rollup-3.29.4/src/ast/nodes/shared/FunctionNode.ts000066400000000000000000000101431450520414700220260ustar00rootroot00000000000000import { type HasEffectsContext, type InclusionContext } from '../../ExecutionContext'; import type { NodeInteraction } from '../../NodeInteractions'; import { INTERACTION_CALLED } from '../../NodeInteractions'; import FunctionScope from '../../scopes/FunctionScope'; import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; import type BlockStatement from '../BlockStatement'; import Identifier, { type IdentifierWithVariable } from '../Identifier'; import type { ExpressionEntity } from './Expression'; import { UNKNOWN_EXPRESSION } from './Expression'; import FunctionBase from './FunctionBase'; import { type IncludeChildren } from './Node'; import { ObjectEntity } from './ObjectEntity'; import { OBJECT_PROTOTYPE } from './ObjectPrototype'; import type { PatternNode } from './Pattern'; export default class FunctionNode extends FunctionBase { declare async: boolean; declare body: BlockStatement; declare id: IdentifierWithVariable | null; declare params: readonly PatternNode[]; declare preventChildBlockScope: true; declare scope: FunctionScope; protected objectEntity: ObjectEntity | null = null; private declare constructedEntity: ObjectEntity; createScope(parentScope: FunctionScope): void { this.scope = new FunctionScope(parentScope, this.context); this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE); // This makes sure that all deoptimizations of "this" are applied to the // constructed entity. this.scope.thisVariable.addEntityToBeDeoptimized(this.constructedEntity); } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); if (interaction.type === INTERACTION_CALLED && path.length === 0 && interaction.args[0]) { // args[0] is the "this" argument this.scope.thisVariable.addEntityToBeDeoptimized(interaction.args[0]); } } hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); if (this.annotationNoSideEffects) { return false; } return !!this.id?.hasEffects(context); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) return true; if (this.annotationNoSideEffects) { return false; } if (interaction.type === INTERACTION_CALLED) { const thisInit = context.replacedVariableInits.get(this.scope.thisVariable); context.replacedVariableInits.set( this.scope.thisVariable, interaction.withNew ? this.constructedEntity : UNKNOWN_EXPRESSION ); const { brokenFlow, ignore, replacedVariableInits } = context; context.ignore = { breaks: false, continues: false, labels: new Set(), returnYield: true, this: interaction.withNew }; if (this.body.hasEffects(context)) return true; context.brokenFlow = brokenFlow; if (thisInit) { replacedVariableInits.set(this.scope.thisVariable, thisInit); } else { replacedVariableInits.delete(this.scope.thisVariable); } context.ignore = ignore; } return false; } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { super.include(context, includeChildrenRecursively); this.id?.include(); const hasArguments = this.scope.argumentsVariable.included; for (const parameter of this.params) { if (!(parameter instanceof Identifier) || hasArguments) { parameter.include(context, includeChildrenRecursively); } } } initialise(): void { super.initialise(); this.id?.declare('function', this); } protected addArgumentToBeDeoptimized(argument: ExpressionEntity) { this.scope.argumentsVariable.addArgumentToBeDeoptimized(argument); } protected getObjectEntity(): ObjectEntity { if (this.objectEntity !== null) { return this.objectEntity; } return (this.objectEntity = new ObjectEntity( [ { key: 'prototype', kind: 'init', property: new ObjectEntity([], OBJECT_PROTOTYPE) } ], OBJECT_PROTOTYPE )); } } rollup-3.29.4/src/ast/nodes/shared/MethodBase.ts000066400000000000000000000102621450520414700214500ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_ASSIGNED, INTERACTION_CALLED, NODE_INTERACTION_UNKNOWN_CALL } from '../../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, type PathTracker, SHARED_RECURSION_TRACKER } from '../../utils/PathTracker'; import type PrivateIdentifier from '../PrivateIdentifier'; import { type ExpressionEntity, type LiteralValueOrUnknown, UNKNOWN_RETURN_EXPRESSION } from './Expression'; import { type ExpressionNode, NodeBase } from './Node'; import type { PatternNode } from './Pattern'; export default class MethodBase extends NodeBase implements DeoptimizableEntity { declare computed: boolean; declare key: ExpressionNode | PrivateIdentifier; declare kind: 'constructor' | 'method' | 'init' | 'get' | 'set'; declare value: ExpressionNode | (ExpressionNode & PatternNode); private accessedValue: [expression: ExpressionEntity, isPure: boolean] | null = null; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { if (interaction.type === INTERACTION_ACCESSED && this.kind === 'get' && path.length === 0) { return this.value.deoptimizeArgumentsOnInteractionAtPath( { args: interaction.args, type: INTERACTION_CALLED, withNew: false }, EMPTY_PATH, recursionTracker ); } if (interaction.type === INTERACTION_ASSIGNED && this.kind === 'set' && path.length === 0) { return this.value.deoptimizeArgumentsOnInteractionAtPath( { args: interaction.args, type: INTERACTION_CALLED, withNew: false }, EMPTY_PATH, recursionTracker ); } this.getAccessedValue()[0].deoptimizeArgumentsOnInteractionAtPath( interaction, path, recursionTracker ); } // As getter properties directly receive their values from fixed function // expressions, there is no known situation where a getter is deoptimized. deoptimizeCache(): void {} deoptimizePath(path: ObjectPath): void { this.getAccessedValue()[0].deoptimizePath(path); } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getAccessedValue()[0].getLiteralValueAtPath(path, recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.getAccessedValue()[0].getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); } hasEffects(context: HasEffectsContext): boolean { return this.key.hasEffects(context); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (this.kind === 'get' && interaction.type === INTERACTION_ACCESSED && path.length === 0) { return this.value.hasEffectsOnInteractionAtPath( EMPTY_PATH, { args: interaction.args, type: INTERACTION_CALLED, withNew: false }, context ); } // setters are only called for empty paths if (this.kind === 'set' && interaction.type === INTERACTION_ASSIGNED) { return this.value.hasEffectsOnInteractionAtPath( EMPTY_PATH, { args: interaction.args, type: INTERACTION_CALLED, withNew: false }, context ); } return this.getAccessedValue()[0].hasEffectsOnInteractionAtPath(path, interaction, context); } protected applyDeoptimizations() {} protected getAccessedValue(): [expression: ExpressionEntity, isPure: boolean] { if (this.accessedValue === null) { if (this.kind === 'get') { this.accessedValue = UNKNOWN_RETURN_EXPRESSION; return (this.accessedValue = this.value.getReturnExpressionWhenCalledAtPath( EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, SHARED_RECURSION_TRACKER, this )); } else { return (this.accessedValue = [this.value, false]); } } return this.accessedValue; } } rollup-3.29.4/src/ast/nodes/shared/MethodTypes.ts000066400000000000000000000061421450520414700217040ustar00rootroot00000000000000import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_CALLED, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, NODE_INTERACTION_UNKNOWN_CALL } from '../../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, UNKNOWN_INTEGER_PATH } from '../../utils/PathTracker'; import { UNKNOWN_LITERAL_BOOLEAN, UNKNOWN_LITERAL_NUMBER, UNKNOWN_LITERAL_STRING } from '../../values'; import { ExpressionEntity, UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION } from './Expression'; type MethodDescription = { callsArgs: number[] | null; mutatesSelfAsArray: boolean | 'deopt-only'; } & ( | { returns: 'self' | (() => ExpressionEntity); returnsPrimitive: null; } | { returns: null; returnsPrimitive: ExpressionEntity; } ); export class Method extends ExpressionEntity { constructor(private readonly description: MethodDescription) { super(); } deoptimizeArgumentsOnInteractionAtPath({ args, type }: NodeInteraction, path: ObjectPath): void { if (type === INTERACTION_CALLED && path.length === 0 && this.description.mutatesSelfAsArray) { args[0]?.deoptimizePath(UNKNOWN_INTEGER_PATH); } } getReturnExpressionWhenCalledAtPath( path: ObjectPath, { args }: NodeInteractionCalled ): [expression: ExpressionEntity, isPure: boolean] { if (path.length > 0) { return UNKNOWN_RETURN_EXPRESSION; } return [ this.description.returnsPrimitive || (this.description.returns === 'self' ? args[0] || UNKNOWN_EXPRESSION : this.description.returns()), false ]; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { const { type } = interaction; if (path.length > (type === INTERACTION_ACCESSED ? 1 : 0)) { return true; } if (type === INTERACTION_CALLED) { const { args } = interaction; if ( this.description.mutatesSelfAsArray === true && args[0]?.hasEffectsOnInteractionAtPath( UNKNOWN_INTEGER_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context ) ) { return true; } if (this.description.callsArgs) { for (const argumentIndex of this.description.callsArgs) { if ( args[argumentIndex + 1]?.hasEffectsOnInteractionAtPath( EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context ) ) { return true; } } } } return false; } } export const METHOD_RETURNS_BOOLEAN = [ new Method({ callsArgs: null, mutatesSelfAsArray: false, returns: null, returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN }) ]; export const METHOD_RETURNS_STRING = [ new Method({ callsArgs: null, mutatesSelfAsArray: false, returns: null, returnsPrimitive: UNKNOWN_LITERAL_STRING }) ]; export const METHOD_RETURNS_NUMBER = [ new Method({ callsArgs: null, mutatesSelfAsArray: false, returns: null, returnsPrimitive: UNKNOWN_LITERAL_NUMBER }) ]; export const METHOD_RETURNS_UNKNOWN = [ new Method({ callsArgs: null, mutatesSelfAsArray: false, returns: null, returnsPrimitive: UNKNOWN_EXPRESSION }) ]; rollup-3.29.4/src/ast/nodes/shared/MultiExpression.ts000066400000000000000000000025451450520414700226140ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; import { ExpressionEntity } from './Expression'; export class MultiExpression extends ExpressionEntity { included = false; constructor(private expressions: readonly ExpressionEntity[]) { super(); } deoptimizePath(path: ObjectPath): void { for (const expression of this.expressions) { expression.deoptimizePath(path); } } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return [ new MultiExpression( this.expressions.map( expression => expression.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin )[0] ) ), false ]; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { for (const expression of this.expressions) { if (expression.hasEffectsOnInteractionAtPath(path, interaction, context)) return true; } return false; } } rollup-3.29.4/src/ast/nodes/shared/Node.ts000066400000000000000000000271761450520414700203360ustar00rootroot00000000000000import type * as acorn from 'acorn'; import { locate, type Location } from 'locate-character'; import type MagicString from 'magic-string'; import type { AstContext } from '../../../Module'; import type { NormalizedTreeshakingOptions } from '../../../rollup/types'; import type { RollupAnnotation } from '../../../utils/commentAnnotations'; import { ANNOTATION_KEY, INVALID_COMMENT_KEY } from '../../../utils/commentAnnotations'; import type { NodeRenderOptions, RenderOptions } from '../../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { Entity } from '../../Entity'; import { createHasEffectsContext, type HasEffectsContext, type InclusionContext } from '../../ExecutionContext'; import type { NodeInteractionAssigned } from '../../NodeInteractions'; import { INTERACTION_ASSIGNED } from '../../NodeInteractions'; import { getAndCreateKeys, keys } from '../../keys'; import type ChildScope from '../../scopes/ChildScope'; import { EMPTY_PATH, UNKNOWN_PATH } from '../../utils/PathTracker'; import type Variable from '../../variables/Variable'; import type * as NodeType from '../NodeType'; import type { InclusionOptions } from './Expression'; import { ExpressionEntity } from './Expression'; export interface GenericEsTreeNode extends acorn.Node { [key: string]: any; } export const INCLUDE_PARAMETERS = 'variables' as const; export type IncludeChildren = boolean | typeof INCLUDE_PARAMETERS; export interface Node extends Entity { annotations?: acorn.Comment[]; context: AstContext; end: number; esTreeNode: GenericEsTreeNode | null; included: boolean; keys: string[]; needsBoundaries?: boolean; parent: Node | { type?: string }; preventChildBlockScope?: boolean; start: number; type: string; variable?: Variable | null; addExportedVariables( variables: readonly Variable[], exportNamesByVariable: ReadonlyMap ): void; /** * Called once all nodes have been initialised and the scopes have been * populated. */ bind(): void; /** * Determine if this Node would have an effect on the bundle. This is usually * true for already included nodes. Exceptions are e.g. break statements which * only have an effect if their surrounding loop or switch statement is * included. * The options pass on information like this about the current execution path. */ hasEffects(context: HasEffectsContext): boolean; /** * Special version of hasEffects for assignment left-hand sides which ensures * that accessor effects are checked as well. This is necessary to do from the * child so that member expressions can use the correct this value. * setAssignedValue needs to be called during initialise to use this. */ hasEffectsAsAssignmentTarget(context: HasEffectsContext, checkAccess: boolean): boolean; /** * Includes the node in the bundle. If the flag is not set, children are * usually included if they are necessary for this node (e.g. a function body) * or if they have effects. Necessary variables need to be included as well. */ include( context: InclusionContext, includeChildrenRecursively: IncludeChildren, options?: InclusionOptions ): void; /** * Special version of include for assignment left-hand sides which ensures * that accessors are handled correctly. This is necessary to do from the * child so that member expressions can use the correct this value. * setAssignedValue needs to be called during initialise to use this. */ includeAsAssignmentTarget( context: InclusionContext, includeChildrenRecursively: IncludeChildren, deoptimizeAccess: boolean ): void; render(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void; /** * Sets the assigned value e.g. for assignment expression left. This must be * called during initialise in case hasEffects/includeAsAssignmentTarget are * used. */ setAssignedValue(value: ExpressionEntity): void; /** * Start a new execution path to determine if this node has an effect on the * bundle and should therefore be included. Included nodes should always be * included again in subsequent visits as the inclusion of additional * variables may require the inclusion of more child nodes in e.g. block * statements. */ shouldBeIncluded(context: InclusionContext): boolean; } export type StatementNode = Node; export interface ExpressionNode extends ExpressionEntity, Node { isSkippedAsOptional?(origin: DeoptimizableEntity): boolean; } export interface ChainElement extends ExpressionNode { optional: boolean; isSkippedAsOptional(origin: DeoptimizableEntity): boolean; } export class NodeBase extends ExpressionEntity implements ExpressionNode { /** Marked with #__NO_SIDE_EFFECTS__ annotation */ declare annotationNoSideEffects?: boolean; /** Marked with #__PURE__ annotation */ declare annotationPure?: boolean; declare annotations?: RollupAnnotation[]; context: AstContext; declare end: number; esTreeNode: acorn.Node | null; keys: string[]; parent: Node | { context: AstContext; type: string }; declare scope: ChildScope; declare start: number; declare type: keyof typeof NodeType; /** * This will be populated during initialise if setAssignedValue is called. */ protected declare assignmentInteraction: NodeInteractionAssigned; /** * Nodes can apply custom deoptimizations once they become part of the * executed code. To do this, they must initialize this as false, implement * applyDeoptimizations and call this from include and hasEffects if they have * custom handlers */ protected deoptimized = false; constructor( esTreeNode: GenericEsTreeNode, parent: Node | { context: AstContext; type: string }, parentScope: ChildScope, keepEsTreeNode = false ) { super(); // Nodes can opt-in to keep the AST if needed during the build pipeline. // Avoid true when possible as large AST takes up memory. this.esTreeNode = keepEsTreeNode ? esTreeNode : null; this.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode); this.parent = parent; this.context = parent.context; this.createScope(parentScope); this.parseNode(esTreeNode); this.initialise(); this.context.magicString.addSourcemapLocation(this.start); this.context.magicString.addSourcemapLocation(this.end); } addExportedVariables( _variables: readonly Variable[], _exportNamesByVariable: ReadonlyMap ): void {} /** * Override this to bind assignments to variables and do any initialisations * that require the scopes to be populated with variables. */ bind(): void { for (const key of this.keys) { const value = (this as GenericEsTreeNode)[key]; if (Array.isArray(value)) { for (const child of value) { child?.bind(); } } else if (value) { value.bind(); } } } /** * Override if this node should receive a different scope than the parent * scope. */ createScope(parentScope: ChildScope): void { this.scope = parentScope; } hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); for (const key of this.keys) { const value = (this as GenericEsTreeNode)[key]; if (value === null) continue; if (Array.isArray(value)) { for (const child of value) { if (child?.hasEffects(context)) return true; } } else if (value.hasEffects(context)) return true; } return false; } hasEffectsAsAssignmentTarget(context: HasEffectsContext, _checkAccess: boolean): boolean { return ( this.hasEffects(context) || this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context) ); } include( context: InclusionContext, includeChildrenRecursively: IncludeChildren, _options?: InclusionOptions ): void { if (!this.deoptimized) this.applyDeoptimizations(); this.included = true; for (const key of this.keys) { const value = (this as GenericEsTreeNode)[key]; if (value === null) continue; if (Array.isArray(value)) { for (const child of value) { child?.include(context, includeChildrenRecursively); } } else { value.include(context, includeChildrenRecursively); } } } includeAsAssignmentTarget( context: InclusionContext, includeChildrenRecursively: IncludeChildren, _deoptimizeAccess: boolean ) { this.include(context, includeChildrenRecursively); } /** * Override to perform special initialisation steps after the scope is * initialised */ initialise(): void {} insertSemicolon(code: MagicString): void { if (code.original[this.end - 1] !== ';') { code.appendLeft(this.end, ';'); } } parseNode(esTreeNode: GenericEsTreeNode, keepEsTreeNodeKeys?: string[]): void { for (const [key, value] of Object.entries(esTreeNode)) { // That way, we can override this function to add custom initialisation and then call super.parseNode if (this.hasOwnProperty(key)) continue; if (key.charCodeAt(0) === 95 /* _ */) { if (key === ANNOTATION_KEY) { const annotations = value as RollupAnnotation[]; this.annotations = annotations; if ((this.context.options.treeshake as NormalizedTreeshakingOptions).annotations) { this.annotationNoSideEffects = annotations.some( comment => comment.annotationType === 'noSideEffects' ); this.annotationPure = annotations.some(comment => comment.annotationType === 'pure'); } } else if (key === INVALID_COMMENT_KEY) { for (const { start, end } of value as acorn.Comment[]) this.context.magicString.remove(start, end); } } else if (typeof value !== 'object' || value === null) { (this as GenericEsTreeNode)[key] = value; } else if (Array.isArray(value)) { (this as GenericEsTreeNode)[key] = []; for (const child of value) { (this as GenericEsTreeNode)[key].push( child === null ? null : new (this.context.getNodeConstructor(child.type))( child, this, this.scope, keepEsTreeNodeKeys?.includes(key) ) ); } } else { (this as GenericEsTreeNode)[key] = new (this.context.getNodeConstructor(value.type))( value, this, this.scope, keepEsTreeNodeKeys?.includes(key) ); } } } render(code: MagicString, options: RenderOptions): void { for (const key of this.keys) { const value = (this as GenericEsTreeNode)[key]; if (value === null) continue; if (Array.isArray(value)) { for (const child of value) { child?.render(code, options); } } else { value.render(code, options); } } } setAssignedValue(value: ExpressionEntity): void { this.assignmentInteraction = { args: [null, value], type: INTERACTION_ASSIGNED }; } shouldBeIncluded(context: InclusionContext): boolean { return this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext())); } /** * Just deoptimize everything by default so that when e.g. we do not track * something properly, it is deoptimized. * @protected */ protected applyDeoptimizations(): void { this.deoptimized = true; for (const key of this.keys) { const value = (this as GenericEsTreeNode)[key]; if (value === null) continue; if (Array.isArray(value)) { for (const child of value) { child?.deoptimizePath(UNKNOWN_PATH); } } else { value.deoptimizePath(UNKNOWN_PATH); } } this.context.requestTreeshakingPass(); } } export { NodeBase as StatementBase }; export function locateNode(node: Node): Location & { file: string } { const location = locate(node.context.code, node.start, { offsetLine: 1 }) as Location & { file: string; }; location.file = node.context.fileName; location.toString = () => JSON.stringify(location); return location; } export function logNode(node: Node): string { return node.context.code.slice(node.start, node.end); } rollup-3.29.4/src/ast/nodes/shared/ObjectEntity.ts000066400000000000000000000343701450520414700220460ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_CALLED } from '../../NodeInteractions'; import type { ObjectPath, ObjectPathKey, PathTracker } from '../../utils/PathTracker'; import { UNKNOWN_INTEGER_PATH, UNKNOWN_PATH, UnknownInteger, UnknownKey, UnknownNonAccessorKey } from '../../utils/PathTracker'; import type { LiteralValueOrUnknown } from './Expression'; import { deoptimizeInteraction, ExpressionEntity, UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION, UnknownTruthyValue, UnknownValue } from './Expression'; export interface ObjectProperty { key: ObjectPathKey; kind: 'init' | 'set' | 'get'; property: ExpressionEntity; } export interface PropertyMap { [key: string]: ExpressionEntity[]; } const INTEGER_REG_EXP = /^\d+$/; export class ObjectEntity extends ExpressionEntity { private readonly additionalExpressionsToBeDeoptimized = new Set(); private readonly allProperties: ExpressionEntity[] = []; private readonly deoptimizedPaths: Record = Object.create(null); private readonly expressionsToBeDeoptimizedByKey: Record = Object.create(null); private readonly gettersByKey: PropertyMap = Object.create(null); private hasLostTrack = false; private hasUnknownDeoptimizedInteger = false; private hasUnknownDeoptimizedProperty = false; private readonly propertiesAndGettersByKey: PropertyMap = Object.create(null); private readonly propertiesAndSettersByKey: PropertyMap = Object.create(null); private readonly settersByKey: PropertyMap = Object.create(null); private readonly unknownIntegerProps: ExpressionEntity[] = []; private readonly unmatchableGetters: ExpressionEntity[] = []; private readonly unmatchablePropertiesAndGetters: ExpressionEntity[] = []; private readonly unmatchableSetters: ExpressionEntity[] = []; // If a PropertyMap is used, this will be taken as propertiesAndGettersByKey // and we assume there are no setters or getters constructor( properties: ObjectProperty[] | PropertyMap, private prototypeExpression: ExpressionEntity | null, private immutable = false ) { super(); if (Array.isArray(properties)) { this.buildPropertyMaps(properties); } else { this.propertiesAndGettersByKey = this.propertiesAndSettersByKey = properties; for (const propertiesForKey of Object.values(properties)) { this.allProperties.push(...propertiesForKey); } } } deoptimizeAllProperties(noAccessors?: boolean): void { const isDeoptimized = this.hasLostTrack || this.hasUnknownDeoptimizedProperty; if (noAccessors) { this.hasUnknownDeoptimizedProperty = true; } else { this.hasLostTrack = true; } if (isDeoptimized) { return; } for (const properties of [ ...Object.values(this.propertiesAndGettersByKey), ...Object.values(this.settersByKey) ]) { for (const property of properties) { property.deoptimizePath(UNKNOWN_PATH); } } // While the prototype itself cannot be mutated, each property can this.prototypeExpression?.deoptimizePath([UnknownKey, UnknownKey]); this.deoptimizeCachedEntities(); } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { const [key, ...subPath] = path; const { args, type } = interaction; if ( this.hasLostTrack || // single paths that are deoptimized will not become getters or setters ((type === INTERACTION_CALLED || path.length > 1) && (this.hasUnknownDeoptimizedProperty || (typeof key === 'string' && this.deoptimizedPaths[key]))) ) { deoptimizeInteraction(interaction); return; } const [propertiesForExactMatchByKey, relevantPropertiesByKey, relevantUnmatchableProperties] = type === INTERACTION_CALLED || path.length > 1 ? [ this.propertiesAndGettersByKey, this.propertiesAndGettersByKey, this.unmatchablePropertiesAndGetters ] : type === INTERACTION_ACCESSED ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; if (typeof key === 'string') { if (propertiesForExactMatchByKey[key]) { const properties = relevantPropertiesByKey[key]; if (properties) { for (const property of properties) { property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); } } if (!this.immutable) { for (const argument of args) { if (argument) { this.additionalExpressionsToBeDeoptimized.add(argument); } } } return; } for (const property of relevantUnmatchableProperties) { property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); } if (INTEGER_REG_EXP.test(key)) { for (const property of this.unknownIntegerProps) { property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); } } } else { for (const properties of [ ...Object.values(relevantPropertiesByKey), relevantUnmatchableProperties ]) { for (const property of properties) { property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); } } for (const property of this.unknownIntegerProps) { property.deoptimizeArgumentsOnInteractionAtPath(interaction, subPath, recursionTracker); } } if (!this.immutable) { for (const argument of args) { if (argument) { this.additionalExpressionsToBeDeoptimized.add(argument); } } } this.prototypeExpression?.deoptimizeArgumentsOnInteractionAtPath( interaction, path, recursionTracker ); } deoptimizeIntegerProperties(): void { if ( this.hasLostTrack || this.hasUnknownDeoptimizedProperty || this.hasUnknownDeoptimizedInteger ) { return; } this.hasUnknownDeoptimizedInteger = true; for (const [key, propertiesAndGetters] of Object.entries(this.propertiesAndGettersByKey)) { if (INTEGER_REG_EXP.test(key)) { for (const property of propertiesAndGetters) { property.deoptimizePath(UNKNOWN_PATH); } } } this.deoptimizeCachedIntegerEntities(); } // Assumption: If only a specific path is deoptimized, no accessors are created deoptimizePath(path: ObjectPath): void { if (this.hasLostTrack || this.immutable) { return; } const key = path[0]; if (path.length === 1) { if (typeof key !== 'string') { if (key === UnknownInteger) { return this.deoptimizeIntegerProperties(); } return this.deoptimizeAllProperties(key === UnknownNonAccessorKey); } if (!this.deoptimizedPaths[key]) { this.deoptimizedPaths[key] = true; // we only deoptimizeCache exact matches as in all other cases, // we do not return a literal value or return expression const expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey[key]; if (expressionsToBeDeoptimized) { for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } } } } const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1); for (const property of typeof key === 'string' ? [ ...(this.propertiesAndGettersByKey[key] || this.unmatchablePropertiesAndGetters), ...(this.settersByKey[key] || this.unmatchableSetters) ] : this.allProperties) { property.deoptimizePath(subPath); } this.prototypeExpression?.deoptimizePath(path.length === 1 ? [...path, UnknownKey] : path); } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (path.length === 0) { return UnknownTruthyValue; } const key = path[0]; const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); if (expressionAtPath) { return expressionAtPath.getLiteralValueAtPath(path.slice(1), recursionTracker, origin); } if (this.prototypeExpression) { return this.prototypeExpression.getLiteralValueAtPath(path, recursionTracker, origin); } if (path.length === 1) { return undefined; } return UnknownValue; } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { if (path.length === 0) { return UNKNOWN_RETURN_EXPRESSION; } const [key, ...subPath] = path; const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); if (expressionAtPath) { return expressionAtPath.getReturnExpressionWhenCalledAtPath( subPath, interaction, recursionTracker, origin ); } if (this.prototypeExpression) { return this.prototypeExpression.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); } return UNKNOWN_RETURN_EXPRESSION; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { const [key, ...subPath] = path; if (subPath.length > 0 || interaction.type === INTERACTION_CALLED) { const expressionAtPath = this.getMemberExpression(key); if (expressionAtPath) { return expressionAtPath.hasEffectsOnInteractionAtPath(subPath, interaction, context); } if (this.prototypeExpression) { return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); } return true; } if (key === UnknownNonAccessorKey) return false; if (this.hasLostTrack) return true; const [propertiesAndAccessorsByKey, accessorsByKey, unmatchableAccessors] = interaction.type === INTERACTION_ACCESSED ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; if (typeof key === 'string') { if (propertiesAndAccessorsByKey[key]) { const accessors = accessorsByKey[key]; if (accessors) { for (const accessor of accessors) { if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) return true; } } return false; } for (const accessor of unmatchableAccessors) { if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) { return true; } } } else { for (const accessors of [...Object.values(accessorsByKey), unmatchableAccessors]) { for (const accessor of accessors) { if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) return true; } } } if (this.prototypeExpression) { return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); } return false; } private buildPropertyMaps(properties: readonly ObjectProperty[]): void { const { allProperties, propertiesAndGettersByKey, propertiesAndSettersByKey, settersByKey, gettersByKey, unknownIntegerProps, unmatchablePropertiesAndGetters, unmatchableGetters, unmatchableSetters } = this; const unmatchablePropertiesAndSetters: ExpressionEntity[] = []; for (let index = properties.length - 1; index >= 0; index--) { const { key, kind, property } = properties[index]; allProperties.push(property); if (typeof key === 'string') { if (kind === 'set') { if (!propertiesAndSettersByKey[key]) { propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; settersByKey[key] = [property, ...unmatchableSetters]; } } else if (kind === 'get') { if (!propertiesAndGettersByKey[key]) { propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; gettersByKey[key] = [property, ...unmatchableGetters]; } } else { if (!propertiesAndSettersByKey[key]) { propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; } if (!propertiesAndGettersByKey[key]) { propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; } } } else { if (key === UnknownInteger) { unknownIntegerProps.push(property); continue; } if (kind === 'set') unmatchableSetters.push(property); if (kind === 'get') unmatchableGetters.push(property); if (kind !== 'get') unmatchablePropertiesAndSetters.push(property); if (kind !== 'set') unmatchablePropertiesAndGetters.push(property); } } } private deoptimizeCachedEntities() { for (const expressionsToBeDeoptimized of Object.values(this.expressionsToBeDeoptimizedByKey)) { for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } } for (const expression of this.additionalExpressionsToBeDeoptimized) { expression.deoptimizePath(UNKNOWN_PATH); } } private deoptimizeCachedIntegerEntities() { for (const [key, expressionsToBeDeoptimized] of Object.entries( this.expressionsToBeDeoptimizedByKey )) { if (INTEGER_REG_EXP.test(key)) { for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } } } for (const expression of this.additionalExpressionsToBeDeoptimized) { expression.deoptimizePath(UNKNOWN_INTEGER_PATH); } } private getMemberExpression(key: ObjectPathKey): ExpressionEntity | null { if ( this.hasLostTrack || this.hasUnknownDeoptimizedProperty || typeof key !== 'string' || (this.hasUnknownDeoptimizedInteger && INTEGER_REG_EXP.test(key)) || this.deoptimizedPaths[key] ) { return UNKNOWN_EXPRESSION; } const properties = this.propertiesAndGettersByKey[key]; if (properties?.length === 1) { return properties[0]; } if ( properties || this.unmatchablePropertiesAndGetters.length > 0 || (this.unknownIntegerProps.length > 0 && INTEGER_REG_EXP.test(key)) ) { return UNKNOWN_EXPRESSION; } return null; } private getMemberExpressionAndTrackDeopt( key: ObjectPathKey, origin: DeoptimizableEntity ): ExpressionEntity | null { if (typeof key !== 'string') { return UNKNOWN_EXPRESSION; } const expression = this.getMemberExpression(key); if (!(expression === UNKNOWN_EXPRESSION || this.immutable)) { const expressionsToBeDeoptimized = (this.expressionsToBeDeoptimizedByKey[key] = this.expressionsToBeDeoptimizedByKey[key] || []); expressionsToBeDeoptimized.push(origin); } return expression; } } rollup-3.29.4/src/ast/nodes/shared/ObjectMember.ts000066400000000000000000000032421450520414700217730ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; import { ExpressionEntity, type LiteralValueOrUnknown } from './Expression'; export class ObjectMember extends ExpressionEntity { constructor( private readonly object: ExpressionEntity, private readonly key: string ) { super(); } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { this.object.deoptimizeArgumentsOnInteractionAtPath( interaction, [this.key, ...path], recursionTracker ); } deoptimizePath(path: ObjectPath): void { this.object.deoptimizePath([this.key, ...path]); } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.object.getLiteralValueAtPath([this.key, ...path], recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.object.getReturnExpressionWhenCalledAtPath( [this.key, ...path], interaction, recursionTracker, origin ); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { return this.object.hasEffectsOnInteractionAtPath([this.key, ...path], interaction, context); } } rollup-3.29.4/src/ast/nodes/shared/ObjectPrototype.ts000066400000000000000000000041441450520414700225730ustar00rootroot00000000000000import type { NodeInteraction } from '../../NodeInteractions'; import { INTERACTION_CALLED } from '../../NodeInteractions'; import type { ObjectPath, ObjectPathKey } from '../../utils/PathTracker'; import type { LiteralValueOrUnknown } from './Expression'; import { deoptimizeInteraction, ExpressionEntity, UnknownValue } from './Expression'; import { METHOD_RETURNS_BOOLEAN, METHOD_RETURNS_STRING, METHOD_RETURNS_UNKNOWN } from './MethodTypes'; import { ObjectEntity, type PropertyMap } from './ObjectEntity'; const isInteger = (property: ObjectPathKey): boolean => typeof property === 'string' && /^\d+$/.test(property); // This makes sure unknown properties are not handled as "undefined" but as // "unknown" but without access side effects. An exception is done for numeric // properties as we do not expect new builtin properties to be numbers, this // will improve tree-shaking for out-of-bounds array properties const OBJECT_PROTOTYPE_FALLBACK: ExpressionEntity = new (class ObjectPrototypeFallbackExpression extends ExpressionEntity { deoptimizeArgumentsOnInteractionAtPath(interaction: NodeInteraction, path: ObjectPath): void { if (interaction.type === INTERACTION_CALLED && path.length === 1 && !isInteger(path[0])) { deoptimizeInteraction(interaction); } } getLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown { // We ignore number properties as we do not expect new properties to be // numbers and also want to keep handling out-of-bound array elements as // "undefined" return path.length === 1 && isInteger(path[0]) ? undefined : UnknownValue; } hasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean { return path.length > 1 || type === INTERACTION_CALLED; } })(); export const OBJECT_PROTOTYPE = new ObjectEntity( { __proto__: null, hasOwnProperty: METHOD_RETURNS_BOOLEAN, isPrototypeOf: METHOD_RETURNS_BOOLEAN, propertyIsEnumerable: METHOD_RETURNS_BOOLEAN, toLocaleString: METHOD_RETURNS_STRING, toString: METHOD_RETURNS_STRING, valueOf: METHOD_RETURNS_UNKNOWN } as unknown as PropertyMap, OBJECT_PROTOTYPE_FALLBACK, true ); rollup-3.29.4/src/ast/nodes/shared/Pattern.ts000066400000000000000000000005571450520414700210600ustar00rootroot00000000000000import type { WritableEntity } from '../../Entity'; import type LocalVariable from '../../variables/LocalVariable'; import type { ExpressionEntity } from './Expression'; import type { Node } from './Node'; export interface PatternNode extends WritableEntity, Node { declare(kind: string, init: ExpressionEntity): LocalVariable[]; markDeclarationReached(): void; } rollup-3.29.4/src/ast/nodes/shared/knownGlobals.ts000066400000000000000000000506351450520414700221050ustar00rootroot00000000000000/* eslint sort-keys: "off" */ import { doNothing } from '../../../utils/doNothing'; import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteractionCalled } from '../../NodeInteractions'; import { NODE_INTERACTION_UNKNOWN_ACCESS, NODE_INTERACTION_UNKNOWN_ASSIGNMENT } from '../../NodeInteractions'; import type { ObjectPath } from '../../utils/PathTracker'; import { SymbolToStringTag, UNKNOWN_NON_ACCESSOR_PATH, UNKNOWN_PATH } from '../../utils/PathTracker'; import ArrayExpression from '../ArrayExpression'; import type { LiteralValueOrUnknown } from './Expression'; import { ExpressionEntity, UnknownTruthyValue } from './Expression'; const ValueProperties = Symbol('Value Properties'); interface ValueDescription { deoptimizeArgumentsOnCall(interaction: NodeInteractionCalled): void; getLiteralValue(): LiteralValueOrUnknown; hasEffectsWhenCalled(interaction: NodeInteractionCalled, context: HasEffectsContext): boolean; } interface GlobalDescription { [pathKey: string]: GlobalDescription | null; [ValueProperties]: ValueDescription; __proto__: null; } const getTruthyLiteralValue = (): LiteralValueOrUnknown => UnknownTruthyValue; const returnFalse = () => false; const returnTrue = () => true; const PURE: ValueDescription = { deoptimizeArgumentsOnCall: doNothing, getLiteralValue: getTruthyLiteralValue, hasEffectsWhenCalled: returnFalse }; const IMPURE: ValueDescription = { deoptimizeArgumentsOnCall: doNothing, getLiteralValue: getTruthyLiteralValue, hasEffectsWhenCalled: returnTrue }; const PURE_WITH_ARRAY: ValueDescription = { deoptimizeArgumentsOnCall: doNothing, getLiteralValue: getTruthyLiteralValue, hasEffectsWhenCalled({ args }) { return args.length > 1 && !(args[1] instanceof ArrayExpression); } }; const GETTER_ACCESS: ValueDescription = { deoptimizeArgumentsOnCall: doNothing, getLiteralValue: getTruthyLiteralValue, hasEffectsWhenCalled({ args }, context) { const [_thisArgument, firstArgument] = args; return ( !(firstArgument instanceof ExpressionEntity) || firstArgument.hasEffectsOnInteractionAtPath( UNKNOWN_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context ) ); } }; // We use shortened variables to reduce file size here /* OBJECT */ const O: GlobalDescription = { __proto__: null, [ValueProperties]: IMPURE }; /* PURE FUNCTION */ const PF: GlobalDescription = { __proto__: null, [ValueProperties]: PURE }; /* PURE FUNCTION IF FIRST ARG DOES NOT CONTAIN A GETTER */ const PF_NO_GETTER: GlobalDescription = { __proto__: null, [ValueProperties]: GETTER_ACCESS }; /* FUNCTION THAT MUTATES FIRST ARG WITHOUT TRIGGERING ACCESSORS */ const MUTATES_ARG_WITHOUT_ACCESSOR: GlobalDescription = { __proto__: null, [ValueProperties]: { deoptimizeArgumentsOnCall({ args: [, firstArgument] }: NodeInteractionCalled) { firstArgument?.deoptimizePath(UNKNOWN_PATH); }, getLiteralValue: getTruthyLiteralValue, hasEffectsWhenCalled({ args }, context) { return ( args.length <= 1 || args[1].hasEffectsOnInteractionAtPath( UNKNOWN_NON_ACCESSOR_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context ) ); } } }; /* CONSTRUCTOR */ const C: GlobalDescription = { __proto__: null, [ValueProperties]: IMPURE, prototype: O }; /* PURE CONSTRUCTOR */ const PC: GlobalDescription = { __proto__: null, [ValueProperties]: PURE, prototype: O }; const PC_WITH_ARRAY = { __proto__: null, [ValueProperties]: PURE_WITH_ARRAY, prototype: O }; const ARRAY_TYPE: GlobalDescription = { __proto__: null, [ValueProperties]: PURE, from: O, of: PF, prototype: O }; const INTL_MEMBER: GlobalDescription = { __proto__: null, [ValueProperties]: PURE, supportedLocalesOf: PC }; const knownGlobals: GlobalDescription = { // Placeholders for global objects to avoid shape mutations global: O, globalThis: O, self: O, window: O, // Common globals __proto__: null, [ValueProperties]: IMPURE, Array: { __proto__: null, [ValueProperties]: IMPURE, from: O, isArray: PF, of: PF, prototype: O }, ArrayBuffer: { __proto__: null, [ValueProperties]: PURE, isView: PF, prototype: O }, Atomics: O, BigInt: C, BigInt64Array: C, BigUint64Array: C, Boolean: PC, constructor: C, DataView: PC, Date: { __proto__: null, [ValueProperties]: PURE, now: PF, parse: PF, prototype: O, UTC: PF }, decodeURI: PF, decodeURIComponent: PF, encodeURI: PF, encodeURIComponent: PF, Error: PC, escape: PF, eval: O, EvalError: PC, Float32Array: ARRAY_TYPE, Float64Array: ARRAY_TYPE, Function: C, hasOwnProperty: O, Infinity: O, Int16Array: ARRAY_TYPE, Int32Array: ARRAY_TYPE, Int8Array: ARRAY_TYPE, isFinite: PF, isNaN: PF, isPrototypeOf: O, JSON: O, Map: PC_WITH_ARRAY, Math: { __proto__: null, [ValueProperties]: IMPURE, abs: PF, acos: PF, acosh: PF, asin: PF, asinh: PF, atan: PF, atan2: PF, atanh: PF, cbrt: PF, ceil: PF, clz32: PF, cos: PF, cosh: PF, exp: PF, expm1: PF, floor: PF, fround: PF, hypot: PF, imul: PF, log: PF, log10: PF, log1p: PF, log2: PF, max: PF, min: PF, pow: PF, random: PF, round: PF, sign: PF, sin: PF, sinh: PF, sqrt: PF, tan: PF, tanh: PF, trunc: PF }, NaN: O, Number: { __proto__: null, [ValueProperties]: PURE, isFinite: PF, isInteger: PF, isNaN: PF, isSafeInteger: PF, parseFloat: PF, parseInt: PF, prototype: O }, Object: { __proto__: null, [ValueProperties]: PURE, create: PF, // Technically those can throw in certain situations, but we ignore this as // code that relies on this will hopefully wrap this in a try-catch, which // deoptimizes everything anyway defineProperty: MUTATES_ARG_WITHOUT_ACCESSOR, defineProperties: MUTATES_ARG_WITHOUT_ACCESSOR, freeze: MUTATES_ARG_WITHOUT_ACCESSOR, getOwnPropertyDescriptor: PF, getOwnPropertyDescriptors: PF, getOwnPropertyNames: PF, getOwnPropertySymbols: PF, getPrototypeOf: PF, hasOwn: PF, is: PF, isExtensible: PF, isFrozen: PF, isSealed: PF, keys: PF, fromEntries: O, entries: PF_NO_GETTER, values: PF_NO_GETTER, prototype: O }, parseFloat: PF, parseInt: PF, Promise: { __proto__: null, [ValueProperties]: IMPURE, all: O, allSettled: O, any: O, prototype: O, race: O, reject: O, resolve: O }, propertyIsEnumerable: O, Proxy: O, RangeError: PC, ReferenceError: PC, Reflect: O, RegExp: PC, Set: PC_WITH_ARRAY, SharedArrayBuffer: C, String: { __proto__: null, [ValueProperties]: PURE, fromCharCode: PF, fromCodePoint: PF, prototype: O, raw: PF }, Symbol: { __proto__: null, [ValueProperties]: PURE, for: PF, keyFor: PF, prototype: O, toStringTag: { __proto__: null, [ValueProperties]: { deoptimizeArgumentsOnCall: doNothing, getLiteralValue() { return SymbolToStringTag; }, hasEffectsWhenCalled: returnTrue } } }, SyntaxError: PC, toLocaleString: O, toString: O, TypeError: PC, Uint16Array: ARRAY_TYPE, Uint32Array: ARRAY_TYPE, Uint8Array: ARRAY_TYPE, Uint8ClampedArray: ARRAY_TYPE, // Technically, this is a global, but it needs special handling // undefined: ?, unescape: PF, URIError: PC, valueOf: O, WeakMap: PC_WITH_ARRAY, WeakSet: PC_WITH_ARRAY, // Additional globals shared by Node and Browser that are not strictly part of the language clearInterval: C, clearTimeout: C, console: { __proto__: null, [ValueProperties]: IMPURE, assert: C, clear: C, count: C, countReset: C, debug: C, dir: C, dirxml: C, error: C, exception: C, group: C, groupCollapsed: C, groupEnd: C, info: C, log: C, table: C, time: C, timeEnd: C, timeLog: C, trace: C, warn: C }, Intl: { __proto__: null, [ValueProperties]: IMPURE, Collator: INTL_MEMBER, DateTimeFormat: INTL_MEMBER, DisplayNames: INTL_MEMBER, ListFormat: INTL_MEMBER, Locale: INTL_MEMBER, NumberFormat: INTL_MEMBER, PluralRules: INTL_MEMBER, RelativeTimeFormat: INTL_MEMBER, Segmenter: INTL_MEMBER }, setInterval: C, setTimeout: C, TextDecoder: C, TextEncoder: C, URL: { __proto__: null, [ValueProperties]: IMPURE, prototype: O, canParse: PF }, URLSearchParams: C, // Browser specific globals AbortController: C, AbortSignal: C, addEventListener: O, alert: O, AnalyserNode: C, Animation: C, AnimationEvent: C, applicationCache: O, ApplicationCache: C, ApplicationCacheErrorEvent: C, atob: O, Attr: C, Audio: C, AudioBuffer: C, AudioBufferSourceNode: C, AudioContext: C, AudioDestinationNode: C, AudioListener: C, AudioNode: C, AudioParam: C, AudioProcessingEvent: C, AudioScheduledSourceNode: C, AudioWorkletNode: C, BarProp: C, BaseAudioContext: C, BatteryManager: C, BeforeUnloadEvent: C, BiquadFilterNode: C, Blob: C, BlobEvent: C, blur: O, BroadcastChannel: C, btoa: O, ByteLengthQueuingStrategy: C, Cache: C, caches: O, CacheStorage: C, cancelAnimationFrame: O, cancelIdleCallback: O, CanvasCaptureMediaStreamTrack: C, CanvasGradient: C, CanvasPattern: C, CanvasRenderingContext2D: C, ChannelMergerNode: C, ChannelSplitterNode: C, CharacterData: C, clientInformation: O, ClipboardEvent: C, close: O, closed: O, CloseEvent: C, Comment: C, CompositionEvent: C, confirm: O, ConstantSourceNode: C, ConvolverNode: C, CountQueuingStrategy: C, createImageBitmap: O, Credential: C, CredentialsContainer: C, crypto: O, Crypto: C, CryptoKey: C, CSS: C, CSSConditionRule: C, CSSFontFaceRule: C, CSSGroupingRule: C, CSSImportRule: C, CSSKeyframeRule: C, CSSKeyframesRule: C, CSSMediaRule: C, CSSNamespaceRule: C, CSSPageRule: C, CSSRule: C, CSSRuleList: C, CSSStyleDeclaration: C, CSSStyleRule: C, CSSStyleSheet: C, CSSSupportsRule: C, CustomElementRegistry: C, customElements: O, CustomEvent: { __proto__: null, [ValueProperties]: { deoptimizeArgumentsOnCall({ args }: NodeInteractionCalled) { args[2]?.deoptimizePath(['detail']); }, getLiteralValue: getTruthyLiteralValue, hasEffectsWhenCalled: returnFalse }, prototype: O }, DataTransfer: C, DataTransferItem: C, DataTransferItemList: C, defaultstatus: O, defaultStatus: O, DelayNode: C, DeviceMotionEvent: C, DeviceOrientationEvent: C, devicePixelRatio: O, dispatchEvent: O, document: O, Document: C, DocumentFragment: C, DocumentType: C, DOMError: C, DOMException: C, DOMImplementation: C, DOMMatrix: C, DOMMatrixReadOnly: C, DOMParser: C, DOMPoint: C, DOMPointReadOnly: C, DOMQuad: C, DOMRect: C, DOMRectReadOnly: C, DOMStringList: C, DOMStringMap: C, DOMTokenList: C, DragEvent: C, DynamicsCompressorNode: C, Element: C, ErrorEvent: C, Event: C, EventSource: C, EventTarget: C, external: O, fetch: O, File: C, FileList: C, FileReader: C, find: O, focus: O, FocusEvent: C, FontFace: C, FontFaceSetLoadEvent: C, FormData: C, frames: O, GainNode: C, Gamepad: C, GamepadButton: C, GamepadEvent: C, getComputedStyle: O, getSelection: O, HashChangeEvent: C, Headers: C, history: O, History: C, HTMLAllCollection: C, HTMLAnchorElement: C, HTMLAreaElement: C, HTMLAudioElement: C, HTMLBaseElement: C, HTMLBodyElement: C, HTMLBRElement: C, HTMLButtonElement: C, HTMLCanvasElement: C, HTMLCollection: C, HTMLContentElement: C, HTMLDataElement: C, HTMLDataListElement: C, HTMLDetailsElement: C, HTMLDialogElement: C, HTMLDirectoryElement: C, HTMLDivElement: C, HTMLDListElement: C, HTMLDocument: C, HTMLElement: C, HTMLEmbedElement: C, HTMLFieldSetElement: C, HTMLFontElement: C, HTMLFormControlsCollection: C, HTMLFormElement: C, HTMLFrameElement: C, HTMLFrameSetElement: C, HTMLHeadElement: C, HTMLHeadingElement: C, HTMLHRElement: C, HTMLHtmlElement: C, HTMLIFrameElement: C, HTMLImageElement: C, HTMLInputElement: C, HTMLLabelElement: C, HTMLLegendElement: C, HTMLLIElement: C, HTMLLinkElement: C, HTMLMapElement: C, HTMLMarqueeElement: C, HTMLMediaElement: C, HTMLMenuElement: C, HTMLMetaElement: C, HTMLMeterElement: C, HTMLModElement: C, HTMLObjectElement: C, HTMLOListElement: C, HTMLOptGroupElement: C, HTMLOptionElement: C, HTMLOptionsCollection: C, HTMLOutputElement: C, HTMLParagraphElement: C, HTMLParamElement: C, HTMLPictureElement: C, HTMLPreElement: C, HTMLProgressElement: C, HTMLQuoteElement: C, HTMLScriptElement: C, HTMLSelectElement: C, HTMLShadowElement: C, HTMLSlotElement: C, HTMLSourceElement: C, HTMLSpanElement: C, HTMLStyleElement: C, HTMLTableCaptionElement: C, HTMLTableCellElement: C, HTMLTableColElement: C, HTMLTableElement: C, HTMLTableRowElement: C, HTMLTableSectionElement: C, HTMLTemplateElement: C, HTMLTextAreaElement: C, HTMLTimeElement: C, HTMLTitleElement: C, HTMLTrackElement: C, HTMLUListElement: C, HTMLUnknownElement: C, HTMLVideoElement: C, IDBCursor: C, IDBCursorWithValue: C, IDBDatabase: C, IDBFactory: C, IDBIndex: C, IDBKeyRange: C, IDBObjectStore: C, IDBOpenDBRequest: C, IDBRequest: C, IDBTransaction: C, IDBVersionChangeEvent: C, IdleDeadline: C, IIRFilterNode: C, Image: C, ImageBitmap: C, ImageBitmapRenderingContext: C, ImageCapture: C, ImageData: C, indexedDB: O, innerHeight: O, innerWidth: O, InputEvent: C, IntersectionObserver: C, IntersectionObserverEntry: C, isSecureContext: O, KeyboardEvent: C, KeyframeEffect: C, length: O, localStorage: O, location: O, Location: C, locationbar: O, matchMedia: O, MediaDeviceInfo: C, MediaDevices: C, MediaElementAudioSourceNode: C, MediaEncryptedEvent: C, MediaError: C, MediaKeyMessageEvent: C, MediaKeySession: C, MediaKeyStatusMap: C, MediaKeySystemAccess: C, MediaList: C, MediaQueryList: C, MediaQueryListEvent: C, MediaRecorder: C, MediaSettingsRange: C, MediaSource: C, MediaStream: C, MediaStreamAudioDestinationNode: C, MediaStreamAudioSourceNode: C, MediaStreamEvent: C, MediaStreamTrack: C, MediaStreamTrackEvent: C, menubar: O, MessageChannel: C, MessageEvent: C, MessagePort: C, MIDIAccess: C, MIDIConnectionEvent: C, MIDIInput: C, MIDIInputMap: C, MIDIMessageEvent: C, MIDIOutput: C, MIDIOutputMap: C, MIDIPort: C, MimeType: C, MimeTypeArray: C, MouseEvent: C, moveBy: O, moveTo: O, MutationEvent: C, MutationObserver: C, MutationRecord: C, name: O, NamedNodeMap: C, NavigationPreloadManager: C, navigator: O, Navigator: C, NetworkInformation: C, Node: C, NodeFilter: O, NodeIterator: C, NodeList: C, Notification: C, OfflineAudioCompletionEvent: C, OfflineAudioContext: C, offscreenBuffering: O, OffscreenCanvas: C, open: O, openDatabase: O, Option: C, origin: O, OscillatorNode: C, outerHeight: O, outerWidth: O, PageTransitionEvent: C, pageXOffset: O, pageYOffset: O, PannerNode: C, parent: O, Path2D: C, PaymentAddress: C, PaymentRequest: C, PaymentRequestUpdateEvent: C, PaymentResponse: C, performance: O, Performance: C, PerformanceEntry: C, PerformanceLongTaskTiming: C, PerformanceMark: C, PerformanceMeasure: C, PerformanceNavigation: C, PerformanceNavigationTiming: C, PerformanceObserver: C, PerformanceObserverEntryList: C, PerformancePaintTiming: C, PerformanceResourceTiming: C, PerformanceTiming: C, PeriodicWave: C, Permissions: C, PermissionStatus: C, personalbar: O, PhotoCapabilities: C, Plugin: C, PluginArray: C, PointerEvent: C, PopStateEvent: C, postMessage: O, Presentation: C, PresentationAvailability: C, PresentationConnection: C, PresentationConnectionAvailableEvent: C, PresentationConnectionCloseEvent: C, PresentationConnectionList: C, PresentationReceiver: C, PresentationRequest: C, print: O, ProcessingInstruction: C, ProgressEvent: C, PromiseRejectionEvent: C, prompt: O, PushManager: C, PushSubscription: C, PushSubscriptionOptions: C, queueMicrotask: O, RadioNodeList: C, Range: C, ReadableStream: C, RemotePlayback: C, removeEventListener: O, Request: C, requestAnimationFrame: O, requestIdleCallback: O, resizeBy: O, ResizeObserver: C, ResizeObserverEntry: C, resizeTo: O, Response: C, RTCCertificate: C, RTCDataChannel: C, RTCDataChannelEvent: C, RTCDtlsTransport: C, RTCIceCandidate: C, RTCIceTransport: C, RTCPeerConnection: C, RTCPeerConnectionIceEvent: C, RTCRtpReceiver: C, RTCRtpSender: C, RTCSctpTransport: C, RTCSessionDescription: C, RTCStatsReport: C, RTCTrackEvent: C, screen: O, Screen: C, screenLeft: O, ScreenOrientation: C, screenTop: O, screenX: O, screenY: O, ScriptProcessorNode: C, scroll: O, scrollbars: O, scrollBy: O, scrollTo: O, scrollX: O, scrollY: O, SecurityPolicyViolationEvent: C, Selection: C, ServiceWorker: C, ServiceWorkerContainer: C, ServiceWorkerRegistration: C, sessionStorage: O, ShadowRoot: C, SharedWorker: C, SourceBuffer: C, SourceBufferList: C, speechSynthesis: O, SpeechSynthesisEvent: C, SpeechSynthesisUtterance: C, StaticRange: C, status: O, statusbar: O, StereoPannerNode: C, stop: O, Storage: C, StorageEvent: C, StorageManager: C, styleMedia: O, StyleSheet: C, StyleSheetList: C, SubtleCrypto: C, SVGAElement: C, SVGAngle: C, SVGAnimatedAngle: C, SVGAnimatedBoolean: C, SVGAnimatedEnumeration: C, SVGAnimatedInteger: C, SVGAnimatedLength: C, SVGAnimatedLengthList: C, SVGAnimatedNumber: C, SVGAnimatedNumberList: C, SVGAnimatedPreserveAspectRatio: C, SVGAnimatedRect: C, SVGAnimatedString: C, SVGAnimatedTransformList: C, SVGAnimateElement: C, SVGAnimateMotionElement: C, SVGAnimateTransformElement: C, SVGAnimationElement: C, SVGCircleElement: C, SVGClipPathElement: C, SVGComponentTransferFunctionElement: C, SVGDefsElement: C, SVGDescElement: C, SVGDiscardElement: C, SVGElement: C, SVGEllipseElement: C, SVGFEBlendElement: C, SVGFEColorMatrixElement: C, SVGFEComponentTransferElement: C, SVGFECompositeElement: C, SVGFEConvolveMatrixElement: C, SVGFEDiffuseLightingElement: C, SVGFEDisplacementMapElement: C, SVGFEDistantLightElement: C, SVGFEDropShadowElement: C, SVGFEFloodElement: C, SVGFEFuncAElement: C, SVGFEFuncBElement: C, SVGFEFuncGElement: C, SVGFEFuncRElement: C, SVGFEGaussianBlurElement: C, SVGFEImageElement: C, SVGFEMergeElement: C, SVGFEMergeNodeElement: C, SVGFEMorphologyElement: C, SVGFEOffsetElement: C, SVGFEPointLightElement: C, SVGFESpecularLightingElement: C, SVGFESpotLightElement: C, SVGFETileElement: C, SVGFETurbulenceElement: C, SVGFilterElement: C, SVGForeignObjectElement: C, SVGGElement: C, SVGGeometryElement: C, SVGGradientElement: C, SVGGraphicsElement: C, SVGImageElement: C, SVGLength: C, SVGLengthList: C, SVGLinearGradientElement: C, SVGLineElement: C, SVGMarkerElement: C, SVGMaskElement: C, SVGMatrix: C, SVGMetadataElement: C, SVGMPathElement: C, SVGNumber: C, SVGNumberList: C, SVGPathElement: C, SVGPatternElement: C, SVGPoint: C, SVGPointList: C, SVGPolygonElement: C, SVGPolylineElement: C, SVGPreserveAspectRatio: C, SVGRadialGradientElement: C, SVGRect: C, SVGRectElement: C, SVGScriptElement: C, SVGSetElement: C, SVGStopElement: C, SVGStringList: C, SVGStyleElement: C, SVGSVGElement: C, SVGSwitchElement: C, SVGSymbolElement: C, SVGTextContentElement: C, SVGTextElement: C, SVGTextPathElement: C, SVGTextPositioningElement: C, SVGTitleElement: C, SVGTransform: C, SVGTransformList: C, SVGTSpanElement: C, SVGUnitTypes: C, SVGUseElement: C, SVGViewElement: C, TaskAttributionTiming: C, Text: C, TextEvent: C, TextMetrics: C, TextTrack: C, TextTrackCue: C, TextTrackCueList: C, TextTrackList: C, TimeRanges: C, toolbar: O, top: O, Touch: C, TouchEvent: C, TouchList: C, TrackEvent: C, TransitionEvent: C, TreeWalker: C, UIEvent: C, ValidityState: C, visualViewport: O, VisualViewport: C, VTTCue: C, WaveShaperNode: C, WebAssembly: O, WebGL2RenderingContext: C, WebGLActiveInfo: C, WebGLBuffer: C, WebGLContextEvent: C, WebGLFramebuffer: C, WebGLProgram: C, WebGLQuery: C, WebGLRenderbuffer: C, WebGLRenderingContext: C, WebGLSampler: C, WebGLShader: C, WebGLShaderPrecisionFormat: C, WebGLSync: C, WebGLTexture: C, WebGLTransformFeedback: C, WebGLUniformLocation: C, WebGLVertexArrayObject: C, WebSocket: C, WheelEvent: C, Window: C, Worker: C, WritableStream: C, XMLDocument: C, XMLHttpRequest: C, XMLHttpRequestEventTarget: C, XMLHttpRequestUpload: C, XMLSerializer: C, XPathEvaluator: C, XPathExpression: C, XPathResult: C, XSLTProcessor: C }; for (const global of ['window', 'global', 'self', 'globalThis']) { knownGlobals[global] = knownGlobals; } export function getGlobalAtPath(path: ObjectPath): ValueDescription | null { let currentGlobal: GlobalDescription | null = knownGlobals; for (const pathSegment of path) { if (typeof pathSegment !== 'string') { return null; } currentGlobal = currentGlobal[pathSegment]; if (!currentGlobal) { return null; } } return currentGlobal[ValueProperties]; } rollup-3.29.4/src/ast/nodes/shared/loops.ts000066400000000000000000000020751450520414700205740ustar00rootroot00000000000000import type { HasEffectsContext, InclusionContext } from '../../ExecutionContext'; import type { StatementNode } from './Node'; export function hasLoopBodyEffects(context: HasEffectsContext, body: StatementNode): boolean { const { brokenFlow, hasBreak, hasContinue, ignore } = context; const { breaks, continues } = ignore; ignore.breaks = true; ignore.continues = true; context.hasBreak = false; context.hasContinue = false; if (body.hasEffects(context)) return true; ignore.breaks = breaks; ignore.continues = continues; context.hasBreak = hasBreak; context.hasContinue = hasContinue; context.brokenFlow = brokenFlow; return false; } export function includeLoopBody( context: InclusionContext, body: StatementNode, includeChildrenRecursively: boolean | 'variables' ) { const { brokenFlow, hasBreak, hasContinue } = context; context.hasBreak = false; context.hasContinue = false; body.include(context, includeChildrenRecursively, { asSingleStatement: true }); context.hasBreak = hasBreak; context.hasContinue = hasContinue; context.brokenFlow = brokenFlow; } rollup-3.29.4/src/ast/scopes/000077500000000000000000000000001450520414700160025ustar00rootroot00000000000000rollup-3.29.4/src/ast/scopes/BlockScope.ts000066400000000000000000000015071450520414700204010ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type LocalVariable from '../variables/LocalVariable'; import ChildScope from './ChildScope'; export default class BlockScope extends ChildScope { addDeclaration( identifier: Identifier, context: AstContext, init: ExpressionEntity, isHoisted: boolean ): LocalVariable { if (isHoisted) { const variable = this.parent.addDeclaration(identifier, context, init, isHoisted); // Necessary to make sure the init is deoptimized for conditional declarations. // We cannot call deoptimizePath here. variable.markInitializersForDeoptimization(); return variable; } else { return super.addDeclaration(identifier, context, init, false); } } } rollup-3.29.4/src/ast/scopes/CatchScope.ts000066400000000000000000000021131450520414700203630ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import { UNDEFINED_EXPRESSION } from '../values'; import type LocalVariable from '../variables/LocalVariable'; import ParameterScope from './ParameterScope'; export default class CatchScope extends ParameterScope { addDeclaration( identifier: Identifier, context: AstContext, init: ExpressionEntity, isHoisted: boolean ): LocalVariable { const existingParameter = this.variables.get(identifier.name) as LocalVariable; if (existingParameter) { // While we still create a hoisted declaration, the initializer goes to // the parameter. Note that technically, the declaration now belongs to // two variables, which is not correct but should not cause issues. this.parent.addDeclaration(identifier, context, UNDEFINED_EXPRESSION, isHoisted); existingParameter.addDeclaration(identifier, init); return existingParameter; } return this.parent.addDeclaration(identifier, context, init, isHoisted); } } rollup-3.29.4/src/ast/scopes/ChildScope.ts000066400000000000000000000072431450520414700203750ustar00rootroot00000000000000import type { InternalModuleFormat } from '../../rollup/types'; import { getSafeName } from '../../utils/safeName'; import type ImportExpression from '../nodes/ImportExpression'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type Variable from '../variables/Variable'; import Scope from './Scope'; export default class ChildScope extends Scope { readonly accessedOutsideVariables = new Map(); parent: Scope; private declare accessedDynamicImports?: Set; constructor(parent: Scope) { super(); this.parent = parent; parent.children.push(this); } addAccessedDynamicImport(importExpression: ImportExpression): void { (this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add( importExpression ); if (this.parent instanceof ChildScope) { this.parent.addAccessedDynamicImport(importExpression); } } addAccessedGlobals( globals: readonly string[], accessedGlobalsByScope: Map> ): void { const accessedGlobals = accessedGlobalsByScope.get(this) || new Set(); for (const name of globals) { accessedGlobals.add(name); } accessedGlobalsByScope.set(this, accessedGlobals); if (this.parent instanceof ChildScope) { this.parent.addAccessedGlobals(globals, accessedGlobalsByScope); } } addNamespaceMemberAccess(name: string, variable: Variable): void { this.accessedOutsideVariables.set(name, variable); (this.parent as ChildScope).addNamespaceMemberAccess(name, variable); } addReturnExpression(expression: ExpressionEntity): void { this.parent instanceof ChildScope && this.parent.addReturnExpression(expression); } addUsedOutsideNames( usedNames: Set, format: InternalModuleFormat, exportNamesByVariable: ReadonlyMap, accessedGlobalsByScope: ReadonlyMap> ): void { for (const variable of this.accessedOutsideVariables.values()) { if (variable.included) { usedNames.add(variable.getBaseVariableName()); if (format === 'system' && exportNamesByVariable.has(variable)) { usedNames.add('exports'); } } } const accessedGlobals = accessedGlobalsByScope.get(this); if (accessedGlobals) { for (const name of accessedGlobals) { usedNames.add(name); } } } contains(name: string): boolean { return this.variables.has(name) || this.parent.contains(name); } deconflict( format: InternalModuleFormat, exportNamesByVariable: ReadonlyMap, accessedGlobalsByScope: ReadonlyMap> ): void { const usedNames = new Set(); this.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope); if (this.accessedDynamicImports) { for (const importExpression of this.accessedDynamicImports) { if (importExpression.inlineNamespace) { usedNames.add(importExpression.inlineNamespace.getBaseVariableName()); } } } for (const [name, variable] of this.variables) { if (variable.included || variable.alwaysRendered) { variable.setRenderNames(null, getSafeName(name, usedNames, variable.forbiddenNames)); } } for (const scope of this.children) { scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); } } findLexicalBoundary(): ChildScope { return (this.parent as ChildScope).findLexicalBoundary(); } findVariable(name: string): Variable { const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); if (knownVariable) { return knownVariable; } const variable = this.parent.findVariable(name); this.accessedOutsideVariables.set(name, variable); return variable; } } rollup-3.29.4/src/ast/scopes/ClassBodyScope.ts000066400000000000000000000014441450520414700212320ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type ClassNode from '../nodes/shared/ClassNode'; import LocalVariable from '../variables/LocalVariable'; import ThisVariable from '../variables/ThisVariable'; import ChildScope from './ChildScope'; import type Scope from './Scope'; export default class ClassBodyScope extends ChildScope { readonly instanceScope: ChildScope; readonly thisVariable: LocalVariable; constructor(parent: Scope, classNode: ClassNode, context: AstContext) { super(parent); this.variables.set( 'this', (this.thisVariable = new LocalVariable('this', null, classNode, context)) ); this.instanceScope = new ChildScope(this); this.instanceScope.variables.set('this', new ThisVariable(context)); } findLexicalBoundary(): ChildScope { return this; } } rollup-3.29.4/src/ast/scopes/FunctionScope.ts000066400000000000000000000023501450520414700211310ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type { InclusionContext } from '../ExecutionContext'; import type SpreadElement from '../nodes/SpreadElement'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import ArgumentsVariable from '../variables/ArgumentsVariable'; import ThisVariable from '../variables/ThisVariable'; import type ChildScope from './ChildScope'; import ReturnValueScope from './ReturnValueScope'; export default class FunctionScope extends ReturnValueScope { readonly argumentsVariable: ArgumentsVariable; readonly thisVariable: ThisVariable; constructor(parent: ChildScope, context: AstContext) { super(parent, context); this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context))); this.variables.set('this', (this.thisVariable = new ThisVariable(context))); } findLexicalBoundary(): ChildScope { return this; } includeCallArguments( context: InclusionContext, parameters: readonly (ExpressionEntity | SpreadElement)[] ): void { super.includeCallArguments(context, parameters); if (this.argumentsVariable.included) { for (const argument of parameters) { if (!argument.included) { argument.include(context, false); } } } } } rollup-3.29.4/src/ast/scopes/GlobalScope.ts000066400000000000000000000010721450520414700205440ustar00rootroot00000000000000import GlobalVariable from '../variables/GlobalVariable'; import UndefinedVariable from '../variables/UndefinedVariable'; import type Variable from '../variables/Variable'; import Scope from './Scope'; export default class GlobalScope extends Scope { parent = null; constructor() { super(); this.variables.set('undefined', new UndefinedVariable()); } findVariable(name: string): Variable { let variable = this.variables.get(name); if (!variable) { variable = new GlobalVariable(name); this.variables.set(name, variable); } return variable; } } rollup-3.29.4/src/ast/scopes/ModuleScope.ts000066400000000000000000000040201450520414700205650ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type { InternalModuleFormat } from '../../rollup/types'; import type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration'; import { UNDEFINED_EXPRESSION } from '../values'; import ExportDefaultVariable from '../variables/ExportDefaultVariable'; import GlobalVariable from '../variables/GlobalVariable'; import LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import ChildScope from './ChildScope'; import type GlobalScope from './GlobalScope'; export default class ModuleScope extends ChildScope { readonly context: AstContext; declare parent: GlobalScope; constructor(parent: GlobalScope, context: AstContext) { super(parent); this.context = context; this.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context)); } addExportDefaultDeclaration( name: string, exportDefaultDeclaration: ExportDefaultDeclaration, context: AstContext ): ExportDefaultVariable { const variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context); this.variables.set('default', variable); return variable; } addNamespaceMemberAccess(): void {} deconflict( format: InternalModuleFormat, exportNamesByVariable: ReadonlyMap, accessedGlobalsByScope: ReadonlyMap> ): void { // all module level variables are already deconflicted when deconflicting the chunk for (const scope of this.children) scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); } findLexicalBoundary(): this { return this; } findVariable(name: string): Variable { const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); if (knownVariable) { return knownVariable; } const variable = this.context.traceVariable(name) || this.parent.findVariable(name); if (variable instanceof GlobalVariable) { this.accessedOutsideVariables.set(name, variable); } return variable; } } rollup-3.29.4/src/ast/scopes/ParameterScope.ts000066400000000000000000000056321450520414700212720ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type { InclusionContext } from '../ExecutionContext'; import type Identifier from '../nodes/Identifier'; import SpreadElement from '../nodes/SpreadElement'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type LocalVariable from '../variables/LocalVariable'; import ParameterVariable from '../variables/ParameterVariable'; import ChildScope from './ChildScope'; import type Scope from './Scope'; export default class ParameterScope extends ChildScope { readonly hoistedBodyVarScope: ChildScope; parameters: readonly ParameterVariable[][] = []; private readonly context: AstContext; private hasRest = false; constructor(parent: Scope, context: AstContext) { super(parent); this.context = context; this.hoistedBodyVarScope = new ChildScope(this); } /** * Adds a parameter to this scope. Parameters must be added in the correct * order, i.e. from left to right. */ addParameterDeclaration(identifier: Identifier): ParameterVariable { const { name } = identifier; const variable = new ParameterVariable(name, identifier, this.context); const localVariable = this.hoistedBodyVarScope.variables.get(name) as LocalVariable; if (localVariable) { this.hoistedBodyVarScope.variables.set(name, variable); variable.mergeDeclarations(localVariable); } this.variables.set(name, variable); return variable; } addParameterVariables(parameters: ParameterVariable[][], hasRest: boolean): void { this.parameters = parameters; for (const parameterList of parameters) { for (const parameter of parameterList) { parameter.alwaysRendered = true; } } this.hasRest = hasRest; } includeCallArguments( context: InclusionContext, parameters: readonly (ExpressionEntity | SpreadElement)[] ): void { let calledFromTryStatement = false; let argumentIncluded = false; const restParameter = this.hasRest && this.parameters[this.parameters.length - 1]; for (const checkedArgument of parameters) { if (checkedArgument instanceof SpreadElement) { for (const argument of parameters) { argument.include(context, false); } break; } } for (let index = parameters.length - 1; index >= 0; index--) { const parameterVariables = this.parameters[index] || restParameter; const argument = parameters[index]; if (parameterVariables) { calledFromTryStatement = false; if (parameterVariables.length === 0) { // handle empty destructuring argumentIncluded = true; } else { for (const variable of parameterVariables) { if (variable.included) { argumentIncluded = true; } if (variable.calledFromTryStatement) { calledFromTryStatement = true; } } } } if (!argumentIncluded && argument.shouldBeIncluded(context)) { argumentIncluded = true; } if (argumentIncluded) { argument.include(context, calledFromTryStatement); } } } } rollup-3.29.4/src/ast/scopes/ReturnValueScope.ts000066400000000000000000000016471450520414700216300ustar00rootroot00000000000000import { type ExpressionEntity, UNKNOWN_EXPRESSION } from '../nodes/shared/Expression'; import { UNKNOWN_PATH } from '../utils/PathTracker'; import ParameterScope from './ParameterScope'; export default class ReturnValueScope extends ParameterScope { private returnExpression: ExpressionEntity | null = null; private readonly returnExpressions: ExpressionEntity[] = []; addReturnExpression(expression: ExpressionEntity): void { this.returnExpressions.push(expression); } getReturnExpression(): ExpressionEntity { if (this.returnExpression === null) this.updateReturnExpression(); return this.returnExpression!; } private updateReturnExpression() { if (this.returnExpressions.length === 1) { this.returnExpression = this.returnExpressions[0]; } else { this.returnExpression = UNKNOWN_EXPRESSION; for (const expression of this.returnExpressions) { expression.deoptimizePath(UNKNOWN_PATH); } } } } rollup-3.29.4/src/ast/scopes/Scope.ts000066400000000000000000000022431450520414700174240ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import { UNDEFINED_EXPRESSION } from '../values'; import LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import type ChildScope from './ChildScope'; export default class Scope { readonly children: ChildScope[] = []; readonly variables = new Map(); addDeclaration( identifier: Identifier, context: AstContext, init: ExpressionEntity, _isHoisted: boolean ): LocalVariable { const name = identifier.name; let variable = this.variables.get(name) as LocalVariable; if (variable) { variable.addDeclaration(identifier, init); } else { variable = new LocalVariable( identifier.name, identifier, init || UNDEFINED_EXPRESSION, context ); this.variables.set(name, variable); } return variable; } contains(name: string): boolean { return this.variables.has(name); } findVariable(_name: string): Variable { throw new Error('Internal Error: findVariable needs to be implemented by a subclass'); } } rollup-3.29.4/src/ast/scopes/TrackingScope.ts000066400000000000000000000011631450520414700211070ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type LocalVariable from '../variables/LocalVariable'; import BlockScope from './BlockScope'; export default class TrackingScope extends BlockScope { readonly hoistedDeclarations: Identifier[] = []; addDeclaration( identifier: Identifier, context: AstContext, init: ExpressionEntity, isHoisted: boolean ): LocalVariable { this.hoistedDeclarations.push(identifier); return super.addDeclaration(identifier, context, init, isHoisted); } } rollup-3.29.4/src/ast/utils/000077500000000000000000000000001450520414700156465ustar00rootroot00000000000000rollup-3.29.4/src/ast/utils/PathTracker.ts000066400000000000000000000067451450520414700204420ustar00rootroot00000000000000import { getNewSet, getOrCreate } from '../../utils/getOrCreate'; import type { Entity } from '../Entity'; export const UnknownKey = Symbol('Unknown Key'); export const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key'); export const UnknownInteger = Symbol('Unknown Integer'); export const SymbolToStringTag = Symbol('Symbol.toStringTag'); export type ObjectPathKey = | string | typeof UnknownKey | typeof UnknownNonAccessorKey | typeof UnknownInteger | typeof SymbolToStringTag; export type ObjectPath = readonly ObjectPathKey[]; export const EMPTY_PATH: ObjectPath = []; export const UNKNOWN_PATH: ObjectPath = [UnknownKey]; // For deoptimizations, this means we are modifying an unknown property but did // not lose track of the object or are creating a setter/getter; // For assignment effects it means we do not check for setter/getter effects // but only if something is mutated that is included, which is relevant for // Object.defineProperty export const UNKNOWN_NON_ACCESSOR_PATH: ObjectPath = [UnknownNonAccessorKey]; export const UNKNOWN_INTEGER_PATH: ObjectPath = [UnknownInteger]; const EntitiesKey = Symbol('Entities'); interface EntityPaths { [pathSegment: string]: EntityPaths; [EntitiesKey]: Set; [SymbolToStringTag]?: EntityPaths; [UnknownInteger]?: EntityPaths; [UnknownKey]?: EntityPaths; [UnknownNonAccessorKey]?: EntityPaths; } export class PathTracker { private entityPaths: EntityPaths = Object.create(null, { [EntitiesKey]: { value: new Set() } }); trackEntityAtPathAndGetIfTracked(path: ObjectPath, entity: Entity): boolean { const trackedEntities = this.getEntities(path); if (trackedEntities.has(entity)) return true; trackedEntities.add(entity); return false; } withTrackedEntityAtPath( path: ObjectPath, entity: Entity, onUntracked: () => T, returnIfTracked: T ): T { const trackedEntities = this.getEntities(path); if (trackedEntities.has(entity)) return returnIfTracked; trackedEntities.add(entity); const result = onUntracked(); trackedEntities.delete(entity); return result; } private getEntities(path: ObjectPath): Set { let currentPaths = this.entityPaths; for (const pathSegment of path) { currentPaths = currentPaths[pathSegment] = currentPaths[pathSegment] || Object.create(null, { [EntitiesKey]: { value: new Set() } }); } return currentPaths[EntitiesKey]; } } export const SHARED_RECURSION_TRACKER = new PathTracker(); interface DiscriminatedEntityPaths { [pathSegment: string]: DiscriminatedEntityPaths; [EntitiesKey]: Map>; [SymbolToStringTag]?: DiscriminatedEntityPaths; [UnknownInteger]?: DiscriminatedEntityPaths; [UnknownKey]?: DiscriminatedEntityPaths; [UnknownNonAccessorKey]?: DiscriminatedEntityPaths; } export class DiscriminatedPathTracker { private entityPaths: DiscriminatedEntityPaths = Object.create(null, { [EntitiesKey]: { value: new Map>() } }); trackEntityAtPathAndGetIfTracked( path: ObjectPath, discriminator: unknown, entity: unknown ): boolean { let currentPaths = this.entityPaths; for (const pathSegment of path) { currentPaths = currentPaths[pathSegment] = currentPaths[pathSegment] || Object.create(null, { [EntitiesKey]: { value: new Map>() } }); } const trackedEntities = getOrCreate( currentPaths[EntitiesKey], discriminator, getNewSet ); if (trackedEntities.has(entity)) return true; trackedEntities.add(entity); return false; } } rollup-3.29.4/src/ast/values.ts000066400000000000000000000177711450520414700163720ustar00rootroot00000000000000import type { HasEffectsContext } from './ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from './NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_CALLED, NODE_INTERACTION_UNKNOWN_CALL } from './NodeInteractions'; import type { LiteralValue } from './nodes/Literal'; import { ExpressionEntity, UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION } from './nodes/shared/Expression'; import { EMPTY_PATH, type ObjectPath, type ObjectPathKey, SHARED_RECURSION_TRACKER } from './utils/PathTracker'; export interface MemberDescription { hasEffectsWhenCalled: | ((interaction: NodeInteractionCalled, context: HasEffectsContext) => boolean) | null; returns: ExpressionEntity; } export interface MemberDescriptions { [key: string]: MemberDescription; } interface RawMemberDescription { value: MemberDescription; } function assembleMemberDescriptions( memberDescriptions: { [key: string]: RawMemberDescription }, inheritedDescriptions: MemberDescriptions | null = null ): MemberDescriptions { return Object.create(inheritedDescriptions, memberDescriptions); } export const UNDEFINED_EXPRESSION: ExpressionEntity = new (class UndefinedExpression extends ExpressionEntity { getLiteralValueAtPath() { return undefined; } })(); const returnsUnknown: RawMemberDescription = { value: { hasEffectsWhenCalled: null, returns: UNKNOWN_EXPRESSION } }; export const UNKNOWN_LITERAL_BOOLEAN: ExpressionEntity = new (class UnknownBoolean extends ExpressionEntity { getReturnExpressionWhenCalledAtPath( path: ObjectPath ): [expression: ExpressionEntity, isPure: boolean] { if (path.length === 1) { return getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]); } return UNKNOWN_RETURN_EXPRESSION; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (interaction.type === INTERACTION_ACCESSED) { return path.length > 1; } if (interaction.type === INTERACTION_CALLED && path.length === 1) { return hasMemberEffectWhenCalled(literalBooleanMembers, path[0], interaction, context); } return true; } })(); const returnsBoolean: RawMemberDescription = { value: { hasEffectsWhenCalled: null, returns: UNKNOWN_LITERAL_BOOLEAN } }; export const UNKNOWN_LITERAL_NUMBER: ExpressionEntity = new (class UnknownNumber extends ExpressionEntity { getReturnExpressionWhenCalledAtPath( path: ObjectPath ): [expression: ExpressionEntity, isPure: boolean] { if (path.length === 1) { return getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]); } return UNKNOWN_RETURN_EXPRESSION; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (interaction.type === INTERACTION_ACCESSED) { return path.length > 1; } if (interaction.type === INTERACTION_CALLED && path.length === 1) { return hasMemberEffectWhenCalled(literalNumberMembers, path[0], interaction, context); } return true; } })(); const returnsNumber: RawMemberDescription = { value: { hasEffectsWhenCalled: null, returns: UNKNOWN_LITERAL_NUMBER } }; export const UNKNOWN_LITERAL_STRING: ExpressionEntity = new (class UnknownString extends ExpressionEntity { getReturnExpressionWhenCalledAtPath( path: ObjectPath ): [expression: ExpressionEntity, isPure: boolean] { if (path.length === 1) { return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); } return UNKNOWN_RETURN_EXPRESSION; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { if (interaction.type === INTERACTION_ACCESSED) { return path.length > 1; } if (interaction.type === INTERACTION_CALLED && path.length === 1) { return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); } return true; } })(); const returnsString: RawMemberDescription = { value: { hasEffectsWhenCalled: null, returns: UNKNOWN_LITERAL_STRING } }; const stringReplace: RawMemberDescription = { value: { hasEffectsWhenCalled({ args }, context) { const argument1 = args[2]; return ( args.length < 3 || (typeof argument1.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, { deoptimizeCache() {} }) === 'symbol' && argument1.hasEffectsOnInteractionAtPath( EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context )) ); }, returns: UNKNOWN_LITERAL_STRING } }; const objectMembers: MemberDescriptions = assembleMemberDescriptions({ hasOwnProperty: returnsBoolean, isPrototypeOf: returnsBoolean, propertyIsEnumerable: returnsBoolean, toLocaleString: returnsString, toString: returnsString, valueOf: returnsUnknown }); const literalBooleanMembers: MemberDescriptions = assembleMemberDescriptions( { valueOf: returnsBoolean }, objectMembers ); const literalNumberMembers: MemberDescriptions = assembleMemberDescriptions( { toExponential: returnsString, toFixed: returnsString, toLocaleString: returnsString, toPrecision: returnsString, valueOf: returnsNumber }, objectMembers ); /** * RegExp are stateful when they have the global or sticky flags set. * But if we actually don't use them, the side effect does not matter. * the check logic in `hasEffectsOnInteractionAtPath`. */ const literalRegExpMembers: MemberDescriptions = assembleMemberDescriptions( { exec: returnsUnknown, test: returnsBoolean }, objectMembers ); export const literalStringMembers: MemberDescriptions = assembleMemberDescriptions( { anchor: returnsString, at: returnsUnknown, big: returnsString, blink: returnsString, bold: returnsString, charAt: returnsString, charCodeAt: returnsNumber, codePointAt: returnsUnknown, concat: returnsString, endsWith: returnsBoolean, fixed: returnsString, fontcolor: returnsString, fontsize: returnsString, includes: returnsBoolean, indexOf: returnsNumber, italics: returnsString, lastIndexOf: returnsNumber, link: returnsString, localeCompare: returnsNumber, match: returnsUnknown, matchAll: returnsUnknown, normalize: returnsString, padEnd: returnsString, padStart: returnsString, repeat: returnsString, replace: stringReplace, replaceAll: stringReplace, search: returnsNumber, slice: returnsString, small: returnsString, split: returnsUnknown, startsWith: returnsBoolean, strike: returnsString, sub: returnsString, substr: returnsString, substring: returnsString, sup: returnsString, toLocaleLowerCase: returnsString, toLocaleUpperCase: returnsString, toLowerCase: returnsString, toString: returnsString, // overrides the toString() method of the Object object; it does not inherit Object.prototype.toString() toUpperCase: returnsString, trim: returnsString, trimEnd: returnsString, trimLeft: returnsString, trimRight: returnsString, trimStart: returnsString, valueOf: returnsString }, objectMembers ); export function getLiteralMembersForValue( value: T ): MemberDescriptions { if (value instanceof RegExp) { return literalRegExpMembers; } switch (typeof value) { case 'boolean': { return literalBooleanMembers; } case 'number': { return literalNumberMembers; } case 'string': { return literalStringMembers; } } return Object.create(null); } export function hasMemberEffectWhenCalled( members: MemberDescriptions, memberName: ObjectPathKey, interaction: NodeInteractionCalled, context: HasEffectsContext ): boolean { if (typeof memberName !== 'string' || !members[memberName]) { return true; } return members[memberName].hasEffectsWhenCalled?.(interaction, context) || false; } export function getMemberReturnExpressionWhenCalled( members: MemberDescriptions, memberName: ObjectPathKey ): [expression: ExpressionEntity, isPure: boolean] { if (typeof memberName !== 'string' || !members[memberName]) return UNKNOWN_RETURN_EXPRESSION; return [members[memberName].returns, false]; } rollup-3.29.4/src/ast/variables/000077500000000000000000000000001450520414700164565ustar00rootroot00000000000000rollup-3.29.4/src/ast/variables/ArgumentsVariable.ts000066400000000000000000000022511450520414700224410ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import { UNKNOWN_EXPRESSION } from '../nodes/shared/Expression'; import type { ObjectPath } from '../utils/PathTracker'; import { UNKNOWN_PATH } from '../utils/PathTracker'; import LocalVariable from './LocalVariable'; export default class ArgumentsVariable extends LocalVariable { private deoptimizedArguments: ExpressionEntity[] = []; constructor(context: AstContext) { super('arguments', null, UNKNOWN_EXPRESSION, context); } addArgumentToBeDeoptimized(argument: ExpressionEntity): void { if (this.included) { argument.deoptimizePath(UNKNOWN_PATH); } else { this.deoptimizedArguments.push(argument); } } hasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean { return type !== INTERACTION_ACCESSED || path.length > 1; } include() { super.include(); for (const argument of this.deoptimizedArguments) { argument.deoptimizePath(UNKNOWN_PATH); } this.deoptimizedArguments.length = 0; } } rollup-3.29.4/src/ast/variables/ExportDefaultVariable.ts000066400000000000000000000056761450520414700233000ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import ClassDeclaration from '../nodes/ClassDeclaration'; import type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration'; import FunctionDeclaration from '../nodes/FunctionDeclaration'; import Identifier, { type IdentifierWithVariable } from '../nodes/Identifier'; import LocalVariable from './LocalVariable'; import UndefinedVariable from './UndefinedVariable'; import type Variable from './Variable'; export default class ExportDefaultVariable extends LocalVariable { hasId = false; private originalId: IdentifierWithVariable | null = null; private originalVariable: Variable | null = null; constructor( name: string, exportDefaultDeclaration: ExportDefaultDeclaration, context: AstContext ) { super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context); const declaration = exportDefaultDeclaration.declaration; if ( (declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) && declaration.id ) { this.hasId = true; this.originalId = declaration.id; } else if (declaration instanceof Identifier) { this.originalId = declaration as IdentifierWithVariable; } } addReference(identifier: Identifier): void { if (!this.hasId) { this.name = identifier.name; } } forbidName(name: string) { const original = this.getOriginalVariable(); if (original === this) { super.forbidName(name); } else { original.forbidName(name); } } getAssignedVariableName(): string | null { return (this.originalId && this.originalId.name) || null; } getBaseVariableName(): string { const original = this.getOriginalVariable(); return original === this ? super.getBaseVariableName() : original.getBaseVariableName(); } getDirectOriginalVariable(): Variable | null { return this.originalId && (this.hasId || !( this.originalId.isPossibleTDZ() || this.originalId.variable.isReassigned || this.originalId.variable instanceof UndefinedVariable || // this avoids a circular dependency 'syntheticNamespace' in this.originalId.variable )) ? this.originalId.variable : null; } getName(getPropertyAccess: (name: string) => string): string { const original = this.getOriginalVariable(); return original === this ? super.getName(getPropertyAccess) : original.getName(getPropertyAccess); } getOriginalVariable(): Variable { if (this.originalVariable) return this.originalVariable; // eslint-disable-next-line @typescript-eslint/no-this-alias let original: Variable | null = this; let currentVariable: Variable; const checkedVariables = new Set(); do { checkedVariables.add(original); currentVariable = original; original = (currentVariable as ExportDefaultVariable).getDirectOriginalVariable(); } while (original instanceof ExportDefaultVariable && !checkedVariables.has(original)); return (this.originalVariable = original || currentVariable); } } rollup-3.29.4/src/ast/variables/ExportShimVariable.ts000066400000000000000000000006371450520414700226040ustar00rootroot00000000000000import type Module from '../../Module'; import { MISSING_EXPORT_SHIM_VARIABLE } from '../../utils/variableNames'; import Variable from './Variable'; export default class ExportShimVariable extends Variable { readonly module: Module; constructor(module: Module) { super(MISSING_EXPORT_SHIM_VARIABLE); this.module = module; } include(): void { super.include(); this.module.needsExportShim = true; } } rollup-3.29.4/src/ast/variables/ExternalVariable.ts000066400000000000000000000020361450520414700222570ustar00rootroot00000000000000import type ExternalModule from '../../ExternalModule'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import type Identifier from '../nodes/Identifier'; import type { ObjectPath } from '../utils/PathTracker'; import Variable from './Variable'; export default class ExternalVariable extends Variable { readonly isNamespace: boolean; readonly module: ExternalModule; referenced = false; constructor(module: ExternalModule, name: string) { super(name); this.module = module; this.isNamespace = name === '*'; } addReference(identifier: Identifier): void { this.referenced = true; if (this.name === 'default' || this.name === '*') { this.module.suggestName(identifier.name); } } hasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean { return type !== INTERACTION_ACCESSED || path.length > (this.isNamespace ? 1 : 0); } include(): void { if (!this.included) { this.included = true; this.module.used = true; } } } rollup-3.29.4/src/ast/variables/GlobalVariable.ts000066400000000000000000000050071450520414700216760ustar00rootroot00000000000000import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_ASSIGNED, INTERACTION_CALLED } from '../NodeInteractions'; import type { LiteralValueOrUnknown } from '../nodes/shared/Expression'; import { UnknownValue } from '../nodes/shared/Expression'; import { getGlobalAtPath } from '../nodes/shared/knownGlobals'; import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import Variable from './Variable'; export default class GlobalVariable extends Variable { // Ensure we use live-bindings for globals as we do not know if they have // been reassigned isReassigned = true; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ) { switch (interaction.type) { // While there is no point in testing these cases as at the moment, they // are also covered via other means, we keep them for completeness case INTERACTION_ACCESSED: case INTERACTION_ASSIGNED: { if (!getGlobalAtPath([this.name, ...path].slice(0, -1))) { super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } return; } case INTERACTION_CALLED: { const globalAtPath = getGlobalAtPath([this.name, ...path]); if (globalAtPath) { globalAtPath.deoptimizeArgumentsOnCall(interaction); } else { super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } return; } } } getLiteralValueAtPath( path: ObjectPath, _recursionTracker: PathTracker, _origin: DeoptimizableEntity ): LiteralValueOrUnknown { const globalAtPath = getGlobalAtPath([this.name, ...path]); return globalAtPath ? globalAtPath.getLiteralValue() : UnknownValue; } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { switch (interaction.type) { case INTERACTION_ACCESSED: { if (path.length === 0) { // Technically, "undefined" is a global variable of sorts return this.name !== 'undefined' && !getGlobalAtPath([this.name]); } return !getGlobalAtPath([this.name, ...path].slice(0, -1)); } case INTERACTION_ASSIGNED: { return true; } case INTERACTION_CALLED: { const globalAtPath = getGlobalAtPath([this.name, ...path]); return !globalAtPath || globalAtPath.hasEffectsWhenCalled(interaction, context); } } } } rollup-3.29.4/src/ast/variables/LocalVariable.ts000066400000000000000000000161641450520414700215360ustar00rootroot00000000000000import type { AstContext, default as Module } from '../../Module'; import { EMPTY_ARRAY } from '../../utils/blank'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import { createInclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_ASSIGNED, INTERACTION_CALLED } from '../NodeInteractions'; import type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration'; import type Identifier from '../nodes/Identifier'; import * as NodeType from '../nodes/NodeType'; import type SpreadElement from '../nodes/SpreadElement'; import { deoptimizeInteraction, type ExpressionEntity, type LiteralValueOrUnknown, UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION, UnknownValue } from '../nodes/shared/Expression'; import type { Node } from '../nodes/shared/Node'; import { type ObjectPath, type PathTracker, UNKNOWN_PATH } from '../utils/PathTracker'; import Variable from './Variable'; export default class LocalVariable extends Variable { calledFromTryStatement = false; readonly declarations: (Identifier | ExportDefaultDeclaration)[]; readonly module: Module; protected additionalInitializers: ExpressionEntity[] | null = null; // Caching and deoptimization: // We track deoptimization when we do not return something unknown protected deoptimizationTracker: PathTracker; private expressionsToBeDeoptimized: DeoptimizableEntity[] = []; constructor( name: string, declarator: Identifier | ExportDefaultDeclaration | null, private init: ExpressionEntity, context: AstContext ) { super(name); this.declarations = declarator ? [declarator] : []; this.deoptimizationTracker = context.deoptimizationTracker; this.module = context.module; } addDeclaration(identifier: Identifier, init: ExpressionEntity): void { this.declarations.push(identifier); this.markInitializersForDeoptimization().push(init); } consolidateInitializers(): void { if (this.additionalInitializers) { for (const initializer of this.additionalInitializers) { initializer.deoptimizePath(UNKNOWN_PATH); } this.additionalInitializers = null; } } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ): void { if (this.isReassigned) { deoptimizeInteraction(interaction); return; } recursionTracker.withTrackedEntityAtPath( path, this.init, () => this.init.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker), undefined ); } deoptimizePath(path: ObjectPath): void { if ( this.isReassigned || this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this) ) { return; } if (path.length === 0) { if (!this.isReassigned) { this.isReassigned = true; const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; this.expressionsToBeDeoptimized = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } this.init.deoptimizePath(UNKNOWN_PATH); } } else { this.init.deoptimizePath(path); } } getLiteralValueAtPath( path: ObjectPath, recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (this.isReassigned) { return UnknownValue; } return recursionTracker.withTrackedEntityAtPath( path, this.init, () => { this.expressionsToBeDeoptimized.push(origin); return this.init.getLiteralValueAtPath(path, recursionTracker, origin); }, UnknownValue ); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, recursionTracker: PathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { if (this.isReassigned) { return UNKNOWN_RETURN_EXPRESSION; } return recursionTracker.withTrackedEntityAtPath( path, this.init, () => { this.expressionsToBeDeoptimized.push(origin); return this.init.getReturnExpressionWhenCalledAtPath( path, interaction, recursionTracker, origin ); }, UNKNOWN_RETURN_EXPRESSION ); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { switch (interaction.type) { case INTERACTION_ACCESSED: { if (this.isReassigned) return true; return ( !context.accessed.trackEntityAtPathAndGetIfTracked(path, this) && this.init.hasEffectsOnInteractionAtPath(path, interaction, context) ); } case INTERACTION_ASSIGNED: { if (this.included) return true; if (path.length === 0) return false; if (this.isReassigned) return true; return ( !context.assigned.trackEntityAtPathAndGetIfTracked(path, this) && this.init.hasEffectsOnInteractionAtPath(path, interaction, context) ); } case INTERACTION_CALLED: { if (this.isReassigned) return true; return ( !( interaction.withNew ? context.instantiated : context.called ).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) && this.init.hasEffectsOnInteractionAtPath(path, interaction, context) ); } } } include(): void { if (!this.included) { this.included = true; for (const declaration of this.declarations) { // If node is a default export, it can save a tree-shaking run to include the full declaration now if (!declaration.included) declaration.include(createInclusionContext(), false); let node = declaration.parent as Node; while (!node.included) { // We do not want to properly include parents in case they are part of a dead branch // in which case .include() might pull in more dead code node.included = true; if (node.type === NodeType.Program) break; node = node.parent as Node; } } } } includeCallArguments( context: InclusionContext, parameters: readonly (ExpressionEntity | SpreadElement)[] ): void { if (this.isReassigned || context.includedCallArguments.has(this.init)) { for (const argument of parameters) { argument.include(context, false); } } else { context.includedCallArguments.add(this.init); this.init.includeCallArguments(context, parameters); context.includedCallArguments.delete(this.init); } } markCalledFromTryStatement(): void { this.calledFromTryStatement = true; } markInitializersForDeoptimization(): ExpressionEntity[] { if (this.additionalInitializers === null) { this.additionalInitializers = [this.init]; this.init = UNKNOWN_EXPRESSION; this.isReassigned = true; } return this.additionalInitializers; } mergeDeclarations(variable: LocalVariable): void { const { declarations } = this; for (const declaration of variable.declarations) { declarations.push(declaration); } const additionalInitializers = this.markInitializersForDeoptimization(); additionalInitializers.push(variable.init); if (variable.additionalInitializers) { for (const initializer of variable.additionalInitializers) { additionalInitializers.push(initializer); } } } } rollup-3.29.4/src/ast/variables/NamespaceVariable.ts000066400000000000000000000136341450520414700223770ustar00rootroot00000000000000import type { AstContext, default as Module } from '../../Module'; import { getToStringTagValue, MERGE_NAMESPACES_VARIABLE } from '../../utils/interopHelpers'; import type { RenderOptions } from '../../utils/renderHelpers'; import { getSystemExportStatement } from '../../utils/systemJsRendering'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ASSIGNED, INTERACTION_CALLED } from '../NodeInteractions'; import type Identifier from '../nodes/Identifier'; import type { LiteralValueOrUnknown } from '../nodes/shared/Expression'; import { deoptimizeInteraction, UnknownValue } from '../nodes/shared/Expression'; import type ChildScope from '../scopes/ChildScope'; import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import { SymbolToStringTag } from '../utils/PathTracker'; import Variable from './Variable'; export default class NamespaceVariable extends Variable { readonly context: AstContext; declare isNamespace: true; readonly module: Module; private memberVariables: { [name: string]: Variable } | null = null; private mergedNamespaces: readonly Variable[] = []; private referencedEarly = false; private references: Identifier[] = []; constructor(context: AstContext) { super(context.getModuleName()); this.context = context; this.module = context.module; } addReference(identifier: Identifier): void { this.references.push(identifier); this.name = identifier.name; } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, recursionTracker: PathTracker ) { if (path.length > 1 || (path.length === 1 && interaction.type === INTERACTION_CALLED)) { const key = path[0]; if (typeof key === 'string') { this.getMemberVariables()[key]?.deoptimizeArgumentsOnInteractionAtPath( interaction, path.slice(1), recursionTracker ); } else { deoptimizeInteraction(interaction); } } } deoptimizePath(path: ObjectPath) { if (path.length > 1) { const key = path[0]; if (typeof key === 'string') { this.getMemberVariables()[key]?.deoptimizePath(path.slice(1)); } } } getLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown { if (path[0] === SymbolToStringTag) { return 'Module'; } return UnknownValue; } getMemberVariables(): { [name: string]: Variable } { if (this.memberVariables) { return this.memberVariables; } const memberVariables: { [name: string]: Variable } = Object.create(null); const sortedExports = [...this.context.getExports(), ...this.context.getReexports()].sort(); for (const name of sortedExports) { if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) { const exportedVariable = this.context.traceExport(name); if (exportedVariable) { memberVariables[name] = exportedVariable; } } } return (this.memberVariables = memberVariables); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { const { type } = interaction; if (path.length === 0) { // This can only be a call anyway return true; } if (path.length === 1 && type !== INTERACTION_CALLED) { return type === INTERACTION_ASSIGNED; } const key = path[0]; if (typeof key !== 'string') { return true; } const memberVariable = this.getMemberVariables()[key]; return ( !memberVariable || memberVariable.hasEffectsOnInteractionAtPath(path.slice(1), interaction, context) ); } include(): void { this.included = true; this.context.includeAllExports(); } prepare(accessedGlobalsByScope: Map>): void { if (this.mergedNamespaces.length > 0) { this.module.scope.addAccessedGlobals([MERGE_NAMESPACES_VARIABLE], accessedGlobalsByScope); } } renderBlock(options: RenderOptions): string { const { exportNamesByVariable, format, freeze, indent: t, namespaceToStringTag, snippets: { _, cnst, getObject, getPropertyAccess, n, s } } = options; const memberVariables = this.getMemberVariables(); const members: [key: string | null, value: string][] = Object.entries(memberVariables) .filter(([_, variable]) => variable.included) .map(([name, variable]) => { if (this.referencedEarly || variable.isReassigned || variable === this) { return [ null, `get ${name}${_}()${_}{${_}return ${variable.getName(getPropertyAccess)}${s}${_}}` ]; } return [name, variable.getName(getPropertyAccess)]; }); members.unshift([null, `__proto__:${_}null`]); let output = getObject(members, { lineBreakIndent: { base: '', t } }); if (this.mergedNamespaces.length > 0) { const assignmentArguments = this.mergedNamespaces.map(variable => variable.getName(getPropertyAccess) ); output = `/*#__PURE__*/${MERGE_NAMESPACES_VARIABLE}(${output},${_}[${assignmentArguments.join( `,${_}` )}])`; } else { // The helper to merge namespaces will also take care of freezing and toStringTag if (namespaceToStringTag) { output = `/*#__PURE__*/Object.defineProperty(${output},${_}Symbol.toStringTag,${_}${getToStringTagValue( getObject )})`; } if (freeze) { output = `/*#__PURE__*/Object.freeze(${output})`; } } const name = this.getName(getPropertyAccess); output = `${cnst} ${name}${_}=${_}${output};`; if (format === 'system' && exportNamesByVariable.has(this)) { output += `${n}${getSystemExportStatement([this], options)};`; } return output; } renderFirst(): boolean { return this.referencedEarly; } setMergedNamespaces(mergedNamespaces: readonly Variable[]): void { this.mergedNamespaces = mergedNamespaces; const moduleExecIndex = this.context.getModuleExecIndex(); for (const identifier of this.references) { if (identifier.context.getModuleExecIndex() <= moduleExecIndex) { this.referencedEarly = true; break; } } } } NamespaceVariable.prototype.isNamespace = true; rollup-3.29.4/src/ast/variables/ParameterVariable.ts000066400000000000000000000115471450520414700224240ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import { EMPTY_ARRAY } from '../../utils/blank'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_CALLED } from '../NodeInteractions'; import type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import { deoptimizeInteraction, UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION } from '../nodes/shared/Expression'; import type { ObjectPath, ObjectPathKey } from '../utils/PathTracker'; import { PathTracker, SHARED_RECURSION_TRACKER, UNKNOWN_PATH, UnknownKey } from '../utils/PathTracker'; import LocalVariable from './LocalVariable'; interface DeoptimizationInteraction { interaction: NodeInteraction; path: ObjectPath; } const MAX_TRACKED_INTERACTIONS = 20; const NO_INTERACTIONS = EMPTY_ARRAY as unknown as DeoptimizationInteraction[]; const UNKNOWN_DEOPTIMIZED_FIELD = new Set([UnknownKey]); const EMPTY_PATH_TRACKER = new PathTracker(); const UNKNOWN_DEOPTIMIZED_ENTITY = new Set([UNKNOWN_EXPRESSION]); export default class ParameterVariable extends LocalVariable { private deoptimizationInteractions: DeoptimizationInteraction[] = []; private deoptimizations = new PathTracker(); private deoptimizedFields = new Set(); private entitiesToBeDeoptimized = new Set(); constructor( name: string, declarator: Identifier | ExportDefaultDeclaration | null, context: AstContext ) { super(name, declarator, UNKNOWN_EXPRESSION, context); } addEntityToBeDeoptimized(entity: ExpressionEntity): void { if (entity === UNKNOWN_EXPRESSION) { // As unknown expressions fully deoptimize all interactions, we can clear // the interaction cache at this point provided we keep this optimization // in mind when adding new interactions if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { this.entitiesToBeDeoptimized.add(UNKNOWN_EXPRESSION); for (const { interaction } of this.deoptimizationInteractions) { deoptimizeInteraction(interaction); } this.deoptimizationInteractions = NO_INTERACTIONS; } } else if (this.deoptimizedFields.has(UnknownKey)) { // This means that we already deoptimized all interactions and no longer // track them entity.deoptimizePath(UNKNOWN_PATH); } else if (!this.entitiesToBeDeoptimized.has(entity)) { this.entitiesToBeDeoptimized.add(entity); for (const field of this.deoptimizedFields) { entity.deoptimizePath([field]); } for (const { interaction, path } of this.deoptimizationInteractions) { entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); } } } deoptimizeArgumentsOnInteractionAtPath(interaction: NodeInteraction, path: ObjectPath): void { // For performance reasons, we fully deoptimize all deeper interactions if ( path.length >= 2 || this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION) || this.deoptimizationInteractions.length >= MAX_TRACKED_INTERACTIONS || (path.length === 1 && (this.deoptimizedFields.has(UnknownKey) || (interaction.type === INTERACTION_CALLED && this.deoptimizedFields.has(path[0])))) ) { deoptimizeInteraction(interaction); return; } if (!this.deoptimizations.trackEntityAtPathAndGetIfTracked(path, interaction.args)) { for (const entity of this.entitiesToBeDeoptimized) { entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); } if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { this.deoptimizationInteractions.push({ interaction, path }); } } } deoptimizePath(path: ObjectPath): void { if (path.length === 0 || this.deoptimizedFields.has(UnknownKey)) { return; } const key = path[0]; if (this.deoptimizedFields.has(key)) { return; } this.deoptimizedFields.add(key); for (const entity of this.entitiesToBeDeoptimized) { // We do not need a recursion tracker here as we already track whether // this field is deoptimized entity.deoptimizePath([key]); } if (key === UnknownKey) { // save some memory this.deoptimizationInteractions = NO_INTERACTIONS; this.deoptimizations = EMPTY_PATH_TRACKER; this.deoptimizedFields = UNKNOWN_DEOPTIMIZED_FIELD; this.entitiesToBeDeoptimized = UNKNOWN_DEOPTIMIZED_ENTITY; } } getReturnExpressionWhenCalledAtPath( path: ObjectPath ): [expression: ExpressionEntity, isPure: boolean] { // We deoptimize everything that is called as that will trivially deoptimize // the corresponding return expressions as well and avoid badly performing // and complicated alternatives if (path.length === 0) { this.deoptimizePath(UNKNOWN_PATH); } else if (!this.deoptimizedFields.has(path[0])) { this.deoptimizePath([path[0]]); } return UNKNOWN_RETURN_EXPRESSION; } } rollup-3.29.4/src/ast/variables/SyntheticNamedExportVariable.ts000066400000000000000000000032501450520414700246150ustar00rootroot00000000000000import type Module from '../../Module'; import type { AstContext } from '../../Module'; import ExportDefaultVariable from './ExportDefaultVariable'; import Variable from './Variable'; export default class SyntheticNamedExportVariable extends Variable { readonly context: AstContext; readonly module: Module; readonly syntheticNamespace: Variable; private baseVariable: Variable | null = null; constructor(context: AstContext, name: string, syntheticNamespace: Variable) { super(name); this.context = context; this.module = context.module; this.syntheticNamespace = syntheticNamespace; } getBaseVariable(): Variable { if (this.baseVariable) return this.baseVariable; let baseVariable = this.syntheticNamespace; while ( baseVariable instanceof ExportDefaultVariable || baseVariable instanceof SyntheticNamedExportVariable ) { if (baseVariable instanceof ExportDefaultVariable) { const original = baseVariable.getOriginalVariable(); if (original === baseVariable) break; baseVariable = original; } if (baseVariable instanceof SyntheticNamedExportVariable) { baseVariable = baseVariable.syntheticNamespace; } } return (this.baseVariable = baseVariable); } getBaseVariableName(): string { return this.syntheticNamespace.getBaseVariableName(); } getName(getPropertyAccess: (name: string) => string): string { return `${this.syntheticNamespace.getName(getPropertyAccess)}${getPropertyAccess(this.name)}`; } include(): void { this.included = true; this.context.includeVariableInModule(this.syntheticNamespace); } setRenderNames(baseName: string | null, name: string | null): void { super.setRenderNames(baseName, name); } } rollup-3.29.4/src/ast/variables/ThisVariable.ts000066400000000000000000000013561450520414700214100ustar00rootroot00000000000000import type { AstContext } from '../../Module'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { UNKNOWN_EXPRESSION } from '../nodes/shared/Expression'; import { type ObjectPath } from '../utils/PathTracker'; import ParameterVariable from './ParameterVariable'; export default class ThisVariable extends ParameterVariable { constructor(context: AstContext) { super('this', null, context); } hasEffectsOnInteractionAtPath( path: ObjectPath, interaction: NodeInteraction, context: HasEffectsContext ): boolean { return ( context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION ).hasEffectsOnInteractionAtPath(path, interaction, context); } } rollup-3.29.4/src/ast/variables/UndefinedVariable.ts000066400000000000000000000004351450520414700223770ustar00rootroot00000000000000import type { LiteralValueOrUnknown } from '../nodes/shared/Expression'; import Variable from './Variable'; export default class UndefinedVariable extends Variable { constructor() { super('undefined'); } getLiteralValueAtPath(): LiteralValueOrUnknown { return undefined; } } rollup-3.29.4/src/ast/variables/Variable.ts000066400000000000000000000046531450520414700205630ustar00rootroot00000000000000import type ExternalModule from '../../ExternalModule'; import type Module from '../../Module'; import type { RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import type Identifier from '../nodes/Identifier'; import { ExpressionEntity } from '../nodes/shared/Expression'; import type { ObjectPath } from '../utils/PathTracker'; export default class Variable extends ExpressionEntity { alwaysRendered = false; forbiddenNames: Set | null = null; initReached = false; isId = false; // both NamespaceVariable and ExternalVariable can be namespaces declare isNamespace?: boolean; isReassigned = false; kind: string | null = null; declare module?: Module | ExternalModule; renderBaseName: string | null = null; renderName: string | null = null; constructor(public name: string) { super(); } /** * Binds identifiers that reference this variable to this variable. * Necessary to be able to change variable names. */ addReference(_identifier: Identifier): void {} /** * Prevent this variable from being renamed to this name to avoid name * collisions */ forbidName(name: string) { (this.forbiddenNames ||= new Set()).add(name); } getBaseVariableName(): string { return this.renderBaseName || this.renderName || this.name; } getName( getPropertyAccess: (name: string) => string, useOriginalName?: RenderOptions['useOriginalName'] ): string { if (useOriginalName?.(this)) { return this.name; } const name = this.renderName || this.name; return this.renderBaseName ? `${this.renderBaseName}${getPropertyAccess(name)}` : name; } hasEffectsOnInteractionAtPath( path: ObjectPath, { type }: NodeInteraction, _context: HasEffectsContext ): boolean { return type !== INTERACTION_ACCESSED || path.length > 0; } /** * Marks this variable as being part of the bundle, which is usually the case when one of * its identifiers becomes part of the bundle. Returns true if it has not been included * previously. * Once a variable is included, it should take care all its declarations are included. */ include(): void { this.included = true; } markCalledFromTryStatement(): void {} setRenderNames(baseName: string | null, name: string | null): void { this.renderBaseName = baseName; this.renderName = name; } } rollup-3.29.4/src/browser-entry.ts000066400000000000000000000001661450520414700171140ustar00rootroot00000000000000export { default as rollup, defineConfig } from './rollup/rollup'; export { version as VERSION } from 'package.json'; rollup-3.29.4/src/finalisers/000077500000000000000000000000001450520414700160565ustar00rootroot00000000000000rollup-3.29.4/src/finalisers/amd.ts000066400000000000000000000053361450520414700171760ustar00rootroot00000000000000import type { Bundle as MagicStringBundle } from 'magic-string'; import type { NormalizedOutputOptions } from '../rollup/types'; import getCompleteAmdId from './shared/getCompleteAmdId'; import { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock'; import getInteropBlock from './shared/getInteropBlock'; import updateExtensionForRelativeAmdId from './shared/updateExtensionForRelativeAmdId'; import warnOnBuiltins from './shared/warnOnBuiltins'; import type { FinaliserOptions } from './index'; export default function amd( magicString: MagicStringBundle, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, log, outro, snippets }: FinaliserOptions, { amd, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }: NormalizedOutputOptions ): void { warnOnBuiltins(log, dependencies); const deps = dependencies.map( m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'` ); const parameters = dependencies.map(m => m.name); const { n, getNonArrowFunctionIntro, _ } = snippets; if (namedExportsMode && hasExports) { parameters.unshift(`exports`); deps.unshift(`'exports'`); } if (accessedGlobals.has('require')) { parameters.unshift('require'); deps.unshift(`'require'`); } if (accessedGlobals.has('module')) { parameters.unshift('module'); deps.unshift(`'module'`); } const completeAmdId = getCompleteAmdId(amd, id); const defineParameters = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + (deps.length > 0 ? `[${deps.join(`,${_}`)}],${_}` : ``); const useStrict = strict ? `${_}'use strict';` : ''; magicString.prepend( `${intro}${getInteropBlock( dependencies, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, t, snippets )}` ); const exportBlock = getExportBlock( exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings ); let namespaceMarkers = getNamespaceMarkers( namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && namespaceToStringTag, snippets ); if (namespaceMarkers) { namespaceMarkers = n + n + namespaceMarkers; } magicString .append(`${exportBlock}${namespaceMarkers}${outro}`) .indent(t) // factory function should be wrapped by parentheses to avoid lazy parsing, // cf. https://v8.dev/blog/preparser#pife .prepend( `${amd.define}(${defineParameters}(${getNonArrowFunctionIntro(parameters, { isAsync: false, name: null })}{${useStrict}${n}${n}` ) .append(`${n}${n}}));`); } rollup-3.29.4/src/finalisers/cjs.ts000066400000000000000000000047121450520414700172110ustar00rootroot00000000000000import type { Bundle as MagicStringBundle } from 'magic-string'; import type { ChunkDependency } from '../Chunk'; import type { NormalizedOutputOptions } from '../rollup/types'; import type { GenerateCodeSnippets } from '../utils/generateCodeSnippets'; import { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock'; import getInteropBlock from './shared/getInteropBlock'; import type { FinaliserOptions } from './index'; export default function cjs( magicString: MagicStringBundle, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }: FinaliserOptions, { compact, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }: NormalizedOutputOptions ): void { const { _, n } = snippets; const useStrict = strict ? `'use strict';${n}${n}` : ''; let namespaceMarkers = getNamespaceMarkers( namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && namespaceToStringTag, snippets ); if (namespaceMarkers) { namespaceMarkers += n + n; } const importBlock = getImportBlock(dependencies, snippets, compact); const interopBlock = getInteropBlock( dependencies, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, t, snippets ); magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`); const exportBlock = getExportBlock( exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, `module.exports${_}=${_}` ); magicString.append(`${exportBlock}${outro}`); } function getImportBlock( dependencies: readonly ChunkDependency[], { _, cnst, n }: GenerateCodeSnippets, compact: boolean ): string { let importBlock = ''; let definingVariable = false; for (const { importPath, name, reexports, imports } of dependencies) { if (!reexports && !imports) { if (importBlock) { importBlock += compact && !definingVariable ? ',' : `;${n}`; } definingVariable = false; importBlock += `require('${importPath}')`; } else { importBlock += compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${cnst} `; definingVariable = true; importBlock += `${name}${_}=${_}require('${importPath}')`; } } if (importBlock) { return `${importBlock};${n}${n}`; } return ''; } rollup-3.29.4/src/finalisers/es.ts000066400000000000000000000111301450520414700170310ustar00rootroot00000000000000import type { Bundle as MagicStringBundle } from 'magic-string'; import type { ChunkDependency, ChunkExports, ImportSpecifier, ReexportSpecifier } from '../Chunk'; import type { NormalizedOutputOptions } from '../rollup/types'; import type { GenerateCodeSnippets } from '../utils/generateCodeSnippets'; import { getHelpersBlock } from '../utils/interopHelpers'; import type { FinaliserOptions } from './index'; export default function es( magicString: MagicStringBundle, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }: FinaliserOptions, { externalLiveBindings, freeze, namespaceToStringTag }: NormalizedOutputOptions ): void { const { n } = snippets; const importBlock = getImportBlock(dependencies, snippets); if (importBlock.length > 0) intro += importBlock.join(n) + n + n; intro += getHelpersBlock( null, accessedGlobals, t, snippets, externalLiveBindings, freeze, namespaceToStringTag ); if (intro) magicString.prepend(intro); const exportBlock = getExportBlock(exports, snippets); if (exportBlock.length > 0) magicString.append(n + n + exportBlock.join(n).trim()); if (outro) magicString.append(outro); magicString.trim(); } function getImportBlock( dependencies: readonly ChunkDependency[], { _ }: GenerateCodeSnippets ): string[] { const importBlock: string[] = []; for (const { importPath, reexports, imports, name, assertions } of dependencies) { const assertion = assertions ? `${_}assert${_}${assertions}` : ''; const pathWithAssertion = `'${importPath}'${assertion};`; if (!reexports && !imports) { importBlock.push(`import${_}${pathWithAssertion}`); continue; } if (imports) { let defaultImport: ImportSpecifier | null = null; let starImport: ImportSpecifier | null = null; const importedNames: ImportSpecifier[] = []; for (const specifier of imports) { if (specifier.imported === 'default') { defaultImport = specifier; } else if (specifier.imported === '*') { starImport = specifier; } else { importedNames.push(specifier); } } if (starImport) { importBlock.push(`import${_}*${_}as ${starImport.local} from${_}${pathWithAssertion}`); } if (defaultImport && importedNames.length === 0) { importBlock.push(`import ${defaultImport.local} from${_}${pathWithAssertion}`); } else if (importedNames.length > 0) { importBlock.push( `import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames .map(specifier => specifier.imported === specifier.local ? specifier.imported : `${specifier.imported} as ${specifier.local}` ) .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}` ); } } if (reexports) { let starExport: ReexportSpecifier | null = null; const namespaceReexports: ReexportSpecifier[] = []; const namedReexports: ReexportSpecifier[] = []; for (const specifier of reexports) { if (specifier.reexported === '*') { starExport = specifier; } else if (specifier.imported === '*') { namespaceReexports.push(specifier); } else { namedReexports.push(specifier); } } if (starExport) { importBlock.push(`export${_}*${_}from${_}${pathWithAssertion}`); } if (namespaceReexports.length > 0) { if ( !imports || !imports.some(specifier => specifier.imported === '*' && specifier.local === name) ) { importBlock.push(`import${_}*${_}as ${name} from${_}${pathWithAssertion}`); } for (const specifier of namespaceReexports) { importBlock.push( `export${_}{${_}${ name === specifier.reexported ? name : `${name} as ${specifier.reexported}` } };` ); } } if (namedReexports.length > 0) { importBlock.push( `export${_}{${_}${namedReexports .map(specifier => specifier.imported === specifier.reexported ? specifier.imported : `${specifier.imported} as ${specifier.reexported}` ) .join(`,${_}`)}${_}}${_}from${_}${pathWithAssertion}` ); } } } return importBlock; } function getExportBlock(exports: ChunkExports, { _, cnst }: GenerateCodeSnippets): string[] { const exportBlock: string[] = []; const exportDeclaration: string[] = []; for (const specifier of exports) { if (specifier.expression) { exportBlock.push(`${cnst} ${specifier.local}${_}=${_}${specifier.expression};`); } exportDeclaration.push( specifier.exported === specifier.local ? specifier.local : `${specifier.local} as ${specifier.exported}` ); } if (exportDeclaration.length > 0) { exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`); } return exportBlock; } rollup-3.29.4/src/finalisers/iife.ts000066400000000000000000000066221450520414700173500ustar00rootroot00000000000000import type { Bundle as MagicStringBundle } from 'magic-string'; import type { NormalizedOutputOptions } from '../rollup/types'; import { isLegal } from '../utils/identifierHelpers'; import { LOGLEVEL_WARN } from '../utils/logging'; import { error, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport } from '../utils/logs'; import { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock'; import getInteropBlock from './shared/getInteropBlock'; import { keypath } from './shared/sanitize'; import setupNamespace from './shared/setupNamespace'; import trimEmptyImports from './shared/trimEmptyImports'; import warnOnBuiltins from './shared/warnOnBuiltins'; import type { FinaliserOptions } from './index'; export default function iife( magicString: MagicStringBundle, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, namedExportsMode, log, outro, snippets }: FinaliserOptions, { compact, esModule, extend, freeze, externalLiveBindings, globals, interop, name, namespaceToStringTag, strict }: NormalizedOutputOptions ): void { const { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets; const isNamespaced = name && name.includes('.'); const useVariableAssignment = !extend && !isNamespaced; if (name && useVariableAssignment && !isLegal(name)) { return error(logIllegalIdentifierAsName(name)); } warnOnBuiltins(log, dependencies); const external = trimEmptyImports(dependencies); const deps = external.map(dep => dep.globalName || 'null'); const parameters = external.map(m => m.name); if (hasExports && !name) { log(LOGLEVEL_WARN, logMissingNameOptionForIifeExport()); } if (namedExportsMode && hasExports) { if (extend) { deps.unshift( `this${keypath(name!, getPropertyAccess)}${_}=${_}this${keypath( name!, getPropertyAccess )}${_}||${_}{}` ); parameters.unshift('exports'); } else { deps.unshift('{}'); parameters.unshift('exports'); } } const useStrict = strict ? `${t}'use strict';${n}` : ''; const interopBlock = getInteropBlock( dependencies, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, t, snippets ); magicString.prepend(`${intro}${interopBlock}`); let wrapperIntro = `(${getNonArrowFunctionIntro(parameters, { isAsync: false, name: null })}{${n}${useStrict}${n}`; if (hasExports) { if (name && !(extend && namedExportsMode)) { wrapperIntro = (useVariableAssignment ? `var ${name}` : `this${keypath(name, getPropertyAccess)}`) + `${_}=${_}${wrapperIntro}`; } if (isNamespaced) { wrapperIntro = setupNamespace(name!, 'this', globals, snippets, compact) + wrapperIntro; } } let wrapperOutro = `${n}${n}})(${deps.join(`,${_}`)});`; if (hasExports && !extend && namedExportsMode) { wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`; } const exportBlock = getExportBlock( exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings ); let namespaceMarkers = getNamespaceMarkers( namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), namespaceToStringTag, snippets ); if (namespaceMarkers) { namespaceMarkers = n + n + namespaceMarkers; } magicString .append(`${exportBlock}${namespaceMarkers}${outro}`) .indent(t) .prepend(wrapperIntro) .append(wrapperOutro); } rollup-3.29.4/src/finalisers/index.ts000066400000000000000000000020521450520414700175340ustar00rootroot00000000000000import type { Bundle as MagicStringBundle } from 'magic-string'; import type { ChunkDependency, ChunkExports } from '../Chunk'; import type { LogHandler, NormalizedOutputOptions } from '../rollup/types'; import type { GenerateCodeSnippets } from '../utils/generateCodeSnippets'; import amd from './amd'; import cjs from './cjs'; import es from './es'; import iife from './iife'; import system from './system'; import umd from './umd'; export interface FinaliserOptions { accessedGlobals: Set; dependencies: ChunkDependency[]; exports: ChunkExports; hasDefaultExport: boolean; hasExports: boolean; id: string; indent: string; intro: string; isEntryFacade: boolean; isModuleFacade: boolean; log: LogHandler; namedExportsMode: boolean; outro: string; snippets: GenerateCodeSnippets; usesTopLevelAwait: boolean; } export type Finaliser = ( magicString: MagicStringBundle, finaliserOptions: FinaliserOptions, options: NormalizedOutputOptions ) => void; export default { amd, cjs, es, iife, system, umd } as { [format: string]: Finaliser; }; rollup-3.29.4/src/finalisers/shared/000077500000000000000000000000001450520414700173245ustar00rootroot00000000000000rollup-3.29.4/src/finalisers/shared/addJsExtension.ts000066400000000000000000000001651450520414700226200ustar00rootroot00000000000000export default function addJsExtension(name: string): string { return name.endsWith('.js') ? name : name + '.js'; } rollup-3.29.4/src/finalisers/shared/getCompleteAmdId.ts000066400000000000000000000005741450520414700230510ustar00rootroot00000000000000import type { NormalizedOutputOptions } from '../../rollup/types'; import removeJsExtension from './removeJsExtension'; export default function getCompleteAmdId( options: NormalizedOutputOptions['amd'], chunkId: string ): string { if (options.autoId) { return `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`; } return options.id ?? ''; } rollup-3.29.4/src/finalisers/shared/getExportBlock.ts000066400000000000000000000142001450520414700226250ustar00rootroot00000000000000import type { ChunkDependency, ChunkExports } from '../../Chunk'; import type { GetInterop } from '../../rollup/types'; import type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets'; import { defaultInteropHelpersByInteropType, getToStringTagValue, isDefaultAProperty, namespaceInteropHelpersByInteropType } from '../../utils/interopHelpers'; export function getExportBlock( exports: ChunkExports, dependencies: readonly ChunkDependency[], namedExportsMode: boolean, interop: GetInterop, snippets: GenerateCodeSnippets, t: string, externalLiveBindings: boolean, mechanism = 'return ' ): string { const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets; if (!namedExportsMode) { return `${n}${n}${mechanism}${getSingleDefaultExport( exports, dependencies, interop, externalLiveBindings, getPropertyAccess )};`; } let exportBlock = ''; for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { if (reexports && namedExportsMode) { for (const specifier of reexports) { if (specifier.reexported !== '*') { const importName = getReexportedImportName( name, specifier.imported, depNamedExportsMode, isChunk, defaultVariableName!, namespaceVariableName!, interop, importPath, externalLiveBindings, getPropertyAccess ); if (exportBlock) exportBlock += n; if (specifier.imported !== '*' && specifier.needsLiveBinding) { const [left, right] = getDirectReturnFunction([], { functionReturn: true, lineBreakIndent: null, name: null }); exportBlock += `Object.defineProperty(exports,${_}'${specifier.reexported}',${_}{${n}` + `${t}enumerable:${_}true,${n}` + `${t}get:${_}${left}${importName}${right}${n}});`; } else { exportBlock += `exports${getPropertyAccess( specifier.reexported )}${_}=${_}${importName};`; } } } } } for (const { exported, local } of exports) { const lhs = `exports${getPropertyAccess(exported)}`; const rhs = local; if (lhs !== rhs) { if (exportBlock) exportBlock += n; exportBlock += `${lhs}${_}=${_}${rhs};`; } } for (const { name, reexports } of dependencies) { if (reexports && namedExportsMode) { for (const specifier of reexports) { if (specifier.reexported === '*') { if (exportBlock) exportBlock += n; const copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!Object.prototype.hasOwnProperty.call(exports,${_}k))${_}${getDefineProperty( name, specifier.needsLiveBinding, t, snippets )}${s}${n}}`; exportBlock += `Object.keys(${name}).forEach(${getFunctionIntro(['k'], { isAsync: false, name: null })}${copyPropertyIfNecessary});`; } } } } if (exportBlock) { return `${n}${n}${exportBlock}`; } return ''; } function getSingleDefaultExport( exports: ChunkExports, dependencies: readonly ChunkDependency[], interop: GetInterop, externalLiveBindings: boolean, getPropertyAccess: (name: string) => string ) { if (exports.length > 0) { return exports[0].local; } else { for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { if (reexports) { return getReexportedImportName( name, reexports[0].imported, depNamedExportsMode, isChunk, defaultVariableName!, namespaceVariableName!, interop, importPath, externalLiveBindings, getPropertyAccess ); } } } } function getReexportedImportName( moduleVariableName: string, imported: string, depNamedExportsMode: boolean, isChunk: boolean, defaultVariableName: string, namespaceVariableName: string, interop: GetInterop, moduleId: string, externalLiveBindings: boolean, getPropertyAccess: (name: string) => string ) { if (imported === 'default') { if (!isChunk) { const moduleInterop = interop(moduleId); const variableName = defaultInteropHelpersByInteropType[moduleInterop] ? defaultVariableName : moduleVariableName; return isDefaultAProperty(moduleInterop, externalLiveBindings) ? `${variableName}${getPropertyAccess('default')}` : variableName; } return depNamedExportsMode ? `${moduleVariableName}${getPropertyAccess('default')}` : moduleVariableName; } if (imported === '*') { return ( isChunk ? !depNamedExportsMode : namespaceInteropHelpersByInteropType[interop(moduleId)] ) ? namespaceVariableName : moduleVariableName; } return `${moduleVariableName}${getPropertyAccess(imported)}`; } function getEsModuleValue(getObject: GenerateCodeSnippets['getObject']) { return getObject([['value', 'true']], { lineBreakIndent: null }); } export function getNamespaceMarkers( hasNamedExports: boolean, addEsModule: boolean, addNamespaceToStringTag: boolean, { _, getObject }: GenerateCodeSnippets ): string { if (hasNamedExports) { if (addEsModule) { if (addNamespaceToStringTag) { return `Object.defineProperties(exports,${_}${getObject( [ ['__esModule', getEsModuleValue(getObject)], [null, `[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}`] ], { lineBreakIndent: null } )});`; } return `Object.defineProperty(exports,${_}'__esModule',${_}${getEsModuleValue(getObject)});`; } if (addNamespaceToStringTag) { return `Object.defineProperty(exports,${_}Symbol.toStringTag,${_}${getToStringTagValue( getObject )});`; } } return ''; } const getDefineProperty = ( name: string, needsLiveBinding: boolean, t: string, { _, getDirectReturnFunction, n }: GenerateCodeSnippets ) => { if (needsLiveBinding) { const [left, right] = getDirectReturnFunction([], { functionReturn: true, lineBreakIndent: null, name: null }); return ( `Object.defineProperty(exports,${_}k,${_}{${n}` + `${t}${t}enumerable:${_}true,${n}` + `${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})` ); } return `exports[k]${_}=${_}${name}[k]`; }; rollup-3.29.4/src/finalisers/shared/getInteropBlock.ts000066400000000000000000000052771450520414700230020ustar00rootroot00000000000000import type { ChunkDependency, ReexportSpecifier } from '../../Chunk'; import type { GetInterop } from '../../rollup/types'; import type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets'; import { defaultInteropHelpersByInteropType, getHelpersBlock, INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, namespaceInteropHelpersByInteropType } from '../../utils/interopHelpers'; export default function getInteropBlock( dependencies: readonly ChunkDependency[], interop: GetInterop, externalLiveBindings: boolean, freeze: boolean, namespaceToStringTag: boolean, accessedGlobals: Set, indent: string, snippets: GenerateCodeSnippets ): string { const { _, cnst, n } = snippets; const neededInteropHelpers = new Set(); const interopStatements: string[] = []; const addInteropStatement = ( helperVariableName: string, helper: string, dependencyVariableName: string ): void => { neededInteropHelpers.add(helper); interopStatements.push( `${cnst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});` ); }; for (const { defaultVariableName, imports, importPath, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) { if (isChunk) { for (const { imported, reexported } of [ ...(imports || []), ...(reexports || []) ] as ReexportSpecifier[]) { if (imported === '*' && reexported !== '*') { if (!namedExportsMode) { addInteropStatement( namespaceVariableName!, INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, name ); } break; } } } else { const moduleInterop = interop(importPath); let hasDefault = false; let hasNamespace = false; for (const { imported, reexported } of [ ...(imports || []), ...(reexports || []) ] as ReexportSpecifier[]) { let helper: string | undefined | null; let variableName: string | undefined; if (imported === 'default') { if (!hasDefault) { hasDefault = true; if (defaultVariableName !== namespaceVariableName) { variableName = defaultVariableName!; helper = defaultInteropHelpersByInteropType[moduleInterop]; } } } else if (imported === '*' && reexported !== '*' && !hasNamespace) { hasNamespace = true; helper = namespaceInteropHelpersByInteropType[moduleInterop]; variableName = namespaceVariableName!; } if (helper) { addInteropStatement(variableName!, helper, name); } } } } return `${getHelpersBlock( neededInteropHelpers, accessedGlobals, indent, snippets, externalLiveBindings, freeze, namespaceToStringTag )}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`; } rollup-3.29.4/src/finalisers/shared/removeJsExtension.ts000066400000000000000000000001751450520414700233660ustar00rootroot00000000000000export default function removeJsExtension(name: string): string { return name.endsWith('.js') ? name.slice(0, -3) : name; } rollup-3.29.4/src/finalisers/shared/sanitize.ts000066400000000000000000000002261450520414700215220ustar00rootroot00000000000000export const keypath = (keypath: string, getPropertyAccess: (name: string) => string): string => keypath.split('.').map(getPropertyAccess).join(''); rollup-3.29.4/src/finalisers/shared/setupNamespace.ts000066400000000000000000000026641450520414700226610ustar00rootroot00000000000000import type { GlobalsOption } from '../../rollup/types'; import type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets'; export default function setupNamespace( name: string, root: string, globals: GlobalsOption, { _, getPropertyAccess, s }: GenerateCodeSnippets, compact: boolean | undefined ): string { const parts = name.split('.'); parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0]; parts.pop(); let propertyPath = root; return ( parts .map(part => { propertyPath += getPropertyAccess(part); return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}${s}`; }) .join(compact ? ',' : '\n') + (compact && parts.length > 0 ? ';' : '\n') ); } export function assignToDeepVariable( deepName: string, root: string, globals: GlobalsOption, assignment: string, { _, getPropertyAccess }: GenerateCodeSnippets ): string { const parts = deepName.split('.'); parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0]; const last = parts.pop()!; let propertyPath = root; let deepAssignment = [ ...parts.map(part => { propertyPath += getPropertyAccess(part); return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}`; }), `${propertyPath}${getPropertyAccess(last)}` ].join(`,${_}`) + `${_}=${_}${assignment}`; if (parts.length > 0) { deepAssignment = `(${deepAssignment})`; } return deepAssignment; } rollup-3.29.4/src/finalisers/shared/trimEmptyImports.ts000066400000000000000000000005541450520414700232500ustar00rootroot00000000000000import type { ChunkDependency } from '../../Chunk'; export default function trimEmptyImports( dependencies: readonly ChunkDependency[] ): ChunkDependency[] { let index = dependencies.length; while (index--) { const { imports, reexports } = dependencies[index]; if (imports || reexports) { return dependencies.slice(0, index + 1); } } return []; } rollup-3.29.4/src/finalisers/shared/updateExtensionForRelativeAmdId.ts000066400000000000000000000010331450520414700261120ustar00rootroot00000000000000import addJsExtension from './addJsExtension'; import removeJsExtension from './removeJsExtension'; // AMD resolution will only respect the AMD baseUrl if the .js extension is omitted. // The assumption is that this makes sense for all relative ids: // https://requirejs.org/docs/api.html#jsfiles export default function updateExtensionForRelativeAmdId( id: string, forceJsExtensionForImports: boolean ): string { if (id[0] !== '.') { return id; } return forceJsExtensionForImports ? addJsExtension(id) : removeJsExtension(id); } rollup-3.29.4/src/finalisers/shared/warnOnBuiltins.ts000066400000000000000000000020201450520414700226440ustar00rootroot00000000000000import builtinModules from 'builtin-modules/static'; import type { ChunkDependency } from '../../Chunk'; import type { LogHandler } from '../../rollup/types'; import { LOGLEVEL_WARN } from '../../utils/logging'; import { logMissingNodeBuiltins } from '../../utils/logs'; const nodeBuiltins: ReadonlySet = new Set([ ...builtinModules, // TODO // remove once builtin-modules includes PR: https://github.com/sindresorhus/builtin-modules/pull/17 'assert/strict', 'dns/promises', 'fs/promises', 'path/posix', 'path/win32', 'readline/promises', 'stream/consumers', 'stream/promises', 'stream/web', 'timers/promises', 'util/types' ]); export default function warnOnBuiltins( log: LogHandler, dependencies: readonly ChunkDependency[] ): void { const externalBuiltins = dependencies .map(({ importPath }) => importPath) .filter(importPath => nodeBuiltins.has(importPath) || importPath.startsWith('node:')); if (externalBuiltins.length === 0) return; log(LOGLEVEL_WARN, logMissingNodeBuiltins(externalBuiltins)); } rollup-3.29.4/src/finalisers/system.ts000066400000000000000000000154051450520414700177570ustar00rootroot00000000000000import type { Bundle as MagicStringBundle } from 'magic-string'; import type { ChunkDependency, ChunkExports, ModuleDeclarations } from '../Chunk'; import type { NormalizedOutputOptions } from '../rollup/types'; import type { GenerateCodeSnippets } from '../utils/generateCodeSnippets'; import { getHelpersBlock } from '../utils/interopHelpers'; import { MISSING_EXPORT_SHIM_VARIABLE } from '../utils/variableNames'; import type { FinaliserOptions } from './index'; export default function system( magicString: MagicStringBundle, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, snippets, outro, usesTopLevelAwait }: FinaliserOptions, { externalLiveBindings, freeze, name, namespaceToStringTag, strict, systemNullSetters }: NormalizedOutputOptions ): void { const { _, getFunctionIntro, getNonArrowFunctionIntro, n, s } = snippets; const { importBindings, setters, starExcludes } = analyzeDependencies( dependencies, exports, t, snippets ); const registeredName = name ? `'${name}',${_}` : ''; const wrapperParameters = accessedGlobals.has('module') ? ['exports', 'module'] : hasExports ? ['exports'] : []; // factory function should be wrapped by parentheses to avoid lazy parsing, // cf. https://v8.dev/blog/preparser#pife let wrapperStart = `System.register(${registeredName}[` + dependencies.map(({ importPath }) => `'${importPath}'`).join(`,${_}`) + `],${_}(${getNonArrowFunctionIntro(wrapperParameters, { isAsync: false, name: null })}{${n}${t}${strict ? "'use strict';" : ''}` + getStarExcludesBlock(starExcludes, t, snippets) + getImportBindingsBlock(importBindings, t, snippets) + `${n}${t}return${_}{${ setters.length > 0 ? `${n}${t}${t}setters:${_}[${setters .map(setter => setter ? `${getFunctionIntro(['module'], { isAsync: false, name: null })}{${n}${t}${t}${t}${setter}${n}${t}${t}}` : systemNullSetters ? `null` : `${getFunctionIntro([], { isAsync: false, name: null })}{}` ) .join(`,${_}`)}],` : '' }${n}`; wrapperStart += `${t}${t}execute:${_}(${getNonArrowFunctionIntro([], { isAsync: usesTopLevelAwait, name: null })}{${n}${n}`; const wrapperEnd = `${t}${t}})${n}${t}}${s}${n}}));`; magicString .prepend( intro + getHelpersBlock( null, accessedGlobals, t, snippets, externalLiveBindings, freeze, namespaceToStringTag ) + getHoistedExportsBlock(exports, t, snippets) ) .append( `${outro}${n}${n}` + getSyntheticExportsBlock(exports, t, snippets) + getMissingExportsBlock(exports, t, snippets) ) .indent(`${t}${t}${t}`) .append(wrapperEnd) .prepend(wrapperStart); } function analyzeDependencies( dependencies: ChunkDependency[], exports: ChunkExports, t: string, { _, cnst, getObject, getPropertyAccess, n }: GenerateCodeSnippets ): { importBindings: string[]; setters: string[]; starExcludes: Set | null } { const importBindings: string[] = []; const setters: string[] = []; let starExcludes: Set | null = null; for (const { imports, reexports } of dependencies) { const setter: string[] = []; if (imports) { for (const specifier of imports) { importBindings.push(specifier.local); if (specifier.imported === '*') { setter.push(`${specifier.local}${_}=${_}module;`); } else { setter.push(`${specifier.local}${_}=${_}module${getPropertyAccess(specifier.imported)};`); } } } if (reexports) { const reexportedNames: [key: string | null, value: string][] = []; let hasStarReexport = false; for (const { imported, reexported } of reexports) { if (reexported === '*') { hasStarReexport = true; } else { reexportedNames.push([ reexported, imported === '*' ? 'module' : `module${getPropertyAccess(imported)}` ]); } } if (reexportedNames.length > 1 || hasStarReexport) { const exportMapping = getObject(reexportedNames, { lineBreakIndent: null }); if (hasStarReexport) { if (!starExcludes) { starExcludes = getStarExcludes({ dependencies, exports }); } setter.push( `${cnst} setter${_}=${_}${exportMapping};`, `for${_}(${cnst} name in module)${_}{`, `${t}if${_}(!_starExcludes[name])${_}setter[name]${_}=${_}module[name];`, '}', 'exports(setter);' ); } else { setter.push(`exports(${exportMapping});`); } } else { const [key, value] = reexportedNames[0]; setter.push(`exports('${key}',${_}${value});`); } } setters.push(setter.join(`${n}${t}${t}${t}`)); } return { importBindings, setters, starExcludes }; } const getStarExcludes = ({ dependencies, exports }: ModuleDeclarations): Set => { const starExcludes = new Set(exports.map(expt => expt.exported)); starExcludes.add('default'); for (const { reexports } of dependencies) { if (reexports) { for (const reexport of reexports) { if (reexport.reexported !== '*') starExcludes.add(reexport.reexported); } } } return starExcludes; }; const getStarExcludesBlock = ( starExcludes: ReadonlySet | null, t: string, { _, cnst, getObject, n }: GenerateCodeSnippets ): string => starExcludes ? `${n}${t}${cnst} _starExcludes${_}=${_}${getObject( [...starExcludes].map(property => [property, '1']), { lineBreakIndent: { base: t, t } } )};` : ''; const getImportBindingsBlock = ( importBindings: readonly string[], t: string, { _, n }: GenerateCodeSnippets ): string => (importBindings.length > 0 ? `${n}${t}var ${importBindings.join(`,${_}`)};` : ''); const getHoistedExportsBlock = ( exports: ChunkExports, t: string, snippets: GenerateCodeSnippets ): string => getExportsBlock( exports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets ); function getExportsBlock( exports: readonly { name: string; value: string }[], t: string, { _, n }: GenerateCodeSnippets ): string { if (exports.length === 0) { return ''; } if (exports.length === 1) { return `exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`; } return ( `exports({${n}` + exports.map(({ name, value }) => `${t}${name}:${_}${value}`).join(`,${n}`) + `${n}});${n}${n}` ); } const getSyntheticExportsBlock = ( exports: ChunkExports, t: string, snippets: GenerateCodeSnippets ): string => getExportsBlock( exports .filter(expt => expt.expression) .map(expt => ({ name: expt.exported, value: expt.local })), t, snippets ); const getMissingExportsBlock = ( exports: ChunkExports, t: string, snippets: GenerateCodeSnippets ): string => getExportsBlock( exports .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE) .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), t, snippets ); rollup-3.29.4/src/finalisers/umd.ts000066400000000000000000000150001450520414700172070ustar00rootroot00000000000000import type { Bundle as MagicStringBundle } from 'magic-string'; import type { NormalizedOutputOptions } from '../rollup/types'; import type { GenerateCodeSnippets } from '../utils/generateCodeSnippets'; import { error, logMissingNameOptionForUmdExport } from '../utils/logs'; import getCompleteAmdId from './shared/getCompleteAmdId'; import { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock'; import getInteropBlock from './shared/getInteropBlock'; import { keypath } from './shared/sanitize'; import { assignToDeepVariable } from './shared/setupNamespace'; import trimEmptyImports from './shared/trimEmptyImports'; import updateExtensionForRelativeAmdId from './shared/updateExtensionForRelativeAmdId'; import warnOnBuiltins from './shared/warnOnBuiltins'; import type { FinaliserOptions } from './index'; function globalProperty( name: string | false | undefined, globalVariable: string, getPropertyAccess: (name: string) => string ) { if (!name) return 'null'; return `${globalVariable}${keypath(name, getPropertyAccess)}`; } function safeAccess( name: string, globalVariable: string, { _, getPropertyAccess }: GenerateCodeSnippets ) { let propertyPath = globalVariable; return name .split('.') .map(part => (propertyPath += getPropertyAccess(part))) .join(`${_}&&${_}`); } export default function umd( magicString: MagicStringBundle, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, namedExportsMode, log, outro, snippets }: FinaliserOptions, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, namespaceToStringTag, globals, noConflict, strict }: NormalizedOutputOptions ): void { const { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets; const factoryVariable = compact ? 'f' : 'factory'; const globalVariable = compact ? 'g' : 'global'; if (hasExports && !name) { return error(logMissingNameOptionForUmdExport()); } warnOnBuiltins(log, dependencies); const amdDeps = dependencies.map( m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'` ); const cjsDeps = dependencies.map(m => `require('${m.importPath}')`); const trimmedImports = trimEmptyImports(dependencies); const globalDeps = trimmedImports.map(module => globalProperty(module.globalName, globalVariable, getPropertyAccess) ); const factoryParameters = trimmedImports.map(m => m.name); if (namedExportsMode && (hasExports || noConflict)) { amdDeps.unshift(`'exports'`); cjsDeps.unshift(`exports`); globalDeps.unshift( assignToDeepVariable( name!, globalVariable, globals, `${ extend ? `${globalProperty(name!, globalVariable, getPropertyAccess)}${_}||${_}` : '' }{}`, snippets ) ); factoryParameters.unshift('exports'); } const completeAmdId = getCompleteAmdId(amd, id); const amdParameters = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + (amdDeps.length > 0 ? `[${amdDeps.join(`,${_}`)}],${_}` : ``); const define = amd.define; const cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``; const useStrict = strict ? `${_}'use strict';${n}` : ``; let iifeExport; if (noConflict) { const noConflictExportsVariable = compact ? 'e' : 'exports'; let factory; if (!namedExportsMode && hasExports) { factory = `${cnst} ${noConflictExportsVariable}${_}=${_}${assignToDeepVariable( name!, globalVariable, globals, `${factoryVariable}(${globalDeps.join(`,${_}`)})`, snippets )};`; } else { const module = globalDeps.shift(); factory = `${cnst} ${noConflictExportsVariable}${_}=${_}${module};${n}` + `${t}${t}${factoryVariable}(${[noConflictExportsVariable, ...globalDeps].join(`,${_}`)});`; } iifeExport = `(${getFunctionIntro([], { isAsync: false, name: null })}{${n}` + `${t}${t}${cnst} current${_}=${_}${safeAccess(name!, globalVariable, snippets)};${n}` + `${t}${t}${factory}${n}` + `${t}${t}${noConflictExportsVariable}.noConflict${_}=${_}${getFunctionIntro([], { isAsync: false, name: null })}{${_}` + `${globalProperty( name!, globalVariable, getPropertyAccess )}${_}=${_}current;${_}return ${noConflictExportsVariable}${s}${_}};${n}` + `${t}})()`; } else { iifeExport = `${factoryVariable}(${globalDeps.join(`,${_}`)})`; if (!namedExportsMode && hasExports) { iifeExport = assignToDeepVariable(name!, globalVariable, globals, iifeExport, snippets); } } const iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0; const wrapperParameters: string[] = [factoryVariable]; if (iifeNeedsGlobal) { wrapperParameters.unshift(globalVariable); } const globalArgument = iifeNeedsGlobal ? `this,${_}` : ''; const iifeStart = iifeNeedsGlobal ? `(${globalVariable}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVariable}${_}||${_}self,${_}` : ''; const iifeEnd = iifeNeedsGlobal ? ')' : ''; const cjsIntro = iifeNeedsGlobal ? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` + `${_}${cjsExport}${factoryVariable}(${cjsDeps.join(`,${_}`)})${_}:${n}` : ''; const wrapperIntro = `(${getNonArrowFunctionIntro(wrapperParameters, { isAsync: false, name: null })}{${n}` + cjsIntro + `${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParameters}${factoryVariable})${_}:${n}` + `${t}${iifeStart}${iifeExport}${iifeEnd};${n}` + // factory function should be wrapped by parentheses to avoid lazy parsing, // cf. https://v8.dev/blog/preparser#pife `})(${globalArgument}(${getNonArrowFunctionIntro(factoryParameters, { isAsync: false, name: null })}{${useStrict}${n}`; const wrapperOutro = n + n + '}));'; magicString.prepend( `${intro}${getInteropBlock( dependencies, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, t, snippets )}` ); const exportBlock = getExportBlock( exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings ); let namespaceMarkers = getNamespaceMarkers( namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), namespaceToStringTag, snippets ); if (namespaceMarkers) { namespaceMarkers = n + n + namespaceMarkers; } magicString .append(`${exportBlock}${namespaceMarkers}${outro}`) .trim() .indent(t) .append(wrapperOutro) .prepend(wrapperIntro); } rollup-3.29.4/src/node-entry.ts000066400000000000000000000002561450520414700163560ustar00rootroot00000000000000export { default as rollup, defineConfig } from './rollup/rollup'; export { default as watch } from './watch/watch-proxy'; export { version as VERSION } from 'package.json'; rollup-3.29.4/src/rollup/000077500000000000000000000000001450520414700152345ustar00rootroot00000000000000rollup-3.29.4/src/rollup/rollup.ts000066400000000000000000000224541450520414700171300ustar00rootroot00000000000000import { version as rollupVersion } from 'package.json'; import Bundle from '../Bundle'; import Graph from '../Graph'; import type { PluginDriver } from '../utils/PluginDriver'; import { getSortedValidatedPlugins } from '../utils/PluginDriver'; import { mkdir, writeFile } from '../utils/fs'; import { catchUnfinishedHookActions } from '../utils/hookActions'; import { getLogHandler } from '../utils/logHandler'; import { getLogger } from '../utils/logger'; import { LOGLEVEL_DEBUG, LOGLEVEL_INFO, LOGLEVEL_WARN } from '../utils/logging'; import { error, logAlreadyClosed, logCannotEmitFromOptionsHook, logMissingFileOrDirOption, logPluginError } from '../utils/logs'; import { normalizeInputOptions } from '../utils/options/normalizeInputOptions'; import { normalizeOutputOptions } from '../utils/options/normalizeOutputOptions'; import { getOnLog, normalizeLog, normalizePluginOption } from '../utils/options/options'; import { dirname, resolve } from '../utils/path'; import { ANONYMOUS_OUTPUT_PLUGIN_PREFIX, ANONYMOUS_PLUGIN_PREFIX } from '../utils/pluginUtils'; import { getTimings, initialiseTimers, timeEnd, timeStart } from '../utils/timers'; import type { InputOptions, NormalizedInputOptions, NormalizedOutputOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, Plugin, RollupBuild, RollupOptions, RollupOptionsFunction, RollupOutput, RollupWatcher } from './types'; export default function rollup(rawInputOptions: RollupOptions): Promise { return rollupInternal(rawInputOptions, null); } export async function rollupInternal( rawInputOptions: RollupOptions, watcher: RollupWatcher | null ): Promise { const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions( rawInputOptions, watcher !== null ); initialiseTimers(inputOptions); const graph = new Graph(inputOptions, watcher); // remove the cache object from the memory after graph creation (cache is not used anymore) const useCache = rawInputOptions.cache !== false; if (rawInputOptions.cache) { inputOptions.cache = undefined; rawInputOptions.cache = undefined; } timeStart('BUILD', 1); await catchUnfinishedHookActions(graph.pluginDriver, async () => { try { timeStart('initialize', 2); await graph.pluginDriver.hookParallel('buildStart', [inputOptions]); timeEnd('initialize', 2); await graph.build(); } catch (error_: any) { const watchFiles = Object.keys(graph.watchFiles); if (watchFiles.length > 0) { error_.watchFiles = watchFiles; } await graph.pluginDriver.hookParallel('buildEnd', [error_]); await graph.pluginDriver.hookParallel('closeBundle', []); throw error_; } await graph.pluginDriver.hookParallel('buildEnd', []); }); timeEnd('BUILD', 1); const result: RollupBuild = { cache: useCache ? graph.getCache() : undefined, async close() { if (result.closed) return; result.closed = true; await graph.pluginDriver.hookParallel('closeBundle', []); }, closed: false, async generate(rawOutputOptions: OutputOptions) { if (result.closed) return error(logAlreadyClosed()); return handleGenerateWrite(false, inputOptions, unsetInputOptions, rawOutputOptions, graph); }, watchFiles: Object.keys(graph.watchFiles), async write(rawOutputOptions: OutputOptions) { if (result.closed) return error(logAlreadyClosed()); return handleGenerateWrite(true, inputOptions, unsetInputOptions, rawOutputOptions, graph); } }; if (inputOptions.perf) result.getTimings = getTimings; return result; } async function getInputOptions( initialInputOptions: InputOptions, watchMode: boolean ): Promise<{ options: NormalizedInputOptions; unsetOptions: Set }> { if (!initialInputOptions) { throw new Error('You must supply an options object to rollup'); } const processedInputOptions = await getProcessedInputOptions(initialInputOptions, watchMode); const { options, unsetOptions } = await normalizeInputOptions(processedInputOptions, watchMode); normalizePlugins(options.plugins, ANONYMOUS_PLUGIN_PREFIX); return { options, unsetOptions }; } async function getProcessedInputOptions( inputOptions: InputOptions, watchMode: boolean ): Promise { const plugins = getSortedValidatedPlugins( 'options', await normalizePluginOption(inputOptions.plugins) ); const logLevel = inputOptions.logLevel || LOGLEVEL_INFO; const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), watchMode, logLevel); for (const plugin of plugins) { const { name, options } = plugin; const handler = 'handler' in options! ? options.handler : options!; const processedOptions = await handler.call( { debug: getLogHandler(LOGLEVEL_DEBUG, 'PLUGIN_LOG', logger, name, logLevel), error: (error_): never => error(logPluginError(normalizeLog(error_), name, { hook: 'onLog' })), info: getLogHandler(LOGLEVEL_INFO, 'PLUGIN_LOG', logger, name, logLevel), meta: { rollupVersion, watchMode }, warn: getLogHandler(LOGLEVEL_WARN, 'PLUGIN_WARNING', logger, name, logLevel) }, inputOptions ); if (processedOptions) { inputOptions = processedOptions; } } return inputOptions; } function normalizePlugins(plugins: readonly Plugin[], anonymousPrefix: string): void { for (const [index, plugin] of plugins.entries()) { if (!plugin.name) { plugin.name = `${anonymousPrefix}${index + 1}`; } } } async function handleGenerateWrite( isWrite: boolean, inputOptions: NormalizedInputOptions, unsetInputOptions: ReadonlySet, rawOutputOptions: OutputOptions, graph: Graph ): Promise { const { options: outputOptions, outputPluginDriver, unsetOptions } = await getOutputOptionsAndPluginDriver( rawOutputOptions, graph.pluginDriver, inputOptions, unsetInputOptions ); return catchUnfinishedHookActions(outputPluginDriver, async () => { const bundle = new Bundle(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph); const generated = await bundle.generate(isWrite); if (isWrite) { timeStart('WRITE', 1); if (!outputOptions.dir && !outputOptions.file) { return error(logMissingFileOrDirOption()); } await Promise.all( Object.values(generated).map(chunk => graph.fileOperationQueue.run(() => writeOutputFile(chunk, outputOptions)) ) ); await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]); timeEnd('WRITE', 1); } return createOutput(generated); }); } async function getOutputOptionsAndPluginDriver( rawOutputOptions: OutputOptions, inputPluginDriver: PluginDriver, inputOptions: NormalizedInputOptions, unsetInputOptions: ReadonlySet ): Promise<{ options: NormalizedOutputOptions; outputPluginDriver: PluginDriver; unsetOptions: Set; }> { if (!rawOutputOptions) { throw new Error('You must supply an options object'); } const rawPlugins = await normalizePluginOption(rawOutputOptions.plugins); normalizePlugins(rawPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX); const outputPluginDriver = inputPluginDriver.createOutputPluginDriver(rawPlugins); return { ...(await getOutputOptions( inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver )), outputPluginDriver }; } function getOutputOptions( inputOptions: NormalizedInputOptions, unsetInputOptions: ReadonlySet, rawOutputOptions: OutputOptions, outputPluginDriver: PluginDriver ): Promise<{ options: NormalizedOutputOptions; unsetOptions: Set }> { return normalizeOutputOptions( outputPluginDriver.hookReduceArg0Sync( 'outputOptions', [rawOutputOptions], (outputOptions, result) => result || outputOptions, pluginContext => { const emitError = () => pluginContext.error(logCannotEmitFromOptionsHook()); return { ...pluginContext, emitFile: emitError, setAssetSource: emitError }; } ), inputOptions, unsetInputOptions ); } function createOutput(outputBundle: OutputBundle): RollupOutput { return { output: ( Object.values(outputBundle).filter(outputFile => Object.keys(outputFile).length > 0) as ( | OutputChunk | OutputAsset )[] ).sort( (outputFileA, outputFileB) => getSortingFileType(outputFileA) - getSortingFileType(outputFileB) ) as [OutputChunk, ...(OutputChunk | OutputAsset)[]] }; } enum SortingFileType { ENTRY_CHUNK = 0, SECONDARY_CHUNK = 1, ASSET = 2 } function getSortingFileType(file: OutputAsset | OutputChunk): SortingFileType { if (file.type === 'asset') { return SortingFileType.ASSET; } if (file.isEntry) { return SortingFileType.ENTRY_CHUNK; } return SortingFileType.SECONDARY_CHUNK; } async function writeOutputFile( outputFile: OutputAsset | OutputChunk, outputOptions: NormalizedOutputOptions ): Promise { const fileName = resolve(outputOptions.dir || dirname(outputOptions.file!), outputFile.fileName); // 'recursive: true' does not throw if the folder structure, or parts of it, already exist await mkdir(dirname(fileName), { recursive: true }); return writeFile(fileName, outputFile.type === 'asset' ? outputFile.source : outputFile.code); } /** * Auxiliary function for defining rollup configuration * Mainly to facilitate IDE code prompts, after all, export default does not * prompt, even if you add @type annotations, it is not accurate * @param options */ export function defineConfig( options: T ): T { return options; } rollup-3.29.4/src/rollup/types.d.ts000066400000000000000000000704131450520414700171770ustar00rootroot00000000000000export const VERSION: string; // utils type NullValue = null | undefined | void; type MaybeArray = T | T[]; type MaybePromise = T | Promise; type PartialNull = { [P in keyof T]: T[P] | null; }; export interface RollupError extends RollupLog { name?: string; stack?: string; watchFiles?: string[]; } export type RollupWarning = RollupLog; export interface RollupLog { binding?: string; cause?: unknown; code?: string; exporter?: string; frame?: string; hook?: string; id?: string; ids?: string[]; loc?: { column: number; file?: string; line: number; }; message: string; meta?: any; names?: string[]; plugin?: string; pluginCode?: unknown; pos?: number; reexporter?: string; stack?: string; url?: string; } export type LogLevel = 'warn' | 'info' | 'debug'; export type LogLevelOption = LogLevel | 'silent'; export type SourceMapSegment = | [number] | [number, number, number, number] | [number, number, number, number, number]; export interface ExistingDecodedSourceMap { file?: string; readonly mappings: SourceMapSegment[][]; names: string[]; sourceRoot?: string; sources: string[]; sourcesContent?: (string | null)[]; version: number; x_google_ignoreList?: number[]; } export interface ExistingRawSourceMap { file?: string; mappings: string; names: string[]; sourceRoot?: string; sources: string[]; sourcesContent?: (string | null)[]; version: number; x_google_ignoreList?: number[]; } export type DecodedSourceMapOrMissing = | { missing: true; plugin: string; } | (ExistingDecodedSourceMap & { missing?: false }); export interface SourceMap { file: string; mappings: string; names: string[]; sources: string[]; sourcesContent: (string | null)[]; version: number; toString(): string; toUrl(): string; } export type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' }; interface ModuleOptions { assertions: Record; meta: CustomPluginOptions; moduleSideEffects: boolean | 'no-treeshake'; syntheticNamedExports: boolean | string; } export interface SourceDescription extends Partial> { ast?: AcornNode; code: string; map?: SourceMapInput; } export interface TransformModuleJSON { ast?: AcornNode; code: string; // note if plugins use new this.cache to opt-out auto transform cache customTransformCache: boolean; originalCode: string; originalSourcemap: ExistingDecodedSourceMap | null; sourcemapChain: DecodedSourceMapOrMissing[]; transformDependencies: string[]; } export interface ModuleJSON extends TransformModuleJSON, ModuleOptions { ast: AcornNode; dependencies: string[]; id: string; resolvedIds: ResolvedIdMap; transformFiles: EmittedFile[] | undefined; } export interface PluginCache { delete(id: string): boolean; get(id: string): T; has(id: string): boolean; set(id: string, value: T): void; } export type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void; export interface MinimalPluginContext { debug: LoggingFunction; error: (error: RollupError | string) => never; info: LoggingFunction; meta: PluginContextMeta; warn: LoggingFunction; } export interface EmittedAsset { fileName?: string; name?: string; needsCodeReference?: boolean; source?: string | Uint8Array; type: 'asset'; } export interface EmittedChunk { fileName?: string; id: string; implicitlyLoadedAfterOneOf?: string[]; importer?: string; name?: string; preserveSignature?: PreserveEntrySignaturesOption; type: 'chunk'; } export interface EmittedPrebuiltChunk { code: string; exports?: string[]; fileName: string; map?: SourceMap; sourcemapFileName?: string; type: 'prebuilt-chunk'; } export type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk; export type EmitFile = (emittedFile: EmittedFile) => string; interface ModuleInfo extends ModuleOptions { ast: AcornNode | null; code: string | null; dynamicImporters: readonly string[]; dynamicallyImportedIdResolutions: readonly ResolvedId[]; dynamicallyImportedIds: readonly string[]; exportedBindings: Record | null; exports: string[] | null; hasDefaultExport: boolean | null; /** @deprecated Use `moduleSideEffects` instead */ hasModuleSideEffects: boolean | 'no-treeshake'; id: string; implicitlyLoadedAfterOneOf: readonly string[]; implicitlyLoadedBefore: readonly string[]; importedIdResolutions: readonly ResolvedId[]; importedIds: readonly string[]; importers: readonly string[]; isEntry: boolean; isExternal: boolean; isIncluded: boolean | null; } export type GetModuleInfo = (moduleId: string) => ModuleInfo | null; export interface CustomPluginOptions { [plugin: string]: any; } type LoggingFunctionWithPosition = ( log: RollupLog | string | (() => RollupLog | string), pos?: number | { column: number; line: number } ) => void; export interface PluginContext extends MinimalPluginContext { addWatchFile: (id: string) => void; cache: PluginCache; debug: LoggingFunction; emitFile: EmitFile; error: (error: RollupError | string) => never; getFileName: (fileReferenceId: string) => string; getModuleIds: () => IterableIterator; getModuleInfo: GetModuleInfo; getWatchFiles: () => string[]; info: LoggingFunction; load: ( options: { id: string; resolveDependencies?: boolean } & Partial> ) => Promise; /** @deprecated Use `this.getModuleIds` instead */ moduleIds: IterableIterator; parse: (input: string, options?: any) => AcornNode; resolve: ( source: string, importer?: string, options?: { assertions?: Record; custom?: CustomPluginOptions; isEntry?: boolean; skipSelf?: boolean; } ) => Promise; setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void; warn: LoggingFunction; } export interface PluginContextMeta { rollupVersion: string; watchMode: boolean; } export interface ResolvedId extends ModuleOptions { external: boolean | 'absolute'; id: string; resolvedBy: string; } export interface ResolvedIdMap { [key: string]: ResolvedId; } interface PartialResolvedId extends Partial> { external?: boolean | 'absolute' | 'relative'; id: string; resolvedBy?: string; } export type ResolveIdResult = string | NullValue | false | PartialResolvedId; export type ResolveIdResultWithoutNullValue = string | false | PartialResolvedId; export type ResolveIdHook = ( this: PluginContext, source: string, importer: string | undefined, options: { assertions: Record; custom?: CustomPluginOptions; isEntry: boolean } ) => ResolveIdResult; export type ShouldTransformCachedModuleHook = ( this: PluginContext, options: { ast: AcornNode; code: string; id: string; meta: CustomPluginOptions; moduleSideEffects: boolean | 'no-treeshake'; resolvedSources: ResolvedIdMap; syntheticNamedExports: boolean | string; } ) => boolean | NullValue; export type IsExternal = ( source: string, importer: string | undefined, isResolved: boolean ) => boolean; export type IsPureModule = (id: string) => boolean | NullValue; export type HasModuleSideEffects = (id: string, external: boolean) => boolean; export type LoadResult = SourceDescription | string | NullValue; export type LoadHook = (this: PluginContext, id: string) => LoadResult; export interface TransformPluginContext extends PluginContext { debug: LoggingFunctionWithPosition; error: (error: RollupError | string, pos?: number | { column: number; line: number }) => never; getCombinedSourcemap: () => SourceMap; info: LoggingFunctionWithPosition; warn: LoggingFunctionWithPosition; } export type TransformResult = string | NullValue | Partial; export type TransformHook = ( this: TransformPluginContext, code: string, id: string ) => TransformResult; export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void; export type RenderChunkHook = ( this: PluginContext, code: string, chunk: RenderedChunk, options: NormalizedOutputOptions, meta: { chunks: Record } ) => { code: string; map?: SourceMapInput } | string | NullValue; export type ResolveDynamicImportHook = ( this: PluginContext, specifier: string | AcornNode, importer: string, options: { assertions: Record } ) => ResolveIdResult; export type ResolveImportMetaHook = ( this: PluginContext, property: string | null, options: { chunkId: string; format: InternalModuleFormat; moduleId: string } ) => string | NullValue; export type ResolveFileUrlHook = ( this: PluginContext, options: { chunkId: string; fileName: string; format: InternalModuleFormat; moduleId: string; referenceId: string; relativePath: string; } ) => string | NullValue; export type AddonHookFunction = ( this: PluginContext, chunk: RenderedChunk ) => string | Promise; export type AddonHook = string | AddonHookFunction; export type ChangeEvent = 'create' | 'update' | 'delete'; export type WatchChangeHook = ( this: PluginContext, id: string, change: { event: ChangeEvent } ) => void; /** * use this type for plugin annotation * @example * ```ts * interface Options { * ... * } * const myPlugin: PluginImpl = (options = {}) => { ... } * ``` */ // eslint-disable-next-line @typescript-eslint/ban-types export type PluginImpl = (options?: O) => Plugin; export interface OutputBundle { [fileName: string]: OutputAsset | OutputChunk; } export interface FunctionPluginHooks { augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void; buildEnd: (this: PluginContext, error?: Error) => void; buildStart: (this: PluginContext, options: NormalizedInputOptions) => void; closeBundle: (this: PluginContext) => void; closeWatcher: (this: PluginContext) => void; generateBundle: ( this: PluginContext, options: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean ) => void; load: LoadHook; moduleParsed: ModuleParsedHook; onLog: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => boolean | NullValue; options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue; outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue; renderChunk: RenderChunkHook; renderDynamicImport: ( this: PluginContext, options: { customResolution: string | null; format: InternalModuleFormat; moduleId: string; targetModuleId: string | null; } ) => { left: string; right: string } | NullValue; renderError: (this: PluginContext, error?: Error) => void; renderStart: ( this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions ) => void; resolveDynamicImport: ResolveDynamicImportHook; resolveFileUrl: ResolveFileUrlHook; resolveId: ResolveIdHook; resolveImportMeta: ResolveImportMetaHook; shouldTransformCachedModule: ShouldTransformCachedModuleHook; transform: TransformHook; watchChange: WatchChangeHook; writeBundle: ( this: PluginContext, options: NormalizedOutputOptions, bundle: OutputBundle ) => void; } export type OutputPluginHooks = | 'augmentChunkHash' | 'generateBundle' | 'outputOptions' | 'renderChunk' | 'renderDynamicImport' | 'renderError' | 'renderStart' | 'resolveFileUrl' | 'resolveImportMeta' | 'writeBundle'; export type InputPluginHooks = Exclude; export type SyncPluginHooks = | 'augmentChunkHash' | 'onLog' | 'outputOptions' | 'renderDynamicImport' | 'resolveFileUrl' | 'resolveImportMeta'; export type AsyncPluginHooks = Exclude; export type FirstPluginHooks = | 'load' | 'renderDynamicImport' | 'resolveDynamicImport' | 'resolveFileUrl' | 'resolveId' | 'resolveImportMeta' | 'shouldTransformCachedModule'; export type SequentialPluginHooks = | 'augmentChunkHash' | 'generateBundle' | 'onLog' | 'options' | 'outputOptions' | 'renderChunk' | 'transform'; export type ParallelPluginHooks = Exclude< keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks >; export type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro'; type MakeAsync = Function_ extends ( this: infer This, ...parameters: infer Arguments ) => infer Return ? (this: This, ...parameters: Arguments) => Return | Promise : never; // eslint-disable-next-line @typescript-eslint/ban-types type ObjectHook = T | ({ handler: T; order?: 'pre' | 'post' | null } & O); export type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook< K extends AsyncPluginHooks ? MakeAsync : FunctionPluginHooks[K], // eslint-disable-next-line @typescript-eslint/ban-types K extends ParallelPluginHooks ? { sequential?: boolean } : {} >; }; export interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial<{ [K in AddonHooks]: ObjectHook }> { cacheKey?: string; name: string; version?: string; } export interface Plugin extends OutputPlugin, Partial { // for inter-plugin communication api?: A; } export type TreeshakingPreset = 'smallest' | 'safest' | 'recommended'; export interface NormalizedTreeshakingOptions { annotations: boolean; correctVarValueBeforeDeclaration: boolean; manualPureFunctions: readonly string[]; moduleSideEffects: HasModuleSideEffects; propertyReadSideEffects: boolean | 'always'; tryCatchDeoptimization: boolean; unknownGlobalSideEffects: boolean; } export interface TreeshakingOptions extends Partial> { moduleSideEffects?: ModuleSideEffectsOption; preset?: TreeshakingPreset; } interface ManualChunkMeta { getModuleIds: () => IterableIterator; getModuleInfo: GetModuleInfo; } export type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue; export type ExternalOption = | (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue); export type GlobalsOption = { [name: string]: string } | ((name: string) => string); export type InputOption = string | string[] | { [entryAlias: string]: string }; export type ManualChunksOption = { [chunkAlias: string]: string[] } | GetManualChunk; export type LogHandlerWithDefault = ( level: LogLevel, log: RollupLog, defaultHandler: LogOrStringHandler ) => void; export type LogOrStringHandler = (level: LogLevel | 'error', log: RollupLog | string) => void; export type LogHandler = (level: LogLevel, log: RollupLog) => void; export type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects; export type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only'; export type SourcemapPathTransformOption = ( relativeSourcePath: string, sourcemapPath: string ) => string; export type SourcemapIgnoreListOption = ( relativeSourcePath: string, sourcemapPath: string ) => boolean; export type InputPluginOption = MaybePromise; export interface InputOptions { acorn?: Record; acornInjectPlugins?: ((...arguments_: any[]) => unknown)[] | ((...arguments_: any[]) => unknown); cache?: boolean | RollupCache; context?: string; experimentalCacheExpiry?: number; experimentalLogSideEffects?: boolean; external?: ExternalOption; /** @deprecated Use the "inlineDynamicImports" output option instead. */ inlineDynamicImports?: boolean; input?: InputOption; logLevel?: LogLevelOption; makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource'; /** @deprecated Use the "manualChunks" output option instead. */ manualChunks?: ManualChunksOption; maxParallelFileOps?: number; /** @deprecated Use the "maxParallelFileOps" option instead. */ maxParallelFileReads?: number; moduleContext?: ((id: string) => string | NullValue) | { [id: string]: string }; onLog?: LogHandlerWithDefault; onwarn?: WarningHandlerWithDefault; perf?: boolean; plugins?: InputPluginOption; preserveEntrySignatures?: PreserveEntrySignaturesOption; /** @deprecated Use the "preserveModules" output option instead. */ preserveModules?: boolean; preserveSymlinks?: boolean; shimMissingExports?: boolean; strictDeprecations?: boolean; treeshake?: boolean | TreeshakingPreset | TreeshakingOptions; watch?: WatcherOptions | false; } export interface InputOptionsWithPlugins extends InputOptions { plugins: Plugin[]; } export interface NormalizedInputOptions { acorn: Record; acornInjectPlugins: (() => unknown)[]; cache: false | undefined | RollupCache; context: string; experimentalCacheExpiry: number; experimentalLogSideEffects: boolean; external: IsExternal; /** @deprecated Use the "inlineDynamicImports" output option instead. */ inlineDynamicImports: boolean | undefined; input: string[] | { [entryAlias: string]: string }; logLevel: LogLevelOption; makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource'; /** @deprecated Use the "manualChunks" output option instead. */ manualChunks: ManualChunksOption | undefined; maxParallelFileOps: number; /** @deprecated Use the "maxParallelFileOps" option instead. */ maxParallelFileReads: number; moduleContext: (id: string) => string; onLog: LogHandler; onwarn: (warning: RollupLog) => void; perf: boolean; plugins: Plugin[]; preserveEntrySignatures: PreserveEntrySignaturesOption; /** @deprecated Use the "preserveModules" output option instead. */ preserveModules: boolean | undefined; preserveSymlinks: boolean; shimMissingExports: boolean; strictDeprecations: boolean; treeshake: false | NormalizedTreeshakingOptions; } export type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd'; export type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs'; type GeneratedCodePreset = 'es5' | 'es2015'; interface NormalizedGeneratedCodeOptions { arrowFunctions: boolean; constBindings: boolean; objectShorthand: boolean; reservedNamesAsProps: boolean; symbols: boolean; } interface GeneratedCodeOptions extends Partial { preset?: GeneratedCodePreset; } export type OptionsPaths = Record | ((id: string) => string); export type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly'; export type GetInterop = (id: string | null) => InteropType; export type AmdOptions = ( | { autoId?: false; id: string; } | { autoId: true; basePath?: string; id?: undefined; } | { autoId?: false; id?: undefined; } ) & { define?: string; forceJsExtensionForImports?: boolean; }; export type NormalizedAmdOptions = ( | { autoId: false; id?: string; } | { autoId: true; basePath: string; } ) & { define: string; forceJsExtensionForImports: boolean; }; type AddonFunction = (chunk: RenderedChunk) => string | Promise; type OutputPluginOption = MaybePromise; export interface OutputOptions { amd?: AmdOptions; assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string); banner?: string | AddonFunction; chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string); compact?: boolean; // only required for bundle.write dir?: string; /** @deprecated Use the "renderDynamicImport" plugin hook instead. */ dynamicImportFunction?: string; dynamicImportInCjs?: boolean; entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string); esModule?: boolean | 'if-default-prop'; /** @deprecated This option is no longer needed and ignored. */ experimentalDeepDynamicChunkOptimization?: boolean; experimentalMinChunkSize?: number; exports?: 'default' | 'named' | 'none' | 'auto'; extend?: boolean; externalImportAssertions?: boolean; externalLiveBindings?: boolean; // only required for bundle.write file?: string; footer?: string | AddonFunction; format?: ModuleFormat; freeze?: boolean; generatedCode?: GeneratedCodePreset | GeneratedCodeOptions; globals?: GlobalsOption; hoistTransitiveImports?: boolean; indent?: string | boolean; inlineDynamicImports?: boolean; interop?: InteropType | GetInterop; intro?: string | AddonFunction; manualChunks?: ManualChunksOption; minifyInternalExports?: boolean; name?: string; /** @deprecated Use "generatedCode.symbols" instead. */ namespaceToStringTag?: boolean; noConflict?: boolean; outro?: string | AddonFunction; paths?: OptionsPaths; plugins?: OutputPluginOption; /** @deprecated Use "generatedCode.constBindings" instead. */ preferConst?: boolean; preserveModules?: boolean; preserveModulesRoot?: string; sanitizeFileName?: boolean | ((fileName: string) => string); sourcemap?: boolean | 'inline' | 'hidden'; sourcemapBaseUrl?: string; sourcemapExcludeSources?: boolean; sourcemapFile?: string; sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string); sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption; sourcemapPathTransform?: SourcemapPathTransformOption; strict?: boolean; systemNullSetters?: boolean; validate?: boolean; } export interface NormalizedOutputOptions { amd: NormalizedAmdOptions; assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string); banner: AddonFunction; chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string); compact: boolean; dir: string | undefined; /** @deprecated Use the "renderDynamicImport" plugin hook instead. */ dynamicImportFunction: string | undefined; dynamicImportInCjs: boolean; entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string); esModule: boolean | 'if-default-prop'; /** @deprecated This option is no longer needed and ignored. */ experimentalDeepDynamicChunkOptimization: boolean; experimentalMinChunkSize: number; exports: 'default' | 'named' | 'none' | 'auto'; extend: boolean; externalImportAssertions: boolean; externalLiveBindings: boolean; file: string | undefined; footer: AddonFunction; format: InternalModuleFormat; freeze: boolean; generatedCode: NormalizedGeneratedCodeOptions; globals: GlobalsOption; hoistTransitiveImports: boolean; indent: true | string; inlineDynamicImports: boolean; interop: GetInterop; intro: AddonFunction; manualChunks: ManualChunksOption; minifyInternalExports: boolean; name: string | undefined; /** @deprecated Use "generatedCode.symbols" instead. */ namespaceToStringTag: boolean; noConflict: boolean; outro: AddonFunction; paths: OptionsPaths; plugins: OutputPlugin[]; /** @deprecated Use "generatedCode.constBindings" instead. */ preferConst: boolean; preserveModules: boolean; preserveModulesRoot: string | undefined; sanitizeFileName: (fileName: string) => string; sourcemap: boolean | 'inline' | 'hidden'; sourcemapBaseUrl: string | undefined; sourcemapExcludeSources: boolean; sourcemapFile: string | undefined; sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined; sourcemapIgnoreList: SourcemapIgnoreListOption; sourcemapPathTransform: SourcemapPathTransformOption | undefined; strict: boolean; systemNullSetters: boolean; validate: boolean; } export type WarningHandlerWithDefault = ( warning: RollupLog, defaultHandler: LoggingFunction ) => void; export interface SerializedTimings { [label: string]: [number, number, number]; } export interface PreRenderedAsset { name: string | undefined; source: string | Uint8Array; type: 'asset'; } export interface OutputAsset extends PreRenderedAsset { fileName: string; needsCodeReference: boolean; } export interface RenderedModule { readonly code: string | null; originalLength: number; removedExports: string[]; renderedExports: string[]; renderedLength: number; } export interface PreRenderedChunk { exports: string[]; facadeModuleId: string | null; isDynamicEntry: boolean; isEntry: boolean; isImplicitEntry: boolean; moduleIds: string[]; name: string; type: 'chunk'; } export interface RenderedChunk extends PreRenderedChunk { dynamicImports: string[]; fileName: string; implicitlyLoadedBefore: string[]; importedBindings: { [imported: string]: string[]; }; imports: string[]; modules: { [id: string]: RenderedModule; }; referencedFiles: string[]; } export interface OutputChunk extends RenderedChunk { code: string; map: SourceMap | null; sourcemapFileName: string | null; preliminaryFileName: string; } export interface SerializablePluginCache { [key: string]: [number, any]; } export interface RollupCache { modules: ModuleJSON[]; plugins?: Record; } export interface RollupOutput { output: [OutputChunk, ...(OutputChunk | OutputAsset)[]]; } export interface RollupBuild { cache: RollupCache | undefined; close: () => Promise; closed: boolean; generate: (outputOptions: OutputOptions) => Promise; getTimings?: () => SerializedTimings; watchFiles: string[]; write: (options: OutputOptions) => Promise; } export interface RollupOptions extends InputOptions { // This is included for compatibility with config files but ignored by rollup.rollup output?: OutputOptions | OutputOptions[]; } export interface MergedRollupOptions extends InputOptionsWithPlugins { output: OutputOptions[]; } export function rollup(options: RollupOptions): Promise; export interface ChokidarOptions { alwaysStat?: boolean; atomic?: boolean | number; awaitWriteFinish?: | { pollInterval?: number; stabilityThreshold?: number; } | boolean; binaryInterval?: number; cwd?: string; depth?: number; disableGlobbing?: boolean; followSymlinks?: boolean; ignoreInitial?: boolean; ignorePermissionErrors?: boolean; ignored?: any; interval?: number; persistent?: boolean; useFsEvents?: boolean; usePolling?: boolean; } export type RollupWatchHooks = 'onError' | 'onStart' | 'onBundleStart' | 'onBundleEnd' | 'onEnd'; export interface WatcherOptions { buildDelay?: number; chokidar?: ChokidarOptions; clearScreen?: boolean; exclude?: string | RegExp | (string | RegExp)[]; include?: string | RegExp | (string | RegExp)[]; skipWrite?: boolean; } export interface RollupWatchOptions extends InputOptions { output?: OutputOptions | OutputOptions[]; watch?: WatcherOptions | false; } export type AwaitedEventListener< T extends { [event: string]: (...parameters: any) => any }, K extends keyof T > = (...parameters: Parameters) => void | Promise; export interface AwaitingEventEmitter any }> { close(): Promise; emit(event: K, ...parameters: Parameters): Promise; /** * Removes an event listener. */ off(event: K, listener: AwaitedEventListener): this; /** * Registers an event listener that will be awaited before Rollup continues. * All listeners will be awaited in parallel while rejections are tracked via * Promise.all. */ on(event: K, listener: AwaitedEventListener): this; /** * Registers an event listener that will be awaited before Rollup continues. * All listeners will be awaited in parallel while rejections are tracked via * Promise.all. * Listeners are removed automatically when removeListenersForCurrentRun is * called, which happens automatically after each run. */ onCurrentRun( event: K, listener: (...parameters: Parameters) => Promise> ): this; removeAllListeners(): this; removeListenersForCurrentRun(): this; } export type RollupWatcherEvent = | { code: 'START' } | { code: 'BUNDLE_START'; input?: InputOption; output: readonly string[] } | { code: 'BUNDLE_END'; duration: number; input?: InputOption; output: readonly string[]; result: RollupBuild; } | { code: 'END' } | { code: 'ERROR'; error: RollupError; result: RollupBuild | null }; export type RollupWatcher = AwaitingEventEmitter<{ change: (id: string, change: { event: ChangeEvent }) => void; close: () => void; event: (event: RollupWatcherEvent) => void; restart: () => void; }>; export function watch(config: RollupWatchOptions | RollupWatchOptions[]): RollupWatcher; interface AcornNode { end: number; start: number; type: string; } export function defineConfig(options: RollupOptions): RollupOptions; export function defineConfig(options: RollupOptions[]): RollupOptions[]; export function defineConfig(optionsFunction: RollupOptionsFunction): RollupOptionsFunction; export type RollupOptionsFunction = ( commandLineArguments: Record ) => MaybePromise; rollup-3.29.4/src/utils/000077500000000000000000000000001450520414700150575ustar00rootroot00000000000000rollup-3.29.4/src/utils/FileEmitter.ts000066400000000000000000000373711450520414700176530ustar00rootroot00000000000000import type Chunk from '../Chunk'; import type Graph from '../Graph'; import type Module from '../Module'; import type { EmittedAsset, EmittedChunk, EmittedPrebuiltChunk, LogHandler, NormalizedInputOptions, NormalizedOutputOptions, OutputChunk } from '../rollup/types'; import { BuildPhase } from './buildPhase'; import { createHash } from './crypto'; import { getOrCreate } from './getOrCreate'; import { defaultHashSize } from './hashPlaceholders'; import { LOGLEVEL_WARN } from './logging'; import { error, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logChunkNotGeneratedForFileName, logFailedValidation, logFileNameConflict, logFileReferenceIdNotFoundForFilename, logInvalidRollupPhaseForChunkEmission, logNoAssetSourceSet } from './logs'; import type { OutputBundleWithPlaceholders } from './outputBundle'; import { FILE_PLACEHOLDER, lowercaseBundleKeys } from './outputBundle'; import { extname } from './path'; import { isPathFragment } from './relativeId'; import { makeUnique, renderNamePattern } from './renderNamePattern'; function getSourceHash(source: string | Uint8Array): string { return createHash().update(source).digest('hex'); } function generateAssetFileName( name: string | undefined, source: string | Uint8Array, sourceHash: string, outputOptions: NormalizedOutputOptions, bundle: OutputBundleWithPlaceholders ): string { const emittedName = outputOptions.sanitizeFileName(name || 'asset'); return makeUnique( renderNamePattern( typeof outputOptions.assetFileNames === 'function' ? outputOptions.assetFileNames({ name, source, type: 'asset' }) : outputOptions.assetFileNames, 'output.assetFileNames', { ext: () => extname(emittedName).slice(1), extname: () => extname(emittedName), hash: size => sourceHash.slice(0, Math.max(0, size || defaultHashSize)), name: () => emittedName.slice(0, Math.max(0, emittedName.length - extname(emittedName).length)) } ), bundle ); } function reserveFileNameInBundle(fileName: string, { bundle }: FileEmitterOutput, log: LogHandler) { if (bundle[lowercaseBundleKeys].has(fileName.toLowerCase())) { log(LOGLEVEL_WARN, logFileNameConflict(fileName)); } else { bundle[fileName] = FILE_PLACEHOLDER; } } type ConsumedChunk = Pick & { module: null | Module; name: string; referenceId: string; }; type ConsumedPrebuiltChunk = EmittedPrebuiltChunk & { referenceId: string; }; type ConsumedAsset = EmittedAsset & { needsCodeReference: boolean; referenceId: string; }; type ConsumedFile = ConsumedChunk | ConsumedAsset | ConsumedPrebuiltChunk; type EmittedFileType = ConsumedFile['type']; interface EmittedFile { [key: string]: unknown; fileName?: string; name?: string; type: EmittedFileType; } const emittedFileTypes: Set = new Set(['chunk', 'asset', 'prebuilt-chunk']); function hasValidType(emittedFile: unknown): emittedFile is { [key: string]: unknown; type: EmittedFileType; } { return Boolean( emittedFile && emittedFileTypes.has((emittedFile as { [key: string]: unknown; type: EmittedFileType }).type) ); } function hasValidName(emittedFile: { [key: string]: unknown; type: EmittedFileType; }): emittedFile is EmittedFile { const validatedName = emittedFile.fileName || emittedFile.name; return !validatedName || (typeof validatedName === 'string' && !isPathFragment(validatedName)); } function getValidSource( source: unknown, emittedFile: { fileName?: string; name?: string }, fileReferenceId: string | null ): string | Uint8Array { if (!(typeof source === 'string' || source instanceof Uint8Array)) { const assetName = emittedFile.fileName || emittedFile.name || fileReferenceId; return error( logFailedValidation( `Could not set source for ${ typeof assetName === 'string' ? `asset "${assetName}"` : 'unnamed asset' }, asset source needs to be a string, Uint8Array or Buffer.` ) ); } return source; } function getAssetFileName(file: ConsumedAsset, referenceId: string): string { if (typeof file.fileName !== 'string') { return error(logAssetNotFinalisedForFileName(file.name || referenceId)); } return file.fileName; } function getChunkFileName( file: ConsumedChunk, facadeChunkByModule: ReadonlyMap | null ): string { if (file.fileName) { return file.fileName; } if (facadeChunkByModule) { return facadeChunkByModule.get(file.module!)!.getFileName(); } return error(logChunkNotGeneratedForFileName(file.fileName || file.name)); } interface FileEmitterOutput { bundle: OutputBundleWithPlaceholders; fileNamesBySource: Map; outputOptions: NormalizedOutputOptions; } export class FileEmitter { private facadeChunkByModule: ReadonlyMap | null = null; private readonly filesByReferenceId: Map; private nextIdBase = 1; private output: FileEmitterOutput | null = null; private outputFileEmitters: FileEmitter[] = []; constructor( private readonly graph: Graph, private readonly options: NormalizedInputOptions, baseFileEmitter?: FileEmitter ) { this.filesByReferenceId = baseFileEmitter ? new Map(baseFileEmitter.filesByReferenceId) : new Map(); baseFileEmitter?.addOutputFileEmitter(this); } public emitFile = (emittedFile: unknown): string => { if (!hasValidType(emittedFile)) { return error( logFailedValidation( `Emitted files must be of type "asset", "chunk" or "prebuilt-chunk", received "${ emittedFile && (emittedFile as any).type }".` ) ); } if (emittedFile.type === 'prebuilt-chunk') { return this.emitPrebuiltChunk(emittedFile); } if (!hasValidName(emittedFile)) { return error( logFailedValidation( `The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${ emittedFile.fileName || emittedFile.name }".` ) ); } if (emittedFile.type === 'chunk') { return this.emitChunk(emittedFile); } return this.emitAsset(emittedFile); }; public finaliseAssets = (): void => { for (const [referenceId, emittedFile] of this.filesByReferenceId) { if (emittedFile.type === 'asset' && typeof emittedFile.fileName !== 'string') return error(logNoAssetSourceSet(emittedFile.name || referenceId)); } }; public getFileName = (fileReferenceId: string): string => { const emittedFile = this.filesByReferenceId.get(fileReferenceId); if (!emittedFile) return error(logFileReferenceIdNotFoundForFilename(fileReferenceId)); if (emittedFile.type === 'chunk') { return getChunkFileName(emittedFile, this.facadeChunkByModule); } if (emittedFile.type === 'prebuilt-chunk') { return emittedFile.fileName; } return getAssetFileName(emittedFile, fileReferenceId); }; public setAssetSource = (referenceId: string, requestedSource: unknown): void => { const consumedFile = this.filesByReferenceId.get(referenceId); if (!consumedFile) return error(logAssetReferenceIdNotFoundForSetSource(referenceId)); if (consumedFile.type !== 'asset') { return error( logFailedValidation( `Asset sources can only be set for emitted assets but "${referenceId}" is an emitted chunk.` ) ); } if (consumedFile.source !== undefined) { return error(logAssetSourceAlreadySet(consumedFile.name || referenceId)); } const source = getValidSource(requestedSource, consumedFile, referenceId); if (this.output) { this.finalizeAdditionalAsset(consumedFile, source, this.output); } else { consumedFile.source = source; for (const emitter of this.outputFileEmitters) { emitter.finalizeAdditionalAsset(consumedFile, source, emitter.output!); } } }; public setChunkInformation = (facadeChunkByModule: ReadonlyMap): void => { this.facadeChunkByModule = facadeChunkByModule; }; public setOutputBundle = ( bundle: OutputBundleWithPlaceholders, outputOptions: NormalizedOutputOptions ): void => { const output = (this.output = { bundle, fileNamesBySource: new Map(), outputOptions }); for (const emittedFile of this.filesByReferenceId.values()) { if (emittedFile.fileName) { reserveFileNameInBundle(emittedFile.fileName, output, this.options.onLog); } } const consumedAssetsByHash = new Map(); for (const consumedFile of this.filesByReferenceId.values()) { if (consumedFile.type === 'asset' && consumedFile.source !== undefined) { if (consumedFile.fileName) { this.finalizeAdditionalAsset(consumedFile, consumedFile.source, output); } else { const sourceHash = getSourceHash(consumedFile.source); getOrCreate(consumedAssetsByHash, sourceHash, () => []).push(consumedFile); } } else if (consumedFile.type === 'prebuilt-chunk') { this.output.bundle[consumedFile.fileName] = this.createPrebuiltChunk(consumedFile); } } for (const [sourceHash, consumedFiles] of consumedAssetsByHash) { this.finalizeAssetsWithSameSource(consumedFiles, sourceHash, output); } }; private addOutputFileEmitter(outputFileEmitter: FileEmitter) { this.outputFileEmitters.push(outputFileEmitter); } private assignReferenceId(file: ConsumedFile, idBase: string): string { let referenceId = idBase; do { referenceId = createHash().update(referenceId).digest('hex').slice(0, 8); } while ( this.filesByReferenceId.has(referenceId) || this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId)) ); file.referenceId = referenceId; this.filesByReferenceId.set(referenceId, file); for (const { filesByReferenceId } of this.outputFileEmitters) { filesByReferenceId.set(referenceId, file); } return referenceId; } private createPrebuiltChunk(prebuiltChunk: ConsumedPrebuiltChunk): OutputChunk { return { code: prebuiltChunk.code, dynamicImports: [], exports: prebuiltChunk.exports || [], facadeModuleId: null, fileName: prebuiltChunk.fileName, implicitlyLoadedBefore: [], importedBindings: {}, imports: [], isDynamicEntry: false, isEntry: false, isImplicitEntry: false, map: prebuiltChunk.map || null, moduleIds: [], modules: {}, name: prebuiltChunk.fileName, preliminaryFileName: prebuiltChunk.fileName, referencedFiles: [], sourcemapFileName: prebuiltChunk.sourcemapFileName || null, type: 'chunk' }; } private emitAsset(emittedAsset: EmittedFile): string { const source = emittedAsset.source === undefined ? undefined : getValidSource(emittedAsset.source, emittedAsset, null); const consumedAsset: ConsumedAsset = { fileName: emittedAsset.fileName, name: emittedAsset.name, needsCodeReference: !!emittedAsset.needsCodeReference, referenceId: '', source, type: 'asset' }; const referenceId = this.assignReferenceId( consumedAsset, emittedAsset.fileName || emittedAsset.name || String(this.nextIdBase++) ); if (this.output) { this.emitAssetWithReferenceId(consumedAsset, this.output); } else { for (const fileEmitter of this.outputFileEmitters) { fileEmitter.emitAssetWithReferenceId(consumedAsset, fileEmitter.output!); } } return referenceId; } private emitAssetWithReferenceId( consumedAsset: Readonly, output: FileEmitterOutput ) { const { fileName, source } = consumedAsset; if (fileName) { reserveFileNameInBundle(fileName, output, this.options.onLog); } if (source !== undefined) { this.finalizeAdditionalAsset(consumedAsset, source, output); } } private emitChunk(emittedChunk: EmittedFile): string { if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) { return error(logInvalidRollupPhaseForChunkEmission()); } if (typeof emittedChunk.id !== 'string') { return error( logFailedValidation( `Emitted chunks need to have a valid string id, received "${emittedChunk.id}"` ) ); } const consumedChunk: ConsumedChunk = { fileName: emittedChunk.fileName, module: null, name: emittedChunk.name || emittedChunk.id, referenceId: '', type: 'chunk' }; this.graph.moduleLoader .emitChunk(emittedChunk as unknown as EmittedChunk) .then(module => (consumedChunk.module = module)) .catch(() => { // Avoid unhandled Promise rejection as the error will be thrown later // once module loading has finished }); return this.assignReferenceId(consumedChunk, emittedChunk.id); } private emitPrebuiltChunk( emitPrebuiltChunk: Omit & Pick ): string { if (typeof emitPrebuiltChunk.code !== 'string') { return error( logFailedValidation( `Emitted prebuilt chunks need to have a valid string code, received "${emitPrebuiltChunk.code}".` ) ); } if ( typeof emitPrebuiltChunk.fileName !== 'string' || isPathFragment(emitPrebuiltChunk.fileName) ) { return error( logFailedValidation( `The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${emitPrebuiltChunk.fileName}".` ) ); } const consumedPrebuiltChunk: ConsumedPrebuiltChunk = { code: emitPrebuiltChunk.code, exports: emitPrebuiltChunk.exports, fileName: emitPrebuiltChunk.fileName, map: emitPrebuiltChunk.map, referenceId: '', type: 'prebuilt-chunk' }; const referenceId = this.assignReferenceId( consumedPrebuiltChunk, consumedPrebuiltChunk.fileName ); if (this.output) { this.output.bundle[consumedPrebuiltChunk.fileName] = this.createPrebuiltChunk(consumedPrebuiltChunk); } return referenceId; } private finalizeAdditionalAsset( consumedFile: Readonly, source: string | Uint8Array, { bundle, fileNamesBySource, outputOptions }: FileEmitterOutput ): void { let { fileName, needsCodeReference, referenceId } = consumedFile; // Deduplicate assets if an explicit fileName is not provided if (!fileName) { const sourceHash = getSourceHash(source); fileName = fileNamesBySource.get(sourceHash); if (!fileName) { fileName = generateAssetFileName( consumedFile.name, source, sourceHash, outputOptions, bundle ); fileNamesBySource.set(sourceHash, fileName); } } // We must not modify the original assets to avoid interaction between outputs const assetWithFileName = { ...consumedFile, fileName, source }; this.filesByReferenceId.set(referenceId, assetWithFileName); const existingAsset = bundle[fileName]; if (existingAsset?.type === 'asset') { existingAsset.needsCodeReference &&= needsCodeReference; } else { bundle[fileName] = { fileName, name: consumedFile.name, needsCodeReference, source, type: 'asset' }; } } private finalizeAssetsWithSameSource( consumedFiles: ReadonlyArray, sourceHash: string, { bundle, fileNamesBySource, outputOptions }: FileEmitterOutput ): void { let fileName = ''; let usedConsumedFile: ConsumedAsset; let needsCodeReference = true; for (const consumedFile of consumedFiles) { needsCodeReference &&= consumedFile.needsCodeReference; const assetFileName = generateAssetFileName( consumedFile.name, consumedFile.source!, sourceHash, outputOptions, bundle ); if ( !fileName || assetFileName.length < fileName.length || (assetFileName.length === fileName.length && assetFileName < fileName) ) { fileName = assetFileName; usedConsumedFile = consumedFile; } } fileNamesBySource.set(sourceHash, fileName); for (const consumedFile of consumedFiles) { // We must not modify the original assets to avoid interaction between outputs const assetWithFileName = { ...consumedFile, fileName }; this.filesByReferenceId.set(consumedFile.referenceId, assetWithFileName); } bundle[fileName] = { fileName, name: usedConsumedFile!.name, needsCodeReference, source: usedConsumedFile!.source!, type: 'asset' }; } } rollup-3.29.4/src/utils/PluginCache.ts000066400000000000000000000035211450520414700176120ustar00rootroot00000000000000import type { PluginCache, SerializablePluginCache } from '../rollup/types'; import { error, logAnonymousPluginCache, logDuplicatePluginName } from './logs'; import { ANONYMOUS_OUTPUT_PLUGIN_PREFIX, ANONYMOUS_PLUGIN_PREFIX } from './pluginUtils'; export function createPluginCache(cache: SerializablePluginCache): PluginCache { return { delete(id: string) { return delete cache[id]; }, get(id: string) { const item = cache[id]; if (!item) return; item[0] = 0; return item[1]; }, has(id: string) { const item = cache[id]; if (!item) return false; item[0] = 0; return true; }, set(id: string, value: any) { cache[id] = [0, value]; } }; } export function getTrackedPluginCache(pluginCache: PluginCache, onUse: () => void): PluginCache { return { delete(id: string) { onUse(); return pluginCache.delete(id); }, get(id: string) { onUse(); return pluginCache.get(id); }, has(id: string) { onUse(); return pluginCache.has(id); }, set(id: string, value: any) { onUse(); return pluginCache.set(id, value); } }; } export const NO_CACHE: PluginCache = { delete() { return false; }, get() { return undefined as any; }, has() { return false; }, set() {} }; function uncacheablePluginError(pluginName: string): never { if ( pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) || pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) ) { return error(logAnonymousPluginCache()); } return error(logDuplicatePluginName(pluginName)); } export function getCacheForUncacheablePlugin(pluginName: string): PluginCache { return { delete() { return uncacheablePluginError(pluginName); }, get() { return uncacheablePluginError(pluginName); }, has() { return uncacheablePluginError(pluginName); }, set() { return uncacheablePluginError(pluginName); } }; } rollup-3.29.4/src/utils/PluginContext.ts000066400000000000000000000070631450520414700202400ustar00rootroot00000000000000import { version as rollupVersion } from 'package.json'; import type Graph from '../Graph'; import type { NormalizedInputOptions, Plugin, PluginCache, PluginContext, SerializablePluginCache } from '../rollup/types'; import type { FileEmitter } from './FileEmitter'; import { createPluginCache, getCacheForUncacheablePlugin, NO_CACHE } from './PluginCache'; import { BLANK, EMPTY_OBJECT } from './blank'; import { BuildPhase } from './buildPhase'; import { getLogHandler } from './logHandler'; import { LOGLEVEL_DEBUG, LOGLEVEL_INFO, LOGLEVEL_WARN } from './logging'; import { error, logInvalidRollupPhaseForAddWatchFile, logPluginError, warnDeprecation } from './logs'; import { normalizeLog } from './options/options'; import { ANONYMOUS_OUTPUT_PLUGIN_PREFIX, ANONYMOUS_PLUGIN_PREFIX } from './pluginUtils'; import { URL_THIS_GETMODULEIDS } from './urls'; export function getPluginContext( plugin: Plugin, pluginCache: Record | void, graph: Graph, options: NormalizedInputOptions, fileEmitter: FileEmitter, existingPluginNames: Set ): PluginContext { const { logLevel, onLog } = options; let cacheable = true; if (typeof plugin.cacheKey !== 'string') { if ( plugin.name.startsWith(ANONYMOUS_PLUGIN_PREFIX) || plugin.name.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) || existingPluginNames.has(plugin.name) ) { cacheable = false; } else { existingPluginNames.add(plugin.name); } } let cacheInstance: PluginCache; if (!pluginCache) { cacheInstance = NO_CACHE; } else if (cacheable) { const cacheKey = plugin.cacheKey || plugin.name; cacheInstance = createPluginCache( pluginCache[cacheKey] || (pluginCache[cacheKey] = Object.create(null)) ); } else { cacheInstance = getCacheForUncacheablePlugin(plugin.name); } return { addWatchFile(id) { if (graph.phase >= BuildPhase.GENERATE) { return this.error(logInvalidRollupPhaseForAddWatchFile()); } graph.watchFiles[id] = true; }, cache: cacheInstance, debug: getLogHandler(LOGLEVEL_DEBUG, 'PLUGIN_LOG', onLog, plugin.name, logLevel), emitFile: fileEmitter.emitFile.bind(fileEmitter), error(error_): never { return error(logPluginError(normalizeLog(error_), plugin.name)); }, getFileName: fileEmitter.getFileName, getModuleIds: () => graph.modulesById.keys(), getModuleInfo: graph.getModuleInfo, getWatchFiles: () => Object.keys(graph.watchFiles), info: getLogHandler(LOGLEVEL_INFO, 'PLUGIN_LOG', onLog, plugin.name, logLevel), load(resolvedId) { return graph.moduleLoader.preloadModule(resolvedId); }, meta: { rollupVersion, watchMode: graph.watchMode }, get moduleIds() { function* wrappedModuleIds() { // We are wrapping this in a generator to only show the message once we are actually iterating warnDeprecation( `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`, URL_THIS_GETMODULEIDS, true, options, plugin.name ); yield* moduleIds; } const moduleIds = graph.modulesById.keys(); return wrappedModuleIds(); }, parse: graph.contextParse.bind(graph), resolve(source, importer, { assertions, custom, isEntry, skipSelf } = BLANK) { return graph.moduleLoader.resolveId( source, importer, custom, isEntry, assertions || EMPTY_OBJECT, skipSelf ? [{ importer, plugin, source }] : null ); }, setAssetSource: fileEmitter.setAssetSource, warn: getLogHandler(LOGLEVEL_WARN, 'PLUGIN_WARNING', onLog, plugin.name, logLevel) }; } rollup-3.29.4/src/utils/PluginDriver.ts000066400000000000000000000354561450520414700200560ustar00rootroot00000000000000import type Chunk from '../Chunk'; import type Graph from '../Graph'; import type Module from '../Module'; import type { AddonHookFunction, AddonHooks, AsyncPluginHooks, EmitFile, FirstPluginHooks, FunctionPluginHooks, InputPluginHooks, NormalizedInputOptions, NormalizedOutputOptions, ParallelPluginHooks, Plugin, PluginContext, SequentialPluginHooks, SerializablePluginCache, SyncPluginHooks } from '../rollup/types'; import { FileEmitter } from './FileEmitter'; import { getPluginContext } from './PluginContext'; import { getOrCreate } from './getOrCreate'; import { LOGLEVEL_WARN } from './logging'; import { error, logInputHookInOutputPlugin, logInvalidAddonPluginHook, logInvalidFunctionPluginHook, logPluginError } from './logs'; import type { OutputBundleWithPlaceholders } from './outputBundle'; /** * Coerce a promise union to always be a promise. * @example EnsurePromise> -> Promise */ type EnsurePromise = Promise>; /** * Get the type of the first argument in a function. * @example Arg0<(a: string, b: number) => void> -> string */ type Argument0 = Parameters[0]; // This will make sure no input hook is omitted const inputHookNames: { [P in InputPluginHooks]: 1; } = { buildEnd: 1, buildStart: 1, closeBundle: 1, closeWatcher: 1, load: 1, moduleParsed: 1, onLog: 1, options: 1, resolveDynamicImport: 1, resolveId: 1, shouldTransformCachedModule: 1, transform: 1, watchChange: 1 }; const inputHooks = Object.keys(inputHookNames); export type ReplaceContext = (context: PluginContext, plugin: Plugin) => PluginContext; export type HookAction = [plugin: string, hook: string, args: unknown[]]; export class PluginDriver { public readonly emitFile: EmitFile; public finaliseAssets: () => void; public getFileName: (fileReferenceId: string) => string; public readonly setChunkInformation: (facadeChunkByModule: ReadonlyMap) => void; public readonly setOutputBundle: ( bundle: OutputBundleWithPlaceholders, outputOptions: NormalizedOutputOptions ) => void; private readonly fileEmitter: FileEmitter; private readonly pluginContexts: ReadonlyMap; private readonly plugins: readonly Plugin[]; private readonly sortedPlugins = new Map(); private readonly unfulfilledActions = new Set(); constructor( private readonly graph: Graph, private readonly options: NormalizedInputOptions, userPlugins: readonly Plugin[], private readonly pluginCache: Record | undefined, basePluginDriver?: PluginDriver ) { this.fileEmitter = new FileEmitter( graph, options, basePluginDriver && basePluginDriver.fileEmitter ); this.emitFile = this.fileEmitter.emitFile.bind(this.fileEmitter); this.getFileName = this.fileEmitter.getFileName.bind(this.fileEmitter); this.finaliseAssets = this.fileEmitter.finaliseAssets.bind(this.fileEmitter); this.setChunkInformation = this.fileEmitter.setChunkInformation.bind(this.fileEmitter); this.setOutputBundle = this.fileEmitter.setOutputBundle.bind(this.fileEmitter); this.plugins = [...(basePluginDriver ? basePluginDriver.plugins : []), ...userPlugins]; const existingPluginNames = new Set(); this.pluginContexts = new Map( this.plugins.map(plugin => [ plugin, getPluginContext(plugin, pluginCache, graph, options, this.fileEmitter, existingPluginNames) ]) ); if (basePluginDriver) { for (const plugin of userPlugins) { for (const hook of inputHooks) { if (hook in plugin) { options.onLog(LOGLEVEL_WARN, logInputHookInOutputPlugin(plugin.name, hook)); } } } } } public createOutputPluginDriver(plugins: readonly Plugin[]): PluginDriver { return new PluginDriver(this.graph, this.options, plugins, this.pluginCache, this); } getUnfulfilledHookActions(): Set { return this.unfulfilledActions; } // chains, first non-null result stops and returns hookFirst( hookName: H, parameters: Parameters, replaceContext?: ReplaceContext | null, skipped?: ReadonlySet | null ): Promise | null> { return this.hookFirstAndGetPlugin(hookName, parameters, replaceContext, skipped).then( result => result && result[0] ); } // chains, first non-null result stops and returns result and last plugin async hookFirstAndGetPlugin( hookName: H, parameters: Parameters, replaceContext?: ReplaceContext | null, skipped?: ReadonlySet | null ): Promise<[NonNullable>, Plugin] | null> { for (const plugin of this.getSortedPlugins(hookName)) { if (skipped?.has(plugin)) continue; const result = await this.runHook(hookName, parameters, plugin, replaceContext); if (result != null) return [result, plugin]; } return null; } // chains synchronously, first non-null result stops and returns hookFirstSync( hookName: H, parameters: Parameters, replaceContext?: ReplaceContext ): ReturnType | null { for (const plugin of this.getSortedPlugins(hookName)) { const result = this.runHookSync(hookName, parameters, plugin, replaceContext); if (result != null) return result; } return null; } // parallel, ignores returns async hookParallel( hookName: H, parameters: Parameters, replaceContext?: ReplaceContext ): Promise { const parallelPromises: Promise[] = []; for (const plugin of this.getSortedPlugins(hookName)) { if ((plugin[hookName] as { sequential?: boolean }).sequential) { await Promise.all(parallelPromises); parallelPromises.length = 0; await this.runHook(hookName, parameters, plugin, replaceContext); } else { parallelPromises.push(this.runHook(hookName, parameters, plugin, replaceContext)); } } await Promise.all(parallelPromises); } // chains, reduces returned value, handling the reduced value as the first hook argument hookReduceArg0( hookName: H, [argument0, ...rest]: Parameters, reduce: ( reduction: Argument0, result: ReturnType, plugin: Plugin ) => Argument0, replaceContext?: ReplaceContext ): Promise> { let promise = Promise.resolve(argument0); for (const plugin of this.getSortedPlugins(hookName)) { promise = promise.then(argument0 => this.runHook( hookName, [argument0, ...rest] as Parameters, plugin, replaceContext ).then(result => reduce.call(this.pluginContexts.get(plugin), argument0, result, plugin)) ); } return promise; } // chains synchronously, reduces returned value, handling the reduced value as the first hook argument hookReduceArg0Sync( hookName: H, [argument0, ...rest]: Parameters, reduce: ( reduction: Argument0, result: ReturnType, plugin: Plugin ) => Argument0, replaceContext?: ReplaceContext ): Argument0 { for (const plugin of this.getSortedPlugins(hookName)) { const parameters = [argument0, ...rest] as Parameters; const result = this.runHookSync(hookName, parameters, plugin, replaceContext); argument0 = reduce.call(this.pluginContexts.get(plugin), argument0, result, plugin); } return argument0; } // chains, reduces returned value to type string, handling the reduced value separately. permits hooks as values. async hookReduceValue( hookName: H, initialValue: string | Promise, parameters: Parameters, reducer: (result: string, next: string) => string ): Promise { const results: string[] = []; const parallelResults: (string | Promise)[] = []; for (const plugin of this.getSortedPlugins(hookName, validateAddonPluginHandler)) { if ((plugin[hookName] as { sequential?: boolean }).sequential) { results.push(...(await Promise.all(parallelResults))); parallelResults.length = 0; results.push(await this.runHook(hookName, parameters, plugin)); } else { parallelResults.push(this.runHook(hookName, parameters, plugin)); } } results.push(...(await Promise.all(parallelResults))); return results.reduce(reducer, await initialValue); } // chains synchronously, reduces returned value to type T, handling the reduced value separately. permits hooks as values. hookReduceValueSync( hookName: H, initialValue: T, parameters: Parameters, reduce: (reduction: T, result: ReturnType, plugin: Plugin) => T, replaceContext?: ReplaceContext ): T { let accumulator = initialValue; for (const plugin of this.getSortedPlugins(hookName)) { const result = this.runHookSync(hookName, parameters, plugin, replaceContext); accumulator = reduce.call(this.pluginContexts.get(plugin), accumulator, result, plugin); } return accumulator; } // chains, ignores returns hookSeq( hookName: H, parameters: Parameters, replaceContext?: ReplaceContext ): Promise { let promise: Promise = Promise.resolve(); for (const plugin of this.getSortedPlugins(hookName)) { promise = promise.then(() => this.runHook(hookName, parameters, plugin, replaceContext)); } return promise.then(noReturn); } private getSortedPlugins( hookName: keyof FunctionPluginHooks | AddonHooks, validateHandler?: (handler: unknown, hookName: string, plugin: Plugin) => void ): Plugin[] { return getOrCreate(this.sortedPlugins, hookName, () => getSortedValidatedPlugins(hookName, this.plugins, validateHandler) ); } /** * Run an async plugin hook and return the result. * @param hookName Name of the plugin hook. Must be either in `PluginHooks` * or `OutputPluginValueHooks`. * @param args Arguments passed to the plugin hook. * @param plugin The actual pluginObject to run. * @param replaceContext When passed, the plugin context can be overridden. */ private runHook( hookName: H, parameters: Parameters, plugin: Plugin ): EnsurePromise>; private runHook( hookName: H, parameters: Parameters, plugin: Plugin, replaceContext?: ReplaceContext | null ): Promise>; // Implementation signature private runHook( hookName: H, parameters: unknown[], plugin: Plugin, replaceContext?: ReplaceContext | null ): Promise { // We always filter for plugins that support the hook before running it const hook = plugin[hookName]; const handler = typeof hook === 'object' ? hook.handler : hook; let context = this.pluginContexts.get(plugin)!; if (replaceContext) { context = replaceContext(context, plugin); } let action: [string, string, Parameters] | null = null; return Promise.resolve() .then(() => { if (typeof handler !== 'function') { return handler; } // eslint-disable-next-line @typescript-eslint/ban-types const hookResult = (handler as Function).apply(context, parameters); if (!hookResult?.then) { // short circuit for non-thenables and non-Promises return hookResult; } // Track pending hook actions to properly error out when // unfulfilled promises cause rollup to abruptly and confusingly // exit with a successful 0 return code but without producing any // output, errors or warnings. action = [plugin.name, hookName, parameters]; this.unfulfilledActions.add(action); // Although it would be more elegant to just return hookResult here // and put the .then() handler just above the .catch() handler below, // doing so would subtly change the defacto async event dispatch order // which at least one test and some plugins in the wild may depend on. return Promise.resolve(hookResult).then(result => { // action was fulfilled this.unfulfilledActions.delete(action!); return result; }); }) .catch(error_ => { if (action !== null) { // action considered to be fulfilled since error being handled this.unfulfilledActions.delete(action); } return error(logPluginError(error_, plugin.name, { hook: hookName })); }); } /** * Run a sync plugin hook and return the result. * @param hookName Name of the plugin hook. Must be in `PluginHooks`. * @param args Arguments passed to the plugin hook. * @param plugin The acutal plugin * @param replaceContext When passed, the plugin context can be overridden. */ private runHookSync( hookName: H, parameters: Parameters, plugin: Plugin, replaceContext?: ReplaceContext ): ReturnType { const hook = plugin[hookName]!; const handler = typeof hook === 'object' ? hook.handler : hook; let context = this.pluginContexts.get(plugin)!; if (replaceContext) { context = replaceContext(context, plugin); } try { // eslint-disable-next-line @typescript-eslint/ban-types return (handler as Function).apply(context, parameters); } catch (error_: any) { return error(logPluginError(error_, plugin.name, { hook: hookName })); } } } export function getSortedValidatedPlugins( hookName: keyof FunctionPluginHooks | AddonHooks, plugins: readonly Plugin[], validateHandler = validateFunctionPluginHandler ): Plugin[] { const pre: Plugin[] = []; const normal: Plugin[] = []; const post: Plugin[] = []; for (const plugin of plugins) { const hook = plugin[hookName]; if (hook) { if (typeof hook === 'object') { validateHandler(hook.handler, hookName, plugin); if (hook.order === 'pre') { pre.push(plugin); continue; } if (hook.order === 'post') { post.push(plugin); continue; } } else { validateHandler(hook, hookName, plugin); } normal.push(plugin); } } return [...pre, ...normal, ...post]; } function validateFunctionPluginHandler(handler: unknown, hookName: string, plugin: Plugin) { if (typeof handler !== 'function') { error(logInvalidFunctionPluginHook(hookName, plugin.name)); } } function validateAddonPluginHandler(handler: unknown, hookName: string, plugin: Plugin) { if (typeof handler !== 'string' && typeof handler !== 'function') { return error(logInvalidAddonPluginHook(hookName, plugin.name)); } } function noReturn() {} rollup-3.29.4/src/utils/Queue.ts000066400000000000000000000014771450520414700165240ustar00rootroot00000000000000interface Task { (): Promise; } interface QueueItem { reject: (reason?: unknown) => void; resolve: (value: any) => void; task: Task; } export default class Queue { private readonly queue: QueueItem[] = []; private workerCount = 0; constructor(private maxParallel: number) {} run(task: Task): Promise { return new Promise((resolve, reject) => { this.queue.push({ reject, resolve, task }); this.work(); }); } private async work(): Promise { if (this.workerCount >= this.maxParallel) return; this.workerCount++; let entry: QueueItem | undefined; while ((entry = this.queue.shift())) { const { reject, resolve, task } = entry; try { const result = await task(); resolve(result); } catch (error) { reject(error); } } this.workerCount--; } } rollup-3.29.4/src/utils/RESERVED_NAMES.ts000066400000000000000000000011261450520414700175710ustar00rootroot00000000000000const RESERVED_NAMES: ReadonlySet = new Set([ 'await', 'break', 'case', 'catch', 'class', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'enum', 'eval', 'export', 'extends', 'false', 'finally', 'for', 'function', 'if', 'implements', 'import', 'in', 'instanceof', 'interface', 'let', 'NaN', 'new', 'null', 'package', 'private', 'protected', 'public', 'return', 'static', 'super', 'switch', 'this', 'throw', 'true', 'try', 'typeof', 'undefined', 'var', 'void', 'while', 'with', 'yield' ]); export default RESERVED_NAMES; rollup-3.29.4/src/utils/addons.ts000066400000000000000000000025571450520414700167100ustar00rootroot00000000000000import type { NormalizedOutputOptions, RenderedChunk } from '../rollup/types'; import type { PluginDriver } from './PluginDriver'; import { error, logAddonNotGenerated } from './logs'; export interface Addons { banner: string; footer: string; intro: string; outro: string; } const concatSeparator = (out: string, next: string) => (next ? `${out}\n${next}` : out); const concatDblSeparator = (out: string, next: string) => (next ? `${out}\n\n${next}` : out); export async function createAddons( options: NormalizedOutputOptions, outputPluginDriver: PluginDriver, chunk: RenderedChunk ): Promise { try { let [banner, footer, intro, outro] = await Promise.all([ outputPluginDriver.hookReduceValue('banner', options.banner(chunk), [chunk], concatSeparator), outputPluginDriver.hookReduceValue('footer', options.footer(chunk), [chunk], concatSeparator), outputPluginDriver.hookReduceValue( 'intro', options.intro(chunk), [chunk], concatDblSeparator ), outputPluginDriver.hookReduceValue('outro', options.outro(chunk), [chunk], concatDblSeparator) ]); if (intro) intro += '\n\n'; if (outro) outro = `\n\n${outro}`; if (banner) banner += '\n'; if (footer) footer = '\n' + footer; return { banner, footer, intro, outro }; } catch (error_: any) { return error(logAddonNotGenerated(error_.message, error_.hook, error_.plugin)); } } rollup-3.29.4/src/utils/asyncFlatten.ts000066400000000000000000000003011450520414700200540ustar00rootroot00000000000000export async function asyncFlatten(array: T[]): Promise { do { array = (await Promise.all(array)).flat(Infinity) as any; } while (array.some((v: any) => v?.then)); return array; } rollup-3.29.4/src/utils/base64.ts000066400000000000000000000005201450520414700165100ustar00rootroot00000000000000const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$'; const base = 64; export function toBase64(value: number): string { let outString = ''; do { const currentDigit = value % base; value = (value / base) | 0; outString = chars[currentDigit] + outString; } while (value !== 0); return outString; } rollup-3.29.4/src/utils/blank.ts000066400000000000000000000004761450520414700165250ustar00rootroot00000000000000export const BLANK: Record = Object.freeze(Object.create(null)); export const EMPTY_OBJECT = Object.freeze({}); export const EMPTY_ARRAY = Object.freeze([]); export const EMPTY_SET = Object.freeze( new (class extends Set { add(): never { throw new Error('Cannot add to empty set'); } })() ); rollup-3.29.4/src/utils/buildPhase.ts000066400000000000000000000001041450520414700175020ustar00rootroot00000000000000export enum BuildPhase { LOAD_AND_PARSE = 0, ANALYSE, GENERATE } rollup-3.29.4/src/utils/chunkAssignment.ts000066400000000000000000000733011450520414700205740ustar00rootroot00000000000000import ExternalModule from '../ExternalModule'; import Module from '../Module'; import type { LogHandler } from '../rollup/types'; import { getNewSet, getOrCreate } from './getOrCreate'; import { concatLazy } from './iterators'; import { logOptimizeChunkStatus } from './logs'; import { timeEnd, timeStart } from './timers'; type ChunkDefinitions = { alias: string | null; modules: Module[] }[]; interface ModulesWithDependentEntries { dependentEntries: Set; modules: Module[]; } /** * At its core, the algorithm first starts from each static or dynamic entry * point and then assigns that entry point to all modules than can be reached * via static imports. We call this the *dependent entry points* of that * module. * * Then we group all modules with the same dependent entry points into chunks * as those modules will always be loaded together. * * One non-trivial optimization we can apply is that dynamic entries are * different from static entries in so far as when a dynamic import occurs, * some * modules are already in memory. If some of these modules are also * dependencies * of the dynamic entry, then it does not make sense to create a separate chunk * for them. Instead, the dynamic import target can load them from the * importing * chunk. * * With regard to chunking, if B is implicitly loaded after A, then this can be * handled the same way as if there was a dynamic import A => B. * * Example: * Assume A -> B (A imports B), A => C (A dynamically imports C) and C -> B. * Then the initial algorithm would assign A into the A chunk, C into the C * chunk and B into the AC chunk, i.e. the chunk with the dependent entry * points * A and C. * However we know that C can only be loaded from A, so A and its dependency B * must already be in memory when C is loaded. So it is enough to create only * two chunks A containing [AB] and C containing [C]. * * So we do not assign the dynamic entry C as dependent entry point to modules * that are already loaded. * * In a more complex example, let us assume that we have entry points X and Y. * Further, let us assume * X -> A, X -> B, X -> C, * Y -> A, Y -> B, * A => D, * D -> B, D -> C * So without dynamic import optimization, the dependent entry points are * A: XY, B: DXY, C: DX, D: D, X: X, Y: Y, * so we would for now create six chunks. * * Now D is loaded only after A is loaded. But A is loaded if either X is * loaded * or Y is loaded. So the modules that are already in memory when D is loaded * are the intersection of all modules that X depends on with all modules that * Y * depends on, which in this case are the modules A and B. * We could also say they are all modules that have both X and Y as dependent * entry points. * * So we can remove D as dependent entry point from A and B, which means they * both now have only XY as dependent entry points and can be merged into the * same chunk. * * Now let us extend this to the most general case where we have several * dynamic * importers for one dynamic entry point. * * In the most general form, it works like this: * For each dynamic entry point, we have a number of dynamic importers, which * are the modules importing it. Using the previous ideas, we can determine * the modules already in memory for each dynamic importer by looking for all * modules that have all the dependent entry points of the dynamic importer as * dependent entry points. * So the modules that are guaranteed to be in memory when the dynamic entry * point is loaded are the intersection of the modules already in memory for * each dynamic importer. * * Assuming that A => D and B => D and A has dependent entry points XY and B * has * dependent entry points YZ, then the modules guaranteed to be in memory are * all modules that have at least XYZ as dependent entry points. * We call XYZ the *dynamically dependent entry points* of D. * * Now there is one last case to consider: If one of the dynamically dependent * entries is itself a dynamic entry, then any module is in memory that either * is a dependency of that dynamic entry or again has the dynamic dependent * entries of that dynamic entry as dependent entry points. * * A naive algorithm for this proved to be costly as it contained an O(n^3) * complexity with regard to dynamic entries that blew up for very large * projects. * * If we have an efficient way to do Set operations, an alternative approach * would be to instead collect already loaded modules per dynamic entry. And as * all chunks from the initial grouping would behave the same, we can instead * collect already loaded chunks for a performance improvement. * * To do that efficiently, need * - a Map of dynamic imports per dynamic entry, which contains all dynamic * imports that can be triggered by a dynamic entry * - a Map of static dependencies per entry * - a Map of already loaded chunks per entry that we initially populate with * empty Sets for static entries and Sets containing all entries for dynamic * entries * * For efficient operations, we assign each entry a numerical index and * represent Sets of Chunks as BigInt values where each chunk corresponds to a * bit index. Then thw last two maps can be represented as arrays of BigInt * values. * * Then we iterate through each dynamic entry. We set the already loaded modules * to the intersection of the previously already loaded modules with the union * of the already loaded modules of that chunk with its static dependencies. * * If the already loaded modules changed, then we use the Map of dynamic imports * per dynamic entry to marks all dynamic entry dependencies as "dirty" and put * them back into the iteration. As an additional optimization, we note for * each dynamic entry which dynamic dependent entries have changed and only * intersect those entries again on subsequent interations. * * Then we remove the dynamic entries from the list of dependent entries for * those chunks that are already loaded for that dynamic entry and create * another round of chunks. */ export function getChunkAssignments( entries: ReadonlyArray, manualChunkAliasByEntry: ReadonlyMap, minChunkSize: number, log: LogHandler ): ChunkDefinitions { const { chunkDefinitions, modulesInManualChunks } = getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry); const { allEntries, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry } = analyzeModuleGraph(entries); // Each chunk is identified by its position in this array const initialChunks = getChunksFromDependentEntries( getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks) ); // This mutates initialChunks but also clears // dynamicallyDependentEntriesByDynamicEntry as side effect removeUnnecessaryDependentEntries( initialChunks, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, allEntries ); chunkDefinitions.push( ...getOptimizedChunks( getChunksFromDependentEntries(initialChunks), allEntries.length, minChunkSize, log ).map(({ modules }) => ({ alias: null, modules })) ); return chunkDefinitions; } function getChunkDefinitionsFromManualChunks( manualChunkAliasByEntry: ReadonlyMap ): { chunkDefinitions: ChunkDefinitions; modulesInManualChunks: Set } { const chunkDefinitions: ChunkDefinitions = []; const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys()); const manualChunkModulesByAlias: Record = Object.create(null); for (const [entry, alias] of manualChunkAliasByEntry) { addStaticDependenciesToManualChunk( entry, (manualChunkModulesByAlias[alias] ||= []), modulesInManualChunks ); } for (const [alias, modules] of Object.entries(manualChunkModulesByAlias)) { chunkDefinitions.push({ alias, modules }); } return { chunkDefinitions, modulesInManualChunks }; } function addStaticDependenciesToManualChunk( entry: Module, manualChunkModules: Module[], modulesInManualChunks: Set ): void { const modulesToHandle = new Set([entry]); for (const module of modulesToHandle) { modulesInManualChunks.add(module); manualChunkModules.push(module); for (const dependency of module.dependencies) { if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) { modulesToHandle.add(dependency); } } } } function analyzeModuleGraph(entries: Iterable): { allEntries: ReadonlyArray; dependentEntriesByModule: Map>; dynamicImportsByEntry: ReadonlyArray>; dynamicallyDependentEntriesByDynamicEntry: Map>; } { const dynamicEntryModules = new Set(); const dependentEntriesByModule: Map> = new Map(); const dynamicImportModulesByEntry: Set[] = []; const allEntriesSet = new Set(entries); let entryIndex = 0; for (const currentEntry of allEntriesSet) { const dynamicImportsForCurrentEntry = new Set(); dynamicImportModulesByEntry.push(dynamicImportsForCurrentEntry); const modulesToHandle = new Set([currentEntry]); for (const module of modulesToHandle) { getOrCreate(dependentEntriesByModule, module, getNewSet).add(entryIndex); for (const dependency of module.getDependenciesToBeIncluded()) { if (!(dependency instanceof ExternalModule)) { modulesToHandle.add(dependency); } } for (const { resolution } of module.dynamicImports) { if ( resolution instanceof Module && resolution.includedDynamicImporters.length > 0 && !allEntriesSet.has(resolution) ) { dynamicEntryModules.add(resolution); allEntriesSet.add(resolution); dynamicImportsForCurrentEntry.add(resolution); } } for (const dependency of module.implicitlyLoadedBefore) { if (!allEntriesSet.has(dependency)) { dynamicEntryModules.add(dependency); allEntriesSet.add(dependency); } } } entryIndex++; } const allEntries = [...allEntriesSet]; const { dynamicEntries, dynamicImportsByEntry } = getDynamicEntries( allEntries, dynamicEntryModules, dynamicImportModulesByEntry ); return { allEntries, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry( dependentEntriesByModule, dynamicEntries, allEntries ), dynamicImportsByEntry }; } function getDynamicEntries( allEntries: Module[], dynamicEntryModules: Set, dynamicImportModulesByEntry: Set[] ) { const entryIndexByModule = new Map(); const dynamicEntries = new Set(); for (const [entryIndex, entry] of allEntries.entries()) { entryIndexByModule.set(entry, entryIndex); if (dynamicEntryModules.has(entry)) { dynamicEntries.add(entryIndex); } } const dynamicImportsByEntry: Set[] = []; for (const dynamicImportModules of dynamicImportModulesByEntry) { const dynamicImports = new Set(); for (const dynamicEntry of dynamicImportModules) { dynamicImports.add(entryIndexByModule.get(dynamicEntry)!); } dynamicImportsByEntry.push(dynamicImports); } return { dynamicEntries, dynamicImportsByEntry }; } function getDynamicallyDependentEntriesByDynamicEntry( dependentEntriesByModule: ReadonlyMap>, dynamicEntries: ReadonlySet, allEntries: ReadonlyArray ): Map> { const dynamicallyDependentEntriesByDynamicEntry: Map> = new Map(); for (const dynamicEntryIndex of dynamicEntries) { const dynamicallyDependentEntries = getOrCreate( dynamicallyDependentEntriesByDynamicEntry, dynamicEntryIndex, getNewSet ); const dynamicEntry = allEntries[dynamicEntryIndex]; for (const importer of concatLazy([ dynamicEntry.includedDynamicImporters, dynamicEntry.implicitlyLoadedAfter ])) { for (const entry of dependentEntriesByModule.get(importer)!) { dynamicallyDependentEntries.add(entry); } } } return dynamicallyDependentEntriesByDynamicEntry; } function getChunksFromDependentEntries( modulesWithDependentEntries: Iterable ): ModulesWithDependentEntries[] { const chunkModules: { [signature: string]: ModulesWithDependentEntries; } = Object.create(null); for (const { dependentEntries, modules } of modulesWithDependentEntries) { let chunkSignature = 0n; for (const entryIndex of dependentEntries) { chunkSignature |= 1n << BigInt(entryIndex); } (chunkModules[String(chunkSignature)] ||= { dependentEntries: new Set(dependentEntries), modules: [] }).modules.push(...modules); } return Object.values(chunkModules); } function* getModulesWithDependentEntries( dependentEntriesByModule: Map>, modulesInManualChunks: Set ) { for (const [module, dependentEntries] of dependentEntriesByModule) { if (!modulesInManualChunks.has(module)) { yield { dependentEntries, modules: [module] }; } } } /** * This removes all unnecessary dynamic entries from the dependenEntries in its * first argument. It will also consume its second argument, so if * dynamicallyDependentEntriesByDynamicEntry is ever needed after this, we * should make a copy. */ function removeUnnecessaryDependentEntries( chunks: ModulesWithDependentEntries[], dynamicallyDependentEntriesByDynamicEntry: Map>, dynamicImportsByEntry: ReadonlyArray>, allEntries: ReadonlyArray ) { // The indices correspond to the indices in allEntries. The chunks correspond // to bits in the bigint values where chunk 0 is the lowest bit. const staticDependenciesPerEntry: bigint[] = allEntries.map(() => 0n); const alreadyLoadedChunksPerEntry: bigint[] = allEntries.map((_entry, entryIndex) => dynamicallyDependentEntriesByDynamicEntry.has(entryIndex) ? -1n : 0n ); // This toggles the bits for each chunk that is a dependency of an entry let chunkMask = 1n; for (const { dependentEntries } of chunks) { for (const entryIndex of dependentEntries) { staticDependenciesPerEntry[entryIndex] |= chunkMask; } chunkMask <<= 1n; } // Warning: This will consume dynamicallyDependentEntriesByDynamicEntry. // If we no longer want this, we should make a copy here. const updatedDynamicallyDependentEntriesByDynamicEntry = dynamicallyDependentEntriesByDynamicEntry; for (const [ dynamicEntryIndex, updatedDynamicallyDependentEntries ] of updatedDynamicallyDependentEntriesByDynamicEntry) { updatedDynamicallyDependentEntriesByDynamicEntry.delete(dynamicEntryIndex); const previousLoadedModules = alreadyLoadedChunksPerEntry[dynamicEntryIndex]; let newLoadedModules = previousLoadedModules; for (const entryIndex of updatedDynamicallyDependentEntries) { newLoadedModules &= staticDependenciesPerEntry[entryIndex] | alreadyLoadedChunksPerEntry[entryIndex]; } if (newLoadedModules !== previousLoadedModules) { alreadyLoadedChunksPerEntry[dynamicEntryIndex] = newLoadedModules; for (const dynamicImport of dynamicImportsByEntry[dynamicEntryIndex]) { getOrCreate( updatedDynamicallyDependentEntriesByDynamicEntry, dynamicImport, getNewSet ).add(dynamicEntryIndex); } } } // Remove entries from dependent entries if a chunk is already loaded without // that entry. chunkMask = 1n; for (const { dependentEntries } of chunks) { for (const entryIndex of dependentEntries) { if ((alreadyLoadedChunksPerEntry[entryIndex] & chunkMask) === chunkMask) { dependentEntries.delete(entryIndex); } } chunkMask <<= 1n; } } interface ChunkDescription { /** * These are the atoms (=initial chunks) that are contained in this chunk */ containedAtoms: bigint; /** * The signatures of all atoms that are included in or loaded with this * chunk. This is the intersection of all dependent entry modules. As chunks * are merged, these sets are intersected. */ correlatedAtoms: bigint; dependencies: Set; dependentChunks: Set; /** * The indices of the entries depending on this chunk */ dependentEntries: Set; modules: Module[]; pure: boolean; size: number; } interface ChunkPartition { big: Set; sideEffectAtoms: bigint; sizeByAtom: number[]; small: Set; } /** * This function tries to get rid of small chunks by merging them with other * chunks. * * We can only merge chunks safely if after the merge, loading any entry point * in any allowed order will not trigger side effects that should not have been * triggered. While side effects are usually things like global function calls, * global variable mutations or potentially thrown errors, details do not * matter here, and we just discern chunks without side effects (pure chunks) * from other chunks. * * As a first step, we assign each pre-generated chunk with side effects a * label. I.e. we have side effect "A" if the non-pure chunk "A" is loaded. * * Now to determine the side effects of loading a chunk, one also has to take * the side effects of its dependencies into account. So if A depends on B * (A -> B) and both have side effects, loading A triggers effects AB. * * Now from the previous step we know that each chunk is uniquely determine by * the entry points that depend on it and cause it to load, which we will call * its dependent entry points. * * E.g. if X -> A and Y -> A, then the dependent entry points of A are XY. * Starting from that idea, we can determine a set of chunks—and thus a set * of side effects—that must have been triggered if a certain chunk has been * loaded. Basically, it is the intersection of all chunks loaded by the * dependent entry points of a given chunk. We call the corresponding side * effects the correlated side effects of that chunk. * * Example: * X -> ABC, Y -> ADE, A-> F, B -> D * Then taking dependencies into account, X -> ABCDF, Y -> ADEF * The intersection is ADF. So we know that when A is loaded, D and F must also * be in memory even though neither D nor A is a dependency of the other. * If all have side effects, we call ADF the correlated side effects of A. The * correlated side effects need to remain constant when merging chunks. * * In contrast, we have the dependency side effects of A, which represents * the side effects we trigger if we directly load A. In this example, the * dependency side effects are AF. * For entry chunks, dependency and correlated side effects are the same. * * With these concepts, merging chunks is allowed if the correlated side * effects of each entry do not change. Thus, we are allowed to merge two * chunks if * * a) the dependency side effects of each chunk are a subset of the correlated * side effects of the other chunk, so no additional side effects are * triggered for any entry, or * b) The dependent entry points of chunk A are a subset of the dependent entry * points of chunk B while the dependency side effects of A are a subset of * the correlated side effects of B. Because in that scenario, whenever A is * loaded, B is loaded as well. But there are cases when B is loaded where A * is not loaded. So if we merge the chunks, all dependency side effects of * A will be added to the correlated side effects of B, and as the latter is * not allowed to change, the former need to be a subset of the latter. * * Another consideration when merging small chunks into other chunks is to * avoid * that too much additional code is loaded. This is achieved when the dependent * entries of the small chunk are a subset of the dependent entries of the * other * chunk. Because then when the small chunk is loaded, the other chunk was * loaded/in memory anyway, so at most when the other chunk is loaded, the * additional size of the small chunk is loaded unnecessarily. * * So the algorithm performs merges in two passes: * * 1. First we try to merge small chunks A only into other chunks B if the * dependent entries of A are a subset of the dependent entries of B and the * dependency side effects of A are a subset of the correlated side effects * of B. * 2. Only then for all remaining small chunks, we look for arbitrary merges * following the rule (a), starting with the smallest chunks to look for * possible merge targets. */ function getOptimizedChunks( initialChunks: ModulesWithDependentEntries[], numberOfEntries: number, minChunkSize: number, log: LogHandler ): { modules: Module[] }[] { timeStart('optimize chunks', 3); const chunkPartition = getPartitionedChunks(initialChunks, numberOfEntries, minChunkSize); if (!chunkPartition) { timeEnd('optimize chunks', 3); return initialChunks; // the actual modules } minChunkSize > 1 && log( 'info', logOptimizeChunkStatus(initialChunks.length, chunkPartition.small.size, 'Initially') ); mergeChunks(chunkPartition, minChunkSize); minChunkSize > 1 && log( 'info', logOptimizeChunkStatus( chunkPartition.small.size + chunkPartition.big.size, chunkPartition.small.size, 'After merging chunks' ) ); timeEnd('optimize chunks', 3); return [...chunkPartition.small, ...chunkPartition.big]; } function getPartitionedChunks( initialChunks: ModulesWithDependentEntries[], numberOfEntries: number, minChunkSize: number ): ChunkPartition | null { const smallChunks: ChunkDescription[] = []; const bigChunks: ChunkDescription[] = []; const chunkByModule = new Map(); const sizeByAtom: number[] = []; let sideEffectAtoms = 0n; let containedAtoms = 1n; for (const { dependentEntries, modules } of initialChunks) { const chunkDescription: ChunkDescription = { containedAtoms, correlatedAtoms: 0n, dependencies: new Set(), dependentChunks: new Set(), dependentEntries, modules, pure: true, size: 0 }; let size = 0; let pure = true; for (const module of modules) { chunkByModule.set(module, chunkDescription); // Unfortunately, we cannot take tree-shaking into account here because // rendering did not happen yet, but we can detect empty modules if (module.isIncluded()) { pure &&= !module.hasEffects(); // we use a trivial size for the default minChunkSize to improve // performance size += minChunkSize > 1 ? module.estimateSize() : 1; } } chunkDescription.pure = pure; chunkDescription.size = size; sizeByAtom.push(size); if (!pure) { sideEffectAtoms |= containedAtoms; } (size < minChunkSize ? smallChunks : bigChunks).push(chunkDescription); containedAtoms <<= 1n; } // If there are no small chunks, we will not optimize if (smallChunks.length === 0) { return null; } sideEffectAtoms |= addChunkDependenciesAndAtomsAndGetSideEffectAtoms( [bigChunks, smallChunks], chunkByModule, numberOfEntries, containedAtoms ); return { big: new Set(bigChunks), sideEffectAtoms, sizeByAtom, small: new Set(smallChunks) }; } function mergeChunks(chunkPartition: ChunkPartition, minChunkSize: number) { const { small } = chunkPartition; for (const mergedChunk of small) { const bestTargetChunk = findBestMergeTarget( mergedChunk, chunkPartition, // In the default case, we do not accept size increases minChunkSize <= 1 ? 1 : Infinity ); if (bestTargetChunk) { const { containedAtoms, correlatedAtoms, modules, pure, size } = mergedChunk; small.delete(mergedChunk); getChunksInPartition(bestTargetChunk, minChunkSize, chunkPartition).delete(bestTargetChunk); bestTargetChunk.modules.push(...modules); bestTargetChunk.size += size; bestTargetChunk.pure &&= pure; const { dependencies, dependentChunks, dependentEntries } = bestTargetChunk; bestTargetChunk.correlatedAtoms &= correlatedAtoms; bestTargetChunk.containedAtoms |= containedAtoms; for (const entry of mergedChunk.dependentEntries) { dependentEntries.add(entry); } for (const dependency of mergedChunk.dependencies) { dependencies.add(dependency); dependency.dependentChunks.delete(mergedChunk); dependency.dependentChunks.add(bestTargetChunk); } for (const dependentChunk of mergedChunk.dependentChunks) { dependentChunks.add(dependentChunk); dependentChunk.dependencies.delete(mergedChunk); dependentChunk.dependencies.add(bestTargetChunk); } dependencies.delete(bestTargetChunk); dependentChunks.delete(bestTargetChunk); getChunksInPartition(bestTargetChunk, minChunkSize, chunkPartition).add(bestTargetChunk); } } } function addChunkDependenciesAndAtomsAndGetSideEffectAtoms( chunkLists: ChunkDescription[][], chunkByModule: Map, numberOfEntries: number, nextAtomSignature: bigint ): bigint { const signatureByExternalModule = new Map(); let sideEffectAtoms = 0n; const atomsByEntry: bigint[] = []; for (let index = 0; index < numberOfEntries; index++) { atomsByEntry.push(0n); } for (const chunks of chunkLists) { chunks.sort(compareChunkSize); for (const chunk of chunks) { const { dependencies, dependentEntries, modules } = chunk; for (const module of modules) { for (const dependency of module.getDependenciesToBeIncluded()) { if (dependency instanceof ExternalModule) { if (dependency.info.moduleSideEffects) { chunk.containedAtoms |= getOrCreate(signatureByExternalModule, dependency, () => { const signature = nextAtomSignature; nextAtomSignature <<= 1n; sideEffectAtoms |= signature; return signature; }); } } else { const dependencyChunk = chunkByModule.get(dependency); if (dependencyChunk && dependencyChunk !== chunk) { dependencies.add(dependencyChunk); dependencyChunk.dependentChunks.add(chunk); } } } } const { containedAtoms } = chunk; for (const entryIndex of dependentEntries) { atomsByEntry[entryIndex] |= containedAtoms; } } } for (const chunks of chunkLists) { for (const chunk of chunks) { const { dependentEntries } = chunk; // Correlated atoms are the intersection of all entry atoms chunk.correlatedAtoms = -1n; for (const entryIndex of dependentEntries) { chunk.correlatedAtoms &= atomsByEntry[entryIndex]; } } } return sideEffectAtoms; } function findBestMergeTarget( mergedChunk: ChunkDescription, { big, sideEffectAtoms, sizeByAtom, small }: ChunkPartition, smallestAdditionalSize: number ): ChunkDescription | null { let bestTargetChunk: ChunkDescription | null = null; // In the default case, we do not accept size increases for (const targetChunk of concatLazy([small, big])) { if (mergedChunk === targetChunk) continue; const additionalSizeAfterMerge = getAdditionalSizeAfterMerge( mergedChunk, targetChunk, smallestAdditionalSize, sideEffectAtoms, sizeByAtom ); if (additionalSizeAfterMerge < smallestAdditionalSize) { bestTargetChunk = targetChunk; if (additionalSizeAfterMerge === 0) break; smallestAdditionalSize = additionalSizeAfterMerge; } } return bestTargetChunk; } function getChunksInPartition( chunk: ChunkDescription, minChunkSize: number, chunkPartition: ChunkPartition ): Set { return chunk.size < minChunkSize ? chunkPartition.small : chunkPartition.big; } function compareChunkSize( { size: sizeA }: ChunkDescription, { size: sizeB }: ChunkDescription ): number { return sizeA - sizeB; } /** * Determine the additional unused code size that would be added by merging the * two chunks. This is not an exact measurement but rather an upper bound. If * the merge produces cycles or adds non-correlated side effects, `Infinity` * is returned. * Merging will not produce cycles if none of the direct non-merged * dependencies of a chunk have the other chunk as a transitive dependency. */ function getAdditionalSizeAfterMerge( mergedChunk: ChunkDescription, targetChunk: ChunkDescription, // The maximum additional unused code size allowed to be added by the merge, // taking dependencies into account, needs to be below this number currentAdditionalSize: number, sideEffectAtoms: bigint, sizeByAtom: number[] ): number { const firstSize = getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect( mergedChunk, targetChunk, currentAdditionalSize, sideEffectAtoms, sizeByAtom ); return firstSize < currentAdditionalSize ? firstSize + getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect( targetChunk, mergedChunk, currentAdditionalSize - firstSize, sideEffectAtoms, sizeByAtom ) : Infinity; } function getAdditionalSizeIfNoTransitiveDependencyOrNonCorrelatedSideEffect( dependentChunk: ChunkDescription, dependencyChunk: ChunkDescription, currentAdditionalSize: number, sideEffectAtoms: bigint, sizeByAtom: number[] ): number { const { correlatedAtoms } = dependencyChunk; let dependencyAtoms = dependentChunk.containedAtoms; const dependentContainedSideEffects = dependencyAtoms & sideEffectAtoms; if ((correlatedAtoms & dependentContainedSideEffects) !== dependentContainedSideEffects) { return Infinity; } const chunksToCheck = new Set(dependentChunk.dependencies); for (const { dependencies, containedAtoms } of chunksToCheck) { dependencyAtoms |= containedAtoms; const containedSideEffects = containedAtoms & sideEffectAtoms; if ((correlatedAtoms & containedSideEffects) !== containedSideEffects) { return Infinity; } for (const dependency of dependencies) { if (dependency === dependencyChunk) { return Infinity; } chunksToCheck.add(dependency); } } return getAtomsSizeIfBelowLimit( dependencyAtoms & ~correlatedAtoms, currentAdditionalSize, sizeByAtom ); } function getAtomsSizeIfBelowLimit( atoms: bigint, currentAdditionalSize: number, sizeByAtom: number[] ): number { let size = 0; let atomIndex = 0; let atomSignature = 1n; const { length } = sizeByAtom; for (; atomIndex < length; atomIndex++) { if ((atoms & atomSignature) === atomSignature) { size += sizeByAtom[atomIndex]; } atomSignature <<= 1n; if (size >= currentAdditionalSize) { return Infinity; } } return size; } rollup-3.29.4/src/utils/collapseSourcemaps.ts000066400000000000000000000153131450520414700212760ustar00rootroot00000000000000import { type DecodedSourceMap, SourceMap } from 'magic-string'; import type Module from '../Module'; import type { DecodedSourceMapOrMissing, ExistingDecodedSourceMap, LogHandler, SourceMapSegment } from '../rollup/types'; import { decodedSourcemap, resetSourcemapCache } from './decodedSourcemap'; import { LOGLEVEL_WARN } from './logging'; import { error, logConflictingSourcemapSources, logSourcemapBroken } from './logs'; import { basename, dirname, relative, resolve } from './path'; class Source { readonly content: string | null; readonly filename: string; isOriginal = true; constructor(filename: string, content: string | null) { this.filename = filename; this.content = content; } traceSegment(line: number, column: number, name: string): SourceMapSegmentObject { return { column, line, name, source: this }; } } interface SourceMapSegmentObject { column: number; line: number; name: string; source: Source; } class Link { readonly mappings: readonly SourceMapSegment[][]; readonly names: readonly string[]; readonly sources: (Source | Link)[]; constructor( map: { mappings: readonly SourceMapSegment[][]; names: readonly string[] }, sources: (Source | Link)[] ) { this.sources = sources; this.names = map.names; this.mappings = map.mappings; } traceMappings() { const sources: string[] = []; const sourceIndexMap = new Map(); const sourcesContent: (string | null)[] = []; const names: string[] = []; const nameIndexMap = new Map(); const mappings = []; for (const line of this.mappings) { const tracedLine: SourceMapSegment[] = []; for (const segment of line) { if (segment.length === 1) continue; const source = this.sources[segment[1]]; if (!source) continue; const traced = source.traceSegment( segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : '' ); if (traced) { const { column, line, name, source: { content, filename } } = traced; let sourceIndex = sourceIndexMap.get(filename); if (sourceIndex === undefined) { sourceIndex = sources.length; sources.push(filename); sourceIndexMap.set(filename, sourceIndex); sourcesContent[sourceIndex] = content; } else if (sourcesContent[sourceIndex] == null) { sourcesContent[sourceIndex] = content; } else if (content != null && sourcesContent[sourceIndex] !== content) { return error(logConflictingSourcemapSources(filename)); } const tracedSegment: SourceMapSegment = [segment[0], sourceIndex, line, column]; if (name) { let nameIndex = nameIndexMap.get(name); if (nameIndex === undefined) { nameIndex = names.length; names.push(name); nameIndexMap.set(name, nameIndex); } (tracedSegment as SourceMapSegment)[4] = nameIndex; } tracedLine.push(tracedSegment); } } mappings.push(tracedLine); } return { mappings, names, sources, sourcesContent }; } traceSegment(line: number, column: number, name: string): SourceMapSegmentObject | null { const segments = this.mappings[line]; if (!segments) return null; // binary search through segments for the given column let searchStart = 0; let searchEnd = segments.length - 1; while (searchStart <= searchEnd) { const m = (searchStart + searchEnd) >> 1; const segment = segments[m]; // If a sourcemap does not have sufficient resolution to contain a // necessary mapping, e.g. because it only contains line information, we // use the best approximation we could find if (segment[0] === column || searchStart === searchEnd) { if (segment.length == 1) return null; const source = this.sources[segment[1]]; if (!source) return null; return source.traceSegment( segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name ); } if (segment[0] > column) { searchEnd = m - 1; } else { searchStart = m + 1; } } return null; } } function getLinkMap(log: LogHandler) { return function linkMap(source: Source | Link, map: DecodedSourceMapOrMissing): Link { if (!map.missing) { return new Link(map, [source]); } log(LOGLEVEL_WARN, logSourcemapBroken(map.plugin)); return new Link( { mappings: [], names: [] }, [source] ); }; } function getCollapsedSourcemap( id: string, originalCode: string, originalSourcemap: ExistingDecodedSourceMap | null, sourcemapChain: readonly DecodedSourceMapOrMissing[], linkMap: (source: Source | Link, map: DecodedSourceMapOrMissing) => Link ): Source | Link { let source: Source | Link; if (originalSourcemap) { const sources = originalSourcemap.sources; const sourcesContent = originalSourcemap.sourcesContent || []; const directory = dirname(id) || '.'; const sourceRoot = originalSourcemap.sourceRoot || '.'; const baseSources = sources.map( (source, index) => new Source(resolve(directory, sourceRoot, source), sourcesContent[index]) ); source = new Link(originalSourcemap, baseSources); } else { source = new Source(id, originalCode); } return sourcemapChain.reduce(linkMap, source); } export function collapseSourcemaps( file: string, map: DecodedSourceMap, modules: readonly Module[], bundleSourcemapChain: readonly DecodedSourceMapOrMissing[], excludeContent: boolean | undefined, log: LogHandler ): SourceMap { const linkMap = getLinkMap(log); const moduleSources = modules .filter(module => !module.excludeFromSourcemap) .map(module => getCollapsedSourcemap( module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap ) ); const link = new Link(map, moduleSources); const source = bundleSourcemapChain.reduce(linkMap, link); let { sources, sourcesContent, names, mappings } = source.traceMappings(); if (file) { const directory = dirname(file); sources = sources.map((source: string) => relative(directory, source)); file = basename(file); } sourcesContent = (excludeContent ? null : sourcesContent) as string[]; for (const module of modules) { resetSourcemapCache(module.originalSourcemap, module.sourcemapChain); } return new SourceMap({ file, mappings, names, sources, sourcesContent }); } export function collapseSourcemap( id: string, originalCode: string, originalSourcemap: ExistingDecodedSourceMap | null, sourcemapChain: readonly DecodedSourceMapOrMissing[], log: LogHandler ): ExistingDecodedSourceMap | null { if (sourcemapChain.length === 0) { return originalSourcemap; } const source = getCollapsedSourcemap( id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(log) ) as Link; const map = source.traceMappings(); return decodedSourcemap({ version: 3, ...map }); } rollup-3.29.4/src/utils/colors.ts000066400000000000000000000004471450520414700167350ustar00rootroot00000000000000import { env } from 'node:process'; import { createColors } from 'colorette'; // @see https://no-color.org // @see https://www.npmjs.com/package/chalk export const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({ useColor: env.FORCE_COLOR !== '0' && !env.NO_COLOR }); rollup-3.29.4/src/utils/commentAnnotations.ts000066400000000000000000000135701450520414700213150ustar00rootroot00000000000000import type * as acorn from 'acorn'; import { base as basicWalker } from 'acorn-walk'; import { ArrowFunctionExpression, BinaryExpression, CallExpression, ChainExpression, ConditionalExpression, ExportDefaultDeclaration, ExportNamedDeclaration, ExpressionStatement, FunctionDeclaration, LogicalExpression, NewExpression, SequenceExpression, VariableDeclaration, VariableDeclarator } from '../ast/nodes/NodeType'; import { SOURCEMAPPING_URL_RE } from './sourceMappingURL'; export type AnnotationType = 'noSideEffects' | 'pure'; export interface RollupAnnotation extends acorn.Comment { annotationType: AnnotationType; } interface CommentState { annotationIndex: number; annotations: RollupAnnotation[]; code: string; } export const ANNOTATION_KEY = '_rollupAnnotations'; export const INVALID_COMMENT_KEY = '_rollupRemoved'; interface NodeWithComments extends acorn.Node { [ANNOTATION_KEY]?: acorn.Comment[]; [INVALID_COMMENT_KEY]?: acorn.Comment[]; } function handlePureAnnotationsOfNode( node: acorn.Node, state: CommentState, type = node.type ): void { const { annotations, code } = state; // eslint-disable-next-line unicorn/consistent-destructuring let comment = annotations[state.annotationIndex]; while (comment && node.start >= comment.end) { markPureNode(node, comment, code); comment = annotations[++state.annotationIndex]; } if (comment && comment.end <= node.end) { basicWalker[type](node, state, handlePureAnnotationsOfNode); // eslint-disable-next-line unicorn/consistent-destructuring while ((comment = annotations[state.annotationIndex]) && comment.end <= node.end) { ++state.annotationIndex; annotateNode(node, comment, false); } } } const neitherWithespaceNorBrackets = /[^\s(]/g; const noWhitespace = /\S/g; function markPureNode(node: NodeWithComments, comment: acorn.Comment, code: string): void { const annotatedNodes: NodeWithComments[] = []; let invalidAnnotation: boolean | undefined; const codeInBetween = code.slice(comment.end, node.start); if (doesNotMatchOutsideComment(codeInBetween, neitherWithespaceNorBrackets)) { const parentStart = node.start; while (true) { annotatedNodes.push(node); switch (node.type) { case ExpressionStatement: case ChainExpression: { node = (node as any).expression; continue; } case SequenceExpression: { // if there are parentheses, the annotation would apply to the entire expression if (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) { node = (node as any).expressions[0]; continue; } invalidAnnotation = true; break; } case ConditionalExpression: { // if there are parentheses, the annotation would apply to the entire expression if (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) { node = (node as any).test; continue; } invalidAnnotation = true; break; } case LogicalExpression: case BinaryExpression: { // if there are parentheses, the annotation would apply to the entire expression if (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) { node = (node as any).left; continue; } invalidAnnotation = true; break; } case ExportNamedDeclaration: case ExportDefaultDeclaration: { node = (node as any).declaration; continue; } case VariableDeclaration: { // case: /*#__PURE__*/ const foo = () => {} const declaration = node as any; if (declaration.kind === 'const') { // jsdoc only applies to the first declaration node = declaration.declarations[0].init; continue; } invalidAnnotation = true; break; } case VariableDeclarator: { node = (node as any).init; continue; } case FunctionDeclaration: case ArrowFunctionExpression: case CallExpression: case NewExpression: { break; } default: { invalidAnnotation = true; } } break; } } else { invalidAnnotation = true; } if (invalidAnnotation) { annotateNode(node, comment, false); } else { for (const node of annotatedNodes) { annotateNode(node, comment, true); } } } function doesNotMatchOutsideComment(code: string, forbiddenChars: RegExp): boolean { let nextMatch: RegExpExecArray | null; while ((nextMatch = forbiddenChars.exec(code)) !== null) { if (nextMatch[0] === '/') { const charCodeAfterSlash = code.charCodeAt(forbiddenChars.lastIndex); if (charCodeAfterSlash === 42 /*"*"*/) { forbiddenChars.lastIndex = code.indexOf('*/', forbiddenChars.lastIndex + 1) + 2; continue; } else if (charCodeAfterSlash === 47 /*"/"*/) { forbiddenChars.lastIndex = code.indexOf('\n', forbiddenChars.lastIndex + 1) + 1; continue; } } forbiddenChars.lastIndex = 0; return false; } return true; } const annotationsRegexes: [AnnotationType, RegExp][] = [ ['pure', /[#@]__PURE__/], ['noSideEffects', /[#@]__NO_SIDE_EFFECTS__/] ]; export function addAnnotations( comments: readonly acorn.Comment[], esTreeAst: acorn.Node, code: string ): void { const annotations: RollupAnnotation[] = []; const sourceMappingComments: acorn.Comment[] = []; for (const comment of comments) { for (const [annotationType, regex] of annotationsRegexes) { if (regex.test(comment.value)) { annotations.push({ ...comment, annotationType }); } } if (SOURCEMAPPING_URL_RE.test(comment.value)) { sourceMappingComments.push(comment); } } for (const comment of sourceMappingComments) { annotateNode(esTreeAst, comment, false); } handlePureAnnotationsOfNode(esTreeAst, { annotationIndex: 0, annotations, code }); } function annotateNode(node: NodeWithComments, comment: acorn.Comment, valid: boolean): void { const key = valid ? ANNOTATION_KEY : INVALID_COMMENT_KEY; const property = node[key]; if (property) { property.push(comment); } else { node[key] = [comment]; } } rollup-3.29.4/src/utils/commondir.ts000066400000000000000000000013701450520414700174170ustar00rootroot00000000000000import { dirname } from './path'; // ported from https://github.com/substack/node-commondir export default function commondir(files: readonly string[]): string { if (files.length === 0) return '/'; if (files.length === 1) return dirname(files[0]); const commonSegments = files.slice(1).reduce( (commonSegments, file) => { const pathSegements = file.split(/\/+|\\+/); let index; for ( index = 0; commonSegments[index] === pathSegements[index] && index < Math.min(commonSegments.length, pathSegements.length); index++ ); return commonSegments.slice(0, index); }, files[0].split(/\/+|\\+/) ); // Windows correctly handles paths with forward-slashes return commonSegments.length > 1 ? commonSegments.join('/') : '/'; } rollup-3.29.4/src/utils/crypto.ts000066400000000000000000000002141450520414700167440ustar00rootroot00000000000000import { createHash as cryptoCreateHash, type Hash } from 'node:crypto'; export const createHash = (): Hash => cryptoCreateHash('sha256'); rollup-3.29.4/src/utils/decodedSourcemap.ts000066400000000000000000000066251450520414700207060ustar00rootroot00000000000000import { decode, encode } from '@jridgewell/sourcemap-codec'; import type { DecodedSourceMapOrMissing, ExistingDecodedSourceMap, ExistingRawSourceMap, SourceMapInput } from '../rollup/types'; // While the types for SourceMapInput are what we expect to recieve from plugins, there are cases // in the wild where plugins return `{mappings: null}`, so we want this function to be a little more // permissive on the input end so that we can normalize the output when creating the decoded sourcemap. interface UnexpectedInput { mappings: null | undefined; } type Input = SourceMapInput | UnexpectedInput | ExistingDecodedSourceMap | undefined; interface CachedSourcemapData { encodedMappings: string | undefined; decodedMappings: ExistingDecodedSourceMap['mappings'] | undefined; } const sourceMapCache = new WeakMap(); /** * This clears the decoded array and falls back to the encoded string form. * Sourcemap mappings arrays can be very large and holding on to them for longer * than is necessary leads to poor heap utilization. */ function resetCacheToEncoded(cache: CachedSourcemapData) { if (cache.encodedMappings === undefined && cache.decodedMappings) { cache.encodedMappings = encode(cache.decodedMappings); } cache.decodedMappings = undefined; } export function resetSourcemapCache( map: ExistingDecodedSourceMap | null, sourcemapChain?: DecodedSourceMapOrMissing[] ) { if (map) { const cache = sourceMapCache.get(map); if (cache) { resetCacheToEncoded(cache); } } if (!sourcemapChain) { return; } for (const map of sourcemapChain) { if (map.missing) continue; resetSourcemapCache(map); } } export function decodedSourcemap(map: null | undefined): null; export function decodedSourcemap(map: Exclude): ExistingDecodedSourceMap; export function decodedSourcemap(map: Input): ExistingDecodedSourceMap | null; export function decodedSourcemap(map: Input): ExistingDecodedSourceMap | null { if (!map) return null; if (typeof map === 'string') { map = JSON.parse(map) as ExistingRawSourceMap; } if (!map.mappings) { return { mappings: [], names: [], sources: [], version: 3 }; } const originalMappings = map.mappings; const isAlreadyDecoded = Array.isArray(originalMappings); const cache: CachedSourcemapData = { decodedMappings: isAlreadyDecoded ? originalMappings : undefined, encodedMappings: isAlreadyDecoded ? undefined : originalMappings }; const decodedMap = { ...(map as ExistingRawSourceMap | ExistingDecodedSourceMap), // By moving mappings behind an accessor, we can avoid unneeded computation for cases // where the mappings field is never actually accessed. This appears to greatly reduce // the overhead of sourcemap decoding in terms of both compute time and memory usage. get mappings() { if (cache.decodedMappings) { return cache.decodedMappings; } // If decodedMappings doesn't exist then encodedMappings should. // The only scenario where cache.encodedMappings should be undefined is if the map // this was constructed from was already decoded, or if mappings was set to a new // decoded string. In either case, this line shouldn't get hit. cache.decodedMappings = cache.encodedMappings ? decode(cache.encodedMappings) : []; cache.encodedMappings = undefined; return cache.decodedMappings; } }; sourceMapCache.set(decodedMap, cache); return decodedMap; } rollup-3.29.4/src/utils/deconflictChunk.ts000066400000000000000000000173741450520414700205460ustar00rootroot00000000000000import type Chunk from '../Chunk'; import ExternalChunk from '../ExternalChunk'; import ExternalModule from '../ExternalModule'; import type Module from '../Module'; import type ChildScope from '../ast/scopes/ChildScope'; import ExportDefaultVariable from '../ast/variables/ExportDefaultVariable'; import type SyntheticNamedExportVariable from '../ast/variables/SyntheticNamedExportVariable'; import type Variable from '../ast/variables/Variable'; import type { GetInterop, InternalModuleFormat } from '../rollup/types'; import { canDefaultBeTakenFromNamespace, defaultInteropHelpersByInteropType, isDefaultAProperty, namespaceInteropHelpersByInteropType } from './interopHelpers'; import { getSafeName } from './safeName'; export interface DependenciesToBeDeconflicted { deconflictedDefault: ReadonlySet; deconflictedNamespace: ReadonlySet; dependencies: ReadonlySet; } const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT: { [format in InternalModuleFormat]: ( usedNames: Set, imports: ReadonlySet, dependenciesToBeDeconflicted: DependenciesToBeDeconflicted, interop: GetInterop, preserveModules: boolean, externalLiveBindings: boolean, chunkByModule: ReadonlyMap, externalChunkByModule: ReadonlyMap, syntheticExports: ReadonlySet ) => void; } = { amd: deconflictImportsOther, cjs: deconflictImportsOther, es: deconflictImportsEsmOrSystem, iife: deconflictImportsOther, system: deconflictImportsEsmOrSystem, umd: deconflictImportsOther }; export function deconflictChunk( modules: readonly Module[], dependenciesToBeDeconflicted: DependenciesToBeDeconflicted, imports: ReadonlySet, usedNames: Set, format: InternalModuleFormat, interop: GetInterop, preserveModules: boolean, externalLiveBindings: boolean, chunkByModule: ReadonlyMap, externalChunkByModule: ReadonlyMap, syntheticExports: ReadonlySet, exportNamesByVariable: ReadonlyMap, accessedGlobalsByScope: ReadonlyMap>, includedNamespaces: ReadonlySet ): void { const reversedModules = [...modules].reverse(); for (const module of reversedModules) { module.scope.addUsedOutsideNames( usedNames, format, exportNamesByVariable, accessedGlobalsByScope ); } deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces); DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format]( usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports ); for (const module of reversedModules) { module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); } } function deconflictImportsEsmOrSystem( usedNames: Set, imports: ReadonlySet, dependenciesToBeDeconflicted: DependenciesToBeDeconflicted, _interop: GetInterop, preserveModules: boolean, _externalLiveBindings: boolean, chunkByModule: ReadonlyMap, externalChunkByModule: ReadonlyMap, syntheticExports: ReadonlySet ) { // This is needed for namespace reexports for (const dependency of dependenciesToBeDeconflicted.dependencies) { if (preserveModules || dependency instanceof ExternalChunk) { dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames, null); } } for (const variable of imports) { const module = variable.module!; const name = variable.name; if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) { variable.setRenderNames( null, (module instanceof ExternalModule ? externalChunkByModule.get(module)! : chunkByModule.get(module)! ).variableName ); } else if (module instanceof ExternalModule && name === 'default') { variable.setRenderNames( null, getSafeName( [...module.exportedVariables].some( ([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included ) ? module.suggestedVariableName + '__default' : module.suggestedVariableName, usedNames, variable.forbiddenNames ) ); } else { variable.setRenderNames(null, getSafeName(name, usedNames, variable.forbiddenNames)); } } for (const variable of syntheticExports) { variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames)); } } function deconflictImportsOther( usedNames: Set, imports: ReadonlySet, { deconflictedDefault, deconflictedNamespace, dependencies }: DependenciesToBeDeconflicted, interop: GetInterop, preserveModules: boolean, externalLiveBindings: boolean, chunkByModule: ReadonlyMap, externalChunkByModule: ReadonlyMap ): void { for (const chunk of dependencies) { chunk.variableName = getSafeName(chunk.suggestedVariableName, usedNames, null); } for (const chunk of deconflictedNamespace) { chunk.namespaceVariableName = getSafeName( `${chunk.suggestedVariableName}__namespace`, usedNames, null ); } for (const externalModule of deconflictedDefault) { externalModule.defaultVariableName = deconflictedNamespace.has(externalModule) && canDefaultBeTakenFromNamespace(interop(externalModule.id), externalLiveBindings) ? externalModule.namespaceVariableName : getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames, null); } for (const variable of imports) { const module = variable.module; if (module instanceof ExternalModule) { const chunk = externalChunkByModule.get(module)!; const name = variable.name; if (name === 'default') { const moduleInterop = interop(module.id); const variableName = defaultInteropHelpersByInteropType[moduleInterop] ? chunk.defaultVariableName : chunk.variableName; if (isDefaultAProperty(moduleInterop, externalLiveBindings)) { variable.setRenderNames(variableName, 'default'); } else { variable.setRenderNames(null, variableName); } } else if (name === '*') { variable.setRenderNames( null, namespaceInteropHelpersByInteropType[interop(module.id)] ? chunk.namespaceVariableName : chunk.variableName ); } else { // if the second parameter is `null`, it uses its "name" for the property name variable.setRenderNames(chunk.variableName, null); } } else { const chunk = chunkByModule.get(module!)!; if (preserveModules && variable.isNamespace) { variable.setRenderNames( null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName ); } else if (chunk.exportMode === 'default') { variable.setRenderNames(null, chunk.variableName); } else { variable.setRenderNames( chunk.variableName, chunk.getVariableExportName(variable) as string | null ); } } } } function deconflictTopLevelVariables( usedNames: Set, modules: readonly Module[], includedNamespaces: ReadonlySet ): void { for (const module of modules) { for (const variable of module.scope.variables.values()) { if ( variable.included && // this will only happen for exports in some formats !( variable.renderBaseName || (variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable) ) ) { variable.setRenderNames( null, getSafeName(variable.name, usedNames, variable.forbiddenNames) ); } } if (includedNamespaces.has(module)) { const namespace = module.namespace; namespace.setRenderNames( null, getSafeName(namespace.name, usedNames, namespace.forbiddenNames) ); } } } rollup-3.29.4/src/utils/doNothing.ts000066400000000000000000000000431450520414700173550ustar00rootroot00000000000000export const doNothing = () => {}; rollup-3.29.4/src/utils/ensureArray.ts000066400000000000000000000003511450520414700177260ustar00rootroot00000000000000export function ensureArray( items: (T | false | null | undefined)[] | T | false | null | undefined ): T[] { if (Array.isArray(items)) { return items.filter(Boolean) as T[]; } if (items) { return [items]; } return []; } rollup-3.29.4/src/utils/escapeId.ts000066400000000000000000000004611450520414700171450ustar00rootroot00000000000000const needsEscapeRegEx = /[\n\r'\\\u2028\u2029]/; const quoteNewlineRegEx = /([\n\r'\u2028\u2029])/g; const backSlashRegEx = /\\/g; export function escapeId(id: string): string { if (!needsEscapeRegEx.test(id)) return id; return id.replace(backSlashRegEx, '\\\\').replace(quoteNewlineRegEx, '\\$1'); } rollup-3.29.4/src/utils/executionOrder.ts000066400000000000000000000044641450520414700204360ustar00rootroot00000000000000import type ExternalModule from '../ExternalModule'; import Module from '../Module'; interface OrderedExecutionUnit { execIndex: number; } const compareExecIndex = (unitA: T, unitB: T) => unitA.execIndex > unitB.execIndex ? 1 : -1; export function sortByExecutionOrder(units: OrderedExecutionUnit[]): void { units.sort(compareExecIndex); } export function analyseModuleExecution(entryModules: readonly Module[]): { cyclePaths: string[][]; orderedModules: Module[]; } { let nextExecIndex = 0; const cyclePaths: string[][] = []; const analysedModules = new Set(); const dynamicImports = new Set(); const parents = new Map(); const orderedModules: Module[] = []; const analyseModule = (module: Module | ExternalModule) => { if (module instanceof Module) { for (const dependency of module.dependencies) { if (parents.has(dependency)) { if (!analysedModules.has(dependency)) { cyclePaths.push(getCyclePath(dependency as Module, module, parents)); } continue; } parents.set(dependency, module); analyseModule(dependency); } for (const dependency of module.implicitlyLoadedBefore) { dynamicImports.add(dependency); } for (const { resolution } of module.dynamicImports) { if (resolution instanceof Module) { dynamicImports.add(resolution); } } orderedModules.push(module); } module.execIndex = nextExecIndex++; analysedModules.add(module); }; for (const currentEntry of entryModules) { if (!parents.has(currentEntry)) { parents.set(currentEntry, null); analyseModule(currentEntry); } } for (const currentEntry of dynamicImports) { if (!parents.has(currentEntry)) { parents.set(currentEntry, null); analyseModule(currentEntry); } } return { cyclePaths, orderedModules }; } function getCyclePath( module: Module, parent: Module, parents: ReadonlyMap ): string[] { const cycleSymbol = Symbol(module.id); const path = [module.id]; let nextModule = parent; module.cycles.add(cycleSymbol); while (nextModule !== module) { nextModule.cycles.add(cycleSymbol); path.push(nextModule.id); nextModule = parents.get(nextModule)!; } path.push(path[0]); path.reverse(); return path; } rollup-3.29.4/src/utils/exportNames.ts000066400000000000000000000024601450520414700177360ustar00rootroot00000000000000import type Variable from '../ast/variables/Variable'; import RESERVED_NAMES from './RESERVED_NAMES'; import { toBase64 } from './base64'; export function assignExportsToMangledNames( exports: ReadonlySet, exportsByName: Map, exportNamesByVariable: Map ): void { let nameIndex = 0; for (const variable of exports) { let [exportName] = variable.name; if (exportsByName.has(exportName)) { do { exportName = toBase64(++nameIndex); // skip past leading number identifiers if (exportName.charCodeAt(0) === 49 /* '1' */) { nameIndex += 9 * 64 ** (exportName.length - 1); exportName = toBase64(nameIndex); } } while (RESERVED_NAMES.has(exportName) || exportsByName.has(exportName)); } exportsByName.set(exportName, variable); exportNamesByVariable.set(variable, [exportName]); } } export function assignExportsToNames( exports: ReadonlySet, exportsByName: Map, exportNamesByVariable: Map ): void { for (const variable of exports) { let nameIndex = 0; let exportName = variable.name; while (exportsByName.has(exportName)) { exportName = variable.name + '$' + ++nameIndex; } exportsByName.set(exportName, variable); exportNamesByVariable.set(variable, [exportName]); } } rollup-3.29.4/src/utils/fs.ts000066400000000000000000000000421450520414700160330ustar00rootroot00000000000000export * from 'node:fs/promises'; rollup-3.29.4/src/utils/generateCodeSnippets.ts000066400000000000000000000102251450520414700215420ustar00rootroot00000000000000import type { NormalizedOutputOptions } from '../rollup/types'; import RESERVED_NAMES from './RESERVED_NAMES'; export interface GenerateCodeSnippets { _: string; cnst: string; n: string; s: string; getDirectReturnFunction( parameters: string[], options: { functionReturn: boolean; lineBreakIndent: { base: string; t: string } | null; name: string | null; } ): [left: string, right: string]; getDirectReturnIifeLeft( parameters: string[], returned: string, options: { needsArrowReturnParens: boolean | undefined; needsWrappedFunction: boolean | undefined; } ): string; getFunctionIntro( parameters: string[], options: { isAsync: boolean; name: string | null } ): string; getNonArrowFunctionIntro( parameters: string[], options: { isAsync: boolean; name: string | null } ): string; getObject( fields: [key: string | null, value: string][], options: { lineBreakIndent: { base: string; t: string } | null } ): string; getPropertyAccess(name: string): string; } export function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, constBindings, objectShorthand, reservedNamesAsProps } }: NormalizedOutputOptions): GenerateCodeSnippets { const { _, n, s } = compact ? { _: '', n: '', s: '' } : { _: ' ', n: '\n', s: ';' }; const cnst = constBindings ? 'const' : 'var'; const getNonArrowFunctionIntro: GenerateCodeSnippets['getNonArrowFunctionIntro'] = ( parameters, { isAsync, name } ) => `${isAsync ? `async ` : ''}function${name ? ` ${name}` : ''}${_}(${parameters.join( `,${_}` )})${_}`; const getFunctionIntro: GenerateCodeSnippets['getFunctionIntro'] = arrowFunctions ? (parameters, { isAsync, name }) => { const singleParameter = parameters.length === 1; const asyncString = isAsync ? `async${singleParameter ? ' ' : _}` : ''; return `${name ? `${cnst} ${name}${_}=${_}` : ''}${asyncString}${ singleParameter ? parameters[0] : `(${parameters.join(`,${_}`)})` }${_}=>${_}`; } : getNonArrowFunctionIntro; const getDirectReturnFunction: GenerateCodeSnippets['getDirectReturnFunction'] = ( parameters, { functionReturn, lineBreakIndent, name } ) => [ `${getFunctionIntro(parameters, { isAsync: false, name })}${ arrowFunctions ? lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : '' : `{${lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _}${ functionReturn ? 'return ' : '' }` }`, arrowFunctions ? `${name ? ';' : ''}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : ''}` : `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}` ]; const isValidPropertyName = reservedNamesAsProps ? (name: string): boolean => validPropertyName.test(name) : (name: string): boolean => !RESERVED_NAMES.has(name) && validPropertyName.test(name); return { _, cnst, getDirectReturnFunction, getDirectReturnIifeLeft: ( parameters, returned, { needsArrowReturnParens, needsWrappedFunction } ) => { const [left, right] = getDirectReturnFunction(parameters, { functionReturn: true, lineBreakIndent: null, name: null }); return `${wrapIfNeeded( `${left}${wrapIfNeeded(returned, arrowFunctions && needsArrowReturnParens)}${right}`, arrowFunctions || needsWrappedFunction )}(`; }, getFunctionIntro, getNonArrowFunctionIntro, getObject(fields, { lineBreakIndent }) { const prefix = lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _; return `{${fields .map(([key, value]) => { if (key === null) return `${prefix}${value}`; const needsQuotes = !isValidPropertyName(key); return key === value && objectShorthand && !needsQuotes ? prefix + key : `${prefix}${needsQuotes ? `'${key}'` : key}:${_}${value}`; }) .join(`,`)}${ fields.length === 0 ? '' : lineBreakIndent ? `${n}${lineBreakIndent.base}` : _ }}`; }, getPropertyAccess: (name: string): string => isValidPropertyName(name) ? `.${name}` : `[${JSON.stringify(name)}]`, n, s }; } const wrapIfNeeded = (code: string, needsParens: boolean | undefined): string => needsParens ? `(${code})` : code; const validPropertyName = /^(?!\d)[\w$]+$/; rollup-3.29.4/src/utils/getCodeFrame.ts000066400000000000000000000032201450520414700177510ustar00rootroot00000000000000function spaces(index: number): string { let result = ''; while (index--) result += ' '; return result; } function tabsToSpaces(value: string): string { return value.replace(/^\t+/, match => match.split('\t').join(' ')); } const LINE_TRUNCATE_LENGTH = 120; const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10; const ELLIPSIS = '...'; export default function getCodeFrame(source: string, line: number, column: number): string { let lines = source.split('\n'); // Needed if a plugin did not generate correct sourcemaps if (line > lines.length) return ''; const maxLineLength = Math.max( tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + ELLIPSIS.length, LINE_TRUNCATE_LENGTH ); const frameStart = Math.max(0, line - 3); let frameEnd = Math.min(line + 2, lines.length); lines = lines.slice(frameStart, frameEnd); while (!/\S/.test(lines[lines.length - 1])) { lines.pop(); frameEnd -= 1; } const digits = String(frameEnd).length; return lines .map((sourceLine, index) => { const isErrorLine = frameStart + index + 1 === line; let lineNumber = String(index + frameStart + 1); while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`; let displayedLine = tabsToSpaces(sourceLine); if (displayedLine.length > maxLineLength) { displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`; } if (isErrorLine) { const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + '^'; return `${lineNumber}: ${displayedLine}\n${indicator}`; } return `${lineNumber}: ${displayedLine}`; }) .join('\n'); } rollup-3.29.4/src/utils/getExportMode.ts000066400000000000000000000023051450520414700202150ustar00rootroot00000000000000import type Chunk from '../Chunk'; import type { LogHandler, NormalizedOutputOptions } from '../rollup/types'; import { LOGLEVEL_WARN } from './logging'; import { error, logIncompatibleExportOptionValue, logMixedExport } from './logs'; export default function getExportMode( chunk: Chunk, { exports: exportMode, name, format }: NormalizedOutputOptions, facadeModuleId: string, log: LogHandler ): 'default' | 'named' | 'none' { const exportKeys = chunk.getExportNames(); if (exportMode === 'default') { if (exportKeys.length !== 1 || exportKeys[0] !== 'default') { return error(logIncompatibleExportOptionValue('default', exportKeys, facadeModuleId)); } } else if (exportMode === 'none' && exportKeys.length > 0) { return error(logIncompatibleExportOptionValue('none', exportKeys, facadeModuleId)); } if (exportMode === 'auto') { if (exportKeys.length === 0) { exportMode = 'none'; } else if (exportKeys.length === 1 && exportKeys[0] === 'default') { exportMode = 'default'; } else { if (format !== 'es' && format !== 'system' && exportKeys.includes('default')) { log(LOGLEVEL_WARN, logMixedExport(facadeModuleId, name)); } exportMode = 'named'; } } return exportMode; } rollup-3.29.4/src/utils/getId.ts000066400000000000000000000001131450520414700164560ustar00rootroot00000000000000export function getId(m: { id: string | null }): string { return m.id!; } rollup-3.29.4/src/utils/getIndentString.ts000066400000000000000000000020341450520414700205360ustar00rootroot00000000000000import type Module from '../Module'; function guessIndentString(code: string): string | null { const lines = code.split('\n'); const tabbed = lines.filter(line => /^\t+/.test(line)); const spaced = lines.filter(line => /^ {2,}/.test(line)); if (tabbed.length === 0 && spaced.length === 0) { return null; } // More lines tabbed than spaced? Assume tabs, and // default to tabs in the case of a tie (or nothing // to go on) if (tabbed.length >= spaced.length) { return '\t'; } // Otherwise, we need to guess the multiple const min = spaced.reduce((previous, current) => { const numberSpaces = /^ +/.exec(current)![0].length; return Math.min(numberSpaces, previous); }, Infinity); return ' '.repeat(min); } export default function getIndentString( modules: readonly Module[], options: { indent: true | string } ): string { if (options.indent !== true) return options.indent; for (const module of modules) { const indent = guessIndentString(module.originalCode); if (indent !== null) return indent; } return '\t'; } rollup-3.29.4/src/utils/getLogFilter.ts000066400000000000000000000033221450520414700200160ustar00rootroot00000000000000import type { RollupLog } from '../rollup/types'; import type { GetLogFilter } from './getLogFilterType'; export const getLogFilter: GetLogFilter = filters => { if (filters.length === 0) return () => true; const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => { const inverted = subFilter.startsWith('!'); if (inverted) subFilter = subFilter.slice(1); const [key, ...value] = subFilter.split(':'); return { inverted, key: key.split('.'), parts: value.join(':').split('*') }; }) ); return (log: RollupLog): boolean => { nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) { for (const { inverted, key, parts } of intersectedFilters) { const isFilterSatisfied = testFilter(log, key, parts); if (inverted ? isFilterSatisfied : !isFilterSatisfied) { continue nextIntersectedFilter; } } return true; } return false; }; }; const testFilter = (log: RollupLog, key: string[], parts: string[]): boolean => { let rawValue: any = log; for (let index = 0; index < key.length; index++) { if (!rawValue) { return false; } const part = key[index]; if (!(part in rawValue)) { return false; } rawValue = rawValue[part]; } let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue); if (parts.length === 1) { return value === parts[0]; } if (!value.startsWith(parts[0])) { return false; } const lastPartIndex = parts.length - 1; for (let index = 1; index < lastPartIndex; index++) { const part = parts[index]; const position = value.indexOf(part); if (position === -1) { return false; } value = value.slice(position + part.length); } return value.endsWith(parts[lastPartIndex]); }; rollup-3.29.4/src/utils/getLogFilterType.d.ts000066400000000000000000000002621450520414700211020ustar00rootroot00000000000000import type { RollupLog } from '../rollup/types'; export type GetLogFilter = typeof getLogFilter; export function getLogFilter(filters: string[]): (log: RollupLog) => boolean; rollup-3.29.4/src/utils/getOrCreate.ts000066400000000000000000000005221450520414700176320ustar00rootroot00000000000000export function getOrCreate(map: Map, key: K, init: () => V): V { const existing = map.get(key); if (existing !== undefined) { return existing; } const value = init(); map.set(key, value); return value; } export function getNewSet() { return new Set(); } export function getNewArray(): T[] { return []; } rollup-3.29.4/src/utils/getOriginalLocation.ts000066400000000000000000000020771450520414700213720ustar00rootroot00000000000000import type { DecodedSourceMapOrMissing, ExistingDecodedSourceMap } from '../rollup/types'; export function getOriginalLocation( sourcemapChain: readonly DecodedSourceMapOrMissing[], location: { column: number; line: number } ): { column: number; line: number } { const filteredSourcemapChain = sourcemapChain.filter( (sourcemap): sourcemap is ExistingDecodedSourceMap => !sourcemap.missing ); traceSourcemap: while (filteredSourcemapChain.length > 0) { const sourcemap = filteredSourcemapChain.pop()!; const line = sourcemap.mappings[location.line - 1]; if (line) { const filteredLine = line.filter( (segment): segment is [number, number, number, number] => segment.length > 1 ); const lastSegment = filteredLine[filteredLine.length - 1]; for (const segment of filteredLine) { if (segment[0] >= location.column || segment === lastSegment) { location = { column: segment[3], line: segment[2] + 1 }; continue traceSourcemap; } } } throw new Error("Can't resolve original location of error."); } return location; } rollup-3.29.4/src/utils/getStaticDependencies.ts000066400000000000000000000037741450520414700217000ustar00rootroot00000000000000import type Chunk from '../Chunk'; import type ExternalChunk from '../ExternalChunk'; import ExternalModule from '../ExternalModule'; import type Module from '../Module'; export function getStaticDependencies( chunk: Chunk, orderedModules: readonly Module[], chunkByModule: ReadonlyMap, externalChunkByModule: ReadonlyMap ): Set { const staticDependencyBlocks: (Chunk | ExternalChunk)[][] = []; const handledDependencies = new Set(); for (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) { const module = orderedModules[modulePos]; if (!handledDependencies.has(module)) { const staticDependencies: (Chunk | ExternalChunk)[] = []; addStaticDependencies( module, staticDependencies, handledDependencies, chunk, chunkByModule, externalChunkByModule ); staticDependencyBlocks.unshift(staticDependencies); } } const dependencies = new Set(); for (const block of staticDependencyBlocks) { for (const dependency of block) { dependencies.add(dependency); } } return dependencies; } function addStaticDependencies( module: Module, staticDependencies: (Chunk | ExternalChunk)[], handledModules: Set, chunk: Chunk, chunkByModule: ReadonlyMap, externalChunkByModule: ReadonlyMap ): void { const dependencies = module.getDependenciesToBeIncluded(); for (const dependency of dependencies) { if (dependency instanceof ExternalModule) { staticDependencies.push(externalChunkByModule.get(dependency)!); continue; } const dependencyChunk = chunkByModule.get(dependency)!; if (dependencyChunk !== chunk) { staticDependencies.push(dependencyChunk); continue; } if (!handledModules.has(dependency)) { handledModules.add(dependency); addStaticDependencies( dependency, staticDependencies, handledModules, chunk, chunkByModule, externalChunkByModule ); } } } rollup-3.29.4/src/utils/hashPlaceholders.ts000066400000000000000000000047411450520414700207060ustar00rootroot00000000000000import { toBase64 } from './base64'; import { error, logFailedValidation } from './logs'; // Four random characters from the private use area to minimize risk of // conflicts const hashPlaceholderLeft = '!~{'; const hashPlaceholderRight = '}~'; const hashPlaceholderOverhead = hashPlaceholderLeft.length + hashPlaceholderRight.length; // This is the size of a sha256 export const maxHashSize = 64; export const defaultHashSize = 8; export type HashPlaceholderGenerator = (optionName: string, hashSize?: number) => string; export const getHashPlaceholderGenerator = (): HashPlaceholderGenerator => { let nextIndex = 0; return (optionName: string, hashSize: number = defaultHashSize) => { if (hashSize > maxHashSize) { return error( logFailedValidation( `Hashes cannot be longer than ${maxHashSize} characters, received ${hashSize}. Check the "${optionName}" option.` ) ); } const placeholder = `${hashPlaceholderLeft}${toBase64(++nextIndex).padStart( hashSize - hashPlaceholderOverhead, '0' )}${hashPlaceholderRight}`; if (placeholder.length > hashSize) { return error( logFailedValidation( `To generate hashes for this number of chunks (currently ${nextIndex}), you need a minimum hash size of ${placeholder.length}, received ${hashSize}. Check the "${optionName}" option.` ) ); } return placeholder; }; }; const REPLACER_REGEX = new RegExp( `${hashPlaceholderLeft}[0-9a-zA-Z_$]{1,${ maxHashSize - hashPlaceholderOverhead }}${hashPlaceholderRight}`, 'g' ); export const replacePlaceholders = ( code: string, hashesByPlaceholder: Map ): string => code.replace(REPLACER_REGEX, placeholder => hashesByPlaceholder.get(placeholder) || placeholder); export const replaceSinglePlaceholder = ( code: string, placeholder: string, value: string ): string => code.replace(REPLACER_REGEX, match => (match === placeholder ? value : match)); export const replacePlaceholdersWithDefaultAndGetContainedPlaceholders = ( code: string, placeholders: Set ): { containedPlaceholders: Set; transformedCode: string } => { const containedPlaceholders = new Set(); const transformedCode = code.replace(REPLACER_REGEX, placeholder => { if (placeholders.has(placeholder)) { containedPlaceholders.add(placeholder); return `${hashPlaceholderLeft}${'0'.repeat( placeholder.length - hashPlaceholderOverhead )}${hashPlaceholderRight}`; } return placeholder; }); return { containedPlaceholders, transformedCode }; }; rollup-3.29.4/src/utils/hookActions.ts000066400000000000000000000036431450520414700177160ustar00rootroot00000000000000import process from 'node:process'; import type { HookAction, PluginDriver } from './PluginDriver'; function formatAction([pluginName, hookName, parameters]: HookAction): string { const action = `(${pluginName}) ${hookName}`; const s = JSON.stringify; switch (hookName) { case 'resolveId': { return `${action} ${s(parameters[0])} ${s(parameters[1])}`; } case 'load': { return `${action} ${s(parameters[0])}`; } case 'transform': { return `${action} ${s(parameters[1])}`; } case 'shouldTransformCachedModule': { return `${action} ${s((parameters[0] as { id: string }).id)}`; } case 'moduleParsed': { return `${action} ${s((parameters[0] as { id: string }).id)}`; } } return action; } let handleBeforeExit: null | (() => void) = null; const rejectByPluginDriver = new Map void>(); export async function catchUnfinishedHookActions( pluginDriver: PluginDriver, callback: () => Promise ): Promise { const emptyEventLoopPromise = new Promise((_, reject) => { rejectByPluginDriver.set(pluginDriver, reject); if (!handleBeforeExit) { // We only ever create a single event listener to avoid max listener and // other issues handleBeforeExit = () => { for (const [pluginDriver, reject] of rejectByPluginDriver) { const unfulfilledActions = pluginDriver.getUnfulfilledHookActions(); reject( new Error( `Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:\n` + [...unfulfilledActions].map(formatAction).join('\n') ) ); } }; process.once('beforeExit', handleBeforeExit); } }); try { return await Promise.race([callback(), emptyEventLoopPromise]); } finally { rejectByPluginDriver.delete(pluginDriver); if (rejectByPluginDriver.size === 0) { process.off('beforeExit', handleBeforeExit!); handleBeforeExit = null; } } } rollup-3.29.4/src/utils/identifierHelpers.ts000066400000000000000000000012121450520414700210700ustar00rootroot00000000000000import RESERVED_NAMES from './RESERVED_NAMES'; const illegalCharacters = /[^\w$]/g; const startsWithDigit = (value: string): boolean => /\d/.test(value[0]); const needsEscape = (value: string) => startsWithDigit(value) || RESERVED_NAMES.has(value) || value === 'arguments'; export function isLegal(value: string): boolean { if (needsEscape(value)) { return false; } return !illegalCharacters.test(value); } export function makeLegal(value: string): string { value = value .replace(/-(\w)/g, (_, letter) => letter.toUpperCase()) .replace(illegalCharacters, '_'); if (needsEscape(value)) value = `_${value}`; return value || '_'; } rollup-3.29.4/src/utils/interopHelpers.ts000066400000000000000000000262441450520414700204420ustar00rootroot00000000000000import type { InteropType } from '../rollup/types'; import type { GenerateCodeSnippets } from './generateCodeSnippets'; const INTEROP_DEFAULT_VARIABLE = '_interopDefault'; const INTEROP_DEFAULT_COMPAT_VARIABLE = '_interopDefaultCompat'; const INTEROP_NAMESPACE_VARIABLE = '_interopNamespace'; const INTEROP_NAMESPACE_COMPAT_VARIABLE = '_interopNamespaceCompat'; const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault'; export const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly'; export const MERGE_NAMESPACES_VARIABLE = '_mergeNamespaces'; export const DOCUMENT_CURRENT_SCRIPT = '_documentCurrentScript'; export const defaultInteropHelpersByInteropType: { [T in InteropType]: string | null } = { auto: INTEROP_DEFAULT_VARIABLE, compat: INTEROP_DEFAULT_COMPAT_VARIABLE, default: null, defaultOnly: null, esModule: null }; export const isDefaultAProperty = ( interopType: InteropType, externalLiveBindings: boolean ): boolean => interopType === 'esModule' || (externalLiveBindings && (interopType === 'auto' || interopType === 'compat')); export const namespaceInteropHelpersByInteropType: { [T in InteropType]: string | null } = { auto: INTEROP_NAMESPACE_VARIABLE, compat: INTEROP_NAMESPACE_COMPAT_VARIABLE, default: INTEROP_NAMESPACE_DEFAULT_VARIABLE, defaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, esModule: null }; export const canDefaultBeTakenFromNamespace = ( interopType: InteropType, externalLiveBindings: boolean ): boolean => interopType !== 'esModule' && isDefaultAProperty(interopType, externalLiveBindings); export const getHelpersBlock = ( additionalHelpers: ReadonlySet | null, accessedGlobals: ReadonlySet, indent: string, snippets: GenerateCodeSnippets, liveBindings: boolean, freeze: boolean, namespaceToStringTag: boolean ): string => { const usedHelpers = new Set(additionalHelpers); for (const variable of HELPER_NAMES) { if (accessedGlobals.has(variable)) { usedHelpers.add(variable); } } return HELPER_NAMES.map(variable => usedHelpers.has(variable) ? HELPER_GENERATORS[variable]( indent, snippets, liveBindings, freeze, namespaceToStringTag, usedHelpers ) : '' ).join(''); }; const HELPER_GENERATORS: { [variable: string]: ( indent: string, snippets: GenerateCodeSnippets, liveBindings: boolean, freeze: boolean, namespaceToStringTag: boolean, usedHelpers: ReadonlySet ) => string; } = { [DOCUMENT_CURRENT_SCRIPT](_t, { _, n }) { return `var${_}${DOCUMENT_CURRENT_SCRIPT}${_}=${_}typeof${_}document${_}!==${_}'undefined'${_}?${_}document.currentScript${_}:${_}null;${n}`; }, [INTEROP_DEFAULT_COMPAT_VARIABLE](_t, snippets, liveBindings) { const { _, getDirectReturnFunction, n } = snippets; const [left, right] = getDirectReturnFunction(['e'], { functionReturn: true, lineBreakIndent: null, name: INTEROP_DEFAULT_COMPAT_VARIABLE }); return ( `${left}${getIsCompatNamespace(snippets)}${_}?${_}` + `${ liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets) }${right}${n}${n}` ); }, [INTEROP_DEFAULT_VARIABLE](_t, snippets, liveBindings) { const { _, getDirectReturnFunction, n } = snippets; const [left, right] = getDirectReturnFunction(['e'], { functionReturn: true, lineBreakIndent: null, name: INTEROP_DEFAULT_VARIABLE }); return ( `${left}e${_}&&${_}e.__esModule${_}?${_}` + `${ liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets) }${right}${n}${n}` ); }, [INTEROP_NAMESPACE_COMPAT_VARIABLE]( t, snippets, liveBindings, freeze, namespaceToStringTag, usedHelpers ) { const { _, getDirectReturnFunction, n } = snippets; if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { const [left, right] = getDirectReturnFunction(['e'], { functionReturn: true, lineBreakIndent: null, name: INTEROP_NAMESPACE_COMPAT_VARIABLE }); return `${left}${getIsCompatNamespace( snippets )}${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`; } return ( `function ${INTEROP_NAMESPACE_COMPAT_VARIABLE}(e)${_}{${n}` + `${t}if${_}(${getIsCompatNamespace(snippets)})${_}return e;${n}` + createNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) + `}${n}${n}` ); }, [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE]( _t, snippets, _liveBindings: boolean, freeze: boolean, namespaceToStringTag: boolean ) { const { getDirectReturnFunction, getObject, n } = snippets; const [left, right] = getDirectReturnFunction(['e'], { functionReturn: true, lineBreakIndent: null, name: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE }); return `${left}${getFrozen( freeze, getWithToStringTag( namespaceToStringTag, getObject( [ ['__proto__', 'null'], ['default', 'e'] ], { lineBreakIndent: null } ), snippets ) )}${right}${n}${n}`; }, [INTEROP_NAMESPACE_DEFAULT_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) { const { _, n } = snippets; return ( `function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` + createNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) + `}${n}${n}` ); }, [INTEROP_NAMESPACE_VARIABLE]( t, snippets, liveBindings, freeze, namespaceToStringTag, usedHelpers ) { const { _, getDirectReturnFunction, n } = snippets; if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { const [left, right] = getDirectReturnFunction(['e'], { functionReturn: true, lineBreakIndent: null, name: INTEROP_NAMESPACE_VARIABLE }); return `${left}e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`; } return ( `function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` + `${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` + createNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) + `}${n}${n}` ); }, [MERGE_NAMESPACES_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) { const { _, cnst, n } = snippets; const useForEach = cnst === 'var' && liveBindings; return ( `function ${MERGE_NAMESPACES_VARIABLE}(n, m)${_}{${n}` + `${t}${loopOverNamespaces( `{${n}` + `${t}${t}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!(k in n))${_}{${n}` + (liveBindings ? useForEach ? copyOwnPropertyLiveBinding : copyPropertyLiveBinding : copyPropertyStatic)(t, t + t + t + t, snippets) + `${t}${t}${t}}${n}` + `${t}${t}}`, useForEach, t, snippets )}${n}` + `${t}return ${getFrozen( freeze, getWithToStringTag(namespaceToStringTag, 'n', snippets) )};${n}` + `}${n}${n}` ); } }; const getDefaultLiveBinding = ({ _, getObject }: GenerateCodeSnippets) => `e${_}:${_}${getObject([['default', 'e']], { lineBreakIndent: null })}`; const getDefaultStatic = ({ _, getPropertyAccess }: GenerateCodeSnippets) => `e${getPropertyAccess('default')}${_}:${_}e`; const getIsCompatNamespace = ({ _ }: GenerateCodeSnippets) => `e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e`; const createNamespaceObject = ( t: string, index: string, snippets: GenerateCodeSnippets, liveBindings: boolean, freeze: boolean, namespaceToStringTag: boolean ) => { const { _, cnst, getObject, getPropertyAccess, n, s } = snippets; const copyProperty = `{${n}` + (liveBindings ? copyNonDefaultOwnPropertyLiveBinding : copyPropertyStatic)( t, index + t + t, snippets ) + `${index}${t}}`; return ( `${index}${cnst} n${_}=${_}Object.create(null${ namespaceToStringTag ? `,${_}{${_}[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}${_}}` : '' });${n}` + `${index}if${_}(e)${_}{${n}` + `${index}${t}${loopOverKeys(copyProperty, !liveBindings, snippets)}${n}` + `${index}}${n}` + `${index}n${getPropertyAccess('default')}${_}=${_}e;${n}` + `${index}return ${getFrozen(freeze, 'n')}${s}${n}` ); }; const loopOverKeys = ( body: string, allowVariableLoopVariable: boolean, { _, cnst, getFunctionIntro, s }: GenerateCodeSnippets ) => cnst !== 'var' || allowVariableLoopVariable ? `for${_}(${cnst} k in e)${_}${body}` : `Object.keys(e).forEach(${getFunctionIntro(['k'], { isAsync: false, name: null })}${body})${s}`; const loopOverNamespaces = ( body: string, useForEach: boolean, t: string, { _, cnst, getDirectReturnFunction, getFunctionIntro, n }: GenerateCodeSnippets ) => { if (useForEach) { const [left, right] = getDirectReturnFunction(['e'], { functionReturn: false, lineBreakIndent: { base: t, t }, name: null }); return ( `m.forEach(${left}` + `e${_}&&${_}typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e)${_}&&${_}Object.keys(e).forEach(${getFunctionIntro( ['k'], { isAsync: false, name: null } )}${body})${right});` ); } return ( `for${_}(var i${_}=${_}0;${_}i${_}<${_}m.length;${_}i++)${_}{${n}` + `${t}${t}${cnst} e${_}=${_}m[i];${n}` + `${t}${t}if${_}(typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e))${_}{${_}for${_}(${cnst} k in e)${_}${body}${_}}${n}${t}}` ); }; const copyNonDefaultOwnPropertyLiveBinding = ( t: string, index: string, snippets: GenerateCodeSnippets ) => { const { _, n } = snippets; return ( `${index}if${_}(k${_}!==${_}'default')${_}{${n}` + copyOwnPropertyLiveBinding(t, index + t, snippets) + `${index}}${n}` ); }; const copyOwnPropertyLiveBinding = ( t: string, index: string, { _, cnst, getDirectReturnFunction, n }: GenerateCodeSnippets ) => { const [left, right] = getDirectReturnFunction([], { functionReturn: true, lineBreakIndent: null, name: null }); return ( `${index}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + `${index}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + `${index}${t}enumerable:${_}true,${n}` + `${index}${t}get:${_}${left}e[k]${right}${n}` + `${index}});${n}` ); }; const copyPropertyLiveBinding = ( t: string, index: string, { _, cnst, getDirectReturnFunction, n }: GenerateCodeSnippets ) => { const [left, right] = getDirectReturnFunction([], { functionReturn: true, lineBreakIndent: null, name: null }); return ( `${index}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + `${index}if${_}(d)${_}{${n}` + `${index}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + `${index}${t}${t}enumerable:${_}true,${n}` + `${index}${t}${t}get:${_}${left}e[k]${right}${n}` + `${index}${t}});${n}` + `${index}}${n}` ); }; const copyPropertyStatic = (_t: string, index: string, { _, n }: GenerateCodeSnippets) => `${index}n[k]${_}=${_}e[k];${n}`; const getFrozen = (freeze: boolean, fragment: string) => freeze ? `Object.freeze(${fragment})` : fragment; const getWithToStringTag = ( namespaceToStringTag: boolean, fragment: string, { _, getObject }: GenerateCodeSnippets ) => namespaceToStringTag ? `Object.defineProperty(${fragment},${_}Symbol.toStringTag,${_}${getToStringTagValue( getObject )})` : fragment; export const HELPER_NAMES = Object.keys(HELPER_GENERATORS); export function getToStringTagValue(getObject: GenerateCodeSnippets['getObject']) { return getObject([['value', "'Module'"]], { lineBreakIndent: null }); } rollup-3.29.4/src/utils/iterators.ts000066400000000000000000000005611450520414700174450ustar00rootroot00000000000000/** * Concatenate a number of iterables to a new iterable without fully evaluating * their iterators. Useful when e.g. working with large sets or lists and when * there is a chance that the iterators will not be fully exhausted. */ export function* concatLazy(iterables: Iterable[]): Iterable { for (const iterable of iterables) { yield* iterable; } } rollup-3.29.4/src/utils/logHandler.ts000066400000000000000000000015121450520414700175050ustar00rootroot00000000000000import type { LoggingFunctionWithPosition, LogHandler, LogLevel, LogLevelOption } from '../rollup/types'; import { doNothing } from './doNothing'; import { LOGLEVEL_WARN, logLevelPriority } from './logging'; import { logInvalidLogPosition } from './logs'; import { normalizeLog } from './options/options'; export function getLogHandler( level: LogLevel, code: string, logger: LogHandler, pluginName: string, logLevel: LogLevelOption ): LoggingFunctionWithPosition { if (logLevelPriority[level] < logLevelPriority[logLevel]) { return doNothing; } return (log, pos) => { if (pos != null) { logger(LOGLEVEL_WARN, logInvalidLogPosition(pluginName)); } log = normalizeLog(log); if (log.code && !log.pluginCode) { log.pluginCode = log.code; } log.code = code; log.plugin = pluginName; logger(level, log); }; } rollup-3.29.4/src/utils/logger.ts000066400000000000000000000033071450520414700167110ustar00rootroot00000000000000import { version as rollupVersion } from 'package.json'; import type { LoggingFunction, LogHandler, LogLevel, LogLevelOption, Plugin, RollupLog } from '../rollup/types'; import { getSortedValidatedPlugins } from './PluginDriver'; import { EMPTY_SET } from './blank'; import { doNothing } from './doNothing'; import { LOGLEVEL_DEBUG, LOGLEVEL_INFO, LOGLEVEL_WARN, logLevelPriority } from './logging'; import { error } from './logs'; import { normalizeLog } from './options/options'; export function getLogger( plugins: Plugin[], onLog: LogHandler, watchMode: boolean, logLevel: LogLevelOption ): LogHandler { plugins = getSortedValidatedPlugins('onLog', plugins); const minimalPriority = logLevelPriority[logLevel]; const logger = (level: LogLevel, log: RollupLog, skipped: ReadonlySet = EMPTY_SET) => { const logPriority = logLevelPriority[level]; if (logPriority < minimalPriority) { return; } for (const plugin of plugins) { if (skipped.has(plugin)) continue; const { onLog: pluginOnLog } = plugin; const getLogHandler = (level: LogLevel): LoggingFunction => { if (logLevelPriority[level] < minimalPriority) { return doNothing; } return log => logger(level, normalizeLog(log), new Set(skipped).add(plugin)); }; const handler = 'handler' in pluginOnLog! ? pluginOnLog.handler : pluginOnLog!; if ( handler.call( { debug: getLogHandler(LOGLEVEL_DEBUG), error: (log): never => error(normalizeLog(log)), info: getLogHandler(LOGLEVEL_INFO), meta: { rollupVersion, watchMode }, warn: getLogHandler(LOGLEVEL_WARN) }, level, log ) === false ) { return; } } onLog(level, log); }; return logger; } rollup-3.29.4/src/utils/logging.ts000066400000000000000000000007151450520414700170600ustar00rootroot00000000000000import type { LogLevel, LogLevelOption } from '../rollup/types'; export const LOGLEVEL_SILENT: LogLevelOption = 'silent'; export const LOGLEVEL_ERROR = 'error'; export const LOGLEVEL_WARN: LogLevel = 'warn'; export const LOGLEVEL_INFO: LogLevel = 'info'; export const LOGLEVEL_DEBUG: LogLevel = 'debug'; export const logLevelPriority: Record = { [LOGLEVEL_DEBUG]: 0, [LOGLEVEL_INFO]: 1, [LOGLEVEL_SILENT]: 3, [LOGLEVEL_WARN]: 2 }; rollup-3.29.4/src/utils/logs.ts000066400000000000000000000774301450520414700164060ustar00rootroot00000000000000import { locate } from 'locate-character'; import type Module from '../Module'; import type { InternalModuleFormat, LogHandler, NormalizedInputOptions, RollupLog } from '../rollup/types'; import getCodeFrame from './getCodeFrame'; import { LOGLEVEL_WARN } from './logging'; import { extname } from './path'; import { printQuotedStringList } from './printStringList'; import relativeId from './relativeId'; import { getRollupUrl } from './url'; import { URL_A_SIMPLE_EXAMPLE, URL_AVOIDING_EVAL, URL_BUNDLE_CONFIG_AS_CJS, URL_CONFIGURATION_FILES, URL_NAME_IS_NOT_EXPORTED, URL_OUTPUT_DIR, URL_OUTPUT_EXPORTS, URL_OUTPUT_EXTEND, URL_OUTPUT_GLOBALS, URL_OUTPUT_INTEROP, URL_OUTPUT_NAME, URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT, URL_THIS_IS_UNDEFINED, URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY } from './urls'; export function error(base: Error | RollupLog): never { if (!(base instanceof Error)) { base = Object.assign(new Error(base.message), base); Object.defineProperty(base, 'name', { value: 'RollupError' }); } throw base; } export function augmentCodeLocation( properties: RollupLog, pos: number | { column: number; line: number }, source: string, id: string ): void { if (typeof pos === 'object') { const { line, column } = pos; properties.loc = { column, file: id, line }; } else { properties.pos = pos; const { line, column } = locate(source, pos, { offsetLine: 1 })!; properties.loc = { column, file: id, line }; } if (properties.frame === undefined) { const { line, column } = properties.loc; properties.frame = getCodeFrame(source, line, column); } } // Error codes should be sorted alphabetically while errors should be sorted by // error code below const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_IMPORT_OPTIONS = 'DUPLICATE_IMPORT_OPTIONS', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FAIL_AFTER_WARNINGS = 'FAIL_AFTER_WARNINGS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ASSERTIONS = 'INCONSISTENT_IMPORT_ASSERTIONS', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_CONFIG_MODULE_FORMAT = 'INVALID_CONFIG_MODULE_FORMAT', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_CONFIG = 'MISSING_CONFIG', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_EXTERNAL_CONFIG = 'MISSING_EXTERNAL_CONFIG', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_FS_IN_BROWSER = 'NO_FS_IN_BROWSER', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', ONLY_INLINE_SOURCEMAPS = 'ONLY_INLINE_SOURCEMAPS', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR'; export function logAddonNotGenerated(message: string, hook: string, plugin: string): RollupLog { return { code: ADDON_ERROR, message: `Could not retrieve "${hook}". Check configuration of plugin "${plugin}". \tError Message: ${message}` }; } export function logAlreadyClosed(): RollupLog { return { code: ALREADY_CLOSED, message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.' }; } export function logAmbiguousExternalNamespaces( binding: string, reexportingModule: string, usedModule: string, sources: string[] ): RollupLog { return { binding, code: AMBIGUOUS_EXTERNAL_NAMESPACES, ids: sources, message: `Ambiguous external namespace resolution: "${relativeId( reexportingModule )}" re-exports "${binding}" from one of the external modules ${printQuotedStringList( sources.map(module => relativeId(module)) )}, guessing "${relativeId(usedModule)}".`, reexporter: reexportingModule }; } export function logAnonymousPluginCache(): RollupLog { return { code: ANONYMOUS_PLUGIN_CACHE, message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.' }; } export function logAssetNotFinalisedForFileName(name: string): RollupLog { return { code: ASSET_NOT_FINALISED, message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.` }; } export function logAssetReferenceIdNotFoundForSetSource(assetReferenceId: string): RollupLog { return { code: ASSET_NOT_FOUND, message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".` }; } export function logAssetSourceAlreadySet(name: string): RollupLog { return { code: ASSET_SOURCE_ALREADY_SET, message: `Unable to set the source for asset "${name}", source already set.` }; } export function logNoAssetSourceSet(assetName: string): RollupLog { return { code: ASSET_SOURCE_MISSING, message: `Plugin error creating asset "${assetName}" - no asset source set.` }; } export function logBadLoader(id: string): RollupLog { return { code: BAD_LOADER, message: `Error loading "${relativeId( id )}": plugin load hook should return a string, a { code, map } object, or nothing/null.` }; } export function logCannotCallNamespace(name: string): RollupLog { return { code: CANNOT_CALL_NAMESPACE, message: `Cannot call a namespace ("${name}").` }; } export function logCannotEmitFromOptionsHook(): RollupLog { return { code: CANNOT_EMIT_FROM_OPTIONS_HOOK, message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.` }; } export function logChunkNotGeneratedForFileName(name: string): RollupLog { return { code: CHUNK_NOT_GENERATED, message: `Plugin error - Unable to get file name for emitted chunk "${name}". You can only get file names once chunks have been generated after the "renderStart" hook.` }; } export function logChunkInvalid( { fileName, code }: { code: string; fileName: string }, exception: { loc: { column: number; line: number }; message: string } ): RollupLog { const errorProperties = { code: CHUNK_INVALID, message: `Chunk "${fileName}" is not valid JavaScript: ${exception.message}.` }; augmentCodeLocation(errorProperties, exception.loc, code, fileName); return errorProperties; } export function logCircularDependency(cyclePath: string[]): RollupLog { return { code: CIRCULAR_DEPENDENCY, ids: cyclePath, message: `Circular dependency: ${cyclePath.map(relativeId).join(' -> ')}` }; } export function logCircularReexport(exportName: string, exporter: string): RollupLog { return { code: CIRCULAR_REEXPORT, exporter, message: `"${exportName}" cannot be exported from "${relativeId( exporter )}" as it is a reexport that references itself.` }; } export function logCyclicCrossChunkReexport( exportName: string, exporter: string, reexporter: string, importer: string, preserveModules: boolean ): RollupLog { return { code: CYCLIC_CROSS_CHUNK_REEXPORT, exporter, id: importer, message: `Export "${exportName}" of module "${relativeId( exporter )}" was reexported through module "${relativeId( reexporter )}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId( importer )}" to point directly to the exporting module or ${ preserveModules ? 'do not use "output.preserveModules"' : 'reconfigure "output.manualChunks"' } to ensure these modules end up in the same chunk.`, reexporter }; } export function logDeprecation( deprecation: string, urlSnippet: string, plugin?: string ): RollupLog { return { code: DEPRECATED_FEATURE, message: deprecation, url: getRollupUrl(urlSnippet), ...(plugin ? { plugin } : {}) }; } export function logDuplicateImportOptions(): RollupLog { return { code: DUPLICATE_IMPORT_OPTIONS, message: 'Either use --input, or pass input path as argument' }; } export function logDuplicatePluginName(plugin: string): RollupLog { return { code: DUPLICATE_PLUGIN_NAME, message: `The plugin name ${plugin} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).` }; } export function logEmptyChunk(chunkName: string): RollupLog { return { code: EMPTY_BUNDLE, message: `Generated an empty chunk: "${chunkName}".`, names: [chunkName] }; } export function logEval(id: string): RollupLog { return { code: EVAL, id, message: `Use of eval in "${relativeId( id )}" is strongly discouraged as it poses security risks and may cause issues with minification.`, url: getRollupUrl(URL_AVOIDING_EVAL) }; } export function logExternalSyntheticExports(id: string, importer: string): RollupLog { return { code: EXTERNAL_SYNTHETIC_EXPORTS, exporter: id, message: `External "${id}" cannot have "syntheticNamedExports" enabled (imported by "${relativeId( importer )}").` }; } export function logFailAfterWarnings(): RollupLog { return { code: FAIL_AFTER_WARNINGS, message: 'Warnings occurred and --failAfterWarnings flag present.' }; } export function logFileNameConflict(fileName: string): RollupLog { return { code: FILE_NAME_CONFLICT, message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.` }; } export function logFileReferenceIdNotFoundForFilename(assetReferenceId: string): RollupLog { return { code: FILE_NOT_FOUND, message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".` }; } export function logFirstSideEffect( source: string, id: string, { line, column }: { column: number; line: number } ): RollupLog { return { code: FIRST_SIDE_EFFECT, message: `First side effect in ${relativeId(id)} is at (${line}:${column})\n${getCodeFrame( source, line, column )}` }; } export function logIllegalIdentifierAsName(name: string): RollupLog { return { code: ILLEGAL_IDENTIFIER_AS_NAME, message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`, url: getRollupUrl(URL_OUTPUT_EXTEND) }; } export function logIllegalImportReassignment(name: string, importingId: string): RollupLog { return { code: ILLEGAL_REASSIGNMENT, message: `Illegal reassignment of import "${name}" in "${relativeId(importingId)}".` }; } export function logInconsistentImportAssertions( existingAssertions: Record, newAssertions: Record, source: string, importer: string ): RollupLog { return { code: INCONSISTENT_IMPORT_ASSERTIONS, message: `Module "${relativeId(importer)}" tried to import "${relativeId( source )}" with ${formatAssertions( newAssertions )} assertions, but it was already imported elsewhere with ${formatAssertions( existingAssertions )} assertions. Please ensure that import assertions for the same module are always consistent.` }; } const formatAssertions = (assertions: Record): string => { const entries = Object.entries(assertions); if (entries.length === 0) return 'no'; return entries.map(([key, value]) => `"${key}": "${value}"`).join(', '); }; export function logInputHookInOutputPlugin(pluginName: string, hookName: string): RollupLog { return { code: INPUT_HOOK_IN_OUTPUT_PLUGIN, message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.` }; } export function logCannotAssignModuleToChunk( moduleId: string, assignToAlias: string, currentAlias: string ): RollupLog { return { code: INVALID_CHUNK, message: `Cannot assign "${relativeId( moduleId )}" to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.` }; } export function logCannotBundleConfigAsEsm(originalError: Error): RollupLog { return { cause: originalError, code: INVALID_CONFIG_MODULE_FORMAT, message: `Rollup transpiled your configuration to an ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.\n\nOriginal error: ${originalError.message}`, stack: originalError.stack, url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS) }; } export function logCannotLoadConfigAsCjs(originalError: Error): RollupLog { return { cause: originalError, code: INVALID_CONFIG_MODULE_FORMAT, message: `Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${originalError.message}`, stack: originalError.stack, url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS) }; } export function logCannotLoadConfigAsEsm(originalError: Error): RollupLog { return { cause: originalError, code: INVALID_CONFIG_MODULE_FORMAT, message: `Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to ".cjs" or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${originalError.message}`, stack: originalError.stack, url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS) }; } export function logInvalidExportOptionValue(optionValue: string): RollupLog { return { code: INVALID_EXPORT_OPTION, message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}".`, url: getRollupUrl(URL_OUTPUT_EXPORTS) }; } export function logIncompatibleExportOptionValue( optionValue: string, keys: readonly string[], entryModule: string ): RollupLog { return { code: INVALID_EXPORT_OPTION, message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId( entryModule )}" has the following exports: ${printQuotedStringList(keys)}`, url: getRollupUrl(URL_OUTPUT_EXPORTS) }; } export function logInternalIdCannotBeExternal(source: string, importer: string): RollupLog { return { code: INVALID_EXTERNAL_ID, message: `"${source}" is imported as an external by "${relativeId( importer )}", but is already an existing non-external module id.` }; } export function logInvalidLogPosition(plugin: string): RollupLog { return { code: INVALID_LOG_POSITION, message: `Plugin "${plugin}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.` }; } export function logInvalidOption( option: string, urlSnippet: string, explanation: string, value?: string | boolean | null ): RollupLog { return { code: INVALID_OPTION, message: `Invalid value ${ value === undefined ? '' : `${JSON.stringify(value)} ` }for option "${option}" - ${explanation}.`, url: getRollupUrl(urlSnippet) }; } export function logInvalidAddonPluginHook(hook: string, plugin: string): RollupLog { return { code: INVALID_PLUGIN_HOOK, hook, message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a string, a function hook or an object with a "handler" string or function.`, plugin }; } export function logInvalidFunctionPluginHook(hook: string, plugin: string): RollupLog { return { code: INVALID_PLUGIN_HOOK, hook, message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a function hook or an object with a "handler" function.`, plugin }; } export function logInvalidRollupPhaseForAddWatchFile(): RollupLog { return { code: INVALID_ROLLUP_PHASE, message: `Cannot call "addWatchFile" after the build has finished.` }; } export function logInvalidRollupPhaseForChunkEmission(): RollupLog { return { code: INVALID_ROLLUP_PHASE, message: `Cannot emit chunks after module loading has finished.` }; } export function logInvalidSetAssetSourceCall(): RollupLog { return { code: INVALID_SETASSETSOURCE, message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.` }; } export function logInvalidFormatForTopLevelAwait( id: string, format: InternalModuleFormat ): RollupLog { return { code: INVALID_TLA_FORMAT, id, message: `Module format "${format}" does not support top-level await. Use the "es" or "system" output formats rather.` }; } export function logMissingConfig(): RollupLog { return { code: MISSING_CONFIG, message: 'Config file must export an options object, or an array of options objects', url: getRollupUrl(URL_CONFIGURATION_FILES) }; } export function logMissingExport( binding: string, importingModule: string, exporter: string ): RollupLog { const isJson = extname(exporter) === '.json'; return { binding, code: MISSING_EXPORT, exporter, id: importingModule, message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId( importingModule )}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`, url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED) }; } export function logMissingExternalConfig(file: string): RollupLog { return { code: MISSING_EXTERNAL_CONFIG, message: `Could not resolve config file "${file}"` }; } export function logMissingGlobalName(externalId: string, guess: string): RollupLog { return { code: MISSING_GLOBAL_NAME, id: externalId, message: `No name was provided for external module "${externalId}" in "output.globals" – guessing "${guess}".`, names: [guess], url: getRollupUrl(URL_OUTPUT_GLOBALS) }; } export function logImplicitDependantCannotBeExternal( unresolvedId: string, implicitlyLoadedBefore: string ): RollupLog { return { code: MISSING_IMPLICIT_DEPENDANT, message: `Module "${relativeId( unresolvedId )}" that should be implicitly loaded before "${relativeId( implicitlyLoadedBefore )}" cannot be external.` }; } export function logUnresolvedImplicitDependant( unresolvedId: string, implicitlyLoadedBefore: string ): RollupLog { return { code: MISSING_IMPLICIT_DEPENDANT, message: `Module "${relativeId( unresolvedId )}" that should be implicitly loaded before "${relativeId( implicitlyLoadedBefore )}" could not be resolved.` }; } export function logImplicitDependantIsNotIncluded(module: Module): RollupLog { const implicitDependencies = [...module.implicitlyLoadedBefore] .map(dependency => relativeId(dependency.id)) .sort(); return { code: MISSING_IMPLICIT_DEPENDANT, message: `Module "${relativeId( module.id )}" that should be implicitly loaded before ${printQuotedStringList( implicitDependencies )} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.` }; } export function logMissingNameOptionForIifeExport(): RollupLog { return { code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT, message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`, url: getRollupUrl(URL_OUTPUT_NAME) }; } export function logMissingNameOptionForUmdExport(): RollupLog { return { code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT, message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.', url: getRollupUrl(URL_OUTPUT_NAME) }; } export function logMissingNodeBuiltins(externalBuiltins: string[]): RollupLog { return { code: MISSING_NODE_BUILTINS, ids: externalBuiltins, message: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList( externalBuiltins )}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node` }; } // eslint-disable-next-line unicorn/prevent-abbreviations export function logMissingFileOrDirOption(): RollupLog { return { code: MISSING_OPTION, message: 'You must specify "output.file" or "output.dir" for the build.', url: getRollupUrl(URL_OUTPUT_DIR) }; } export function logMixedExport(facadeModuleId: string, name?: string): RollupLog { return { code: MIXED_EXPORTS, id: facadeModuleId, message: `Entry module "${relativeId( facadeModuleId )}" is using named and default exports together. Consumers of your bundle will have to use \`${ name || 'chunk' }.default\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`, url: getRollupUrl(URL_OUTPUT_EXPORTS) }; } export function logModuleLevelDirective(directive: string, id: string): RollupLog { return { code: MODULE_LEVEL_DIRECTIVE, id, message: `Module level directives cause errors when bundled, "${directive}" in "${relativeId( id )}" was ignored.` }; } export function logNamespaceConflict( binding: string, reexportingModuleId: string, sources: string[] ): RollupLog { return { binding, code: NAMESPACE_CONFLICT, ids: sources, message: `Conflicting namespaces: "${relativeId( reexportingModuleId )}" re-exports "${binding}" from one of the modules ${printQuotedStringList( sources.map(moduleId => relativeId(moduleId)) )} (will be ignored).`, reexporter: reexportingModuleId }; } export function logNoFileSystemInBrowser(method: string): RollupLog { return { code: NO_FS_IN_BROWSER, message: `Cannot access the file system (via "${method}") when using the browser build of Rollup. Make sure you supply a plugin with custom resolveId and load hooks to Rollup.`, url: getRollupUrl(URL_A_SIMPLE_EXAMPLE) }; } export function logNoTransformMapOrAstWithoutCode(pluginName: string): RollupLog { return { code: NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE, message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` + 'a "code". This will be ignored.' }; } export function logOnlyInlineSourcemapsForStdout(): RollupLog { return { code: ONLY_INLINE_SOURCEMAPS, message: 'Only inline sourcemaps are supported when bundling to stdout.' }; } export function logOptimizeChunkStatus( chunks: number, smallChunks: number, pointInTime: string ): RollupLog { return { code: OPTIMIZE_CHUNK_STATUS, message: `${pointInTime}, there are\n` + `${chunks} chunks, of which\n` + `${smallChunks} are below minChunkSize.` }; } export function logParseError(error: Error, moduleId: string): RollupLog { let message = error.message.replace(/ \(\d+:\d+\)$/, ''); if (moduleId.endsWith('.json')) { message += ' (Note that you need @rollup/plugin-json to import JSON files)'; } else if (!moduleId.endsWith('.js')) { message += ' (Note that you need plugins to import files that are not JavaScript)'; } return { cause: error, code: PARSE_ERROR, id: moduleId, message }; } export function logPluginError( error: Omit & { code?: unknown }, plugin: string, { hook, id }: { hook?: string; id?: string } = {} ) { const code = error.code; if ( !error.pluginCode && code != null && (typeof code !== 'string' || (typeof code === 'string' && !code.startsWith('PLUGIN_'))) ) { error.pluginCode = code; } error.code = PLUGIN_ERROR; error.plugin = plugin; if (hook) { error.hook = hook; } if (id) { error.id = id; } return error as RollupLog; } export function logShimmedExport(id: string, binding: string): RollupLog { return { binding, code: SHIMMED_EXPORT, exporter: id, message: `Missing export "${binding}" has been shimmed in module "${relativeId(id)}".` }; } export function logSourcemapBroken(plugin: string): RollupLog { return { code: SOURCEMAP_BROKEN, message: `Sourcemap is likely to be incorrect: a plugin (${plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`, plugin, url: getRollupUrl(URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT) }; } export function logConflictingSourcemapSources(filename: string): RollupLog { return { code: SOURCEMAP_BROKEN, message: `Multiple conflicting contents for sourcemap source ${filename}` }; } export function logInvalidSourcemapForError( error: Error, id: string, column: number, line: number, pos: number ): RollupLog { return { cause: error, code: SOURCEMAP_ERROR, id, loc: { column, file: id, line }, message: `Error when using sourcemap for reporting an error: ${error.message}`, pos }; } export function logSyntheticNamedExportsNeedNamespaceExport( id: string, syntheticNamedExportsOption: boolean | string ): RollupLog { return { code: SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT, exporter: id, message: `Module "${relativeId( id )}" that is marked with \`syntheticNamedExports: ${JSON.stringify( syntheticNamedExportsOption )}\` needs ${ typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default' ? `an explicit export named "${syntheticNamedExportsOption}"` : 'a default export' } that does not reexport an unresolved named export of the same module.` }; } export function logThisIsUndefined(): RollupLog { return { code: THIS_IS_UNDEFINED, message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`, url: getRollupUrl(URL_THIS_IS_UNDEFINED) }; } export function logUnexpectedNamedImport( id: string, imported: string, isReexport: boolean ): RollupLog { const importType = isReexport ? 'reexport' : 'import'; return { code: UNEXPECTED_NAMED_IMPORT, exporter: id, message: `The named export "${imported}" was ${importType}ed from the external module "${relativeId( id )}" even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`, url: getRollupUrl(URL_OUTPUT_INTEROP) }; } export function logUnexpectedNamespaceReexport(id: string): RollupLog { return { code: UNEXPECTED_NAMED_IMPORT, exporter: id, message: `There was a namespace "*" reexport from the external module "${relativeId( id )}" even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`, url: getRollupUrl(URL_OUTPUT_INTEROP) }; } export function logUnknownOption( optionType: string, unknownOptions: string[], validOptions: string[] ): RollupLog { return { code: UNKNOWN_OPTION, message: `Unknown ${optionType}: ${unknownOptions.join( ', ' )}. Allowed options: ${validOptions.join(', ')}` }; } export function logEntryCannotBeExternal(unresolvedId: string): RollupLog { return { code: UNRESOLVED_ENTRY, message: `Entry module "${relativeId(unresolvedId)}" cannot be external.` }; } export function logExternalModulesCannotBeIncludedInManualChunks(source: string): RollupLog { return { code: EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS, message: `"${source}" cannot be included in manualChunks because it is resolved as an external module by the "external" option or plugins.` }; } export function logExternalModulesCannotBeTransformedToModules(source: string): RollupLog { return { code: EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES, message: `${source} is resolved as a module now, but it was an external module before. Please check whether there are conflicts in your Rollup options "external" and "manualChunks", manualChunks cannot include external modules.` }; } export function logUnresolvedEntry(unresolvedId: string): RollupLog { return { code: UNRESOLVED_ENTRY, message: `Could not resolve entry module "${relativeId(unresolvedId)}".` }; } export function logUnresolvedImport(source: string, importer: string): RollupLog { return { code: UNRESOLVED_IMPORT, exporter: source, id: importer, message: `Could not resolve "${source}" from "${relativeId(importer)}"` }; } export function logUnresolvedImportTreatedAsExternal(source: string, importer: string): RollupLog { return { code: UNRESOLVED_IMPORT, exporter: source, id: importer, message: `"${source}" is imported by "${relativeId( importer )}", but could not be resolved – treating it as an external dependency.`, url: getRollupUrl(URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY) }; } export function logUnusedExternalImports( externalId: string, names: string[], importers: string[] ): RollupLog { return { code: UNUSED_EXTERNAL_IMPORT, exporter: externalId, ids: importers, message: `${printQuotedStringList(names, [ 'is', 'are' ])} imported from external module "${externalId}" but never used in ${printQuotedStringList( importers.map(importer => relativeId(importer)) )}.`, names }; } export function logFailedValidation(message: string): RollupLog { return { code: VALIDATION_ERROR, message }; } export function warnDeprecation( deprecation: string, urlSnippet: string, activeDeprecation: boolean, options: NormalizedInputOptions, plugin?: string ): void { warnDeprecationWithOptions( deprecation, urlSnippet, activeDeprecation, options.onLog, options.strictDeprecations, plugin ); } export function warnDeprecationWithOptions( deprecation: string, urlSnippet: string, activeDeprecation: boolean, log: LogHandler, strictDeprecations: boolean, plugin?: string ): void { if (activeDeprecation || strictDeprecations) { const warning = logDeprecation(deprecation, urlSnippet, plugin); if (strictDeprecations) { return error(warning); } log(LOGLEVEL_WARN, warning); } } rollup-3.29.4/src/utils/options/000077500000000000000000000000001450520414700165525ustar00rootroot00000000000000rollup-3.29.4/src/utils/options/mergeOptions.ts000066400000000000000000000225351450520414700216040ustar00rootroot00000000000000import type { ExternalOption, InputOptions, LogHandler, MergedRollupOptions, OutputOptions, Plugin, RollupCache, RollupOptions } from '../../rollup/types'; import { ensureArray } from '../ensureArray'; import { getLogger } from '../logger'; import { LOGLEVEL_INFO } from '../logging'; import { URL_OUTPUT_GENERATEDCODE, URL_TREESHAKE } from '../urls'; import type { CommandConfigObject } from './normalizeInputOptions'; import { generatedCodePresets, type GenericConfigObject, getOnLog, normalizePluginOption, objectifyOption, objectifyOptionWithPresets, treeshakePresets, warnUnknownOptions } from './options'; export const commandAliases: { [key: string]: string } = { c: 'config', d: 'dir', e: 'external', f: 'format', g: 'globals', h: 'help', i: 'input', m: 'sourcemap', n: 'name', o: 'file', p: 'plugin', v: 'version', w: 'watch' }; const EMPTY_COMMAND_OPTIONS = { external: [], globals: undefined }; export async function mergeOptions( config: RollupOptions, watchMode: boolean, rawCommandOptions: GenericConfigObject = EMPTY_COMMAND_OPTIONS, printLog?: LogHandler ): Promise { const command = getCommandOptions(rawCommandOptions); const plugins = await normalizePluginOption(config.plugins); const logLevel = config.logLevel || LOGLEVEL_INFO; const onLog = getOnLog(config, logLevel, printLog); const log = getLogger(plugins, onLog, watchMode, logLevel); const inputOptions = await mergeInputOptions(config, command, plugins, log, onLog); if (command.output) { Object.assign(command, command.output); } const outputOptionsArray = ensureArray(config.output); if (outputOptionsArray.length === 0) outputOptionsArray.push({}); const outputOptions = await Promise.all( outputOptionsArray.map(singleOutputOptions => mergeOutputOptions(singleOutputOptions, command, log) ) ); warnUnknownOptions( command, [ ...Object.keys(inputOptions), ...Object.keys(outputOptions[0]).filter( option => option !== 'sourcemapIgnoreList' && option !== 'sourcemapPathTransform' ), ...Object.keys(commandAliases), 'bundleConfigAsCjs', 'config', 'environment', 'filterLogs', 'plugin', 'silent', 'failAfterWarnings', 'stdin', 'waitForBundleInput', 'configPlugin' ], 'CLI flags', log, /^_$|output$|config/ ); (inputOptions as MergedRollupOptions).output = outputOptions; return inputOptions as MergedRollupOptions; } function getCommandOptions(rawCommandOptions: GenericConfigObject): CommandConfigObject { const external = rawCommandOptions.external && typeof rawCommandOptions.external === 'string' ? rawCommandOptions.external.split(',') : []; return { ...rawCommandOptions, external, globals: typeof rawCommandOptions.globals === 'string' ? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => { const [id, variableName] = globalDefinition.split(':'); globals[id] = variableName; if (!external.includes(id)) { external.push(id); } return globals; }, Object.create(null)) : undefined }; } type CompleteInputOptions = { [K in U]: InputOptions[K]; }; function mergeInputOptions( config: InputOptions, overrides: CommandConfigObject, plugins: Plugin[], log: LogHandler, onLog: LogHandler ): InputOptions { const getOption = (name: keyof InputOptions): any => overrides[name] ?? config[name]; const inputOptions: CompleteInputOptions = { acorn: getOption('acorn'), acornInjectPlugins: config.acornInjectPlugins as | (() => unknown)[] | (() => unknown) | undefined, cache: config.cache as false | RollupCache | undefined, context: getOption('context'), experimentalCacheExpiry: getOption('experimentalCacheExpiry'), experimentalLogSideEffects: getOption('experimentalLogSideEffects'), external: getExternal(config, overrides), inlineDynamicImports: getOption('inlineDynamicImports'), input: getOption('input') || [], logLevel: getOption('logLevel'), makeAbsoluteExternalsRelative: getOption('makeAbsoluteExternalsRelative'), manualChunks: getOption('manualChunks'), maxParallelFileOps: getOption('maxParallelFileOps'), maxParallelFileReads: getOption('maxParallelFileReads'), moduleContext: getOption('moduleContext'), onLog, onwarn: undefined, perf: getOption('perf'), plugins, preserveEntrySignatures: getOption('preserveEntrySignatures'), preserveModules: getOption('preserveModules'), preserveSymlinks: getOption('preserveSymlinks'), shimMissingExports: getOption('shimMissingExports'), strictDeprecations: getOption('strictDeprecations'), treeshake: getObjectOption( config, overrides, 'treeshake', objectifyOptionWithPresets(treeshakePresets, 'treeshake', URL_TREESHAKE, 'false, true, ') ), watch: getWatch(config, overrides) }; warnUnknownOptions(config, Object.keys(inputOptions), 'input options', log, /^output$/); return inputOptions; } const getExternal = (config: InputOptions, overrides: CommandConfigObject): ExternalOption => { const configExternal = config.external; return typeof configExternal === 'function' ? (source: string, importer: string | undefined, isResolved: boolean) => configExternal(source, importer, isResolved) || overrides.external.includes(source) : [...ensureArray(configExternal), ...overrides.external]; }; const getObjectOption = ( config: T, overrides: T, name: keyof T, objectifyValue = objectifyOption ) => { const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue); const configOption = normalizeObjectOptionValue(config[name], objectifyValue); if (commandOption !== undefined) { return commandOption && { ...configOption, ...commandOption }; } return configOption; }; export const getWatch = (config: InputOptions, overrides: InputOptions) => config.watch !== false && getObjectOption(config, overrides, 'watch'); export const isWatchEnabled = (optionValue: unknown): boolean => { if (Array.isArray(optionValue)) { return optionValue.reduce( (result, value) => (typeof value === 'boolean' ? value : result), false ); } return optionValue === true; }; export const normalizeObjectOptionValue = ( optionValue: unknown, objectifyValue: (value: unknown) => Record | undefined ): Record | undefined => { if (!optionValue) { return optionValue as undefined; } if (Array.isArray(optionValue)) { return optionValue.reduce( (result, value) => value && result && { ...result, ...objectifyValue(value) }, {} ); } return objectifyValue(optionValue); }; type CompleteOutputOptions = { [K in U]: OutputOptions[K]; }; async function mergeOutputOptions( config: OutputOptions, overrides: OutputOptions, log: LogHandler ): Promise { const getOption = (name: keyof OutputOptions): any => overrides[name] ?? config[name]; const outputOptions: CompleteOutputOptions = { amd: getObjectOption(config, overrides, 'amd'), assetFileNames: getOption('assetFileNames'), banner: getOption('banner'), chunkFileNames: getOption('chunkFileNames'), compact: getOption('compact'), dir: getOption('dir'), dynamicImportFunction: getOption('dynamicImportFunction'), dynamicImportInCjs: getOption('dynamicImportInCjs'), entryFileNames: getOption('entryFileNames'), esModule: getOption('esModule'), experimentalDeepDynamicChunkOptimization: getOption('experimentalDeepDynamicChunkOptimization'), experimentalMinChunkSize: getOption('experimentalMinChunkSize'), exports: getOption('exports'), extend: getOption('extend'), externalImportAssertions: getOption('externalImportAssertions'), externalLiveBindings: getOption('externalLiveBindings'), file: getOption('file'), footer: getOption('footer'), format: getOption('format'), freeze: getOption('freeze'), generatedCode: getObjectOption( config, overrides, 'generatedCode', objectifyOptionWithPresets( generatedCodePresets, 'output.generatedCode', URL_OUTPUT_GENERATEDCODE, '' ) ), globals: getOption('globals'), hoistTransitiveImports: getOption('hoistTransitiveImports'), indent: getOption('indent'), inlineDynamicImports: getOption('inlineDynamicImports'), interop: getOption('interop'), intro: getOption('intro'), manualChunks: getOption('manualChunks'), minifyInternalExports: getOption('minifyInternalExports'), name: getOption('name'), namespaceToStringTag: getOption('namespaceToStringTag'), noConflict: getOption('noConflict'), outro: getOption('outro'), paths: getOption('paths'), plugins: await normalizePluginOption(config.plugins), preferConst: getOption('preferConst'), preserveModules: getOption('preserveModules'), preserveModulesRoot: getOption('preserveModulesRoot'), sanitizeFileName: getOption('sanitizeFileName'), sourcemap: getOption('sourcemap'), sourcemapBaseUrl: getOption('sourcemapBaseUrl'), sourcemapExcludeSources: getOption('sourcemapExcludeSources'), sourcemapFile: getOption('sourcemapFile'), sourcemapFileNames: getOption('sourcemapFileNames'), sourcemapIgnoreList: getOption('sourcemapIgnoreList'), sourcemapPathTransform: getOption('sourcemapPathTransform'), strict: getOption('strict'), systemNullSetters: getOption('systemNullSetters'), validate: getOption('validate') }; warnUnknownOptions(config, Object.keys(outputOptions), 'output options', log); return outputOptions; } rollup-3.29.4/src/utils/options/normalizeInputOptions.ts000066400000000000000000000220431450520414700235170ustar00rootroot00000000000000import type * as acorn from 'acorn'; import { importAssertions } from 'acorn-import-assertions'; import type { HasModuleSideEffects, InputOptions, LogHandler, ModuleSideEffectsOption, NormalizedInputOptions, RollupBuild } from '../../rollup/types'; import { EMPTY_ARRAY } from '../blank'; import { ensureArray } from '../ensureArray'; import { getLogger } from '../logger'; import { LOGLEVEL_INFO, LOGLEVEL_WARN } from '../logging'; import { error, logInvalidOption, warnDeprecationWithOptions } from '../logs'; import { resolve } from '../path'; import { URL_MAXPARALLELFILEOPS, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_PRESERVEMODULES, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS } from '../urls'; import { getOnLog, getOptionWithPreset, normalizePluginOption, treeshakePresets, warnUnknownOptions } from './options'; export interface CommandConfigObject { [key: string]: unknown; external: (string | RegExp)[]; globals: { [id: string]: string } | undefined; } export async function normalizeInputOptions( config: InputOptions, watchMode: boolean ): Promise<{ options: NormalizedInputOptions; unsetOptions: Set; }> { // These are options that may trigger special warnings or behaviour later // if the user did not select an explicit value const unsetOptions = new Set(); const context = config.context ?? 'undefined'; const plugins = await normalizePluginOption(config.plugins); const logLevel = config.logLevel || LOGLEVEL_INFO; const onLog = getLogger(plugins, getOnLog(config, logLevel), watchMode, logLevel); const strictDeprecations = config.strictDeprecations || false; const maxParallelFileOps = getMaxParallelFileOps(config, onLog, strictDeprecations); const options: NormalizedInputOptions & InputOptions = { acorn: getAcorn(config) as unknown as NormalizedInputOptions['acorn'], acornInjectPlugins: getAcornInjectPlugins(config), cache: getCache(config), context, experimentalCacheExpiry: config.experimentalCacheExpiry ?? 10, experimentalLogSideEffects: config.experimentalLogSideEffects || false, external: getIdMatcher(config.external), inlineDynamicImports: getInlineDynamicImports(config, onLog, strictDeprecations), input: getInput(config), logLevel, makeAbsoluteExternalsRelative: config.makeAbsoluteExternalsRelative ?? 'ifRelativeSource', manualChunks: getManualChunks(config, onLog, strictDeprecations), maxParallelFileOps, maxParallelFileReads: maxParallelFileOps, moduleContext: getModuleContext(config, context), onLog, onwarn: warning => onLog(LOGLEVEL_WARN, warning), perf: config.perf || false, plugins, preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only', preserveModules: getPreserveModules(config, onLog, strictDeprecations), preserveSymlinks: config.preserveSymlinks || false, shimMissingExports: config.shimMissingExports || false, strictDeprecations, treeshake: getTreeshake(config) }; warnUnknownOptions( config, [...Object.keys(options), 'watch'], 'input options', onLog, /^(output)$/ ); return { options, unsetOptions }; } const getAcorn = (config: InputOptions): acorn.Options => ({ ecmaVersion: 'latest', sourceType: 'module', ...config.acorn }); const getAcornInjectPlugins = ( config: InputOptions ): NormalizedInputOptions['acornInjectPlugins'] => [ importAssertions, ...ensureArray(config.acornInjectPlugins) ]; const getCache = (config: InputOptions): NormalizedInputOptions['cache'] => config.cache === true // `true` is the default ? undefined : (config.cache as unknown as RollupBuild)?.cache || config.cache; const getIdMatcher = >( option: | undefined | boolean | string | RegExp | (string | RegExp)[] | ((id: string, ...parameters: T) => boolean | null | void) ): ((id: string, ...parameters: T) => boolean) => { if (option === true) { return () => true; } if (typeof option === 'function') { return (id, ...parameters) => (!id.startsWith('\0') && option(id, ...parameters)) || false; } if (option) { const ids = new Set(); const matchers: RegExp[] = []; for (const value of ensureArray(option)) { if (value instanceof RegExp) { matchers.push(value); } else { ids.add(value); } } return (id: string, ..._arguments) => ids.has(id) || matchers.some(matcher => matcher.test(id)); } return () => false; }; const getInlineDynamicImports = ( config: InputOptions, log: LogHandler, strictDeprecations: boolean ): NormalizedInputOptions['inlineDynamicImports'] => { const configInlineDynamicImports = config.inlineDynamicImports; if (configInlineDynamicImports) { warnDeprecationWithOptions( 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', URL_OUTPUT_INLINEDYNAMICIMPORTS, true, log, strictDeprecations ); } return configInlineDynamicImports; }; const getInput = (config: InputOptions): NormalizedInputOptions['input'] => { const configInput = config.input; return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput; }; const getManualChunks = ( config: InputOptions, log: LogHandler, strictDeprecations: boolean ): NormalizedInputOptions['manualChunks'] => { const configManualChunks = config.manualChunks; if (configManualChunks) { warnDeprecationWithOptions( 'The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', URL_OUTPUT_MANUALCHUNKS, true, log, strictDeprecations ); } return configManualChunks; }; const getMaxParallelFileOps = ( config: InputOptions, log: LogHandler, strictDeprecations: boolean ): NormalizedInputOptions['maxParallelFileOps'] => { const maxParallelFileReads = config.maxParallelFileReads; if (typeof maxParallelFileReads === 'number') { warnDeprecationWithOptions( 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', URL_MAXPARALLELFILEOPS, true, log, strictDeprecations ); } const maxParallelFileOps = config.maxParallelFileOps ?? maxParallelFileReads; if (typeof maxParallelFileOps === 'number') { if (maxParallelFileOps <= 0) return Infinity; return maxParallelFileOps; } return 20; }; const getModuleContext = ( config: InputOptions, context: string ): NormalizedInputOptions['moduleContext'] => { const configModuleContext = config.moduleContext; if (typeof configModuleContext === 'function') { return id => configModuleContext(id) ?? context; } if (configModuleContext) { const contextByModuleId: { [key: string]: string; } = Object.create(null); for (const [key, moduleContext] of Object.entries(configModuleContext)) { contextByModuleId[resolve(key)] = moduleContext; } return id => contextByModuleId[id] ?? context; } return () => context; }; const getPreserveModules = ( config: InputOptions, log: LogHandler, strictDeprecations: boolean ): NormalizedInputOptions['preserveModules'] => { const configPreserveModules = config.preserveModules; if (configPreserveModules) { warnDeprecationWithOptions( 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', URL_OUTPUT_PRESERVEMODULES, true, log, strictDeprecations ); } return configPreserveModules; }; const getTreeshake = (config: InputOptions): NormalizedInputOptions['treeshake'] => { const configTreeshake = config.treeshake; if (configTreeshake === false) { return false; } const configWithPreset = getOptionWithPreset( config.treeshake, treeshakePresets, 'treeshake', URL_TREESHAKE, 'false, true, ' ); return { annotations: configWithPreset.annotations !== false, correctVarValueBeforeDeclaration: configWithPreset.correctVarValueBeforeDeclaration === true, manualPureFunctions: (configWithPreset.manualPureFunctions as readonly string[] | undefined) ?? EMPTY_ARRAY, moduleSideEffects: getHasModuleSideEffects( configWithPreset.moduleSideEffects as ModuleSideEffectsOption | undefined ), propertyReadSideEffects: configWithPreset.propertyReadSideEffects === 'always' ? 'always' : configWithPreset.propertyReadSideEffects !== false, tryCatchDeoptimization: configWithPreset.tryCatchDeoptimization !== false, unknownGlobalSideEffects: configWithPreset.unknownGlobalSideEffects !== false }; }; const getHasModuleSideEffects = ( moduleSideEffectsOption: ModuleSideEffectsOption | undefined ): HasModuleSideEffects => { if (typeof moduleSideEffectsOption === 'boolean') { return () => moduleSideEffectsOption; } if (moduleSideEffectsOption === 'no-external') { return (_id, external) => !external; } if (typeof moduleSideEffectsOption === 'function') { return (id, external) => id.startsWith('\0') ? true : moduleSideEffectsOption(id, external) !== false; } if (Array.isArray(moduleSideEffectsOption)) { const ids = new Set(moduleSideEffectsOption); return id => ids.has(id); } if (moduleSideEffectsOption) { error( logInvalidOption( 'treeshake.moduleSideEffects', URL_TREESHAKE_MODULESIDEEFFECTS, 'please use one of false, "no-external", a function or an array' ) ); } return () => true; }; rollup-3.29.4/src/utils/options/normalizeOutputOptions.ts000066400000000000000000000404511450520414700237230ustar00rootroot00000000000000import type { InternalModuleFormat, InteropType, NormalizedInputOptions, NormalizedOutputOptions, OutputOptions, SourcemapPathTransformOption } from '../../rollup/types'; import { LOGLEVEL_WARN } from '../logging'; import { error, logInvalidExportOptionValue, logInvalidOption, warnDeprecation } from '../logs'; import { resolve } from '../path'; import { sanitizeFileName as defaultSanitizeFileName } from '../sanitizeFileName'; import { addTrailingSlashIfMissed, isValidUrl } from '../url'; import { URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_DYNAMICIMPORTFUNCTION, URL_OUTPUT_EXPERIMENTALDEEPCHUNKOPTIMIZATION, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS, URL_OUTPUT_GENERATEDCODE_SYMBOLS, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, URL_PRESERVEENTRYSIGNATURES, URL_RENDERDYNAMICIMPORT } from '../urls'; import { generatedCodePresets, getOptionWithPreset, normalizePluginOption, warnUnknownOptions } from './options'; export async function normalizeOutputOptions( config: OutputOptions, inputOptions: NormalizedInputOptions, unsetInputOptions: ReadonlySet ): Promise<{ options: NormalizedOutputOptions; unsetOptions: Set }> { // These are options that may trigger special warnings or behaviour later // if the user did not select an explicit value const unsetOptions = new Set(unsetInputOptions); const compact = config.compact || false; const format = getFormat(config); const inlineDynamicImports = getInlineDynamicImports(config, inputOptions); const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions); const file = getFile(config, preserveModules, inputOptions); const preferConst = getPreferConst(config, inputOptions); const generatedCode = getGeneratedCode(config, preferConst); const outputOptions: NormalizedOutputOptions & OutputOptions = { amd: getAmd(config), assetFileNames: config.assetFileNames ?? 'assets/[name]-[hash][extname]', banner: getAddon(config, 'banner'), chunkFileNames: config.chunkFileNames ?? '[name]-[hash].js', compact, dir: getDir(config, file), dynamicImportFunction: getDynamicImportFunction(config, inputOptions, format), dynamicImportInCjs: config.dynamicImportInCjs ?? true, entryFileNames: getEntryFileNames(config, unsetOptions), esModule: config.esModule ?? 'if-default-prop', experimentalDeepDynamicChunkOptimization: getExperimentalDeepDynamicChunkOptimization( config, inputOptions ), experimentalMinChunkSize: config.experimentalMinChunkSize ?? 1, exports: getExports(config, unsetOptions), extend: config.extend || false, externalImportAssertions: config.externalImportAssertions ?? true, externalLiveBindings: config.externalLiveBindings ?? true, file, footer: getAddon(config, 'footer'), format, freeze: config.freeze ?? true, generatedCode, globals: config.globals || {}, hoistTransitiveImports: config.hoistTransitiveImports ?? true, indent: getIndent(config, compact), inlineDynamicImports, interop: getInterop(config), intro: getAddon(config, 'intro'), manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules, inputOptions), minifyInternalExports: getMinifyInternalExports(config, format, compact), name: config.name, namespaceToStringTag: getNamespaceToStringTag(config, generatedCode, inputOptions), noConflict: config.noConflict || false, outro: getAddon(config, 'outro'), paths: config.paths || {}, plugins: await normalizePluginOption(config.plugins), preferConst, preserveModules, preserveModulesRoot: getPreserveModulesRoot(config), sanitizeFileName: typeof config.sanitizeFileName === 'function' ? config.sanitizeFileName : config.sanitizeFileName === false ? id => id : defaultSanitizeFileName, sourcemap: config.sourcemap || false, sourcemapBaseUrl: getSourcemapBaseUrl(config), sourcemapExcludeSources: config.sourcemapExcludeSources || false, sourcemapFile: config.sourcemapFile, sourcemapFileNames: getSourcemapFileNames(config, unsetOptions), sourcemapIgnoreList: typeof config.sourcemapIgnoreList === 'function' ? config.sourcemapIgnoreList : config.sourcemapIgnoreList === false ? () => false : relativeSourcePath => relativeSourcePath.includes('node_modules'), sourcemapPathTransform: config.sourcemapPathTransform as | SourcemapPathTransformOption | undefined, strict: config.strict ?? true, systemNullSetters: config.systemNullSetters ?? true, validate: config.validate || false }; warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onLog); return { options: outputOptions, unsetOptions }; } const getFile = ( config: OutputOptions, preserveModules: boolean, inputOptions: NormalizedInputOptions ): NormalizedOutputOptions['file'] => { const { file } = config; if (typeof file === 'string') { if (preserveModules) { return error( logInvalidOption( 'output.file', URL_OUTPUT_DIR, 'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option' ) ); } if (!Array.isArray(inputOptions.input)) return error( logInvalidOption( 'output.file', URL_OUTPUT_DIR, 'you must set "output.dir" instead of "output.file" when providing named inputs' ) ); } return file; }; const getFormat = (config: OutputOptions): NormalizedOutputOptions['format'] => { const configFormat = config.format; switch (configFormat) { case undefined: case 'es': case 'esm': case 'module': { return 'es'; } case 'cjs': case 'commonjs': { return 'cjs'; } case 'system': case 'systemjs': { return 'system'; } case 'amd': case 'iife': case 'umd': { return configFormat; } default: { return error( logInvalidOption( 'output.format', URL_OUTPUT_FORMAT, `Valid values are "amd", "cjs", "system", "es", "iife" or "umd"`, configFormat ) ); } } }; const getInlineDynamicImports = ( config: OutputOptions, inputOptions: NormalizedInputOptions ): NormalizedOutputOptions['inlineDynamicImports'] => { const inlineDynamicImports = (config.inlineDynamicImports ?? inputOptions.inlineDynamicImports) || false; const { input } = inputOptions; if (inlineDynamicImports && (Array.isArray(input) ? input : Object.keys(input)).length > 1) { return error( logInvalidOption( 'output.inlineDynamicImports', URL_OUTPUT_INLINEDYNAMICIMPORTS, 'multiple inputs are not supported when "output.inlineDynamicImports" is true' ) ); } return inlineDynamicImports; }; const getPreserveModules = ( config: OutputOptions, inlineDynamicImports: boolean, inputOptions: NormalizedInputOptions ): NormalizedOutputOptions['preserveModules'] => { const preserveModules = (config.preserveModules ?? inputOptions.preserveModules) || false; if (preserveModules) { if (inlineDynamicImports) { return error( logInvalidOption( 'output.inlineDynamicImports', URL_OUTPUT_INLINEDYNAMICIMPORTS, `this option is not supported for "output.preserveModules"` ) ); } if (inputOptions.preserveEntrySignatures === false) { return error( logInvalidOption( 'preserveEntrySignatures', URL_PRESERVEENTRYSIGNATURES, 'setting this option to false is not supported for "output.preserveModules"' ) ); } } return preserveModules; }; const getPreferConst = ( config: OutputOptions, inputOptions: NormalizedInputOptions ): NormalizedOutputOptions['preferConst'] => { const configPreferConst = config.preferConst; if (configPreferConst != null) { warnDeprecation( `The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS, true, inputOptions ); } return !!configPreferConst; }; const getPreserveModulesRoot = ( config: OutputOptions ): NormalizedOutputOptions['preserveModulesRoot'] => { const { preserveModulesRoot } = config; if (preserveModulesRoot === null || preserveModulesRoot === undefined) { return undefined; } return resolve(preserveModulesRoot); }; const getAmd = (config: OutputOptions): NormalizedOutputOptions['amd'] => { const mergedOption: { autoId: boolean; basePath: string; define: string; forceJsExtensionForImports: boolean; id?: string; } = { autoId: false, basePath: '', define: 'define', forceJsExtensionForImports: false, ...config.amd }; if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) { return error( logInvalidOption( 'output.amd.id', URL_OUTPUT_AMD_ID, 'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"' ) ); } if (mergedOption.basePath && !mergedOption.autoId) { return error( logInvalidOption( 'output.amd.basePath', URL_OUTPUT_AMD_BASEPATH, 'this option only works with "output.amd.autoId"' ) ); } return mergedOption.autoId ? { autoId: true, basePath: mergedOption.basePath, define: mergedOption.define, forceJsExtensionForImports: mergedOption.forceJsExtensionForImports } : { autoId: false, define: mergedOption.define, forceJsExtensionForImports: mergedOption.forceJsExtensionForImports, id: mergedOption.id }; }; const getAddon = ( config: OutputOptions, name: T ): NormalizedOutputOptions[T] => { const configAddon = config[name]; if (typeof configAddon === 'function') { return configAddon as NormalizedOutputOptions[T]; } return () => configAddon || ''; }; // eslint-disable-next-line unicorn/prevent-abbreviations const getDir = ( config: OutputOptions, file: string | undefined ): NormalizedOutputOptions['dir'] => { const { dir } = config; if (typeof dir === 'string' && typeof file === 'string') { return error( logInvalidOption( 'output.dir', URL_OUTPUT_DIR, 'you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks' ) ); } return dir; }; const getDynamicImportFunction = ( config: OutputOptions, inputOptions: NormalizedInputOptions, format: InternalModuleFormat ): NormalizedOutputOptions['dynamicImportFunction'] => { const configDynamicImportFunction = config.dynamicImportFunction; if (configDynamicImportFunction) { warnDeprecation( `The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, URL_RENDERDYNAMICIMPORT, true, inputOptions ); if (format !== 'es') { inputOptions.onLog( LOGLEVEL_WARN, logInvalidOption( 'output.dynamicImportFunction', URL_OUTPUT_DYNAMICIMPORTFUNCTION, 'this option is ignored for formats other than "es"' ) ); } } return configDynamicImportFunction; }; const getEntryFileNames = ( config: OutputOptions, unsetOptions: Set ): NormalizedOutputOptions['entryFileNames'] => { const configEntryFileNames = config.entryFileNames; if (configEntryFileNames == null) { unsetOptions.add('entryFileNames'); } return configEntryFileNames ?? '[name].js'; }; function getExperimentalDeepDynamicChunkOptimization( config: OutputOptions, inputOptions: NormalizedInputOptions ) { const configExperimentalDeepDynamicChunkOptimization = config.experimentalDeepDynamicChunkOptimization; if (configExperimentalDeepDynamicChunkOptimization != null) { warnDeprecation( `The "output.experimentalDeepDynamicChunkOptimization" option is deprecated as Rollup always runs the full chunking algorithm now. The option should be removed.`, URL_OUTPUT_EXPERIMENTALDEEPCHUNKOPTIMIZATION, true, inputOptions ); } return configExperimentalDeepDynamicChunkOptimization || false; } function getExports( config: OutputOptions, unsetOptions: Set ): NormalizedOutputOptions['exports'] { const configExports = config.exports; if (configExports == null) { unsetOptions.add('exports'); } else if (!['default', 'named', 'none', 'auto'].includes(configExports)) { return error(logInvalidExportOptionValue(configExports)); } return configExports || 'auto'; } const getGeneratedCode = ( config: OutputOptions, preferConst: boolean ): NormalizedOutputOptions['generatedCode'] => { const configWithPreset = getOptionWithPreset( config.generatedCode, generatedCodePresets, 'output.generatedCode', URL_OUTPUT_GENERATEDCODE, '' ); return { arrowFunctions: configWithPreset.arrowFunctions === true, constBindings: configWithPreset.constBindings === true || preferConst, objectShorthand: configWithPreset.objectShorthand === true, reservedNamesAsProps: configWithPreset.reservedNamesAsProps !== false, symbols: configWithPreset.symbols === true }; }; const getIndent = (config: OutputOptions, compact: boolean): NormalizedOutputOptions['indent'] => { if (compact) { return ''; } const configIndent = config.indent; return configIndent === false ? '' : configIndent ?? true; }; const ALLOWED_INTEROP_TYPES: ReadonlySet = new Set([ 'compat', 'auto', 'esModule', 'default', 'defaultOnly' ]); const getInterop = (config: OutputOptions): NormalizedOutputOptions['interop'] => { const configInterop = config.interop; if (typeof configInterop === 'function') { const interopPerId: { [id: string]: InteropType } = Object.create(null); let defaultInterop: InteropType | null = null; return id => id === null ? defaultInterop || validateInterop((defaultInterop = configInterop(id))) : id in interopPerId ? interopPerId[id] : validateInterop((interopPerId[id] = configInterop(id))); } return configInterop === undefined ? () => 'default' : () => validateInterop(configInterop); }; const validateInterop = (interop: InteropType): InteropType => { if (!ALLOWED_INTEROP_TYPES.has(interop)) { return error( logInvalidOption( 'output.interop', URL_OUTPUT_INTEROP, // eslint-disable-next-line unicorn/prefer-spread `use one of ${Array.from(ALLOWED_INTEROP_TYPES, value => JSON.stringify(value)).join( ', ' )}`, interop ) ); } return interop; }; const getManualChunks = ( config: OutputOptions, inlineDynamicImports: boolean, preserveModules: boolean, inputOptions: NormalizedInputOptions ): NormalizedOutputOptions['manualChunks'] => { const configManualChunks = config.manualChunks || inputOptions.manualChunks; if (configManualChunks) { if (inlineDynamicImports) { return error( logInvalidOption( 'output.manualChunks', URL_OUTPUT_MANUALCHUNKS, 'this option is not supported for "output.inlineDynamicImports"' ) ); } if (preserveModules) { return error( logInvalidOption( 'output.manualChunks', URL_OUTPUT_MANUALCHUNKS, 'this option is not supported for "output.preserveModules"' ) ); } } return configManualChunks || {}; }; const getMinifyInternalExports = ( config: OutputOptions, format: InternalModuleFormat, compact: boolean ): NormalizedOutputOptions['minifyInternalExports'] => config.minifyInternalExports ?? (compact || format === 'es' || format === 'system'); const getNamespaceToStringTag = ( config: OutputOptions, generatedCode: NormalizedOutputOptions['generatedCode'], inputOptions: NormalizedInputOptions ): NormalizedOutputOptions['namespaceToStringTag'] => { const configNamespaceToStringTag = config.namespaceToStringTag; if (configNamespaceToStringTag != null) { warnDeprecation( `The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, URL_OUTPUT_GENERATEDCODE_SYMBOLS, true, inputOptions ); return configNamespaceToStringTag; } return generatedCode.symbols || false; }; const getSourcemapFileNames = ( config: OutputOptions, unsetOptions: Set ): NormalizedOutputOptions['sourcemapFileNames'] => { const configSourcemapFileNames = config.sourcemapFileNames; if (configSourcemapFileNames == null) { unsetOptions.add('sourcemapFileNames'); } return configSourcemapFileNames; }; const getSourcemapBaseUrl = ( config: OutputOptions ): NormalizedOutputOptions['sourcemapBaseUrl'] => { const { sourcemapBaseUrl } = config; if (sourcemapBaseUrl) { if (isValidUrl(sourcemapBaseUrl)) { return addTrailingSlashIfMissed(sourcemapBaseUrl); } return error( logInvalidOption( 'output.sourcemapBaseUrl', URL_OUTPUT_SOURCEMAPBASEURL, `must be a valid URL, received ${JSON.stringify(sourcemapBaseUrl)}` ) ); } }; rollup-3.29.4/src/utils/options/options.ts000066400000000000000000000144231450520414700206210ustar00rootroot00000000000000import type { InputOptions, InputPluginOption, LogHandler, LogLevelOption, NormalizedGeneratedCodeOptions, NormalizedInputOptions, NormalizedOutputOptions, NormalizedTreeshakingOptions, OutputOptions, OutputPlugin, OutputPluginOption, Plugin, RollupLog, WarningHandlerWithDefault } from '../../rollup/types'; import { asyncFlatten } from '../asyncFlatten'; import { EMPTY_ARRAY } from '../blank'; import { LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_WARN, logLevelPriority } from '../logging'; import { error, logInvalidOption, logUnknownOption } from '../logs'; import { printQuotedStringList } from '../printStringList'; import relativeId from '../relativeId'; export interface GenericConfigObject { [key: string]: unknown; } export const getOnLog = ( config: InputOptions, logLevel: LogLevelOption, printLog = defaultPrintLog ): NormalizedInputOptions['onLog'] => { const { onwarn, onLog } = config; const defaultOnLog = getDefaultOnLog(printLog, onwarn); if (onLog) { const minimalPriority = logLevelPriority[logLevel]; return (level, log) => onLog(level, addLogToString(log), (level, handledLog) => { if (level === LOGLEVEL_ERROR) { return error(normalizeLog(handledLog)); } if (logLevelPriority[level] >= minimalPriority) { defaultOnLog(level, normalizeLog(handledLog)); } }); } return defaultOnLog; }; const getDefaultOnLog = (printLog: LogHandler, onwarn?: WarningHandlerWithDefault): LogHandler => onwarn ? (level, log) => { if (level === LOGLEVEL_WARN) { onwarn(addLogToString(log), warning => printLog(LOGLEVEL_WARN, normalizeLog(warning))); } else { printLog(level, log); } } : printLog; const addLogToString = (log: RollupLog): RollupLog => { Object.defineProperty(log, 'toString', { value: () => getExtendedLogMessage(log), writable: true }); return log; }; export const normalizeLog = (log: RollupLog | string | (() => RollupLog | string)): RollupLog => typeof log === 'string' ? { message: log } : typeof log === 'function' ? normalizeLog(log()) : log; const getExtendedLogMessage = (log: RollupLog): string => { let prefix = ''; if (log.plugin) { prefix += `(${log.plugin} plugin) `; } if (log.loc) { prefix += `${relativeId(log.loc.file!)} (${log.loc.line}:${log.loc.column}) `; } return prefix + log.message; }; const defaultPrintLog: LogHandler = (level, log) => { const message = getExtendedLogMessage(log); switch (level) { case LOGLEVEL_WARN: { return console.warn(message); } case LOGLEVEL_DEBUG: { return console.debug(message); } default: { return console.info(message); } } }; export function warnUnknownOptions( passedOptions: object, validOptions: readonly string[], optionType: string, log: LogHandler, ignoredKeys = /$./ ): void { const validOptionSet = new Set(validOptions); const unknownOptions = Object.keys(passedOptions).filter( key => !(validOptionSet.has(key) || ignoredKeys.test(key)) ); if (unknownOptions.length > 0) { log(LOGLEVEL_WARN, logUnknownOption(optionType, unknownOptions, [...validOptionSet].sort())); } } type ObjectValue = Base extends Record ? Base : never; export const treeshakePresets: { [key in NonNullable< ObjectValue['preset'] >]: NormalizedTreeshakingOptions; } = { recommended: { annotations: true, correctVarValueBeforeDeclaration: false, manualPureFunctions: EMPTY_ARRAY, moduleSideEffects: () => true, propertyReadSideEffects: true, tryCatchDeoptimization: true, unknownGlobalSideEffects: false }, safest: { annotations: true, correctVarValueBeforeDeclaration: true, manualPureFunctions: EMPTY_ARRAY, moduleSideEffects: () => true, propertyReadSideEffects: true, tryCatchDeoptimization: true, unknownGlobalSideEffects: true }, smallest: { annotations: true, correctVarValueBeforeDeclaration: false, manualPureFunctions: EMPTY_ARRAY, moduleSideEffects: () => false, propertyReadSideEffects: false, tryCatchDeoptimization: false, unknownGlobalSideEffects: false } }; export const generatedCodePresets: { [key in NonNullable< ObjectValue['preset'] >]: NormalizedOutputOptions['generatedCode']; } = { es2015: { arrowFunctions: true, constBindings: true, objectShorthand: true, reservedNamesAsProps: true, symbols: true }, es5: { arrowFunctions: false, constBindings: false, objectShorthand: false, reservedNamesAsProps: true, symbols: false } }; type ObjectOptionWithPresets = | Partial | Partial; export const objectifyOption = (value: unknown): Record => value && typeof value === 'object' ? (value as Record) : {}; export const objectifyOptionWithPresets = ( presets: Record, optionName: string, urlSnippet: string, additionalValues: string ) => (value: unknown): Record => { if (typeof value === 'string') { const preset = presets[value]; if (preset) { return preset; } error( logInvalidOption( optionName, urlSnippet, `valid values are ${additionalValues}${printQuotedStringList( Object.keys(presets) )}. You can also supply an object for more fine-grained control`, value ) ); } return objectifyOption(value); }; export const getOptionWithPreset = ( value: unknown, presets: Record, optionName: string, urlSnippet: string, additionalValues: string ): Record => { const presetName: string | undefined = (value as any)?.preset; if (presetName) { const preset = presets[presetName]; if (preset) { return { ...preset, ...(value as Record) }; } else { error( logInvalidOption( `${optionName}.preset`, urlSnippet, `valid values are ${printQuotedStringList(Object.keys(presets))}`, presetName ) ); } } return objectifyOptionWithPresets(presets, optionName, urlSnippet, additionalValues)(value); }; export const normalizePluginOption: { (plugins: InputPluginOption): Promise; (plugins: OutputPluginOption): Promise; (plugins: unknown): Promise; } = async (plugins: any) => (await asyncFlatten([plugins])).filter(Boolean); rollup-3.29.4/src/utils/outputBundle.ts000066400000000000000000000033051450520414700201220ustar00rootroot00000000000000import type { OutputAsset, OutputBundle, OutputChunk } from '../rollup/types'; export const lowercaseBundleKeys = Symbol('bundleKeys'); export const FILE_PLACEHOLDER = { type: 'placeholder' as const }; export interface OutputBundleWithPlaceholders { [fileName: string]: OutputAsset | OutputChunk | typeof FILE_PLACEHOLDER; [lowercaseBundleKeys]: Set; } export const getOutputBundle = (outputBundleBase: OutputBundle): OutputBundleWithPlaceholders => { const reservedLowercaseBundleKeys = new Set(); return new Proxy(outputBundleBase, { deleteProperty(target, key) { if (typeof key === 'string') { reservedLowercaseBundleKeys.delete(key.toLowerCase()); } return Reflect.deleteProperty(target, key); }, get(target, key) { if (key === lowercaseBundleKeys) { return reservedLowercaseBundleKeys; } return Reflect.get(target, key); }, set(target, key, value) { if (typeof key === 'string') { reservedLowercaseBundleKeys.add(key.toLowerCase()); } return Reflect.set(target, key, value); } }) as OutputBundleWithPlaceholders; }; export const removeUnreferencedAssets = (outputBundle: OutputBundleWithPlaceholders) => { const unreferencedAssets = new Set(); const bundleEntries = Object.values(outputBundle); for (const asset of bundleEntries) { asset.type === 'asset' && asset.needsCodeReference && unreferencedAssets.add(asset.fileName); } for (const chunk of bundleEntries) { if (chunk.type === 'chunk') { for (const referencedFile of chunk.referencedFiles) { unreferencedAssets.has(referencedFile) && unreferencedAssets.delete(referencedFile); } } } for (const file of unreferencedAssets) { delete outputBundle[file]; } }; rollup-3.29.4/src/utils/parseAssertions.ts000066400000000000000000000041411450520414700206140ustar00rootroot00000000000000import type Identifier from '../ast/nodes/Identifier'; import type ImportAttribute from '../ast/nodes/ImportAttribute'; import type ImportExpression from '../ast/nodes/ImportExpression'; import type { LiteralValue } from '../ast/nodes/Literal'; import type Literal from '../ast/nodes/Literal'; import type ObjectExpression from '../ast/nodes/ObjectExpression'; import type Property from '../ast/nodes/Property'; import type SpreadElement from '../ast/nodes/SpreadElement'; import { EMPTY_OBJECT } from './blank'; export function getAssertionsFromImportExpression(node: ImportExpression): Record { const assertProperty = node.arguments?.[0]?.properties.find( (property): property is Property => getPropertyKey(property) === 'assert' )?.value; if (!assertProperty) { return EMPTY_OBJECT; } const assertFields = (assertProperty as ObjectExpression).properties .map(property => { const key = getPropertyKey(property); if ( typeof key === 'string' && typeof ((property as Property).value as Literal).value === 'string' ) { return [key, ((property as Property).value as Literal).value] as [string, string]; } return null; }) .filter((property): property is [string, string] => !!property); if (assertFields.length > 0) { return Object.fromEntries(assertFields); } return EMPTY_OBJECT; } const getPropertyKey = ( property: Property | SpreadElement | ImportAttribute ): LiteralValue | undefined => { const key = (property as Property | ImportAttribute).key; return key && ((key as Identifier).name || (key as Literal).value); }; export function getAssertionsFromImportExportDeclaration( assertions: ImportAttribute[] | undefined ) { return assertions?.length ? Object.fromEntries( assertions.map(assertion => [getPropertyKey(assertion), assertion.value.value]) ) : EMPTY_OBJECT; } export function doAssertionsDiffer( assertionA: Record, assertionB: Record ): boolean { const keysA = Object.keys(assertionA); return ( keysA.length !== Object.keys(assertionB).length || keysA.some(key => assertionA[key] !== assertionB[key]) ); } rollup-3.29.4/src/utils/path.ts000066400000000000000000000007631450520414700163710ustar00rootroot00000000000000const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/; const RELATIVE_PATH_REGEX = /^\.?\.(\/|$)/; export function isAbsolute(path: string): boolean { return ABSOLUTE_PATH_REGEX.test(path); } export function isRelative(path: string): boolean { return RELATIVE_PATH_REGEX.test(path); } const BACKSLASH_REGEX = /\\/g; export function normalize(path: string): string { return path.replace(BACKSLASH_REGEX, '/'); } export { basename, dirname, extname, relative, resolve } from 'node:path'; rollup-3.29.4/src/utils/performance.ts000066400000000000000000000000721450520414700177270ustar00rootroot00000000000000export { performance as default } from 'node:perf_hooks'; rollup-3.29.4/src/utils/pluginUtils.ts000066400000000000000000000001741450520414700177500ustar00rootroot00000000000000export const ANONYMOUS_PLUGIN_PREFIX = 'at position '; export const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position '; rollup-3.29.4/src/utils/printStringList.ts000066400000000000000000000006351450520414700206120ustar00rootroot00000000000000export function printQuotedStringList( list: readonly string[], verbs?: readonly [string, string] ): string { const isSingleItem = list.length <= 1; const quotedList = list.map(item => `"${item}"`); let output = isSingleItem ? quotedList[0] : `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`; if (verbs) { output += ` ${isSingleItem ? verbs[0] : verbs[1]}`; } return output; } rollup-3.29.4/src/utils/process.ts000066400000000000000000000000501450520414700171000ustar00rootroot00000000000000export { default } from 'node:process'; rollup-3.29.4/src/utils/pureFunctions.ts000066400000000000000000000012771450520414700203020ustar00rootroot00000000000000import type { NormalizedInputOptions } from '../rollup/types'; export const PureFunctionKey = Symbol('PureFunction'); export interface PureFunctions { [pathSegment: string]: PureFunctions; [PureFunctionKey]?: boolean; } export const getPureFunctions = ({ treeshake }: NormalizedInputOptions): PureFunctions => { const pureFunctions: PureFunctions = Object.create(null); for (const functionName of treeshake ? treeshake.manualPureFunctions : []) { let currentFunctions = pureFunctions; for (const pathSegment of functionName.split('.')) { currentFunctions = currentFunctions[pathSegment] ||= Object.create(null); } currentFunctions[PureFunctionKey] = true; } return pureFunctions; }; rollup-3.29.4/src/utils/reassignedExportsMember.ts000066400000000000000000000004711450520414700222720ustar00rootroot00000000000000import type Variable from '../ast/variables/Variable'; export function isReassignedExportsMember( variable: Variable, exportNamesByVariable: ReadonlyMap ): boolean { return ( variable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned ); } rollup-3.29.4/src/utils/relativeId.ts000066400000000000000000000026131450520414700175210ustar00rootroot00000000000000import { relative } from '../../browser/src/path'; import { basename, dirname, extname, isAbsolute, normalize, resolve } from './path'; export function getAliasName(id: string): string { const base = basename(id); return base.slice(0, Math.max(0, base.length - extname(id).length)); } export default function relativeId(id: string): string { if (!isAbsolute(id)) return id; return relative(resolve(), id); } export function isPathFragment(name: string): boolean { // starting with "/", "./", "../", "C:/" return ( name[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name) ); } const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/; export function getImportPath( importerId: string, targetPath: string, stripJsExtension: boolean, ensureFileName: boolean ): string { while (targetPath.startsWith('../')) { targetPath = targetPath.slice(3); importerId = '_/' + importerId; } let relativePath = normalize(relative(dirname(importerId), targetPath)); if (stripJsExtension && relativePath.endsWith('.js')) { relativePath = relativePath.slice(0, -3); } if (ensureFileName) { if (relativePath === '') return '../' + basename(targetPath); if (UPPER_DIR_REGEX.test(relativePath)) { return [...relativePath.split('/'), '..', basename(targetPath)].join('/'); } } return relativePath ? (relativePath.startsWith('..') ? relativePath : './' + relativePath) : '.'; } rollup-3.29.4/src/utils/renderCallArguments.ts000066400000000000000000000023371450520414700213750ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type CallExpression from '../ast/nodes/CallExpression'; import type NewExpression from '../ast/nodes/NewExpression'; import type { RenderOptions } from './renderHelpers'; import { findFirstOccurrenceOutsideComment } from './renderHelpers'; export function renderCallArguments( code: MagicString, options: RenderOptions, node: CallExpression | NewExpression ): void { if (node.arguments.length > 0) { if (node.arguments[node.arguments.length - 1].included) { for (const argument of node.arguments) { argument.render(code, options); } } else { let lastIncludedIndex = node.arguments.length - 2; while (lastIncludedIndex >= 0 && !node.arguments[lastIncludedIndex].included) { lastIncludedIndex--; } if (lastIncludedIndex >= 0) { for (let index = 0; index <= lastIncludedIndex; index++) { node.arguments[index].render(code, options); } code.remove( findFirstOccurrenceOutsideComment( code.original, ',', node.arguments[lastIncludedIndex].end ), node.end - 1 ); } else { code.remove( findFirstOccurrenceOutsideComment(code.original, '(', node.callee.end) + 1, node.end - 1 ); } } } } rollup-3.29.4/src/utils/renderChunks.ts000066400000000000000000000272631450520414700200740ustar00rootroot00000000000000import type { Bundle as MagicStringBundle, SourceMap } from 'magic-string'; import type { default as Chunk, ChunkRenderResult } from '../Chunk'; import type Module from '../Module'; import type { DecodedSourceMapOrMissing, LogHandler, NormalizedOutputOptions, RenderedChunk } from '../rollup/types'; import type { PluginDriver } from './PluginDriver'; import { collapseSourcemaps } from './collapseSourcemaps'; import { createHash } from './crypto'; import { decodedSourcemap } from './decodedSourcemap'; import { replacePlaceholders, replacePlaceholdersWithDefaultAndGetContainedPlaceholders, replaceSinglePlaceholder } from './hashPlaceholders'; import { error, logFailedValidation } from './logs'; import type { OutputBundleWithPlaceholders } from './outputBundle'; import { FILE_PLACEHOLDER, lowercaseBundleKeys } from './outputBundle'; import { basename, normalize, resolve } from './path'; import { SOURCEMAPPING_URL } from './sourceMappingURL'; import { timeEnd, timeStart } from './timers'; interface HashResult { containedPlaceholders: Set; contentHash: string; } interface RenderedChunkWithPlaceholders { chunk: Chunk; code: string; fileName: string; sourcemapFileName: string | null; map: SourceMap | null; } export async function renderChunks( chunks: Chunk[], bundle: OutputBundleWithPlaceholders, pluginDriver: PluginDriver, outputOptions: NormalizedOutputOptions, log: LogHandler ) { timeStart('render chunks', 2); reserveEntryChunksInBundle(chunks); const renderedChunks = await Promise.all(chunks.map(chunk => chunk.render())); timeEnd('render chunks', 2); timeStart('transform chunks', 2); const chunkGraph = getChunkGraph(chunks); const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes( renderedChunks, chunkGraph, outputOptions, pluginDriver, log ); const hashesByPlaceholder = generateFinalHashes( renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle ); addChunksToBundle( renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions ); timeEnd('transform chunks', 2); } function reserveEntryChunksInBundle(chunks: Chunk[]) { for (const chunk of chunks) { if (chunk.facadeModule && chunk.facadeModule.isUserDefinedEntryPoint) { // reserves name in bundle as side effect if it does not contain a hash chunk.getPreliminaryFileName(); } } } function getChunkGraph(chunks: Chunk[]) { return Object.fromEntries( chunks.map(chunk => { const renderedChunkInfo = chunk.getRenderedChunkInfo(); return [renderedChunkInfo.fileName, renderedChunkInfo]; }) ); } async function transformChunk( magicString: MagicStringBundle, fileName: string, usedModules: Module[], chunkGraph: Record, options: NormalizedOutputOptions, outputPluginDriver: PluginDriver, log: LogHandler ) { let map: SourceMap | null = null; const sourcemapChain: DecodedSourceMapOrMissing[] = []; let code = await outputPluginDriver.hookReduceArg0( 'renderChunk', [magicString.toString(), chunkGraph[fileName], options, { chunks: chunkGraph }], (code, result, plugin) => { if (result == null) return code; if (typeof result === 'string') result = { code: result, map: undefined }; // strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning if (result.map !== null) { const map = decodedSourcemap(result.map); sourcemapChain.push(map || { missing: true, plugin: plugin.name }); } return result.code; } ); const { compact, dir, file, sourcemap, sourcemapExcludeSources, sourcemapFile, sourcemapPathTransform, sourcemapIgnoreList } = options; if (!compact && code[code.length - 1] !== '\n') code += '\n'; if (sourcemap) { timeStart('sourcemaps', 3); let resultingFile: string; if (file) resultingFile = resolve(sourcemapFile || file); else if (dir) resultingFile = resolve(dir, fileName); else resultingFile = resolve(fileName); const decodedMap = magicString.generateDecodedMap({}); map = collapseSourcemaps( resultingFile, decodedMap, usedModules, sourcemapChain, sourcemapExcludeSources, log ); for (let sourcesIndex = 0; sourcesIndex < map.sources.length; ++sourcesIndex) { let sourcePath = map.sources[sourcesIndex]; const sourcemapPath = `${resultingFile}.map`; const ignoreList = sourcemapIgnoreList(sourcePath, sourcemapPath); if (typeof ignoreList !== 'boolean') { error(logFailedValidation('sourcemapIgnoreList function must return a boolean.')); } if (ignoreList) { if (map.x_google_ignoreList === undefined) { map.x_google_ignoreList = []; } if (!map.x_google_ignoreList.includes(sourcesIndex)) { map.x_google_ignoreList.push(sourcesIndex); } } if (sourcemapPathTransform) { sourcePath = sourcemapPathTransform(sourcePath, sourcemapPath); if (typeof sourcePath !== 'string') { error(logFailedValidation(`sourcemapPathTransform function must return a string.`)); } } map.sources[sourcesIndex] = normalize(sourcePath); } timeEnd('sourcemaps', 3); } return { code, map }; } async function transformChunksAndGenerateContentHashes( renderedChunks: ChunkRenderResult[], chunkGraph: Record, outputOptions: NormalizedOutputOptions, pluginDriver: PluginDriver, log: LogHandler ) { const nonHashedChunksWithPlaceholders: RenderedChunkWithPlaceholders[] = []; const renderedChunksByPlaceholder = new Map(); const hashDependenciesByPlaceholder = new Map(); const initialHashesByPlaceholder = new Map(); const placeholders = new Set(); for (const { preliminaryFileName: { hashPlaceholder } } of renderedChunks) { if (hashPlaceholder) placeholders.add(hashPlaceholder); } await Promise.all( renderedChunks.map( async ({ chunk, preliminaryFileName: { fileName, hashPlaceholder }, preliminarySourcemapFileName, magicString, usedModules }) => { const transformedChunk: RenderedChunkWithPlaceholders = { chunk, fileName, sourcemapFileName: preliminarySourcemapFileName?.fileName ?? null, ...(await transformChunk( magicString, fileName, usedModules, chunkGraph, outputOptions, pluginDriver, log )) }; const { code, map } = transformedChunk; if (hashPlaceholder) { // To create a reproducible content-only hash, all placeholders are // replaced with the same value before hashing const { containedPlaceholders, transformedCode } = replacePlaceholdersWithDefaultAndGetContainedPlaceholders(code, placeholders); const hash = createHash().update(transformedCode); const hashAugmentation = pluginDriver.hookReduceValueSync( 'augmentChunkHash', '', [chunk.getRenderedChunkInfo()], (augmentation, pluginHash) => { if (pluginHash) { augmentation += pluginHash; } return augmentation; } ); if (hashAugmentation) { hash.update(hashAugmentation); } renderedChunksByPlaceholder.set(hashPlaceholder, transformedChunk); hashDependenciesByPlaceholder.set(hashPlaceholder, { containedPlaceholders, contentHash: hash.digest('hex') }); } else { nonHashedChunksWithPlaceholders.push(transformedChunk); } const sourcemapHashPlaceholder = preliminarySourcemapFileName?.hashPlaceholder; if (map && sourcemapHashPlaceholder) { initialHashesByPlaceholder.set( preliminarySourcemapFileName.hashPlaceholder, createHash() .update(map.toString()) .digest('hex') .slice(0, preliminarySourcemapFileName.hashPlaceholder.length) ); } } ) ); return { hashDependenciesByPlaceholder, initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder }; } function generateFinalHashes( renderedChunksByPlaceholder: Map, hashDependenciesByPlaceholder: Map, initialHashesByPlaceholder: Map, bundle: OutputBundleWithPlaceholders ) { const hashesByPlaceholder = new Map(initialHashesByPlaceholder); for (const [placeholder, { fileName }] of renderedChunksByPlaceholder) { let hash = createHash(); const hashDependencyPlaceholders = new Set([placeholder]); for (const dependencyPlaceholder of hashDependencyPlaceholders) { const { containedPlaceholders, contentHash } = hashDependenciesByPlaceholder.get(dependencyPlaceholder)!; hash.update(contentHash); for (const containedPlaceholder of containedPlaceholders) { // When looping over a map, setting an entry only causes a new iteration if the key is new hashDependencyPlaceholders.add(containedPlaceholder); } } let finalFileName: string | undefined; let finalHash: string | undefined; do { // In case of a hash collision, create a hash of the hash if (finalHash) { hash = createHash().update(finalHash); } finalHash = hash.digest('hex').slice(0, placeholder.length); finalFileName = replaceSinglePlaceholder(fileName, placeholder, finalHash); } while (bundle[lowercaseBundleKeys].has(finalFileName.toLowerCase())); bundle[finalFileName] = FILE_PLACEHOLDER; hashesByPlaceholder.set(placeholder, finalHash); } return hashesByPlaceholder; } function addChunksToBundle( renderedChunksByPlaceholder: Map, hashesByPlaceholder: Map, bundle: OutputBundleWithPlaceholders, nonHashedChunksWithPlaceholders: RenderedChunkWithPlaceholders[], pluginDriver: PluginDriver, options: NormalizedOutputOptions ) { for (const { chunk, code, fileName, sourcemapFileName, map } of renderedChunksByPlaceholder.values()) { let updatedCode = replacePlaceholders(code, hashesByPlaceholder); const finalFileName = replacePlaceholders(fileName, hashesByPlaceholder); let finalSourcemapFileName = null; if (map) { finalSourcemapFileName = sourcemapFileName ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder) : `${finalFileName}.map`; map.file = replacePlaceholders(map.file, hashesByPlaceholder); updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options); } bundle[finalFileName] = chunk.finalizeChunk( updatedCode, map, finalSourcemapFileName, hashesByPlaceholder ); } for (const { chunk, code, fileName, sourcemapFileName, map } of nonHashedChunksWithPlaceholders) { let updatedCode = hashesByPlaceholder.size > 0 ? replacePlaceholders(code, hashesByPlaceholder) : code; let finalSourcemapFileName = null; if (map) { finalSourcemapFileName = sourcemapFileName ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder) : `${fileName}.map`; updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options); } bundle[fileName] = chunk.finalizeChunk( updatedCode, map, finalSourcemapFileName, hashesByPlaceholder ); } } function emitSourceMapAndGetComment( fileName: string, map: SourceMap, pluginDriver: PluginDriver, { sourcemap, sourcemapBaseUrl }: NormalizedOutputOptions ) { let url: string; if (sourcemap === 'inline') { url = map.toUrl(); } else { const sourcemapFileName = basename(fileName); url = sourcemapBaseUrl ? new URL(sourcemapFileName, sourcemapBaseUrl).toString() : sourcemapFileName; pluginDriver.emitFile({ fileName, source: map.toString(), type: 'asset' }); } return sourcemap === 'hidden' ? '' : `//# ${SOURCEMAPPING_URL}=${url}\n`; } rollup-3.29.4/src/utils/renderHelpers.ts000066400000000000000000000140551450520414700202360ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type { Node, StatementNode } from '../ast/nodes/shared/Node'; import type Variable from '../ast/variables/Variable'; import type { InternalModuleFormat } from '../rollup/types'; import type { PluginDriver } from './PluginDriver'; import type { GenerateCodeSnippets } from './generateCodeSnippets'; import { treeshakeNode } from './treeshakeNode'; export interface RenderOptions { accessedDocumentCurrentScript: boolean; dynamicImportFunction: string | undefined; exportNamesByVariable: Map; format: InternalModuleFormat; freeze: boolean; indent: string; namespaceToStringTag: boolean; pluginDriver: PluginDriver; snippets: GenerateCodeSnippets; useOriginalName: ((variable: Variable) => boolean) | null; } export interface NodeRenderOptions { end?: number; isCalleeOfRenderedParent?: boolean; isNoStatement?: boolean; isShorthandProperty?: boolean; preventASI?: boolean; /* Indicates if the direct parent of an element changed. Necessary for determining the "this" context of callees. */ renderedParentType?: string; /* Indicates if the parent or ancestor surrounding an element has changed and what it changed to. Necessary for adding parentheses. */ renderedSurroundingElement?: string; start?: number; } export const NO_SEMICOLON: NodeRenderOptions = { isNoStatement: true }; // This assumes there are only white-space and comments between start and the string we are looking for export function findFirstOccurrenceOutsideComment( code: string, searchString: string, start = 0 ): number { let searchPos: number, charCodeAfterSlash: number; searchPos = code.indexOf(searchString, start); while (true) { start = code.indexOf('/', start); if (start === -1 || start >= searchPos) return searchPos; charCodeAfterSlash = code.charCodeAt(++start); ++start; // With our assumption, '/' always starts a comment. Determine comment type: start = charCodeAfterSlash === 47 /*"/"*/ ? code.indexOf('\n', start) + 1 : code.indexOf('*/', start) + 2; if (start > searchPos) { searchPos = code.indexOf(searchString, start); } } } const NON_WHITESPACE = /\S/g; export function findNonWhiteSpace(code: string, index: number): number { NON_WHITESPACE.lastIndex = index; const result = NON_WHITESPACE.exec(code)!; return result.index; } // This assumes "code" only contains white-space and comments // Returns position of line-comment if applicable export function findFirstLineBreakOutsideComment(code: string): [number, number] { let lineBreakPos, charCodeAfterSlash, start = 0; lineBreakPos = code.indexOf('\n', start); while (true) { start = code.indexOf('/', start); if (start === -1 || start > lineBreakPos) return [lineBreakPos, lineBreakPos + 1]; // With our assumption, '/' always starts a comment. Determine comment type: charCodeAfterSlash = code.charCodeAt(start + 1); if (charCodeAfterSlash === 47 /*"/"*/) return [start, lineBreakPos + 1]; start = code.indexOf('*/', start + 3) + 2; if (start > lineBreakPos) { lineBreakPos = code.indexOf('\n', start); } } } export function renderStatementList( statements: readonly StatementNode[], code: MagicString, start: number, end: number, options: RenderOptions ): void { let currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart; let nextNode = statements[0]; let nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries; if (nextNodeNeedsBoundaries) { nextNodeStart = start + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1]; } for (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) { currentNode = nextNode; currentNodeStart = nextNodeStart; currentNodeNeedsBoundaries = nextNodeNeedsBoundaries; nextNode = statements[nextIndex]; nextNodeNeedsBoundaries = nextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries; if (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) { nextNodeStart = currentNode.end + findFirstLineBreakOutsideComment( code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start) )[1]; if (currentNode.included) { currentNodeNeedsBoundaries ? currentNode.render(code, options, { end: nextNodeStart, start: currentNodeStart }) : currentNode.render(code, options); } else { treeshakeNode(currentNode, code, currentNodeStart!, nextNodeStart); } } else { currentNode.render(code, options); } } } // This assumes that the first character is not part of the first node export function getCommaSeparatedNodesWithBoundaries( nodes: readonly N[], code: MagicString, start: number, end: number ): { contentEnd: number; end: number; node: N; separator: number | null; start: number; }[] { const splitUpNodes = []; let node, nextNodeStart, contentEnd, char; let separator = start - 1; for (const nextNode of nodes) { if (node !== undefined) { separator = node.end + findFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ','); } nextNodeStart = contentEnd = separator + 1 + findFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1]; while ( ((char = code.original.charCodeAt(nextNodeStart)), char === 32 /*" "*/ || char === 9 /*"\t"*/ || char === 10 /*"\n"*/ || char === 13) /*"\r"*/ ) nextNodeStart++; if (node !== undefined) { splitUpNodes.push({ contentEnd, end: nextNodeStart, node, separator, start }); } node = nextNode; start = nextNodeStart; } splitUpNodes.push({ contentEnd: end, end, node: node as N, separator: null, start }); return splitUpNodes; } // This assumes there are only white-space and comments between start and end export function removeLineBreaks(code: MagicString, start: number, end: number): void { while (true) { const [removeStart, removeEnd] = findFirstLineBreakOutsideComment( code.original.slice(start, end) ); if (removeStart === -1) { break; } code.remove(start + removeStart, (start += removeEnd)); } } rollup-3.29.4/src/utils/renderNamePattern.ts000066400000000000000000000035651450520414700210560ustar00rootroot00000000000000import { error, logFailedValidation } from './logs'; import type { OutputBundleWithPlaceholders } from './outputBundle'; import { lowercaseBundleKeys } from './outputBundle'; import { extname } from './path'; import { isPathFragment } from './relativeId'; export function renderNamePattern( pattern: string, patternName: string, replacements: { [name: string]: (size?: number) => string } ): string { if (isPathFragment(pattern)) return error( logFailedValidation( `Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.` ) ); return pattern.replace( /\[(\w+)(:\d+)?]/g, (_match, type: string, size: `:${string}` | undefined) => { if (!replacements.hasOwnProperty(type) || (size && type !== 'hash')) { return error( logFailedValidation( `"[${type}${size || ''}]" is not a valid placeholder in the "${patternName}" pattern.` ) ); } const replacement = replacements[type](size && Number.parseInt(size.slice(1))); if (isPathFragment(replacement)) return error( logFailedValidation( `Invalid substitution "${replacement}" for placeholder "[${type}]" in "${patternName}" pattern, can be neither absolute nor relative path.` ) ); return replacement; } ); } export function makeUnique( name: string, { [lowercaseBundleKeys]: reservedLowercaseBundleKeys }: OutputBundleWithPlaceholders ): string { if (!reservedLowercaseBundleKeys.has(name.toLowerCase())) return name; const extension = extname(name); name = name.slice(0, Math.max(0, name.length - extension.length)); let uniqueName: string, uniqueIndex = 1; while ( reservedLowercaseBundleKeys.has((uniqueName = name + ++uniqueIndex + extension).toLowerCase()) ); return uniqueName; } rollup-3.29.4/src/utils/resolveId.ts000066400000000000000000000052331450520414700173660ustar00rootroot00000000000000import type { ModuleLoaderResolveId } from '../ModuleLoader'; import type { CustomPluginOptions, Plugin, ResolveIdResult } from '../rollup/types'; import type { PluginDriver } from './PluginDriver'; import { lstat, readdir, realpath } from './fs'; import { basename, dirname, isAbsolute, resolve } from './path'; import { resolveIdViaPlugins } from './resolveIdViaPlugins'; export async function resolveId( source: string, importer: string | undefined, preserveSymlinks: boolean, pluginDriver: PluginDriver, moduleLoaderResolveId: ModuleLoaderResolveId, skip: readonly { importer: string | undefined; plugin: Plugin; source: string }[] | null, customOptions: CustomPluginOptions | undefined, isEntry: boolean, assertions: Record ): Promise { const pluginResult = await resolveIdViaPlugins( source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, assertions ); if (pluginResult != null) { const [resolveIdResult, plugin] = pluginResult; if (typeof resolveIdResult === 'object' && !resolveIdResult.resolvedBy) { return { ...resolveIdResult, resolvedBy: plugin.name }; } if (typeof resolveIdResult === 'string') { return { id: resolveIdResult, resolvedBy: plugin.name }; } return resolveIdResult; } // external modules (non-entry modules that start with neither '.' or '/') // are skipped at this stage. if (importer !== undefined && !isAbsolute(source) && source[0] !== '.') return null; // `resolve` processes paths from right to left, prepending them until an // absolute path is created. Absolute importees therefore shortcircuit the // resolve call and require no special handing on our part. // See https://nodejs.org/api/path.html#path_path_resolve_paths return addJsExtensionIfNecessary( importer ? resolve(dirname(importer), source) : resolve(source), preserveSymlinks ); } async function addJsExtensionIfNecessary( file: string, preserveSymlinks: boolean ): Promise { return ( (await findFile(file, preserveSymlinks)) ?? (await findFile(file + '.mjs', preserveSymlinks)) ?? (await findFile(file + '.js', preserveSymlinks)) ); } async function findFile(file: string, preserveSymlinks: boolean): Promise { try { const stats = await lstat(file); if (!preserveSymlinks && stats.isSymbolicLink()) return await findFile(await realpath(file), preserveSymlinks); if ((preserveSymlinks && stats.isSymbolicLink()) || stats.isFile()) { // check case const name = basename(file); const files = await readdir(dirname(file)); if (files.includes(name)) return file; } } catch { // suppress } } rollup-3.29.4/src/utils/resolveIdViaPlugins.ts000066400000000000000000000027431450520414700213730ustar00rootroot00000000000000import type { ModuleLoaderResolveId } from '../ModuleLoader'; import type { CustomPluginOptions, Plugin, PluginContext, ResolveIdResult } from '../rollup/types'; import type { PluginDriver, ReplaceContext } from './PluginDriver'; import { BLANK, EMPTY_OBJECT } from './blank'; export function resolveIdViaPlugins( source: string, importer: string | undefined, pluginDriver: PluginDriver, moduleLoaderResolveId: ModuleLoaderResolveId, skip: readonly { importer: string | undefined; plugin: Plugin; source: string }[] | null, customOptions: CustomPluginOptions | undefined, isEntry: boolean, assertions: Record ): Promise<[NonNullable, Plugin] | null> { let skipped: Set | null = null; let replaceContext: ReplaceContext | null = null; if (skip) { skipped = new Set(); for (const skippedCall of skip) { if (source === skippedCall.source && importer === skippedCall.importer) { skipped.add(skippedCall.plugin); } } replaceContext = (pluginContext, plugin): PluginContext => ({ ...pluginContext, resolve: (source, importer, { assertions, custom, isEntry, skipSelf } = BLANK) => moduleLoaderResolveId( source, importer, custom, isEntry, assertions || EMPTY_OBJECT, skipSelf ? [...skip, { importer, plugin, source }] : skip ) }); } return pluginDriver.hookFirstAndGetPlugin( 'resolveId', [source, importer, { assertions, custom: customOptions, isEntry }], replaceContext, skipped ); } rollup-3.29.4/src/utils/safeName.ts000066400000000000000000000006761450520414700171570ustar00rootroot00000000000000import RESERVED_NAMES from './RESERVED_NAMES'; import { toBase64 } from './base64'; export function getSafeName( baseName: string, usedNames: Set, forbiddenNames: Set | null ): string { let safeName = baseName; let count = 1; while (usedNames.has(safeName) || RESERVED_NAMES.has(safeName) || forbiddenNames?.has(safeName)) { safeName = `${baseName}$${toBase64(count++)}`; } usedNames.add(safeName); return safeName; } rollup-3.29.4/src/utils/sanitizeFileName.ts000066400000000000000000000011271450520414700206570ustar00rootroot00000000000000// https://datatracker.ietf.org/doc/html/rfc2396 // eslint-disable-next-line no-control-regex const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g; const DRIVE_LETTER_REGEX = /^[a-z]:/i; export function sanitizeFileName(name: string): string { const match = DRIVE_LETTER_REGEX.exec(name); const driveLetter = match ? match[0] : ''; // A `:` is only allowed as part of a windows drive letter (ex: C:\foo) // Otherwise, avoid them because they can refer to NTFS alternate data streams. return driveLetter + name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, '_'); } rollup-3.29.4/src/utils/sourceMappingURL.ts000066400000000000000000000006331450520414700206300ustar00rootroot00000000000000// this looks ridiculous, but it prevents sourcemap tooling from mistaking // this for an actual sourceMappingURL export let SOURCEMAPPING_URL = 'sourceMa'; SOURCEMAPPING_URL += 'ppingURL'; const whiteSpaceNoNewline = '[ \\f\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]'; export const SOURCEMAPPING_URL_RE = new RegExp(`^#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+`); rollup-3.29.4/src/utils/systemJsRendering.ts000066400000000000000000000055701450520414700211150ustar00rootroot00000000000000import type MagicString from 'magic-string'; import type Variable from '../ast/variables/Variable'; import type { RenderOptions } from './renderHelpers'; export function getSystemExportStatement( exportedVariables: readonly Variable[], { exportNamesByVariable, snippets: { _, getObject, getPropertyAccess } }: RenderOptions, modifier = '' ): string { if ( exportedVariables.length === 1 && exportNamesByVariable.get(exportedVariables[0])!.length === 1 ) { const variable = exportedVariables[0]; return `exports('${exportNamesByVariable.get(variable)}',${_}${variable.getName( getPropertyAccess )}${modifier})`; } else { const fields: [key: string, value: string][] = []; for (const variable of exportedVariables) { for (const exportName of exportNamesByVariable.get(variable)!) { fields.push([exportName, variable.getName(getPropertyAccess) + modifier]); } } return `exports(${getObject(fields, { lineBreakIndent: null })})`; } } export function renderSystemExportExpression( exportedVariable: Variable, expressionStart: number, expressionEnd: number, code: MagicString, { exportNamesByVariable, snippets: { _ } }: RenderOptions ): void { code.prependRight( expressionStart, `exports('${exportNamesByVariable.get(exportedVariable)}',${_}` ); code.appendLeft(expressionEnd, ')'); } export function renderSystemExportFunction( exportedVariables: readonly Variable[], expressionStart: number, expressionEnd: number, needsParens: boolean | undefined, code: MagicString, options: RenderOptions ): void { const { _, getDirectReturnIifeLeft } = options.snippets; code.prependRight( expressionStart, getDirectReturnIifeLeft( ['v'], `${getSystemExportStatement(exportedVariables, options)},${_}v`, { needsArrowReturnParens: true, needsWrappedFunction: needsParens } ) ); code.appendLeft(expressionEnd, ')'); } export function renderSystemExportSequenceAfterExpression( exportedVariable: Variable, expressionStart: number, expressionEnd: number, needsParens: boolean | undefined, code: MagicString, options: RenderOptions ): void { const { _, getPropertyAccess } = options.snippets; code.appendLeft( expressionEnd, `,${_}${getSystemExportStatement([exportedVariable], options)},${_}${exportedVariable.getName( getPropertyAccess )}` ); if (needsParens) { code.prependRight(expressionStart, '('); code.appendLeft(expressionEnd, ')'); } } export function renderSystemExportSequenceBeforeExpression( exportedVariable: Variable, expressionStart: number, expressionEnd: number, needsParens: boolean | undefined, code: MagicString, options: RenderOptions, modifier: string ): void { const { _ } = options.snippets; code.prependRight( expressionStart, `${getSystemExportStatement([exportedVariable], options, modifier)},${_}` ); if (needsParens) { code.prependRight(expressionStart, '('); code.appendLeft(expressionEnd, ')'); } } rollup-3.29.4/src/utils/timers.ts000066400000000000000000000064701450520414700167410ustar00rootroot00000000000000import type { NormalizedInputOptions, Plugin, PluginHooks, SerializedTimings } from '../rollup/types'; import { doNothing } from './doNothing'; import performance from './performance'; import process from './process'; interface Timer { memory: number; startMemory: number; startTime: number; time: number; totalMemory: number; } let timers = new Map(); function getPersistedLabel(label: string, level: number): string { switch (level) { case 1: { return `# ${label}`; } case 2: { return `## ${label}`; } case 3: { return label; } default: { return `${' '.repeat(level - 4)}- ${label}`; } } } function timeStartImpl(label: string, level = 3): void { label = getPersistedLabel(label, level); const startMemory = process.memoryUsage().heapUsed; const startTime = performance.now(); const timer = timers.get(label); if (timer === undefined) { timers.set(label, { memory: 0, startMemory, startTime, time: 0, totalMemory: 0 }); } else { timer.startMemory = startMemory; timer.startTime = startTime; } } function timeEndImpl(label: string, level = 3): void { label = getPersistedLabel(label, level); const timer = timers.get(label); if (timer !== undefined) { const currentMemory = process.memoryUsage().heapUsed; timer.memory += currentMemory - timer.startMemory; timer.time += performance.now() - timer.startTime; timer.totalMemory = Math.max(timer.totalMemory, currentMemory); } } export function getTimings(): SerializedTimings { const newTimings: SerializedTimings = {}; for (const [label, { memory, time, totalMemory }] of timers) { newTimings[label] = [time, memory, totalMemory]; } return newTimings; } export let timeStart: (label: string, level?: number) => void = doNothing; export let timeEnd: (label: string, level?: number) => void = doNothing; const TIMED_PLUGIN_HOOKS: readonly (keyof PluginHooks)[] = [ 'augmentChunkHash', 'buildEnd', 'buildStart', 'generateBundle', 'load', 'moduleParsed', 'options', 'outputOptions', 'renderChunk', 'renderDynamicImport', 'renderStart', 'resolveDynamicImport', 'resolveFileUrl', 'resolveId', 'resolveImportMeta', 'shouldTransformCachedModule', 'transform', 'writeBundle' ]; function getPluginWithTimers(plugin: any, index: number): Plugin { if (plugin._hasTimer) return plugin; plugin._hasTimer = true; for (const hook of TIMED_PLUGIN_HOOKS) { if (hook in plugin) { let timerLabel = `plugin ${index}`; if (plugin.name) { timerLabel += ` (${plugin.name})`; } timerLabel += ` - ${hook}`; const handler = function (this: any, ...parameters: readonly unknown[]) { timeStart(timerLabel, 4); const result = hookFunction.apply(this, parameters); timeEnd(timerLabel, 4); return result; }; let hookFunction: any; if (typeof plugin[hook].handler === 'function') { hookFunction = plugin[hook].handler; plugin[hook].handler = handler; } else { hookFunction = plugin[hook]; plugin[hook] = handler; } } } return plugin; } export function initialiseTimers(inputOptions: NormalizedInputOptions): void { if (inputOptions.perf) { timers = new Map(); timeStart = timeStartImpl; timeEnd = timeEndImpl; inputOptions.plugins = inputOptions.plugins!.map(getPluginWithTimers); } else { timeStart = doNothing; timeEnd = doNothing; } } rollup-3.29.4/src/utils/transform.ts000066400000000000000000000116231450520414700174450ustar00rootroot00000000000000import MagicString, { SourceMap } from 'magic-string'; import type Module from '../Module'; import type { DecodedSourceMapOrMissing, EmittedFile, ExistingRawSourceMap, LoggingFunctionWithPosition, LogHandler, Plugin, PluginContext, RollupError, SourceDescription, TransformModuleJSON, TransformPluginContext, TransformResult } from '../rollup/types'; import { getTrackedPluginCache } from './PluginCache'; import type { PluginDriver } from './PluginDriver'; import { collapseSourcemap } from './collapseSourcemaps'; import { decodedSourcemap } from './decodedSourcemap'; import { LOGLEVEL_WARN } from './logging'; import { augmentCodeLocation, error, logInvalidSetAssetSourceCall, logNoTransformMapOrAstWithoutCode, logPluginError } from './logs'; import { normalizeLog } from './options/options'; export default async function transform( source: SourceDescription, module: Module, pluginDriver: PluginDriver, log: LogHandler ): Promise { const id = module.id; const sourcemapChain: DecodedSourceMapOrMissing[] = []; let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map); const originalCode = source.code; let ast = source.ast; const transformDependencies: string[] = []; const emittedFiles: EmittedFile[] = []; let customTransformCache = false; const useCustomTransformCache = () => (customTransformCache = true); let pluginName = ''; let currentSource = source.code; function transformReducer( this: PluginContext, previousCode: string, result: TransformResult, plugin: Plugin ): string { let code: string; let map: string | ExistingRawSourceMap | { mappings: '' } | null | undefined; if (typeof result === 'string') { code = result; } else if (result && typeof result === 'object') { module.updateOptions(result); if (result.code == null) { if (result.map || result.ast) { log(LOGLEVEL_WARN, logNoTransformMapOrAstWithoutCode(plugin.name)); } return previousCode; } ({ code, map, ast } = result); } else { return previousCode; } // strict null check allows 'null' maps to not be pushed to the chain, // while 'undefined' gets the missing map warning if (map !== null) { sourcemapChain.push( decodedSourcemap(typeof map === 'string' ? JSON.parse(map) : map) || { missing: true, plugin: plugin.name } ); } currentSource = code; return code; } const getLogHandler = (handler: LoggingFunctionWithPosition): LoggingFunctionWithPosition => (log, pos) => { log = normalizeLog(log); if (pos) augmentCodeLocation(log, pos, currentSource, id); log.id = id; log.hook = 'transform'; handler(log); }; let code: string; try { code = await pluginDriver.hookReduceArg0( 'transform', [currentSource, id], transformReducer, (pluginContext, plugin): TransformPluginContext => { pluginName = plugin.name; return { ...pluginContext, addWatchFile(id: string) { transformDependencies.push(id); pluginContext.addWatchFile(id); }, cache: customTransformCache ? pluginContext.cache : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache), debug: getLogHandler(pluginContext.debug), emitFile(emittedFile: EmittedFile) { emittedFiles.push(emittedFile); return pluginDriver.emitFile(emittedFile); }, error( error_: RollupError | string, pos?: number | { column: number; line: number } ): never { if (typeof error_ === 'string') error_ = { message: error_ }; if (pos) augmentCodeLocation(error_, pos, currentSource, id); error_.id = id; error_.hook = 'transform'; return pluginContext.error(error_); }, getCombinedSourcemap() { const combinedMap = collapseSourcemap( id, originalCode, originalSourcemap, sourcemapChain, log ); if (!combinedMap) { const magicString = new MagicString(originalCode); return magicString.generateMap({ hires: true, includeContent: true, source: id }); } if (originalSourcemap !== combinedMap) { originalSourcemap = combinedMap; sourcemapChain.length = 0; } return new SourceMap({ ...combinedMap, file: null as never, sourcesContent: combinedMap.sourcesContent! }); }, info: getLogHandler(pluginContext.info), setAssetSource() { return this.error(logInvalidSetAssetSourceCall()); }, warn: getLogHandler(pluginContext.warn) }; } ); } catch (error_: any) { return error(logPluginError(error_, pluginName, { hook: 'transform', id })); } if ( !customTransformCache && // files emitted by a transform hook need to be emitted again if the hook is skipped emittedFiles.length > 0 ) module.transformFiles = emittedFiles; return { ast, code, customTransformCache, originalCode, originalSourcemap, sourcemapChain, transformDependencies }; } rollup-3.29.4/src/utils/traverseStaticDependencies.ts000066400000000000000000000013431450520414700227420ustar00rootroot00000000000000import ExternalModule from '../ExternalModule'; import type Module from '../Module'; export function markModuleAndImpureDependenciesAsExecuted(baseModule: Module): void { baseModule.isExecuted = true; const modules = [baseModule]; const visitedModules = new Set(); for (const module of modules) { for (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) { if ( !(dependency instanceof ExternalModule) && !dependency.isExecuted && (dependency.info.moduleSideEffects || module.implicitlyLoadedBefore.has(dependency)) && !visitedModules.has(dependency.id) ) { dependency.isExecuted = true; visitedModules.add(dependency.id); modules.push(dependency); } } } } rollup-3.29.4/src/utils/treeshakeNode.ts000066400000000000000000000014231450520414700202100ustar00rootroot00000000000000import type MagicString from 'magic-string'; import * as NodeType from '../ast/nodes/NodeType'; import type { Node } from '../ast/nodes/shared/Node'; export function treeshakeNode(node: Node, code: MagicString, start: number, end: number): void { code.remove(start, end); if (node.annotations) { for (const annotation of node.annotations) { if (annotation.start < start) { code.remove(annotation.start, annotation.end); } else { return; } } } } export function removeAnnotations(node: Node, code: MagicString): void { if (!node.annotations && node.parent.type === NodeType.ExpressionStatement) { node = node.parent as Node; } if (node.annotations) { for (const annotation of node.annotations) { code.remove(annotation.start, annotation.end); } } } rollup-3.29.4/src/utils/url.ts000066400000000000000000000005201450520414700162260ustar00rootroot00000000000000export function isValidUrl(url: string): boolean { try { new URL(url); } catch { return false; } return true; } export function getRollupUrl(snippet: string) { return `https://rollupjs.org/${snippet}`; } export function addTrailingSlashIfMissed(url: string) { if (!url.endsWith('/')) { return url + '/'; } return url; } rollup-3.29.4/src/utils/urls.ts000066400000000000000000000061041450520414700164150ustar00rootroot00000000000000// troubleshooting export const URL_AVOIDING_EVAL = 'troubleshooting/#avoiding-eval'; export const URL_NAME_IS_NOT_EXPORTED = 'troubleshooting/#error-name-is-not-exported-by-module'; export const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined'; export const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency'; export const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect'; // configuration-options export const URL_MAXPARALLELFILEOPS = 'configuration-options/#maxparallelfileops'; export const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id'; export const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath'; export const URL_OUTPUT_DIR = 'configuration-options/#output-dir'; export const URL_OUTPUT_DYNAMICIMPORTFUNCTION = 'configuration-options/#output-dynamicimportfunction'; export const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports'; export const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend'; export const URL_OUTPUT_FORMAT = 'configuration-options/#output-format'; export const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode'; export const URL_OUTPUT_EXPERIMENTALDEEPCHUNKOPTIMIZATION = 'configuration-options/#output-experimentaldeepdynamicchunkoptimization'; export const URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS = 'configuration-options/#output-generatedcode-constbindings'; export const URL_OUTPUT_GENERATEDCODE_SYMBOLS = 'configuration-options/#output-generatedcode-symbols'; export const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals'; export const URL_OUTPUT_INLINEDYNAMICIMPORTS = 'configuration-options/#output-inlinedynamicimports'; export const URL_OUTPUT_INTEROP = 'configuration-options/#output-interop'; export const URL_OUTPUT_MANUALCHUNKS = 'configuration-options/#output-manualchunks'; export const URL_OUTPUT_NAME = 'configuration-options/#output-name'; export const URL_OUTPUT_PRESERVEMODULES = 'configuration-options/#output-preservemodules'; export const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-sourcemapbaseurl'; export const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile'; export const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures'; export const URL_TREESHAKE = 'configuration-options/#treeshake'; export const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects'; export const URL_WATCH = 'configuration-options/#watch'; // command-line-interface export const URL_BUNDLE_CONFIG_AS_CJS = 'command-line-interface/#bundleconfigascjs'; export const URL_CONFIGURATION_FILES = 'command-line-interface/#configuration-files'; // plugin-development export const URL_A_SIMPLE_EXAMPLE = 'plugin-development/#a-simple-example'; export const URL_RENDERDYNAMICIMPORT = 'plugin-development/#renderdynamicimport'; export const URL_THIS_GETMODULEIDS = 'plugin-development/#this-getmoduleids'; export const URL_THIS_GETMODULEINFO = 'plugin-development/#this-getmoduleinfo'; rollup-3.29.4/src/utils/variableNames.ts000066400000000000000000000001021450520414700201710ustar00rootroot00000000000000export const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim'; rollup-3.29.4/src/watch/000077500000000000000000000000001450520414700150255ustar00rootroot00000000000000rollup-3.29.4/src/watch/WatchEmitter.ts000066400000000000000000000045321450520414700200010ustar00rootroot00000000000000import type { AwaitedEventListener, AwaitingEventEmitter } from '../rollup/types'; export class WatchEmitter any }> implements AwaitingEventEmitter { private currentHandlers: { [K in keyof T]?: AwaitedEventListener[]; } = Object.create(null); private persistentHandlers: { [K in keyof T]?: AwaitedEventListener[]; } = Object.create(null); // Will be overwritten by Rollup async close(): Promise {} emit(event: K, ...parameters: Parameters): Promise { return Promise.all( [...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters) ) ); } off(event: K, listener: AwaitedEventListener): this { const listeners = this.persistentHandlers[event]; if (listeners) { // A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1 // (which would remove the last array element if used unchanged) is turned // into max_int, which is outside the array and does not change anything. listeners.splice(listeners.indexOf(listener) >>> 0, 1); } return this; } on(event: K, listener: AwaitedEventListener): this { this.getPersistentHandlers(event).push(listener); return this; } onCurrentRun(event: K, listener: AwaitedEventListener): this { this.getCurrentHandlers(event).push(listener); return this; } once(event: K, listener: AwaitedEventListener): this { const selfRemovingListener: AwaitedEventListener = (...parameters) => { this.off(event, selfRemovingListener); return listener(...parameters); }; this.on(event, selfRemovingListener); return this; } removeAllListeners(): this { this.removeListenersForCurrentRun(); this.persistentHandlers = Object.create(null); return this; } removeListenersForCurrentRun(): this { this.currentHandlers = Object.create(null); return this; } private getCurrentHandlers(event: K): AwaitedEventListener[] { return this.currentHandlers[event] || (this.currentHandlers[event] = []); } private getPersistentHandlers(event: K): AwaitedEventListener[] { return this.persistentHandlers[event] || (this.persistentHandlers[event] = []); } } rollup-3.29.4/src/watch/fileWatcher.ts000066400000000000000000000041051450520414700176320ustar00rootroot00000000000000import { platform } from 'node:os'; import chokidar, { type FSWatcher } from 'chokidar'; import type { ChangeEvent, ChokidarOptions } from '../rollup/types'; import type { Task } from './watch'; export class FileWatcher { private readonly chokidarOptions: ChokidarOptions; private readonly task: Task; private readonly transformWatchers = new Map(); private readonly watcher: FSWatcher; constructor(task: Task, chokidarOptions: ChokidarOptions) { this.chokidarOptions = chokidarOptions; this.task = task; this.watcher = this.createWatcher(null); } close(): void { this.watcher.close(); for (const watcher of this.transformWatchers.values()) { watcher.close(); } } unwatch(id: string): void { this.watcher.unwatch(id); const transformWatcher = this.transformWatchers.get(id); if (transformWatcher) { this.transformWatchers.delete(id); transformWatcher.close(); } } watch(id: string, isTransformDependency: boolean): void { if (isTransformDependency) { const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id); watcher.add(id); this.transformWatchers.set(id, watcher); } else { this.watcher.add(id); } } private createWatcher(transformWatcherId: string | null): FSWatcher { const task = this.task; const isLinux = platform() === 'linux'; const isTransformDependency = transformWatcherId !== null; const handleChange = (id: string, event: ChangeEvent) => { const changedId = transformWatcherId || id; if (isLinux) { // unwatching and watching fixes an issue with chokidar where on certain systems, // a file that was unlinked and immediately recreated would create a change event // but then no longer any further events watcher.unwatch(changedId); watcher.add(changedId); } task.invalidate(changedId, { event, isTransformDependency }); }; const watcher = chokidar .watch([], this.chokidarOptions) .on('add', id => handleChange(id, 'create')) .on('change', id => handleChange(id, 'update')) .on('unlink', id => handleChange(id, 'delete')); return watcher; } } rollup-3.29.4/src/watch/fsevents-importer.ts000066400000000000000000000007401450520414700210720ustar00rootroot00000000000000import type FsEvents from 'fsevents'; let fsEvents: typeof FsEvents; let fsEventsImportError: Error | undefined; export async function loadFsEvents(): Promise { try { ({ default: fsEvents } = await import('fsevents')); } catch (error: any) { fsEventsImportError = error; } } // A call to this function will be injected into the chokidar code export function getFsEvents(): typeof FsEvents { if (fsEventsImportError) throw fsEventsImportError; return fsEvents; } rollup-3.29.4/src/watch/watch-proxy.ts000066400000000000000000000023661450520414700176710ustar00rootroot00000000000000import { handleError } from '../../cli/logging'; import type { MaybeArray, RollupOptions, RollupWatcher } from '../rollup/types'; import { ensureArray } from '../utils/ensureArray'; import { error, logInvalidOption } from '../utils/logs'; import { mergeOptions } from '../utils/options/mergeOptions'; import { URL_WATCH } from '../utils/urls'; import { WatchEmitter } from './WatchEmitter'; import { loadFsEvents } from './fsevents-importer'; export default function watch(configs: RollupOptions[] | RollupOptions): RollupWatcher { const emitter = new WatchEmitter() as RollupWatcher; watchInternal(configs, emitter).catch(error => { handleError(error); }); return emitter; } async function watchInternal(configs: MaybeArray, emitter: RollupWatcher) { const optionsList = await Promise.all( ensureArray(configs).map(config => mergeOptions(config, true)) ); const watchOptionsList = optionsList.filter(config => config.watch !== false); if (watchOptionsList.length === 0) { return error( logInvalidOption( 'watch', URL_WATCH, 'there must be at least one config where "watch" is not set to "false"' ) ); } await loadFsEvents(); const { Watcher } = await import('./watch'); new Watcher(watchOptionsList, emitter); } rollup-3.29.4/src/watch/watch.ts000066400000000000000000000155131450520414700165100ustar00rootroot00000000000000import { resolve } from 'node:path'; import process from 'node:process'; import { createFilter } from '@rollup/pluginutils'; import { rollupInternal } from '../rollup/rollup'; import type { ChangeEvent, MergedRollupOptions, OutputOptions, RollupBuild, RollupCache, RollupWatcher, WatcherOptions } from '../rollup/types'; import { FileWatcher } from './fileWatcher'; const eventsRewrites: Record> = { create: { create: 'buggy', delete: null, //delete file from map update: 'create' }, delete: { create: 'update', delete: 'buggy', update: 'buggy' }, update: { create: 'buggy', delete: 'delete', update: 'update' } }; export class Watcher { readonly emitter: RollupWatcher; private buildDelay = 0; private buildTimeout: NodeJS.Timer | null = null; private closed = false; private readonly invalidatedIds = new Map(); private rerun = false; private running = true; private readonly tasks: Task[]; constructor(optionsList: readonly MergedRollupOptions[], emitter: RollupWatcher) { this.emitter = emitter; emitter.close = this.close.bind(this); this.tasks = optionsList.map(options => new Task(this, options)); for (const { watch } of optionsList) { if (watch && typeof watch.buildDelay === 'number') { this.buildDelay = Math.max(this.buildDelay, watch.buildDelay!); } } process.nextTick(() => this.run()); } async close(): Promise { if (this.closed) return; this.closed = true; if (this.buildTimeout) clearTimeout(this.buildTimeout); for (const task of this.tasks) { task.close(); } await this.emitter.emit('close'); this.emitter.removeAllListeners(); } invalidate(file?: { event: ChangeEvent; id: string }): void { if (file) { const previousEvent = this.invalidatedIds.get(file.id); const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event; if (event === 'buggy') { //TODO: throws or warn? Currently just ignore, uses new event this.invalidatedIds.set(file.id, file.event); } else if (event === null) { this.invalidatedIds.delete(file.id); } else { this.invalidatedIds.set(file.id, event); } } if (this.running) { this.rerun = true; return; } if (this.buildTimeout) clearTimeout(this.buildTimeout); this.buildTimeout = setTimeout(async () => { this.buildTimeout = null; try { await Promise.all( [...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })) ); this.invalidatedIds.clear(); await this.emitter.emit('restart'); this.emitter.removeListenersForCurrentRun(); this.run(); } catch (error: any) { this.invalidatedIds.clear(); await this.emitter.emit('event', { code: 'ERROR', error, result: null }); await this.emitter.emit('event', { code: 'END' }); } }, this.buildDelay); } private async run(): Promise { this.running = true; await this.emitter.emit('event', { code: 'START' }); for (const task of this.tasks) { await task.run(); } this.running = false; await this.emitter.emit('event', { code: 'END' }); if (this.rerun) { this.rerun = false; this.invalidate(); } } } export class Task { cache: RollupCache = { modules: [] }; watchFiles: string[] = []; private closed = false; private readonly fileWatcher: FileWatcher; private filter: (id: string) => boolean; private invalidated = true; private readonly options: MergedRollupOptions; private readonly outputFiles: string[]; private readonly outputs: OutputOptions[]; private skipWrite: boolean; private watched = new Set(); private readonly watcher: Watcher; constructor(watcher: Watcher, options: MergedRollupOptions) { this.watcher = watcher; this.options = options; this.skipWrite = Boolean(options.watch && options.watch.skipWrite); this.outputs = this.options.output; this.outputFiles = this.outputs.map(output => { if (output.file || output.dir) return resolve(output.file || output.dir!); return undefined as never; }); const watchOptions: WatcherOptions = this.options.watch || {}; this.filter = createFilter(watchOptions.include, watchOptions.exclude); this.fileWatcher = new FileWatcher(this, { ...watchOptions.chokidar, disableGlobbing: true, ignoreInitial: true }); } close(): void { this.closed = true; this.fileWatcher.close(); } invalidate(id: string, details: { event: ChangeEvent; isTransformDependency?: boolean }): void { this.invalidated = true; if (details.isTransformDependency) { for (const module of this.cache.modules) { if (!module.transformDependencies.includes(id)) continue; // effective invalidation module.originalCode = null as never; } } this.watcher.invalidate({ event: details.event, id }); } async run(): Promise { if (!this.invalidated) return; this.invalidated = false; const options = { ...this.options, cache: this.cache }; const start = Date.now(); await this.watcher.emitter.emit('event', { code: 'BUNDLE_START', input: this.options.input, output: this.outputFiles }); let result: RollupBuild | null = null; try { result = await rollupInternal(options, this.watcher.emitter); if (this.closed) { return; } this.updateWatchedFiles(result); this.skipWrite || (await Promise.all(this.outputs.map(output => result!.write(output)))); await this.watcher.emitter.emit('event', { code: 'BUNDLE_END', duration: Date.now() - start, input: this.options.input, output: this.outputFiles, result }); } catch (error: any) { if (!this.closed) { if (Array.isArray(error.watchFiles)) { for (const id of error.watchFiles) { this.watchFile(id); } } if (error.id) { this.cache.modules = this.cache.modules.filter(module => module.id !== error.id); } } await this.watcher.emitter.emit('event', { code: 'ERROR', error, result }); } } private updateWatchedFiles(result: RollupBuild) { const previouslyWatched = this.watched; this.watched = new Set(); this.watchFiles = result.watchFiles; this.cache = result.cache!; for (const id of this.watchFiles) { this.watchFile(id); } for (const module of this.cache.modules) { for (const depId of module.transformDependencies) { this.watchFile(depId, true); } } for (const id of previouslyWatched) { if (!this.watched.has(id)) { this.fileWatcher.unwatch(id); } } } private watchFile(id: string, isTransformDependency = false) { if (!this.filter(id)) return; this.watched.add(id); if (this.outputFiles.includes(id)) { throw new Error('Cannot import the generated bundle'); } // this is necessary to ensure that any 'renamed' files // continue to be watched following an error this.fileWatcher.watch(id, isTransformDependency); } } rollup-3.29.4/test/000077500000000000000000000000001450520414700141075ustar00rootroot00000000000000rollup-3.29.4/test/browser/000077500000000000000000000000001450520414700155725ustar00rootroot00000000000000rollup-3.29.4/test/browser/define.d.ts000066400000000000000000000002131450520414700176120ustar00rootroot00000000000000import type { TestConfigBrowser } from '../types'; declare global { function defineTest(config: TestConfigBrowser): TestConfigBrowser; } rollup-3.29.4/test/browser/index.js000066400000000000000000000054311450520414700172420ustar00rootroot00000000000000// since we don't run the browser tests in an actual browser, we need to make `performance` // globally accessible same as in the browser. this can be removed once `performance` is // available globally in all supported platforms. [currently global for node.js v16+]. // @ts-expect-error ignore global.performance = require('node:perf_hooks').performance; const { basename, resolve } = require('node:path'); const fixturify = require('fixturify'); /** * @type {import('../../src/rollup/types')} Rollup */ const { rollup } = require('../../browser/dist/rollup.browser.js'); const { assertFilesAreEqual, runTestSuiteWithSamples, compareError } = require('../utils.js'); runTestSuiteWithSamples( 'browser', resolve(__dirname, 'samples'), /** * @param {import('../types').TestConfigBrowser} config */ (directory, config) => { (config.skip ? it.skip : config.solo ? it.only : it)( basename(directory) + ': ' + config.description, async () => { let bundle; try { bundle = await rollup({ input: 'main', onwarn: warning => { if (!(config.expectedWarnings && config.expectedWarnings.includes(warning.code))) { throw new Error( `Unexpected warnings (${warning.code}): ${warning.message}\n` + 'If you expect warnings, list their codes in config.expectedWarnings' ); } }, strictDeprecations: true, ...config.options }); } catch (error) { if (config.error) { compareError(error, config.error); return; } else { throw error; } } if (config.error) { throw new Error('Expected an error while rolling up'); } let output; try { ({ output } = await bundle.generate({ exports: 'auto', format: 'es', ...(config.options || {}).output })); } catch (error) { if (config.generateError) { compareError(error, config.generateError); return; } else { throw error; } } if (config.generateError) { throw new Error('Expected an error while generating output'); } assertOutputMatches(output, directory); } ); } ); function assertOutputMatches(output, directory) { /** @type any */ const actual = {}; for (const file of output) { const filePath = file.fileName.split('/'); const fileName = filePath.pop(); let currentDirectory = actual; for (const pathElement of filePath) { if (!currentDirectory[pathElement]) { currentDirectory[pathElement] = {}; } currentDirectory = currentDirectory[pathElement] = currentDirectory[pathElement] || {}; } currentDirectory[fileName] = file.source || file.code; } fixturify.writeSync(resolve(directory, '_actual'), actual); const expected = fixturify.readSync(resolve(directory, '_expected')); assertFilesAreEqual(actual, expected); } rollup-3.29.4/test/browser/samples/000077500000000000000000000000001450520414700172365ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/basic/000077500000000000000000000000001450520414700203175ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/basic/_config.js000066400000000000000000000004031450520414700222560ustar00rootroot00000000000000const { loader } = require('../../../utils.js'); module.exports = defineTest({ description: 'bundles files for the browser', options: { plugins: loader({ main: `import {foo} from 'dep'; console.log(foo);`, dep: `export const foo = 42;` }) } }); rollup-3.29.4/test/browser/samples/basic/_expected/000077500000000000000000000000001450520414700222575ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/basic/_expected/main.js000066400000000000000000000000431450520414700235360ustar00rootroot00000000000000const foo = 42; console.log(foo); rollup-3.29.4/test/browser/samples/missing-dependency-resolution/000077500000000000000000000000001450520414700252245ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/missing-dependency-resolution/_config.js000066400000000000000000000010531450520414700271650ustar00rootroot00000000000000const { loader } = require('../../../utils.js'); module.exports = defineTest({ description: 'fails if a dependency cannot be resolved', options: { plugins: loader({ main: `import {foo} from 'dep'; console.log(foo);` }) }, error: { code: 'NO_FS_IN_BROWSER', message: 'Cannot access the file system (via "path.resolve") when using the browser build of Rollup. Make sure you supply a plugin with custom resolveId and load hooks to Rollup.', url: 'https://rollupjs.org/plugin-development/#a-simple-example', watchFiles: ['main'] } }); rollup-3.29.4/test/browser/samples/missing-entry-resolution/000077500000000000000000000000001450520414700242475ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/missing-entry-resolution/_config.js000066400000000000000000000005761450520414700262210ustar00rootroot00000000000000module.exports = defineTest({ description: 'fails if an entry cannot be resolved', error: { code: 'NO_FS_IN_BROWSER', message: 'Cannot access the file system (via "path.resolve") when using the browser build of Rollup. Make sure you supply a plugin with custom resolveId and load hooks to Rollup.', url: 'https://rollupjs.org/plugin-development/#a-simple-example' } }); rollup-3.29.4/test/browser/samples/missing-load/000077500000000000000000000000001450520414700216245ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/missing-load/_config.js000066400000000000000000000010071450520414700235640ustar00rootroot00000000000000module.exports = defineTest({ description: 'fails if a file cannot be loaded', options: { plugins: { name: 'test', resolveId(source) { return source; } } }, error: { code: 'NO_FS_IN_BROWSER', message: 'Could not load main: Cannot access the file system (via "fs.readFile") when using the browser build of Rollup. Make sure you supply a plugin with custom resolveId and load hooks to Rollup.', url: 'https://rollupjs.org/plugin-development/#a-simple-example', watchFiles: ['main'] } }); rollup-3.29.4/test/browser/samples/renormalizes-external-paths/000077500000000000000000000000001450520414700247055ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/renormalizes-external-paths/_config.js000066400000000000000000000020241450520414700266450ustar00rootroot00000000000000const { join, dirname } = require('node:path').posix; module.exports = defineTest({ description: 'renormalizes external paths if possible', options: { input: ['/main.js', '/nested/entry.js'], external(id) { return id.endsWith('ext'); }, plugins: { name: 'test-plugin', resolveId(source, importer) { if (source.endsWith('ext.js')) { return false; } if (!importer) { return source; } return join(dirname(importer), source); }, load(id) { switch (id) { case '/main.js': { return `import './nested/dep.js'; import './ext.js'; import './nested/nested-ext.js';`; } case '/dep.js': { return `import './ext.js'; import './nested/nested-ext.js';`; } case '/nested/dep.js': { return `import '../ext.js'; import './nested-ext.js';`; } case '/nested/entry.js': { return `import '../dep.js'; import '../ext.js'; import './nested-ext.js';`; } default: { throw new Error(`Unexpected id ${id}`); } } } } } }); rollup-3.29.4/test/browser/samples/renormalizes-external-paths/_expected/000077500000000000000000000000001450520414700266455ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/renormalizes-external-paths/_expected/entry.js000066400000000000000000000000641450520414700303440ustar00rootroot00000000000000import './ext.js'; import './nested/nested-ext.js'; rollup-3.29.4/test/browser/samples/renormalizes-external-paths/_expected/main.js000066400000000000000000000000641450520414700301270ustar00rootroot00000000000000import './ext.js'; import './nested/nested-ext.js'; rollup-3.29.4/test/browser/samples/supports-hashes/000077500000000000000000000000001450520414700224065ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/supports-hashes/_config.js000066400000000000000000000005241450520414700243510ustar00rootroot00000000000000const { loader } = require('../../../utils.js'); module.exports = defineTest({ description: 'bundles files for the browser', options: { input: ['main', 'dep'], plugins: loader({ main: `import {foo} from 'dep'; console.log(foo);`, dep: `export const foo = 42;` }), output: { entryFileNames: '[name]-[hash].js' } } }); rollup-3.29.4/test/browser/samples/supports-hashes/_expected/000077500000000000000000000000001450520414700243465ustar00rootroot00000000000000rollup-3.29.4/test/browser/samples/supports-hashes/_expected/dep-bd733981.js000066400000000000000000000000411450520414700265310ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-3.29.4/test/browser/samples/supports-hashes/_expected/main-70712c1f.js000066400000000000000000000000741450520414700267010ustar00rootroot00000000000000import { foo } from './dep-bd733981.js'; console.log(foo); rollup-3.29.4/test/browser/tsconfig.json000066400000000000000000000001701450520414700202770ustar00rootroot00000000000000{ "extends": "../tsconfig.base.json", "include": [ "**/_config.js", "./index.js", "./define.d.ts" ] } rollup-3.29.4/test/chunking-form/000077500000000000000000000000001450520414700166565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/define.d.ts000066400000000000000000000002321450520414700206770ustar00rootroot00000000000000import type { TestConfigChunkingForm } from '../types'; declare global { function defineTest(config: TestConfigChunkingForm): TestConfigChunkingForm; } rollup-3.29.4/test/chunking-form/index.js000066400000000000000000000056711450520414700203340ustar00rootroot00000000000000const { basename, resolve } = require('node:path'); /** * @type {import('../../src/rollup/types')} Rollup */ // @ts-expect-error not included in types const { rollup } = require('../../dist/rollup'); const { compareLogs } = require('../utils'); const { runTestSuiteWithSamples, assertDirectoriesAreEqual } = require('../utils.js'); const FORMATS = ['es', 'cjs', 'amd', 'system']; runTestSuiteWithSamples('chunking form', resolve(__dirname, 'samples'), (directory, config) => { (config.skip ? describe.skip : config.solo ? describe.only : describe)( basename(directory) + ': ' + config.description, () => { let bundle; if (config.before) { before(config.before); } if (config.after) { after(config.after); } const logs = []; after(() => config.logs && compareLogs(logs, config.logs)); for (const format of FORMATS) { it('generates ' + format, async () => { process.chdir(directory); const warnings = []; bundle = bundle || (await rollup({ input: [directory + '/main.js'], onLog: (level, log) => { logs.push({ level, ...log }); if (level === 'warn' && !config.expectedWarnings?.includes(log.code)) { warnings.push(log); } }, strictDeprecations: true, ...config.options })); await generateAndTestBundle( bundle, { dir: `${directory}/_actual/${format}`, exports: 'auto', format, chunkFileNames: 'generated-[name].js', validate: true, ...(config.options || {}).output }, `${directory}/_expected/${format}`, config ); if (warnings.length > 0) { const codes = new Set(); for (const { code } of warnings) { codes.add(code); } throw new Error( `Unexpected warnings (${[...codes].join(', ')}): \n${warnings .map(({ message }) => `${message}\n\n`) .join('')}` + 'If you expect warnings, list their codes in config.expectedWarnings' ); } }); } } ); }); async function generateAndTestBundle(bundle, outputOptions, expectedDirectory, config) { await bundle.write({ ...outputOptions, dir: `${outputOptions.dir}${config.nestedDir ? '/' + config.nestedDir : ''}` }); if (outputOptions.format === 'amd' && config.runAmd) { try { const exports = await new Promise((resolve, reject) => { // @ts-expect-error global global.assert = require('node:assert'); const requirejs = require('requirejs'); requirejs.config({ baseUrl: outputOptions.dir }); requirejs([config.nestedDir ? `${config.nestedDir}/main` : 'main'], resolve, reject); }); if (config.runAmd.exports) { await config.runAmd.exports(exports); } } finally { delete require.cache[require.resolve('requirejs')]; // @ts-expect-error global delete global.requirejsVars; // @ts-expect-error global delete global.assert; } } assertDirectoriesAreEqual(outputOptions.dir, expectedDirectory); } rollup-3.29.4/test/chunking-form/samples/000077500000000000000000000000001450520414700203225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/000077500000000000000000000000001450520414700243065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_config.js000066400000000000000000000002111450520414700262420ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunk aliasing with extensions', options: { input: ['main1', 'main2', 'main3.ts'] } }); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/000077500000000000000000000000001450520414700262465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/amd/000077500000000000000000000000001450520414700270075ustar00rootroot00000000000000generated-main4.dynamic.js000066400000000000000000000001021450520414700336460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/amddefine((function () { 'use strict'; console.log('main4'); })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/amd/generated-main5.js000066400000000000000000000001021450520414700323030ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main5'); })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/amd/main1.js000066400000000000000000000004341450520414700303530ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; console.log('main1'); new Promise(function (resolve, reject) { require(['./generated-main4.dynamic'], resolve, reject); }); new Promise(function (resolve, reject) { require(['./generated-main5'], resolve, reject); }); })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/amd/main2.js000066400000000000000000000001021450520414700303440ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main2'); })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/amd/main3.js000066400000000000000000000001021450520414700303450ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main3'); })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/cjs/000077500000000000000000000000001450520414700270255ustar00rootroot00000000000000generated-main4.dynamic.js000066400000000000000000000000451450520414700336720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/cjs'use strict'; console.log('main4'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/cjs/generated-main5.js000066400000000000000000000000451450520414700323270ustar00rootroot00000000000000'use strict'; console.log('main5'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/cjs/main1.js000066400000000000000000000003171450520414700303710ustar00rootroot00000000000000'use strict'; console.log('main1'); Promise.resolve().then(function () { return require('./generated-main4.dynamic.js'); }); Promise.resolve().then(function () { return require('./generated-main5.js'); }); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/cjs/main2.js000066400000000000000000000000451450520414700303700ustar00rootroot00000000000000'use strict'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/cjs/main3.js000066400000000000000000000000451450520414700303710ustar00rootroot00000000000000'use strict'; console.log('main3'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/es/000077500000000000000000000000001450520414700266555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/es/generated-main4.dynamic.js000066400000000000000000000000261450520414700336000ustar00rootroot00000000000000console.log('main4'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/es/generated-main5.js000066400000000000000000000000261450520414700321560ustar00rootroot00000000000000console.log('main5'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/es/main1.js000066400000000000000000000001361450520414700302200ustar00rootroot00000000000000console.log('main1'); import('./generated-main4.dynamic.js'); import('./generated-main5.js'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/es/main2.js000066400000000000000000000000261450520414700302170ustar00rootroot00000000000000console.log('main2'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/es/main3.js000066400000000000000000000000261450520414700302200ustar00rootroot00000000000000console.log('main3'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/system/000077500000000000000000000000001450520414700275725ustar00rootroot00000000000000generated-main4.dynamic.js000066400000000000000000000001771450520414700344450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main4'); }) }; })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/system/generated-main5.js000066400000000000000000000001771450520414700331020ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main5'); }) }; })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/system/main1.js000066400000000000000000000003521450520414700311350ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log('main1'); module.import('./generated-main4.dynamic.js'); module.import('./generated-main5.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/system/main2.js000066400000000000000000000001771450520414700311430ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/_expected/system/main3.js000066400000000000000000000001771450520414700311440ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main3'); }) }; })); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/main1.js000066400000000000000000000001061450520414700256460ustar00rootroot00000000000000console.log('main1'); import('./main4.dynamic'); import('./main5.ts');rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/main2000066400000000000000000000000251450520414700252340ustar00rootroot00000000000000console.log('main2');rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/main3.ts000066400000000000000000000000261450520414700256630ustar00rootroot00000000000000console.log('main3'); rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/main4.dynamic.js000066400000000000000000000000251450520414700272740ustar00rootroot00000000000000console.log('main4');rollup-3.29.4/test/chunking-form/samples/aliasing-extensions/main5.ts000066400000000000000000000000261450520414700256650ustar00rootroot00000000000000console.log('main5'); rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/000077500000000000000000000000001450520414700255325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_config.js000066400000000000000000000014141450520414700274740ustar00rootroot00000000000000module.exports = defineTest({ description: "allows to use amd.autoId with amd.basePath and works when concat'd into one file", options: { input: ['main'], output: { amd: { autoId: true, basePath: 'some/where' } }, plugins: [ { name: 'concatenate-amd', generateBundle(options, bundle) { if (options.format === 'amd') { const concatenatedCode = Object.keys(bundle) .map(chunkName => bundle[chunkName].code) .join('\n'); for (const chunkName of Object.keys(bundle)) { delete bundle[chunkName]; } this.emitFile({ type: 'asset', fileName: 'main.js', source: concatenatedCode }); } } } ] }, nestedDir: 'some/where', runAmd: { exports(exports) { return exports.getA(); } } }); rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/000077500000000000000000000000001450520414700274725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/amd/000077500000000000000000000000001450520414700302335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/amd/some/000077500000000000000000000000001450520414700311765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/amd/some/where/000077500000000000000000000000001450520414700323105ustar00rootroot00000000000000main.js000066400000000000000000000006101450520414700335100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/amd/some/wheredefine('some/where/main', ['require', 'exports'], (function (require, exports) { 'use strict'; function getA() { return new Promise(function (resolve, reject) { require(['./generated-a'], resolve, reject); }); } exports.getA = getA; })); define('some/where/generated-a', ['exports'], (function (exports) { 'use strict'; const something = 42; exports.something = something; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/cjs/000077500000000000000000000000001450520414700302515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/cjs/some/000077500000000000000000000000001450520414700312145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/cjs/some/where/000077500000000000000000000000001450520414700323265ustar00rootroot00000000000000generated-a.js000066400000000000000000000001051450520414700347550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/cjs/some/where'use strict'; const something = 42; exports.something = something; main.js000066400000000000000000000002161450520414700335300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/cjs/some/where'use strict'; function getA() { return Promise.resolve().then(function () { return require('./generated-a.js'); }); } exports.getA = getA; rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/es/000077500000000000000000000000001450520414700301015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/es/some/000077500000000000000000000000001450520414700310445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/es/some/where/000077500000000000000000000000001450520414700321565ustar00rootroot00000000000000generated-a.js000066400000000000000000000000551450520414700346110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/es/some/whereconst something = 42; export { something }; main.js000066400000000000000000000001121450520414700333530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/es/some/wherefunction getA() { return import('./generated-a.js'); } export { getA }; rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/system/000077500000000000000000000000001450520414700310165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/system/some/000077500000000000000000000000001450520414700317615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/system/some/where/000077500000000000000000000000001450520414700330735ustar00rootroot00000000000000generated-a.js000066400000000000000000000002341450520414700355250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/system/some/whereSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const something = exports('something', 42); }) }; })); main.js000066400000000000000000000003301450520414700342720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/_expected/system/some/whereSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { exports('getA', getA); function getA() { return module.import('./generated-a.js'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/a.js000066400000000000000000000000351450520414700263060ustar00rootroot00000000000000export const something = 42; rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path-concat/main.js000066400000000000000000000000621450520414700270120ustar00rootroot00000000000000export function getA() { return import('./a'); } rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/000077500000000000000000000000001450520414700242655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_config.js000066400000000000000000000005541450520414700262330ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to use amd.autoId with amd.basePath, and chunks folder', options: { input: ['main'], output: { chunkFileNames: 'chunks/generated-[name].js', amd: { autoId: true, basePath: 'some/where' } } }, nestedDir: 'some/where', runAmd: { exports(exports) { return exports.getA(); } } }); rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/000077500000000000000000000000001450520414700262255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/amd/000077500000000000000000000000001450520414700267665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/amd/some/000077500000000000000000000000001450520414700277315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/amd/some/where/000077500000000000000000000000001450520414700310435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/amd/some/where/chunks/000077500000000000000000000000001450520414700323365ustar00rootroot00000000000000generated-a.js000066400000000000000000000002301450520414700347640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/amd/some/where/chunksdefine('some/where/chunks/generated-a', ['exports'], (function (exports) { 'use strict'; const something = 42; exports.something = something; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/amd/some/where/main.js000066400000000000000000000003751450520414700323320ustar00rootroot00000000000000define('some/where/main', ['require', 'exports'], (function (require, exports) { 'use strict'; function getA() { return new Promise(function (resolve, reject) { require(['./chunks/generated-a'], resolve, reject); }); } exports.getA = getA; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/cjs/000077500000000000000000000000001450520414700270045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/cjs/some/000077500000000000000000000000001450520414700277475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/cjs/some/where/000077500000000000000000000000001450520414700310615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/cjs/some/where/chunks/000077500000000000000000000000001450520414700323545ustar00rootroot00000000000000generated-a.js000066400000000000000000000001051450520414700350030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/cjs/some/where/chunks'use strict'; const something = 42; exports.something = something; rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/cjs/some/where/main.js000066400000000000000000000002251450520414700323420ustar00rootroot00000000000000'use strict'; function getA() { return Promise.resolve().then(function () { return require('./chunks/generated-a.js'); }); } exports.getA = getA; rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/es/000077500000000000000000000000001450520414700266345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/es/some/000077500000000000000000000000001450520414700275775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/es/some/where/000077500000000000000000000000001450520414700307115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/es/some/where/chunks/000077500000000000000000000000001450520414700322045ustar00rootroot00000000000000generated-a.js000066400000000000000000000000551450520414700346370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/es/some/where/chunksconst something = 42; export { something }; rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/es/some/where/main.js000066400000000000000000000001211450520414700321650ustar00rootroot00000000000000function getA() { return import('./chunks/generated-a.js'); } export { getA }; rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/system/000077500000000000000000000000001450520414700275515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/system/some/000077500000000000000000000000001450520414700305145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/system/some/where/000077500000000000000000000000001450520414700316265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/system/some/where/chunks/000077500000000000000000000000001450520414700331215ustar00rootroot00000000000000generated-a.js000066400000000000000000000002341450520414700355530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/system/some/where/chunksSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const something = exports('something', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/_expected/system/some/where/main.js000066400000000000000000000003371450520414700331130ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { exports('getA', getA); function getA() { return module.import('./chunks/generated-a.js'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/a.js000066400000000000000000000000351450520414700250410ustar00rootroot00000000000000export const something = 42; rollup-3.29.4/test/chunking-form/samples/amd-id-auto-base-path/main.js000066400000000000000000000000621450520414700255450ustar00rootroot00000000000000export function getA() { return import('./a'); } rollup-3.29.4/test/chunking-form/samples/amd-id-auto/000077500000000000000000000000001450520414700224235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_config.js000066400000000000000000000003401450520414700243620ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to use amd.autoId', options: { input: ['main'], output: { amd: { autoId: true } } }, runAmd: { exports(exports) { return exports.getA(); } } }); rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/000077500000000000000000000000001450520414700243635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/amd/000077500000000000000000000000001450520414700251245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/amd/generated-a.js000066400000000000000000000002061450520414700276340ustar00rootroot00000000000000define('generated-a', ['exports'], (function (exports) { 'use strict'; const something = 42; exports.something = something; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/amd/main.js000066400000000000000000000003531450520414700264070ustar00rootroot00000000000000define('main', ['require', 'exports'], (function (require, exports) { 'use strict'; function getA() { return new Promise(function (resolve, reject) { require(['./generated-a'], resolve, reject); }); } exports.getA = getA; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/cjs/000077500000000000000000000000001450520414700251425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/cjs/generated-a.js000066400000000000000000000001051450520414700276500ustar00rootroot00000000000000'use strict'; const something = 42; exports.something = something; rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/cjs/main.js000066400000000000000000000002161450520414700264230ustar00rootroot00000000000000'use strict'; function getA() { return Promise.resolve().then(function () { return require('./generated-a.js'); }); } exports.getA = getA; rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/es/000077500000000000000000000000001450520414700247725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/es/generated-a.js000066400000000000000000000000551450520414700275040ustar00rootroot00000000000000const something = 42; export { something }; rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/es/main.js000066400000000000000000000001121450520414700262460ustar00rootroot00000000000000function getA() { return import('./generated-a.js'); } export { getA }; rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/system/000077500000000000000000000000001450520414700257075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/system/generated-a.js000066400000000000000000000002341450520414700304200ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const something = exports('something', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto/_expected/system/main.js000066400000000000000000000003301450520414700271650ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { exports('getA', getA); function getA() { return module.import('./generated-a.js'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/amd-id-auto/a.js000066400000000000000000000000351450520414700231770ustar00rootroot00000000000000export const something = 42; rollup-3.29.4/test/chunking-form/samples/amd-id-auto/main.js000066400000000000000000000000621450520414700237030ustar00rootroot00000000000000export function getA() { return import('./a'); } rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/000077500000000000000000000000001450520414700276225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_config.js000066400000000000000000000040251450520414700315650ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'emits unreferenced assets if needsCodeReference is true if they are also emitted without that flag', options: { output: { assetFileNames: '[name][extname]' }, plugins: [ { name: 'test', buildStart() { this.emitFile({ type: 'asset', name: 'needs-reference1.txt', needsCodeReference: true, source: 'source1' }); this.emitFile({ type: 'asset', name: 'file1.txt', source: 'source1' }); this.emitFile({ type: 'asset', name: 'file2.txt', source: 'source2' }); this.emitFile({ type: 'asset', name: 'needs-reference2.txt', needsCodeReference: true, source: 'source2' }); this.emitFile({ type: 'asset', name: 'needs-reference3.txt', needsCodeReference: true, source: 'source3' }); this.emitFile({ type: 'asset', name: 'file4.txt', source: 'source4' }); this.emitFile({ type: 'asset', name: 'needs-reference5.txt', needsCodeReference: true, source: 'source5' }); this.emitFile({ type: 'asset', name: 'file6.txt', source: 'source6' }); }, renderStart() { this.emitFile({ type: 'asset', name: 'file3.txt', source: 'source3' }); this.emitFile({ type: 'asset', name: 'needs-reference4.txt', needsCodeReference: true, source: 'source4' }); }, generateBundle(_, bundle) { this.emitFile({ type: 'asset', name: 'file5.txt', source: 'source5' }); this.emitFile({ type: 'asset', name: 'needs-reference6.txt', needsCodeReference: true, source: 'source6' }); assert.deepEqual(Object.keys(bundle).sort(), [ 'file1.txt', 'file2.txt', 'file4.txt', 'file6.txt', 'main.js', 'needs-reference3.txt', 'needs-reference5.txt' ]); } } ] } }); rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/000077500000000000000000000000001450520414700315625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/amd/000077500000000000000000000000001450520414700323235ustar00rootroot00000000000000file1.txt000066400000000000000000000000071450520414700340020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/amdsource1file2.txt000066400000000000000000000000071450520414700340030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/amdsource2file4.txt000066400000000000000000000000071450520414700340050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/amdsource4file6.txt000066400000000000000000000000071450520414700340070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/amdsource6main.js000066400000000000000000000001011450520414700335160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/amddefine((function () { 'use strict'; console.log('main'); })); needs-reference3.txt000066400000000000000000000000071450520414700361170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/amdsource3needs-reference5.txt000066400000000000000000000000071450520414700361210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/amdsource5rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/cjs/000077500000000000000000000000001450520414700323415ustar00rootroot00000000000000file1.txt000066400000000000000000000000071450520414700340200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/cjssource1file2.txt000066400000000000000000000000071450520414700340210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/cjssource2file4.txt000066400000000000000000000000071450520414700340230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/cjssource4file6.txt000066400000000000000000000000071450520414700340250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/cjssource6main.js000066400000000000000000000000441450520414700335420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/cjs'use strict'; console.log('main'); needs-reference3.txt000066400000000000000000000000071450520414700361350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/cjssource3needs-reference5.txt000066400000000000000000000000071450520414700361370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/cjssource5rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/es/000077500000000000000000000000001450520414700321715ustar00rootroot00000000000000file1.txt000066400000000000000000000000071450520414700336500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/essource1file2.txt000066400000000000000000000000071450520414700336510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/essource2file4.txt000066400000000000000000000000071450520414700336530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/essource4file6.txt000066400000000000000000000000071450520414700336550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/essource6rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/es/main.js000066400000000000000000000000251450520414700334500ustar00rootroot00000000000000console.log('main'); needs-reference3.txt000066400000000000000000000000071450520414700357650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/essource3needs-reference5.txt000066400000000000000000000000071450520414700357670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/essource5rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/system/000077500000000000000000000000001450520414700331065ustar00rootroot00000000000000file1.txt000066400000000000000000000000071450520414700345650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/systemsource1file2.txt000066400000000000000000000000071450520414700345660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/systemsource2file4.txt000066400000000000000000000000071450520414700345700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/systemsource4file6.txt000066400000000000000000000000071450520414700345720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/systemsource6main.js000066400000000000000000000001761450520414700343150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); needs-reference3.txt000066400000000000000000000000071450520414700367020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/systemsource3needs-reference5.txt000066400000000000000000000000071450520414700367040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/_expected/systemsource5rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference-same-source/main.js000066400000000000000000000000251450520414700311010ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/000077500000000000000000000000001450520414700254015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_config.js000066400000000000000000000015551450520414700273510ustar00rootroot00000000000000const assert = require('node:assert'); const fs = require('node:fs'); const path = require('node:path'); module.exports = defineTest({ description: 'does not emit unreferenced assets if needsCodeReference is true', options: { output: { assetFileNames: '[name][extname]' }, plugins: [ { resolveId(source, importer) { if (source.endsWith('.svg')) { return path.resolve(path.dirname(importer), source); } }, load(id) { if (id.endsWith('.svg')) { const referenceId = this.emitFile({ type: 'asset', name: path.basename(id), needsCodeReference: true, source: fs.readFileSync(id) }); return `export default import.meta.ROLLUP_FILE_URL_${referenceId}`; } }, generateBundle(_, bundle) { assert.deepEqual(Object.keys(bundle), ['logo2.svg', 'main.js']); } } ] } }); rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/000077500000000000000000000000001450520414700273415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/amd/000077500000000000000000000000001450520414700301025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/amd/logo2.svg000066400000000000000000000064311450520414700316510ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/amd/main.js000066400000000000000000000003731450520414700313670ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; var asset2 = new URL(require.toUrl('./logo2.svg'), document.baseURI).href; { const image = document.createElement('img'); image.src = asset2; document.body.appendChild(image); } })); rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/cjs/000077500000000000000000000000001450520414700301205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/cjs/logo2.svg000066400000000000000000000064311450520414700316670ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/cjs/main.js000066400000000000000000000005231450520414700314020ustar00rootroot00000000000000'use strict'; var asset2 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/logo2.svg').href : new URL('logo2.svg', document.currentScript && document.currentScript.src || document.baseURI).href); { const image = document.createElement('img'); image.src = asset2; document.body.appendChild(image); } rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/es/000077500000000000000000000000001450520414700277505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/es/logo2.svg000066400000000000000000000064311450520414700315170ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/es/main.js000066400000000000000000000002441450520414700312320ustar00rootroot00000000000000var asset2 = new URL('logo2.svg', import.meta.url).href; { const image = document.createElement('img'); image.src = asset2; document.body.appendChild(image); } rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/system/000077500000000000000000000000001450520414700306655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/system/logo2.svg000066400000000000000000000064311450520414700324340ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/_expected/system/main.js000066400000000000000000000004531450520414700321510ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var asset2 = new URL('logo2.svg', module.meta.url).href; { const image = document.createElement('img'); image.src = asset2; document.body.appendChild(image); } }) }; })); rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/logo.svg000066400000000000000000000064341450520414700270710ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/logo2.svg000066400000000000000000000064311450520414700271500ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/asset-needs-code-reference/main.js000066400000000000000000000004531450520414700266650ustar00rootroot00000000000000import asset from './logo.svg'; import asset2 from './logo2.svg'; if (false) { const image = document.createElement('img'); image.src = asset; document.body.appendChild(image); } if (true) { const image = document.createElement('img'); image.src = asset2; document.body.appendChild(image); } rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/000077500000000000000000000000001450520414700256645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_config.js000066400000000000000000000003341450520414700276260ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoids hoisting transitive dependencies via flag', options: { input: ['main1.js', 'main2.js'], external: ['lib'], output: { hoistTransitiveImports: false } } }); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/000077500000000000000000000000001450520414700276245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/amd/000077500000000000000000000000001450520414700303655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/amd/generated-dep.js000066400000000000000000000001701450520414700334250ustar00rootroot00000000000000define(['exports', 'lib'], (function (exports, value) { 'use strict'; var dep = 2 * value; exports.dep = dep; })); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/amd/main1.js000066400000000000000000000001431450520414700317260ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main1', dep.dep); })); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/amd/main2.js000066400000000000000000000001431450520414700317270ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main2', dep.dep); })); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/cjs/000077500000000000000000000000001450520414700304035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/cjs/generated-dep.js000066400000000000000000000001251450520414700334430ustar00rootroot00000000000000'use strict'; var value = require('lib'); var dep = 2 * value; exports.dep = dep; rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/cjs/main1.js000066400000000000000000000001301450520414700317400ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep.dep); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/cjs/main2.js000066400000000000000000000001301450520414700317410ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main2', dep.dep); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/es/000077500000000000000000000000001450520414700302335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/es/generated-dep.js000066400000000000000000000001051450520414700332710ustar00rootroot00000000000000import value from 'lib'; var dep = 2 * value; export { dep as d }; rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/es/main1.js000066400000000000000000000001131450520414700315710ustar00rootroot00000000000000import { d as dep } from './generated-dep.js'; console.log('main1', dep); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/es/main2.js000066400000000000000000000001131450520414700315720ustar00rootroot00000000000000import { d as dep } from './generated-dep.js'; console.log('main2', dep); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/system/000077500000000000000000000000001450520414700311505ustar00rootroot00000000000000generated-dep.js000066400000000000000000000003451450520414700341350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/systemSystem.register(['lib'], (function (exports) { 'use strict'; var value; return { setters: [function (module) { value = module.default; }], execute: (function () { var dep = exports('d', 2 * value); }) }; })); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/system/main1.js000066400000000000000000000003331450520414700325120ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var dep; return { setters: [function (module) { dep = module.d; }], execute: (function () { console.log('main1', dep); }) }; })); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/system/main2.js000066400000000000000000000003331450520414700325130ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var dep; return { setters: [function (module) { dep = module.d; }], execute: (function () { console.log('main2', dep); }) }; })); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/dep.js000066400000000000000000000000641450520414700267720ustar00rootroot00000000000000import value from 'lib'; export default 2 * value; rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/main1.js000066400000000000000000000000701450520414700272240ustar00rootroot00000000000000import dep from './dep.js'; console.log('main1', dep); rollup-3.29.4/test/chunking-form/samples/avoid-chunk-import-hoisting/main2.js000066400000000000000000000000701450520414700272250ustar00rootroot00000000000000import dep from './dep.js'; console.log('main2', dep); rollup-3.29.4/test/chunking-form/samples/basic-chunking/000077500000000000000000000000001450520414700232075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/basic-chunking/_config.js000066400000000000000000000001641450520414700251520ustar00rootroot00000000000000module.exports = defineTest({ description: 'simple chunking', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/000077500000000000000000000000001450520414700251475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/amd/000077500000000000000000000000001450520414700257105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/amd/generated-dep2.js000066400000000000000000000003101450520414700310260ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/amd/main1.js000066400000000000000000000003261450520414700272540ustar00rootroot00000000000000define(['./generated-dep2'], (function (dep2) { 'use strict'; function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); dep2.fn(); } } return Main1; })); rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/amd/main2.js000066400000000000000000000004301450520414700272510ustar00rootroot00000000000000define(['./generated-dep2'], (function (dep2) { 'use strict'; function fn$1 () { console.log('lib1 fn'); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); dep2.fn(); } } return Main2; })); rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/cjs/000077500000000000000000000000001450520414700257265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/cjs/generated-dep2.js000066400000000000000000000002101450520414700310430ustar00rootroot00000000000000'use strict'; function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/cjs/main1.js000066400000000000000000000003021450520414700272640ustar00rootroot00000000000000'use strict'; var dep2 = require('./generated-dep2.js'); function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); dep2.fn(); } } module.exports = Main1; rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/cjs/main2.js000066400000000000000000000003741450520414700272760ustar00rootroot00000000000000'use strict'; var dep2 = require('./generated-dep2.js'); function fn$1 () { console.log('lib1 fn'); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); dep2.fn(); } } module.exports = Main2; rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/es/000077500000000000000000000000001450520414700255565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/es/generated-dep2.js000066400000000000000000000001741450520414700307040ustar00rootroot00000000000000function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } export { fn as f }; rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/es/main1.js000066400000000000000000000002731450520414700271230ustar00rootroot00000000000000import { f as fn$1 } from './generated-dep2.js'; function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); fn$1(); } } export { Main1 as default }; rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/es/main2.js000066400000000000000000000003651450520414700271260ustar00rootroot00000000000000import { f as fn$2 } from './generated-dep2.js'; function fn$1 () { console.log('lib1 fn'); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); fn$2(); } } export { Main2 as default }; rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/system/000077500000000000000000000000001450520414700264735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/system/generated-dep2.js000066400000000000000000000004361450520414700316220ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', fn); function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/system/main1.js000066400000000000000000000006221450520414700300360ustar00rootroot00000000000000System.register(['./generated-dep2.js'], (function (exports) { 'use strict'; var fn$1; return { setters: [function (module) { fn$1 = module.f; }], execute: (function () { function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); fn$1(); } } exports('default', Main1); }) }; })); rollup-3.29.4/test/chunking-form/samples/basic-chunking/_expected/system/main2.js000066400000000000000000000007441450520414700300440ustar00rootroot00000000000000System.register(['./generated-dep2.js'], (function (exports) { 'use strict'; var fn$2; return { setters: [function (module) { fn$2 = module.f; }], execute: (function () { function fn$1 () { console.log('lib1 fn'); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); fn$2(); } } exports('default', Main2); }) }; })); rollup-3.29.4/test/chunking-form/samples/basic-chunking/dep1.js000066400000000000000000000000631450520414700243750ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-3.29.4/test/chunking-form/samples/basic-chunking/dep2.js000066400000000000000000000001501450520414700243730ustar00rootroot00000000000000import { fn as libfn } from './lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-3.29.4/test/chunking-form/samples/basic-chunking/dep3.js000066400000000000000000000002201450520414700243720ustar00rootroot00000000000000import { fn as libfn, treeshaked } from './lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-3.29.4/test/chunking-form/samples/basic-chunking/lib1.js000066400000000000000000000001751450520414700243770ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-3.29.4/test/chunking-form/samples/basic-chunking/lib2.js000066400000000000000000000000631450520414700243740ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-3.29.4/test/chunking-form/samples/basic-chunking/main1.js000066400000000000000000000002221450520414700245460ustar00rootroot00000000000000import { fn } from './dep1.js'; import { fn as fn2 } from './dep2.js'; export default class Main1 { constructor () { fn(); fn2(); } }rollup-3.29.4/test/chunking-form/samples/basic-chunking/main2.js000066400000000000000000000003111450520414700245460ustar00rootroot00000000000000import { fn } from './dep2.js'; import { fn as fn2, default as treeshaked } from './dep3.js'; if (false) { treeshaked(); } export default class Main2 { constructor () { fn2(); fn(); } }rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/000077500000000000000000000000001450520414700254505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_config.js000066400000000000000000000005751450520414700274210ustar00rootroot00000000000000const path = require('node:path'); const commonjs = require('@rollup/plugin-commonjs'); module.exports = defineTest({ description: 'the content of c.js is complete', options: { plugins: [ commonjs(), { resolveId(id) { if (id === './c.js') { return { id: path.resolve('./c.js'), moduleSideEffects: false }; } } } ] } }); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/000077500000000000000000000000001450520414700274105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/amd/000077500000000000000000000000001450520414700301515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/amd/generated-a.js000066400000000000000000000002271450520414700326640ustar00rootroot00000000000000define(['exports', './generated-c'], (function (exports, c) { 'use strict'; function A() { return { icon: c.c.faPrint }; } exports.A = A; })); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/amd/generated-b.js000066400000000000000000000002271450520414700326650ustar00rootroot00000000000000define(['exports', './generated-c'], (function (exports, c) { 'use strict'; function B() { return { icon: c.c.faPrint }; } exports.B = B; })); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/amd/generated-c.js000066400000000000000000000003201450520414700326600ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var c = {}; (function (exports) { exports.preFaPrint = { foo: 1 }; exports.faPrint = exports.preFaPrint; } (c)); exports.c = c; })); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/amd/main.js000066400000000000000000000005021450520414700314300ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; const importA = () => new Promise(function (resolve, reject) { require(['./generated-a'], resolve, reject); }); const importB = () => new Promise(function (resolve, reject) { require(['./generated-b'], resolve, reject); }); console.log(importA, importB); })); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/cjs/000077500000000000000000000000001450520414700301675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/cjs/generated-a.js000066400000000000000000000001651450520414700327030ustar00rootroot00000000000000'use strict'; var c = require('./generated-c.js'); function A() { return { icon: c.c.faPrint }; } exports.A = A; rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/cjs/generated-b.js000066400000000000000000000001651450520414700327040ustar00rootroot00000000000000'use strict'; var c = require('./generated-c.js'); function B() { return { icon: c.c.faPrint }; } exports.B = B; rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/cjs/generated-c.js000066400000000000000000000002301450520414700326760ustar00rootroot00000000000000'use strict'; var c = {}; (function (exports) { exports.preFaPrint = { foo: 1 }; exports.faPrint = exports.preFaPrint; } (c)); exports.c = c; rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/cjs/main.js000066400000000000000000000003651450520414700314550ustar00rootroot00000000000000'use strict'; const importA = () => Promise.resolve().then(function () { return require('./generated-a.js'); }); const importB = () => Promise.resolve().then(function () { return require('./generated-b.js'); }); console.log(importA, importB); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/es/000077500000000000000000000000001450520414700300175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/es/generated-a.js000066400000000000000000000001441450520414700325300ustar00rootroot00000000000000import { c } from './generated-c.js'; function A() { return { icon: c.faPrint }; } export { A }; rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/es/generated-b.js000066400000000000000000000001441450520414700325310ustar00rootroot00000000000000import { c } from './generated-c.js'; function B() { return { icon: c.faPrint }; } export { B }; rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/es/generated-c.js000066400000000000000000000002101450520414700325240ustar00rootroot00000000000000var c = {}; (function (exports) { exports.preFaPrint = { foo: 1 }; exports.faPrint = exports.preFaPrint; } (c)); export { c }; rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/es/main.js000066400000000000000000000002041450520414700312750ustar00rootroot00000000000000const importA = () => import('./generated-a.js'); const importB = () => import('./generated-b.js'); console.log(importA, importB); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/system/000077500000000000000000000000001450520414700307345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/system/generated-a.js000066400000000000000000000004121450520414700334430ustar00rootroot00000000000000System.register(['./generated-c.js'], (function (exports) { 'use strict'; var c; return { setters: [function (module) { c = module.c; }], execute: (function () { exports('A', A); function A() { return { icon: c.faPrint }; } }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/system/generated-b.js000066400000000000000000000004121450520414700334440ustar00rootroot00000000000000System.register(['./generated-c.js'], (function (exports) { 'use strict'; var c; return { setters: [function (module) { c = module.c; }], execute: (function () { exports('B', B); function B() { return { icon: c.faPrint }; } }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/system/generated-c.js000066400000000000000000000004111450520414700334440ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var c = exports('c', {}); (function (exports) { exports.preFaPrint = { foo: 1 }; exports.faPrint = exports.preFaPrint; } (c)); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/system/main.js000066400000000000000000000004201450520414700322120ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const importA = () => module.import('./generated-a.js'); const importB = () => module.import('./generated-b.js'); console.log(importA, importB); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/a.js000066400000000000000000000001261450520414700262250ustar00rootroot00000000000000import { faPrint } from './c.js'; export function A() { return { icon: faPrint }; } rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/b.js000066400000000000000000000001261450520414700262260ustar00rootroot00000000000000import { faPrint } from './c.js'; export function B() { return { icon: faPrint }; } rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/c.js000066400000000000000000000001111450520414700262210ustar00rootroot00000000000000exports.preFaPrint = { foo: 1 }; exports.faPrint = exports.preFaPrint; rollup-3.29.4/test/chunking-form/samples/chunk-assigment-in-dynamic/main.js000066400000000000000000000001601450520414700267270ustar00rootroot00000000000000const importA = () => import('./a.js'); const importB = () => import('./b.js'); console.log(importA, importB); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/000077500000000000000000000000001450520414700264215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_config.js000066400000000000000000000002421450520414700303610ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunk reassignment import deshadowing', options: { input: ['main1.js', 'main2.js', 'main3.js', 'main4.js'] } }); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/000077500000000000000000000000001450520414700303615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/000077500000000000000000000000001450520414700311225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main1.js000066400000000000000000000002021450520414700324570ustar00rootroot00000000000000define(['./main2', './main3', './main4'], (function (main2, main3, main4) { 'use strict'; console.log(main2.x + main2.y); })); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main2.js000066400000000000000000000003431450520414700324660ustar00rootroot00000000000000define(['exports', './main3', './main4'], (function (exports, main3, main4) { 'use strict'; var x = main3.x + 1; console.log('shared1'); var y = main4.x + 1; console.log('shared2'); exports.x = x; exports.y = y; })); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main3.js000066400000000000000000000001631450520414700324670ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var x = 42; console.log('dep1'); exports.x = x; })); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/amd/main4.js000066400000000000000000000001631450520414700324700ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var x = 43; console.log('dep2'); exports.x = x; })); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/000077500000000000000000000000001450520414700311405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main1.js000066400000000000000000000002011450520414700324740ustar00rootroot00000000000000'use strict'; var main2 = require('./main2.js'); require('./main3.js'); require('./main4.js'); console.log(main2.x + main2.y); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main2.js000066400000000000000000000003201450520414700324770ustar00rootroot00000000000000'use strict'; var main3 = require('./main3.js'); var main4 = require('./main4.js'); var x = main3.x + 1; console.log('shared1'); var y = main4.x + 1; console.log('shared2'); exports.x = x; exports.y = y; rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main3.js000066400000000000000000000001001450520414700324740ustar00rootroot00000000000000'use strict'; var x = 42; console.log('dep1'); exports.x = x; rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/cjs/main4.js000066400000000000000000000001001450520414700324750ustar00rootroot00000000000000'use strict'; var x = 43; console.log('dep2'); exports.x = x; rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/000077500000000000000000000000001450520414700307705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main1.js000066400000000000000000000001421450520414700323300ustar00rootroot00000000000000import { x, y } from './main2.js'; import './main3.js'; import './main4.js'; console.log(x + y); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main2.js000066400000000000000000000002641450520414700323360ustar00rootroot00000000000000import { x as x$1 } from './main3.js'; import { x as x$2 } from './main4.js'; var x = x$1 + 1; console.log('shared1'); var y = x$2 + 1; console.log('shared2'); export { x, y }; rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main3.js000066400000000000000000000000601450520414700323310ustar00rootroot00000000000000var x = 42; console.log('dep1'); export { x }; rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/es/main4.js000066400000000000000000000000601450520414700323320ustar00rootroot00000000000000var x = 43; console.log('dep2'); export { x }; rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/000077500000000000000000000000001450520414700317055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main1.js000066400000000000000000000004041450520414700332460ustar00rootroot00000000000000System.register(['./main2.js', './main3.js', './main4.js'], (function () { 'use strict'; var x, y; return { setters: [function (module) { x = module.x; y = module.y; }, null, null], execute: (function () { console.log(x + y); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main2.js000066400000000000000000000005661450520414700332600ustar00rootroot00000000000000System.register(['./main3.js', './main4.js'], (function (exports) { 'use strict'; var x$1, x$2; return { setters: [function (module) { x$1 = module.x; }, function (module) { x$2 = module.x; }], execute: (function () { var x = exports('x', x$1 + 1); console.log('shared1'); var y = exports('y', x$2 + 1); console.log('shared2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main3.js000066400000000000000000000002421450520414700332500ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var x = exports('x', 42); console.log('dep1'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/_expected/system/main4.js000066400000000000000000000002421450520414700332510ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var x = exports('x', 43); console.log('dep2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/dep1.js000066400000000000000000000000631450520414700276070ustar00rootroot00000000000000var x = 42; export default x; console.log('dep1'); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/dep2.js000066400000000000000000000000631450520414700276100ustar00rootroot00000000000000var x = 43; export default x; console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/main1.js000066400000000000000000000001201450520414700277550ustar00rootroot00000000000000import x from './shared1.js'; import y from './shared2.js'; console.log(x + y);rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/main2.js000066400000000000000000000000551450520414700277650ustar00rootroot00000000000000import './shared1.js'; import './shared2.js';rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/main3.js000066400000000000000000000000231450520414700277610ustar00rootroot00000000000000import './dep1.js';rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/main4.js000066400000000000000000000000231450520414700277620ustar00rootroot00000000000000import './dep2.js';rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/shared1.js000066400000000000000000000001351450520414700303050ustar00rootroot00000000000000import './dep1.js'; import x from './dep1.js'; export default x + 1; console.log('shared1'); rollup-3.29.4/test/chunking-form/samples/chunk-deshadowing-reassignment/shared2.js000066400000000000000000000001351450520414700303060ustar00rootroot00000000000000import './dep2.js'; import x from './dep2.js'; export default x + 1; console.log('shared2'); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/000077500000000000000000000000001450520414700245445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_config.js000066400000000000000000000002271450520414700265070ustar00rootroot00000000000000module.exports = defineTest({ description: 'maintains execution order ', options: { input: ['main1.js', 'main2.js', 'main3.js', 'main4.js'] } }); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/000077500000000000000000000000001450520414700265045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/amd/000077500000000000000000000000001450520414700272455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/amd/main1.js000066400000000000000000000002141450520414700306050ustar00rootroot00000000000000define(['./main2', './main4', './main3'], (function (main2, main4, main3) { 'use strict'; console.log('1'); console.log(main4.x); })); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/amd/main2.js000066400000000000000000000001431450520414700306070ustar00rootroot00000000000000define(['./main3', './main4'], (function (main3, main4) { 'use strict'; console.log('11'); })); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/amd/main3.js000066400000000000000000000001001450520414700306010ustar00rootroot00000000000000define((function () { 'use strict'; console.log('111'); })); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/amd/main4.js000066400000000000000000000001631450520414700306130ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const x = 0; console.log('112'); exports.x = x; })); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/cjs/000077500000000000000000000000001450520414700272635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main1.js000066400000000000000000000002121450520414700306210ustar00rootroot00000000000000'use strict'; require('./main2.js'); var main4 = require('./main4.js'); require('./main3.js'); console.log('1'); console.log(main4.x); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main2.js000066400000000000000000000001211450520414700306210ustar00rootroot00000000000000'use strict'; require('./main3.js'); require('./main4.js'); console.log('11'); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main3.js000066400000000000000000000000431450520414700306250ustar00rootroot00000000000000'use strict'; console.log('111'); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/cjs/main4.js000066400000000000000000000001001450520414700306200ustar00rootroot00000000000000'use strict'; const x = 0; console.log('112'); exports.x = x; rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/es/000077500000000000000000000000001450520414700271135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/es/main1.js000066400000000000000000000001561450520414700304600ustar00rootroot00000000000000import './main2.js'; import { x } from './main4.js'; import './main3.js'; console.log('1'); console.log(x); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/es/main2.js000066400000000000000000000000761450520414700304620ustar00rootroot00000000000000import './main3.js'; import './main4.js'; console.log('11'); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/es/main3.js000066400000000000000000000000241450520414700304540ustar00rootroot00000000000000console.log('111'); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/es/main4.js000066400000000000000000000000601450520414700304550ustar00rootroot00000000000000const x = 0; console.log('112'); export { x }; rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/system/000077500000000000000000000000001450520414700300305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/system/main1.js000066400000000000000000000004021450520414700313670ustar00rootroot00000000000000System.register(['./main2.js', './main4.js', './main3.js'], (function () { 'use strict'; var x; return { setters: [null, function (module) { x = module.x; }, null], execute: (function () { console.log('1'); console.log(x); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/system/main2.js000066400000000000000000000002571450520414700314000ustar00rootroot00000000000000System.register(['./main3.js', './main4.js'], (function () { 'use strict'; return { setters: [null, null], execute: (function () { console.log('11'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/system/main3.js000066400000000000000000000001751450520414700314000ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('111'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/_expected/system/main4.js000066400000000000000000000002421450520414700313740ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const x = exports('x', 0); console.log('112'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/dep1.js000066400000000000000000000000621450520414700257310ustar00rootroot00000000000000export { x } from './dep11.js'; console.log('1'); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/dep11.js000066400000000000000000000001121450520414700260060ustar00rootroot00000000000000import './dep111.js'; export { x } from './dep112.js'; console.log('11'); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/dep111.js000066400000000000000000000000241450520414700260710ustar00rootroot00000000000000console.log('111'); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/dep112.js000066400000000000000000000000501450520414700260710ustar00rootroot00000000000000export const x = 0; console.log('112'); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/main1.js000066400000000000000000000000601450520414700261030ustar00rootroot00000000000000import { x } from './dep1.js'; console.log(x); rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/main2.js000066400000000000000000000000251450520414700261050ustar00rootroot00000000000000import './dep11.js'; rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/main3.js000066400000000000000000000000261450520414700261070ustar00rootroot00000000000000import './dep111.js'; rollup-3.29.4/test/chunking-form/samples/chunk-execution-order/main4.js000066400000000000000000000000261450520414700261100ustar00rootroot00000000000000import './dep112.js'; rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/000077500000000000000000000000001450520414700252435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_config.js000066400000000000000000000002511450520414700272030ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunk export deshadowing', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/000077500000000000000000000000001450520414700272035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/amd/000077500000000000000000000000001450520414700277445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/amd/generated-dep1.js000066400000000000000000000005001450520414700330620ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn$2 () { console.log('lib fn'); } function fn$1 () { fn$2(); console.log(text); } var text$1 = 'dep1 fn'; function fn () { console.log(text$1); } var text = 'dep2 fn'; exports.fn = fn; exports.fn$1 = fn$1; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/amd/main1.js000066400000000000000000000002261450520414700313070ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; class Main1 { constructor () { dep1.fn(); } } return Main1; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/amd/main2.js000066400000000000000000000002301450520414700313030ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; class Main2 { constructor () { dep1.fn$1(); } } return Main2; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/cjs/000077500000000000000000000000001450520414700277625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/cjs/generated-dep1.js000066400000000000000000000003641450520414700331100ustar00rootroot00000000000000'use strict'; function fn$2 () { console.log('lib fn'); } function fn$1 () { fn$2(); console.log(text); } var text$1 = 'dep1 fn'; function fn () { console.log(text$1); } var text = 'dep2 fn'; exports.fn = fn; exports.fn$1 = fn$1; rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/cjs/main1.js000066400000000000000000000002121450520414700313200ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); class Main1 { constructor () { dep1.fn(); } } module.exports = Main1; rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/cjs/main2.js000066400000000000000000000002141450520414700313230ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); class Main2 { constructor () { dep1.fn$1(); } } module.exports = Main2; rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/es/000077500000000000000000000000001450520414700276125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/es/generated-dep1.js000066400000000000000000000003361450520414700327370ustar00rootroot00000000000000function fn$2 () { console.log('lib fn'); } function fn$1 () { fn$2(); console.log(text); } var text$1 = 'dep1 fn'; function fn () { console.log(text$1); } var text = 'dep2 fn'; export { fn$1 as a, fn as f }; rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/es/main1.js000066400000000000000000000001771450520414700311620ustar00rootroot00000000000000import { f as fn } from './generated-dep1.js'; class Main1 { constructor () { fn(); } } export { Main1 as default }; rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/es/main2.js000066400000000000000000000001771450520414700311630ustar00rootroot00000000000000import { a as fn } from './generated-dep1.js'; class Main2 { constructor () { fn(); } } export { Main2 as default }; rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/system/000077500000000000000000000000001450520414700305275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/system/generated-dep1.js000066400000000000000000000006641450520414700336600ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports({ a: fn$1, f: fn }); function fn$2 () { console.log('lib fn'); } function fn$1 () { fn$2(); console.log(text); } var text$1 = 'dep1 fn'; function fn () { console.log(text$1); } var text = 'dep2 fn'; }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/system/main1.js000066400000000000000000000004741450520414700320770ustar00rootroot00000000000000System.register(['./generated-dep1.js'], (function (exports) { 'use strict'; var fn; return { setters: [function (module) { fn = module.f; }], execute: (function () { class Main1 { constructor () { fn(); } } exports('default', Main1); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/_expected/system/main2.js000066400000000000000000000004741450520414700321000ustar00rootroot00000000000000System.register(['./generated-dep1.js'], (function (exports) { 'use strict'; var fn; return { setters: [function (module) { fn = module.a; }], execute: (function () { class Main2 { constructor () { fn(); } } exports('default', Main2); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/dep1.js000066400000000000000000000001611450520414700264300ustar00rootroot00000000000000import { text as t } from './dep2.js'; export function fn () { console.log(t); } export var text = 'dep2 fn';rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/dep2.js000066400000000000000000000002441450520414700264330ustar00rootroot00000000000000import { text as t } from './dep1.js'; import { fn as libfn } from './lib.js'; export function fn () { libfn(); console.log(t); } export var text = 'dep1 fn';rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/lib.js000066400000000000000000000000621450520414700263450ustar00rootroot00000000000000export function fn () { console.log('lib fn'); }rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/main1.js000066400000000000000000000001401450520414700266010ustar00rootroot00000000000000import { fn } from './dep1.js'; export default class Main1 { constructor () { fn(); } }rollup-3.29.4/test/chunking-form/samples/chunk-export-deshadowing/main2.js000066400000000000000000000001401450520414700266020ustar00rootroot00000000000000import { fn } from './dep2.js'; export default class Main2 { constructor () { fn(); } }rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/000077500000000000000000000000001450520414700245475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_config.js000066400000000000000000000001721450520414700265110ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunk export renaming', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/000077500000000000000000000000001450520414700265075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/amd/000077500000000000000000000000001450520414700272505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/amd/generated-main1.js000066400000000000000000000003451450520414700325510ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; class One { test() { return ONE_CONSTANT; } } const ONE_CONSTANT = 'oneconstant'; exports.ONE_CONSTANT = ONE_CONSTANT; exports.One = One; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/amd/main1.js000066400000000000000000000001731450520414700306140ustar00rootroot00000000000000define(['exports', './generated-main1'], (function (exports, main1) { 'use strict'; exports.ItemOne = main1.One; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/amd/main2.js000066400000000000000000000003171450520414700306150ustar00rootroot00000000000000define(['exports', './generated-main1'], (function (exports, main1) { 'use strict'; class Two { test() { return main1.ONE_CONSTANT; } } exports.ItemTwo = Two; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/cjs/000077500000000000000000000000001450520414700272665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/cjs/generated-main1.js000066400000000000000000000002451450520414700325660ustar00rootroot00000000000000'use strict'; class One { test() { return ONE_CONSTANT; } } const ONE_CONSTANT = 'oneconstant'; exports.ONE_CONSTANT = ONE_CONSTANT; exports.One = One; rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/cjs/main1.js000066400000000000000000000001341450520414700306270ustar00rootroot00000000000000'use strict'; var main1 = require('./generated-main1.js'); exports.ItemOne = main1.One; rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/cjs/main2.js000066400000000000000000000002311450520414700306260ustar00rootroot00000000000000'use strict'; var main1 = require('./generated-main1.js'); class Two { test() { return main1.ONE_CONSTANT; } } exports.ItemTwo = Two; rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/es/000077500000000000000000000000001450520414700271165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/es/generated-main1.js000066400000000000000000000002061450520414700324130ustar00rootroot00000000000000class One { test() { return ONE_CONSTANT; } } const ONE_CONSTANT = 'oneconstant'; export { ONE_CONSTANT as O, One as a }; rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/es/main1.js000066400000000000000000000000651450520414700304620ustar00rootroot00000000000000export { a as ItemOne } from './generated-main1.js'; rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/es/main2.js000066400000000000000000000002251450520414700304610ustar00rootroot00000000000000import { O as ONE_CONSTANT } from './generated-main1.js'; class Two { test() { return ONE_CONSTANT; } } export { Two as ItemTwo }; rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/system/000077500000000000000000000000001450520414700300335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/system/generated-main1.js000066400000000000000000000004261450520414700333340ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { class One { test() { return ONE_CONSTANT; } } exports('a', One); const ONE_CONSTANT = exports('O', 'oneconstant'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/system/main1.js000066400000000000000000000003131450520414700313730ustar00rootroot00000000000000System.register(['./generated-main1.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('ItemOne', module.a); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/_expected/system/main2.js000066400000000000000000000006301450520414700313760ustar00rootroot00000000000000System.register(['./generated-main1.js'], (function (exports) { 'use strict'; var ONE_CONSTANT; return { setters: [function (module) { ONE_CONSTANT = module.O; }], execute: (function () { class Two { test() { return ONE_CONSTANT; } } exports('ItemTwo', Two); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/main1.js000066400000000000000000000000521450520414700261070ustar00rootroot00000000000000export { One as ItemOne } from './one.js';rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/main2.js000066400000000000000000000000521450520414700261100ustar00rootroot00000000000000export { Two as ItemTwo } from './two.js';rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/one.js000066400000000000000000000001521450520414700256640ustar00rootroot00000000000000export class One { test() { return ONE_CONSTANT; } } export const ONE_CONSTANT = 'oneconstant';rollup-3.29.4/test/chunking-form/samples/chunk-export-renaming/two.js000066400000000000000000000001531450520414700257150ustar00rootroot00000000000000import { ONE_CONSTANT } from './one'; export class Two { test() { return ONE_CONSTANT; } }rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/000077500000000000000000000000001450520414700252345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_config.js000066400000000000000000000001751450520414700272010ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunk import deshadowing', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/000077500000000000000000000000001450520414700271745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/amd/000077500000000000000000000000001450520414700277355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/amd/generated-lib.js000066400000000000000000000002331450520414700327730ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function emptyFunction() {} console.log('lib'); exports.emptyFunction = emptyFunction; })); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/amd/main1.js000066400000000000000000000002751450520414700313040ustar00rootroot00000000000000define(['./generated-lib'], (function (lib) { 'use strict'; function fn() { var emptyFunction = lib.emptyFunction; console.log(emptyFunction); } console.log('dep1'); fn(); })); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/amd/main2.js000066400000000000000000000001311450520414700312740ustar00rootroot00000000000000define(['./generated-lib'], (function (lib) { 'use strict'; console.log('dep2'); })); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/cjs/000077500000000000000000000000001450520414700277535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/cjs/generated-lib.js000066400000000000000000000001501450520414700330070ustar00rootroot00000000000000'use strict'; function emptyFunction() {} console.log('lib'); exports.emptyFunction = emptyFunction; rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/cjs/main1.js000066400000000000000000000002551450520414700313200ustar00rootroot00000000000000'use strict'; var lib = require('./generated-lib.js'); function fn() { var emptyFunction = lib.emptyFunction; console.log(emptyFunction); } console.log('dep1'); fn(); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/cjs/main2.js000066400000000000000000000001041450520414700313120ustar00rootroot00000000000000'use strict'; require('./generated-lib.js'); console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/es/000077500000000000000000000000001450520414700276035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/es/generated-lib.js000066400000000000000000000001211450520414700326350ustar00rootroot00000000000000function emptyFunction() {} console.log('lib'); export { emptyFunction as e }; rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/es/main1.js000066400000000000000000000002561450520414700311510ustar00rootroot00000000000000import { e as emptyFunction } from './generated-lib.js'; function fn() { var emptyFunction$1 = emptyFunction; console.log(emptyFunction$1); } console.log('dep1'); fn(); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/es/main2.js000066400000000000000000000000631450520414700311460ustar00rootroot00000000000000import './generated-lib.js'; console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/system/000077500000000000000000000000001450520414700305205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/system/generated-lib.js000066400000000000000000000003051450520414700335560ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('e', emptyFunction); function emptyFunction() {} console.log('lib'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/system/main1.js000066400000000000000000000005271450520414700320670ustar00rootroot00000000000000System.register(['./generated-lib.js'], (function () { 'use strict'; var emptyFunction; return { setters: [function (module) { emptyFunction = module.e; }], execute: (function () { function fn() { var emptyFunction$1 = emptyFunction; console.log(emptyFunction$1); } console.log('dep1'); fn(); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/_expected/system/main2.js000066400000000000000000000002451450520414700320650ustar00rootroot00000000000000System.register(['./generated-lib.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('dep2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/dep1.js000066400000000000000000000002211450520414700264160ustar00rootroot00000000000000import { emptyFunction as x } from './lib'; export function fn() { var emptyFunction = x; console.log(emptyFunction); } console.log('dep1'); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/dep2.js000066400000000000000000000001351450520414700264230ustar00rootroot00000000000000import { another } from './lib'; export function fn() { another(); } console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/lib.js000066400000000000000000000001261450520414700263370ustar00rootroot00000000000000export function emptyFunction() {} export function another() {} console.log('lib'); rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/main1.js000066400000000000000000000000461450520414700265770ustar00rootroot00000000000000import { fn } from './dep1.js'; fn();rollup-3.29.4/test/chunking-form/samples/chunk-import-deshadowing/main2.js000066400000000000000000000000461450520414700266000ustar00rootroot00000000000000import { fn } from './dep2.js'; fn();rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/000077500000000000000000000000001450520414700241625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_config.js000066400000000000000000000002621450520414700261240ustar00rootroot00000000000000module.exports = defineTest({ description: 'ES module live bindings in chunks', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/000077500000000000000000000000001450520414700261225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/amd/000077500000000000000000000000001450520414700266635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/amd/generated-dep1.js000066400000000000000000000006541450520414700320130ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn$2 () { console.log('lib fn'); } function fn$1 () { fn$2(); console.log(exports.text); exports.text$1 = 'dep1 fn after dep2'; } exports.text$1 = 'dep1 fn'; function fn () { console.log(exports.text$1); exports.text = 'dep2 fn after dep1'; } exports.text = 'dep2 fn'; exports.fn = fn; exports.fn$1 = fn$1; })); rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/amd/main1.js000066400000000000000000000002641450520414700302300ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; class Main1 { constructor () { dep1.fn(); console.log(dep1.text); } } return Main1; })); rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/amd/main2.js000066400000000000000000000002701450520414700302260ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; class Main2 { constructor () { dep1.fn$1(); console.log(dep1.text$1); } } return Main2; })); rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/cjs/000077500000000000000000000000001450520414700267015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/cjs/generated-dep1.js000066400000000000000000000005341450520414700320260ustar00rootroot00000000000000'use strict'; function fn$2 () { console.log('lib fn'); } function fn$1 () { fn$2(); console.log(exports.text); exports.text$1 = 'dep1 fn after dep2'; } exports.text$1 = 'dep1 fn'; function fn () { console.log(exports.text$1); exports.text = 'dep2 fn after dep1'; } exports.text = 'dep2 fn'; exports.fn = fn; exports.fn$1 = fn$1; rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/cjs/main1.js000066400000000000000000000002461450520414700302460ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); class Main1 { constructor () { dep1.fn(); console.log(dep1.text); } } module.exports = Main1; rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/cjs/main2.js000066400000000000000000000002521450520414700302440ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); class Main2 { constructor () { dep1.fn$1(); console.log(dep1.text$1); } } module.exports = Main2; rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/es/000077500000000000000000000000001450520414700265315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/es/generated-dep1.js000066400000000000000000000004661450520414700316620ustar00rootroot00000000000000function fn$2 () { console.log('lib fn'); } function fn$1 () { fn$2(); console.log(text); text$1 = 'dep1 fn after dep2'; } var text$1 = 'dep1 fn'; function fn () { console.log(text$1); text = 'dep2 fn after dep1'; } var text = 'dep2 fn'; export { fn$1 as a, text$1 as b, fn as f, text as t }; rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/es/main1.js000066400000000000000000000002411450520414700300710ustar00rootroot00000000000000import { f as fn, t as text } from './generated-dep1.js'; class Main1 { constructor () { fn(); console.log(text); } } export { Main1 as default }; rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/es/main2.js000066400000000000000000000002411450520414700300720ustar00rootroot00000000000000import { a as fn, b as text } from './generated-dep1.js'; class Main2 { constructor () { fn(); console.log(text); } } export { Main2 as default }; rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/system/000077500000000000000000000000001450520414700274465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/system/generated-dep1.js000066400000000000000000000010701450520414700325670ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports({ a: fn$1, f: fn }); function fn$2 () { console.log('lib fn'); } function fn$1 () { fn$2(); console.log(text); exports('b', text$1 = 'dep1 fn after dep2'); } var text$1 = exports('b', 'dep1 fn'); function fn () { console.log(text$1); exports('t', text = 'dep2 fn after dep1'); } var text = exports('t', 'dep2 fn'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/system/main1.js000066400000000000000000000005661450520414700310200ustar00rootroot00000000000000System.register(['./generated-dep1.js'], (function (exports) { 'use strict'; var fn, text; return { setters: [function (module) { fn = module.f; text = module.t; }], execute: (function () { class Main1 { constructor () { fn(); console.log(text); } } exports('default', Main1); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/_expected/system/main2.js000066400000000000000000000005661450520414700310210ustar00rootroot00000000000000System.register(['./generated-dep1.js'], (function (exports) { 'use strict'; var fn, text; return { setters: [function (module) { fn = module.a; text = module.b; }], execute: (function () { class Main2 { constructor () { fn(); console.log(text); } } exports('default', Main2); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/dep1.js000066400000000000000000000002201450520414700253430ustar00rootroot00000000000000import { text as t } from './dep2.js'; export function fn () { console.log(t); text = 'dep2 fn after dep1'; } export var text = 'dep2 fn';rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/dep2.js000066400000000000000000000003031450520414700253460ustar00rootroot00000000000000import { text as t } from './dep1.js'; import { fn as libfn } from './lib.js'; export function fn () { libfn(); console.log(t); text = 'dep1 fn after dep2'; } export var text = 'dep1 fn';rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/lib.js000066400000000000000000000000621450520414700252640ustar00rootroot00000000000000export function fn () { console.log('lib fn'); }rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/main1.js000066400000000000000000000001751450520414700255300ustar00rootroot00000000000000import { fn, text } from './dep1.js'; export default class Main1 { constructor () { fn(); console.log(text); } }rollup-3.29.4/test/chunking-form/samples/chunk-live-bindings/main2.js000066400000000000000000000001751450520414700255310ustar00rootroot00000000000000import { fn, text } from './dep2.js'; export default class Main2 { constructor () { fn(); console.log(text); } }rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/000077500000000000000000000000001450520414700252055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_config.js000066400000000000000000000002041450520414700271430ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunk with a namespace boundary', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/000077500000000000000000000000001450520414700271455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/amd/000077500000000000000000000000001450520414700277065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/amd/generated-shared.js000066400000000000000000000005761450520414700334560ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; commonjsGlobal.data = [4, 5, 6]; var shared = commonjsGlobal.data; exports.commonjsGlobal = commonjsGlobal; exports.shared = shared; })); rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/amd/main1.js000066400000000000000000000003141450520414700312470ustar00rootroot00000000000000define(['./generated-shared'], (function (shared) { 'use strict'; shared.commonjsGlobal.fn = d => d + 1; var cjs = shared.commonjsGlobal.fn; var main1 = shared.shared.map(cjs); return main1; })); rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/amd/main2.js000066400000000000000000000002051450520414700312470ustar00rootroot00000000000000define(['./generated-shared'], (function (shared) { 'use strict'; var main2 = shared.shared.map(d => d + 2); return main2; })); rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/cjs/000077500000000000000000000000001450520414700277245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/cjs/generated-shared.js000066400000000000000000000004461450520414700334700ustar00rootroot00000000000000'use strict'; var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; commonjsGlobal.data = [4, 5, 6]; var shared = commonjsGlobal.data; exports.commonjsGlobal = commonjsGlobal; exports.shared = shared; rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/cjs/main1.js000066400000000000000000000003101450520414700312610ustar00rootroot00000000000000'use strict'; var shared = require('./generated-shared.js'); shared.commonjsGlobal.fn = d => d + 1; var cjs = shared.commonjsGlobal.fn; var main1 = shared.shared.map(cjs); module.exports = main1; rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/cjs/main2.js000066400000000000000000000002031450520414700312630ustar00rootroot00000000000000'use strict'; var shared = require('./generated-shared.js'); var main2 = shared.shared.map(d => d + 2); module.exports = main2; rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/es/000077500000000000000000000000001450520414700275545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/es/generated-shared.js000066400000000000000000000004021450520414700333100ustar00rootroot00000000000000var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; commonjsGlobal.data = [4, 5, 6]; var shared = commonjsGlobal.data; export { commonjsGlobal as c, shared as s }; rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/es/main1.js000066400000000000000000000003041450520414700311140ustar00rootroot00000000000000import { c as commonjsGlobal, s as shared } from './generated-shared.js'; commonjsGlobal.fn = d => d + 1; var cjs = commonjsGlobal.fn; var main1 = shared.map(cjs); export { main1 as default }; rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/es/main2.js000066400000000000000000000001701450520414700311160ustar00rootroot00000000000000import { s as shared } from './generated-shared.js'; var main2 = shared.map(d => d + 2); export { main2 as default }; rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/system/000077500000000000000000000000001450520414700304715ustar00rootroot00000000000000generated-shared.js000066400000000000000000000007261450520414700341570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var commonjsGlobal = exports('c', typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}); commonjsGlobal.data = [4, 5, 6]; var shared = exports('s', commonjsGlobal.data); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/system/main1.js000066400000000000000000000005631450520414700320400ustar00rootroot00000000000000System.register(['./generated-shared.js'], (function (exports) { 'use strict'; var commonjsGlobal, shared; return { setters: [function (module) { commonjsGlobal = module.c; shared = module.s; }], execute: (function () { commonjsGlobal.fn = d => d + 1; var cjs = commonjsGlobal.fn; var main1 = exports('default', shared.map(cjs)); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/_expected/system/main2.js000066400000000000000000000004101450520414700320300ustar00rootroot00000000000000System.register(['./generated-shared.js'], (function (exports) { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { var main2 = exports('default', shared.map(d => d + 2)); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/cjs.js000066400000000000000000000003141450520414700263200ustar00rootroot00000000000000import * as commonjsHelpers from './commonjsHelpers'; commonjsHelpers.commonjsGlobal.fn = d => d + 1; var cjs = commonjsHelpers.commonjsGlobal.fn; export default cjs; export { cjs as __moduleExports }; rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/commonjsHelpers.js000066400000000000000000000010771450520414700307200ustar00rootroot00000000000000export var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; export function commonjsRequire () { throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); } export function unwrapExports (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } export function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/main1.js000066400000000000000000000001141450520414700265440ustar00rootroot00000000000000import e from './shared'; import fn from './cjs'; export default e.map(fn); rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/main2.js000066400000000000000000000000741450520414700265520ustar00rootroot00000000000000import d from './shared'; export default d.map(d => d + 2); rollup-3.29.4/test/chunking-form/samples/chunk-namespace-boundary/shared.js000066400000000000000000000003301450520414700270050ustar00rootroot00000000000000import * as commonjsHelpers from './commonjsHelpers'; commonjsHelpers.commonjsGlobal.data = [4, 5, 6]; var shared = commonjsHelpers.commonjsGlobal.data; export default shared; export { shared as __moduleExports }; rollup-3.29.4/test/chunking-form/samples/chunk-naming/000077500000000000000000000000001450520414700227015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_config.js000066400000000000000000000003441450520414700246440ustar00rootroot00000000000000module.exports = defineTest({ description: 'simple chunking', options: { input: { entryA: 'main1.js', entryB: 'main2.js', 'custom/entryC': 'main3.js' }, output: { chunkFileNames: 'chunks/chunk.js' } } }); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/000077500000000000000000000000001450520414700246415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/amd/000077500000000000000000000000001450520414700254025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/amd/chunks/000077500000000000000000000000001450520414700266755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/amd/chunks/chunk.js000066400000000000000000000001421450520414700303400ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 1; exports.num = num; })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/amd/chunks/chunk2.js000066400000000000000000000001421450520414700304220ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 2; exports.num = num; })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/amd/chunks/chunk3.js000066400000000000000000000001421450520414700304230ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 3; exports.num = num; })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/amd/custom/000077500000000000000000000000001450520414700267145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/amd/custom/entryC.js000066400000000000000000000002011450520414700305070ustar00rootroot00000000000000define(['../chunks/chunk', '../chunks/chunk3'], (function (dep1, dep3) { 'use strict'; console.log(dep1.num + dep3.num); })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/amd/entryA.js000066400000000000000000000001771450520414700272070ustar00rootroot00000000000000define(['./chunks/chunk', './chunks/chunk2'], (function (dep1, dep2) { 'use strict'; console.log(dep1.num + dep2.num); })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/amd/entryB.js000066400000000000000000000002001450520414700271730ustar00rootroot00000000000000define(['./chunks/chunk2', './chunks/chunk3'], (function (dep2, dep3) { 'use strict'; console.log(dep2.num + dep3.num); })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/cjs/000077500000000000000000000000001450520414700254205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/cjs/chunks/000077500000000000000000000000001450520414700267135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/cjs/chunks/chunk.js000066400000000000000000000000601450520414700303550ustar00rootroot00000000000000'use strict'; var num = 1; exports.num = num; rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/cjs/chunks/chunk2.js000066400000000000000000000000601450520414700304370ustar00rootroot00000000000000'use strict'; var num = 2; exports.num = num; rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/cjs/chunks/chunk3.js000066400000000000000000000000601450520414700304400ustar00rootroot00000000000000'use strict'; var num = 3; exports.num = num; rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/cjs/custom/000077500000000000000000000000001450520414700267325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/cjs/custom/entryC.js000066400000000000000000000002071450520414700305330ustar00rootroot00000000000000'use strict'; var dep1 = require('../chunks/chunk.js'); var dep3 = require('../chunks/chunk3.js'); console.log(dep1.num + dep3.num); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/cjs/entryA.js000066400000000000000000000002051450520414700272150ustar00rootroot00000000000000'use strict'; var dep1 = require('./chunks/chunk.js'); var dep2 = require('./chunks/chunk2.js'); console.log(dep1.num + dep2.num); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/cjs/entryB.js000066400000000000000000000002061450520414700272170ustar00rootroot00000000000000'use strict'; var dep2 = require('./chunks/chunk2.js'); var dep3 = require('./chunks/chunk3.js'); console.log(dep2.num + dep3.num); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/es/000077500000000000000000000000001450520414700252505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/es/chunks/000077500000000000000000000000001450520414700265435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/es/chunks/chunk.js000066400000000000000000000000431450520414700302060ustar00rootroot00000000000000var num = 1; export { num as n }; rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/es/chunks/chunk2.js000066400000000000000000000000431450520414700302700ustar00rootroot00000000000000var num = 2; export { num as n }; rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/es/chunks/chunk3.js000066400000000000000000000000431450520414700302710ustar00rootroot00000000000000var num = 3; export { num as n }; rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/es/custom/000077500000000000000000000000001450520414700265625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/es/custom/entryC.js000066400000000000000000000001741450520414700303660ustar00rootroot00000000000000import { n as num } from '../chunks/chunk.js'; import { n as num$1 } from '../chunks/chunk3.js'; console.log(num + num$1); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/es/entryA.js000066400000000000000000000001721450520414700270500ustar00rootroot00000000000000import { n as num } from './chunks/chunk.js'; import { n as num$1 } from './chunks/chunk2.js'; console.log(num + num$1); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/es/entryB.js000066400000000000000000000001731450520414700270520ustar00rootroot00000000000000import { n as num } from './chunks/chunk2.js'; import { n as num$1 } from './chunks/chunk3.js'; console.log(num + num$1); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/system/000077500000000000000000000000001450520414700261655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/system/chunks/000077500000000000000000000000001450520414700274605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/system/chunks/chunk.js000066400000000000000000000002131450520414700311220ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 1); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/system/chunks/chunk2.js000066400000000000000000000002131450520414700312040ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 2); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/system/chunks/chunk3.js000066400000000000000000000002131450520414700312050ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 3); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/system/custom/000077500000000000000000000000001450520414700274775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/system/custom/entryC.js000066400000000000000000000004461450520414700313050ustar00rootroot00000000000000System.register(['../chunks/chunk.js', '../chunks/chunk3.js'], (function () { 'use strict'; var num, num$1; return { setters: [function (module) { num = module.n; }, function (module) { num$1 = module.n; }], execute: (function () { console.log(num + num$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/system/entryA.js000066400000000000000000000004441450520414700277670ustar00rootroot00000000000000System.register(['./chunks/chunk.js', './chunks/chunk2.js'], (function () { 'use strict'; var num, num$1; return { setters: [function (module) { num = module.n; }, function (module) { num$1 = module.n; }], execute: (function () { console.log(num + num$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/_expected/system/entryB.js000066400000000000000000000004451450520414700277710ustar00rootroot00000000000000System.register(['./chunks/chunk2.js', './chunks/chunk3.js'], (function () { 'use strict'; var num, num$1; return { setters: [function (module) { num = module.n; }, function (module) { num$1 = module.n; }], execute: (function () { console.log(num + num$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-naming/dep1.js000066400000000000000000000000231450520414700240630ustar00rootroot00000000000000export var num = 1;rollup-3.29.4/test/chunking-form/samples/chunk-naming/dep2.js000066400000000000000000000000231450520414700240640ustar00rootroot00000000000000export var num = 2;rollup-3.29.4/test/chunking-form/samples/chunk-naming/dep3.js000066400000000000000000000000231450520414700240650ustar00rootroot00000000000000export var num = 3;rollup-3.29.4/test/chunking-form/samples/chunk-naming/main1.js000066400000000000000000000001461450520414700242450ustar00rootroot00000000000000import { num as num1 } from './dep1'; import { num as num2 } from './dep2'; console.log(num1 + num2);rollup-3.29.4/test/chunking-form/samples/chunk-naming/main2.js000066400000000000000000000001461450520414700242460ustar00rootroot00000000000000import { num as num1 } from './dep2'; import { num as num2 } from './dep3'; console.log(num1 + num2);rollup-3.29.4/test/chunking-form/samples/chunk-naming/main3.js000066400000000000000000000001461450520414700242470ustar00rootroot00000000000000import { num as num1 } from './dep1'; import { num as num2 } from './dep3'; console.log(num1 + num2);rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/000077500000000000000000000000001450520414700257325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_config.js000066400000000000000000000002011450520414700276650ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunk variable name conflict', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/000077500000000000000000000000001450520414700276725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/amd/000077500000000000000000000000001450520414700304335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/amd/generated-dep.js000066400000000000000000000002071450520414700334740ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var value = 42; const x = 3; exports.value = value; exports.x = x; })); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/amd/main1.js000066400000000000000000000001751450520414700320010ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; [43].map(dep$1 => console.log(dep$1, dep.value, dep.x)); })); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/amd/main2.js000066400000000000000000000001641450520414700320000ustar00rootroot00000000000000define(['./generated-dep'], (function (dep$1) { 'use strict'; var dep = 44; console.log(dep, dep$1.value); })); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/cjs/000077500000000000000000000000001450520414700304515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/cjs/generated-dep.js000066400000000000000000000001231450520414700335070ustar00rootroot00000000000000'use strict'; var value = 42; const x = 3; exports.value = value; exports.x = x; rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/cjs/main1.js000066400000000000000000000001621450520414700320130ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); [43].map(dep$1 => console.log(dep$1, dep.value, dep.x)); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/cjs/main2.js000066400000000000000000000001501450520414700320110ustar00rootroot00000000000000'use strict'; var dep$1 = require('./generated-dep.js'); var dep = 44; console.log(dep, dep$1.value); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/es/000077500000000000000000000000001450520414700303015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/es/generated-dep.js000066400000000000000000000000701450520414700333400ustar00rootroot00000000000000var value = 42; const x = 3; export { value as v, x }; rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/es/main1.js000066400000000000000000000001421450520414700316410ustar00rootroot00000000000000import { v as value, x } from './generated-dep.js'; [43].map(dep => console.log(dep, value, x)); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/es/main2.js000066400000000000000000000001311450520414700316400ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; var dep = 44; console.log(dep, value); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/system/000077500000000000000000000000001450520414700312165ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002541450520414700342020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('v', 42); const x = exports('x', 3); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/system/main1.js000066400000000000000000000004051450520414700325600ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var value, x; return { setters: [function (module) { value = module.v; x = module.x; }], execute: (function () { [43].map(dep => console.log(dep, value, x)); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/_expected/system/main2.js000066400000000000000000000003561450520414700325660ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { var dep = 44; console.log(dep, value); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/dep.js000066400000000000000000000000471450520414700270410ustar00rootroot00000000000000export default 42; export const x = 3; rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/main1.js000066400000000000000000000001201450520414700272660ustar00rootroot00000000000000import value, {x} from './dep.js'; [43].map(dep => console.log(dep, value, x)); rollup-3.29.4/test/chunking-form/samples/chunk-variable-name-conflict/main2.js000066400000000000000000000001051450520414700272720ustar00rootroot00000000000000import value from './dep.js'; var dep = 44; console.log(dep, value); rollup-3.29.4/test/chunking-form/samples/chunking-compact/000077500000000000000000000000001450520414700235545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-compact/_config.js000066400000000000000000000003041450520414700255130ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunking compact and mangled output', options: { input: ['main1.js', 'main2.js'], external: ['external'], output: { compact: true } } }); rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/000077500000000000000000000000001450520414700255145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/amd/000077500000000000000000000000001450520414700262555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/amd/generated-dep2.js000066400000000000000000000002501450520414700313760ustar00rootroot00000000000000define(['exports'],(function(exports){'use strict';function fn$1 () { console.log('lib2 fn'); }function fn () { fn$1(); console.log('dep2 fn'); }exports.f=fn;}));rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/amd/main1.js000066400000000000000000000002641450520414700276220ustar00rootroot00000000000000define(['./generated-dep2'],(function(dep2){'use strict';function fn () { console.log('dep1 fn'); }class Main1 { constructor () { fn(); dep2.f(); } }return Main1;}));rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/amd/main2.js000066400000000000000000000004211450520414700276160ustar00rootroot00000000000000define(['./generated-dep2','external'],(function(dep2,external){'use strict';function fn$1 () { console.log('lib1 fn'); external.fn(); }function fn () { fn$1(); console.log('dep3 fn'); }class Main2 { constructor () { fn(); dep2.f(); } }return Main2;}));rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/cjs/000077500000000000000000000000001450520414700262735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/cjs/generated-dep2.js000066400000000000000000000001761450520414700314230ustar00rootroot00000000000000'use strict';function fn$1 () { console.log('lib2 fn'); }function fn () { fn$1(); console.log('dep2 fn'); }exports.f=fn;rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/cjs/main1.js000066400000000000000000000002641450520414700276400ustar00rootroot00000000000000'use strict';var dep2=require('./generated-dep2.js');function fn () { console.log('dep1 fn'); }class Main1 { constructor () { fn(); dep2.f(); } }module.exports=Main1;rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/cjs/main2.js000066400000000000000000000004321450520414700276360ustar00rootroot00000000000000'use strict';var dep2=require('./generated-dep2.js'),external=require('external');function fn$1 () { console.log('lib1 fn'); external.fn(); }function fn () { fn$1(); console.log('dep3 fn'); }class Main2 { constructor () { fn(); dep2.f(); } }module.exports=Main2;rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/es/000077500000000000000000000000001450520414700261235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/es/generated-dep2.js000066400000000000000000000001641450520414700312500ustar00rootroot00000000000000function fn$1 () { console.log('lib2 fn'); }function fn () { fn$1(); console.log('dep2 fn'); }export{fn as f};rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/es/main1.js000066400000000000000000000002551450520414700274700ustar00rootroot00000000000000import {f as fn$1}from'./generated-dep2.js';function fn () { console.log('dep1 fn'); }class Main1 { constructor () { fn(); fn$1(); } }export{Main1 as default};rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/es/main2.js000066400000000000000000000004211450520414700274640ustar00rootroot00000000000000import {f as fn$3}from'./generated-dep2.js';import {fn as fn$2}from'external';function fn$1 () { console.log('lib1 fn'); fn$2(); }function fn () { fn$1(); console.log('dep3 fn'); }class Main2 { constructor () { fn(); fn$3(); } }export{Main2 as default};rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/system/000077500000000000000000000000001450520414700270405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/system/generated-dep2.js000066400000000000000000000003111450520414700321570ustar00rootroot00000000000000System.register([],(function(exports){'use strict';return{execute:(function(){exports('f',fn);function fn$1 () { console.log('lib2 fn'); }function fn () { fn$1(); console.log('dep2 fn'); }})}}));rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/system/main1.js000066400000000000000000000004371450520414700304070ustar00rootroot00000000000000System.register(['./generated-dep2.js'],(function(exports){'use strict';var fn$1;return{setters:[function(module){fn$1=module.f;}],execute:(function(){function fn () { console.log('dep1 fn'); }class Main1 { constructor () { fn(); fn$1(); } }exports('default',Main1);})}}));rollup-3.29.4/test/chunking-form/samples/chunking-compact/_expected/system/main2.js000066400000000000000000000006231450520414700304050ustar00rootroot00000000000000System.register(['./generated-dep2.js','external'],(function(exports){'use strict';var fn$3,fn$2;return{setters:[function(module){fn$3=module.f;},function(module){fn$2=module.fn;}],execute:(function(){function fn$1 () { console.log('lib1 fn'); fn$2(); }function fn () { fn$1(); console.log('dep3 fn'); }class Main2 { constructor () { fn(); fn$3(); } }exports('default',Main2);})}}));rollup-3.29.4/test/chunking-form/samples/chunking-compact/dep1.js000066400000000000000000000000631450520414700247420ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-compact/dep2.js000066400000000000000000000001501450520414700247400ustar00rootroot00000000000000import { fn as libfn } from './lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-compact/dep3.js000066400000000000000000000001501450520414700247410ustar00rootroot00000000000000import { fn as libfn } from './lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-compact/lib1.js000066400000000000000000000001451450520414700247410ustar00rootroot00000000000000import { fn as fn$1 } from 'external'; export function fn () { console.log('lib1 fn'); fn$1(); }rollup-3.29.4/test/chunking-form/samples/chunking-compact/lib2.js000066400000000000000000000000631450520414700247410ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-compact/main1.js000066400000000000000000000002221450520414700251130ustar00rootroot00000000000000import { fn } from './dep1.js'; import { fn as fn2 } from './dep2.js'; export default class Main1 { constructor () { fn(); fn2(); } }rollup-3.29.4/test/chunking-form/samples/chunking-compact/main2.js000066400000000000000000000002221450520414700251140ustar00rootroot00000000000000import { fn } from './dep2.js'; import { fn as fn2 } from './dep3.js'; export default class Main2 { constructor () { fn2(); fn(); } }rollup-3.29.4/test/chunking-form/samples/chunking-externals/000077500000000000000000000000001450520414700241335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-externals/_config.js000066400000000000000000000002401450520414700260710ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunking external module handling', options: { input: ['main1.js', 'main2.js'], external: ['external'] } }); rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/000077500000000000000000000000001450520414700260735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/amd/000077500000000000000000000000001450520414700266345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/amd/generated-dep2.js000066400000000000000000000003101450520414700317520ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/amd/main1.js000066400000000000000000000003261450520414700302000ustar00rootroot00000000000000define(['./generated-dep2'], (function (dep2) { 'use strict'; function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); dep2.fn(); } } return Main1; })); rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/amd/main2.js000066400000000000000000000005011450520414700301740ustar00rootroot00000000000000define(['./generated-dep2', 'external'], (function (dep2, external) { 'use strict'; function fn$1 () { console.log('lib1 fn'); external.fn(); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); dep2.fn(); } } return Main2; })); rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/cjs/000077500000000000000000000000001450520414700266525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/cjs/generated-dep2.js000066400000000000000000000002101450520414700317670ustar00rootroot00000000000000'use strict'; function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/cjs/main1.js000066400000000000000000000003021450520414700302100ustar00rootroot00000000000000'use strict'; var dep2 = require('./generated-dep2.js'); function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); dep2.fn(); } } module.exports = Main1; rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/cjs/main2.js000066400000000000000000000004611450520414700302170ustar00rootroot00000000000000'use strict'; var dep2 = require('./generated-dep2.js'); var external = require('external'); function fn$1 () { console.log('lib1 fn'); external.fn(); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); dep2.fn(); } } module.exports = Main2; rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/es/000077500000000000000000000000001450520414700265025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/es/generated-dep2.js000066400000000000000000000001741450520414700316300ustar00rootroot00000000000000function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } export { fn as f }; rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/es/main1.js000066400000000000000000000002731450520414700300470ustar00rootroot00000000000000import { f as fn$1 } from './generated-dep2.js'; function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); fn$1(); } } export { Main1 as default }; rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/es/main2.js000066400000000000000000000004461450520414700300520ustar00rootroot00000000000000import { f as fn$3 } from './generated-dep2.js'; import { fn as fn$2 } from 'external'; function fn$1 () { console.log('lib1 fn'); fn$2(); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); fn$3(); } } export { Main2 as default }; rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/system/000077500000000000000000000000001450520414700274175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/system/generated-dep2.js000066400000000000000000000004361450520414700325460ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', fn); function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/system/main1.js000066400000000000000000000006221450520414700307620ustar00rootroot00000000000000System.register(['./generated-dep2.js'], (function (exports) { 'use strict'; var fn$1; return { setters: [function (module) { fn$1 = module.f; }], execute: (function () { function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); fn$1(); } } exports('default', Main1); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunking-externals/_expected/system/main2.js000066400000000000000000000010711450520414700307620ustar00rootroot00000000000000System.register(['./generated-dep2.js', 'external'], (function (exports) { 'use strict'; var fn$3, fn$2; return { setters: [function (module) { fn$3 = module.f; }, function (module) { fn$2 = module.fn; }], execute: (function () { function fn$1 () { console.log('lib1 fn'); fn$2(); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); fn$3(); } } exports('default', Main2); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunking-externals/dep1.js000066400000000000000000000000631450520414700253210ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-externals/dep2.js000066400000000000000000000001501450520414700253170ustar00rootroot00000000000000import { fn as libfn } from './lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-externals/dep3.js000066400000000000000000000001501450520414700253200ustar00rootroot00000000000000import { fn as libfn } from './lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-externals/lib1.js000066400000000000000000000001451450520414700253200ustar00rootroot00000000000000import { fn as fn$1 } from 'external'; export function fn () { console.log('lib1 fn'); fn$1(); }rollup-3.29.4/test/chunking-form/samples/chunking-externals/lib2.js000066400000000000000000000000631450520414700253200ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-externals/main1.js000066400000000000000000000002221450520414700254720ustar00rootroot00000000000000import { fn } from './dep1.js'; import { fn as fn2 } from './dep2.js'; export default class Main1 { constructor () { fn(); fn2(); } }rollup-3.29.4/test/chunking-form/samples/chunking-externals/main2.js000066400000000000000000000002221450520414700254730ustar00rootroot00000000000000import { fn } from './dep2.js'; import { fn as fn2 } from './dep3.js'; export default class Main2 { constructor () { fn2(); fn(); } }rollup-3.29.4/test/chunking-form/samples/chunking-reexport/000077500000000000000000000000001450520414700237765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_config.js000066400000000000000000000002251450520414700257370ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunking star external', options: { input: ['main1.js', 'main2.js'], external: ['external'] } }); rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/000077500000000000000000000000001450520414700257365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/amd/000077500000000000000000000000001450520414700264775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/amd/main1.js000066400000000000000000000003321450520414700300400ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; console.log('dep'); Object.defineProperty(exports, 'dep', { enumerable: true, get: function () { return external.asdf; } }); })); rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/amd/main2.js000066400000000000000000000003301450520414700300370ustar00rootroot00000000000000define(['exports', './main1', 'external'], (function (exports, main1, external) { 'use strict'; Object.defineProperty(exports, 'dep', { enumerable: true, get: function () { return external.asdf; } }); })); rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/cjs/000077500000000000000000000000001450520414700265155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/cjs/main1.js000066400000000000000000000002641450520414700300620ustar00rootroot00000000000000'use strict'; var external = require('external'); console.log('dep'); Object.defineProperty(exports, 'dep', { enumerable: true, get: function () { return external.asdf; } }); rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/cjs/main2.js000066400000000000000000000002701450520414700300600ustar00rootroot00000000000000'use strict'; require('./main1.js'); var external = require('external'); Object.defineProperty(exports, 'dep', { enumerable: true, get: function () { return external.asdf; } }); rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/es/000077500000000000000000000000001450520414700263455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/es/main1.js000066400000000000000000000000751450520414700277120ustar00rootroot00000000000000export { asdf as dep } from 'external'; console.log('dep'); rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/es/main2.js000066400000000000000000000000751450520414700277130ustar00rootroot00000000000000import './main1.js'; export { asdf as dep } from 'external'; rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/system/000077500000000000000000000000001450520414700272625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/system/main1.js000066400000000000000000000003241450520414700306240ustar00rootroot00000000000000System.register(['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('dep', module.asdf); }], execute: (function () { console.log('dep'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunking-reexport/_expected/system/main2.js000066400000000000000000000003221450520414700306230ustar00rootroot00000000000000System.register(['./main1.js', 'external'], (function (exports) { 'use strict'; return { setters: [null, function (module) { exports('dep', module.asdf); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/chunking-reexport/dep.js000066400000000000000000000000731450520414700251040ustar00rootroot00000000000000export { asdf as dep } from 'external'; console.log('dep');rollup-3.29.4/test/chunking-form/samples/chunking-reexport/main1.js000066400000000000000000000000371450520414700253410ustar00rootroot00000000000000export { dep } from './dep.js';rollup-3.29.4/test/chunking-form/samples/chunking-reexport/main2.js000066400000000000000000000000371450520414700253420ustar00rootroot00000000000000export { dep } from './dep.js';rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/000077500000000000000000000000001450520414700243645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_config.js000066400000000000000000000002241450520414700263240ustar00rootroot00000000000000module.exports = defineTest({ description: 'source maps', options: { input: ['main1.js', 'main2.js'], output: { sourcemap: true } } }); rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/000077500000000000000000000000001450520414700263245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/amd/000077500000000000000000000000001450520414700270655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/amd/generated-dep2.js000066400000000000000000000003631450520414700322130ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } exports.fn = fn; })); //# sourceMappingURL=generated-dep2.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/amd/generated-dep2.js.map000066400000000000000000000007511450520414700327700ustar00rootroot00000000000000{"version":3,"file":"generated-dep2.js","sources":["../../lib2.js","../../dep2.js"],"sourcesContent":["export function fn () {\n console.log('lib2 fn');\n}","import { fn as libfn } from './lib2.js';\n\nexport function fn () {\n libfn();\n console.log('dep2 fn');\n}"],"names":["fn","libfn"],"mappings":";;EAAO,SAASA,IAAE,IAAI;EACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;EACzB;;ECAO,SAAS,EAAE,IAAI;EACtB,EAAEC,IAAK,EAAE,CAAC;EACV,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;EACzB;;;;;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/amd/main1.js000066400000000000000000000003701450520414700304300ustar00rootroot00000000000000define(['./generated-dep2'], (function (dep2) { 'use strict'; function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); dep2.fn(); } } return Main1; })); //# sourceMappingURL=main1.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/amd/main1.js.map000066400000000000000000000010251450520414700312020ustar00rootroot00000000000000{"version":3,"file":"main1.js","sources":["../../dep1.js","../../main1.js"],"sourcesContent":["export function fn () {\n console.log('dep1 fn');\n}","import { fn } from './dep1.js';\nimport { fn as fn2 } from './dep2.js';\n\nexport default class Main1 {\n constructor () {\n fn();\n fn2();\n }\n}"],"names":["fn2"],"mappings":";;EAAO,SAAS,EAAE,IAAI;EACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;EACzB;;ECCe,MAAM,KAAK,CAAC;EAC3B,EAAE,WAAW,CAAC,GAAG;EACjB,IAAI,EAAE,EAAE,CAAC;EACT,IAAIA,OAAG,EAAE,CAAC;EACV,GAAG;EACH;;;;;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/amd/main2.js000066400000000000000000000004721450520414700304340ustar00rootroot00000000000000define(['./generated-dep2'], (function (dep2) { 'use strict'; function fn$1 () { console.log('lib1 fn'); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); dep2.fn(); } } return Main2; })); //# sourceMappingURL=main2.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/amd/main2.js.map000066400000000000000000000016721450520414700312130ustar00rootroot00000000000000{"version":3,"file":"main2.js","sources":["../../lib1.js","../../dep3.js","../../main2.js"],"sourcesContent":["export function fn () {\n console.log('lib1 fn');\n}\n\nexport function treeshaked () {\n console.log('this is tree shaken!');\n}","import { fn as libfn, treeshaked } from './lib1.js';\n\nexport function fn () {\n libfn();\n console.log('dep3 fn');\n}\n\nexport default treeshaked;","import { fn } from './dep2.js';\nimport { fn as fn2, default as treeshaked } from './dep3.js';\n\nif (false) {\n treeshaked();\n}\n\nexport default class Main2 {\n constructor () {\n fn2();\n fn();\n }\n}"],"names":["fn","libfn","fn2"],"mappings":";;EAAO,SAASA,IAAE,IAAI;EACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;EACzB;;ECAO,SAAS,EAAE,IAAI;EACtB,EAAEC,IAAK,EAAE,CAAC;EACV,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;EACzB;;ECEe,MAAM,KAAK,CAAC;EAC3B,EAAE,WAAW,CAAC,GAAG;EACjB,IAAIC,EAAG,EAAE,CAAC;EACV,IAAIF,OAAE,EAAE,CAAC;EACT,GAAG;EACH;;;;;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/cjs/000077500000000000000000000000001450520414700271035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/cjs/generated-dep2.js000066400000000000000000000002631450520414700322300ustar00rootroot00000000000000'use strict'; function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } exports.fn = fn; //# sourceMappingURL=generated-dep2.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/cjs/generated-dep2.js.map000066400000000000000000000007451450520414700330110ustar00rootroot00000000000000{"version":3,"file":"generated-dep2.js","sources":["../../lib2.js","../../dep2.js"],"sourcesContent":["export function fn () {\n console.log('lib2 fn');\n}","import { fn as libfn } from './lib2.js';\n\nexport function fn () {\n libfn();\n console.log('dep2 fn');\n}"],"names":["fn","libfn"],"mappings":";;AAAO,SAASA,IAAE,IAAI;AACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;ACAO,SAAS,EAAE,IAAI;AACtB,EAAEC,IAAK,EAAE,CAAC;AACV,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/cjs/main1.js000066400000000000000000000003441450520414700304470ustar00rootroot00000000000000'use strict'; var dep2 = require('./generated-dep2.js'); function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); dep2.fn(); } } module.exports = Main1; //# sourceMappingURL=main1.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/cjs/main1.js.map000066400000000000000000000010231450520414700312160ustar00rootroot00000000000000{"version":3,"file":"main1.js","sources":["../../dep1.js","../../main1.js"],"sourcesContent":["export function fn () {\n console.log('dep1 fn');\n}","import { fn } from './dep1.js';\nimport { fn as fn2 } from './dep2.js';\n\nexport default class Main1 {\n constructor () {\n fn();\n fn2();\n }\n}"],"names":["fn2"],"mappings":";;;;AAAO,SAAS,EAAE,IAAI;AACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;ACCe,MAAM,KAAK,CAAC;AAC3B,EAAE,WAAW,CAAC,GAAG;AACjB,IAAI,EAAE,EAAE,CAAC;AACT,IAAIA,OAAG,EAAE,CAAC;AACV,GAAG;AACH;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/cjs/main2.js000066400000000000000000000004361450520414700304520ustar00rootroot00000000000000'use strict'; var dep2 = require('./generated-dep2.js'); function fn$1 () { console.log('lib1 fn'); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); dep2.fn(); } } module.exports = Main2; //# sourceMappingURL=main2.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/cjs/main2.js.map000066400000000000000000000016701450520414700312270ustar00rootroot00000000000000{"version":3,"file":"main2.js","sources":["../../lib1.js","../../dep3.js","../../main2.js"],"sourcesContent":["export function fn () {\n console.log('lib1 fn');\n}\n\nexport function treeshaked () {\n console.log('this is tree shaken!');\n}","import { fn as libfn, treeshaked } from './lib1.js';\n\nexport function fn () {\n libfn();\n console.log('dep3 fn');\n}\n\nexport default treeshaked;","import { fn } from './dep2.js';\nimport { fn as fn2, default as treeshaked } from './dep3.js';\n\nif (false) {\n treeshaked();\n}\n\nexport default class Main2 {\n constructor () {\n fn2();\n fn();\n }\n}"],"names":["fn","libfn","fn2"],"mappings":";;;;AAAO,SAASA,IAAE,IAAI;AACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;ACAO,SAAS,EAAE,IAAI;AACtB,EAAEC,IAAK,EAAE,CAAC;AACV,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;ACEe,MAAM,KAAK,CAAC;AAC3B,EAAE,WAAW,CAAC,GAAG;AACjB,IAAIC,EAAG,EAAE,CAAC;AACV,IAAIF,OAAE,EAAE,CAAC;AACT,GAAG;AACH;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/es/000077500000000000000000000000001450520414700267335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/es/generated-dep2.js000066400000000000000000000002471450520414700320620ustar00rootroot00000000000000function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } export { fn as f }; //# sourceMappingURL=generated-dep2.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/es/generated-dep2.js.map000066400000000000000000000007431450520414700326370ustar00rootroot00000000000000{"version":3,"file":"generated-dep2.js","sources":["../../lib2.js","../../dep2.js"],"sourcesContent":["export function fn () {\n console.log('lib2 fn');\n}","import { fn as libfn } from './lib2.js';\n\nexport function fn () {\n libfn();\n console.log('dep2 fn');\n}"],"names":["fn","libfn"],"mappings":"AAAO,SAASA,IAAE,IAAI;AACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;ACAO,SAAS,EAAE,IAAI;AACtB,EAAEC,IAAK,EAAE,CAAC;AACV,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/es/main1.js000066400000000000000000000003351450520414700302770ustar00rootroot00000000000000import { f as fn$1 } from './generated-dep2.js'; function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); fn$1(); } } export { Main1 as default }; //# sourceMappingURL=main1.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/es/main1.js.map000066400000000000000000000010211450520414700310440ustar00rootroot00000000000000{"version":3,"file":"main1.js","sources":["../../dep1.js","../../main1.js"],"sourcesContent":["export function fn () {\n console.log('dep1 fn');\n}","import { fn } from './dep1.js';\nimport { fn as fn2 } from './dep2.js';\n\nexport default class Main1 {\n constructor () {\n fn();\n fn2();\n }\n}"],"names":["fn2"],"mappings":";;AAAO,SAAS,EAAE,IAAI;AACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;ACCe,MAAM,KAAK,CAAC;AAC3B,EAAE,WAAW,CAAC,GAAG;AACjB,IAAI,EAAE,EAAE,CAAC;AACT,IAAIA,IAAG,EAAE,CAAC;AACV,GAAG;AACH;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/es/main2.js000066400000000000000000000004271450520414700303020ustar00rootroot00000000000000import { f as fn$2 } from './generated-dep2.js'; function fn$1 () { console.log('lib1 fn'); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); fn$2(); } } export { Main2 as default }; //# sourceMappingURL=main2.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/es/main2.js.map000066400000000000000000000016661450520414700310640ustar00rootroot00000000000000{"version":3,"file":"main2.js","sources":["../../lib1.js","../../dep3.js","../../main2.js"],"sourcesContent":["export function fn () {\n console.log('lib1 fn');\n}\n\nexport function treeshaked () {\n console.log('this is tree shaken!');\n}","import { fn as libfn, treeshaked } from './lib1.js';\n\nexport function fn () {\n libfn();\n console.log('dep3 fn');\n}\n\nexport default treeshaked;","import { fn } from './dep2.js';\nimport { fn as fn2, default as treeshaked } from './dep3.js';\n\nif (false) {\n treeshaked();\n}\n\nexport default class Main2 {\n constructor () {\n fn2();\n fn();\n }\n}"],"names":["fn","libfn","fn2"],"mappings":";;AAAO,SAASA,IAAE,IAAI;AACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;ACAO,SAAS,EAAE,IAAI;AACtB,EAAEC,IAAK,EAAE,CAAC;AACV,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB;;ACEe,MAAM,KAAK,CAAC;AAC3B,EAAE,WAAW,CAAC,GAAG;AACjB,IAAIC,EAAG,EAAE,CAAC;AACV,IAAIF,IAAE,EAAE,CAAC;AACT,GAAG;AACH;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/system/000077500000000000000000000000001450520414700276505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/system/generated-dep2.js000066400000000000000000000005111450520414700327710ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', fn); function fn$1 () { console.log('lib2 fn'); } function fn () { fn$1(); console.log('dep2 fn'); } }) }; })); //# sourceMappingURL=generated-dep2.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/system/generated-dep2.js.map000066400000000000000000000007561450520414700335600ustar00rootroot00000000000000{"version":3,"file":"generated-dep2.js","sources":["../../lib2.js","../../dep2.js"],"sourcesContent":["export function fn () {\n console.log('lib2 fn');\n}","import { fn as libfn } from './lib2.js';\n\nexport function fn () {\n libfn();\n console.log('dep2 fn');\n}"],"names":["fn","libfn"],"mappings":";;;;;;;MAAO,SAASA,IAAE,IAAI;MACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;MACzB;;MCAO,SAAS,EAAE,IAAI;MACtB,EAAEC,IAAK,EAAE,CAAC;MACV,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;MACzB;;;;;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/system/main1.js000066400000000000000000000006641450520414700312210ustar00rootroot00000000000000System.register(['./generated-dep2.js'], (function (exports) { 'use strict'; var fn$1; return { setters: [function (module) { fn$1 = module.f; }], execute: (function () { function fn () { console.log('dep1 fn'); } class Main1 { constructor () { fn(); fn$1(); } } exports('default', Main1); }) }; })); //# sourceMappingURL=main1.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/system/main1.js.map000066400000000000000000000010341450520414700317650ustar00rootroot00000000000000{"version":3,"file":"main1.js","sources":["../../dep1.js","../../main1.js"],"sourcesContent":["export function fn () {\n console.log('dep1 fn');\n}","import { fn } from './dep1.js';\nimport { fn as fn2 } from './dep2.js';\n\nexport default class Main1 {\n constructor () {\n fn();\n fn2();\n }\n}"],"names":["fn2"],"mappings":";;;;;;;;;MAAO,SAAS,EAAE,IAAI;MACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;MACzB;;MCCe,MAAM,KAAK,CAAC;MAC3B,EAAE,WAAW,CAAC,GAAG;MACjB,IAAI,EAAE,EAAE,CAAC;MACT,IAAIA,IAAG,EAAE,CAAC;MACV,GAAG;MACH;;;;;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/system/main2.js000066400000000000000000000010061450520414700312110ustar00rootroot00000000000000System.register(['./generated-dep2.js'], (function (exports) { 'use strict'; var fn$2; return { setters: [function (module) { fn$2 = module.f; }], execute: (function () { function fn$1 () { console.log('lib1 fn'); } function fn () { fn$1(); console.log('dep3 fn'); } class Main2 { constructor () { fn(); fn$2(); } } exports('default', Main2); }) }; })); //# sourceMappingURL=main2.js.map rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/_expected/system/main2.js.map000066400000000000000000000017011450520414700317670ustar00rootroot00000000000000{"version":3,"file":"main2.js","sources":["../../lib1.js","../../dep3.js","../../main2.js"],"sourcesContent":["export function fn () {\n console.log('lib1 fn');\n}\n\nexport function treeshaked () {\n console.log('this is tree shaken!');\n}","import { fn as libfn, treeshaked } from './lib1.js';\n\nexport function fn () {\n libfn();\n console.log('dep3 fn');\n}\n\nexport default treeshaked;","import { fn } from './dep2.js';\nimport { fn as fn2, default as treeshaked } from './dep3.js';\n\nif (false) {\n treeshaked();\n}\n\nexport default class Main2 {\n constructor () {\n fn2();\n fn();\n }\n}"],"names":["fn","libfn","fn2"],"mappings":";;;;;;;;;MAAO,SAASA,IAAE,IAAI;MACtB,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;MACzB;;MCAO,SAAS,EAAE,IAAI;MACtB,EAAEC,IAAK,EAAE,CAAC;MACV,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;MACzB;;MCEe,MAAM,KAAK,CAAC;MAC3B,EAAE,WAAW,CAAC,GAAG;MACjB,IAAIC,EAAG,EAAE,CAAC;MACV,IAAIF,IAAE,EAAE,CAAC;MACT,GAAG;MACH;;;;;;;;"}rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/dep1.js000066400000000000000000000000631450520414700255520ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/dep2.js000066400000000000000000000001501450520414700255500ustar00rootroot00000000000000import { fn as libfn } from './lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/dep3.js000066400000000000000000000002201450520414700255470ustar00rootroot00000000000000import { fn as libfn, treeshaked } from './lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/lib1.js000066400000000000000000000001751450520414700255540ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/lib2.js000066400000000000000000000000631450520414700255510ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/main1.js000066400000000000000000000002221450520414700257230ustar00rootroot00000000000000import { fn } from './dep1.js'; import { fn as fn2 } from './dep2.js'; export default class Main1 { constructor () { fn(); fn2(); } }rollup-3.29.4/test/chunking-form/samples/chunking-source-maps/main2.js000066400000000000000000000003111450520414700257230ustar00rootroot00000000000000import { fn } from './dep2.js'; import { fn as fn2, default as treeshaked } from './dep3.js'; if (false) { treeshaked(); } export default class Main2 { constructor () { fn2(); fn(); } }rollup-3.29.4/test/chunking-form/samples/chunking-star-external/000077500000000000000000000000001450520414700247175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_config.js000066400000000000000000000003051450520414700266570ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunking star external', options: { input: ['main1.js', 'main2.js'], external: ['external1', 'external2', 'starexternal1', 'starexternal2'] } }); rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/000077500000000000000000000000001450520414700266575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/amd/000077500000000000000000000000001450520414700274205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/amd/generated-dep.js000066400000000000000000000002361450520414700324630ustar00rootroot00000000000000define(['exports', 'starexternal2', 'external2'], (function (exports, starexternal2, external2) { 'use strict'; var dep = 'dep'; exports.dep = dep; })); rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/amd/main1.js000066400000000000000000000011461450520414700307650ustar00rootroot00000000000000define(['exports', 'starexternal1', 'external1', './generated-dep', 'starexternal2', 'external2'], (function (exports, starexternal1, external1, dep, starexternal2, external2) { 'use strict'; var main = '1'; Object.defineProperty(exports, 'e', { enumerable: true, get: function () { return external1.e; } }); exports.dep = dep.dep; exports.main = main; Object.keys(starexternal1).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return starexternal1[k]; } }); }); })); rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/amd/main2.js000066400000000000000000000010561450520414700307660ustar00rootroot00000000000000define(['exports', './generated-dep', 'external2', 'starexternal2'], (function (exports, dep, external2, starexternal2) { 'use strict'; var main = '2'; exports.dep = dep.dep; Object.defineProperty(exports, 'e', { enumerable: true, get: function () { return external2.e; } }); exports.main = main; Object.keys(starexternal2).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return starexternal2[k]; } }); }); })); rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/cjs/000077500000000000000000000000001450520414700274365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/cjs/generated-dep.js000066400000000000000000000001451450520414700325000ustar00rootroot00000000000000'use strict'; require('starexternal2'); require('external2'); var dep = 'dep'; exports.dep = dep; rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/cjs/main1.js000066400000000000000000000011171450520414700310010ustar00rootroot00000000000000'use strict'; var starexternal1 = require('starexternal1'); var external1 = require('external1'); var dep = require('./generated-dep.js'); require('starexternal2'); require('external2'); var main = '1'; Object.defineProperty(exports, 'e', { enumerable: true, get: function () { return external1.e; } }); exports.dep = dep.dep; exports.main = main; Object.keys(starexternal1).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return starexternal1[k]; } }); }); rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/cjs/main2.js000066400000000000000000000010371450520414700310030ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); var external2 = require('external2'); var starexternal2 = require('starexternal2'); var main = '2'; exports.dep = dep.dep; Object.defineProperty(exports, 'e', { enumerable: true, get: function () { return external2.e; } }); exports.main = main; Object.keys(starexternal2).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return starexternal2[k]; } }); }); rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/es/000077500000000000000000000000001450520414700272665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/es/generated-dep.js000066400000000000000000000001241450520414700323250ustar00rootroot00000000000000import 'starexternal2'; import 'external2'; var dep = 'dep'; export { dep as d }; rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/es/main1.js000066400000000000000000000002741450520414700306340ustar00rootroot00000000000000export * from 'starexternal1'; export { e } from 'external1'; export { d as dep } from './generated-dep.js'; import 'starexternal2'; import 'external2'; var main = '1'; export { main }; rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/es/main2.js000066400000000000000000000002201450520414700306240ustar00rootroot00000000000000export { d as dep } from './generated-dep.js'; export { e } from 'external2'; export * from 'starexternal2'; var main = '2'; export { main }; rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/system/000077500000000000000000000000001450520414700302035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/system/generated-dep.js000066400000000000000000000003041450520414700332420ustar00rootroot00000000000000System.register(['starexternal2', 'external2'], (function (exports) { 'use strict'; return { setters: [null, null], execute: (function () { var dep = exports('d', 'dep'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/system/main1.js000066400000000000000000000011101450520414700315370ustar00rootroot00000000000000System.register(['starexternal1', 'external1', './generated-dep.js', 'starexternal2', 'external2'], (function (exports) { 'use strict'; var _starExcludes = { main: 1, default: 1, e: 1, dep: 1 }; return { setters: [function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }, function (module) { exports('e', module.e); }, function (module) { exports('dep', module.d); }, null, null], execute: (function () { var main = exports('main', '1'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunking-star-external/_expected/system/main2.js000066400000000000000000000010361450520414700315470ustar00rootroot00000000000000System.register(['./generated-dep.js', 'external2', 'starexternal2'], (function (exports) { 'use strict'; var _starExcludes = { main: 1, default: 1, dep: 1, e: 1 }; return { setters: [function (module) { exports('dep', module.d); }, function (module) { exports('e', module.e); }, function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { var main = exports('main', '2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/chunking-star-external/dep.js000066400000000000000000000001251450520414700260230ustar00rootroot00000000000000export * from 'starexternal2'; export { e } from 'external2'; export var dep = 'dep';rollup-3.29.4/test/chunking-form/samples/chunking-star-external/main1.js000066400000000000000000000001611450520414700262600ustar00rootroot00000000000000export * from 'starexternal1'; export { e } from 'external1'; export { dep } from './dep'; export var main = '1';rollup-3.29.4/test/chunking-form/samples/chunking-star-external/main2.js000066400000000000000000000001451450520414700262630ustar00rootroot00000000000000export * from './dep'; export { e } from './dep'; export { dep } from './dep'; export var main = '2';rollup-3.29.4/test/chunking-form/samples/circular-entry-points/000077500000000000000000000000001450520414700245775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_config.js000066400000000000000000000002571450520414700265450ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunking circular entry points', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/000077500000000000000000000000001450520414700265375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/amd/000077500000000000000000000000001450520414700273005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/amd/generated-main1.js000066400000000000000000000004761450520414700326060ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = 43; new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = 42; new C().fn(p); exports.p = p$1; exports.p$1 = p; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/amd/main1.js000066400000000000000000000001651450520414700306450ustar00rootroot00000000000000define(['exports', './generated-main1'], (function (exports, main2) { 'use strict'; exports.p = main2.p$1; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/amd/main2.js000066400000000000000000000001631450520414700306440ustar00rootroot00000000000000define(['exports', './generated-main1'], (function (exports, main2) { 'use strict'; exports.p = main2.p; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/cjs/000077500000000000000000000000001450520414700273165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/cjs/generated-main1.js000066400000000000000000000003561450520414700326210ustar00rootroot00000000000000'use strict'; let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = 43; new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = 42; new C().fn(p); exports.p = p$1; exports.p$1 = p; rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/cjs/main1.js000066400000000000000000000001261450520414700306600ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main1.js'); exports.p = main2.p$1; rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/cjs/main2.js000066400000000000000000000001241450520414700306570ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main1.js'); exports.p = main2.p; rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/es/000077500000000000000000000000001450520414700271465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/es/generated-main1.js000066400000000000000000000003321450520414700324430ustar00rootroot00000000000000let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = 43; new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = 42; new C().fn(p); export { p as a, p$1 as p }; rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/es/main1.js000066400000000000000000000000571450520414700305130ustar00rootroot00000000000000export { a as p } from './generated-main1.js'; rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/es/main2.js000066400000000000000000000000521450520414700305070ustar00rootroot00000000000000export { p } from './generated-main1.js'; rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/system/000077500000000000000000000000001450520414700300635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/system/generated-main1.js000066400000000000000000000006401450520414700333620ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = exports('p', 43); new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = exports('a', 42); new C().fn(p); }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/system/main1.js000066400000000000000000000003051450520414700314240ustar00rootroot00000000000000System.register(['./generated-main1.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('p', module.a); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points/_expected/system/main2.js000066400000000000000000000003051450520414700314250ustar00rootroot00000000000000System.register(['./generated-main1.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('p', module.p); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points/dep1.js000066400000000000000000000001361450520414700257660ustar00rootroot00000000000000import { p } from './main2.js'; export class C { fn (num) { console.log(num - p); } }rollup-3.29.4/test/chunking-form/samples/circular-entry-points/dep2.js000066400000000000000000000001361450520414700257670ustar00rootroot00000000000000import { p } from './main1.js'; export class C { fn (num) { console.log(num - p); } }rollup-3.29.4/test/chunking-form/samples/circular-entry-points/main1.js000066400000000000000000000001011450520414700261320ustar00rootroot00000000000000import { C } from './dep1.js'; export var p = 42; new C().fn(p);rollup-3.29.4/test/chunking-form/samples/circular-entry-points/main2.js000066400000000000000000000001011450520414700261330ustar00rootroot00000000000000import { C } from './dep2.js'; export var p = 43; new C().fn(p);rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/000077500000000000000000000000001450520414700246615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_config.js000066400000000000000000000003221450520414700266200ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not create a facade for one circular entry point if possible', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/000077500000000000000000000000001450520414700266215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/amd/000077500000000000000000000000001450520414700273625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/amd/main1.js000066400000000000000000000001521450520414700307230ustar00rootroot00000000000000define(['exports', './main2'], (function (exports, main2) { 'use strict'; exports.p = main2.p2; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/amd/main2.js000066400000000000000000000004751450520414700307340ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = 43; new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = 42; new C().fn(p); exports.p = p$1; exports.p2 = p; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/cjs/000077500000000000000000000000001450520414700274005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/cjs/main1.js000066400000000000000000000001131450520414700307360ustar00rootroot00000000000000'use strict'; var main2 = require('./main2.js'); exports.p = main2.p2; rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/cjs/main2.js000066400000000000000000000003551450520414700307470ustar00rootroot00000000000000'use strict'; let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = 43; new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = 42; new C().fn(p); exports.p = p$1; exports.p2 = p; rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/es/000077500000000000000000000000001450520414700272305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/es/main1.js000066400000000000000000000000461450520414700305730ustar00rootroot00000000000000export { p2 as p } from './main2.js'; rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/es/main2.js000066400000000000000000000003331450520414700305730ustar00rootroot00000000000000let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = 43; new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = 42; new C().fn(p); export { p$1 as p, p as p2 }; rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/system/000077500000000000000000000000001450520414700301455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/system/main1.js000066400000000000000000000002741450520414700315130ustar00rootroot00000000000000System.register(['./main2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('p', module.p2); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/_expected/system/main2.js000066400000000000000000000006411450520414700315120ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = exports('p', 43); new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = exports('p2', 42); new C().fn(p); }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/dep1.js000066400000000000000000000001361450520414700260500ustar00rootroot00000000000000import { p } from './main2.js'; export class C { fn (num) { console.log(num - p); } }rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/dep2.js000066400000000000000000000001361450520414700260510ustar00rootroot00000000000000import { p } from './main1.js'; export class C { fn (num) { console.log(num - p); } }rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/main1.js000066400000000000000000000001011450520414700262140ustar00rootroot00000000000000import { C } from './dep1.js'; export var p = 42; new C().fn(p);rollup-3.29.4/test/chunking-form/samples/circular-entry-points2/main2.js000066400000000000000000000001411450520414700262210ustar00rootroot00000000000000import { C } from './dep2.js'; export var p = 43; export {p as p2} from './main1' new C().fn(p);rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/000077500000000000000000000000001450520414700246625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_config.js000066400000000000000000000003641450520414700266270ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates facades for all circular entry points if they become tainted by another entry', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { input: ['main1.js', 'main2.js', 'main3.js'] } }); rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/000077500000000000000000000000001450520414700266225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/amd/000077500000000000000000000000001450520414700273635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/amd/generated-main3.js000066400000000000000000000005211450520414700326620ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = 43; new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = 42; new C().fn(p); exports.C = C$1; exports.p = p$1; exports.p$1 = p; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/amd/main1.js000066400000000000000000000001651450520414700307300ustar00rootroot00000000000000define(['exports', './generated-main3'], (function (exports, main2) { 'use strict'; exports.p = main2.p$1; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/amd/main2.js000066400000000000000000000002141450520414700307240ustar00rootroot00000000000000define(['exports', './generated-main3'], (function (exports, main2) { 'use strict'; exports.p = main2.p; exports.p2 = main2.p$1; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/amd/main3.js000066400000000000000000000001631450520414700307300ustar00rootroot00000000000000define(['exports', './generated-main3'], (function (exports, main2) { 'use strict'; exports.C = main2.C; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/cjs/000077500000000000000000000000001450520414700274015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/cjs/generated-main3.js000066400000000000000000000003771450520414700327110ustar00rootroot00000000000000'use strict'; let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = 43; new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = 42; new C().fn(p); exports.C = C$1; exports.p = p$1; exports.p$1 = p; rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/cjs/main1.js000066400000000000000000000001261450520414700307430ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main3.js'); exports.p = main2.p$1; rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/cjs/main2.js000066400000000000000000000001541450520414700307450ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main3.js'); exports.p = main2.p; exports.p2 = main2.p$1; rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/cjs/main3.js000066400000000000000000000001241450520414700307430ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main3.js'); exports.C = main2.C; rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/es/000077500000000000000000000000001450520414700272315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/es/generated-main3.js000066400000000000000000000003441450520414700325330ustar00rootroot00000000000000let C$1 = class C { fn (num) { console.log(num - p); } }; var p$1 = 43; new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = 42; new C().fn(p); export { C$1 as C, p as a, p$1 as p }; rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/es/main1.js000066400000000000000000000000571450520414700305760ustar00rootroot00000000000000export { a as p } from './generated-main3.js'; rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/es/main2.js000066400000000000000000000000631450520414700305740ustar00rootroot00000000000000export { p, a as p2 } from './generated-main3.js'; rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/es/main3.js000066400000000000000000000000521450520414700305730ustar00rootroot00000000000000export { C } from './generated-main3.js'; rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/system/000077500000000000000000000000001450520414700301465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/system/generated-main3.js000066400000000000000000000006631450520414700334540ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { let C$1 = class C { fn (num) { console.log(num - p); } }; exports('C', C$1); var p$1 = exports('p', 43); new C$1().fn(p$1); class C { fn (num) { console.log(num - p$1); } } var p = exports('a', 42); new C().fn(p); }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/system/main1.js000066400000000000000000000003051450520414700315070ustar00rootroot00000000000000System.register(['./generated-main3.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('p', module.a); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/system/main2.js000066400000000000000000000003251450520414700315120ustar00rootroot00000000000000System.register(['./generated-main3.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ p: module.p, p2: module.a }); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/_expected/system/main3.js000066400000000000000000000003051450520414700315110ustar00rootroot00000000000000System.register(['./generated-main3.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('C', module.C); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/dep1.js000066400000000000000000000001361450520414700260510ustar00rootroot00000000000000import { p } from './main2.js'; export class C { fn (num) { console.log(num - p); } }rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/dep2.js000066400000000000000000000001361450520414700260520ustar00rootroot00000000000000import { p } from './main1.js'; export class C { fn (num) { console.log(num - p); } }rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/main1.js000066400000000000000000000001011450520414700262150ustar00rootroot00000000000000import { C } from './dep1.js'; export var p = 42; new C().fn(p);rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/main2.js000066400000000000000000000001411450520414700262220ustar00rootroot00000000000000import { C } from './dep2.js'; export var p = 43; export {p as p2} from './main1' new C().fn(p);rollup-3.29.4/test/chunking-form/samples/circular-entry-points3/main3.js000066400000000000000000000000371450520414700262270ustar00rootroot00000000000000export { C } from './dep2.js'; rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/000077500000000000000000000000001450520414700246725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_config.js000066400000000000000000000003571450520414700266410ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles manual chunks with circular dependencies', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { input: 'main', output: { manualChunks: { lib1: ['lib1'], lib2: ['lib2'] } } } }); rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/000077500000000000000000000000001450520414700266325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/amd/000077500000000000000000000000001450520414700273735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/amd/generated-lib1.js000066400000000000000000000002641450520414700325160ustar00rootroot00000000000000define(['exports', './generated-lib2'], (function (exports, lib2) { 'use strict'; const lib1 = 'lib1'; console.log(`${lib1} imports ${lib2.lib2}`); exports.lib1 = lib1; })); rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/amd/generated-lib2.js000066400000000000000000000002641450520414700325170ustar00rootroot00000000000000define(['exports', './generated-lib1'], (function (exports, lib1) { 'use strict'; const lib2 = 'lib2'; console.log(`${lib2} imports ${lib1.lib1}`); exports.lib2 = lib2; })); rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/amd/main.js000066400000000000000000000002201450520414700306470ustar00rootroot00000000000000define(['exports', './generated-lib1', './generated-lib2'], (function (exports, lib1, lib2) { 'use strict'; exports.lib1 = lib1.lib1; })); rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/cjs/000077500000000000000000000000001450520414700274115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/cjs/generated-lib1.js000066400000000000000000000002231450520414700325270ustar00rootroot00000000000000'use strict'; var lib2 = require('./generated-lib2.js'); const lib1 = 'lib1'; console.log(`${lib1} imports ${lib2.lib2}`); exports.lib1 = lib1; rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/cjs/generated-lib2.js000066400000000000000000000002231450520414700325300ustar00rootroot00000000000000'use strict'; var lib1 = require('./generated-lib1.js'); const lib2 = 'lib2'; console.log(`${lib2} imports ${lib1.lib1}`); exports.lib2 = lib2; rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/cjs/main.js000066400000000000000000000001671450520414700306770ustar00rootroot00000000000000'use strict'; var lib1 = require('./generated-lib1.js'); require('./generated-lib2.js'); exports.lib1 = lib1.lib1; rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/es/000077500000000000000000000000001450520414700272415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/es/generated-lib1.js000066400000000000000000000002061450520414700323600ustar00rootroot00000000000000import { l as lib2 } from './generated-lib2.js'; const lib1 = 'lib1'; console.log(`${lib1} imports ${lib2}`); export { lib1 as l }; rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/es/generated-lib2.js000066400000000000000000000002061450520414700323610ustar00rootroot00000000000000import { l as lib1 } from './generated-lib1.js'; const lib2 = 'lib2'; console.log(`${lib2} imports ${lib1}`); export { lib2 as l }; rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/es/main.js000066400000000000000000000001171450520414700305220ustar00rootroot00000000000000export { l as lib1 } from './generated-lib1.js'; import './generated-lib2.js'; rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/system/000077500000000000000000000000001450520414700301565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/system/generated-lib1.js000066400000000000000000000004301450520414700332740ustar00rootroot00000000000000System.register(['./generated-lib2.js'], (function (exports) { 'use strict'; var lib2; return { setters: [function (module) { lib2 = module.l; }], execute: (function () { const lib1 = exports('l', 'lib1'); console.log(`${lib1} imports ${lib2}`); }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/system/generated-lib2.js000066400000000000000000000004301450520414700332750ustar00rootroot00000000000000System.register(['./generated-lib1.js'], (function (exports) { 'use strict'; var lib1; return { setters: [function (module) { lib1 = module.l; }], execute: (function () { const lib2 = exports('l', 'lib2'); console.log(`${lib2} imports ${lib1}`); }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/_expected/system/main.js000066400000000000000000000003441450520414700314410ustar00rootroot00000000000000System.register(['./generated-lib1.js', './generated-lib2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('lib1', module.l); }, null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/lib1.js000066400000000000000000000001461450520414700260600ustar00rootroot00000000000000import { lib2 } from './lib2.js'; export const lib1 = 'lib1'; console.log(`${lib1} imports ${lib2}`); rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/lib2.js000066400000000000000000000001431450520414700260560ustar00rootroot00000000000000import { lib1 } from './lib1'; export const lib2 = 'lib2'; console.log(`${lib2} imports ${lib1}`); rollup-3.29.4/test/chunking-form/samples/circular-manual-chunks/main.js000066400000000000000000000000421450520414700261500ustar00rootroot00000000000000export { lib1 } from './lib1.js'; rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/000077500000000000000000000000001450520414700257025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_config.js000066400000000000000000000002151450520414700276420ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly handles combined namespace reexports', options: { input: ['main1', 'main2'] } }); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/000077500000000000000000000000001450520414700276425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/amd/000077500000000000000000000000001450520414700304035ustar00rootroot00000000000000generated-geometry.js000066400000000000000000000005511450520414700344520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 'foo'; var volume = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); const bar = 'bar'; var geometry = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports.bar = bar; exports.foo = foo; exports.geometry = geometry; exports.volume = volume; })); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/amd/main1.js000066400000000000000000000003321450520414700317440ustar00rootroot00000000000000define(['./generated-geometry'], (function (geometry) { 'use strict'; var mod = /*#__PURE__*/Object.freeze({ __proto__: null, geometry: geometry.geometry, volume: geometry.volume }); console.log(mod); })); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/amd/main2.js000066400000000000000000000001671450520414700317530ustar00rootroot00000000000000define(['./generated-geometry'], (function (geometry) { 'use strict'; console.log(geometry.foo, geometry.bar); })); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/cjs/000077500000000000000000000000001450520414700304215ustar00rootroot00000000000000generated-geometry.js000066400000000000000000000004531450520414700344710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/cjs'use strict'; const foo = 'foo'; var volume = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); const bar = 'bar'; var geometry = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports.bar = bar; exports.foo = foo; exports.geometry = geometry; exports.volume = volume; rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/cjs/main1.js000066400000000000000000000003121450520414700317600ustar00rootroot00000000000000'use strict'; var geometry = require('./generated-geometry.js'); var mod = /*#__PURE__*/Object.freeze({ __proto__: null, geometry: geometry.geometry, volume: geometry.volume }); console.log(mod); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/cjs/main2.js000066400000000000000000000001541450520414700317650ustar00rootroot00000000000000'use strict'; var geometry = require('./generated-geometry.js'); console.log(geometry.foo, geometry.bar); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/es/000077500000000000000000000000001450520414700302515ustar00rootroot00000000000000generated-geometry.js000066400000000000000000000003731450520414700343220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/esconst foo = 'foo'; var volume = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); const bar = 'bar'; var geometry = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); export { bar as b, foo as f, geometry as g, volume as v }; rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/es/main1.js000066400000000000000000000002741450520414700316170ustar00rootroot00000000000000import { g as geometry, v as volume } from './generated-geometry.js'; var mod = /*#__PURE__*/Object.freeze({ __proto__: null, geometry: geometry, volume: volume }); console.log(mod); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/es/main2.js000066400000000000000000000001261450520414700316140ustar00rootroot00000000000000import { f as foo, b as bar } from './generated-geometry.js'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/system/000077500000000000000000000000001450520414700311665ustar00rootroot00000000000000generated-geometry.js000066400000000000000000000006321450520414700352350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('f', 'foo'); var volume = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); exports('v', volume); const bar = exports('b', 'bar'); var geometry = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports('g', geometry); }) }; })); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/system/main1.js000066400000000000000000000005611450520414700325330ustar00rootroot00000000000000System.register(['./generated-geometry.js'], (function () { 'use strict'; var geometry, volume; return { setters: [function (module) { geometry = module.g; volume = module.v; }], execute: (function () { var mod = /*#__PURE__*/Object.freeze({ __proto__: null, geometry: geometry, volume: volume }); console.log(mod); }) }; })); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/_expected/system/main2.js000066400000000000000000000003641450520414700325350ustar00rootroot00000000000000System.register(['./generated-geometry.js'], (function () { 'use strict'; var foo, bar; return { setters: [function (module) { foo = module.f; bar = module.b; }], execute: (function () { console.log(foo, bar); }) }; })); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/geometry.js000066400000000000000000000000321450520414700300660ustar00rootroot00000000000000export const bar = 'bar'; rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/index.js000066400000000000000000000001141450520414700273430ustar00rootroot00000000000000export * as volume from './volume'; export * as geometry from './geometry'; rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/main1.js000066400000000000000000000000651450520414700272460ustar00rootroot00000000000000import * as mod from './index.js'; console.log(mod); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/main2.js000066400000000000000000000001401450520414700272410ustar00rootroot00000000000000import { bar } from './geometry.js'; import { foo } from './volume.js'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/combined-namespace-reexport/volume.js000066400000000000000000000000321450520414700275420ustar00rootroot00000000000000export const foo = 'foo'; rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/000077500000000000000000000000001450520414700236425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_config.js000066400000000000000000000006001450520414700256000ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports custom file name sanitizer functions', options: { plugins: [ { name: 'test-plugin', buildStart() { this.emitFile({ type: 'asset', name: 'asset.txt', source: 'asset' }); } } ], output: { assetFileNames: '[name][extname]', sanitizeFileName(id) { return id.replace(/a/g, '_'); } } } }); rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/000077500000000000000000000000001450520414700256025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/amd/000077500000000000000000000000001450520414700263435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/amd/_sset.txt000066400000000000000000000000051450520414700302140ustar00rootroot00000000000000assetrollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/amd/m_in.js000066400000000000000000000000771450520414700276270ustar00rootroot00000000000000define((function () { 'use strict'; console.log('ok'); })); rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/cjs/000077500000000000000000000000001450520414700263615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/cjs/_sset.txt000066400000000000000000000000051450520414700302320ustar00rootroot00000000000000assetrollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/cjs/m_in.js000066400000000000000000000000421450520414700276350ustar00rootroot00000000000000'use strict'; console.log('ok'); rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/es/000077500000000000000000000000001450520414700262115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/es/_sset.txt000066400000000000000000000000051450520414700300620ustar00rootroot00000000000000assetrollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/es/m_in.js000066400000000000000000000000231450520414700274640ustar00rootroot00000000000000console.log('ok'); rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/system/000077500000000000000000000000001450520414700271265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/system/_sset.txt000066400000000000000000000000051450520414700307770ustar00rootroot00000000000000assetrollup-3.29.4/test/chunking-form/samples/custom-sanitizer/_expected/system/m_in.js000066400000000000000000000001741450520414700304100ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('ok'); }) }; })); rollup-3.29.4/test/chunking-form/samples/custom-sanitizer/main.js000066400000000000000000000000241450520414700251200ustar00rootroot00000000000000console.log('ok'); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/000077500000000000000000000000001450520414700240555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_config.js000066400000000000000000000002451450520414700260200ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not deconflict due to global variables used in other chunks', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/000077500000000000000000000000001450520414700260155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/amd/000077500000000000000000000000001450520414700265565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/amd/generated-dep.js000066400000000000000000000001371450520414700316210ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const x = 42; exports.x = x; })); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/amd/main1.js000066400000000000000000000001301450520414700301130ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.x); })); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/amd/main2.js000066400000000000000000000001331450520414700301170ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log(x, dep.x); })); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/cjs/000077500000000000000000000000001450520414700265745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/cjs/generated-dep.js000066400000000000000000000000551450520414700316360ustar00rootroot00000000000000'use strict'; const x = 42; exports.x = x; rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/cjs/main1.js000066400000000000000000000001151450520414700301340ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log(dep.x); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/cjs/main2.js000066400000000000000000000001201450520414700301310ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log(x, dep.x); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/es/000077500000000000000000000000001450520414700264245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/es/generated-dep.js000066400000000000000000000000351450520414700314640ustar00rootroot00000000000000const x = 42; export { x }; rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/es/main1.js000066400000000000000000000000711450520414700277650ustar00rootroot00000000000000import { x } from './generated-dep.js'; console.log(x); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/es/main2.js000066400000000000000000000001051450520414700277640ustar00rootroot00000000000000import { x as x$1 } from './generated-dep.js'; console.log(x, x$1); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/system/000077500000000000000000000000001450520414700273415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/system/generated-dep.js000066400000000000000000000002141450520414700324000ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const x = exports('x', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/system/main1.js000066400000000000000000000003141450520414700307020ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var x; return { setters: [function (module) { x = module.x; }], execute: (function () { console.log(x); }) }; })); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/_expected/system/main2.js000066400000000000000000000003251450520414700307050ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var x$1; return { setters: [function (module) { x$1 = module.x; }], execute: (function () { console.log(x, x$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/dep.js000066400000000000000000000000251450520414700251600ustar00rootroot00000000000000export const x = 42; rollup-3.29.4/test/chunking-form/samples/deconflict-globals/main1.js000066400000000000000000000000571450520414700254220ustar00rootroot00000000000000import { x } from './dep.js'; console.log(x); rollup-3.29.4/test/chunking-form/samples/deconflict-globals/main2.js000066400000000000000000000000671450520414700254240ustar00rootroot00000000000000import { x as y } from './dep.js'; console.log(x, y); rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/000077500000000000000000000000001450520414700305025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_config.js000066400000000000000000000003021450520414700324370ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts SystemJS default export variable with namespace imports', options: { external: 'external', output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/000077500000000000000000000000001450520414700324425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/amd/000077500000000000000000000000001450520414700332035ustar00rootroot00000000000000main.js000066400000000000000000000001541450520414700344060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/amddefine(['./other'], (function (other) { 'use strict'; var main = other + "extended"; return main; })); other.js000066400000000000000000000001501450520414700345770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 'bar'; exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/cjs/000077500000000000000000000000001450520414700332215ustar00rootroot00000000000000main.js000066400000000000000000000001521450520414700344220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/cjs'use strict'; var other = require('./other.js'); var main = other + "extended"; module.exports = main; other.js000066400000000000000000000000661450520414700346230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/cjs'use strict'; const foo = 'bar'; exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/es/000077500000000000000000000000001450520414700330515ustar00rootroot00000000000000main.js000066400000000000000000000001421450520414700342510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/esimport * as other from './other.js'; var main = other + "extended"; export { main as default }; other.js000066400000000000000000000000441450520414700344470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/esconst foo = 'bar'; export { foo }; rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/system/000077500000000000000000000000001450520414700337665ustar00rootroot00000000000000main.js000066400000000000000000000003641450520414700351740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/systemSystem.register(['./other.js'], (function (exports) { 'use strict'; var other; return { setters: [function (module) { other = module; }], execute: (function () { var main = exports('default', other + "extended"); }) }; })); other.js000066400000000000000000000002231450520414700353630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 'bar'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/main.js000066400000000000000000000001061450520414700317610ustar00rootroot00000000000000import * as main from './other.js'; export default main + "extended";rollup-3.29.4/test/chunking-form/samples/deconflict-system-default-export-variable/other.js000066400000000000000000000000301450520414700321520ustar00rootroot00000000000000export const foo = 'bar'rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/000077500000000000000000000000001450520414700307115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_config.js000066400000000000000000000003121450520414700326470ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not import variables that reference an original if another variable referencing it is already imported', options: { input: ['main1', 'main2'] } }); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/000077500000000000000000000000001450520414700326515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/amd/000077500000000000000000000000001450520414700334125ustar00rootroot00000000000000generated-foo.js000066400000000000000000000001451450520414700364100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = {}; exports.foo = foo; })); main1.js000066400000000000000000000001431450520414700346740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/amddefine(['./generated-foo'], (function (foo) { 'use strict'; console.log(foo.foo, foo.foo); })); main2.js000066400000000000000000000001431450520414700346750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/amddefine(['./generated-foo'], (function (foo) { 'use strict'; console.log(foo.foo, foo.foo); })); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/cjs/000077500000000000000000000000001450520414700334305ustar00rootroot00000000000000generated-foo.js000066400000000000000000000000631450520414700364250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/cjs'use strict'; const foo = {}; exports.foo = foo; main1.js000066400000000000000000000001301450520414700347060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/cjs'use strict'; var foo = require('./generated-foo.js'); console.log(foo.foo, foo.foo); main2.js000066400000000000000000000001301450520414700347070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/cjs'use strict'; var foo = require('./generated-foo.js'); console.log(foo.foo, foo.foo); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/es/000077500000000000000000000000001450520414700332605ustar00rootroot00000000000000generated-foo.js000066400000000000000000000000461450520414700362560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/esconst foo = {}; export { foo as f }; main1.js000066400000000000000000000001071450520414700345420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/esimport { f as foo } from './generated-foo.js'; console.log(foo, foo); main2.js000066400000000000000000000001071450520414700345430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/esimport { f as foo } from './generated-foo.js'; console.log(foo, foo); system/000077500000000000000000000000001450520414700341165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expectedgenerated-foo.js000066400000000000000000000002161450520414700371720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('f', {}); }) }; })); main1.js000066400000000000000000000003271450520414700354630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/systemSystem.register(['./generated-foo.js'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.f; }], execute: (function () { console.log(foo, foo); }) }; })); main2.js000066400000000000000000000003271450520414700354640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/systemSystem.register(['./generated-foo.js'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.f; }], execute: (function () { console.log(foo, foo); }) }; })); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/foo.js000066400000000000000000000000271450520414700320310ustar00rootroot00000000000000export const foo = {}; rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/main1.js000066400000000000000000000001201450520414700322450ustar00rootroot00000000000000import foo from './proxy1'; import bar from './proxy2'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/main2.js000066400000000000000000000001201450520414700322460ustar00rootroot00000000000000import foo from './proxy1'; import bar from './proxy2'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/proxy1.js000066400000000000000000000000621450520414700325070ustar00rootroot00000000000000import { foo } from './foo'; export default foo; rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals-2/proxy2.js000066400000000000000000000000621450520414700325100ustar00rootroot00000000000000import { foo } from './foo'; export default foo; rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/000077500000000000000000000000001450520414700305525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_config.js000066400000000000000000000002671450520414700325210ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not import variables that reference an original if the original is already imported', options: { input: ['main1', 'main2'] } }); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/000077500000000000000000000000001450520414700325125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/amd/000077500000000000000000000000001450520414700332535ustar00rootroot00000000000000generated-foo.js000066400000000000000000000001451450520414700362510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = {}; exports.foo = foo; })); main1.js000066400000000000000000000001431450520414700345350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/amddefine(['./generated-foo'], (function (foo) { 'use strict'; console.log(foo.foo, foo.foo); })); main2.js000066400000000000000000000001431450520414700345360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/amddefine(['./generated-foo'], (function (foo) { 'use strict'; console.log(foo.foo, foo.foo); })); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/cjs/000077500000000000000000000000001450520414700332715ustar00rootroot00000000000000generated-foo.js000066400000000000000000000000631450520414700362660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/cjs'use strict'; const foo = {}; exports.foo = foo; main1.js000066400000000000000000000001301450520414700345470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/cjs'use strict'; var foo = require('./generated-foo.js'); console.log(foo.foo, foo.foo); main2.js000066400000000000000000000001301450520414700345500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/cjs'use strict'; var foo = require('./generated-foo.js'); console.log(foo.foo, foo.foo); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/es/000077500000000000000000000000001450520414700331215ustar00rootroot00000000000000generated-foo.js000066400000000000000000000000461450520414700361170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/esconst foo = {}; export { foo as f }; main1.js000066400000000000000000000001071450520414700344030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/esimport { f as foo } from './generated-foo.js'; console.log(foo, foo); main2.js000066400000000000000000000001071450520414700344040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/esimport { f as foo } from './generated-foo.js'; console.log(foo, foo); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/system/000077500000000000000000000000001450520414700340365ustar00rootroot00000000000000generated-foo.js000066400000000000000000000002161450520414700370330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('f', {}); }) }; })); main1.js000066400000000000000000000003271450520414700353240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/systemSystem.register(['./generated-foo.js'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.f; }], execute: (function () { console.log(foo, foo); }) }; })); main2.js000066400000000000000000000003271450520414700353250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/_expected/systemSystem.register(['./generated-foo.js'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.f; }], execute: (function () { console.log(foo, foo); }) }; })); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/foo.js000066400000000000000000000000271450520414700316720ustar00rootroot00000000000000export const foo = {}; rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/main1.js000066400000000000000000000001201450520414700321060ustar00rootroot00000000000000import { foo } from './foo'; import bar from './proxy'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/main2.js000066400000000000000000000001201450520414700321070ustar00rootroot00000000000000import { foo } from './foo'; import bar from './proxy'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/deduplicate-imports-referencing-originals/proxy.js000066400000000000000000000000611450520414700322660ustar00rootroot00000000000000import { foo } from './foo'; export default foo; rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/000077500000000000000000000000001450520414700260025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_config.js000066400000000000000000000002431450520414700277430ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not produce name conflicts when reexporting via default exports', options: { input: ['main1', 'main2'] } }); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/000077500000000000000000000000001450520414700277425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/amd/000077500000000000000000000000001450520414700305035ustar00rootroot00000000000000generated-module1.js000066400000000000000000000001641450520414700342650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const firebase = {}; exports.firebase = firebase; })); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/amd/main1.js000066400000000000000000000001751450520414700320510ustar00rootroot00000000000000define(['./generated-module1'], (function (module1) { 'use strict'; console.log(module1.firebase, module1.firebase); })); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/amd/main2.js000066400000000000000000000001751450520414700320520ustar00rootroot00000000000000define(['./generated-module1'], (function (module1) { 'use strict'; console.log(module1.firebase, module1.firebase); })); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/cjs/000077500000000000000000000000001450520414700305215ustar00rootroot00000000000000generated-module1.js000066400000000000000000000001021450520414700342730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/cjs'use strict'; const firebase = {}; exports.firebase = firebase; rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/cjs/main1.js000066400000000000000000000001621450520414700320630ustar00rootroot00000000000000'use strict'; var module1 = require('./generated-module1.js'); console.log(module1.firebase, module1.firebase); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/cjs/main2.js000066400000000000000000000001621450520414700320640ustar00rootroot00000000000000'use strict'; var module1 = require('./generated-module1.js'); console.log(module1.firebase, module1.firebase); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/es/000077500000000000000000000000001450520414700303515ustar00rootroot00000000000000generated-module1.js000066400000000000000000000000601450520414700341260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/esconst firebase = {}; export { firebase as f }; rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/es/main1.js000066400000000000000000000001321450520414700317100ustar00rootroot00000000000000import { f as firebase } from './generated-module1.js'; console.log(firebase, firebase); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/es/main2.js000066400000000000000000000001321450520414700317110ustar00rootroot00000000000000import { f as firebase } from './generated-module1.js'; console.log(firebase, firebase); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/system/000077500000000000000000000000001450520414700312665ustar00rootroot00000000000000generated-module1.js000066400000000000000000000002231450520414700350440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const firebase = exports('f', {}); }) }; })); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/system/main1.js000066400000000000000000000003571450520414700326360ustar00rootroot00000000000000System.register(['./generated-module1.js'], (function () { 'use strict'; var firebase; return { setters: [function (module) { firebase = module.f; }], execute: (function () { console.log(firebase, firebase); }) }; })); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/_expected/system/main2.js000066400000000000000000000003571450520414700326370ustar00rootroot00000000000000System.register(['./generated-module1.js'], (function () { 'use strict'; var firebase; return { setters: [function (module) { firebase = module.f; }], execute: (function () { console.log(firebase, firebase); }) }; })); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/main1.js000066400000000000000000000001201450520414700273360ustar00rootroot00000000000000import a from './module1.js'; import b from './module3.js'; console.log(a, b); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/main2.js000066400000000000000000000001201450520414700273370ustar00rootroot00000000000000import a from './module1.js'; import b from './module3.js'; console.log(a, b); rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/module1.js000066400000000000000000000000561450520414700277070ustar00rootroot00000000000000const firebase = {}; export default firebase; rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/module2.js000066400000000000000000000000731450520414700277070ustar00rootroot00000000000000import firebase from './module1'; export default firebase; rollup-3.29.4/test/chunking-form/samples/default-export-name-conflict/module3.js000066400000000000000000000000731450520414700277100ustar00rootroot00000000000000import firebase from './module2'; export default firebase; rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/000077500000000000000000000000001450520414700256645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_config.js000066400000000000000000000002141450520414700276230ustar00rootroot00000000000000module.exports = defineTest({ description: 'Default export identifier name handling', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/000077500000000000000000000000001450520414700276245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/amd/000077500000000000000000000000001450520414700303655ustar00rootroot00000000000000generated-shared.js000066400000000000000000000001571450520414700340510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const data = [1, 2, 3]; exports.data = data; })); rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/amd/main1.js000066400000000000000000000002031450520414700317230ustar00rootroot00000000000000define(['./generated-shared'], (function (shared) { 'use strict'; var main1 = shared.data.map(d => d + 1); return main1; })); rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/amd/main2.js000066400000000000000000000002031450520414700317240ustar00rootroot00000000000000define(['./generated-shared'], (function (shared) { 'use strict'; var main2 = shared.data.map(d => d + 2); return main2; })); rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/cjs/000077500000000000000000000000001450520414700304035ustar00rootroot00000000000000generated-shared.js000066400000000000000000000000751450520414700340660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/cjs'use strict'; const data = [1, 2, 3]; exports.data = data; rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/cjs/main1.js000066400000000000000000000002011450520414700317370ustar00rootroot00000000000000'use strict'; var shared = require('./generated-shared.js'); var main1 = shared.data.map(d => d + 1); module.exports = main1; rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/cjs/main2.js000066400000000000000000000002011450520414700317400ustar00rootroot00000000000000'use strict'; var shared = require('./generated-shared.js'); var main2 = shared.data.map(d => d + 2); module.exports = main2; rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/es/000077500000000000000000000000001450520414700302335ustar00rootroot00000000000000generated-shared.js000066400000000000000000000000571450520414700337160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/esconst data = [1, 2, 3]; export { data as d }; rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/es/main1.js000066400000000000000000000001641450520414700315770ustar00rootroot00000000000000import { d as data } from './generated-shared.js'; var main1 = data.map(d => d + 1); export { main1 as default }; rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/es/main2.js000066400000000000000000000001641450520414700316000ustar00rootroot00000000000000import { d as data } from './generated-shared.js'; var main2 = data.map(d => d + 2); export { main2 as default }; rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/system/000077500000000000000000000000001450520414700311505ustar00rootroot00000000000000generated-shared.js000066400000000000000000000002261450520414700346310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const data = exports('d', [1, 2, 3]); }) }; })); rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/system/main1.js000066400000000000000000000004021450520414700325070ustar00rootroot00000000000000System.register(['./generated-shared.js'], (function (exports) { 'use strict'; var data; return { setters: [function (module) { data = module.d; }], execute: (function () { var main1 = exports('default', data.map(d => d + 1)); }) }; })); rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/_expected/system/main2.js000066400000000000000000000004021450520414700325100ustar00rootroot00000000000000System.register(['./generated-shared.js'], (function (exports) { 'use strict'; var data; return { setters: [function (module) { data = module.d; }], execute: (function () { var main2 = exports('default', data.map(d => d + 2)); }) }; })); rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/main1.js000066400000000000000000000000761450520414700272320ustar00rootroot00000000000000import d from './shared.js'; export default d.map(d => d + 1);rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/main2.js000066400000000000000000000000761450520414700272330ustar00rootroot00000000000000import d from './shared.js'; export default d.map(d => d + 2);rollup-3.29.4/test/chunking-form/samples/default-identifier-renaming/shared.js000066400000000000000000000000541450520414700274670ustar00rootroot00000000000000const data = [1, 2, 3]; export default data;rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/000077500000000000000000000000001450520414700255465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/Component_one.js000066400000000000000000000001501450520414700307030ustar00rootroot00000000000000import * as icons from './icons/index'; const __component__ = { icons }; export default __component__; rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_config.js000066400000000000000000000002501450520414700275050ustar00rootroot00000000000000module.exports = defineTest({ description: 'Properly handle adding a default reexport to a namespace (#3583)', options: { input: ['main.js', 'icons/one.js'] } }); rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/000077500000000000000000000000001450520414700275065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/amd/000077500000000000000000000000001450520414700302475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/amd/main.js000066400000000000000000000004161450520414700315320ustar00rootroot00000000000000define(['exports', './one'], (function (exports, one) { 'use strict'; const __icon__ = {}; var icons = /*#__PURE__*/Object.freeze({ __proto__: null, one: one, two: __icon__ }); const __component__ = { icons }; exports.Component_one = __component__; })); rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/amd/one.js000066400000000000000000000001241450520414700313630ustar00rootroot00000000000000define((function () { 'use strict'; const __icon__ = {}; return __icon__; })); rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/cjs/000077500000000000000000000000001450520414700302655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/cjs/main.js000066400000000000000000000003501450520414700315450ustar00rootroot00000000000000'use strict'; var one = require('./one.js'); const __icon__ = {}; var icons = /*#__PURE__*/Object.freeze({ __proto__: null, one: one, two: __icon__ }); const __component__ = { icons }; exports.Component_one = __component__; rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/cjs/one.js000066400000000000000000000001001450520414700313730ustar00rootroot00000000000000'use strict'; const __icon__ = {}; module.exports = __icon__; rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/es/000077500000000000000000000000001450520414700301155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/es/main.js000066400000000000000000000003501450520414700313750ustar00rootroot00000000000000import __icon__$1 from './one.js'; const __icon__ = {}; var icons = /*#__PURE__*/Object.freeze({ __proto__: null, one: __icon__$1, two: __icon__ }); const __component__ = { icons }; export { __component__ as Component_one }; rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/es/one.js000066400000000000000000000000661450520414700312360ustar00rootroot00000000000000const __icon__ = {}; export { __icon__ as default }; rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/system/000077500000000000000000000000001450520414700310325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/system/main.js000066400000000000000000000006251450520414700323170ustar00rootroot00000000000000System.register(['./one.js'], (function (exports) { 'use strict'; var __icon__$1; return { setters: [function (module) { __icon__$1 = module.default; }], execute: (function () { const __icon__ = {}; var icons = /*#__PURE__*/Object.freeze({ __proto__: null, one: __icon__$1, two: __icon__ }); const __component__ = exports('Component_one', { icons }); }) }; })); rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/_expected/system/one.js000066400000000000000000000002311450520414700321450ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const __icon__ = exports('default', {}); }) }; })); rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/icons/000077500000000000000000000000001450520414700266615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/icons/index.js000066400000000000000000000001201450520414700303170ustar00rootroot00000000000000export { default as one } from './one'; export { default as two } from './two'; rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/icons/one.js000066400000000000000000000000541450520414700277770ustar00rootroot00000000000000const __icon__ = {} export default __icon__rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/icons/two.js000066400000000000000000000000541450520414700300270ustar00rootroot00000000000000const __icon__ = {} export default __icon__rollup-3.29.4/test/chunking-form/samples/default-reexport-namespace/main.js000066400000000000000000000000751450520414700270320ustar00rootroot00000000000000export { default as Component_one } from './Component_one.js'rollup-3.29.4/test/chunking-form/samples/deprecated/000077500000000000000000000000001450520414700224225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/000077500000000000000000000000001450520414700305165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_config.js000066400000000000000000000003721450520414700324620ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoids empty imports if they do not have side-effects when preserving modules (#3359)', options: { strictDeprecations: false, preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/000077500000000000000000000000001450520414700324565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amd/000077500000000000000000000000001450520414700332175ustar00rootroot00000000000000a.js000066400000000000000000000001361450520414700337160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const a = 1; exports.a = a; })); b.js000066400000000000000000000001361450520414700337170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const b = 2; exports.b = b; })); main.js000066400000000000000000000001361450520414700344220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amddefine(['./a', './one'], (function (a, one) { 'use strict'; console.log(a.a + one.d); })); one.js000066400000000000000000000001561450520414700342610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/amddefine(['exports', './b'], (function (exports, b) { 'use strict'; const d = b.b + 4; exports.d = d; })); rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs/000077500000000000000000000000001450520414700332355ustar00rootroot00000000000000a.js000066400000000000000000000000541450520414700337330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs'use strict'; const a = 1; exports.a = a; b.js000066400000000000000000000000541450520414700337340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs'use strict'; const b = 2; exports.b = b; main.js000066400000000000000000000001441450520414700344370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs'use strict'; var a = require('./a.js'); var one = require('./one.js'); console.log(a.a + one.d); one.js000066400000000000000000000001161450520414700342730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/cjs'use strict'; var b = require('./b.js'); const d = b.b + 4; exports.d = d; rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/000077500000000000000000000000001450520414700330655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/a.js000066400000000000000000000000341450520414700336400ustar00rootroot00000000000000const a = 1; export { a }; rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/es/b.js000066400000000000000000000000341450520414700336410ustar00rootroot00000000000000const b = 2; export { b }; main.js000066400000000000000000000001171450520414700342670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/esimport { a } from './a.js'; import { d } from './one.js'; console.log(a + d); one.js000066400000000000000000000000751450520414700341270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/esimport { b } from './b.js'; const d = b + 4; export { d }; rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/system/000077500000000000000000000000001450520414700340025ustar00rootroot00000000000000a.js000066400000000000000000000002131450520414700344750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const a = exports('a', 1); }) }; })); b.js000066400000000000000000000002131450520414700344760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const b = exports('b', 2); }) }; })); main.js000066400000000000000000000003751450520414700352120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/systemSystem.register(['./a.js', './one.js'], (function () { 'use strict'; var a, d; return { setters: [function (module) { a = module.a; }, function (module) { d = module.d; }], execute: (function () { console.log(a + d); }) }; })); one.js000066400000000000000000000003261450520414700350430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_expected/systemSystem.register(['./b.js'], (function (exports) { 'use strict'; var b; return { setters: [function (module) { b = module.b; }], execute: (function () { const d = exports('d', b + 4); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/a.js000066400000000000000000000000241450520414700312700ustar00rootroot00000000000000export const a = 1; rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/b.js000066400000000000000000000000241450520414700312710ustar00rootroot00000000000000export const b = 2; rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/c.js000066400000000000000000000000241450520414700312720ustar00rootroot00000000000000export const c = 3; rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/index.js000066400000000000000000000001131450520414700321560ustar00rootroot00000000000000export { a } from './a'; export { b } from './b'; export { c } from './c'; rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/main.js000066400000000000000000000001141450520414700317740ustar00rootroot00000000000000import { a } from './index'; import { d } from './one'; console.log(a + d); rollup-3.29.4/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/one.js000066400000000000000000000000651450520414700316360ustar00rootroot00000000000000import { b } from './index'; export const d = b + 4; rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/000077500000000000000000000000001450520414700267725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_config.js000066400000000000000000000004261450520414700307360ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles manual chunks with circular dependencies', expectedWarnings: ['CIRCULAR_DEPENDENCY', 'DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: 'main', manualChunks: { lib1: ['lib1'], lib2: ['lib2'] } } }); rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/000077500000000000000000000000001450520414700307325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/000077500000000000000000000000001450520414700314735ustar00rootroot00000000000000generated-lib1.js000066400000000000000000000002641450520414700345370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amddefine(['exports', './generated-lib2'], (function (exports, lib2) { 'use strict'; const lib1 = 'lib1'; console.log(`${lib1} imports ${lib2.lib2}`); exports.lib1 = lib1; })); generated-lib2.js000066400000000000000000000002641450520414700345400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amddefine(['exports', './generated-lib1'], (function (exports, lib1) { 'use strict'; const lib2 = 'lib2'; console.log(`${lib2} imports ${lib1.lib1}`); exports.lib2 = lib2; })); rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/amd/main.js000066400000000000000000000002201450520414700327470ustar00rootroot00000000000000define(['exports', './generated-lib1', './generated-lib2'], (function (exports, lib1, lib2) { 'use strict'; exports.lib1 = lib1.lib1; })); rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/000077500000000000000000000000001450520414700315115ustar00rootroot00000000000000generated-lib1.js000066400000000000000000000002231450520414700345500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs'use strict'; var lib2 = require('./generated-lib2.js'); const lib1 = 'lib1'; console.log(`${lib1} imports ${lib2.lib2}`); exports.lib1 = lib1; generated-lib2.js000066400000000000000000000002231450520414700345510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs'use strict'; var lib1 = require('./generated-lib1.js'); const lib2 = 'lib2'; console.log(`${lib2} imports ${lib1.lib1}`); exports.lib2 = lib2; rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/cjs/main.js000066400000000000000000000001671450520414700327770ustar00rootroot00000000000000'use strict'; var lib1 = require('./generated-lib1.js'); require('./generated-lib2.js'); exports.lib1 = lib1.lib1; rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/000077500000000000000000000000001450520414700313415ustar00rootroot00000000000000generated-lib1.js000066400000000000000000000002061450520414700344010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/esimport { l as lib2 } from './generated-lib2.js'; const lib1 = 'lib1'; console.log(`${lib1} imports ${lib2}`); export { lib1 as l }; generated-lib2.js000066400000000000000000000002061450520414700344020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/esimport { l as lib1 } from './generated-lib1.js'; const lib2 = 'lib2'; console.log(`${lib2} imports ${lib1}`); export { lib2 as l }; rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/es/main.js000066400000000000000000000001171450520414700326220ustar00rootroot00000000000000export { l as lib1 } from './generated-lib1.js'; import './generated-lib2.js'; rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/000077500000000000000000000000001450520414700322565ustar00rootroot00000000000000generated-lib1.js000066400000000000000000000004301450520414700353150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/systemSystem.register(['./generated-lib2.js'], (function (exports) { 'use strict'; var lib2; return { setters: [function (module) { lib2 = module.l; }], execute: (function () { const lib1 = exports('l', 'lib1'); console.log(`${lib1} imports ${lib2}`); }) }; })); generated-lib2.js000066400000000000000000000004301450520414700353160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/systemSystem.register(['./generated-lib1.js'], (function (exports) { 'use strict'; var lib1; return { setters: [function (module) { lib1 = module.l; }], execute: (function () { const lib2 = exports('l', 'lib2'); console.log(`${lib2} imports ${lib1}`); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/_expected/system/main.js000066400000000000000000000003441450520414700335410ustar00rootroot00000000000000System.register(['./generated-lib1.js', './generated-lib2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('lib1', module.l); }, null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/lib1.js000066400000000000000000000001461450520414700301600ustar00rootroot00000000000000import { lib2 } from './lib2.js'; export const lib1 = 'lib1'; console.log(`${lib1} imports ${lib2}`); rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/lib2.js000066400000000000000000000001431450520414700301560ustar00rootroot00000000000000import { lib1 } from './lib1'; export const lib2 = 'lib2'; console.log(`${lib2} imports ${lib1}`); rollup-3.29.4/test/chunking-form/samples/deprecated/circular-manual-chunks/main.js000066400000000000000000000000421450520414700302500ustar00rootroot00000000000000export { lib1 } from './lib1.js'; rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/000077500000000000000000000000001450520414700272015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_config.js000066400000000000000000000005351450520414700311460ustar00rootroot00000000000000module.exports = defineTest({ description: 'should not remove inline comments inside dynamic import', options: { strictDeprecations: false, input: 'main.js', onwarn() {}, plugins: { resolveDynamicImport() { return false; } }, output: { dynamicImportFunction: 'foobar' } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/000077500000000000000000000000001450520414700311415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/amd/000077500000000000000000000000001450520414700317025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/amd/main.js000066400000000000000000000012031450520414700331600ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } new Promise(function (resolve, reject) { require([ /* webpackChunkName: "chunk-name" */ './foo'/*suffix*/], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/cjs/000077500000000000000000000000001450520414700317205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/cjs/main.js000066400000000000000000000001621450520414700332010ustar00rootroot00000000000000'use strict'; import /* () should not break */ ( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/es/000077500000000000000000000000001450520414700315505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/es/main.js000066400000000000000000000001041450520414700330250ustar00rootroot00000000000000foobar( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/system/000077500000000000000000000000001450520414700324655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/_expected/system/main.js000066400000000000000000000003111450520414700337420ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-comments/main.js000066400000000000000000000001431450520414700304610ustar00rootroot00000000000000import /* () should not break */ ( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/000077500000000000000000000000001450520414700304275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_config.js000066400000000000000000000004101450520414700323640ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports an object with a single entry when inlining dynamic imports', options: { strictDeprecations: false, inlineDynamicImports: true, input: { entry: 'main' } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/000077500000000000000000000000001450520414700323675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/amd/000077500000000000000000000000001450520414700331305ustar00rootroot00000000000000entry.js000066400000000000000000000003321450520414700345460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); exports.bar = bar; })); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/cjs/000077500000000000000000000000001450520414700331465ustar00rootroot00000000000000entry.js000066400000000000000000000002441450520414700345660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/cjs'use strict'; const bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); exports.bar = bar; rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/es/000077500000000000000000000000001450520414700327765ustar00rootroot00000000000000entry.js000066400000000000000000000002221450520414700344120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/esconst bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); export { bar }; rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/system/000077500000000000000000000000001450520414700337135ustar00rootroot00000000000000entry.js000066400000000000000000000004151450520414700353330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const bar = exports('bar', 2); Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/foo.js000066400000000000000000000000251450520414700315450ustar00rootroot00000000000000export const foo = 1;rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/main.js000066400000000000000000000000521450520414700317060ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/000077500000000000000000000000001450520414700262745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_config.js000066400000000000000000000005221450520414700302350ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows specifying a custom importer function', options: { strictDeprecations: false, input: 'main.js', onwarn() {}, plugins: { resolveDynamicImport() { return false; } }, output: { dynamicImportFunction: 'foobar' } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/000077500000000000000000000000001450520414700302345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/amd/000077500000000000000000000000001450520414700307755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/amd/main.js000066400000000000000000000011651450520414700322620ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } new Promise(function (resolve, reject) { require(['./foo'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }).then(result => console.log(result)); })); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/cjs/000077500000000000000000000000001450520414700310135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/cjs/main.js000066400000000000000000000001071450520414700322730ustar00rootroot00000000000000'use strict'; import('./foo.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/es/000077500000000000000000000000001450520414700306435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/es/main.js000066400000000000000000000000701450520414700321220ustar00rootroot00000000000000foobar('./foo.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/system/000077500000000000000000000000001450520414700315605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/_expected/system/main.js000066400000000000000000000002671450520414700330470ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./foo.js').then(result => console.log(result)); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/dynamic-import-name/main.js000066400000000000000000000000701450520414700275530ustar00rootroot00000000000000import('./foo.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/000077500000000000000000000000001450520414700266045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js000066400000000000000000000010621450520414700305450ustar00rootroot00000000000000const assert = require('node:assert'); let referenceId; module.exports = defineTest({ description: 'retrieves the correct name of an emitted chunk in case a facade is created', options: { strictDeprecations: false, input: 'main', manualChunks: { 'build-starter': ['buildStart'] }, plugins: { buildStart() { referenceId = this.emitFile({ type: 'chunk', id: 'buildStart' }); }, renderChunk() { assert.strictEqual(this.getFileName(referenceId), 'generated-buildStart.js'); } } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/000077500000000000000000000000001450520414700305445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/000077500000000000000000000000001450520414700313055ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003111450520414700362740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; const otherValue = 43; console.log('startBuild', value); exports.otherValue = otherValue; exports.value = value; })); generated-buildStart.js000066400000000000000000000002331450520414700356330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amddefine(['exports', './generated-build-starter'], (function (exports, buildStarter) { 'use strict'; exports.buildStartValue = buildStarter.value; })); rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/main.js000066400000000000000000000002311450520414700325630ustar00rootroot00000000000000define(['./generated-build-starter'], (function (buildStarter) { 'use strict'; console.log('main', buildStarter.value, buildStarter.otherValue); })); rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/000077500000000000000000000000001450520414700313235ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000002241450520414700363150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs'use strict'; const value = 42; const otherValue = 43; console.log('startBuild', value); exports.otherValue = otherValue; exports.value = value; generated-buildStart.js000066400000000000000000000001741450520414700356550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs'use strict'; var buildStarter = require('./generated-build-starter.js'); exports.buildStartValue = buildStarter.value; rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/main.js000066400000000000000000000002161450520414700326040ustar00rootroot00000000000000'use strict'; var buildStarter = require('./generated-build-starter.js'); console.log('main', buildStarter.value, buildStarter.otherValue); rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/000077500000000000000000000000001450520414700311535ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000001651450520414700361510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/esconst value = 42; const otherValue = 43; console.log('startBuild', value); export { otherValue as o, value as v }; generated-buildStart.js000066400000000000000000000001051450520414700354770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/esexport { v as buildStartValue } from './generated-build-starter.js'; rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/main.js000066400000000000000000000001651450520414700324370ustar00rootroot00000000000000import { v as value, o as otherValue } from './generated-build-starter.js'; console.log('main', value, otherValue); rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/000077500000000000000000000000001450520414700320705ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003361450520414700370660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('v', 42); const otherValue = exports('o', 43); console.log('startBuild', value); }) }; })); generated-buildStart.js000066400000000000000000000003331450520414700364170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/systemSystem.register(['./generated-build-starter.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('buildStartValue', module.v); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/main.js000066400000000000000000000004341450520414700333530ustar00rootroot00000000000000System.register(['./generated-build-starter.js'], (function () { 'use strict'; var value, otherValue; return { setters: [function (module) { value = module.v; otherValue = module.o; }], execute: (function () { console.log('main', value, otherValue); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/buildStart.js000066400000000000000000000001511450520414700312540ustar00rootroot00000000000000import {value} from './dep.js'; console.log('startBuild', value); export { value as buildStartValue }; rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/dep.js000066400000000000000000000000671450520414700277150ustar00rootroot00000000000000export const value = 42; export const otherValue = 43; rollup-3.29.4/test/chunking-form/samples/deprecated/emit-file-chunk-facade/main.js000066400000000000000000000001241450520414700300630ustar00rootroot00000000000000import { value, otherValue } from './dep'; console.log('main', value, otherValue); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/000077500000000000000000000000001450520414700274265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_config.js000066400000000000000000000034151450520414700313730ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); // @ts-expect-error not included in types const { getObject } = require('../../../../utils'); module.exports = defineTest({ description: 'associates empty modules with chunks if tree-shaking is disabled for them', options: { strictDeprecations: false, input: ['main1.js', 'main2.js'], plugins: { resolveId(id) { if (id.startsWith('empty')) { if (id === 'emptyResolved') { return { id, moduleSideEffects: 'no-treeshake' }; } return id; } }, load(id) { if (id.startsWith('empty')) { if (id === 'emptyLoaded') { return { code: '', moduleSideEffects: 'no-treeshake' }; } return ''; } }, transform(code, id) { if (id === 'emptyTransformed') { return { code: '', moduleSideEffects: 'no-treeshake' }; } }, generateBundle(options, bundle) { assert.deepStrictEqual( getObject( [...this.getModuleIds()].map(id => [ id.startsWith('empty') ? id : path.relative(__dirname, id), this.getModuleInfo(id).hasModuleSideEffects ]) ), { empty: true, emptyLoaded: 'no-treeshake', emptyResolved: 'no-treeshake', emptyTransformed: 'no-treeshake', 'main1.js': true, 'main2.js': true } ); assert.deepStrictEqual( getObject( Object.entries(bundle).map(([chunkId, chunk]) => [ chunkId, Object.keys(chunk.modules).map(moduleId => path.relative(__dirname, moduleId)) ]) ), { 'main1.js': ['emptyResolved', 'main1.js'], 'main2.js': ['emptyLoaded', 'main2.js'], 'generated-emptyTransformed.js': ['emptyTransformed'] } ); } } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/000077500000000000000000000000001450520414700313665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/000077500000000000000000000000001450520414700321275ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000000541450520414700377040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amddefine((function () { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main1.js000066400000000000000000000001641450520414700334730ustar00rootroot00000000000000define(['./generated-emptyTransformed'], (function (emptyTransformed) { 'use strict'; console.log('main1'); })); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/amd/main2.js000066400000000000000000000001641450520414700334740ustar00rootroot00000000000000define(['./generated-emptyTransformed'], (function (emptyTransformed) { 'use strict'; console.log('main2'); })); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/000077500000000000000000000000001450520414700321455ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000000171450520414700377210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs'use strict'; rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main1.js000066400000000000000000000001221450520414700335030ustar00rootroot00000000000000'use strict'; require('./generated-emptyTransformed.js'); console.log('main1'); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/cjs/main2.js000066400000000000000000000001221450520414700335040ustar00rootroot00000000000000'use strict'; require('./generated-emptyTransformed.js'); console.log('main2'); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/000077500000000000000000000000001450520414700317755ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000000011450520414700375420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main1.js000066400000000000000000000001011450520414700333300ustar00rootroot00000000000000import './generated-emptyTransformed.js'; console.log('main1'); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/es/main2.js000066400000000000000000000001011450520414700333310ustar00rootroot00000000000000import './generated-emptyTransformed.js'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/system/000077500000000000000000000000001450520414700327125ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000001471450520414700404720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); main1.js000066400000000000000000000002631450520414700341770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/systemSystem.register(['./generated-emptyTransformed.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main1'); }) }; })); main2.js000066400000000000000000000002631450520414700342000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_expected/systemSystem.register(['./generated-emptyTransformed.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/main1.js000066400000000000000000000001311450520414700307640ustar00rootroot00000000000000import 'empty'; import 'emptyResolved'; import 'emptyTransformed'; console.log('main1'); rollup-3.29.4/test/chunking-form/samples/deprecated/empty-module-no-treeshake/main2.js000066400000000000000000000001271450520414700307720ustar00rootroot00000000000000import 'empty'; import 'emptyLoaded'; import 'emptyTransformed'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/000077500000000000000000000000001450520414700315535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js000066400000000000000000000004121450520414700335120ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not drop indirect reexports when preserving modules', expectedWarnings: ['MIXED_EXPORTS', 'DEPRECATED_FEATURE'], options: { strictDeprecations: false, output: { name: 'bundle' }, preserveModules: true } }); rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/000077500000000000000000000000001450520414700335135ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700341755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expectedcomponents/000077500000000000000000000000001450520414700363625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amdindex.js000066400000000000000000000002511450520414700400250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/componentsdefine(['exports', './sub/index'], (function (exports, index) { 'use strict'; const baz = { bar: index.default }; exports.foo = index.foo; exports.baz = baz; })); sub/000077500000000000000000000000001450520414700371535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/componentsindex.js000066400000000000000000000003261450520414700406210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/components/subdefine(['exports'], (function (exports) { 'use strict'; const foo = 'bar'; var bar = () => {}; exports.default = bar; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); main.js000066400000000000000000000002671450520414700354640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amddefine(['exports', './components/index', './components/sub/index'], (function (exports, index, index$1) { 'use strict'; exports.baz = index.baz; exports.foo = index$1.foo; })); cjs/000077500000000000000000000000001450520414700342135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expectedcomponents/000077500000000000000000000000001450520414700364005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjsindex.js000066400000000000000000000002101450520414700400360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components'use strict'; var index = require('./sub/index.js'); const baz = { bar: index.default }; exports.foo = index.foo; exports.baz = baz; sub/000077500000000000000000000000001450520414700371715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/componentsindex.js000066400000000000000000000002411450520414700406330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components/sub'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo = 'bar'; var bar = () => {}; exports.default = bar; exports.foo = foo; main.js000066400000000000000000000002501450520414700354720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs'use strict'; var index = require('./components/index.js'); var index$1 = require('./components/sub/index.js'); exports.baz = index.baz; exports.foo = index$1.foo; es/000077500000000000000000000000001450520414700340435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expectedcomponents/000077500000000000000000000000001450520414700362305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/esindex.js000066400000000000000000000001571450520414700377000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/componentsimport bar from './sub/index.js'; export { foo } from './sub/index.js'; const baz = { bar }; export { baz }; sub/000077500000000000000000000000001450520414700370215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/componentsindex.js000066400000000000000000000001101450520414700404560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/subconst foo = 'bar'; var bar = () => {}; export { bar as default, foo }; main.js000066400000000000000000000001361450520414700353250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/esexport { baz } from './components/index.js'; export { foo } from './components/sub/index.js'; system/000077500000000000000000000000001450520414700347605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expectedcomponents/000077500000000000000000000000001450520414700371455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/systemindex.js000066400000000000000000000004271450520414700406150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/componentsSystem.register('bundle', ['./sub/index.js'], (function (exports) { 'use strict'; var bar; return { setters: [function (module) { bar = module.default; exports('foo', module.foo); }], execute: (function () { const baz = exports('baz', { bar }); }) }; })); sub/000077500000000000000000000000001450520414700377365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/componentsindex.js000066400000000000000000000003101450520414700413750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/components/subSystem.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 'bar'); var bar = exports('default', () => {}); }) }; })); main.js000066400000000000000000000004511450520414700362420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/systemSystem.register('bundle', ['./components/index.js', './components/sub/index.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('baz', module.baz); }, function (module) { exports('foo', module.foo); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/000077500000000000000000000000001450520414700337405ustar00rootroot00000000000000index.js000066400000000000000000000001251450520414700353240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/componentsimport bar, { foo } from './sub/index'; export const baz = { bar }; export { foo }; sub/000077500000000000000000000000001450520414700344525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/componentsindex.js000066400000000000000000000000751450520414700361210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/subconst foo = 'bar'; export { foo }; export default () => {}; rollup-3.29.4/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/main.js000066400000000000000000000001051450520414700330310ustar00rootroot00000000000000import { baz, foo } from './components/index'; export { baz, foo }; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/000077500000000000000000000000001450520414700273065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js000066400000000000000000000004051450520414700312470ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoid facades if possible when using manual chunks', options: { strictDeprecations: false, input: ['main1', 'main2'], manualChunks: { manual: ['main2'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/000077500000000000000000000000001450520414700312465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/000077500000000000000000000000001450520414700320075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main1.js000066400000000000000000000001471450520414700333540ustar00rootroot00000000000000define(['./main2'], (function (manual) { 'use strict'; console.log('main', manual.reexported); })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main2.js000066400000000000000000000002171450520414700333530ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 42; console.log('main2', value); exports.reexported = value; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/000077500000000000000000000000001450520414700320255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main1.js000066400000000000000000000001341450520414700333660ustar00rootroot00000000000000'use strict'; var manual = require('./main2.js'); console.log('main', manual.reexported); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main2.js000066400000000000000000000001341450520414700333670ustar00rootroot00000000000000'use strict'; const value = 42; console.log('main2', value); exports.reexported = value; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/000077500000000000000000000000001450520414700316555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main1.js000066400000000000000000000001171450520414700332170ustar00rootroot00000000000000import { reexported as value } from './main2.js'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main2.js000066400000000000000000000001211450520414700332130ustar00rootroot00000000000000const value = 42; console.log('main2', value); export { value as reexported }; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/000077500000000000000000000000001450520414700325725ustar00rootroot00000000000000main1.js000066400000000000000000000003411450520414700340540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/systemSystem.register(['./main2.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.reexported; }], execute: (function () { console.log('main', value); }) }; })); main2.js000066400000000000000000000002721450520414700340600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('reexported', 42); console.log('main2', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/dep.js000066400000000000000000000000311450520414700304060ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main1.js000066400000000000000000000000741450520414700306520ustar00rootroot00000000000000import { value } from './dep'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main2.js000066400000000000000000000001371450520414700306530ustar00rootroot00000000000000import {value} from './dep.js'; console.log('main2', value); export { value as reexported }; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/000077500000000000000000000000001450520414700315575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js000066400000000000000000000004711450520414700335230ustar00rootroot00000000000000module.exports = defineTest({ description: 'Uses entry alias if manual chunks contain entry chunks with different alias', options: { strictDeprecations: false, input: { main: 'main.js', main2: 'main2.js' }, manualChunks: { outer: ['outer'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/000077500000000000000000000000001450520414700335175ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700342015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expectedmain.js000066400000000000000000000002301450520414700354560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; })); main2.js000066400000000000000000000000751450520414700355470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amddefine(['./main'], (function (outer) { 'use strict'; })); cjs/000077500000000000000000000000001450520414700342175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expectedmain.js000066400000000000000000000001441450520414700355000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; main2.js000066400000000000000000000000461450520414700355630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs'use strict'; require('./main.js'); es/000077500000000000000000000000001450520414700340475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expectedmain.js000066400000000000000000000001201450520414700353220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/esconsole.log('dep'); console.log('main'); const value = 42; export { value }; main2.js000066400000000000000000000000241450520414700354070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/esimport './main.js'; system/000077500000000000000000000000001450520414700347645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expectedmain.js000066400000000000000000000003051450520414700362440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); main2.js000066400000000000000000000002051450520414700363250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/dep.js000066400000000000000000000000241450520414700326610ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main.js000066400000000000000000000001031450520414700330330ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main2.js000066400000000000000000000000231450520414700331160ustar00rootroot00000000000000import './dep.js'; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/outer.js000066400000000000000000000000501450520414700332460ustar00rootroot00000000000000import './main'; console.log('outer'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/000077500000000000000000000000001450520414700310525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js000066400000000000000000000004571450520414700330220ustar00rootroot00000000000000module.exports = defineTest({ description: 'Identifies the entry chunk with the manual chunk that contains it if the aliases match', options: { strictDeprecations: false, input: { main: 'main.js' }, manualChunks: { main: ['outer'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/000077500000000000000000000000001450520414700330125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/amd/000077500000000000000000000000001450520414700335535ustar00rootroot00000000000000main.js000066400000000000000000000002301450520414700347510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/cjs/000077500000000000000000000000001450520414700335715ustar00rootroot00000000000000main.js000066400000000000000000000001441450520414700347730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/cjs'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/es/000077500000000000000000000000001450520414700334215ustar00rootroot00000000000000main.js000066400000000000000000000001201450520414700346150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/esconsole.log('dep'); console.log('main'); const value = 42; export { value }; system/000077500000000000000000000000001450520414700342575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expectedmain.js000066400000000000000000000003051450520414700355370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/dep.js000066400000000000000000000000241450520414700321540ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/main.js000066400000000000000000000001031450520414700323260ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/outer.js000066400000000000000000000000501450520414700325410ustar00rootroot00000000000000import './main'; console.log('outer'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/000077500000000000000000000000001450520414700303545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js000066400000000000000000000004641450520414700323220ustar00rootroot00000000000000module.exports = defineTest({ description: 'Uses entry alias if manual chunks are entry chunks with different alias', options: { strictDeprecations: false, input: { main: 'main.js', main2: 'main2.js' }, manualChunks: { other: ['main'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/000077500000000000000000000000001450520414700323145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/000077500000000000000000000000001450520414700330555ustar00rootroot00000000000000main.js000066400000000000000000000002301450520414700342530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; })); main2.js000066400000000000000000000000751450520414700343440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amddefine(['./main'], (function (other) { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/000077500000000000000000000000001450520414700330735ustar00rootroot00000000000000main.js000066400000000000000000000001441450520414700342750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; main2.js000066400000000000000000000000461450520414700343600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs'use strict'; require('./main.js'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/000077500000000000000000000000001450520414700327235ustar00rootroot00000000000000main.js000066400000000000000000000001201450520414700341170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/esconsole.log('dep'); console.log('main'); const value = 42; export { value }; main2.js000066400000000000000000000000241450520414700342040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/esimport './main.js'; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/000077500000000000000000000000001450520414700336405ustar00rootroot00000000000000main.js000066400000000000000000000003051450520414700350410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); main2.js000066400000000000000000000002051450520414700351220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/dep.js000066400000000000000000000000241450520414700314560ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main.js000066400000000000000000000001031450520414700316300ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main2.js000066400000000000000000000000231450520414700317130ustar00rootroot00000000000000import './dep.js'; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/000077500000000000000000000000001450520414700276475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js000066400000000000000000000004651450520414700316160ustar00rootroot00000000000000module.exports = defineTest({ description: 'Identifies the entry chunk with the manual chunk that has the same entry if the aliases match', options: { strictDeprecations: false, input: { main: 'main.js' }, manualChunks: { main: ['main'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/000077500000000000000000000000001450520414700316075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/amd/000077500000000000000000000000001450520414700323505ustar00rootroot00000000000000main.js000066400000000000000000000002301450520414700335460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/cjs/000077500000000000000000000000001450520414700323665ustar00rootroot00000000000000main.js000066400000000000000000000001441450520414700335700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/cjs'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/es/000077500000000000000000000000001450520414700322165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/es/main.js000066400000000000000000000001201450520414700334710ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/system/000077500000000000000000000000001450520414700331335ustar00rootroot00000000000000main.js000066400000000000000000000003051450520414700343340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/dep.js000066400000000000000000000000241450520414700307510ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/main.js000066400000000000000000000001031450520414700311230ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/000077500000000000000000000000001450520414700304145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js000066400000000000000000000005251450520414700323600ustar00rootroot00000000000000module.exports = defineTest({ description: 'manual chunks can have other manual chunks as dependencies', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { 'manual-outer': ['outer.js'], 'manual-inner': ['inner.js'], 'manual-middle': ['middle.js'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/000077500000000000000000000000001450520414700323545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/000077500000000000000000000000001450520414700331155ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000001021450520414700377070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amddefine((function () { 'use strict'; console.log('inner'); })); generated-manual-middle.js000066400000000000000000000001541450520414700400410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amddefine(['./generated-manual-inner'], (function (manualInner) { 'use strict'; console.log('middle'); })); generated-manual-outer.js000066400000000000000000000001551450520414700377420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amddefine(['./generated-manual-middle'], (function (manualMiddle) { 'use strict'; console.log('outer'); })); main.js000066400000000000000000000002761450520414700343250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amddefine(['./generated-manual-outer', './generated-manual-middle', './generated-manual-inner'], (function (manualOuter, manualMiddle, manualInner) { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/000077500000000000000000000000001450520414700331335ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000000451450520414700377330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs'use strict'; console.log('inner'); generated-manual-middle.js000066400000000000000000000001171450520414700400560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs'use strict'; require('./generated-manual-inner.js'); console.log('middle'); generated-manual-outer.js000066400000000000000000000001171450520414700377560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs'use strict'; require('./generated-manual-middle.js'); console.log('outer'); main.js000066400000000000000000000002361450520414700343370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs'use strict'; require('./generated-manual-outer.js'); require('./generated-manual-middle.js'); require('./generated-manual-inner.js'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/000077500000000000000000000000001450520414700327635ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000000261450520414700375620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/esconsole.log('inner'); generated-manual-middle.js000066400000000000000000000000761450520414700377120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/esimport './generated-manual-inner.js'; console.log('middle'); generated-manual-outer.js000066400000000000000000000000761450520414700376120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/esimport './generated-manual-middle.js'; console.log('outer'); main.js000066400000000000000000000002111450520414700341600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/esimport './generated-manual-outer.js'; import './generated-manual-middle.js'; import './generated-manual-inner.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/000077500000000000000000000000001450520414700337005ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000001771450520414700405060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('inner'); }) }; })); generated-manual-middle.js000066400000000000000000000002601450520414700406220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/systemSystem.register(['./generated-manual-inner.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('middle'); }) }; })); generated-manual-outer.js000066400000000000000000000002601450520414700405220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/systemSystem.register(['./generated-manual-middle.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('outer'); }) }; })); main.js000066400000000000000000000003711450520414700351040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/systemSystem.register(['./generated-manual-outer.js', './generated-manual-middle.js', './generated-manual-inner.js'], (function () { 'use strict'; return { setters: [null, null, null], execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/inner.js000066400000000000000000000000261450520414700320630ustar00rootroot00000000000000console.log('inner'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/main.js000066400000000000000000000000531450520414700316740ustar00rootroot00000000000000import './outer.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/middle.js000066400000000000000000000000551450520414700322100ustar00rootroot00000000000000import './inner.js'; console.log('middle'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-different-nested/outer.js000066400000000000000000000000551450520414700321100ustar00rootroot00000000000000import './middle.js'; console.log('outer'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/000077500000000000000000000000001450520414700301765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js000066400000000000000000000004111450520414700321340ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates facades for dynamic manual chunks if necessary', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { dynamic: ['dynamic1.js'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/000077500000000000000000000000001450520414700321365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/000077500000000000000000000000001450520414700326775ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000011701450520414700365350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const DEP = 'DEP'; const DYNAMIC_2 = 'DYNAMIC_2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_2: DYNAMIC_2 }); const DYNAMIC_3 = 'DYNAMIC_3'; var dynamic3 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_3: DYNAMIC_3 }); const DYNAMIC_1 = 'DYNAMIC_1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DEP: DEP, DYNAMIC_1: DYNAMIC_1, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports.DEP = DEP; exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; exports.dynamic3 = dynamic3; })); main.js000066400000000000000000000011051450520414700340770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amddefine(['require', './generated-dynamic'], (function (require, dynamic) { 'use strict'; Promise.all([new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic1; }), new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic2; }), new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic3; })]).then( results => console.log(results, dynamic.DEP) ); })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/000077500000000000000000000000001450520414700327155ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000010611450520414700365520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs'use strict'; const DEP = 'DEP'; const DYNAMIC_2 = 'DYNAMIC_2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_2: DYNAMIC_2 }); const DYNAMIC_3 = 'DYNAMIC_3'; var dynamic3 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_3: DYNAMIC_3 }); const DYNAMIC_1 = 'DYNAMIC_1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DEP: DEP, DYNAMIC_1: DYNAMIC_1, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports.DEP = DEP; exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; exports.dynamic3 = dynamic3; main.js000066400000000000000000000007751450520414700341310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs'use strict'; var dynamic = require('./generated-dynamic.js'); Promise.all([Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic1; }), Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic2; }), Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic3; })]).then( results => console.log(results, dynamic.DEP) ); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/000077500000000000000000000000001450520414700325455ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000007721450520414700364120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/esconst DEP = 'DEP'; const DYNAMIC_2 = 'DYNAMIC_2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_2: DYNAMIC_2 }); const DYNAMIC_3 = 'DYNAMIC_3'; var dynamic3 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_3: DYNAMIC_3 }); const DYNAMIC_1 = 'DYNAMIC_1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DEP: DEP, DYNAMIC_1: DYNAMIC_1, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); export { DEP as D, dynamic3 as a, dynamic1 as b, dynamic2 as d }; main.js000066400000000000000000000005001450520414700337430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/esimport { D as DEP } from './generated-dynamic.js'; Promise.all([import('./generated-dynamic.js').then(function (n) { return n.b; }), import('./generated-dynamic.js').then(function (n) { return n.d; }), import('./generated-dynamic.js').then(function (n) { return n.a; })]).then( results => console.log(results, DEP) ); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/000077500000000000000000000000001450520414700334625ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000012741450520414700373250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const DEP = exports('D', 'DEP'); const DYNAMIC_2 = 'DYNAMIC_2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_2: DYNAMIC_2 }); exports('d', dynamic2); const DYNAMIC_3 = 'DYNAMIC_3'; var dynamic3 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_3: DYNAMIC_3 }); exports('a', dynamic3); const DYNAMIC_1 = 'DYNAMIC_1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DEP: DEP, DYNAMIC_1: DYNAMIC_1, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports('b', dynamic1); }) }; })); main.js000066400000000000000000000007721450520414700346730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/systemSystem.register(['./generated-dynamic.js'], (function (exports, module) { 'use strict'; var DEP; return { setters: [function (module) { DEP = module.D; }], execute: (function () { Promise.all([module.import('./generated-dynamic.js').then(function (n) { return n.b; }), module.import('./generated-dynamic.js').then(function (n) { return n.d; }), module.import('./generated-dynamic.js').then(function (n) { return n.a; })]).then( results => console.log(results, DEP) ); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dep.js000066400000000000000000000000321450520414700312770ustar00rootroot00000000000000export const DEP = 'DEP'; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic1.js000066400000000000000000000001761450520414700322450ustar00rootroot00000000000000export * from './dep.js'; export * from './dynamic2.js'; export * from './dynamic3.js'; export const DYNAMIC_1 = 'DYNAMIC_1'; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic2.js000066400000000000000000000000461450520414700322420ustar00rootroot00000000000000export const DYNAMIC_2 = 'DYNAMIC_2'; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic3.js000066400000000000000000000000461450520414700322430ustar00rootroot00000000000000export const DYNAMIC_3 = 'DYNAMIC_3'; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/main.js000066400000000000000000000002461450520414700314620ustar00rootroot00000000000000import { DEP } from './dep'; Promise.all([import('./dynamic1.js'), import('./dynamic2.js'), import('./dynamic3.js')]).then( results => console.log(results, DEP) ); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/000077500000000000000000000000001450520414700313275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js000066400000000000000000000003721450520414700332730ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles name conflicts in manual chunks', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { dynamic: ['dynamic1.js'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/000077500000000000000000000000001450520414700332675ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700337515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expectedgenerated-dynamic.js000066400000000000000000000007341450520414700376730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('dynamic2'); const DYNAMIC_A = 'DYNAMIC_A'; const DYNAMIC_B = 'DYNAMIC_B'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_A, DYNAMIC_B: DYNAMIC_B }); console.log('dynamic1'); var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_B, DYNAMIC_B: DYNAMIC_A }); exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; })); main.js000066400000000000000000000006351450520414700352370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic1; }).then(result => console.log(result)); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic2; }).then(result => console.log(result)); })); cjs/000077500000000000000000000000001450520414700337675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expectedgenerated-dynamic.js000066400000000000000000000006341450520414700377100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs'use strict'; console.log('dynamic2'); const DYNAMIC_A = 'DYNAMIC_A'; const DYNAMIC_B = 'DYNAMIC_B'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_A, DYNAMIC_B: DYNAMIC_B }); console.log('dynamic1'); var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_B, DYNAMIC_B: DYNAMIC_A }); exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; main.js000066400000000000000000000005211450520414700352470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic1; }).then(result => console.log(result)); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic2; }).then(result => console.log(result)); es/000077500000000000000000000000001450520414700336175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expectedgenerated-dynamic.js000066400000000000000000000005741450520414700375430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/esconsole.log('dynamic2'); const DYNAMIC_A = 'DYNAMIC_A'; const DYNAMIC_B = 'DYNAMIC_B'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_A, DYNAMIC_B: DYNAMIC_B }); console.log('dynamic1'); var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_B, DYNAMIC_B: DYNAMIC_A }); export { dynamic1 as a, dynamic2 as d }; main.js000066400000000000000000000003221450520414700350760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/esimport('./generated-dynamic.js').then(function (n) { return n.a; }).then(result => console.log(result)); import('./generated-dynamic.js').then(function (n) { return n.d; }).then(result => console.log(result)); system/000077500000000000000000000000001450520414700345345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expectedgenerated-dynamic.js000066400000000000000000000010371450520414700404530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dynamic2'); const DYNAMIC_A = 'DYNAMIC_A'; const DYNAMIC_B = 'DYNAMIC_B'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_A, DYNAMIC_B: DYNAMIC_B }); exports('d', dynamic2); console.log('dynamic1'); var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_B, DYNAMIC_B: DYNAMIC_A }); exports('a', dynamic1); }) }; })); main.js000066400000000000000000000005331450520414700360170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic.js').then(function (n) { return n.a; }).then(result => console.log(result)); module.import('./generated-dynamic.js').then(function (n) { return n.d; }).then(result => console.log(result)); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic1.js000066400000000000000000000001471450520414700333740ustar00rootroot00000000000000console.log('dynamic1'); export { DYNAMIC_A as DYNAMIC_B, DYNAMIC_B as DYNAMIC_A } from './dynamic2'; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic2.js000066400000000000000000000001461450520414700333740ustar00rootroot00000000000000console.log('dynamic2'); export const DYNAMIC_A = 'DYNAMIC_A'; export const DYNAMIC_B = 'DYNAMIC_B'; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/main.js000066400000000000000000000001721450520414700326110ustar00rootroot00000000000000import('./dynamic1.js').then(result => console.log(result)); import('./dynamic2.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/000077500000000000000000000000001450520414700266125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js000066400000000000000000000003601450520414700305530ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports dynamic manual chunks', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { dynamic: ['dynamic.js'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/000077500000000000000000000000001450520414700305525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/000077500000000000000000000000001450520414700313135ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002401450520414700351460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; exports.DYNAMIC_USED_BY_A = DYNAMIC_USED_BY_A; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/main.js000066400000000000000000000003361450520414700325770ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/000077500000000000000000000000001450520414700313315ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001561450520414700351720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs'use strict'; const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; exports.DYNAMIC_USED_BY_A = DYNAMIC_USED_BY_A; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/main.js000066400000000000000000000002401450520414700326070ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/000077500000000000000000000000001450520414700311615ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001161450520414700350160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/esconst DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; export { DYNAMIC_USED_BY_A }; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/main.js000066400000000000000000000001401450520414700324360ustar00rootroot00000000000000import('./generated-dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/000077500000000000000000000000001450520414700320765ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002751450520414700357410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const DYNAMIC_USED_BY_A = exports('DYNAMIC_USED_BY_A', 'DYNAMIC_USED_BY_A'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/main.js000066400000000000000000000003371450520414700333630ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/dynamic.js000066400000000000000000000000651450520414700305750ustar00rootroot00000000000000export const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A';rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-dynamic/main.js000066400000000000000000000001261450520414700300730ustar00rootroot00000000000000import('./dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/000077500000000000000000000000001450520414700270135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_config.js000066400000000000000000000004701450520414700307560ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to define manual chunks via a function', options: { strictDeprecations: false, input: ['main-a'], manualChunks(id) { if (id[id.length - 5] === '-') { return `chunk-${id[id.length - 4]}`; } } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/000077500000000000000000000000001450520414700307535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/000077500000000000000000000000001450520414700315145ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000001311450520414700352510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amddefine((function () { 'use strict'; console.log('dep2'); console.log('dep-b'); })); generated-chunk-c.js000066400000000000000000000001411450520414700352530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amddefine(['./generated-chunk-b'], (function (chunkB) { 'use strict'; console.log('dep-c'); })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js000066400000000000000000000002601450520414700332120ustar00rootroot00000000000000define(['./generated-chunk-c', './generated-chunk-b'], (function (chunkC, chunkB) { 'use strict'; console.log('dep1'); console.log('dep-a'); console.log('main-a'); })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/000077500000000000000000000000001450520414700315325ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000000731450520414700352740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs'use strict'; console.log('dep2'); console.log('dep-b'); generated-chunk-c.js000066400000000000000000000001111450520414700352660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs'use strict'; require('./generated-chunk-b.js'); console.log('dep-c'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js000066400000000000000000000002321450520414700332270ustar00rootroot00000000000000'use strict'; require('./generated-chunk-c.js'); require('./generated-chunk-b.js'); console.log('dep1'); console.log('dep-a'); console.log('main-a'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/000077500000000000000000000000001450520414700313625ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000000541450520414700351230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/esconsole.log('dep2'); console.log('dep-b'); generated-chunk-c.js000066400000000000000000000000701450520414700351220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/esimport './generated-chunk-b.js'; console.log('dep-c'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js000066400000000000000000000002071450520414700330610ustar00rootroot00000000000000import './generated-chunk-c.js'; import './generated-chunk-b.js'; console.log('dep1'); console.log('dep-a'); console.log('main-a'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/000077500000000000000000000000001450520414700322775ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000002301450520414700360340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep2'); console.log('dep-b'); }) }; })); generated-chunk-c.js000066400000000000000000000002521450520414700360410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/systemSystem.register(['./generated-chunk-b.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('dep-c'); }) }; })); main-a.js000066400000000000000000000003761450520414700337260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/systemSystem.register(['./generated-chunk-c.js', './generated-chunk-b.js'], (function () { 'use strict'; return { setters: [null, null], execute: (function () { console.log('dep1'); console.log('dep-a'); console.log('main-a'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/dep-a.js000066400000000000000000000000721450520414700303360ustar00rootroot00000000000000import './dep-c'; import './dep1'; console.log('dep-a'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/dep-b.js000066400000000000000000000000501450520414700303330ustar00rootroot00000000000000import './dep2'; console.log('dep-b'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/dep-c.js000066400000000000000000000000501450520414700303340ustar00rootroot00000000000000import './dep2'; console.log('dep-c'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/dep1.js000066400000000000000000000000251450520414700301770ustar00rootroot00000000000000console.log('dep1'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/dep2.js000066400000000000000000000000251450520414700302000ustar00rootroot00000000000000console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-function/main-a.js000066400000000000000000000000741450520414700305140ustar00rootroot00000000000000import './dep-a'; import './dep-b'; console.log('main-a'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/000077500000000000000000000000001450520414700264505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js000066400000000000000000000004201450520414700304060ustar00rootroot00000000000000module.exports = defineTest({ description: 'manual chunks can contain nested modules', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { manual: ['middle.js', 'inner.js', 'outer.js'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/000077500000000000000000000000001450520414700304105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/000077500000000000000000000000001450520414700311515ustar00rootroot00000000000000generated-manual.js000066400000000000000000000001631450520414700346410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amddefine((function () { 'use strict'; console.log('inner'); console.log('middle'); console.log('outer'); })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/main.js000066400000000000000000000001371450520414700324340ustar00rootroot00000000000000define(['./generated-manual'], (function (manual) { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/000077500000000000000000000000001450520414700311675ustar00rootroot00000000000000generated-manual.js000066400000000000000000000001241450520414700346540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs'use strict'; console.log('inner'); console.log('middle'); console.log('outer'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/main.js000066400000000000000000000001071450520414700324470ustar00rootroot00000000000000'use strict'; require('./generated-manual.js'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/000077500000000000000000000000001450520414700310175ustar00rootroot00000000000000generated-manual.js000066400000000000000000000001051450520414700345030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/esconsole.log('inner'); console.log('middle'); console.log('outer'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/main.js000066400000000000000000000000661450520414700323030ustar00rootroot00000000000000import './generated-manual.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/000077500000000000000000000000001450520414700317345ustar00rootroot00000000000000generated-manual.js000066400000000000000000000002641450520414700354260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('inner'); console.log('middle'); console.log('outer'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/main.js000066400000000000000000000002501450520414700332130ustar00rootroot00000000000000System.register(['./generated-manual.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/inner.js000066400000000000000000000000261450520414700301170ustar00rootroot00000000000000console.log('inner'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/main.js000066400000000000000000000000531450520414700277300ustar00rootroot00000000000000import './outer.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/middle.js000066400000000000000000000000551450520414700302440ustar00rootroot00000000000000import './inner.js'; console.log('middle'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks-nested/outer.js000066400000000000000000000000551450520414700301440ustar00rootroot00000000000000import './middle.js'; console.log('outer'); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/000077500000000000000000000000001450520414700251705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_config.js000066400000000000000000000004071450520414700271330ustar00rootroot00000000000000module.exports = defineTest({ description: 'manual chunks support', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { lib1: ['lib1.js'], deps2and3: ['dep2.js', 'dep3.js'] } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/000077500000000000000000000000001450520414700271305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/000077500000000000000000000000001450520414700276715ustar00rootroot00000000000000generated-deps2and3.js000066400000000000000000000004761450520414700336760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/amddefine(['exports', './generated-lib1'], (function (exports, lib1) { 'use strict'; function fn$2 () { console.log('lib2 fn'); } function fn$1 () { fn$2(); console.log('dep2 fn'); } function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn$1; exports.fn$1 = fn; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-lib1.js000066400000000000000000000002061450520414700330100ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/main.js000066400000000000000000000004251450520414700311540ustar00rootroot00000000000000define(['./generated-deps2and3', './generated-lib1'], (function (deps2and3, lib1) { 'use strict'; function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); deps2and3.fn(); deps2and3.fn$1(); } } return Main; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/000077500000000000000000000000001450520414700277075ustar00rootroot00000000000000generated-deps2and3.js000066400000000000000000000004061450520414700337050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs'use strict'; var lib1 = require('./generated-lib1.js'); function fn$2 () { console.log('lib2 fn'); } function fn$1 () { fn$2(); console.log('dep2 fn'); } function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn$1; exports.fn$1 = fn; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-lib1.js000066400000000000000000000001161450520414700330260ustar00rootroot00000000000000'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/main.js000066400000000000000000000004051450520414700311700ustar00rootroot00000000000000'use strict'; var deps2and3 = require('./generated-deps2and3.js'); require('./generated-lib1.js'); function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); deps2and3.fn(); deps2and3.fn$1(); } } module.exports = Main; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/000077500000000000000000000000001450520414700275375ustar00rootroot00000000000000generated-deps2and3.js000066400000000000000000000003631450520414700335370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/esimport { f as fn$3 } from './generated-lib1.js'; function fn$2 () { console.log('lib2 fn'); } function fn$1 () { fn$2(); console.log('dep2 fn'); } function fn () { fn$3(); console.log('dep3 fn'); } export { fn as a, fn$1 as f }; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-lib1.js000066400000000000000000000001021450520414700326510ustar00rootroot00000000000000function fn () { console.log('lib1 fn'); } export { fn as f }; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/main.js000066400000000000000000000003631450520414700310230ustar00rootroot00000000000000import { f as fn$1, a as fn$2 } from './generated-deps2and3.js'; import './generated-lib1.js'; function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); fn$1(); fn$2(); } } export { Main as default }; rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/000077500000000000000000000000001450520414700304545ustar00rootroot00000000000000generated-deps2and3.js000066400000000000000000000007631450520414700344600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/systemSystem.register(['./generated-lib1.js'], (function (exports) { 'use strict'; var fn$3; return { setters: [function (module) { fn$3 = module.f; }], execute: (function () { exports({ a: fn, f: fn$1 }); function fn$2 () { console.log('lib2 fn'); } function fn$1 () { fn$2(); console.log('dep2 fn'); } function fn () { fn$3(); console.log('dep3 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-lib1.js000066400000000000000000000003141450520414700335730ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', fn); function fn () { console.log('lib1 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/main.js000066400000000000000000000007411450520414700317400ustar00rootroot00000000000000System.register(['./generated-deps2and3.js', './generated-lib1.js'], (function (exports) { 'use strict'; var fn$1, fn$2; return { setters: [function (module) { fn$1 = module.f; fn$2 = module.a; }, null], execute: (function () { function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); fn$1(); fn$2(); } } exports('default', Main); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/dep1.js000066400000000000000000000000631450520414700263560ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/dep2.js000066400000000000000000000001501450520414700263540ustar00rootroot00000000000000import { fn as libfn } from './lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/dep3.js000066400000000000000000000002201450520414700263530ustar00rootroot00000000000000import { fn as libfn, treeshaked } from './lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/lib1.js000066400000000000000000000001751450520414700263600ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/lib2.js000066400000000000000000000000631450520414700263550ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-3.29.4/test/chunking-form/samples/deprecated/manual-chunks/main.js000066400000000000000000000003721450520414700264540ustar00rootroot00000000000000import { fn } from './dep1.js'; import { fn as fn2 } from './dep2.js'; import { fn as fn3, default as treeshaked } from './dep3.js'; if (false) { treeshaked(); } export default class Main { constructor () { fn(); fn2(); fn3(); } }rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/000077500000000000000000000000001450520414700315055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js000066400000000000000000000004421450520414700334470ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles using dependencies with shimmed missing exports as ', expectedWarnings: ['SHIMMED_EXPORT', 'DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, shimMissingExports: true } }); rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/000077500000000000000000000000001450520414700334455ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700341275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expecteddep1.js000066400000000000000000000005431450520414700353200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var _missingExportShim = void 0; console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); exports.missing1 = _missingExportShim; })); dep2.js000066400000000000000000000005241450520414700353200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var _missingExportShim = void 0; console.log('This is the output when a missing export is reexported'); var _missingExportShim$1 = void 0; console.log(_missingExportShim$1); exports.missing2 = _missingExportShim; exports.previousShimmedExport = _missingExportShim$1; })); main.js000066400000000000000000000002231450520414700354060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/amddefine(['./dep1', './dep2'], (function (dep1, dep2) { 'use strict'; console.log(dep1.missing1, dep2.missing2, dep2.previousShimmedExport); })); cjs/000077500000000000000000000000001450520414700341455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expecteddep1.js000066400000000000000000000004521450520414700353350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs'use strict'; var _missingExportShim = void 0; console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); exports.missing1 = _missingExportShim; dep2.js000066400000000000000000000004361450520414700353400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs'use strict'; var _missingExportShim = void 0; console.log('This is the output when a missing export is reexported'); var _missingExportShim$1 = void 0; console.log(_missingExportShim$1); exports.missing2 = _missingExportShim; exports.previousShimmedExport = _missingExportShim$1; main.js000066400000000000000000000002311450520414700354230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs'use strict'; var dep1 = require('./dep1.js'); var dep2 = require('./dep2.js'); console.log(dep1.missing1, dep2.missing2, dep2.previousShimmedExport); es/000077500000000000000000000000001450520414700337755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expecteddep1.js000066400000000000000000000004371450520414700351700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/esvar _missingExportShim = void 0; console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); export { _missingExportShim as missing1 }; dep2.js000066400000000000000000000004141450520414700351640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/esvar _missingExportShim = void 0; console.log('This is the output when a missing export is reexported'); var _missingExportShim$1 = void 0; console.log(_missingExportShim$1); export { _missingExportShim as missing2, _missingExportShim$1 as previousShimmedExport }; main.js000066400000000000000000000003671450520414700352650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/esimport { missing1 as _missingExportShim } from './dep1.js'; import { missing2 as _missingExportShim$1, previousShimmedExport as _missingExportShim$2 } from './dep2.js'; console.log(_missingExportShim, _missingExportShim$1, _missingExportShim$2); system/000077500000000000000000000000001450520414700347125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expecteddep1.js000066400000000000000000000006451450520414700361060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var _missingExportShim = void 0; console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); exports('missing1', _missingExportShim); }) }; })); dep2.js000066400000000000000000000005711450520414700361050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var _missingExportShim = void 0; console.log('This is the output when a missing export is reexported'); var _missingExportShim$1 = exports('previousShimmedExport', void 0); console.log(_missingExportShim$1); exports('missing2', _missingExportShim); }) }; })); main.js000066400000000000000000000007361450520414700362020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/systemSystem.register(['./dep1.js', './dep2.js'], (function () { 'use strict'; var _missingExportShim, _missingExportShim$1, _missingExportShim$2; return { setters: [function (module) { _missingExportShim = module.missing1; }, function (module) { _missingExportShim$1 = module.missing2; _missingExportShim$2 = module.previousShimmedExport; }], execute: (function () { console.log(_missingExportShim, _missingExportShim$1, _missingExportShim$2); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep1.js000066400000000000000000000003211450520414700326700ustar00rootroot00000000000000console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep2.js000066400000000000000000000003011450520414700326670ustar00rootroot00000000000000console.log('This is the output when a missing export is reexported'); var _missingExportShim = void 0; console.log(_missingExportShim); export {_missingExportShim as previousShimmedExport} rollup-3.29.4/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/main.js000066400000000000000000000002341450520414700327660ustar00rootroot00000000000000import { missing1 } from './dep1.js'; import { missing2, previousShimmedExport } from './dep2.js'; console.log(missing1, missing2, previousShimmedExport); rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/000077500000000000000000000000001450520414700262255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/000077500000000000000000000000001450520414700335255ustar00rootroot00000000000000_config.js000066400000000000000000000004611450520414700354110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-modemodule.exports = defineTest({ description: 'adds Symbol.toStringTag property to dynamic imports of entry chunks with default export mode', options: { strictDeprecations: false, input: ['main', 'foo'], output: { namespaceToStringTag: true } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); _expected/000077500000000000000000000000001450520414700354065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-modeamd/000077500000000000000000000000001450520414700361475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000001101450520414700372600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amddefine((function () { 'use strict'; var foo = 42; return foo; })); main.js000066400000000000000000000006131450520414700374310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/amddefine(['require'], (function (require) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } new Promise(function (resolve, reject) { require(['./foo'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(console.log); })); cjs/000077500000000000000000000000001450520414700361655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000000641450520414700373060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs'use strict'; var foo = 42; module.exports = foo; main.js000066400000000000000000000004671450520414700374560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/cjs'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./foo.js')); }).then(console.log); es/000077500000000000000000000000001450520414700360155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000000521450520414700371330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/esvar foo = 42; export { foo as default }; main.js000066400000000000000000000000461450520414700372770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/esimport('./foo.js').then(console.log); system/000077500000000000000000000000001450520414700367325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000002221450520414700400470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('default', 42); }) }; })); main.js000066400000000000000000000002451450520414700402150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./foo.js').then(console.log); }) }; })); foo.js000066400000000000000000000000231450520414700345620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-modeexport default 42; main.js000066400000000000000000000000431450520414700347250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-modeimport('./foo').then(console.log); rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/000077500000000000000000000000001450520414700311615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_config.js000066400000000000000000000003541450520414700331250ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to dynamic imports', options: { strictDeprecations: false, output: { namespaceToStringTag: true } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/000077500000000000000000000000001450520414700331215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amd/000077500000000000000000000000001450520414700336625ustar00rootroot00000000000000generated-foo.js000066400000000000000000000002601450520414700366560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const bar = 42; exports.bar = bar; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); })); main.js000066400000000000000000000002561450520414700350700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-foo'], resolve, reject); }).then(console.log); })); rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs/000077500000000000000000000000001450520414700337005ustar00rootroot00000000000000generated-foo.js000066400000000000000000000001751450520414700367010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const bar = 42; exports.bar = bar; main.js000066400000000000000000000001601450520414700351000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-foo.js'); }).then(console.log); rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/es/000077500000000000000000000000001450520414700335305ustar00rootroot00000000000000generated-foo.js000066400000000000000000000000411450520414700365210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/esconst bar = 42; export { bar }; main.js000066400000000000000000000000601450520414700347270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/esimport('./generated-foo.js').then(console.log); system/000077500000000000000000000000001450520414700343665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expectedgenerated-foo.js000066400000000000000000000002201450520414700374350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const bar = exports('bar', 42); }) }; })); main.js000066400000000000000000000002571450520414700356540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-foo.js').then(console.log); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/foo.js000066400000000000000000000000271450520414700323010ustar00rootroot00000000000000export const bar = 42; rollup-3.29.4/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/main.js000066400000000000000000000000431450520414700324400ustar00rootroot00000000000000import('./foo').then(console.log); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/000077500000000000000000000000001450520414700311325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js000066400000000000000000000003671450520414700331020ustar00rootroot00000000000000module.exports = defineTest({ description: 'Uses entry point semantics for all files when preserving modules', options: { strictDeprecations: false, input: 'main.js', preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/000077500000000000000000000000001450520414700330725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/000077500000000000000000000000001450520414700336335ustar00rootroot00000000000000default.js000066400000000000000000000001171450520414700355350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amddefine((function () { 'use strict'; var foo = 'default'; return foo; })); main.js000066400000000000000000000011121450520414700350310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amddefine(['require', './default', './named'], (function (require, _default, named) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } console.log(_default, named.value); new Promise(function (resolve, reject) { require(['./default'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(result => console.log(result.default)); new Promise(function (resolve, reject) { require(['./named'], resolve, reject); }).then(result => console.log(result.value)); return _default; })); named.js000066400000000000000000000001601450520414700351730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'named'; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/000077500000000000000000000000001450520414700336515ustar00rootroot00000000000000default.js000066400000000000000000000000731450520414700355540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs'use strict'; var foo = 'default'; module.exports = foo; main.js000066400000000000000000000010231450520414700350500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs'use strict'; var _default = require('./default.js'); var named = require('./named.js'); function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } console.log(_default, named.value); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./default.js')); }).then(result => console.log(result.default)); Promise.resolve().then(function () { return require('./named.js'); }).then(result => console.log(result.value)); module.exports = _default; named.js000066400000000000000000000000761450520414700352170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs'use strict'; const value = 'named'; exports.value = value; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/000077500000000000000000000000001450520414700335015ustar00rootroot00000000000000default.js000066400000000000000000000000611450520414700354010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/esvar foo = 'default'; export { foo as default }; main.js000066400000000000000000000003771450520414700347130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/esimport foo from './default.js'; import { value } from './named.js'; console.log(foo, value); import('./default.js').then(result => console.log(result.default)); import('./named.js').then(result => console.log(result.value)); export { foo as default }; named.js000066400000000000000000000000521450520414700350410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/esconst value = 'named'; export { value }; system/000077500000000000000000000000001450520414700343375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expecteddefault.js000066400000000000000000000002311450520414700363150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('default', 'default'); }) }; })); main.js000066400000000000000000000007571450520414700356320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/systemSystem.register(['./default.js', './named.js'], (function (exports, module) { 'use strict'; var foo, value; return { setters: [function (module) { foo = module.default; exports('default', module.default); }, function (module) { value = module.value; }], execute: (function () { console.log(foo, value); module.import('./default.js').then(result => console.log(result.default)); module.import('./named.js').then(result => console.log(result.value)); }) }; })); named.js000066400000000000000000000002311450520414700357550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 'named'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/default.js000066400000000000000000000000321450520414700331070ustar00rootroot00000000000000export default 'default'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/main.js000066400000000000000000000004051450520414700324130ustar00rootroot00000000000000import foo from './default.js'; import { value } from './named.js'; console.log(foo, value); export { default } from './default.js'; import('./default').then(result => console.log(result.default)); import('./named').then(result => console.log(result.value)); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/named.js000066400000000000000000000000361450520414700325530ustar00rootroot00000000000000export const value = 'named'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/000077500000000000000000000000001450520414700275465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js000066400000000000000000000005341450520414700315120ustar00rootroot00000000000000const commonjs = require('@rollup/plugin-commonjs'); module.exports = defineTest({ description: 'Handles output from @rollup/plugin-commonjs', expectedWarnings: ['MIXED_EXPORTS', 'DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: 'main.js', preserveModules: true, external: ['external'], plugins: [commonjs()] } }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/000077500000000000000000000000001450520414700315065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/000077500000000000000000000000001450520414700322475ustar00rootroot00000000000000_virtual/000077500000000000000000000000001450520414700340155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd_commonjsHelpers.js000066400000000000000000000004141450520414700376610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } exports.getDefaultExportFromCjs = getDefaultExportFromCjs; })); other.js000066400000000000000000000001551450520414700354750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; var other = {}; exports.__exports = other; })); commonjs.js000066400000000000000000000005751450520414700343620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amddefine(['./_virtual/_commonjsHelpers', 'external', './other', './_virtual/other'], (function (_commonjsHelpers, require$$0, other$1, other) { 'use strict'; const external = require$$0; const { value } = other.__exports; console.log(external, value); var commonjs = 42; var value$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(commonjs); return value$1; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js000066400000000000000000000001771450520414700335360ustar00rootroot00000000000000define(['./commonjs', 'external'], (function (commonjs, require$$0) { 'use strict'; console.log(commonjs, require$$0); })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js000066400000000000000000000001751450520414700337310ustar00rootroot00000000000000define(['./_virtual/other'], (function (other) { 'use strict'; other.__exports.value = 43; return other.__exports; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/000077500000000000000000000000001450520414700322655ustar00rootroot00000000000000_virtual/000077500000000000000000000000001450520414700340335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs_commonjsHelpers.js000066400000000000000000000003301450520414700376740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual'use strict'; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } exports.getDefaultExportFromCjs = getDefaultExportFromCjs; other.js000066400000000000000000000000731450520414700355120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual'use strict'; var other = {}; exports.__exports = other; commonjs.js000066400000000000000000000006311450520414700343710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs'use strict'; var _commonjsHelpers = require('./_virtual/_commonjsHelpers.js'); var require$$0 = require('external'); require('./other.js'); var other = require('./_virtual/other.js'); const external = require$$0; const { value } = other.__exports; console.log(external, value); var commonjs = 42; var value$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(commonjs); module.exports = value$1; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js000066400000000000000000000002021450520414700335410ustar00rootroot00000000000000'use strict'; var commonjs = require('./commonjs.js'); var require$$0 = require('external'); console.log(commonjs, require$$0); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js000066400000000000000000000001731450520414700337450ustar00rootroot00000000000000'use strict'; var other = require('./_virtual/other.js'); other.__exports.value = 43; module.exports = other.__exports; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/000077500000000000000000000000001450520414700321155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/000077500000000000000000000000001450520414700337425ustar00rootroot00000000000000_commonjsHelpers.js000066400000000000000000000002621450520414700375300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtualfunction getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } export { getDefaultExportFromCjs }; other.js000066400000000000000000000000601450520414700353360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtualvar other = {}; export { other as __exports }; commonjs.js000066400000000000000000000006051450520414700342220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/esimport { getDefaultExportFromCjs } from './_virtual/_commonjsHelpers.js'; import require$$0 from 'external'; import './other.js'; import { __exports as other } from './_virtual/other.js'; const external = require$$0; const { value } = other; console.log(external, value); var commonjs = 42; var value$1 = /*@__PURE__*/getDefaultExportFromCjs(commonjs); export { value$1 as default }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js000066400000000000000000000001471450520414700334010ustar00rootroot00000000000000import value from './commonjs.js'; import require$$0 from 'external'; console.log(value, require$$0); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js000066400000000000000000000001531450520414700335730ustar00rootroot00000000000000import { __exports as other } from './_virtual/other.js'; other.value = 43; export { other as default }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/000077500000000000000000000000001450520414700330325ustar00rootroot00000000000000_virtual/000077500000000000000000000000001450520414700346005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system_commonjsHelpers.js000066400000000000000000000005041450520414700404440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('getDefaultExportFromCjs', getDefaultExportFromCjs); function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } }) }; })); other.js000066400000000000000000000002261450520414700362570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var other = exports('__exports', {}); }) }; })); commonjs.js000066400000000000000000000012221450520414700351330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/systemSystem.register(['./_virtual/_commonjsHelpers.js', 'external', './other.js', './_virtual/other.js'], (function (exports) { 'use strict'; var getDefaultExportFromCjs, require$$0, other; return { setters: [function (module) { getDefaultExportFromCjs = module.getDefaultExportFromCjs; }, function (module) { require$$0 = module.default; }, null, function (module) { other = module.__exports; }], execute: (function () { const external = require$$0; const { value } = other; console.log(external, value); var commonjs = 42; var value$1 = exports('default', /*@__PURE__*/getDefaultExportFromCjs(commonjs)); }) }; })); main.js000066400000000000000000000004661450520414700342430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/systemSystem.register(['./commonjs.js', 'external'], (function () { 'use strict'; var value, require$$0; return { setters: [function (module) { value = module.default; }, function (module) { require$$0 = module.default; }], execute: (function () { console.log(value, require$$0); }) }; })); other.js000066400000000000000000000004171450520414700344340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/systemSystem.register(['./_virtual/other.js'], (function (exports) { 'use strict'; var other; return { setters: [function (module) { other = module.__exports; exports('default', module.__exports); }], execute: (function () { other.value = 43; }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/commonjs.js000066400000000000000000000002011450520414700317220ustar00rootroot00000000000000const external = require('external'); const { value } = require('./other'); console.log(external, value); module.exports = 42; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/main.js000066400000000000000000000001411450520414700310240ustar00rootroot00000000000000import value from './commonjs'; import external from 'external'; console.log(value, external); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-commonjs/other.js000066400000000000000000000000241450520414700312210ustar00rootroot00000000000000exports.value = 43; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/000077500000000000000000000000001450520414700310405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js000066400000000000000000000003661450520414700330070ustar00rootroot00000000000000module.exports = defineTest({ description: 'dynamic imports are handled correctly when preserving modules', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/000077500000000000000000000000001450520414700330005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/000077500000000000000000000000001450520414700335415ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000001631450520414700372310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'included'; exports.value = value; })); main.js000066400000000000000000000003031450520414700347400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./dynamic-included'], resolve, reject); }).then(result => console.log(result)); })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/000077500000000000000000000000001450520414700335575ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000001011450520414700372370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs'use strict'; const value = 'included'; exports.value = value; main.js000066400000000000000000000002051450520414700347570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./dynamic-included.js'); }).then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/000077500000000000000000000000001450520414700334075ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000000551450520414700370770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/esconst value = 'included'; export { value }; main.js000066400000000000000000000001051450520414700346060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/esimport('./dynamic-included.js').then(result => console.log(result)); system/000077500000000000000000000000001450520414700342455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expecteddynamic-included.js000066400000000000000000000002341450520414700400130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 'included'); }) }; })); main.js000066400000000000000000000003041450520414700355240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./dynamic-included.js').then(result => console.log(result)); }) }; })); dynamic-included.js000066400000000000000000000000411450520414700345230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-importsexport const value = 'included'; dynamic-removed.js000066400000000000000000000000401450520414700343740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-importsexport const value = 'removed'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/main.js000066400000000000000000000002551450520414700323240ustar00rootroot00000000000000import('./dynamic-included').then(result => console.log(result)); const include = false; if (include) { import('./dynamic-removed').then(result => console.log(result)); } rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/000077500000000000000000000000001450520414700312775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js000066400000000000000000000003751450520414700332460ustar00rootroot00000000000000module.exports = defineTest({ description: 'Preserve modules properly handles internal namespace imports (#2576)', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/000077500000000000000000000000001450520414700332375ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700337215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expectedm1.js000066400000000000000000000001751450520414700345770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amddefine(['exports', './m2', './m3'], (function (exports, m2, m3) { 'use strict'; exports.m2 = m2; exports.m3 = m3; })); m2.js000066400000000000000000000001111450520414700345660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amddefine((function () { 'use strict'; var m2 = {a:1}; return m2; })); m3.js000066400000000000000000000001111450520414700345670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amddefine((function () { 'use strict'; var m3 = {b:2}; return m3; })); main.js000066400000000000000000000001111450520414700351740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amddefine(['./m1'], (function (m1) { 'use strict'; console.log(m1); })); cjs/000077500000000000000000000000001450520414700337375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expectedm1.js000066400000000000000000000001561450520414700346140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs'use strict'; var m2 = require('./m2.js'); var m3 = require('./m3.js'); exports.m2 = m2; exports.m3 = m3; m2.js000066400000000000000000000000651450520414700346140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs'use strict'; var m2 = {a:1}; module.exports = m2; m3.js000066400000000000000000000000651450520414700346150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs'use strict'; var m3 = {b:2}; module.exports = m3; main.js000066400000000000000000000000761450520414700352240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs'use strict'; var m1 = require('./m1.js'); console.log(m1); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/000077500000000000000000000000001450520414700336465ustar00rootroot00000000000000m1.js000066400000000000000000000001221450520414700344350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/esexport { default as m2 } from './m2.js'; export { default as m3 } from './m3.js'; m2.js000066400000000000000000000000531450520414700344410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/esvar m2 = {a:1}; export { m2 as default }; m3.js000066400000000000000000000000531450520414700344420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/esvar m3 = {b:2}; export { m3 as default }; main.js000066400000000000000000000000611450520414700350460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/esimport * as m1 from './m1.js'; console.log(m1); system/000077500000000000000000000000001450520414700345045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expectedm1.js000066400000000000000000000004051450520414700353560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/systemSystem.register(['./m2.js', './m3.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('m2', module.default); }, function (module) { exports('m3', module.default); }], execute: (function () { }) }; })); m2.js000066400000000000000000000002241450520414700353560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var m2 = exports('default', {a:1}); }) }; })); m3.js000066400000000000000000000002241450520414700353570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var m3 = exports('default', {b:2}); }) }; })); main.js000066400000000000000000000003021450520414700357610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/systemSystem.register(['./m1.js'], (function () { 'use strict'; var m1; return { setters: [function (module) { m1 = module; }], execute: (function () { console.log(m1); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m1.js000066400000000000000000000001361450520414700321520ustar00rootroot00000000000000import m2 from './m2.js'; import m3 from './m3.js'; // console.log('m1'); export { m2, m3 }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m2.js000066400000000000000000000000431450520414700321500ustar00rootroot00000000000000var m2 = {a:1}; export default m2; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m3.js000066400000000000000000000000431450520414700321510ustar00rootroot00000000000000var m3 = {b:2}; export default m3; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/main.js000066400000000000000000000000611450520414700325560ustar00rootroot00000000000000import * as ms from './m1.js'; console.log(ms); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/000077500000000000000000000000001450520414700270575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js000066400000000000000000000003411450520414700310170ustar00rootroot00000000000000module.exports = defineTest({ description: 'Preserve modules remove empty dependencies', options: { strictDeprecations: false, input: 'main.js', preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/000077500000000000000000000000001450520414700310175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/000077500000000000000000000000001450520414700315605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/main.js000066400000000000000000000001231450520414700330360ustar00rootroot00000000000000define(['./two'], (function (two) { 'use strict'; window.APP = { a: two }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/two.js000066400000000000000000000001041450520414700327220ustar00rootroot00000000000000define((function () { 'use strict'; var a = {}; return a; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/000077500000000000000000000000001450520414700315765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/main.js000066400000000000000000000001101450520414700330500ustar00rootroot00000000000000'use strict'; var two = require('./two.js'); window.APP = { a: two }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/two.js000066400000000000000000000000601450520414700327410ustar00rootroot00000000000000'use strict'; var a = {}; module.exports = a; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/000077500000000000000000000000001450520414700314265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/main.js000066400000000000000000000000571450520414700327120ustar00rootroot00000000000000import a from './two.js'; window.APP = { a }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/two.js000066400000000000000000000000461450520414700325750ustar00rootroot00000000000000var a = {}; export { a as default }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/000077500000000000000000000000001450520414700323435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/main.js000066400000000000000000000003141450520414700336230ustar00rootroot00000000000000System.register(['./two.js'], (function () { 'use strict'; var a; return { setters: [function (module) { a = module.default; }], execute: (function () { window.APP = { a }; }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/two.js000066400000000000000000000002201450520414700335040ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var a = exports('default', {}); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/main.js000066400000000000000000000000571450520414700303430ustar00rootroot00000000000000import { a } from './one'; window.APP = { a };rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/one.js000066400000000000000000000001151450520414700301730ustar00rootroot00000000000000export { default as a } from './two'; export { default as b } from './three';rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/three.js000066400000000000000000000000221450520414700305160ustar00rootroot00000000000000export default {};rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-empty/two.js000066400000000000000000000000221450520414700302200ustar00rootroot00000000000000export default {};rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/000077500000000000000000000000001450520414700303315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js000066400000000000000000000003651450520414700322770ustar00rootroot00000000000000module.exports = defineTest({ description: 'confirm export aliases are preserved in modules', options: { strictDeprecations: false, input: ['main1.js', 'main2.js'], preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/000077500000000000000000000000001450520414700322715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/000077500000000000000000000000001450520414700330325ustar00rootroot00000000000000dep.js000066400000000000000000000001701450520414700340570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 1; exports.bar = foo; exports.foo = foo; })); main1.js000066400000000000000000000001771450520414700343230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amddefine(['exports', './dep'], (function (exports, dep) { 'use strict'; exports.bar = dep.foo; exports.foo = dep.foo; })); main2.js000066400000000000000000000001471450520414700343210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amddefine(['exports', './dep'], (function (exports, dep) { 'use strict'; exports.bar = dep.foo; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/000077500000000000000000000000001450520414700330505ustar00rootroot00000000000000dep.js000066400000000000000000000001051450520414700340730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs'use strict'; const foo = 1; exports.bar = foo; exports.foo = foo; main1.js000066400000000000000000000001371450520414700343350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs'use strict'; var dep = require('./dep.js'); exports.bar = dep.foo; exports.foo = dep.foo; main2.js000066400000000000000000000001101450520414700343250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs'use strict'; var dep = require('./dep.js'); exports.bar = dep.foo; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/000077500000000000000000000000001450520414700327005ustar00rootroot00000000000000dep.js000066400000000000000000000000541450520414700337260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/esconst foo = 1; export { foo as bar, foo }; main1.js000066400000000000000000000000541450520414700341630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/esexport { foo as bar, foo } from './dep.js'; main2.js000066400000000000000000000000471450520414700341660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/esexport { foo as bar } from './dep.js'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/000077500000000000000000000000001450520414700336155ustar00rootroot00000000000000dep.js000066400000000000000000000002401450520414700346400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; exports({ foo: foo, bar: foo }); }) }; })); main1.js000066400000000000000000000003201450520414700350740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/systemSystem.register(['./dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ bar: module.foo, foo: module.foo }); }], execute: (function () { }) }; })); main2.js000066400000000000000000000002751450520414700351060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/systemSystem.register(['./dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('bar', module.foo); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/dep.js000066400000000000000000000000531450520414700314350ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar };rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main1.js000066400000000000000000000000411450520414700316670ustar00rootroot00000000000000export { foo, bar } from './dep';rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main2.js000066400000000000000000000000341450520414700316720ustar00rootroot00000000000000export { bar } from './dep';rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/000077500000000000000000000000001450520414700311545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js000066400000000000000000000004771450520414700331260ustar00rootroot00000000000000module.exports = defineTest({ description: 'entryFileNames pattern supported in combination with preserveModules', options: { strictDeprecations: false, input: 'src/main.ts', output: { entryFileNames: '[name]-[format]-[hash].js' }, preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/000077500000000000000000000000001450520414700331145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/000077500000000000000000000000001450520414700336555ustar00rootroot00000000000000foo-amd-0f9dc16c.js000066400000000000000000000001101450520414700366630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var foo = 42; return foo; })); main-amd-f0570656.js000066400000000000000000000004241450520414700366170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amddefine(['exports', './foo-amd-0f9dc16c', './nested/bar-amd-f038b10c', './nested/baz-amd-d3de4cc0', './no-ext-amd-9d2c6ef6'], (function (exports, foo, bar, baz, noExt) { 'use strict'; exports.foo = foo; exports.bar = bar; exports.baz = baz; exports.noExt = noExt; })); nested/000077500000000000000000000000001450520414700350605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amdbar-amd-f038b10c.js000066400000000000000000000001161450520414700400430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nesteddefine((function () { 'use strict'; var bar = 'banana'; return bar; })); baz-amd-d3de4cc0.js000066400000000000000000000001201450520414700402110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nesteddefine((function () { 'use strict'; var baz = 'whatever'; return baz; })); no-ext-amd-9d2c6ef6.js000066400000000000000000000001221450520414700373260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var noExt = 'no-ext'; return noExt; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/000077500000000000000000000000001450520414700336735ustar00rootroot00000000000000foo-cjs-0d5774b5.js000066400000000000000000000000641450520414700365710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs'use strict'; var foo = 42; module.exports = foo; main-cjs-e39bf23f.js000066400000000000000000000004451450520414700370770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs'use strict'; var foo = require('./foo-cjs-0d5774b5.js'); var bar = require('./nested/bar-cjs-abedc91d.js'); var baz = require('./nested/baz-cjs-4a9c02fc.js'); var noExt = require('./no-ext-cjs-500f8f81.js'); exports.foo = foo; exports.bar = bar; exports.baz = baz; exports.noExt = noExt; nested/000077500000000000000000000000001450520414700350765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjsbar-cjs-abedc91d.js000066400000000000000000000000721450520414700403260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested'use strict'; var bar = 'banana'; module.exports = bar; baz-cjs-4a9c02fc.js000066400000000000000000000000741450520414700401770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested'use strict'; var baz = 'whatever'; module.exports = baz; no-ext-cjs-500f8f81.js000066400000000000000000000000761450520414700372230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs'use strict'; var noExt = 'no-ext'; module.exports = noExt; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/000077500000000000000000000000001450520414700335235ustar00rootroot00000000000000foo-es-3585f3eb.js000066400000000000000000000000521450520414700363310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/esvar foo = 42; export { foo as default }; main-es-d43a43b5.js000066400000000000000000000003571450520414700364670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/esexport { default as foo } from './foo-es-3585f3eb.js'; export { default as bar } from './nested/bar-es-bd5e2ae1.js'; export { default as baz } from './nested/baz-es-a913ab4d.js'; export { default as noExt } from './no-ext-es-1f34b6e8.js'; nested/000077500000000000000000000000001450520414700347265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/esbar-es-bd5e2ae1.js000066400000000000000000000000601450520414700377170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nestedvar bar = 'banana'; export { bar as default }; baz-es-a913ab4d.js000066400000000000000000000000621450520414700376510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nestedvar baz = 'whatever'; export { baz as default }; no-ext-es-1f34b6e8.js000066400000000000000000000000641450520414700367610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/esvar noExt = 'no-ext'; export { noExt as default }; system/000077500000000000000000000000001450520414700343615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expectedfoo-system-0e2d8e48.js000066400000000000000000000002221450520414700401610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('default', 42); }) }; })); main-system-5684b811.js000066400000000000000000000007541450520414700401730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/systemSystem.register(['./foo-system-0e2d8e48.js', './nested/bar-system-a72f6c95.js', './nested/baz-system-71d114fd.js', './no-ext-system-0cf938a8.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.default); }, function (module) { exports('bar', module.default); }, function (module) { exports('baz', module.default); }, function (module) { exports('noExt', module.default); }], execute: (function () { }) }; })); nested/000077500000000000000000000000001450520414700356435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/systembar-system-a72f6c95.js000066400000000000000000000002301450520414700414260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nestedSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var bar = exports('default', 'banana'); }) }; })); baz-system-71d114fd.js000066400000000000000000000002321450520414700414250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/system/nestedSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var baz = exports('default', 'whatever'); }) }; })); no-ext-system-0cf938a8.js000066400000000000000000000002321450520414700406130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var noExt = exports('default', 'no-ext'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/000077500000000000000000000000001450520414700317435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/foo.ts000066400000000000000000000000231450520414700330710ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/main.ts000066400000000000000000000003641450520414700332420ustar00rootroot00000000000000// @ts-ignore export { default as foo } from './foo.ts'; // @ts-ignore export { default as bar } from './nested/bar.ts'; // @ts-ignore export { default as baz } from './nested/baz.ts'; // @ts-ignore export { default as noExt } from './no-ext'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/000077500000000000000000000000001450520414700332255ustar00rootroot00000000000000bar.ts000066400000000000000000000000311450520414700342540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nestedexport default 'banana'; baz.ts000066400000000000000000000000331450520414700342660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nestedexport default 'whatever'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/no-ext000066400000000000000000000000301450520414700330710ustar00rootroot00000000000000export default 'no-ext' rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/000077500000000000000000000000001450520414700312355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js000066400000000000000000000007271450520414700332050ustar00rootroot00000000000000module.exports = defineTest({ description: 'Preserve modules id case sensitive', options: { strictDeprecations: false, input: 'main.js', preserveModules: true, plugins: [ { resolveId(id) { if (id.toLowerCase().includes('one')) { return id; } }, load(id) { if (id.toLowerCase().includes('one')) { return `export default '${id.replace('\0', '')}'`; } } } ] }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/000077500000000000000000000000001450520414700331755ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700336575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected_virtual/000077500000000000000000000000001450520414700355045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd_One1.js000066400000000000000000000001131450520414700367760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var c = 'One1.js'; return c; })); _One2.js000066400000000000000000000001121450520414700367760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var b = 'One.js'; return b; })); _one.js000066400000000000000000000001121450520414700367540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var a = 'one.js'; return a; })); main.js000066400000000000000000000002471450520414700351440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amddefine(['./_virtual/_one', './_virtual/_One2', './_virtual/_One1'], (function (_one, _One, _One1) { 'use strict'; window.APP = { a: _one, b: _One, c: _One1 }; })); cjs/000077500000000000000000000000001450520414700336755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected_virtual/000077500000000000000000000000001450520414700355225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs_One1.js000066400000000000000000000000671450520414700370240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var c = 'One1.js'; module.exports = c; _One2.js000066400000000000000000000000661450520414700370240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var b = 'One.js'; module.exports = b; _one.js000066400000000000000000000000661450520414700370020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var a = 'one.js'; module.exports = a; main.js000066400000000000000000000002761450520414700351640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs'use strict'; var _one = require('./_virtual/_one.js'); var _One = require('./_virtual/_One2.js'); var _One1 = require('./_virtual/_One1.js'); window.APP = { a: _one, b: _One, c: _One1 }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/000077500000000000000000000000001450520414700336045ustar00rootroot00000000000000_virtual/000077500000000000000000000000001450520414700353525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es_One1.js000066400000000000000000000000551450520414700366510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtualvar c = 'One1.js'; export { c as default }; _One2.js000066400000000000000000000000541450520414700366510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtualvar b = 'One.js'; export { b as default }; _one.js000066400000000000000000000000541450520414700366270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtualvar a = 'one.js'; export { a as default }; main.js000066400000000000000000000002111450520414700350010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/esimport a from './_virtual/_one.js'; import b from './_virtual/_One2.js'; import c from './_virtual/_One1.js'; window.APP = { a, b, c }; system/000077500000000000000000000000001450520414700344425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected_virtual/000077500000000000000000000000001450520414700362675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system_One1.js000066400000000000000000000002271450520414700375670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var c = exports('default', 'One1.js'); }) }; })); _One2.js000066400000000000000000000002261450520414700375670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var b = exports('default', 'One.js'); }) }; })); _one.js000066400000000000000000000002261450520414700375450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var a = exports('default', 'one.js'); }) }; })); main.js000066400000000000000000000005601450520414700357250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/systemSystem.register(['./_virtual/_one.js', './_virtual/_One2.js', './_virtual/_One1.js'], (function () { 'use strict'; var a, b, c; return { setters: [function (module) { a = module.default; }, function (module) { b = module.default; }, function (module) { c = module.default; }], execute: (function () { window.APP = { a, b, c }; }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/main.js000066400000000000000000000001521450520414700325150ustar00rootroot00000000000000import a from '\0one.js'; import b from '\0One.js'; import c from '\0One1.js'; window.APP = { a, b, c }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/000077500000000000000000000000001450520414700312465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js000066400000000000000000000004361450520414700332130ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects "named" export mode in all chunks when preserving modules', options: { strictDeprecations: false, input: 'main.js', preserveModules: true, output: { exports: 'named' } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/000077500000000000000000000000001450520414700332065ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700336705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expecteddefault.js000066400000000000000000000002571450520414700356560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var foo = 'default'; exports.default = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); main.js000066400000000000000000000010231450520414700351460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amddefine(['require', 'exports', './default', './named'], (function (require, exports, _default, named) { 'use strict'; console.log(_default.default, named.value); new Promise(function (resolve, reject) { require(['./default'], resolve, reject); }).then(result => console.log(result.default)); new Promise(function (resolve, reject) { require(['./named'], resolve, reject); }).then(result => console.log(result.value)); exports.default = _default.default; Object.defineProperty(exports, '__esModule', { value: true }); })); named.js000066400000000000000000000001601450520414700353070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'named'; exports.value = value; })); cjs/000077500000000000000000000000001450520414700337065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expecteddefault.js000066400000000000000000000001741450520414700356720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var foo = 'default'; exports.default = foo; main.js000066400000000000000000000007231450520414700351720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _default = require('./default.js'); var named = require('./named.js'); console.log(_default.default, named.value); Promise.resolve().then(function () { return require('./default.js'); }).then(result => console.log(result.default)); Promise.resolve().then(function () { return require('./named.js'); }).then(result => console.log(result.value)); exports.default = _default.default; named.js000066400000000000000000000000761450520414700353330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs'use strict'; const value = 'named'; exports.value = value; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/000077500000000000000000000000001450520414700336155ustar00rootroot00000000000000default.js000066400000000000000000000000611450520414700355150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/esvar foo = 'default'; export { foo as default }; main.js000066400000000000000000000003771450520414700350270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/esimport foo from './default.js'; import { value } from './named.js'; console.log(foo, value); import('./default.js').then(result => console.log(result.default)); import('./named.js').then(result => console.log(result.value)); export { foo as default }; named.js000066400000000000000000000000521450520414700351550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/esconst value = 'named'; export { value }; system/000077500000000000000000000000001450520414700344535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expecteddefault.js000066400000000000000000000002311450520414700364310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('default', 'default'); }) }; })); main.js000066400000000000000000000007571450520414700357460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/systemSystem.register(['./default.js', './named.js'], (function (exports, module) { 'use strict'; var foo, value; return { setters: [function (module) { foo = module.default; exports('default', module.default); }, function (module) { value = module.value; }], execute: (function () { console.log(foo, value); module.import('./default.js').then(result => console.log(result.default)); module.import('./named.js').then(result => console.log(result.value)); }) }; })); named.js000066400000000000000000000002311450520414700360710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 'named'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/default.js000066400000000000000000000000321450520414700332230ustar00rootroot00000000000000export default 'default'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/main.js000066400000000000000000000004051450520414700325270ustar00rootroot00000000000000import foo from './default.js'; import { value } from './named.js'; console.log(foo, value); export { default } from './default.js'; import('./default').then(result => console.log(result.default)); import('./named').then(result => console.log(result.value)); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/named.js000066400000000000000000000000361450520414700326670ustar00rootroot00000000000000export const value = 'named'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/000077500000000000000000000000001450520414700323745ustar00rootroot00000000000000_config.js000066400000000000000000000003731450520414700342620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-exportmodule.exports = defineTest({ description: 'confirm exports are deconflicted when exporting nested index aliases', options: { strictDeprecations: false, input: 'main.js', preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); _expected/000077500000000000000000000000001450520414700342555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-exportamd/000077500000000000000000000000001450520414700350165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expectedmain.js000066400000000000000000000002731450520414700363020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amddefine(['exports', './module-a/v1/index', './module-b/v1/index'], (function (exports, index, index$1) { 'use strict'; exports.ModuleA_V1 = index; exports.ModuleB_V1 = index$1; })); module-a/000077500000000000000000000000001450520414700365215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amdv1/000077500000000000000000000000001450520414700370475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-aindex.js000066400000000000000000000002041450520414700405100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-a/v1define(['exports'], (function (exports) { 'use strict'; const TEST_MODULE_A = 'A'; exports.TEST_MODULE_A = TEST_MODULE_A; })); module-b/000077500000000000000000000000001450520414700365225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amdv1/000077500000000000000000000000001450520414700370505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-bindex.js000066400000000000000000000002041450520414700405110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-b/v1define(['exports'], (function (exports) { 'use strict'; const TEST_MODULE_B = 'A'; exports.TEST_MODULE_B = TEST_MODULE_B; })); cjs/000077500000000000000000000000001450520414700350345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expectedmain.js000066400000000000000000000002541450520414700363170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs'use strict'; var index = require('./module-a/v1/index.js'); var index$1 = require('./module-b/v1/index.js'); exports.ModuleA_V1 = index; exports.ModuleB_V1 = index$1; module-a/000077500000000000000000000000001450520414700365375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjsv1/000077500000000000000000000000001450520414700370655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-aindex.js000066400000000000000000000001221450520414700405250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-a/v1'use strict'; const TEST_MODULE_A = 'A'; exports.TEST_MODULE_A = TEST_MODULE_A; module-b/000077500000000000000000000000001450520414700365405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjsv1/000077500000000000000000000000001450520414700370665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-bindex.js000066400000000000000000000001221450520414700405260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-b/v1'use strict'; const TEST_MODULE_B = 'A'; exports.TEST_MODULE_B = TEST_MODULE_B; es/000077500000000000000000000000001450520414700346645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expectedmain.js000066400000000000000000000002461450520414700361500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/esimport * as index from './module-a/v1/index.js'; export { index as ModuleA_V1 }; import * as index$1 from './module-b/v1/index.js'; export { index$1 as ModuleB_V1 }; module-a/000077500000000000000000000000001450520414700363675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/esv1/000077500000000000000000000000001450520414700367155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-aindex.js000066400000000000000000000000661450520414700403640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-a/v1const TEST_MODULE_A = 'A'; export { TEST_MODULE_A }; module-b/000077500000000000000000000000001450520414700363705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/esv1/000077500000000000000000000000001450520414700367165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-bindex.js000066400000000000000000000000661450520414700403650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-b/v1const TEST_MODULE_B = 'A'; export { TEST_MODULE_B }; system/000077500000000000000000000000001450520414700356015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expectedmain.js000066400000000000000000000004431450520414700370640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/systemSystem.register(['./module-a/v1/index.js', './module-b/v1/index.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('ModuleA_V1', module); }, function (module) { exports('ModuleB_V1', module); }], execute: (function () { }) }; })); module-a/000077500000000000000000000000001450520414700373045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/systemv1/000077500000000000000000000000001450520414700376325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-aindex.js000066400000000000000000000002451450520414700413000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-a/v1System.register([], (function (exports) { 'use strict'; return { execute: (function () { const TEST_MODULE_A = exports('TEST_MODULE_A', 'A'); }) }; })); module-b/000077500000000000000000000000001450520414700373055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/systemv1/000077500000000000000000000000001450520414700376335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-bindex.js000066400000000000000000000002451450520414700413010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-b/v1System.register([], (function (exports) { 'use strict'; return { execute: (function () { const TEST_MODULE_B = exports('TEST_MODULE_B', 'A'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/main.js000066400000000000000000000001011450520414700336460ustar00rootroot00000000000000export * from './module-a/index' export * from './module-b/index'module-a/000077500000000000000000000000001450520414700340205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-exportindex.js000066400000000000000000000000771450520414700354710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-aimport * as ModuleA_V1 from './v1/index' export { ModuleA_V1 }v1/000077500000000000000000000000001450520414700343465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-aindex.js000066400000000000000000000000401450520414700360050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/v1export const TEST_MODULE_A = 'A'module-b/000077500000000000000000000000001450520414700340215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-exportindex.js000066400000000000000000000000771450520414700354720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-bimport * as ModuleB_V1 from './v1/index' export { ModuleB_V1 }v1/000077500000000000000000000000001450520414700343475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-bindex.js000066400000000000000000000000401450520414700360060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/v1export const TEST_MODULE_B = 'A'rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/000077500000000000000000000000001450520414700305225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js000066400000000000000000000003541450520414700324660ustar00rootroot00000000000000module.exports = defineTest({ description: 'confirm exports are preserved when exporting a module', options: { strictDeprecations: false, input: 'main.js', preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/000077500000000000000000000000001450520414700324625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/000077500000000000000000000000001450520414700332235ustar00rootroot00000000000000inner/000077500000000000000000000000001450520414700342575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amdmore_inner/000077500000000000000000000000001450520414700364145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/innersomething.js000066400000000000000000000002021450520414700407410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/inner/more_innerdefine(['exports'], (function (exports) { 'use strict'; const Something = 'Hello World'; exports.Something = Something; })); some_effect.js000066400000000000000000000001101450520414700370640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/innerdefine((function () { 'use strict'; console.log('side-effect'); })); main.js000066400000000000000000000002721450520414700344270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amddefine(['exports', './inner/more_inner/something', './inner/some_effect'], (function (exports, something, some_effect) { 'use strict'; exports.Something = something.Something; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/000077500000000000000000000000001450520414700332415ustar00rootroot00000000000000inner/000077500000000000000000000000001450520414700342755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjsmore_inner/000077500000000000000000000000001450520414700364325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/innersomething.js000066400000000000000000000001201450520414700407560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/more_inner'use strict'; const Something = 'Hello World'; exports.Something = Something; some_effect.js000066400000000000000000000000531450520414700371100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner'use strict'; console.log('side-effect'); main.js000066400000000000000000000002321450520414700344410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs'use strict'; var something = require('./inner/more_inner/something.js'); require('./inner/some_effect.js'); exports.Something = something.Something; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/000077500000000000000000000000001450520414700330715ustar00rootroot00000000000000inner/000077500000000000000000000000001450520414700341255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/esmore_inner/000077500000000000000000000000001450520414700362625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/innersomething.js000066400000000000000000000000701450520414700406120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/more_innerconst Something = 'Hello World'; export { Something }; some_effect.js000066400000000000000000000000341450520414700367370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/innerconsole.log('side-effect'); main.js000066400000000000000000000001361450520414700342740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/esexport { Something } from './inner/more_inner/something.js'; import './inner/some_effect.js'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/000077500000000000000000000000001450520414700340065ustar00rootroot00000000000000inner/000077500000000000000000000000001450520414700350425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/systemmore_inner/000077500000000000000000000000001450520414700371775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/innersomething.js000066400000000000000000000002471450520414700415350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/inner/more_innerSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const Something = exports('Something', 'Hello World'); }) }; })); some_effect.js000066400000000000000000000002051450520414700376540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/innerSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('side-effect'); }) }; })); main.js000066400000000000000000000004001450520414700352030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/systemSystem.register(['./inner/more_inner/something.js', './inner/some_effect.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('Something', module.Something); }, null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/000077500000000000000000000000001450520414700316355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/index.js000066400000000000000000000000741450520414700333030ustar00rootroot00000000000000export * from './more_inner/index'; import './some_effect'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/000077500000000000000000000000001450520414700337725ustar00rootroot00000000000000index.js000066400000000000000000000000351450520414700353560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_innerexport * from './something'; something.js000066400000000000000000000000501450520414700362410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_innerexport const Something = 'Hello World'; some_effect.js000066400000000000000000000000341450520414700343700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/innerconsole.log('side-effect'); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-nested-export/main.js000066400000000000000000000000371450520414700320040ustar00rootroot00000000000000export * from './inner/index'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/000077500000000000000000000000001450520414700313455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js000066400000000000000000000003521450520414700333070ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports and exports of non-entry points are tracked', options: { strictDeprecations: false, input: 'main.js', preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/000077500000000000000000000000001450520414700333055ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700337675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expecteddep2.js000066400000000000000000000001141450520414700351530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amddefine((function () { 'use strict'; function foo() {} return foo; })); main.js000066400000000000000000000001131450520414700352440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amddefine(['./dep2'], (function (dep2) { 'use strict'; return dep2; })); cjs/000077500000000000000000000000001450520414700340055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expecteddep2.js000066400000000000000000000000701450520414700351720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs'use strict'; function foo() {} module.exports = foo; main.js000066400000000000000000000001121450520414700352610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs'use strict'; var dep2 = require('./dep2.js'); module.exports = dep2; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/000077500000000000000000000000001450520414700337145ustar00rootroot00000000000000dep2.js000066400000000000000000000000561450520414700350260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/esfunction foo() {} export { foo as default }; main.js000066400000000000000000000000731450520414700351170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/esimport foo from './dep2.js'; export { foo as default }; system/000077500000000000000000000000001450520414700345525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expecteddep2.js000066400000000000000000000002371450520414700357440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo() {} }) }; })); main.js000066400000000000000000000003511450520414700360330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/systemSystem.register(['./dep2.js'], (function (exports) { 'use strict'; var foo; return { setters: [function (module) { foo = module.default; exports('default', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep1.js000066400000000000000000000000411450520414700325270ustar00rootroot00000000000000export { default } from './dep2';rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep2.js000066400000000000000000000000351450520414700325330ustar00rootroot00000000000000export default function() {};rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/main.js000066400000000000000000000000561450520414700326300ustar00rootroot00000000000000import foo from './dep1'; export default foo;rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/000077500000000000000000000000001450520414700304125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js000066400000000000000000000004241450520414700323540ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly resolves imports via a proxy module as direct imports when preserving modules', options: { strictDeprecations: false, preserveModules: true, external: 'external' }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/000077500000000000000000000000001450520414700323525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/000077500000000000000000000000001450520414700331135ustar00rootroot00000000000000main.js000066400000000000000000000002211450520414700343110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amddefine(['external'], (function (path) { 'use strict'; console.log(path.normalize('foo\\bar')); console.log(path.normalize('foo\\bar')); })); proxy.js000066400000000000000000000001151450520414700345500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amddefine(['external'], (function (path) { 'use strict'; return path; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/000077500000000000000000000000001450520414700331315ustar00rootroot00000000000000main.js000066400000000000000000000002021450520414700343260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs'use strict'; var path = require('external'); console.log(path.normalize('foo\\bar')); console.log(path.normalize('foo\\bar')); proxy.js000066400000000000000000000001111450520414700345620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs'use strict'; var path = require('external'); module.exports = path; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/000077500000000000000000000000001450520414700327615ustar00rootroot00000000000000main.js000066400000000000000000000001601450520414700341610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/esimport path from 'external'; console.log(path.normalize('foo\\bar')); console.log(path.normalize('foo\\bar')); proxy.js000066400000000000000000000001011450520414700344110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/esimport path from 'external'; export { default } from 'external'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/000077500000000000000000000000001450520414700336765ustar00rootroot00000000000000main.js000066400000000000000000000004231450520414700351000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/systemSystem.register(['external'], (function () { 'use strict'; var path; return { setters: [function (module) { path = module.default; }], execute: (function () { console.log(path.normalize('foo\\bar')); console.log(path.normalize('foo\\bar')); }) }; })); proxy.js000066400000000000000000000003521450520414700353360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/systemSystem.register(['external'], (function (exports) { 'use strict'; var path; return { setters: [function (module) { path = module.default; exports('default', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/main.js000066400000000000000000000002261450520414700316740ustar00rootroot00000000000000import path from 'external'; import proxyPath from './proxy'; console.log(path.normalize('foo\\bar')); console.log(proxyPath.normalize('foo\\bar')); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/proxy.js000066400000000000000000000000621450520414700321270ustar00rootroot00000000000000import path from 'external'; export default path; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/000077500000000000000000000000001450520414700311535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js000066400000000000000000000003341450520414700331150ustar00rootroot00000000000000module.exports = defineTest({ description: 'change the module destination', options: { strictDeprecations: false, input: 'src/lib/main.js', preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/000077500000000000000000000000001450520414700331135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/000077500000000000000000000000001450520414700336545ustar00rootroot00000000000000dep.js000066400000000000000000000002051450520414700347000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amddefine(['exports'], (function (exports) { 'use strict'; function fn () { console.log('dep fn'); } exports.fn = fn; })); lib/000077500000000000000000000000001450520414700343435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amdmain.js000066400000000000000000000002101450520414700356160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/libdefine(['../dep'], (function (dep) { 'use strict'; class Main { constructor () { dep.fn(); } } return Main; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/000077500000000000000000000000001450520414700336725ustar00rootroot00000000000000dep.js000066400000000000000000000001151450520414700347160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs'use strict'; function fn () { console.log('dep fn'); } exports.fn = fn; lib/000077500000000000000000000000001450520414700343615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjsmain.js000066400000000000000000000001741450520414700356450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/lib'use strict'; var dep = require('../dep.js'); class Main { constructor () { dep.fn(); } } module.exports = Main; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/000077500000000000000000000000001450520414700335225ustar00rootroot00000000000000dep.js000066400000000000000000000000741450520414700345520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/esfunction fn () { console.log('dep fn'); } export { fn }; lib/000077500000000000000000000000001450520414700342115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/esmain.js000066400000000000000000000001561450520414700354750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/libimport { fn } from '../dep.js'; class Main { constructor () { fn(); } } export { Main as default }; system/000077500000000000000000000000001450520414700343605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expecteddep.js000066400000000000000000000003141450520414700354640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('dep fn'); } }) }; })); lib/000077500000000000000000000000001450520414700351265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/systemmain.js000066400000000000000000000004611450520414700364110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/system/libSystem.register(['../dep.js'], (function (exports) { 'use strict'; var fn; return { setters: [function (module) { fn = module.fn; }], execute: (function () { class Main { constructor () { fn(); } } exports('default', Main); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/000077500000000000000000000000001450520414700317425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/dep.js000066400000000000000000000000621450520414700330460ustar00rootroot00000000000000export function fn () { console.log('dep fn'); }rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/lib/000077500000000000000000000000001450520414700325105ustar00rootroot00000000000000main.js000066400000000000000000000001341450520414700337110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/libimport { fn } from '../dep'; export default class Main { constructor () { fn(); } }rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/000077500000000000000000000000001450520414700315265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js000066400000000000000000000013271450520414700334730ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'scriptified assets have extension in preserveModules output filename', options: { strictDeprecations: false, input: 'src/main.js', preserveModules: true, plugins: [ { name: 'str-num-plugin', transform(code, id) { switch (path.extname(id)) { case '.num': { return { code: `export default ${code.trim()}` }; } case '.str': { return { code: `export default "${code.trim()}"` }; } case '': { return { code: 'export default "COULDN\'T TRANSFORM"' }; } default: { return null; } } } } ] }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/000077500000000000000000000000001450520414700334665ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700341505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expectedanswer.num.js000066400000000000000000000001161450520414700366010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amddefine((function () { 'use strict'; var answer = 42; return answer; })); lorem.str.js000066400000000000000000000010111450520414700364240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amddefine((function () { 'use strict'; var lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; return lorem; })); main.js000066400000000000000000000003141450520414700354300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amddefine(['exports', './answer.num', './lorem.str', './no-ext'], (function (exports, answer, lorem, noExt) { 'use strict'; exports.answer = answer; exports.lorem = lorem; exports.noExt = noExt; })); no-ext.js000066400000000000000000000001361450520414700357200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amddefine((function () { 'use strict'; var noExt = "COULDN'T TRANSFORM"; return noExt; })); cjs/000077500000000000000000000000001450520414700341665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expectedanswer.num.js000066400000000000000000000000721450520414700366200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs'use strict'; var answer = 42; module.exports = answer; lorem.str.js000066400000000000000000000007651450520414700364610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs'use strict'; var lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; module.exports = lorem; main.js000066400000000000000000000003151450520414700354470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs'use strict'; var answer = require('./answer.num.js'); var lorem = require('./lorem.str.js'); var noExt = require('./no-ext.js'); exports.answer = answer; exports.lorem = lorem; exports.noExt = noExt; no-ext.js000066400000000000000000000001121450520414700357300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs'use strict'; var noExt = "COULDN'T TRANSFORM"; module.exports = noExt; es/000077500000000000000000000000001450520414700340165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expectedanswer.num.js000066400000000000000000000000601450520414700364450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/esvar answer = 42; export { answer as default }; lorem.str.js000066400000000000000000000007531450520414700363060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/esvar lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; export { lorem as default }; main.js000066400000000000000000000002301450520414700352730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/esexport { default as answer } from './answer.num.js'; export { default as lorem } from './lorem.str.js'; export { default as noExt } from './no-ext.js'; no-ext.js000066400000000000000000000001001450520414700355550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/esvar noExt = "COULDN'T TRANSFORM"; export { noExt as default }; system/000077500000000000000000000000001450520414700347335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expectedanswer.num.js000066400000000000000000000002251450520414700373650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var answer = exports('default', 42); }) }; })); lorem.str.js000066400000000000000000000011211450520414700372110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var lorem = exports('default', "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."); }) }; })); main.js000066400000000000000000000005501450520414700362150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/systemSystem.register(['./answer.num.js', './lorem.str.js', './no-ext.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('answer', module.default); }, function (module) { exports('lorem', module.default); }, function (module) { exports('noExt', module.default); }], execute: (function () { }) }; })); no-ext.js000066400000000000000000000002461450520414700365050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var noExt = exports('default', "COULDN'T TRANSFORM"); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/000077500000000000000000000000001450520414700323155ustar00rootroot00000000000000answer.num000066400000000000000000000000031450520414700342470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src42 lorem.str000066400000000000000000000006761450520414700341170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/srcLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/main.js000066400000000000000000000002171450520414700335770ustar00rootroot00000000000000export { default as answer } from './answer.num'; export { default as lorem } from './lorem.str'; export { default as noExt } from './no-ext'; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/no-ext000066400000000000000000000000111450520414700334420ustar00rootroot00000000000000WHATEVER rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/000077500000000000000000000000001450520414700303415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js000066400000000000000000000003301450520414700322770ustar00rootroot00000000000000module.exports = defineTest({ description: 'single entry names file correctly', options: { strictDeprecations: false, input: 'main.js', preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/000077500000000000000000000000001450520414700323015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/amd/000077500000000000000000000000001450520414700330425ustar00rootroot00000000000000main.js000066400000000000000000000000731450520414700342450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/amddefine((function () { 'use strict'; console.log(); })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/cjs/000077500000000000000000000000001450520414700330605ustar00rootroot00000000000000main.js000066400000000000000000000000361450520414700342620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/cjs'use strict'; console.log(); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/es/000077500000000000000000000000001450520414700327105ustar00rootroot00000000000000main.js000066400000000000000000000000171450520414700341110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/esconsole.log(); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/system/000077500000000000000000000000001450520414700336255ustar00rootroot00000000000000main.js000066400000000000000000000001701450520414700350260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log(); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-single-entry/main.js000066400000000000000000000000151450520414700316170ustar00rootroot00000000000000console.log()rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/000077500000000000000000000000001450520414700310555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js000066400000000000000000000011511450520414700330150ustar00rootroot00000000000000module.exports = defineTest({ description: 'Generates actual files for virtual modules when preserving modules', options: { strictDeprecations: false, input: 'main.js', preserveModules: true, plugins: [ { resolveId(id) { if (id === '\0virtualModule') return id; }, load(id) { if (id !== '\0virtualModule') return null; return 'export const virtual = "Virtual!";\n'; }, transform(code, id) { if (id === '\0virtualModule') return null; return 'import {virtual} from "\0virtualModule";\n' + code; } } ] }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/000077500000000000000000000000001450520414700330155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/000077500000000000000000000000001450520414700335565ustar00rootroot00000000000000_virtual/000077500000000000000000000000001450520414700353245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd_virtualModule.js000066400000000000000000000001711450520414700406540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual = "Virtual!"; exports.virtual = virtual; })); main.js000066400000000000000000000002131450520414700347550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amddefine(['./_virtual/_virtualModule'], (function (_virtualModule) { 'use strict'; assert.equal(_virtualModule.virtual, 'Virtual!'); })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/000077500000000000000000000000001450520414700335745ustar00rootroot00000000000000_virtual/000077500000000000000000000000001450520414700353425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs_virtualModule.js000066400000000000000000000001071450520414700406710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/_virtual'use strict'; const virtual = "Virtual!"; exports.virtual = virtual; main.js000066400000000000000000000002001450520414700347670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs'use strict'; var _virtualModule = require('./_virtual/_virtualModule.js'); assert.equal(_virtualModule.virtual, 'Virtual!'); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/000077500000000000000000000000001450520414700334245ustar00rootroot00000000000000_virtual/000077500000000000000000000000001450520414700351725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es_virtualModule.js000066400000000000000000000000611450520414700405200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/_virtualconst virtual = "Virtual!"; export { virtual }; main.js000066400000000000000000000001341450520414700346250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/esimport { virtual } from './_virtual/_virtualModule.js'; assert.equal(virtual, 'Virtual!'); system/000077500000000000000000000000001450520414700342625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected_virtual/000077500000000000000000000000001450520414700361075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system_virtualModule.js000066400000000000000000000002401450520414700414340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const virtual = exports('virtual', "Virtual!"); }) }; })); main.js000066400000000000000000000003731450520414700355470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/systemSystem.register(['./_virtual/_virtualModule.js'], (function () { 'use strict'; var virtual; return { setters: [function (module) { virtual = module.virtual; }], execute: (function () { assert.equal(virtual, 'Virtual!'); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/main.js000066400000000000000000000000431450520414700323340ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/000077500000000000000000000000001450520414700257235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_config.js000066400000000000000000000003361450520414700276670ustar00rootroot00000000000000module.exports = defineTest({ description: 'Rewrite modules in-place', options: { strictDeprecations: false, input: ['main1.js', 'main2.js'], preserveModules: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/000077500000000000000000000000001450520414700276635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/000077500000000000000000000000001450520414700304245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/000077500000000000000000000000001450520414700313575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep1.js000066400000000000000000000002061450520414700325440ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('dep1 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep2.js000066400000000000000000000002521450520414700325460ustar00rootroot00000000000000define(['exports', '../lib/lib2'], (function (exports, lib2) { 'use strict'; function fn () { lib2.fn(); console.log('dep2 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep3.js000066400000000000000000000002521450520414700325470ustar00rootroot00000000000000define(['exports', '../lib/lib1'], (function (exports, lib1) { 'use strict'; function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/000077500000000000000000000000001450520414700311725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib1.js000066400000000000000000000002061450520414700323550ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib2.js000066400000000000000000000002061450520414700323560ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib2 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main1.js000066400000000000000000000002671450520414700317740ustar00rootroot00000000000000define(['./deps/dep1', './deps/dep2'], (function (dep1, dep2) { 'use strict'; class Main1 { constructor () { dep1.fn(); dep2.fn(); } } return Main1; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main2.js000066400000000000000000000002671450520414700317750ustar00rootroot00000000000000define(['./deps/dep2', './deps/dep3'], (function (dep2, dep3) { 'use strict'; class Main2 { constructor () { dep3.fn(); dep2.fn(); } } return Main2; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/000077500000000000000000000000001450520414700304425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/000077500000000000000000000000001450520414700313755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep1.js000066400000000000000000000001161450520414700325620ustar00rootroot00000000000000'use strict'; function fn () { console.log('dep1 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep2.js000066400000000000000000000002021450520414700325570ustar00rootroot00000000000000'use strict'; var lib2 = require('../lib/lib2.js'); function fn () { lib2.fn(); console.log('dep2 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep3.js000066400000000000000000000002021450520414700325600ustar00rootroot00000000000000'use strict'; var lib1 = require('../lib/lib1.js'); function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/000077500000000000000000000000001450520414700312105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib1.js000066400000000000000000000001161450520414700323730ustar00rootroot00000000000000'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib2.js000066400000000000000000000001161450520414700323740ustar00rootroot00000000000000'use strict'; function fn () { console.log('lib2 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main1.js000066400000000000000000000002721450520414700320060ustar00rootroot00000000000000'use strict'; var dep1 = require('./deps/dep1.js'); var dep2 = require('./deps/dep2.js'); class Main1 { constructor () { dep1.fn(); dep2.fn(); } } module.exports = Main1; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main2.js000066400000000000000000000002721450520414700320070ustar00rootroot00000000000000'use strict'; var dep2 = require('./deps/dep2.js'); var dep3 = require('./deps/dep3.js'); class Main2 { constructor () { dep3.fn(); dep2.fn(); } } module.exports = Main2; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/000077500000000000000000000000001450520414700302725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/000077500000000000000000000000001450520414700312255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep1.js000066400000000000000000000000751450520414700324160ustar00rootroot00000000000000function fn () { console.log('dep1 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep2.js000066400000000000000000000001651450520414700324170ustar00rootroot00000000000000import { fn as fn$1 } from '../lib/lib2.js'; function fn () { fn$1(); console.log('dep2 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep3.js000066400000000000000000000001651450520414700324200ustar00rootroot00000000000000import { fn as fn$1 } from '../lib/lib1.js'; function fn () { fn$1(); console.log('dep3 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/000077500000000000000000000000001450520414700310405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib1.js000066400000000000000000000000751450520414700322270ustar00rootroot00000000000000function fn () { console.log('lib1 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib2.js000066400000000000000000000000751450520414700322300ustar00rootroot00000000000000function fn () { console.log('lib2 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main1.js000066400000000000000000000002561450520414700316400ustar00rootroot00000000000000import { fn } from './deps/dep1.js'; import { fn as fn$1 } from './deps/dep2.js'; class Main1 { constructor () { fn(); fn$1(); } } export { Main1 as default }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main2.js000066400000000000000000000002561450520414700316410ustar00rootroot00000000000000import { fn as fn$1 } from './deps/dep2.js'; import { fn } from './deps/dep3.js'; class Main2 { constructor () { fn(); fn$1(); } } export { Main2 as default }; rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/000077500000000000000000000000001450520414700312075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/000077500000000000000000000000001450520414700321425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep1.js000066400000000000000000000003151450520414700333300ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('dep1 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep2.js000066400000000000000000000004731450520414700333360ustar00rootroot00000000000000System.register(['../lib/lib2.js'], (function (exports) { 'use strict'; var fn$1; return { setters: [function (module) { fn$1 = module.fn; }], execute: (function () { exports('fn', fn); function fn () { fn$1(); console.log('dep2 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep3.js000066400000000000000000000004731450520414700333370ustar00rootroot00000000000000System.register(['../lib/lib1.js'], (function (exports) { 'use strict'; var fn$1; return { setters: [function (module) { fn$1 = module.fn; }], execute: (function () { exports('fn', fn); function fn () { fn$1(); console.log('dep3 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/000077500000000000000000000000001450520414700317555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib1.js000066400000000000000000000003151450520414700331410ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('lib1 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib2.js000066400000000000000000000003151450520414700331420ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('lib2 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main1.js000066400000000000000000000006251450520414700325550ustar00rootroot00000000000000System.register(['./deps/dep1.js', './deps/dep2.js'], (function (exports) { 'use strict'; var fn, fn$1; return { setters: [function (module) { fn = module.fn; }, function (module) { fn$1 = module.fn; }], execute: (function () { class Main1 { constructor () { fn(); fn$1(); } } exports('default', Main1); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main2.js000066400000000000000000000006251450520414700325560ustar00rootroot00000000000000System.register(['./deps/dep2.js', './deps/dep3.js'], (function (exports) { 'use strict'; var fn$1, fn; return { setters: [function (module) { fn$1 = module.fn; }, function (module) { fn = module.fn; }], execute: (function () { class Main2 { constructor () { fn(); fn$1(); } } exports('default', Main2); }) }; })); rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/deps/000077500000000000000000000000001450520414700266565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/deps/dep1.js000066400000000000000000000000631450520414700300440ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/deps/dep2.js000066400000000000000000000001551450520414700300470ustar00rootroot00000000000000import { fn as libfn } from '../lib/lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/deps/dep3.js000066400000000000000000000002251450520414700300460ustar00rootroot00000000000000import { fn as libfn, treeshaked } from '../lib/lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/lib/000077500000000000000000000000001450520414700264715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/lib/lib1.js000066400000000000000000000001751450520414700276610ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/lib/lib2.js000066400000000000000000000000631450520414700276560ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/main1.js000066400000000000000000000002341450520414700272650ustar00rootroot00000000000000import { fn } from './deps/dep1.js'; import { fn as fn2 } from './deps/dep2.js'; export default class Main1 { constructor () { fn(); fn2(); } }rollup-3.29.4/test/chunking-form/samples/deprecated/preserve-modules/main2.js000066400000000000000000000003231450520414700272650ustar00rootroot00000000000000import { fn } from './deps/dep2.js'; import { fn as fn2, default as treeshaked } from './deps/dep3.js'; if (false) { treeshaked(); } export default class Main2 { constructor () { fn2(); fn(); } }rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/000077500000000000000000000000001450520414700246475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_config.js000066400000000000000000000001661450520414700266140ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes chained dynamic imports', options: { input: 'main.js' } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/000077500000000000000000000000001450520414700266075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/amd/000077500000000000000000000000001450520414700273505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/amd/generated-dep1.js000066400000000000000000000002631450520414700324740ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; console.log('dep1'); new Promise(function (resolve, reject) { require(['./generated-dep2'], resolve, reject); }); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/amd/generated-dep2.js000066400000000000000000000001011450520414700324640ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dep2'); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/amd/main.js000066400000000000000000000002631450520414700306330ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; console.log('main'); new Promise(function (resolve, reject) { require(['./generated-dep1'], resolve, reject); }); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/cjs/000077500000000000000000000000001450520414700273665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/cjs/generated-dep1.js000066400000000000000000000001641450520414700325120ustar00rootroot00000000000000'use strict'; console.log('dep1'); Promise.resolve().then(function () { return require('./generated-dep2.js'); }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/cjs/generated-dep2.js000066400000000000000000000000441450520414700325100ustar00rootroot00000000000000'use strict'; console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/cjs/main.js000066400000000000000000000001641450520414700306510ustar00rootroot00000000000000'use strict'; console.log('main'); Promise.resolve().then(function () { return require('./generated-dep1.js'); }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/es/000077500000000000000000000000001450520414700272165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/es/generated-dep1.js000066400000000000000000000000641450520414700323410ustar00rootroot00000000000000console.log('dep1'); import('./generated-dep2.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/es/generated-dep2.js000066400000000000000000000000251450520414700323370ustar00rootroot00000000000000console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/es/main.js000066400000000000000000000000641450520414700305000ustar00rootroot00000000000000console.log('main'); import('./generated-dep1.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/system/000077500000000000000000000000001450520414700301335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/system/generated-dep1.js000066400000000000000000000002661450520414700332620ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log('dep1'); module.import('./generated-dep2.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/system/generated-dep2.js000066400000000000000000000001761450520414700332630ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/_expected/system/main.js000066400000000000000000000002661450520414700314210ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log('main'); module.import('./generated-dep1.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/dep1.js000066400000000000000000000000521450520414700260330ustar00rootroot00000000000000console.log('dep1'); import('./dep2.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/dep2.js000066400000000000000000000000251450520414700260340ustar00rootroot00000000000000console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chained/main.js000066400000000000000000000001651450520414700261330ustar00rootroot00000000000000console.log('main'); // to mess up the internal execution order if (false) import('./dep2.js') import('./dep1.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/000077500000000000000000000000001450520414700250625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_config.js000066400000000000000000000002371450520414700270260ustar00rootroot00000000000000module.exports = defineTest({ description: 'Code splitting with dynamic import', options: { input: ['main.js'], preserveEntrySignatures: 'strict' } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/000077500000000000000000000000001450520414700270225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/amd/000077500000000000000000000000001450520414700275635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/amd/generated-dep2.js000066400000000000000000000002571450520414700327130ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, main) { 'use strict'; function mult (num) { return num + main.multiplier; } exports.mult = mult; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/amd/generated-main.js000066400000000000000000000010161450520414700327770ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; var multiplier = 7; function calc (num) { return num * multiplier; } function fn (num) { return num * calc(num); } function dynamic (num) { return new Promise(function (resolve, reject) { require(['./generated-dep2'], resolve, reject); }) .then(dep2 => { return dep2.mult(num); }); } console.log(fn(5)); dynamic(10).then(num => { console.log(num); }); exports.multiplier = multiplier; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/amd/main.js000066400000000000000000000001061450520414700310420ustar00rootroot00000000000000define(['./generated-main'], (function (main) { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/cjs/000077500000000000000000000000001450520414700276015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/cjs/generated-dep2.js000066400000000000000000000002111450520414700327170ustar00rootroot00000000000000'use strict'; var main = require('./generated-main.js'); function mult (num) { return num + main.multiplier; } exports.mult = mult; rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/cjs/generated-main.js000066400000000000000000000006311450520414700330170ustar00rootroot00000000000000'use strict'; var multiplier = 7; function calc (num) { return num * multiplier; } function fn (num) { return num * calc(num); } function dynamic (num) { return Promise.resolve().then(function () { return require('./generated-dep2.js'); }) .then(dep2 => { return dep2.mult(num); }); } console.log(fn(5)); dynamic(10).then(num => { console.log(num); }); exports.multiplier = multiplier; rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/cjs/main.js000066400000000000000000000000601450520414700310570ustar00rootroot00000000000000'use strict'; require('./generated-main.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/es/000077500000000000000000000000001450520414700274315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/es/generated-dep2.js000066400000000000000000000001751450520414700325600ustar00rootroot00000000000000import { m as multiplier } from './generated-main.js'; function mult (num) { return num + multiplier; } export { mult }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/es/generated-main.js000066400000000000000000000005241450520414700326500ustar00rootroot00000000000000var multiplier = 7; function calc (num) { return num * multiplier; } function fn (num) { return num * calc(num); } function dynamic (num) { return import('./generated-dep2.js') .then(dep2 => { return dep2.mult(num); }); } console.log(fn(5)); dynamic(10).then(num => { console.log(num); }); export { multiplier as m }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/es/main.js000066400000000000000000000000361450520414700307120ustar00rootroot00000000000000import './generated-main.js'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/system/000077500000000000000000000000001450520414700303465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/system/generated-dep2.js000066400000000000000000000005051450520414700334720ustar00rootroot00000000000000System.register(['./generated-main.js'], (function (exports) { 'use strict'; var multiplier; return { setters: [function (module) { multiplier = module.m; }], execute: (function () { exports('mult', mult); function mult (num) { return num + multiplier; } }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/system/generated-main.js000066400000000000000000000010561450520414700335660ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var multiplier = exports('m', 7); function calc (num) { return num * multiplier; } function fn (num) { return num * calc(num); } function dynamic (num) { return module.import('./generated-dep2.js') .then(dep2 => { return dep2.mult(num); }); } console.log(fn(5)); dynamic(10).then(num => { console.log(num); }); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/_expected/system/main.js000066400000000000000000000002171450520414700316300ustar00rootroot00000000000000System.register(['./generated-main.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/dep1.js000066400000000000000000000003141450520414700262470ustar00rootroot00000000000000import { calc } from './dep3.js'; export function fn (num) { return num * calc(num); } export function dynamic (num) { return import('./dep2.js') .then(dep2 => { return dep2.mult(num); }); }rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/dep2.js000066400000000000000000000001421450520414700262470ustar00rootroot00000000000000import { multiplier } from './dep4.js'; export function mult (num) { return num + multiplier; }rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/dep3.js000066400000000000000000000001421450520414700262500ustar00rootroot00000000000000import { multiplier } from './dep4.js'; export function calc (num) { return num * multiplier; }rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/dep4.js000066400000000000000000000000321450520414700262470ustar00rootroot00000000000000export var multiplier = 7;rollup-3.29.4/test/chunking-form/samples/dynamic-import-chunking/main.js000066400000000000000000000001611450520414700263420ustar00rootroot00000000000000import { fn, dynamic } from './dep1.js'; console.log(fn(5)); dynamic(10).then(num => { console.log(num); }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/000077500000000000000000000000001450520414700251015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_config.js000066400000000000000000000004551450520414700270470ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not remove inline comments inside dynamic imports', options: { input: 'main.js', onwarn() {}, plugins: { renderDynamicImport() { return { left: 'foobar(', right: ')' }; }, resolveDynamicImport() { return false; } } } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_expected/000077500000000000000000000000001450520414700270415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_expected/amd/000077500000000000000000000000001450520414700276025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_expected/amd/main.js000066400000000000000000000002031450520414700310570ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; foobar( /* webpackChunkName: "chunk-name" */ './foo'/*suffix*/); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_expected/cjs/000077500000000000000000000000001450520414700276205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_expected/cjs/main.js000066400000000000000000000001231450520414700310760ustar00rootroot00000000000000'use strict'; foobar( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_expected/es/000077500000000000000000000000001450520414700274505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_expected/es/main.js000066400000000000000000000001041450520414700307250ustar00rootroot00000000000000foobar( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_expected/system/000077500000000000000000000000001450520414700303655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/_expected/system/main.js000066400000000000000000000003021450520414700316420ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { foobar( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-comments/main.js000066400000000000000000000001431450520414700263610ustar00rootroot00000000000000import /* () should not break */ ( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/000077500000000000000000000000001450520414700247005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_config.js000066400000000000000000000001721450520414700266420ustar00rootroot00000000000000module.exports = defineTest({ description: 'Code splitting with dynamic import', options: { input: ['main.js'] } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_expected/000077500000000000000000000000001450520414700266405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_expected/amd/000077500000000000000000000000001450520414700274015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_expected/amd/main.js000066400000000000000000000011761450520414700306700ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var dep = 'dep'; (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })(dep); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_expected/cjs/000077500000000000000000000000001450520414700274175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_expected/cjs/main.js000066400000000000000000000000561450520414700307020ustar00rootroot00000000000000'use strict'; var dep = 'dep'; import(dep); rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_expected/es/000077500000000000000000000000001450520414700272475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_expected/es/main.js000066400000000000000000000000371450520414700305310ustar00rootroot00000000000000var dep = 'dep'; import(dep); rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_expected/system/000077500000000000000000000000001450520414700301645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/_expected/system/main.js000066400000000000000000000002411450520414700314430ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var dep = 'dep'; module.import(dep); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/dep.js000066400000000000000000000000301450520414700257770ustar00rootroot00000000000000export var dep = 'dep'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-dynamic/main.js000066400000000000000000000000521450520414700261570ustar00rootroot00000000000000import { dep } from './dep'; import(dep);rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/000077500000000000000000000000001450520414700250765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_config.js000066400000000000000000000003441450520414700270410ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks dynamic imports as external when resolveDynamicImport returns false', options: { input: 'main.js', plugins: { resolveDynamicImport() { return false; } } } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_expected/000077500000000000000000000000001450520414700270365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_expected/amd/000077500000000000000000000000001450520414700275775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_expected/amd/main.js000066400000000000000000000011211450520414700310540ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } new Promise(function (resolve, reject) { require(['./foo'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_expected/cjs/000077500000000000000000000000001450520414700276155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_expected/cjs/main.js000066400000000000000000000000431450520414700310740ustar00rootroot00000000000000'use strict'; import('./foo.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_expected/es/000077500000000000000000000000001450520414700274455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_expected/es/main.js000066400000000000000000000000241450520414700307230ustar00rootroot00000000000000import('./foo.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_expected/system/000077500000000000000000000000001450520414700303625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/_expected/system/main.js000066400000000000000000000002231450520414700316410ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./foo.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/foo.js000066400000000000000000000000241450520414700262130ustar00rootroot00000000000000console.log('foo'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-external/main.js000066400000000000000000000000241450520414700263540ustar00rootroot00000000000000import('./foo.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/000077500000000000000000000000001450520414700244575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_config.js000066400000000000000000000002161450520414700264200ustar00rootroot00000000000000module.exports = defineTest({ description: 'makes sure dynamic chunks are not tainted', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/000077500000000000000000000000001450520414700264175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/amd/000077500000000000000000000000001450520414700271605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/amd/generated-dynamic.js000066400000000000000000000005171450520414700331010ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); const dynamic = 'dynamic'; var dynamic$1 = /*#__PURE__*/Object.freeze({ __proto__: null, dynamic: dynamic }); exports.dep = dep; exports.dynamic = dynamic; exports.dynamic$1 = dynamic$1; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/amd/main1.js000066400000000000000000000003761450520414700305310ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic$1; }).then(({dynamic}) => console.log('main1', dynamic)); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/amd/main2.js000066400000000000000000000002001450520414700305140ustar00rootroot00000000000000define(['./generated-dynamic'], (function (dynamic) { 'use strict'; console.log('main2', dynamic.dynamic, dynamic.dep); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/cjs/000077500000000000000000000000001450520414700271765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/cjs/generated-dynamic.js000066400000000000000000000004241450520414700331140ustar00rootroot00000000000000'use strict'; console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); const dynamic = 'dynamic'; var dynamic$1 = /*#__PURE__*/Object.freeze({ __proto__: null, dynamic: dynamic }); exports.dep = dep; exports.dynamic = dynamic; exports.dynamic$1 = dynamic$1; rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/cjs/main1.js000066400000000000000000000003001450520414700305320ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic$1; }).then(({dynamic}) => console.log('main1', dynamic)); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/cjs/main2.js000066400000000000000000000001651450520414700305440ustar00rootroot00000000000000'use strict'; var dynamic = require('./generated-dynamic.js'); console.log('main2', dynamic.dynamic, dynamic.dep); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/es/000077500000000000000000000000001450520414700270265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/es/generated-dynamic.js000066400000000000000000000003531450520414700327450ustar00rootroot00000000000000console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); const dynamic = 'dynamic'; var dynamic$1 = /*#__PURE__*/Object.freeze({ __proto__: null, dynamic: dynamic }); export { dep as a, dynamic$1 as b, dynamic as d }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/es/main1.js000066400000000000000000000001701450520414700303670ustar00rootroot00000000000000import('./generated-dynamic.js').then(function (n) { return n.b; }).then(({dynamic}) => console.log('main1', dynamic)); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/es/main2.js000066400000000000000000000001461450520414700303730ustar00rootroot00000000000000import { d as dynamic, a as dep } from './generated-dynamic.js'; console.log('main2', dynamic, dep); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/system/000077500000000000000000000000001450520414700277435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/system/generated-dynamic.js000066400000000000000000000005641450520414700336660ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); const dep = exports('a', 'dep'); console.log('dynamic', dep); const dynamic = exports('d', 'dynamic'); var dynamic$1 = /*#__PURE__*/Object.freeze({ __proto__: null, dynamic: dynamic }); exports('b', dynamic$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/system/main1.js000066400000000000000000000003671450520414700313140ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic.js').then(function (n) { return n.b; }).then(({dynamic}) => console.log('main1', dynamic)); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/_expected/system/main2.js000066400000000000000000000004101450520414700313020ustar00rootroot00000000000000System.register(['./generated-dynamic.js'], (function () { 'use strict'; var dynamic, dep; return { setters: [function (module) { dynamic = module.d; dep = module.a; }], execute: (function () { console.log('main2', dynamic, dep); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/dep.js000066400000000000000000000000571450520414700255670ustar00rootroot00000000000000console.log('dep'); export const dep = 'dep'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/dynamic.js000066400000000000000000000001331450520414700264360ustar00rootroot00000000000000import {dep} from './dep'; console.log('dynamic', dep); export const dynamic = 'dynamic'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/main1.js000066400000000000000000000001131450520414700260150ustar00rootroot00000000000000import('./dynamic.js').then(({dynamic}) => console.log('main1', dynamic)); rollup-3.29.4/test/chunking-form/samples/dynamic-import-facade/main2.js000066400000000000000000000001551450520414700260240ustar00rootroot00000000000000import { dep } from './dep.js'; import { dynamic } from './dynamic.js'; console.log('main2', dynamic, dep); rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/000077500000000000000000000000001450520414700266005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_config.js000066400000000000000000000003011450520414700305340ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles dynamic imports in manual chunks', options: { input: 'main.js', output: { manualChunks: { manual: ['manual.js'] } } } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/000077500000000000000000000000001450520414700305405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/amd/000077500000000000000000000000001450520414700313015ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001771450520414700351450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/amddefine(['./main', './generated-manual'], (function (main, manual) { 'use strict'; console.log(main.dep1, manual.dep2); })); generated-manual.js000066400000000000000000000003661450520414700347760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const dep2 = 'dep2'; console.log(dep2); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); exports.dep2 = dep2; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/amd/main.js000066400000000000000000000002371450520414700325650ustar00rootroot00000000000000define(['exports', './generated-manual'], (function (exports, manual) { 'use strict'; const dep1 = 'dep1'; console.log(dep1); exports.dep1 = dep1; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/cjs/000077500000000000000000000000001450520414700313175ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002051450520414700351530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/cjs'use strict'; var main = require('./main.js'); var manual = require('./generated-manual.js'); console.log(main.dep1, manual.dep2); generated-manual.js000066400000000000000000000002411450520414700350040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/cjs'use strict'; const dep2 = 'dep2'; console.log(dep2); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); exports.dep2 = dep2; rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/cjs/main.js000066400000000000000000000001611450520414700325770ustar00rootroot00000000000000'use strict'; require('./generated-manual.js'); const dep1 = 'dep1'; console.log(dep1); exports.dep1 = dep1; rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/es/000077500000000000000000000000001450520414700311475ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001641450520414700350070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/esimport { d as dep1 } from './main.js'; import { d as dep2 } from './generated-manual.js'; console.log(dep1, dep2); generated-manual.js000066400000000000000000000001421450520414700346340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/esconst dep2 = 'dep2'; console.log(dep2); import('./generated-dynamic.js'); export { dep2 as d }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/es/main.js000066400000000000000000000001411450520414700324250ustar00rootroot00000000000000import './generated-manual.js'; const dep1 = 'dep1'; console.log(dep1); export { dep1 as d }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/system/000077500000000000000000000000001450520414700320645ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000004361450520414700357260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/systemSystem.register(['./main.js', './generated-manual.js'], (function () { 'use strict'; var dep1, dep2; return { setters: [function (module) { dep1 = module.d; }, function (module) { dep2 = module.d; }], execute: (function () { console.log(dep1, dep2); }) }; })); generated-manual.js000066400000000000000000000003361450520414700355560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const dep2 = exports('d', 'dep2'); console.log(dep2); module.import('./generated-dynamic.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/_expected/system/main.js000066400000000000000000000003241450520414700333450ustar00rootroot00000000000000System.register(['./generated-manual.js'], (function (exports) { 'use strict'; return { setters: [null], execute: (function () { const dep1 = exports('d', 'dep1'); console.log(dep1); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/dep1.js000066400000000000000000000000341450520414700277640ustar00rootroot00000000000000export const dep1 = 'dep1'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/dep2.js000066400000000000000000000000341450520414700277650ustar00rootroot00000000000000export const dep2 = 'dep2'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/dynamic.js000066400000000000000000000001301450520414700305540ustar00rootroot00000000000000import { dep1 } from './dep1'; import { dep2 } from './dep2'; console.log(dep1, dep2); rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/main.js000066400000000000000000000001061450520414700300570ustar00rootroot00000000000000import { dep1 } from './dep1'; import './manual'; console.log(dep1); rollup-3.29.4/test/chunking-form/samples/dynamic-import-from-manual-chunk/manual.js000066400000000000000000000001101450520414700304030ustar00rootroot00000000000000import { dep2 } from './dep2'; console.log(dep2); import('./dynamic'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/000077500000000000000000000000001450520414700265315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_config.js000066400000000000000000000002331450520414700304710ustar00rootroot00000000000000module.exports = defineTest({ description: 'Handle dynamic imports that are part of a static graph', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/000077500000000000000000000000001450520414700304715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/amd/000077500000000000000000000000001450520414700312325ustar00rootroot00000000000000generated-separate.js000066400000000000000000000002611450520414700352500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var separate = 'separate'; const x = 2; console.log('separate'); exports.default = separate; exports.x = x; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/amd/main1.js000066400000000000000000000010311450520414700325700ustar00rootroot00000000000000define(['require', 'exports', './generated-separate'], (function (require, exports, separate$1) { 'use strict'; var inlined$1 = 'inlined'; const x = 1; console.log('inlined'); var inlined$2 = /*#__PURE__*/Object.freeze({ __proto__: null, default: inlined$1, x: x }); const inlined = Promise.resolve().then(function () { return inlined$2; }); const separate = new Promise(function (resolve, reject) { require(['./generated-separate'], resolve, reject); }); exports.inlined = inlined; exports.separate = separate; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/amd/main2.js000066400000000000000000000003451450520414700326000ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const separate = new Promise(function (resolve, reject) { require(['./generated-separate'], resolve, reject); }); exports.separate = separate; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/cjs/000077500000000000000000000000001450520414700312505ustar00rootroot00000000000000generated-separate.js000066400000000000000000000001741450520414700352710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/cjs'use strict'; var separate = 'separate'; const x = 2; console.log('separate'); exports.default = separate; exports.x = x; rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/cjs/main1.js000066400000000000000000000006751450520414700326230ustar00rootroot00000000000000'use strict'; require('./generated-separate.js'); var inlined$1 = 'inlined'; const x = 1; console.log('inlined'); var inlined$2 = /*#__PURE__*/Object.freeze({ __proto__: null, default: inlined$1, x: x }); const inlined = Promise.resolve().then(function () { return inlined$2; }); const separate = Promise.resolve().then(function () { return require('./generated-separate.js'); }); exports.inlined = inlined; exports.separate = separate; rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/cjs/main2.js000066400000000000000000000002221450520414700326100ustar00rootroot00000000000000'use strict'; const separate = Promise.resolve().then(function () { return require('./generated-separate.js'); }); exports.separate = separate; rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/es/000077500000000000000000000000001450520414700311005ustar00rootroot00000000000000generated-separate.js000066400000000000000000000001451450520414700351170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/esvar separate = 'separate'; const x = 2; console.log('separate'); export { separate as default, x }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/es/main1.js000066400000000000000000000005411450520414700324430ustar00rootroot00000000000000import './generated-separate.js'; var inlined$1 = 'inlined'; const x = 1; console.log('inlined'); var inlined$2 = /*#__PURE__*/Object.freeze({ __proto__: null, default: inlined$1, x: x }); const inlined = Promise.resolve().then(function () { return inlined$2; }); const separate = import('./generated-separate.js'); export { inlined, separate }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/es/main2.js000066400000000000000000000001121450520414700324360ustar00rootroot00000000000000const separate = import('./generated-separate.js'); export { separate }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/system/000077500000000000000000000000001450520414700320155ustar00rootroot00000000000000generated-separate.js000066400000000000000000000003311450520414700360310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var separate = exports('default', 'separate'); const x = exports('x', 2); console.log('separate'); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/system/main1.js000066400000000000000000000010161450520414700333560ustar00rootroot00000000000000System.register(['./generated-separate.js'], (function (exports, module) { 'use strict'; return { setters: [null], execute: (function () { var inlined$1 = 'inlined'; const x = 1; console.log('inlined'); var inlined$2 = /*#__PURE__*/Object.freeze({ __proto__: null, default: inlined$1, x: x }); const inlined = exports('inlined', Promise.resolve().then(function () { return inlined$2; })); const separate = exports('separate', module.import('./generated-separate.js')); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/system/main2.js000066400000000000000000000003101450520414700333530ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const separate = exports('separate', module.import('./generated-separate.js')); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/inlined.js000066400000000000000000000001061450520414700305060ustar00rootroot00000000000000export default 'inlined'; export const x = 1; console.log('inlined'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/main1.js000066400000000000000000000002201450520414700300660ustar00rootroot00000000000000import './inlined.js'; import './separate.js'; export const inlined = import('./inlined.js'); export const separate = import('./separate.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/main2.js000066400000000000000000000000611450520414700300720ustar00rootroot00000000000000export const separate = import('./separate.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inline-colouring/separate.js000066400000000000000000000001101450520414700306630ustar00rootroot00000000000000export default 'separate'; export const x = 2; console.log('separate'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/000077500000000000000000000000001450520414700263275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_config.js000066400000000000000000000003141450520414700302670ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports an object with a single entry when inlining dynamic imports', options: { output: { inlineDynamicImports: true }, input: { entry: 'main' } } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_expected/000077500000000000000000000000001450520414700302675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_expected/amd/000077500000000000000000000000001450520414700310305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_expected/amd/entry.js000066400000000000000000000003321450520414700325250ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); exports.bar = bar; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_expected/cjs/000077500000000000000000000000001450520414700310465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_expected/cjs/entry.js000066400000000000000000000002441450520414700325450ustar00rootroot00000000000000'use strict'; const bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); exports.bar = bar; rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_expected/es/000077500000000000000000000000001450520414700306765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_expected/es/entry.js000066400000000000000000000002221450520414700323710ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); export { bar }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_expected/system/000077500000000000000000000000001450520414700316135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/_expected/system/entry.js000066400000000000000000000004151450520414700333120ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const bar = exports('bar', 2); Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/foo.js000066400000000000000000000000251450520414700274450ustar00rootroot00000000000000export const foo = 1;rollup-3.29.4/test/chunking-form/samples/dynamic-import-inlining-object/main.js000066400000000000000000000000521450520414700276060ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/000077500000000000000000000000001450520414700256575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_config.js000066400000000000000000000003061450520414700276200ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly imports dynamic namespaces with only a default export from entry- and non-entry-point chunks', options: { input: ['main', 'entry'] } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/000077500000000000000000000000001450520414700276175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/amd/000077500000000000000000000000001450520414700303605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/amd/entry.js000066400000000000000000000001141450520414700320530ustar00rootroot00000000000000define((function () { 'use strict'; var entry = 42; return entry; })); generated-other.js000066400000000000000000000001531450520414700337130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var other = 42; exports.default = other; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/amd/main.js000066400000000000000000000007021450520414700316410ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } var main = Promise.all([new Promise(function (resolve, reject) { require(['./entry'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }), new Promise(function (resolve, reject) { require(['./generated-other'], resolve, reject); })]); return main; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/cjs/000077500000000000000000000000001450520414700303765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/cjs/entry.js000066400000000000000000000000701450520414700320720ustar00rootroot00000000000000'use strict'; var entry = 42; module.exports = entry; generated-other.js000066400000000000000000000000711450520414700337300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/cjs'use strict'; var other = 42; exports.default = other; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/cjs/main.js000066400000000000000000000005521450520414700316620ustar00rootroot00000000000000'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } var main = Promise.all([Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./entry.js')); }), Promise.resolve().then(function () { return require('./generated-other.js'); })]); module.exports = main; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/es/000077500000000000000000000000001450520414700302265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/es/entry.js000066400000000000000000000000561450520414700317260ustar00rootroot00000000000000var entry = 42; export { entry as default }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/es/generated-other.js000066400000000000000000000000561450520414700336420ustar00rootroot00000000000000var other = 42; export { other as default }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/es/main.js000066400000000000000000000001551450520414700315110ustar00rootroot00000000000000var main = Promise.all([import('./entry.js'), import('./generated-other.js')]); export { main as default }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/system/000077500000000000000000000000001450520414700311435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/system/entry.js000066400000000000000000000002241450520414700326400ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var entry = exports('default', 42); }) }; })); generated-other.js000066400000000000000000000002241450520414700344750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var other = exports('default', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/_expected/system/main.js000066400000000000000000000003521450520414700324250ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var main = exports('default', Promise.all([module.import('./entry.js'), module.import('./generated-other.js')])); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/entry.js000066400000000000000000000000231450520414700273510ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/main.js000066400000000000000000000001121450520414700271330ustar00rootroot00000000000000export default Promise.all([import('./entry.js'), import('./other.js')]); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-default/other.js000066400000000000000000000000231450520414700273310ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/000077500000000000000000000000001450520414700262665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_config.js000066400000000000000000000002471450520414700302330ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles dynamic imports when the imported module only reexports from other modules', options: { input: ['main'] } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/000077500000000000000000000000001450520414700302265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/amd/000077500000000000000000000000001450520414700307675ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001531450520414700346250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/amd/main.js000066400000000000000000000003101450520414700322430ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(({ value }) => console.log(value)); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/cjs/000077500000000000000000000000001450520414700310055ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000000711450520414700346420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/cjs'use strict'; const value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/cjs/main.js000066400000000000000000000002121450520414700322620ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(({ value }) => console.log(value)); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/es/000077500000000000000000000000001450520414700306355ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000000451450520414700344730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/esconst value = 42; export { value }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/es/main.js000066400000000000000000000001121450520414700321110ustar00rootroot00000000000000import('./generated-dynamic.js').then(({ value }) => console.log(value)); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/system/000077500000000000000000000000001450520414700315525ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002241450520414700354070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/_expected/system/main.js000066400000000000000000000003111450520414700330270ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic.js').then(({ value }) => console.log(value)); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/dep.js000066400000000000000000000000311450520414700273660ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/dynamic.js000066400000000000000000000000351450520414700302460ustar00rootroot00000000000000export {value} from './dep'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-only-reexports/main.js000066400000000000000000000000751450520414700275520ustar00rootroot00000000000000import('./dynamic').then(({ value }) => console.log(value)); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/000077500000000000000000000000001450520414700274055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_config.js000066400000000000000000000003311450520414700313440ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles dynamic imports of previously statically imported chunks that are also dynamically imported by other chunks', options: { input: ['main.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/000077500000000000000000000000001450520414700313455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/amd/000077500000000000000000000000001450520414700321065ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000005651450520414700351600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/amddefine(['exports'], (function (exports) { 'use strict'; function foo() { return 'dep2'; } Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); function bar() { return foo(); } var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports.bar = bar; exports.dep1 = dep1; exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/amd/main.js000066400000000000000000000001531450520414700333670ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; console.log(dep1.foo(), dep1.bar()); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/amd/main2.js000066400000000000000000000003511450520414700334510ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dep1'], resolve, reject); }).then(function (n) { return n.dep1; }).then(({ bar }) => console.log(bar())); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/cjs/000077500000000000000000000000001450520414700321245ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000004671450520414700351770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/cjs'use strict'; function foo() { return 'dep2'; } Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); function bar() { return foo(); } var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports.bar = bar; exports.dep1 = dep1; exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/cjs/main.js000066400000000000000000000001401450520414700334010ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); console.log(dep1.foo(), dep1.bar()); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/cjs/main2.js000066400000000000000000000002531450520414700334700ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dep1.js'); }).then(function (n) { return n.dep1; }).then(({ bar }) => console.log(bar())); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/es/000077500000000000000000000000001450520414700317545ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000004271450520414700350230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/esfunction foo() { return 'dep2'; } Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); function bar() { return foo(); } var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); export { bar as b, dep1 as d, foo as f }; rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/es/main.js000066400000000000000000000001261450520414700332350ustar00rootroot00000000000000import { f as foo, b as bar } from './generated-dep1.js'; console.log(foo(), bar()); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/es/main2.js000066400000000000000000000001501450520414700333140ustar00rootroot00000000000000import('./generated-dep1.js').then(function (n) { return n.d; }).then(({ bar }) => console.log(bar())); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/system/000077500000000000000000000000001450520414700326715ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000006751450520414700357450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { exports({ b: bar, f: foo }); function foo() { return 'dep2'; } Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); function bar() { return foo(); } var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports('d', dep1); }) }; })); main.js000066400000000000000000000003641450520414700340770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/systemSystem.register(['./generated-dep1.js'], (function () { 'use strict'; var foo, bar; return { setters: [function (module) { foo = module.f; bar = module.b; }], execute: (function () { console.log(foo(), bar()); }) }; })); main2.js000066400000000000000000000003471450520414700341620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dep1.js').then(function (n) { return n.d; }).then(({ bar }) => console.log(bar())); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/dep1.js000066400000000000000000000001111450520414700305650ustar00rootroot00000000000000import {foo} from './dep2.js'; export function bar() { return foo(); } rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/dep2.js000066400000000000000000000001461450520414700305760ustar00rootroot00000000000000export function foo() { return 'dep2'; } import('./dep1.js').then(({ bar }) => console.log(bar())); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/main.js000066400000000000000000000001361450520414700306670ustar00rootroot00000000000000import { bar } from './dep1.js'; import { foo } from './dep2.js'; console.log(foo(), bar()); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported-2/main2.js000066400000000000000000000000731450520414700307510ustar00rootroot00000000000000import('./dep1.js').then(({ bar }) => console.log(bar())); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/000077500000000000000000000000001450520414700272465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_config.js000066400000000000000000000002301450520414700312030ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles dynamic imports of previously statically imported chunks', options: { input: ['main.js'] } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_expected/000077500000000000000000000000001450520414700312065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_expected/amd/000077500000000000000000000000001450520414700317475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_expected/amd/main.js000066400000000000000000000004771450520414700332410ustar00rootroot00000000000000define((function () { 'use strict'; function foo() { return 'dep2'; } Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); function bar() { return foo(); } var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); console.log(foo(), bar()); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_expected/cjs/000077500000000000000000000000001450520414700317655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_expected/cjs/main.js000066400000000000000000000004271450520414700332520ustar00rootroot00000000000000'use strict'; function foo() { return 'dep2'; } Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); function bar() { return foo(); } var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); console.log(foo(), bar()); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_expected/es/000077500000000000000000000000001450520414700316155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_expected/es/main.js000066400000000000000000000004101450520414700330720ustar00rootroot00000000000000function foo() { return 'dep2'; } Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); function bar() { return foo(); } var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); console.log(foo(), bar()); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_expected/system/000077500000000000000000000000001450520414700325325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/_expected/system/main.js000066400000000000000000000006221450520414700340140ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo() { return 'dep2'; } Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); function bar() { return foo(); } var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); console.log(foo(), bar()); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/dep1.js000066400000000000000000000001111450520414700304260ustar00rootroot00000000000000import {foo} from './dep2.js'; export function bar() { return foo(); } rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/dep2.js000066400000000000000000000001461450520414700304370ustar00rootroot00000000000000export function foo() { return 'dep2'; } import('./dep1.js').then(({ bar }) => console.log(bar())); rollup-3.29.4/test/chunking-form/samples/dynamic-import-statically-imported/main.js000066400000000000000000000001361450520414700305300ustar00rootroot00000000000000import { bar } from './dep1.js'; import { foo } from './dep2.js'; console.log(foo(), bar()); rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/000077500000000000000000000000001450520414700322675ustar00rootroot00000000000000_config.js000066400000000000000000000006461450520414700341600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modulesmodule.exports = defineTest({ description: 'handle dynamically importing a module with synthetic named exports when preserving modules', options: { input: ['main', 'lib'], plugins: { name: 'test-plugin', transform(code, id) { if (id.endsWith('lib.js')) { return { code, syntheticNamedExports: '__moduleExports' }; } } }, output: { exports: 'named', preserveModules: true } } }); _expected/000077500000000000000000000000001450520414700341505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modulesamd/000077500000000000000000000000001450520414700347115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expectedlib.js000066400000000000000000000013621450520414700360170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/amddefine(['exports'], (function (exports) { 'use strict'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } const __moduleExports = { foo: 'bar' }; var lib = 'baz'; var lib$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: lib }, [__moduleExports]); exports.default = lib; exports.lib = lib$1; Object.defineProperty(exports, '__esModule', { value: true }); })); main.js000066400000000000000000000003111450520414700361660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./lib'], resolve, reject); }).then(function (n) { return n.lib; }).then(console.log); })); cjs/000077500000000000000000000000001450520414700347275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expectedlib.js000066400000000000000000000012531450520414700360340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } const __moduleExports = { foo: 'bar' }; var lib = 'baz'; var lib$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: lib }, [__moduleExports]); exports.default = lib; exports.lib = lib$1; main.js000066400000000000000000000002131450520414700362050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./lib.js'); }).then(function (n) { return n.lib; }).then(console.log); es/000077500000000000000000000000001450520414700345575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expectedlib.js000066400000000000000000000011271450520414700356640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/esfunction _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } const __moduleExports = { foo: 'bar' }; var lib = 'baz'; var lib$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: lib }, [__moduleExports]); export { lib as default, lib$1 as l }; main.js000066400000000000000000000001111450520414700360320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/esimport('./lib.js').then(function (n) { return n.l; }).then(console.log); system/000077500000000000000000000000001450520414700354745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expectedlib.js000066400000000000000000000014041450520414700365770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } const __moduleExports = { foo: 'bar' }; var lib = exports('default', 'baz'); var lib$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: lib }, [__moduleExports]); exports('l', lib$1); }) }; })); main.js000066400000000000000000000003101450520414700367500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./lib.js').then(function (n) { return n.l; }).then(console.log); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/lib.js000066400000000000000000000001051450520414700333670ustar00rootroot00000000000000export const __moduleExports = { foo: 'bar' }; export default 'baz'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/main.js000066400000000000000000000000461450520414700335510ustar00rootroot00000000000000import('./lib.js').then(console.log); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/000077500000000000000000000000001450520414700257735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_config.js000066400000000000000000000002601450520414700277330ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses tree-shaking information to improve chunking', options: { input: { entryA: 'main1.js', entryB: 'main2.js' } } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/000077500000000000000000000000001450520414700277335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/amd/000077500000000000000000000000001450520414700304745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/amd/entryA.js000066400000000000000000000001601450520414700322710ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dep'); var value = 1; console.log('main1', value); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/amd/entryB.js000066400000000000000000000001021450520414700322660ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main2'); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/cjs/000077500000000000000000000000001450520414700305125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/cjs/entryA.js000066400000000000000000000001211450520414700323040ustar00rootroot00000000000000'use strict'; console.log('dep'); var value = 1; console.log('main1', value); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/cjs/entryB.js000066400000000000000000000000451450520414700323120ustar00rootroot00000000000000'use strict'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/es/000077500000000000000000000000001450520414700303425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/es/entryA.js000066400000000000000000000001021450520414700321330ustar00rootroot00000000000000console.log('dep'); var value = 1; console.log('main1', value); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/es/entryB.js000066400000000000000000000000261450520414700321410ustar00rootroot00000000000000console.log('main2'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/system/000077500000000000000000000000001450520414700312575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/system/entryA.js000066400000000000000000000002611450520414700330560ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep'); var value = 1; console.log('main1', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/system/entryB.js000066400000000000000000000001771450520414700330650ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/dep.js000066400000000000000000000000531450520414700270770ustar00rootroot00000000000000console.log('dep'); export var value = 1; rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/dep2.js000066400000000000000000000000651450520414700271640ustar00rootroot00000000000000console.log('dep2'); export { value } from './dep'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/main1.js000066400000000000000000000000751450520414700273400ustar00rootroot00000000000000import { value } from './dep'; console.log('main1', value); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-1/main2.js000066400000000000000000000001521450520414700273350ustar00rootroot00000000000000if (false) { import('./dep2').then(({ value }) => console.log('main2', value)); } console.log('main2'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/000077500000000000000000000000001450520414700257745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_config.js000066400000000000000000000002651450520414700277410ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not expose exports of chunks which were used by tree-shaken dynamic imports', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/000077500000000000000000000000001450520414700277345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/amd/000077500000000000000000000000001450520414700304755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/amd/main1.js000066400000000000000000000001021450520414700320310ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main1'); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/amd/main2.js000066400000000000000000000002201450520414700320330ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); console.log('main2', dep); })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/cjs/000077500000000000000000000000001450520414700305135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/cjs/main1.js000066400000000000000000000000451450520414700320550ustar00rootroot00000000000000'use strict'; console.log('main1'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/cjs/main2.js000066400000000000000000000001601450520414700320540ustar00rootroot00000000000000'use strict'; console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); console.log('main2', dep); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/es/000077500000000000000000000000001450520414700303435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/es/main1.js000066400000000000000000000000261450520414700317040ustar00rootroot00000000000000console.log('main1'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/es/main2.js000066400000000000000000000001411450520414700317030ustar00rootroot00000000000000console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); console.log('main2', dep); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/system/000077500000000000000000000000001450520414700312605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/system/main1.js000066400000000000000000000001771450520414700326300ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main1'); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/system/main2.js000066400000000000000000000003231450520414700326220ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); console.log('main2', dep); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/dep.js000066400000000000000000000000561450520414700271030ustar00rootroot00000000000000console.log('dep'); export const dep = 'dep'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/dynamic.js000066400000000000000000000001351450520414700277550ustar00rootroot00000000000000import { dep } from './dep'; console.log('dynamic', dep); export const dynamic = 'dynamic'; rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/main1.js000066400000000000000000000000761450520414700273420ustar00rootroot00000000000000if (false) { import('./dynamic.js'); } console.log('main1'); rollup-3.29.4/test/chunking-form/samples/dynamic-import-tree-shaking-2/main2.js000066400000000000000000000001231450520414700273340ustar00rootroot00000000000000import { dep } from './dep.js'; import './dynamic.js'; console.log('main2', dep); rollup-3.29.4/test/chunking-form/samples/dynamic-import/000077500000000000000000000000001450520414700232565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_config.js000066400000000000000000000003771450520414700252270ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles dynamic imports with a shared dependency', options: { input: ['main'], output: { chunkFileNames: 'chunks/[name].js' } }, runAmd: { exports(exports) { return exports.promise; } } }); rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/000077500000000000000000000000001450520414700252165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/amd/000077500000000000000000000000001450520414700257575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/amd/chunks/000077500000000000000000000000001450520414700272525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/amd/chunks/main.js000066400000000000000000000006021450520414700305320ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const sharedValue = 'shared'; assert.equal(sharedValue, 'shared'); const promise = new Promise(function (resolve, reject) { require(['./other'], resolve, reject); }).then(result => assert.deepEqual(result, { value: 'shared' }) ); exports.promise = promise; exports.sharedValue = sharedValue; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/amd/chunks/other.js000066400000000000000000000001641450520414700307320ustar00rootroot00000000000000define(['exports', './main'], (function (exports, main) { 'use strict'; exports.value = main.sharedValue; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/amd/main.js000066400000000000000000000001711450520414700272400ustar00rootroot00000000000000define(['exports', './chunks/main'], (function (exports, main) { 'use strict'; exports.promise = main.promise; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/cjs/000077500000000000000000000000001450520414700257755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/cjs/chunks/000077500000000000000000000000001450520414700272705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/cjs/chunks/main.js000066400000000000000000000004521450520414700305530ustar00rootroot00000000000000'use strict'; const sharedValue = 'shared'; assert.equal(sharedValue, 'shared'); const promise = Promise.resolve().then(function () { return require('./other.js'); }).then(result => assert.deepEqual(result, { value: 'shared' }) ); exports.promise = promise; exports.sharedValue = sharedValue; rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/cjs/chunks/other.js000066400000000000000000000001251450520414700307450ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); exports.value = main.sharedValue; rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/cjs/main.js000066400000000000000000000001321450520414700272530ustar00rootroot00000000000000'use strict'; var main = require('./chunks/main.js'); exports.promise = main.promise; rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/es/000077500000000000000000000000001450520414700256255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/es/chunks/000077500000000000000000000000001450520414700271205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/es/chunks/main.js000066400000000000000000000003271450520414700304040ustar00rootroot00000000000000const sharedValue = 'shared'; assert.equal(sharedValue, 'shared'); const promise = import('./other.js').then(result => assert.deepEqual(result, { value: 'shared' }) ); export { promise as p, sharedValue as s }; rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/es/chunks/other.js000066400000000000000000000000501450520414700305720ustar00rootroot00000000000000export { s as value } from './main.js'; rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/es/main.js000066400000000000000000000000611450520414700271040ustar00rootroot00000000000000export { p as promise } from './chunks/main.js'; rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/system/000077500000000000000000000000001450520414700265425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/system/chunks/000077500000000000000000000000001450520414700300355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/system/chunks/main.js000066400000000000000000000005221450520414700313160ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const sharedValue = exports('s', 'shared'); assert.equal(sharedValue, 'shared'); const promise = exports('p', module.import('./other.js').then(result => assert.deepEqual(result, { value: 'shared' }) )); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/system/chunks/other.js000066400000000000000000000002761450520414700315210ustar00rootroot00000000000000System.register(['./main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module.s); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import/_expected/system/main.js000066400000000000000000000003071450520414700300240ustar00rootroot00000000000000System.register(['./chunks/main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('promise', module.p); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamic-import/main.js000066400000000000000000000002701450520414700245370ustar00rootroot00000000000000import { sharedValue } from './shared'; assert.equal(sharedValue, 'shared'); export const promise = import('./other').then(result => assert.deepEqual(result, { value: 'shared' }) ); rollup-3.29.4/test/chunking-form/samples/dynamic-import/other.js000066400000000000000000000000611450520414700247320ustar00rootroot00000000000000export { sharedValue as value } from './shared'; rollup-3.29.4/test/chunking-form/samples/dynamic-import/shared.js000066400000000000000000000000451450520414700250610ustar00rootroot00000000000000export const sharedValue = 'shared'; rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/000077500000000000000000000000001450520414700266445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_config.js000066400000000000000000000003061450520414700306050ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses existing entry facades for dynamic imports if present', options: { input: ['main.js', 'importer.js'], preserveEntrySignatures: 'strict' } }); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/000077500000000000000000000000001450520414700306045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/amd/000077500000000000000000000000001450520414700313455ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001521450520414700352020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/amddefine(['./generated-main'], (function (main) { 'use strict'; console.log('dynamic', main.value); })); generated-main.js000066400000000000000000000004761450520414700345130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; var value = 42; const promise = new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(result => console.log('main', result, value)); exports.promise = promise; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/amd/importer.js000066400000000000000000000003031450520414700335400ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./main'], resolve, reject); }).then(result => console.log('importer', result)); })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/amd/main.js000066400000000000000000000001741450520414700326310ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, main) { 'use strict'; exports.promise = main.promise; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/cjs/000077500000000000000000000000001450520414700313635ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001371450520414700352230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/cjs'use strict'; var main = require('./generated-main.js'); console.log('dynamic', main.value); generated-main.js000066400000000000000000000003511450520414700345210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/cjs'use strict'; var value = 42; const promise = Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(result => console.log('main', result, value)); exports.promise = promise; exports.value = value; rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/cjs/importer.js000066400000000000000000000002051450520414700335570ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./main.js'); }).then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/cjs/main.js000066400000000000000000000001351450520414700326440ustar00rootroot00000000000000'use strict'; var main = require('./generated-main.js'); exports.promise = main.promise; rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/es/000077500000000000000000000000001450520414700312135ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001221450520414700350450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/esimport { v as value } from './generated-main.js'; console.log('dynamic', value); generated-main.js000066400000000000000000000002341450520414700343510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/esvar value = 42; const promise = import('./generated-dynamic.js').then(result => console.log('main', result, value)); export { promise as p, value as v }; rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/es/importer.js000066400000000000000000000001051450520414700334060ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/es/main.js000066400000000000000000000000641450520414700324750ustar00rootroot00000000000000export { p as promise } from './generated-main.js'; rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/system/000077500000000000000000000000001450520414700321305ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003441450520414700357700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/systemSystem.register(['./generated-main.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('dynamic', value); }) }; })); generated-main.js000066400000000000000000000004241450520414700352670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var value = exports('v', 42); const promise = exports('p', module.import('./generated-dynamic.js').then(result => console.log('main', result, value))); }) }; })); importer.js000066400000000000000000000003041450520414700342450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./main.js').then(result => console.log('importer', result)); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/system/main.js000066400000000000000000000003121450520414700334060ustar00rootroot00000000000000System.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('promise', module.p); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/dep.js000066400000000000000000000000231450520414700277450ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/dynamic.js000066400000000000000000000000761450520414700306310ustar00rootroot00000000000000import value from './dep.js'; console.log('dynamic', value); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/importer.js000066400000000000000000000001051450520414700310370ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-facaded-entry/main.js000066400000000000000000000001761450520414700301320ustar00rootroot00000000000000import value from './dep.js'; export const promise = import('./dynamic').then(result => console.log('main', result, value)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/000077500000000000000000000000001450520414700300645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_config.js000066400000000000000000000003071450520414700320260ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports dynamically importing entries with additional exports', options: { input: ['main.js', 'importer.js'], preserveEntrySignatures: false } }); rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/000077500000000000000000000000001450520414700320245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/amd/000077500000000000000000000000001450520414700325655ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001401450520414700364170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/amddefine(['./main'], (function (main) { 'use strict'; console.log('dynamic', main.value); })); importer.js000066400000000000000000000003511450520414700347040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./main'], resolve, reject); }).then(function (n) { return n.main; }).then(result => console.log('importer', result)); })); main.js000066400000000000000000000006151450520414700337720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; var value = 42; const promise = new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(result => console.log('main', result, value)); var main = /*#__PURE__*/Object.freeze({ __proto__: null, promise: promise }); exports.main = main; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/cjs/000077500000000000000000000000001450520414700326035ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001251450520414700364400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/cjs'use strict'; var main = require('./main.js'); console.log('dynamic', main.value); importer.js000066400000000000000000000002531450520414700347230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./main.js'); }).then(function (n) { return n.main; }).then(result => console.log('importer', result)); main.js000066400000000000000000000004641450520414700340120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/cjs'use strict'; var value = 42; const promise = Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(result => console.log('main', result, value)); var main = /*#__PURE__*/Object.freeze({ __proto__: null, promise: promise }); exports.main = main; exports.value = value; rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/es/000077500000000000000000000000001450520414700324335ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001101450520414700362620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/esimport { v as value } from './main.js'; console.log('dynamic', value); importer.js000066400000000000000000000001501450520414700345470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/esimport('./main.js').then(function (n) { return n.m; }).then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/es/main.js000066400000000000000000000003521450520414700337150ustar00rootroot00000000000000var value = 42; const promise = import('./generated-dynamic.js').then(result => console.log('main', result, value)); var main = /*#__PURE__*/Object.freeze({ __proto__: null, promise: promise }); export { main as m, value as v }; rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/system/000077500000000000000000000000001450520414700333505ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003321450520414700372050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('dynamic', value); }) }; })); importer.js000066400000000000000000000003471450520414700354740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./main.js').then(function (n) { return n.m; }).then(result => console.log('importer', result)); }) }; })); main.js000066400000000000000000000005721450520414700345570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var value = exports('v', 42); const promise = module.import('./generated-dynamic.js').then(result => console.log('main', result, value)); var main = /*#__PURE__*/Object.freeze({ __proto__: null, promise: promise }); exports('m', main); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/dep.js000066400000000000000000000000231450520414700311650ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/dynamic.js000066400000000000000000000000761450520414700320510ustar00rootroot00000000000000import value from './dep.js'; console.log('dynamic', value); rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/importer.js000066400000000000000000000001051450520414700322570ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-non-preserved-entry/main.js000066400000000000000000000001761450520414700313520ustar00rootroot00000000000000import value from './dep.js'; export const promise = import('./dynamic').then(result => console.log('main', result, value)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/000077500000000000000000000000001450520414700267255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_config.js000066400000000000000000000003231450520414700306650ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports dynamically importing entries with additional exports', options: { input: ['main.js', 'importer.js'], preserveEntrySignatures: 'allow-extension' } }); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/000077500000000000000000000000001450520414700306655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/amd/000077500000000000000000000000001450520414700314265ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001401450520414700352600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/amddefine(['./main'], (function (main) { 'use strict'; console.log('dynamic', main.value); })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/amd/importer.js000066400000000000000000000003511450520414700336240ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./main'], resolve, reject); }).then(function (n) { return n.main; }).then(result => console.log('importer', result)); })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/amd/main.js000066400000000000000000000006511450520414700327120ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; var value = 42; const promise = new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(result => console.log('main', result, value)); var main = /*#__PURE__*/Object.freeze({ __proto__: null, promise: promise }); exports.main = main; exports.promise = promise; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/cjs/000077500000000000000000000000001450520414700314445ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001251450520414700353010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/cjs'use strict'; var main = require('./main.js'); console.log('dynamic', main.value); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/cjs/importer.js000066400000000000000000000002531450520414700336430ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./main.js'); }).then(function (n) { return n.main; }).then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/cjs/main.js000066400000000000000000000005171450520414700327310ustar00rootroot00000000000000'use strict'; var value = 42; const promise = Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(result => console.log('main', result, value)); var main = /*#__PURE__*/Object.freeze({ __proto__: null, promise: promise }); exports.main = main; exports.promise = promise; exports.value = value; rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/es/000077500000000000000000000000001450520414700312745ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001101450520414700351230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/esimport { v as value } from './main.js'; console.log('dynamic', value); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/es/importer.js000066400000000000000000000001501450520414700334670ustar00rootroot00000000000000import('./main.js').then(function (n) { return n.m; }).then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/es/main.js000066400000000000000000000003631450520414700325600ustar00rootroot00000000000000var value = 42; const promise = import('./generated-dynamic.js').then(result => console.log('main', result, value)); var main = /*#__PURE__*/Object.freeze({ __proto__: null, promise: promise }); export { main as m, promise, value as v }; rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/system/000077500000000000000000000000001450520414700322115ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003321450520414700360460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('dynamic', value); }) }; })); importer.js000066400000000000000000000003471450520414700343350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./main.js').then(function (n) { return n.m; }).then(result => console.log('importer', result)); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/system/main.js000066400000000000000000000006161450520414700334760ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var value = exports('v', 42); const promise = exports('promise', module.import('./generated-dynamic.js').then(result => console.log('main', result, value))); var main = /*#__PURE__*/Object.freeze({ __proto__: null, promise: promise }); exports('m', main); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/dep.js000066400000000000000000000000231450520414700300260ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/dynamic.js000066400000000000000000000000761450520414700307120ustar00rootroot00000000000000import value from './dep.js'; console.log('dynamic', value); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/importer.js000066400000000000000000000001051450520414700311200ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-tainted-entry/main.js000066400000000000000000000001761450520414700302130ustar00rootroot00000000000000import value from './dep.js'; export const promise = import('./dynamic').then(result => console.log('main', result, value)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/000077500000000000000000000000001450520414700272705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_config.js000066400000000000000000000003261450520414700312330ustar00rootroot00000000000000module.exports = defineTest({ description: 'makes existing entries a proper facade if possible when importing dynamically', options: { input: ['main.js', 'importer.js'], preserveEntrySignatures: false } }); rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/000077500000000000000000000000001450520414700312305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/amd/000077500000000000000000000000001450520414700317715ustar00rootroot00000000000000importer.js000066400000000000000000000005521450520414700341130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/amddefine(['require'], (function (require) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } new Promise(function (resolve, reject) { require(['./main'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(result => console.log('importer', result)); })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/amd/main.js000066400000000000000000000001121450520414700332450ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/cjs/000077500000000000000000000000001450520414700320075ustar00rootroot00000000000000importer.js000066400000000000000000000004261450520414700341310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/cjs'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./main.js')); }).then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/cjs/main.js000066400000000000000000000000661450520414700332730ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/es/000077500000000000000000000000001450520414700316375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/es/importer.js000066400000000000000000000001051450520414700340320ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/es/main.js000066400000000000000000000000541450520414700331200ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/system/000077500000000000000000000000001450520414700325545ustar00rootroot00000000000000importer.js000066400000000000000000000003041450520414700346710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./main.js').then(result => console.log('importer', result)); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/system/main.js000066400000000000000000000002231450520414700340330ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/importer.js000066400000000000000000000001051450520414700314630ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-3.29.4/test/chunking-form/samples/dynamically-import-untainted-entry/main.js000066400000000000000000000000231450520414700305450ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/emit-file/000077500000000000000000000000001450520414700221755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/000077500000000000000000000000001450520414700253325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_config.js000066400000000000000000000005031450520414700272720ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports custom asset file names', options: { input: ['main.js'], plugins: { transform() { this.emitFile({ type: 'asset', name: 'test.txt', source: 'hello world' }); return null; } }, output: { assetFileNames: '[ext]/[hash]-[name][extname]' } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/000077500000000000000000000000001450520414700272725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/000077500000000000000000000000001450520414700300335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/main.js000066400000000000000000000001011450520414700313050ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/txt/000077500000000000000000000000001450520414700306525ustar00rootroot00000000000000b94d27b9-test.txt000066400000000000000000000000131450520414700334510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/txthello worldrollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/000077500000000000000000000000001450520414700300515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/main.js000066400000000000000000000000441450520414700313310ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/txt/000077500000000000000000000000001450520414700306705ustar00rootroot00000000000000b94d27b9-test.txt000066400000000000000000000000131450520414700334670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/txthello worldrollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/000077500000000000000000000000001450520414700277015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/main.js000066400000000000000000000000251450520414700311600ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/txt/000077500000000000000000000000001450520414700305205ustar00rootroot00000000000000b94d27b9-test.txt000066400000000000000000000000131450520414700333170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/txthello worldrollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/000077500000000000000000000000001450520414700306165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/main.js000066400000000000000000000001761450520414700321040ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/txt/000077500000000000000000000000001450520414700314355ustar00rootroot00000000000000b94d27b9-test.txt000066400000000000000000000000131450520414700342340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/txthello worldrollup-3.29.4/test/chunking-form/samples/emit-file/asset-file-names/main.js000066400000000000000000000000251450520414700266110ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/000077500000000000000000000000001450520414700301155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_config.js000066400000000000000000000016371450520414700320660ustar00rootroot00000000000000const { loader } = require('../../../../utils.js'); module.exports = defineTest({ description: 'deconflicts files against named files', options: { input: 'main', output: { assetFileNames: '[name].js', chunkFileNames: '[name].js' }, plugins: [ loader({ emitted1: 'console.log(1);', emitted2: 'console.log(2);', emitted3: 'console.log(3);' }), { buildStart() { this.emitFile({ type: 'chunk', id: 'emitted1', name: 'myfile' }); this.emitFile({ type: 'chunk', id: 'emitted2', fileName: 'myfile.js' }); this.emitFile({ type: 'chunk', id: 'emitted3', name: 'myfile' }); this.emitFile({ type: 'asset', name: 'myfile.js', source: 'text1' }); }, renderStart() { this.emitFile({ type: 'asset', name: 'myfile.js', source: 'text2' }); } } ] } }); rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/000077500000000000000000000000001450520414700320555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amd/000077500000000000000000000000001450520414700326165ustar00rootroot00000000000000main.js000066400000000000000000000001011450520414700340110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amddefine((function () { 'use strict'; console.log('main'); })); myfile.js000066400000000000000000000000741450520414700343630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amddefine((function () { 'use strict'; console.log(2); })); myfile2.js000066400000000000000000000000051450520414700344370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amdtext1myfile3.js000066400000000000000000000000051450520414700344400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amdtext2myfile4.js000066400000000000000000000000741450520414700344470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amddefine((function () { 'use strict'; console.log(1); })); myfile5.js000066400000000000000000000000741450520414700344500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amddefine((function () { 'use strict'; console.log(3); })); rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs/000077500000000000000000000000001450520414700326345ustar00rootroot00000000000000main.js000066400000000000000000000000441450520414700340350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs'use strict'; console.log('main'); myfile.js000066400000000000000000000000371450520414700344000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs'use strict'; console.log(2); myfile2.js000066400000000000000000000000051450520414700344550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjstext1myfile3.js000066400000000000000000000000051450520414700344560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjstext2myfile4.js000066400000000000000000000000371450520414700344640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs'use strict'; console.log(1); myfile5.js000066400000000000000000000000371450520414700344650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs'use strict'; console.log(3); rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/es/000077500000000000000000000000001450520414700324645ustar00rootroot00000000000000main.js000066400000000000000000000000251450520414700336640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/esconsole.log('main'); myfile.js000066400000000000000000000000201450520414700342200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/esconsole.log(2); myfile2.js000066400000000000000000000000051450520414700343050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/estext1myfile3.js000066400000000000000000000000051450520414700343060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/estext2myfile4.js000066400000000000000000000000201450520414700343040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/esconsole.log(1); myfile5.js000066400000000000000000000000201450520414700343050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/esconsole.log(3); rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/system/000077500000000000000000000000001450520414700334015ustar00rootroot00000000000000main.js000066400000000000000000000001761450520414700346100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); myfile.js000066400000000000000000000001711450520414700351440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log(2); }) }; })); myfile2.js000066400000000000000000000000051450520414700352220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemtext1myfile3.js000066400000000000000000000000051450520414700352230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemtext2myfile4.js000066400000000000000000000001711450520414700352300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log(1); }) }; })); myfile5.js000066400000000000000000000001711450520414700352310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log(3); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/deconflict-against-named-files/main.js000066400000000000000000000000251450520414700313740ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/000077500000000000000000000000001450520414700257605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_config.js000066400000000000000000000060521450520414700277250ustar00rootroot00000000000000const assert = require('node:assert'); let string1Id, string2Id, stringSameSourceId, sameStringAsBufferId, otherStringId, bufferId, bufferSameSourceId, sameBufferAsStringId, otherBufferId; module.exports = defineTest({ description: 'deduplicates asset that have the same source', options: { input: ['main.js'], plugins: { buildStart() { // emit 'string' source in a random order stringSameSourceId = this.emitFile({ type: 'asset', name: 'stringSameSource.txt', source: 'string' }); string2Id = this.emitFile({ type: 'asset', name: 'string2.txt', source: 'string' }); string1Id = this.emitFile({ type: 'asset', name: 'string1.txt', source: 'string' }); sameStringAsBufferId = this.emitFile({ type: 'asset', name: 'sameStringAsBuffer.txt', source: Buffer.from('string') // Test cross Buffer/string deduplication }); // Different string source otherStringId = this.emitFile({ type: 'asset', name: 'otherString.txt', source: 'otherString' }); const bufferSource = () => Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); bufferId = this.emitFile({ type: 'asset', name: 'buffer.txt', source: bufferSource() }); bufferSameSourceId = this.emitFile({ type: 'asset', name: 'bufferSameSource.txt', source: bufferSource() }); sameBufferAsStringId = this.emitFile({ type: 'asset', name: 'sameBufferAsString.txt', source: bufferSource().toString() // Test cross Buffer/string deduplication }); // Different buffer source otherBufferId = this.emitFile({ type: 'asset', name: 'otherBuffer.txt', source: Buffer.from('otherBuffer') }); // specific file names will not be deduplicated this.emitFile({ type: 'asset', fileName: 'named/string.txt', source: 'named' }); this.emitFile({ type: 'asset', fileName: 'named/buffer.txt', source: bufferSource() }); return null; }, generateBundle() { assert.strictEqual(this.getFileName(string1Id), 'assets/string1-473287f8.txt', 'string1'); assert.strictEqual(this.getFileName(string2Id), 'assets/string1-473287f8.txt', 'string2'); assert.strictEqual( this.getFileName(stringSameSourceId), 'assets/string1-473287f8.txt', 'stringSameSource' ); assert.strictEqual( this.getFileName(sameStringAsBufferId), 'assets/string1-473287f8.txt', 'sameStringAsBuffer' ); assert.strictEqual( this.getFileName(otherStringId), 'assets/otherString-e296c1ca.txt', 'otherString' ); assert.strictEqual(this.getFileName(bufferId), 'assets/buffer-d0ca8c2a.txt', 'buffer'); assert.strictEqual( this.getFileName(bufferSameSourceId), 'assets/buffer-d0ca8c2a.txt', 'bufferSameSource' ); assert.strictEqual( this.getFileName(sameBufferAsStringId), 'assets/buffer-d0ca8c2a.txt', 'sameBufferAsString' ); assert.strictEqual( this.getFileName(otherBufferId), 'assets/otherBuffer-e8d9b528.txt', 'otherBuffer' ); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/000077500000000000000000000000001450520414700277205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/000077500000000000000000000000001450520414700304615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/000077500000000000000000000000001450520414700317635ustar00rootroot00000000000000buffer-d0ca8c2a.txt000066400000000000000000000000061450520414700351750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assetsbufferotherBuffer-e8d9b528.txt000066400000000000000000000000131450520414700360620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assetsotherBufferotherString-e296c1ca.txt000066400000000000000000000000131450520414700361620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assetsotherStringstring1-473287f8.txt000066400000000000000000000000061450520414700350420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assetsstringrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/main.js000066400000000000000000000001011450520414700317330ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/named/000077500000000000000000000000001450520414700315455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/named/buffer.txt000066400000000000000000000000061450520414700335530ustar00rootroot00000000000000bufferrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/named/string.txt000066400000000000000000000000051450520414700336070ustar00rootroot00000000000000namedrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/000077500000000000000000000000001450520414700304775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/000077500000000000000000000000001450520414700320015ustar00rootroot00000000000000buffer-d0ca8c2a.txt000066400000000000000000000000061450520414700352130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assetsbufferotherBuffer-e8d9b528.txt000066400000000000000000000000131450520414700361000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assetsotherBufferotherString-e296c1ca.txt000066400000000000000000000000131450520414700362000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assetsotherStringstring1-473287f8.txt000066400000000000000000000000061450520414700350600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assetsstringrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/main.js000066400000000000000000000000441450520414700317570ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/named/000077500000000000000000000000001450520414700315635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/named/buffer.txt000066400000000000000000000000061450520414700335710ustar00rootroot00000000000000bufferrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/named/string.txt000066400000000000000000000000051450520414700336250ustar00rootroot00000000000000namedrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/000077500000000000000000000000001450520414700303275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/000077500000000000000000000000001450520414700316315ustar00rootroot00000000000000buffer-d0ca8c2a.txt000066400000000000000000000000061450520414700350430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assetsbufferotherBuffer-e8d9b528.txt000066400000000000000000000000131450520414700357300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assetsotherBufferotherString-e296c1ca.txt000066400000000000000000000000131450520414700360300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assetsotherStringstring1-473287f8.txt000066400000000000000000000000061450520414700347100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assetsstringrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/main.js000066400000000000000000000000251450520414700316060ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/named/000077500000000000000000000000001450520414700314135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/named/buffer.txt000066400000000000000000000000061450520414700334210ustar00rootroot00000000000000bufferrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/named/string.txt000066400000000000000000000000051450520414700334550ustar00rootroot00000000000000namedrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/000077500000000000000000000000001450520414700312445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/000077500000000000000000000000001450520414700325465ustar00rootroot00000000000000buffer-d0ca8c2a.txt000066400000000000000000000000061450520414700357600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assetsbufferotherBuffer-e8d9b528.txt000066400000000000000000000000131450520414700366450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assetsotherBufferotherString-e296c1ca.txt000066400000000000000000000000131450520414700367450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assetsotherStringstring1-473287f8.txt000066400000000000000000000000061450520414700356250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assetsstringrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/main.js000066400000000000000000000001761450520414700325320ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/named/000077500000000000000000000000001450520414700323305ustar00rootroot00000000000000buffer.txt000066400000000000000000000000061450520414700342570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/namedbufferstring.txt000066400000000000000000000000051450520414700343130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/namednamedrollup-3.29.4/test/chunking-form/samples/emit-file/deduplicate-assets/main.js000066400000000000000000000000251450520414700272370ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/000077500000000000000000000000001450520414700266675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_config.js000066400000000000000000000003471450520414700306350ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports emitting an asset without a name', options: { input: ['main.js'], plugins: { buildStart() { this.emitFile({ type: 'asset', source: 'hello world' }); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/000077500000000000000000000000001450520414700306275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/000077500000000000000000000000001450520414700313705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/assets/000077500000000000000000000000001450520414700326725ustar00rootroot00000000000000asset-b94d27b9000066400000000000000000000000131450520414700350130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/assetshello worldrollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/main.js000066400000000000000000000001011450520414700326420ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/000077500000000000000000000000001450520414700314065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/assets/000077500000000000000000000000001450520414700327105ustar00rootroot00000000000000asset-b94d27b9000066400000000000000000000000131450520414700350310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/assetshello worldrollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/main.js000066400000000000000000000000441450520414700326660ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/000077500000000000000000000000001450520414700312365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/assets/000077500000000000000000000000001450520414700325405ustar00rootroot00000000000000asset-b94d27b9000066400000000000000000000000131450520414700346610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/assetshello worldrollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/main.js000066400000000000000000000000251450520414700325150ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/000077500000000000000000000000001450520414700321535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/assets/000077500000000000000000000000001450520414700334555ustar00rootroot00000000000000asset-b94d27b9000066400000000000000000000000131450520414700355760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/assetshello worldrollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/main.js000066400000000000000000000001761450520414700334410ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-asset-without-name/main.js000066400000000000000000000000251450520414700301460ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/000077500000000000000000000000001450520414700254425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_config.js000066400000000000000000000007751450520414700274150ustar00rootroot00000000000000const assert = require('node:assert'); let referenceId; module.exports = defineTest({ description: 'retrieves the correct name of an emitted chunk in case a facade is created', options: { input: 'main', output: { manualChunks: { 'build-starter': ['buildStart'] } }, plugins: { buildStart() { referenceId = this.emitFile({ type: 'chunk', id: 'buildStart' }); }, renderChunk() { assert.strictEqual(this.getFileName(referenceId), 'generated-buildStart.js'); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/000077500000000000000000000000001450520414700274025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/amd/000077500000000000000000000000001450520414700301435ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003111450520414700351320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; const otherValue = 43; console.log('startBuild', value); exports.otherValue = otherValue; exports.value = value; })); generated-buildStart.js000066400000000000000000000002331450520414700344710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/amddefine(['exports', './generated-build-starter'], (function (exports, buildStarter) { 'use strict'; exports.buildStartValue = buildStarter.value; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/amd/main.js000066400000000000000000000002311450520414700314210ustar00rootroot00000000000000define(['./generated-build-starter'], (function (buildStarter) { 'use strict'; console.log('main', buildStarter.value, buildStarter.otherValue); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/cjs/000077500000000000000000000000001450520414700301615ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000002241450520414700351530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/cjs'use strict'; const value = 42; const otherValue = 43; console.log('startBuild', value); exports.otherValue = otherValue; exports.value = value; generated-buildStart.js000066400000000000000000000001741450520414700345130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/cjs'use strict'; var buildStarter = require('./generated-build-starter.js'); exports.buildStartValue = buildStarter.value; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/cjs/main.js000066400000000000000000000002161450520414700314420ustar00rootroot00000000000000'use strict'; var buildStarter = require('./generated-build-starter.js'); console.log('main', buildStarter.value, buildStarter.otherValue); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/es/000077500000000000000000000000001450520414700300115ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000001651450520414700350070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/esconst value = 42; const otherValue = 43; console.log('startBuild', value); export { otherValue as o, value as v }; generated-buildStart.js000066400000000000000000000001051450520414700343350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/esexport { v as buildStartValue } from './generated-build-starter.js'; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/es/main.js000066400000000000000000000001651450520414700312750ustar00rootroot00000000000000import { v as value, o as otherValue } from './generated-build-starter.js'; console.log('main', value, otherValue); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/system/000077500000000000000000000000001450520414700307265ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003361450520414700357240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('v', 42); const otherValue = exports('o', 43); console.log('startBuild', value); }) }; })); generated-buildStart.js000066400000000000000000000003331450520414700352550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/systemSystem.register(['./generated-build-starter.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('buildStartValue', module.v); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/system/main.js000066400000000000000000000004341450520414700322110ustar00rootroot00000000000000System.register(['./generated-build-starter.js'], (function () { 'use strict'; var value, otherValue; return { setters: [function (module) { value = module.v; otherValue = module.o; }], execute: (function () { console.log('main', value, otherValue); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/buildStart.js000066400000000000000000000001511450520414700301120ustar00rootroot00000000000000import {value} from './dep.js'; console.log('startBuild', value); export { value as buildStartValue }; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/dep.js000066400000000000000000000000671450520414700265530ustar00rootroot00000000000000export const value = 42; export const otherValue = 43; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-facade/main.js000066400000000000000000000001241450520414700267210ustar00rootroot00000000000000import { value, otherValue } from './dep'; console.log('main', value, otherValue); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/000077500000000000000000000000001450520414700260175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_config.js000066400000000000000000000012211450520414700277550ustar00rootroot00000000000000const assert = require('node:assert'); let referenceId; module.exports = defineTest({ description: 'supports specifying a file name when emitting a chunk', options: { input: 'main', plugins: { buildStart() { referenceId = this.emitFile({ type: 'chunk', id: 'buildStart', fileName: 'custom/build-start-chunk.js' }); }, renderChunk() { assert.strictEqual(this.getFileName(referenceId), 'custom/build-start-chunk.js'); }, generateBundle(options, bundle) { assert.deepStrictEqual( Object.keys(bundle).map(key => bundle[key].name), ['build-start-chunk', 'main', 'buildStart'] ); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/000077500000000000000000000000001450520414700277575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/amd/000077500000000000000000000000001450520414700305205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/amd/custom/000077500000000000000000000000001450520414700320325ustar00rootroot00000000000000build-start-chunk.js000066400000000000000000000002051450520414700356460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/amd/customdefine(['exports', '../generated-buildStart'], (function (exports, buildStart) { 'use strict'; exports.id = buildStart.id; })); generated-buildStart.js000066400000000000000000000002571450520414700350540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var value = 42; const id = 'startBuild'; console.log(id, value); exports.id = id; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/amd/main.js000066400000000000000000000002271450520414700320030ustar00rootroot00000000000000define(['./generated-buildStart'], (function (buildStart) { 'use strict'; console.log(buildStart.id); console.log('main', buildStart.value); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/cjs/000077500000000000000000000000001450520414700305365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/cjs/custom/000077500000000000000000000000001450520414700320505ustar00rootroot00000000000000build-start-chunk.js000066400000000000000000000001461450520414700356700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/cjs/custom'use strict'; var buildStart = require('../generated-buildStart.js'); exports.id = buildStart.id; generated-buildStart.js000066400000000000000000000001721450520414700350660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/cjs'use strict'; var value = 42; const id = 'startBuild'; console.log(id, value); exports.id = id; exports.value = value; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/cjs/main.js000066400000000000000000000002131450520414700320140ustar00rootroot00000000000000'use strict'; var buildStart = require('./generated-buildStart.js'); console.log(buildStart.id); console.log('main', buildStart.value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/es/000077500000000000000000000000001450520414700303665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/es/custom/000077500000000000000000000000001450520414700317005ustar00rootroot00000000000000build-start-chunk.js000066400000000000000000000000661450520414700355210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/es/customexport { i as id } from '../generated-buildStart.js'; generated-buildStart.js000066400000000000000000000001431450520414700347140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/esvar value = 42; const id = 'startBuild'; console.log(id, value); export { id as i, value as v }; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/es/main.js000066400000000000000000000001601450520414700316450ustar00rootroot00000000000000import { i as id, v as value } from './generated-buildStart.js'; console.log(id); console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/system/000077500000000000000000000000001450520414700313035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/system/custom/000077500000000000000000000000001450520414700326155ustar00rootroot00000000000000build-start-chunk.js000066400000000000000000000003141450520414700364320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/system/customSystem.register(['../generated-buildStart.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('id', module.i); }], execute: (function () { }) }; })); generated-buildStart.js000066400000000000000000000003241450520414700356320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('v', 42); const id = exports('i', 'startBuild'); console.log(id, value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/system/main.js000066400000000000000000000004221450520414700325630ustar00rootroot00000000000000System.register(['./generated-buildStart.js'], (function () { 'use strict'; var id, value; return { setters: [function (module) { id = module.i; value = module.v; }], execute: (function () { console.log(id); console.log('main', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/buildStart.js000066400000000000000000000001261450520414700304710ustar00rootroot00000000000000import value from './dep.js'; export const id = 'startBuild'; console.log(id, value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/dep.js000066400000000000000000000000231450520414700271200ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/dep2.js000066400000000000000000000000701450520414700272040ustar00rootroot00000000000000import { id } from './buildStart.js'; console.log(id); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-filename/main.js000066400000000000000000000001161450520414700272770ustar00rootroot00000000000000import value from './dep.js'; import './dep2.js'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/000077500000000000000000000000001450520414700267565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_config.js000066400000000000000000000021151450520414700307170ustar00rootroot00000000000000module.exports = defineTest({ description: 'deduplicates named chunks emitted more than once', options: { // For the second entry, a facade is created input: { mainChunk: 'main', other: 'main' }, plugins: { buildStart() { // The chunk is only emitted once this.emitFile({ type: 'chunk', id: 'dep1', name: 'name' }); this.emitFile({ type: 'chunk', id: 'dep1', name: 'name' }); // One of the suggested names is picked this.emitFile({ type: 'chunk', id: 'dep2', name: 'firstName' }); this.emitFile({ type: 'chunk', id: 'dep2', name: 'secondName' }); // Chunks with the same name are deduplicated this.emitFile({ type: 'chunk', id: 'dep3', name: 'name' }); // Names for user defined chunks are not overridden this.emitFile({ type: 'chunk', id: 'main', name: 'ignored' }); }, load(id) { if (id.endsWith('main.js')) { this.emitFile({ type: 'chunk', id: 'dep1', name: 'name' }); this.emitFile({ type: 'chunk', id: 'dep2', name: 'thirdName' }); this.emitFile({ type: 'chunk', id: 'main', name: 'ignored' }); } } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/000077500000000000000000000000001450520414700307165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amd/000077500000000000000000000000001450520414700314575ustar00rootroot00000000000000generated-firstName.js000066400000000000000000000001161450520414700356200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amddefine((function () { 'use strict'; var value2 = 43; return value2; })); generated-name.js000066400000000000000000000001161450520414700346100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amddefine((function () { 'use strict'; var value1 = 42; return value1; })); generated-name2.js000066400000000000000000000001161450520414700346720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amddefine((function () { 'use strict'; var value3 = 44; return value3; })); mainChunk.js000066400000000000000000000002651450520414700336560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amddefine(['./generated-name', './generated-firstName', './generated-name2'], (function (name, firstName, name$1) { 'use strict'; console.log('main', name, firstName, name$1); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amd/other.js000066400000000000000000000002411450520414700331330ustar00rootroot00000000000000define(['./generated-name', './generated-firstName', './generated-name2', './mainChunk'], (function (name, firstName, name$1, mainChunk) { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs/000077500000000000000000000000001450520414700314755ustar00rootroot00000000000000generated-firstName.js000066400000000000000000000000721450520414700356370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs'use strict'; var value2 = 43; module.exports = value2; generated-name.js000066400000000000000000000000721450520414700346270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs'use strict'; var value1 = 42; module.exports = value1; generated-name2.js000066400000000000000000000000721450520414700347110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs'use strict'; var value3 = 44; module.exports = value3; mainChunk.js000066400000000000000000000003141450520414700336670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs'use strict'; var name = require('./generated-name.js'); var firstName = require('./generated-firstName.js'); var name$1 = require('./generated-name2.js'); console.log('main', name, firstName, name$1); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs/other.js000066400000000000000000000002211450520414700331470ustar00rootroot00000000000000'use strict'; require('./generated-name.js'); require('./generated-firstName.js'); require('./generated-name2.js'); require('./mainChunk.js'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/es/000077500000000000000000000000001450520414700313255ustar00rootroot00000000000000generated-firstName.js000066400000000000000000000000601450520414700354640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/esvar value2 = 43; export { value2 as default }; generated-name.js000066400000000000000000000000601450520414700344540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/esvar value1 = 42; export { value1 as default }; generated-name2.js000066400000000000000000000000601450520414700345360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/esvar value3 = 44; export { value3 as default }; mainChunk.js000066400000000000000000000002621450520414700335210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/esimport value1 from './generated-name.js'; import value2 from './generated-firstName.js'; import value3 from './generated-name2.js'; console.log('main', value1, value2, value3); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/es/other.js000066400000000000000000000001711450520414700330030ustar00rootroot00000000000000import './generated-name.js'; import './generated-firstName.js'; import './generated-name2.js'; import './mainChunk.js'; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/system/000077500000000000000000000000001450520414700322425ustar00rootroot00000000000000generated-firstName.js000066400000000000000000000002251450520414700364040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value2 = exports('default', 43); }) }; })); generated-name.js000066400000000000000000000002251450520414700353740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value1 = exports('default', 42); }) }; })); generated-name2.js000066400000000000000000000002251450520414700354560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value3 = exports('default', 44); }) }; })); mainChunk.js000066400000000000000000000006501450520414700344370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/systemSystem.register(['./generated-name.js', './generated-firstName.js', './generated-name2.js'], (function () { 'use strict'; var value1, value2, value3; return { setters: [function (module) { value1 = module.default; }, function (module) { value2 = module.default; }, function (module) { value3 = module.default; }], execute: (function () { console.log('main', value1, value2, value3); }) }; })); other.js000066400000000000000000000003471450520414700336460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/systemSystem.register(['./generated-name.js', './generated-firstName.js', './generated-name2.js', './mainChunk.js'], (function () { 'use strict'; return { setters: [null, null, null, null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/dep1.js000066400000000000000000000000231450520414700301400ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/dep2.js000066400000000000000000000000231450520414700301410ustar00rootroot00000000000000export default 43; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/dep3.js000066400000000000000000000000231450520414700301420ustar00rootroot00000000000000export default 44; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/main.js000066400000000000000000000002161450520414700302370ustar00rootroot00000000000000import value1 from './dep1.js'; import value2 from './dep2.js'; import value3 from './dep3.js'; console.log('main', value1, value2, value3); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/000077500000000000000000000000001450520414700253235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_config.js000066400000000000000000000006401450520414700272650ustar00rootroot00000000000000const assert = require('node:assert'); let referenceId; module.exports = defineTest({ description: 'allows naming emitted chunks', options: { input: 'main', plugins: { buildStart() { referenceId = this.emitFile({ type: 'chunk', id: 'buildStart', name: 'nested/my-chunk' }); }, renderChunk() { assert.strictEqual(this.getFileName(referenceId), 'generated-nested/my-chunk.js'); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/000077500000000000000000000000001450520414700272635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/amd/000077500000000000000000000000001450520414700300245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/amd/generated-dep.js000066400000000000000000000001511450520414700330630ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/amd/generated-nested/000077500000000000000000000000001450520414700332425ustar00rootroot00000000000000my-chunk.js000066400000000000000000000001531450520414700352530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/amd/generated-nesteddefine(['../generated-dep'], (function (dep) { 'use strict'; console.log('startBuild', dep.value); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/amd/main.js000066400000000000000000000001441450520414700313050ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main', dep.value); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/cjs/000077500000000000000000000000001450520414700300425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/cjs/generated-dep.js000066400000000000000000000000671450520414700331070ustar00rootroot00000000000000'use strict'; var value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/cjs/generated-nested/000077500000000000000000000000001450520414700332605ustar00rootroot00000000000000my-chunk.js000066400000000000000000000001401450520414700352650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/cjs/generated-nested'use strict'; var dep = require('../generated-dep.js'); console.log('startBuild', dep.value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/cjs/main.js000066400000000000000000000001311450520414700313170ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main', dep.value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/es/000077500000000000000000000000001450520414700276725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/es/generated-dep.js000066400000000000000000000000501450520414700327270ustar00rootroot00000000000000var value = 42; export { value as v }; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/es/generated-nested/000077500000000000000000000000001450520414700331105ustar00rootroot00000000000000my-chunk.js000066400000000000000000000001251450520414700351200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/es/generated-nestedimport { v as value } from '../generated-dep.js'; console.log('startBuild', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/es/main.js000066400000000000000000000001161450520414700311520ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/system/000077500000000000000000000000001450520414700306075ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002161450520414700335710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('v', 42); }) }; })); generated-nested/000077500000000000000000000000001450520414700337465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/systemmy-chunk.js000066400000000000000000000003471450520414700360430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/system/generated-nestedSystem.register(['../generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('startBuild', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/system/main.js000066400000000000000000000003401450520414700320660ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/buildStart.js000066400000000000000000000001011450520414700277660ustar00rootroot00000000000000import value from './dep.js'; console.log('startBuild', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/dep.js000066400000000000000000000000231450520414700264240ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-named/main.js000066400000000000000000000000731450520414700266050ustar00rootroot00000000000000import value from './dep.js'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/000077500000000000000000000000001450520414700254335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_config.js000066400000000000000000000013231450520414700273740ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'creates a consistent chunking order (needs to be consistent with the other test of this kind)', options: { input: 'main', plugins: { resolveId(id) { if (id === 'emitted') { return id; } }, load(id) { if (id === 'emitted') { return `import value from './dep.js'; export const id = 'emitted'; console.log(id, value); `; } }, buildStart() { this.emitFile({ type: 'chunk', id: 'emitted' }); }, generateBundle(options, bundle) { assert.deepStrictEqual( Object.keys(bundle).map(key => bundle[key].name), ['main', 'emitted', 'emitted'] ); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/000077500000000000000000000000001450520414700273735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/amd/000077500000000000000000000000001450520414700301345ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000002541450520414700340030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var value = 42; const id = 'emitted'; console.log(id, value); exports.id = id; exports.value = value; })); generated-emitted2.js000066400000000000000000000001731450520414700340650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/amddefine(['exports', './generated-emitted'], (function (exports, emitted) { 'use strict'; exports.id = emitted.id; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/amd/main.js000066400000000000000000000002131450520414700314120ustar00rootroot00000000000000define(['./generated-emitted'], (function (emitted) { 'use strict'; console.log(emitted.id); console.log('main', emitted.value); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/cjs/000077500000000000000000000000001450520414700301525ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000001671450520414700340240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/cjs'use strict'; var value = 42; const id = 'emitted'; console.log(id, value); exports.id = id; exports.value = value; generated-emitted2.js000066400000000000000000000001341450520414700341000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/cjs'use strict'; var emitted = require('./generated-emitted.js'); exports.id = emitted.id; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/cjs/main.js000066400000000000000000000001771450520414700314410ustar00rootroot00000000000000'use strict'; var emitted = require('./generated-emitted.js'); console.log(emitted.id); console.log('main', emitted.value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/es/000077500000000000000000000000001450520414700300025ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000001401450520414700336430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/esvar value = 42; const id = 'emitted'; console.log(id, value); export { id as i, value as v }; generated-emitted2.js000066400000000000000000000000621450520414700337300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/esexport { i as id } from './generated-emitted.js'; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/es/main.js000066400000000000000000000001551450520414700312650ustar00rootroot00000000000000import { i as id, v as value } from './generated-emitted.js'; console.log(id); console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/system/000077500000000000000000000000001450520414700307175ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000003211450520414700345610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('v', 42); const id = exports('i', 'emitted'); console.log(id, value); }) }; })); generated-emitted2.js000066400000000000000000000003101450520414700346410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/systemSystem.register(['./generated-emitted.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('id', module.i); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/system/main.js000066400000000000000000000004171450520414700322030ustar00rootroot00000000000000System.register(['./generated-emitted.js'], (function () { 'use strict'; var id, value; return { setters: [function (module) { id = module.i; value = module.v; }], execute: (function () { console.log(id); console.log('main', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/dep.js000066400000000000000000000000231450520414700265340ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/dep2.js000066400000000000000000000000601450520414700266170ustar00rootroot00000000000000import { id } from 'emitted'; console.log(id); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order1/main.js000066400000000000000000000001161450520414700267130ustar00rootroot00000000000000import value from './dep.js'; import './dep2.js'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/000077500000000000000000000000001450520414700254345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_config.js000066400000000000000000000014651450520414700274040ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'creates a consistent chunking order (needs to be consistent with the other test of this kind)', options: { input: 'main', plugins: { resolveId(id) { if (id === 'emitted') { return id; } }, load(id) { if (id === 'emitted') { return new Promise(resolve => setTimeout( () => resolve(`import value from './dep.js'; export const id = 'emitted'; console.log(id, value); `), 200 ) ); } }, buildStart() { this.emitFile({ type: 'chunk', id: 'emitted' }); }, generateBundle(options, bundle) { assert.deepStrictEqual( Object.keys(bundle).map(key => bundle[key].name), ['main', 'emitted', 'emitted'] ); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/000077500000000000000000000000001450520414700273745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/amd/000077500000000000000000000000001450520414700301355ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000002541450520414700340040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var value = 42; const id = 'emitted'; console.log(id, value); exports.id = id; exports.value = value; })); generated-emitted2.js000066400000000000000000000001731450520414700340660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/amddefine(['exports', './generated-emitted'], (function (exports, emitted) { 'use strict'; exports.id = emitted.id; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/amd/main.js000066400000000000000000000002131450520414700314130ustar00rootroot00000000000000define(['./generated-emitted'], (function (emitted) { 'use strict'; console.log(emitted.id); console.log('main', emitted.value); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/cjs/000077500000000000000000000000001450520414700301535ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000001671450520414700340250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/cjs'use strict'; var value = 42; const id = 'emitted'; console.log(id, value); exports.id = id; exports.value = value; generated-emitted2.js000066400000000000000000000001341450520414700341010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/cjs'use strict'; var emitted = require('./generated-emitted.js'); exports.id = emitted.id; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/cjs/main.js000066400000000000000000000001771450520414700314420ustar00rootroot00000000000000'use strict'; var emitted = require('./generated-emitted.js'); console.log(emitted.id); console.log('main', emitted.value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/es/000077500000000000000000000000001450520414700300035ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000001401450520414700336440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/esvar value = 42; const id = 'emitted'; console.log(id, value); export { id as i, value as v }; generated-emitted2.js000066400000000000000000000000621450520414700337310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/esexport { i as id } from './generated-emitted.js'; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/es/main.js000066400000000000000000000001551450520414700312660ustar00rootroot00000000000000import { i as id, v as value } from './generated-emitted.js'; console.log(id); console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/system/000077500000000000000000000000001450520414700307205ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000003211450520414700345620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('v', 42); const id = exports('i', 'emitted'); console.log(id, value); }) }; })); generated-emitted2.js000066400000000000000000000003101450520414700346420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/systemSystem.register(['./generated-emitted.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('id', module.i); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/system/main.js000066400000000000000000000004171450520414700322040ustar00rootroot00000000000000System.register(['./generated-emitted.js'], (function () { 'use strict'; var id, value; return { setters: [function (module) { id = module.i; value = module.v; }], execute: (function () { console.log(id); console.log('main', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/dep.js000066400000000000000000000000231450520414700265350ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/dep2.js000066400000000000000000000000601450520414700266200ustar00rootroot00000000000000import { id } from 'emitted'; console.log(id); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-order2/main.js000066400000000000000000000001161450520414700267140ustar00rootroot00000000000000import value from './dep.js'; import './dep2.js'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/000077500000000000000000000000001450520414700270515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_config.js000066400000000000000000000017541450520414700310220ustar00rootroot00000000000000const path = require('node:path'); let noImporterReferenceId; let mainReferenceId; let nestedReferenceId; module.exports = defineTest({ description: 'allows specifying an importer when resolving ids', options: { input: 'main', plugins: { buildStart() { noImporterReferenceId = this.emitFile({ type: 'chunk', id: './lib.js' }); mainReferenceId = this.emitFile({ type: 'chunk', id: './lib.js', importer: path.resolve(__dirname, 'main.js') }); nestedReferenceId = this.emitFile({ type: 'chunk', id: './lib.js', importer: path.resolve(__dirname, 'nested/virtual.js') }); }, transform(code, id) { if (id.endsWith('main.js')) { return ( `console.log('no importer', import.meta.ROLLUP_FILE_URL_${noImporterReferenceId});\n` + `console.log('from maim', import.meta.ROLLUP_FILE_URL_${mainReferenceId});\n` + `console.log('from nested', import.meta.ROLLUP_FILE_URL_${nestedReferenceId});\n` ); } } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/000077500000000000000000000000001450520414700310115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/amd/000077500000000000000000000000001450520414700315525ustar00rootroot00000000000000generated-lib.js000066400000000000000000000001051450520414700345270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/amddefine((function () { 'use strict'; console.log('main lib'); })); generated-lib2.js000066400000000000000000000001071450520414700346130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/amddefine((function () { 'use strict'; console.log('nested lib'); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/amd/main.js000066400000000000000000000005441450520414700330370ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; console.log('no importer', new URL(require.toUrl('./generated-lib.js'), document.baseURI).href); console.log('from maim', new URL(require.toUrl('./generated-lib.js'), document.baseURI).href); console.log('from nested', new URL(require.toUrl('./generated-lib2.js'), document.baseURI).href); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/cjs/000077500000000000000000000000001450520414700315705ustar00rootroot00000000000000generated-lib.js000066400000000000000000000000501450520414700345440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/cjs'use strict'; console.log('main lib'); generated-lib2.js000066400000000000000000000000521450520414700346300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/cjs'use strict'; console.log('nested lib'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/cjs/main.js000066400000000000000000000013611450520414700330530ustar00rootroot00000000000000'use strict'; console.log('no importer', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/generated-lib.js').href : new URL('generated-lib.js', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log('from maim', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/generated-lib.js').href : new URL('generated-lib.js', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log('from nested', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/generated-lib2.js').href : new URL('generated-lib2.js', document.currentScript && document.currentScript.src || document.baseURI).href)); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/es/000077500000000000000000000000001450520414700314205ustar00rootroot00000000000000generated-lib.js000066400000000000000000000000311450520414700343730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/esconsole.log('main lib'); generated-lib2.js000066400000000000000000000000331450520414700344570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/esconsole.log('nested lib'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/es/main.js000066400000000000000000000003541450520414700327040ustar00rootroot00000000000000console.log('no importer', new URL('generated-lib.js', import.meta.url).href); console.log('from maim', new URL('generated-lib.js', import.meta.url).href); console.log('from nested', new URL('generated-lib2.js', import.meta.url).href); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/system/000077500000000000000000000000001450520414700323355ustar00rootroot00000000000000generated-lib.js000066400000000000000000000002021450520414700353100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main lib'); }) }; })); generated-lib2.js000066400000000000000000000002041450520414700353740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('nested lib'); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/system/main.js000066400000000000000000000005521450520414700336210ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log('no importer', new URL('generated-lib.js', module.meta.url).href); console.log('from maim', new URL('generated-lib.js', module.meta.url).href); console.log('from nested', new URL('generated-lib2.js', module.meta.url).href); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/lib.js000066400000000000000000000000311450520414700301470ustar00rootroot00000000000000console.log('main lib'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/main.js000066400000000000000000000000301450520414700303240ustar00rootroot00000000000000console.log('ignored'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/nested/000077500000000000000000000000001450520414700303335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-with-importer/nested/lib.js000066400000000000000000000000331450520414700314330ustar00rootroot00000000000000console.log('nested lib'); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/000077500000000000000000000000001450520414700255505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_config.js000066400000000000000000000027421450520414700275170ustar00rootroot00000000000000const path = require('node:path'); let workerId; let proxyId; module.exports = defineTest({ description: 'allows adding additional chunks to be used in workers', options: { input: 'main', output: { chunkFileNames: 'chunks/[name].js' }, plugins: { load(id) { if (id === 'merged' || id === 'nested') { if (!workerId) { workerId = this.emitFile({ type: 'chunk', id: 'worker' }); proxyId = this.emitFile({ type: 'chunk', id: 'worker-proxy' }); } return ` export const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker(import.meta.ROLLUP_FILE_URL_${proxyId}); worker.onmessage = resolve; });`; } if (id === 'worker-proxy') { return `PLACEHOLDER(import.meta.ROLLUP_FILE_URL_${workerId})`; } }, renderChunk(code, chunk, options) { if (chunk.facadeModuleId === 'worker-proxy') { const chunkFileName = `./${path.relative( path.dirname(chunk.fileName), this.getFileName(workerId) )}`; if (options.format === 'system') { return `importScripts('../../../../../../../../node_modules/systemjs/dist/system.js'); System.import('${chunkFileName}');`; } if (options.format === 'amd') { return `importScripts('../../../../../../../../node_modules/requirejs/require.js'); requirejs(['${chunkFileName}']);`; } } }, resolveId(id) { if (id === 'merged' || id === 'nested' || id === 'worker-proxy') { return id; } return null; } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/000077500000000000000000000000001450520414700275105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/000077500000000000000000000000001450520414700302515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunks/000077500000000000000000000000001450520414700315445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunks/nested.js000066400000000000000000000005061450520414700333650ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker(new URL(require.toUrl('./worker-proxy.js'), document.baseURI).href); worker.onmessage = resolve; }); exports.getWorkerMessage = getWorkerMessage; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunks/shared.js000066400000000000000000000001641450520414700333510ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const shared = 'shared'; exports.shared = shared; })); worker-proxy.js000066400000000000000000000001501450520414700345070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunksimportScripts('../../../../../../../../node_modules/requirejs/require.js'); requirejs(['./worker.js']); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunks/worker.js000066400000000000000000000001561450520414700334150ustar00rootroot00000000000000define(['./shared'], (function (shared) { 'use strict'; postMessage(`from worker: ${shared.shared}`); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/main.js000066400000000000000000000012441450520414700315340ustar00rootroot00000000000000define(['require', './chunks/shared'], (function (require, shared) { 'use strict'; const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker(new URL(require.toUrl('./chunks/worker-proxy.js'), document.baseURI).href); worker.onmessage = resolve; }); document.body.innerHTML += `

main: ${shared.shared}

`; getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); new Promise(function (resolve, reject) { require(['./chunks/nested'], resolve, reject); }) .then(result => result.getWorkerMessage()) .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/000077500000000000000000000000001450520414700302675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks/000077500000000000000000000000001450520414700315625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks/nested.js000066400000000000000000000006141450520414700334030ustar00rootroot00000000000000'use strict'; const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/worker-proxy.js').href : new URL('worker-proxy.js', document.currentScript && document.currentScript.src || document.baseURI).href)); worker.onmessage = resolve; }); exports.getWorkerMessage = getWorkerMessage; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks/shared.js000066400000000000000000000001021450520414700333570ustar00rootroot00000000000000'use strict'; const shared = 'shared'; exports.shared = shared; worker-proxy.js000066400000000000000000000003501450520414700345270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks'use strict'; PLACEHOLDER((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/worker.js').href : new URL('worker.js', document.currentScript && document.currentScript.src || document.baseURI).href)); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks/worker.js000066400000000000000000000001431450520414700334270ustar00rootroot00000000000000'use strict'; var shared = require('./shared.js'); postMessage(`from worker: ${shared.shared}`); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/main.js000066400000000000000000000014021450520414700315460ustar00rootroot00000000000000'use strict'; var shared = require('./chunks/shared.js'); const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/chunks/worker-proxy.js').href : new URL('chunks/worker-proxy.js', document.currentScript && document.currentScript.src || document.baseURI).href)); worker.onmessage = resolve; }); document.body.innerHTML += `

main: ${shared.shared}

`; getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); Promise.resolve().then(function () { return require('./chunks/nested.js'); }) .then(result => result.getWorkerMessage()) .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/000077500000000000000000000000001450520414700301175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunks/000077500000000000000000000000001450520414700314125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunks/nested.js000066400000000000000000000003071450520414700332320ustar00rootroot00000000000000const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker(new URL('worker-proxy.js', import.meta.url).href); worker.onmessage = resolve; }); export { getWorkerMessage }; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunks/shared.js000066400000000000000000000000621450520414700332140ustar00rootroot00000000000000const shared = 'shared'; export { shared as s }; worker-proxy.js000066400000000000000000000000711450520414700343570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunksPLACEHOLDER(new URL('worker.js', import.meta.url).href); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunks/worker.js000066400000000000000000000001231450520414700332550ustar00rootroot00000000000000import { s as shared } from './shared.js'; postMessage(`from worker: ${shared}`); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/main.js000066400000000000000000000010241450520414700313760ustar00rootroot00000000000000import { s as shared } from './chunks/shared.js'; const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker(new URL('chunks/worker-proxy.js', import.meta.url).href); worker.onmessage = resolve; }); document.body.innerHTML += `

main: ${shared}

`; getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); import('./chunks/nested.js') .then(result => result.getWorkerMessage()) .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/000077500000000000000000000000001450520414700310345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/chunks/000077500000000000000000000000001450520414700323275ustar00rootroot00000000000000nested.js000066400000000000000000000005321450520414700340700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/chunksSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const getWorkerMessage = exports('getWorkerMessage', () => new Promise(resolve => { const worker = new Worker(new URL('worker-proxy.js', module.meta.url).href); worker.onmessage = resolve; })); }) }; })); shared.js000066400000000000000000000002271450520414700340550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/chunksSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); }) }; })); worker-proxy.js000066400000000000000000000001551450520414700352770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/chunksimportScripts('../../../../../../../../node_modules/systemjs/dist/system.js'); System.import('./worker.js'); worker.js000066400000000000000000000003461450520414700341220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/chunksSystem.register(['./shared.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { postMessage(`from worker: ${shared}`); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/main.js000066400000000000000000000013771450520414700323260ustar00rootroot00000000000000System.register(['./chunks/shared.js'], (function (exports, module) { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker(new URL('chunks/worker-proxy.js', module.meta.url).href); worker.onmessage = resolve; }); document.body.innerHTML += `

main: ${shared}

`; getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); module.import('./chunks/nested.js') .then(result => result.getWorkerMessage()) .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/index-amd.html000066400000000000000000000003461450520414700303070ustar00rootroot00000000000000 AMD rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/index-system.html000066400000000000000000000004111450520414700310630ustar00rootroot00000000000000 SystemJS rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/main.js000066400000000000000000000005631450520414700270360ustar00rootroot00000000000000import { getWorkerMessage } from 'merged'; import { shared } from './shared'; document.body.innerHTML += `

main: ${shared}

`; getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); import('nested') .then(result => result.getWorkerMessage()) .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/shared.js000066400000000000000000000000401450520414700273460ustar00rootroot00000000000000export const shared = 'shared'; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worker/worker.js000066400000000000000000000001111450520414700274100ustar00rootroot00000000000000import {shared} from './shared'; postMessage(`from worker: ${shared}`); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/000077500000000000000000000000001450520414700257265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_config.js000066400000000000000000000013351450520414700276720ustar00rootroot00000000000000const REGISTER_WORKLET = 'register-paint-worklet:'; module.exports = defineTest({ description: 'allows adding additional chunks to be used in worklets', options: { input: 'main', output: { chunkFileNames: 'chunks/[name].js' }, plugins: { load(id) { if (id.startsWith(REGISTER_WORKLET)) { return `CSS.paintWorklet.addModule(import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'chunk', id: id.slice(REGISTER_WORKLET.length) })});`; } }, resolveId(id, importee) { if (id.startsWith(REGISTER_WORKLET)) { return this.resolve(id.slice(REGISTER_WORKLET.length), importee).then( resolvedId => REGISTER_WORKLET + resolvedId.id ); } return null; } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/000077500000000000000000000000001450520414700276665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/amd/000077500000000000000000000000001450520414700304275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/amd/chunks/000077500000000000000000000000001450520414700317225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/amd/chunks/shared.js000066400000000000000000000002351450520414700335260ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const color = 'greenyellow'; const size = 6; exports.color = color; exports.size = size; })); worklet.js000066400000000000000000000005141450520414700336700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/amd/chunksdefine(['./shared'], (function (shared) { 'use strict'; registerPaint( 'vertical-lines', class { paint(ctx, geom) { for (let x = 0; x < geom.width / shared.size; x++) { ctx.beginPath(); ctx.fillStyle = shared.color; ctx.rect(x * shared.size, 0, 2, geom.height); ctx.fill(); } } } ); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/amd/main.js000066400000000000000000000005041450520414700317100ustar00rootroot00000000000000define(['require', './chunks/shared'], (function (require, shared) { 'use strict'; CSS.paintWorklet.addModule(new URL(require.toUrl('./chunks/worklet.js'), document.baseURI).href); document.body.innerHTML += `

color: ${shared.color}, size: ${shared.size}

`; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/cjs/000077500000000000000000000000001450520414700304455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/cjs/chunks/000077500000000000000000000000001450520414700317405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/cjs/chunks/shared.js000066400000000000000000000001511450520414700335410ustar00rootroot00000000000000'use strict'; const color = 'greenyellow'; const size = 6; exports.color = color; exports.size = size; worklet.js000066400000000000000000000004651450520414700337130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/cjs/chunks'use strict'; var shared = require('./shared.js'); registerPaint( 'vertical-lines', class { paint(ctx, geom) { for (let x = 0; x < geom.width / shared.size; x++) { ctx.beginPath(); ctx.fillStyle = shared.color; ctx.rect(x * shared.size, 0, 2, geom.height); ctx.fill(); } } } ); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/cjs/main.js000066400000000000000000000006721450520414700317340ustar00rootroot00000000000000'use strict'; var shared = require('./chunks/shared.js'); CSS.paintWorklet.addModule((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/chunks/worklet.js').href : new URL('chunks/worklet.js', document.currentScript && document.currentScript.src || document.baseURI).href)); document.body.innerHTML += `

color: ${shared.color}, size: ${shared.size}

`; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/000077500000000000000000000000001450520414700302755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/chunks/000077500000000000000000000000001450520414700315705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/chunks/shared.js000066400000000000000000000001201450520414700333650ustar00rootroot00000000000000const color = 'greenyellow'; const size = 6; export { color as c, size as s }; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/chunks/worklet.js000066400000000000000000000004411450520414700336140ustar00rootroot00000000000000import { s as size, c as color } from './shared.js'; registerPaint( 'vertical-lines', class { paint(ctx, geom) { for (let x = 0; x < geom.width / size; x++) { ctx.beginPath(); ctx.fillStyle = color; ctx.rect(x * size, 0, 2, geom.height); ctx.fill(); } } } ); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/main.js000066400000000000000000000004051450520414700315560ustar00rootroot00000000000000import { c as color, s as size } from './chunks/shared.js'; CSS.paintWorklet.addModule(new URL('chunks/worklet.js', import.meta.url).href); document.body.innerHTML += `

color: ${color}, size: ${size}

`; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/system/000077500000000000000000000000001450520414700312125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/system/chunks/000077500000000000000000000000001450520414700325055ustar00rootroot00000000000000shared.js000066400000000000000000000002741450520414700342350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/system/chunksSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const color = exports('c', 'greenyellow'); const size = exports('s', 6); }) }; })); worklet.js000066400000000000000000000007461450520414700344620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/system/chunksSystem.register(['./shared.js'], (function () { 'use strict'; var size, color; return { setters: [function (module) { size = module.s; color = module.c; }], execute: (function () { registerPaint( 'vertical-lines', class { paint(ctx, geom) { for (let x = 0; x < geom.width / size; x++) { ctx.beginPath(); ctx.fillStyle = color; ctx.rect(x * size, 0, 2, geom.height); ctx.fill(); } } } ); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/system/main.js000066400000000000000000000006701450520414700324770ustar00rootroot00000000000000System.register(['./chunks/shared.js'], (function (exports, module) { 'use strict'; var color, size; return { setters: [function (module) { color = module.c; size = module.s; }], execute: (function () { CSS.paintWorklet.addModule(new URL('chunks/worklet.js', module.meta.url).href); document.body.innerHTML += `

color: ${color}, size: ${size}

`; }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/index-es.html000066400000000000000000000002651450520414700303330ustar00rootroot00000000000000 ES rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/main.js000066400000000000000000000003161450520414700272100ustar00rootroot00000000000000import 'register-paint-worklet:./worklet.js'; import { color, size } from './shared'; document.body.innerHTML += `

color: ${color}, size: ${size}

`; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/shared.js000066400000000000000000000000731450520414700275320ustar00rootroot00000000000000export const color = 'greenyellow'; export const size = 6; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk-worklet/worklet.js000066400000000000000000000004241450520414700277530ustar00rootroot00000000000000import { color, size } from './shared'; registerPaint( 'vertical-lines', class { paint(ctx, geom) { for (let x = 0; x < geom.width / size; x++) { ctx.beginPath(); ctx.fillStyle = color; ctx.rect(x * size, 0, 2, geom.height); ctx.fill(); } } } ); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/000077500000000000000000000000001450520414700242415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_config.js000066400000000000000000000010441450520414700262020ustar00rootroot00000000000000const assert = require('node:assert'); let referenceId; module.exports = defineTest({ description: 'allows adding additional chunks and retrieving their file name', options: { input: 'main', plugins: { buildStart() { referenceId = this.emitFile({ type: 'chunk', id: 'buildStart' }); }, resolveId(id) { if (id === 'external') { return { id: "./ext'ernal", external: true }; } }, renderChunk() { assert.strictEqual(this.getFileName(referenceId), 'generated-buildStart.js'); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/000077500000000000000000000000001450520414700262015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/amd/000077500000000000000000000000001450520414700267425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/amd/generated-buildStart.js000066400000000000000000000001521450520414700333470ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('startBuild', dep.value); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/amd/generated-dep.js000066400000000000000000000001511450520414700320010ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/amd/main.js000066400000000000000000000012221450520414700302210ustar00rootroot00000000000000define(['require', './generated-dep'], (function (require, dep) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } new Promise(function (resolve, reject) { require(['./ext\'ernal'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); console.log('main', dep.value); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/cjs/000077500000000000000000000000001450520414700267605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/cjs/generated-buildStart.js000066400000000000000000000001371450520414700333700ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('startBuild', dep.value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/cjs/generated-dep.js000066400000000000000000000000671450520414700320250ustar00rootroot00000000000000'use strict'; var value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/cjs/main.js000066400000000000000000000001621450520414700302410ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); import('./ext\'ernal'); console.log('main', dep.value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/es/000077500000000000000000000000001450520414700266105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/es/generated-buildStart.js000066400000000000000000000001241450520414700332140ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('startBuild', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/es/generated-dep.js000066400000000000000000000000501450520414700316450ustar00rootroot00000000000000var value = 42; export { value as v }; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/es/main.js000066400000000000000000000001471450520414700300740ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; import('./ext\'ernal'); console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/system/000077500000000000000000000000001450520414700275255ustar00rootroot00000000000000generated-buildStart.js000066400000000000000000000003461450520414700340600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('startBuild', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/system/generated-dep.js000066400000000000000000000002161450520414700325660ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('v', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/_expected/system/main.js000066400000000000000000000004221450520414700310050ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function (exports, module) { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { module.import('./ext\'ernal'); console.log('main', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/buildStart.js000066400000000000000000000001011450520414700267040ustar00rootroot00000000000000import value from './dep.js'; console.log('startBuild', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/dep.js000066400000000000000000000000231450520414700253420ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/emit-file/emit-chunk/main.js000066400000000000000000000001171450520414700255220ustar00rootroot00000000000000import value from './dep.js'; import('external'); console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/000077500000000000000000000000001450520414700262545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_config.js000066400000000000000000000010571450520414700302210ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows adding modules already in the graph as entry points', options: { input: { 'first-main': 'main1', 'second-main': 'main2' }, plugins: { buildStart() { // it should be possible to add existing entry points while not overriding their alias this.emitFile({ type: 'chunk', id: 'main1' }); // if an existing dependency is added, all references should use the new name this.emitFile({ type: 'chunk', id: 'dep.js' }); this.emitFile({ type: 'chunk', id: 'dep' }); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/000077500000000000000000000000001450520414700302145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/amd/000077500000000000000000000000001450520414700307555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/amd/first-main.js000066400000000000000000000001371450520414700333650ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main1', dep); })); generated-dep.js000066400000000000000000000001141450520414700337340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/amddefine((function () { 'use strict'; var value = 42; return value; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/amd/second-main.js000066400000000000000000000001371450520414700335110ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main1', dep); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/cjs/000077500000000000000000000000001450520414700307735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/cjs/first-main.js000066400000000000000000000001241450520414700333770ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep); generated-dep.js000066400000000000000000000000701450520414700337530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/cjs'use strict'; var value = 42; module.exports = value; rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/cjs/second-main.js000066400000000000000000000001241450520414700335230ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/es/000077500000000000000000000000001450520414700306235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/es/first-main.js000066400000000000000000000001061450520414700332270ustar00rootroot00000000000000import value from './generated-dep.js'; console.log('main1', value); generated-dep.js000066400000000000000000000000561450520414700336070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/esvar value = 42; export { value as default }; rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/es/second-main.js000066400000000000000000000001061450520414700333530ustar00rootroot00000000000000import value from './generated-dep.js'; console.log('main1', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/system/000077500000000000000000000000001450520414700315405ustar00rootroot00000000000000first-main.js000066400000000000000000000003471450520414700340740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.default; }], execute: (function () { console.log('main1', value); }) }; })); generated-dep.js000066400000000000000000000002241450520414700345210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('default', 42); }) }; })); second-main.js000066400000000000000000000003471450520414700342200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.default; }], execute: (function () { console.log('main1', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/dep.js000066400000000000000000000000231450520414700273550ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/main1.js000066400000000000000000000000741450520414700276200ustar00rootroot00000000000000import value from './dep.js'; console.log('main1', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-existing-chunk/main2.js000066400000000000000000000000741450520414700276210ustar00rootroot00000000000000import value from './dep.js'; console.log('main1', value); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/000077500000000000000000000000001450520414700301665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_config.js000066400000000000000000000052021450520414700321270ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports emitting assets from plugin hooks', options: { input: ['main.js'], plugins: { buildStart() { this.emitFile({ type: 'asset', name: 'buildStart.txt', source: 'buildStart' }); this.emitFile({ type: 'asset', fileName: 'custom/buildStart.txt', source: 'buildStart-custom' }); }, resolveId() { this.emitFile({ type: 'asset', name: 'resolveId.txt', source: 'resolveId' }); this.emitFile({ type: 'asset', fileName: 'custom/resolveId.txt', source: 'resolveId-custom' }); }, load() { this.emitFile({ type: 'asset', name: 'load.txt', source: 'load' }); this.emitFile({ type: 'asset', fileName: 'custom/load.txt', source: 'load-custom' }); }, transform() { this.emitFile({ type: 'asset', name: 'transform.txt', source: 'transform' }); this.emitFile({ type: 'asset', fileName: 'custom/transform.txt', source: 'transform-custom' }); }, buildEnd() { this.emitFile({ type: 'asset', name: 'buildEnd.txt', source: 'buildEnd' }); this.emitFile({ type: 'asset', fileName: 'custom/buildEnd.txt', source: 'buildEnd-custom' }); }, renderStart() { this.emitFile({ type: 'asset', name: 'renderStart.txt', source: 'renderStart' }); this.emitFile({ type: 'asset', fileName: 'custom/renderStart.txt', source: 'renderStart-custom' }); }, banner() { this.emitFile({ type: 'asset', name: 'banner.txt', source: 'banner' }); this.emitFile({ type: 'asset', fileName: 'custom/banner.txt', source: 'banner-custom' }); }, footer() { this.emitFile({ type: 'asset', name: 'footer.txt', source: 'footer' }); this.emitFile({ type: 'asset', fileName: 'custom/footer.txt', source: 'footer-custom' }); }, intro() { this.emitFile({ type: 'asset', name: 'intro.txt', source: 'intro' }); this.emitFile({ type: 'asset', fileName: 'custom/intro.txt', source: 'intro-custom' }); }, outro() { this.emitFile({ type: 'asset', name: 'outro.txt', source: 'outro' }); this.emitFile({ type: 'asset', fileName: 'custom/outro.txt', source: 'outro-custom' }); }, renderChunk() { this.emitFile({ type: 'asset', name: 'renderChunk.txt', source: 'renderChunk' }); this.emitFile({ type: 'asset', fileName: 'custom/renderChunk.txt', source: 'renderChunk-custom' }); }, generateBundle() { this.emitFile({ type: 'asset', name: 'generateBundle.txt', source: 'generateBundle' }); this.emitFile({ type: 'asset', fileName: 'custom/generateBundle.txt', source: 'generateBundle-custom' }); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/000077500000000000000000000000001450520414700321265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/000077500000000000000000000000001450520414700326675ustar00rootroot00000000000000assets/000077500000000000000000000000001450520414700341125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amdbanner-8c7ed2d9.txt000066400000000000000000000000061450520414700373430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsbannerbuildEnd-6e08d992.txt000066400000000000000000000000101450520414700374600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsbuildEndbuildStart-db9421f6.txt000066400000000000000000000000121450520414700401200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsbuildStartfooter-0301844c.txt000066400000000000000000000000061450520414700371310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsfootergenerateBundle-5b9a4e56.txt000066400000000000000000000000161450520414700407360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsgenerateBundleintro-c432b372.txt000066400000000000000000000000051450520414700370500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsintroload-0cf67fc7.txt000066400000000000000000000000041450520414700370070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsloadoutro-1e5fe046.txt000066400000000000000000000000051450520414700371530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsoutrorenderChunk-aa9e49b7.txt000066400000000000000000000000131450520414700403400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsrenderChunkrenderStart-981aa2ea.txt000066400000000000000000000000131450520414700403530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsrenderStartresolveId-dd9bb7f8.txt000066400000000000000000000000111450520414700401060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsresolveIdtransform-aa214ea3.txt000066400000000000000000000000111450520414700400550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetstransformcustom/000077500000000000000000000000001450520414700341225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amdbanner.txt000066400000000000000000000000151450520414700361240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/custombanner-custombuildEnd.txt000066400000000000000000000000171450520414700364070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/custombuildEnd-custombuildStart.txt000066400000000000000000000000211450520414700367710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/custombuildStart-customfooter.txt000066400000000000000000000000151450520414700361550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customfooter-customgenerateBundle.txt000066400000000000000000000000251450520414700376040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customgenerateBundle-customintro.txt000066400000000000000000000000141450520414700360110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customintro-customload.txt000066400000000000000000000000131450520414700355740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customload-customoutro.txt000066400000000000000000000000141450520414700360260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customoutro-customrenderChunk.txt000066400000000000000000000000221450520414700371250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customrenderChunk-customrenderStart.txt000066400000000000000000000000221450520414700371520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customrenderStart-customresolveId.txt000066400000000000000000000000201450520414700366070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customresolveId-customtransform.txt000066400000000000000000000000201450520414700366660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customtransform-custommain.js000066400000000000000000000001011450520414700340620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amddefine((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/000077500000000000000000000000001450520414700327055ustar00rootroot00000000000000assets/000077500000000000000000000000001450520414700341305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjsbanner-8c7ed2d9.txt000066400000000000000000000000061450520414700373610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsbannerbuildEnd-6e08d992.txt000066400000000000000000000000101450520414700374760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsbuildEndbuildStart-db9421f6.txt000066400000000000000000000000121450520414700401360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsbuildStartfooter-0301844c.txt000066400000000000000000000000061450520414700371470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsfootergenerateBundle-5b9a4e56.txt000066400000000000000000000000161450520414700407540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsgenerateBundleintro-c432b372.txt000066400000000000000000000000051450520414700370660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsintroload-0cf67fc7.txt000066400000000000000000000000041450520414700370250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsloadoutro-1e5fe046.txt000066400000000000000000000000051450520414700371710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsoutrorenderChunk-aa9e49b7.txt000066400000000000000000000000131450520414700403560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsrenderChunkrenderStart-981aa2ea.txt000066400000000000000000000000131450520414700403710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsrenderStartresolveId-dd9bb7f8.txt000066400000000000000000000000111450520414700401240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsresolveIdtransform-aa214ea3.txt000066400000000000000000000000111450520414700400730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetstransformcustom/000077500000000000000000000000001450520414700341405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjsbanner.txt000066400000000000000000000000151450520414700361420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/custombanner-custombuildEnd.txt000066400000000000000000000000171450520414700364250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/custombuildEnd-custombuildStart.txt000066400000000000000000000000211450520414700370070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/custombuildStart-customfooter.txt000066400000000000000000000000151450520414700361730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customfooter-customgenerateBundle.txt000066400000000000000000000000251450520414700376220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customgenerateBundle-customintro.txt000066400000000000000000000000141450520414700360270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customintro-customload.txt000066400000000000000000000000131450520414700356120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customload-customoutro.txt000066400000000000000000000000141450520414700360440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customoutro-customrenderChunk.txt000066400000000000000000000000221450520414700371430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customrenderChunk-customrenderStart.txt000066400000000000000000000000221450520414700371700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customrenderStart-customresolveId.txt000066400000000000000000000000201450520414700366250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customresolveId-customtransform.txt000066400000000000000000000000201450520414700367040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customtransform-custommain.js000066400000000000000000000000441450520414700341060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs'use strict'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/000077500000000000000000000000001450520414700325355ustar00rootroot00000000000000assets/000077500000000000000000000000001450520414700337605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/esbanner-8c7ed2d9.txt000066400000000000000000000000061450520414700372110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsbannerbuildEnd-6e08d992.txt000066400000000000000000000000101450520414700373260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsbuildEndbuildStart-db9421f6.txt000066400000000000000000000000121450520414700377660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsbuildStartfooter-0301844c.txt000066400000000000000000000000061450520414700367770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsfootergenerateBundle-5b9a4e56.txt000066400000000000000000000000161450520414700406040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsgenerateBundleintro-c432b372.txt000066400000000000000000000000051450520414700367160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsintroload-0cf67fc7.txt000066400000000000000000000000041450520414700366550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsloadoutro-1e5fe046.txt000066400000000000000000000000051450520414700370210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsoutrorenderChunk-aa9e49b7.txt000066400000000000000000000000131450520414700402060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsrenderChunkrenderStart-981aa2ea.txt000066400000000000000000000000131450520414700402210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsrenderStartresolveId-dd9bb7f8.txt000066400000000000000000000000111450520414700377540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsresolveIdtransform-aa214ea3.txt000066400000000000000000000000111450520414700377230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetstransformcustom/000077500000000000000000000000001450520414700337705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/esbanner.txt000066400000000000000000000000151450520414700357720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/custombanner-custombuildEnd.txt000066400000000000000000000000171450520414700362550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/custombuildEnd-custombuildStart.txt000066400000000000000000000000211450520414700366370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/custombuildStart-customfooter.txt000066400000000000000000000000151450520414700360230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customfooter-customgenerateBundle.txt000066400000000000000000000000251450520414700374520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customgenerateBundle-customintro.txt000066400000000000000000000000141450520414700356570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customintro-customload.txt000066400000000000000000000000131450520414700354420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customload-customoutro.txt000066400000000000000000000000141450520414700356740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customoutro-customrenderChunk.txt000066400000000000000000000000221450520414700367730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customrenderChunk-customrenderStart.txt000066400000000000000000000000221450520414700370200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customrenderStart-customresolveId.txt000066400000000000000000000000201450520414700364550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customresolveId-customtransform.txt000066400000000000000000000000201450520414700365340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customtransform-custommain.js000066400000000000000000000000251450520414700337350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/esconsole.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/000077500000000000000000000000001450520414700334525ustar00rootroot00000000000000assets/000077500000000000000000000000001450520414700346755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/systembanner-8c7ed2d9.txt000066400000000000000000000000061450520414700401260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsbannerbuildEnd-6e08d992.txt000066400000000000000000000000101450520414700402430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsbuildEndbuildStart-db9421f6.txt000066400000000000000000000000121450520414700407030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsbuildStartfooter-0301844c.txt000066400000000000000000000000061450520414700377140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsfootergenerateBundle-5b9a4e56.txt000066400000000000000000000000161450520414700415210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsgenerateBundleintro-c432b372.txt000066400000000000000000000000051450520414700376330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsintroload-0cf67fc7.txt000066400000000000000000000000041450520414700375720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsloadoutro-1e5fe046.txt000066400000000000000000000000051450520414700377360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsoutrorenderChunk-aa9e49b7.txt000066400000000000000000000000131450520414700411230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsrenderChunkrenderStart-981aa2ea.txt000066400000000000000000000000131450520414700411360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsrenderStartresolveId-dd9bb7f8.txt000066400000000000000000000000111450520414700406710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsresolveIdtransform-aa214ea3.txt000066400000000000000000000000111450520414700406400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetstransformcustom/000077500000000000000000000000001450520414700347055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/systembanner.txt000066400000000000000000000000151450520414700367070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/custombanner-custombuildEnd.txt000066400000000000000000000000171450520414700371720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/custombuildEnd-custombuildStart.txt000066400000000000000000000000211450520414700375540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/custombuildStart-customfooter.txt000066400000000000000000000000151450520414700367400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customfooter-customgenerateBundle.txt000066400000000000000000000000251450520414700403670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customgenerateBundle-customintro.txt000066400000000000000000000000141450520414700365740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customintro-customload.txt000066400000000000000000000000131450520414700363570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customload-customoutro.txt000066400000000000000000000000141450520414700366110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customoutro-customrenderChunk.txt000066400000000000000000000000221450520414700377100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customrenderChunk-customrenderStart.txt000066400000000000000000000000221450520414700377350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customrenderStart-customresolveId.txt000066400000000000000000000000201450520414700373720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customresolveId-customtransform.txt000066400000000000000000000000201450520414700374510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customtransform-custommain.js000066400000000000000000000001761450520414700346610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/main.js000066400000000000000000000000251450520414700314450ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/000077500000000000000000000000001450520414700331205ustar00rootroot00000000000000_config.js000066400000000000000000000024031450520414700350020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modulesconst assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEB = path.join(__dirname, 'deb.js'); module.exports = defineTest({ description: 'supports using a function that returns a pattern for entryFileNames, with output.preserveModules option', options: { input: ['main.js'], plugins: { transform() { this.emitFile({ type: 'asset', name: 'test.txt', source: 'hello world' }); return null; } }, output: { preserveModules: true, entryFileNames: fileInfo => { if (fileInfo.facadeModuleId === ID_MAIN) { assert.deepStrictEqual( fileInfo, { exports: [], facadeModuleId: ID_MAIN, isDynamicEntry: false, isEntry: true, isImplicitEntry: false, moduleIds: [ID_MAIN], name: 'main', type: 'chunk' }, 'entry info' ); } else { assert.deepStrictEqual( fileInfo, { exports: ['default'], facadeModuleId: ID_DEB, isDynamicEntry: true, isEntry: false, isImplicitEntry: false, moduleIds: [ID_DEB], name: 'deb', type: 'chunk' }, 'entry info' ); } return `entry-[name]-[format].js`; } } } }); _expected/000077500000000000000000000000001450520414700350015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modulesamd/000077500000000000000000000000001450520414700355425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expectedassets/000077500000000000000000000000001450520414700370445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amdtest-b94d27b9.txt000066400000000000000000000000131450520414700417220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amd/assetshello worldentry-deb-amd.js000066400000000000000000000001161450520414700405260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amddefine((function () { 'use strict'; var deb = 'string'; return deb; })); entry-main-amd.js000066400000000000000000000005531450520414700407250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amddefine(['require'], (function (require) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } console.log('main'); new Promise(function (resolve, reject) { require(['./entry-deb-amd'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(console.log); })); cjs/000077500000000000000000000000001450520414700355605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expectedassets/000077500000000000000000000000001450520414700370625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjstest-b94d27b9.txt000066400000000000000000000000131450520414700417400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs/assetshello worldentry-deb-cjs.js000066400000000000000000000000721450520414700405630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs'use strict'; var deb = 'string'; module.exports = deb; entry-main-cjs.js000066400000000000000000000004261450520414700407600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } console.log('main'); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./entry-deb-cjs.js')); }).then(console.log); es/000077500000000000000000000000001450520414700354105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expectedassets/000077500000000000000000000000001450520414700367125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/estest-b94d27b9.txt000066400000000000000000000000131450520414700415700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/es/assetshello worldentry-deb-es.js000066400000000000000000000000601450520414700402400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/esvar deb = 'string'; export { deb as default }; entry-main-es.js000066400000000000000000000001041450520414700404310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/esconsole.log('main'); import('./entry-deb-es.js').then(console.log); system/000077500000000000000000000000001450520414700363255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expectedassets/000077500000000000000000000000001450520414700376275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/systemtest-b94d27b9.txt000066400000000000000000000000131450520414700425050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/system/assetshello worldentry-deb-system.js000066400000000000000000000002301450520414700420710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var deb = exports('default', 'string'); }) }; })); entry-main-system.js000066400000000000000000000003121450520414700422640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log('main'); module.import('./entry-deb-system.js').then(console.log); }) }; })); deb.js000066400000000000000000000000311450520414700341230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modulesexport default 'string'; main.js000066400000000000000000000000701450520414700343200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modulesconsole.log('main'); import('./deb').then(console.log); rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/000077500000000000000000000000001450520414700276215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_config.js000066400000000000000000000027021450520414700315640ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEB = path.join(__dirname, 'deb.js'); module.exports = defineTest({ description: 'supports using a function that returns a pattern for FileNames', options: { input: ['main.js'], plugins: { name: 'test-plugin', transform() { this.emitFile({ type: 'asset', name: 'test.txt', source: 'hello world' }); return null; } }, output: { entryFileNames: fileInfo => { assert.deepStrictEqual( fileInfo, { exports: [], facadeModuleId: ID_MAIN, isDynamicEntry: false, isEntry: true, isImplicitEntry: false, name: 'main', moduleIds: [ID_MAIN], type: 'chunk' }, 'entry info' ); return `entry-[name]-[hash]-[format].js`; }, assetFileNames: fileInfo => { assert.deepStrictEqual( fileInfo, { name: 'test.txt', source: 'hello world', type: 'asset' }, 'asset info' ); return '[ext]/[hash]-[name][extname]'; }, chunkFileNames: fileInfo => { assert.deepStrictEqual( fileInfo, { exports: ['default'], facadeModuleId: ID_DEB, isDynamicEntry: true, isEntry: false, isImplicitEntry: false, moduleIds: [ID_DEB], name: 'deb', type: 'chunk' }, 'chunk info' ); return 'chunk-[name]-[hash]-[format].js'; } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/000077500000000000000000000000001450520414700315615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/000077500000000000000000000000001450520414700323225ustar00rootroot00000000000000chunk-deb-87ce45a9-amd.js000066400000000000000000000001551450520414700363500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var deb = 'string'; exports.default = deb; })); entry-main-70ac024b-amd.js000066400000000000000000000003151450520414700365420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amddefine(['require'], (function (require) { 'use strict'; console.log('main'); new Promise(function (resolve, reject) { require(['./chunk-deb-87ce45a9-amd'], resolve, reject); }).then(console.log); })); rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/txt/000077500000000000000000000000001450520414700331415ustar00rootroot00000000000000b94d27b9-test.txt000066400000000000000000000000131450520414700357400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/txthello worldrollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/000077500000000000000000000000001450520414700323405ustar00rootroot00000000000000chunk-deb-69905607-cjs.js000066400000000000000000000000731450520414700361630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs'use strict'; var deb = 'string'; exports.default = deb; entry-main-780766d3-cjs.js000066400000000000000000000002161450520414700364640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs'use strict'; console.log('main'); Promise.resolve().then(function () { return require('./chunk-deb-69905607-cjs.js'); }).then(console.log); rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/txt/000077500000000000000000000000001450520414700331575ustar00rootroot00000000000000b94d27b9-test.txt000066400000000000000000000000131450520414700357560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/txthello worldrollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/000077500000000000000000000000001450520414700321705ustar00rootroot00000000000000chunk-deb-9f85baf7-es.js000066400000000000000000000000601450520414700361410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/esvar deb = 'string'; export { deb as default }; entry-main-080ad38c-es.js000066400000000000000000000001151450520414700362640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/esconsole.log('main'); import('./chunk-deb-9f85baf7-es.js').then(console.log); rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/txt/000077500000000000000000000000001450520414700330075ustar00rootroot00000000000000b94d27b9-test.txt000066400000000000000000000000131450520414700356060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/txthello worldrollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/000077500000000000000000000000001450520414700331055ustar00rootroot00000000000000chunk-deb-467d682b-system.js000066400000000000000000000002301450520414700376250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var deb = exports('default', 'string'); }) }; })); entry-main-5d41b5c4-system.js000066400000000000000000000003231450520414700401200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log('main'); module.import('./chunk-deb-467d682b-system.js').then(console.log); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/txt/000077500000000000000000000000001450520414700337245ustar00rootroot00000000000000b94d27b9-test.txt000066400000000000000000000000131450520414700365230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/txthello worldrollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/deb.js000066400000000000000000000000311450520414700307030ustar00rootroot00000000000000export default 'string'; rollup-3.29.4/test/chunking-form/samples/emit-file/filenames-function-patterns/main.js000066400000000000000000000000701450520414700311000ustar00rootroot00000000000000console.log('main'); import('./deb').then(console.log); rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/000077500000000000000000000000001450520414700255265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_config.js000066400000000000000000000016441450520414700274750ustar00rootroot00000000000000const assert = require('node:assert'); let referenceIdName; let referenceIdFileName1; let referenceIdFileName2; module.exports = defineTest({ description: 'deduplicates with named chunks defined by the user', options: { input: { mainChunk: 'main', mainChunkFacade: 'main' }, plugins: { buildStart() { referenceIdName = this.emitFile({ type: 'chunk', id: 'main', name: 'ignored' }); referenceIdFileName1 = this.emitFile({ type: 'chunk', id: 'main', fileName: 'explicit-name1.js' }); referenceIdFileName2 = this.emitFile({ type: 'chunk', id: 'main', fileName: 'explicit-name2.js' }); }, generateBundle() { assert.strictEqual(this.getFileName(referenceIdName), 'mainChunk.js'); assert.strictEqual(this.getFileName(referenceIdFileName1), 'explicit-name1.js'); assert.strictEqual(this.getFileName(referenceIdFileName2), 'explicit-name2.js'); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/000077500000000000000000000000001450520414700274665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amd/000077500000000000000000000000001450520414700302275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amd/explicit-name1.js000066400000000000000000000001751450520414700334100ustar00rootroot00000000000000define(['exports', './mainChunk'], (function (exports, mainChunk) { 'use strict'; exports.value = mainChunk.value; })); rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amd/explicit-name2.js000066400000000000000000000001751450520414700334110ustar00rootroot00000000000000define(['exports', './mainChunk'], (function (exports, mainChunk) { 'use strict'; exports.value = mainChunk.value; })); rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amd/mainChunk.js000066400000000000000000000001531450520414700325010ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); mainChunkFacade.js000066400000000000000000000001751450520414700335120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amddefine(['exports', './mainChunk'], (function (exports, mainChunk) { 'use strict'; exports.value = mainChunk.value; })); rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs/000077500000000000000000000000001450520414700302455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs/explicit-name1.js000066400000000000000000000001361450520414700334230ustar00rootroot00000000000000'use strict'; var mainChunk = require('./mainChunk.js'); exports.value = mainChunk.value; rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs/explicit-name2.js000066400000000000000000000001361450520414700334240ustar00rootroot00000000000000'use strict'; var mainChunk = require('./mainChunk.js'); exports.value = mainChunk.value; rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs/mainChunk.js000066400000000000000000000000711450520414700325160ustar00rootroot00000000000000'use strict'; const value = 42; exports.value = value; mainChunkFacade.js000066400000000000000000000001361450520414700335250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs'use strict'; var mainChunk = require('./mainChunk.js'); exports.value = mainChunk.value; rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/000077500000000000000000000000001450520414700300755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/explicit-name1.js000066400000000000000000000000501450520414700332460ustar00rootroot00000000000000export { value } from './mainChunk.js'; rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/explicit-name2.js000066400000000000000000000000501450520414700332470ustar00rootroot00000000000000export { value } from './mainChunk.js'; rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/mainChunk.js000066400000000000000000000000451450520414700323470ustar00rootroot00000000000000const value = 42; export { value }; rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/mainChunkFacade.js000066400000000000000000000000501450520414700334270ustar00rootroot00000000000000export { value } from './mainChunk.js'; rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/system/000077500000000000000000000000001450520414700310125ustar00rootroot00000000000000explicit-name1.js000066400000000000000000000003071450520414700341110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/systemSystem.register(['./mainChunk.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module.value); }], execute: (function () { }) }; })); explicit-name2.js000066400000000000000000000003071450520414700341120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/systemSystem.register(['./mainChunk.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module.value); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/system/mainChunk.js000066400000000000000000000002241450520414700332630ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 42); }) }; })); mainChunkFacade.js000066400000000000000000000003071450520414700342720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/_expected/systemSystem.register(['./mainChunk.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module.value); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/named-user-chunks/main.js000066400000000000000000000000311450520414700270020ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/000077500000000000000000000000001450520414700252335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_config.js000066400000000000000000000013231450520414700271740ustar00rootroot00000000000000const { readFileSync } = require('node:fs'); const path = require('node:path'); module.exports = defineTest({ description: 'allows referencing emitted files', options: { strictDeprecations: false, input: ['main.js'], preserveEntrySignatures: false, output: { chunkFileNames: 'nested/chunk.js' }, plugins: { name: 'test-plugin', resolveId(id, importee) { if (id.endsWith('.svg') && importee) { return path.resolve(path.dirname(importee), id); } }, load(id) { if (id.endsWith('.svg')) { return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'asset', name: path.basename(id), source: readFileSync(id) })};`; } } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/000077500000000000000000000000001450520414700271735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/amd/000077500000000000000000000000001450520414700277345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/000077500000000000000000000000001450520414700312365ustar00rootroot00000000000000logo1-60bc15c4.svg000066400000000000000000000064341450520414700340550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets logo2-fdaa7478.svg000066400000000000000000000064341450520414700341540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/amd/main.js000066400000000000000000000010061450520414700312130ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; var logo = new URL(require.toUrl('./assets/logo1-60bc15c4.svg'), document.baseURI).href; function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); new Promise(function (resolve, reject) { require(['./nested/chunk'], resolve, reject); }); exports.showImage = showImage; })); rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/amd/nested/000077500000000000000000000000001450520414700312165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/amd/nested/chunk.js000066400000000000000000000003031450520414700326600ustar00rootroot00000000000000define(['require', '../main'], (function (require, main) { 'use strict'; var logo = new URL(require.toUrl('../assets/logo2-fdaa7478.svg'), document.baseURI).href; main.showImage(logo); })); rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/000077500000000000000000000000001450520414700277525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/000077500000000000000000000000001450520414700312545ustar00rootroot00000000000000logo1-60bc15c4.svg000066400000000000000000000064341450520414700340730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets logo2-fdaa7478.svg000066400000000000000000000064341450520414700341720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/main.js000066400000000000000000000011071450520414700312330ustar00rootroot00000000000000'use strict'; var logo = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/logo1-60bc15c4.svg').href : new URL('assets/logo1-60bc15c4.svg', document.currentScript && document.currentScript.src || document.baseURI).href); function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); Promise.resolve().then(function () { return require('./nested/chunk.js'); }); exports.showImage = showImage; rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/nested/000077500000000000000000000000001450520414700312345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/nested/chunk.js000066400000000000000000000005061450520414700327030ustar00rootroot00000000000000'use strict'; var main = require('../main.js'); var logo = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/../assets/logo2-fdaa7478.svg').href : new URL('../assets/logo2-fdaa7478.svg', document.currentScript && document.currentScript.src || document.baseURI).href); main.showImage(logo); rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/es/000077500000000000000000000000001450520414700276025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/000077500000000000000000000000001450520414700311045ustar00rootroot00000000000000logo1-60bc15c4.svg000066400000000000000000000064341450520414700337230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets logo2-fdaa7478.svg000066400000000000000000000064341450520414700340220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/es/main.js000066400000000000000000000005231450520414700310640ustar00rootroot00000000000000var logo = new URL('assets/logo1-60bc15c4.svg', import.meta.url).href; function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); import('./nested/chunk.js'); export { showImage as s }; rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/es/nested/000077500000000000000000000000001450520414700310645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/es/nested/chunk.js000066400000000000000000000002121450520414700325250ustar00rootroot00000000000000import { s as showImage } from '../main.js'; var logo = new URL('../assets/logo2-fdaa7478.svg', import.meta.url).href; showImage(logo); rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/system/000077500000000000000000000000001450520414700305175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/000077500000000000000000000000001450520414700320215ustar00rootroot00000000000000logo1-60bc15c4.svg000066400000000000000000000064341450520414700346400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets logo2-fdaa7478.svg000066400000000000000000000064341450520414700347370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/system/main.js000066400000000000000000000007611450520414700320050ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { exports('s', showImage); var logo = new URL('assets/logo1-60bc15c4.svg', module.meta.url).href; function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); module.import('./nested/chunk.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/system/nested/000077500000000000000000000000001450520414700320015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/_expected/system/nested/chunk.js000066400000000000000000000004621450520414700334510ustar00rootroot00000000000000System.register(['../main.js'], (function (exports, module) { 'use strict'; var showImage; return { setters: [function (module) { showImage = module.s; }], execute: (function () { var logo = new URL('../assets/logo2-fdaa7478.svg', module.meta.url).href; showImage(logo); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/index-amd.html000066400000000000000000000003461450520414700277720ustar00rootroot00000000000000 AMD rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/index-es.html000066400000000000000000000002701450520414700276340ustar00rootroot00000000000000 Title rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/index-system.html000066400000000000000000000004111450520414700305460ustar00rootroot00000000000000 SystemJS rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/logo1.svg000066400000000000000000000064341450520414700270040ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/logo2.svg000066400000000000000000000064341450520414700270050ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/main.js000066400000000000000000000001631450520414700265150ustar00rootroot00000000000000import logo from './logo1.svg'; import { showImage } from './show-image'; showImage(logo); import('./nested.js'); rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/nested.js000066400000000000000000000001341450520414700270510ustar00rootroot00000000000000import logo from './logo2.svg'; import { showImage } from './show-image'; showImage(logo); rollup-3.29.4/test/chunking-form/samples/emit-file/reference-files/show-image.js000066400000000000000000000003071450520414700276310ustar00rootroot00000000000000export function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/000077500000000000000000000000001450520414700256565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_config.js000066400000000000000000000006351450520414700276240ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows adding additional chunks and retrieving their file name', options: { input: 'main', plugins: { resolveId(id) { if (id === '\0virtual') { return id; } }, load(id) { if (id === '\0virtual') { return `console.log('virtual');`; } }, buildStart() { this.emitFile({ type: 'chunk', id: '\0virtual' }); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/000077500000000000000000000000001450520414700276165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/amd/000077500000000000000000000000001450520414700303575ustar00rootroot00000000000000generated-_virtual.js000066400000000000000000000001041450520414700344120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/amddefine((function () { 'use strict'; console.log('virtual'); })); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/amd/main.js000066400000000000000000000001321450520414700316350ustar00rootroot00000000000000define((function () { 'use strict'; var value = 42; console.log('main', value); })); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/cjs/000077500000000000000000000000001450520414700303755ustar00rootroot00000000000000generated-_virtual.js000066400000000000000000000000471450520414700344360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/cjs'use strict'; console.log('virtual'); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/cjs/main.js000066400000000000000000000000741450520414700316600ustar00rootroot00000000000000'use strict'; var value = 42; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/es/000077500000000000000000000000001450520414700302255ustar00rootroot00000000000000generated-_virtual.js000066400000000000000000000000301450520414700342560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/esconsole.log('virtual'); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/es/main.js000066400000000000000000000000551450520414700315070ustar00rootroot00000000000000var value = 42; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/system/000077500000000000000000000000001450520414700311425ustar00rootroot00000000000000generated-_virtual.js000066400000000000000000000002011450520414700351730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('virtual'); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/system/main.js000066400000000000000000000002311450520414700324200ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var value = 42; console.log('main', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/buildStart.js000066400000000000000000000001011450520414700303210ustar00rootroot00000000000000import value from './dep.js'; console.log('startBuild', value); rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/dep.js000066400000000000000000000000231450520414700267570ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/emit-file/sanitize-file-name/main.js000066400000000000000000000000731450520414700271400ustar00rootroot00000000000000import value from './dep.js'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/000077500000000000000000000000001450520414700254035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_config.js000066400000000000000000000070161450520414700273510ustar00rootroot00000000000000let renderStart; let renderStartNamed; let banner; let bannerNamed; let footer; let footerNamed; let intro; let introNamed; let outro; let outroNamed; let renderChunk; let renderChunkNamed; let generateBundle; let generateBundleNamed; module.exports = defineTest({ description: 'supports setting the asset source during generate', options: { input: ['main.js'], plugins: { load() { renderStart = this.emitFile({ type: 'asset', name: 'renderStart.txt' }); renderStartNamed = this.emitFile({ type: 'asset', fileName: 'renderStart.txt' }); banner = this.emitFile({ type: 'asset', name: 'banner.txt' }); bannerNamed = this.emitFile({ type: 'asset', fileName: 'banner.txt' }); footer = this.emitFile({ type: 'asset', name: 'footer.txt' }); footerNamed = this.emitFile({ type: 'asset', fileName: 'footer.txt' }); intro = this.emitFile({ type: 'asset', name: 'intro.txt' }); introNamed = this.emitFile({ type: 'asset', fileName: 'intro.txt' }); outro = this.emitFile({ type: 'asset', name: 'outro.txt' }); outroNamed = this.emitFile({ type: 'asset', fileName: 'outro.txt' }); renderChunk = this.emitFile({ type: 'asset', name: 'renderChunk.txt' }); renderChunkNamed = this.emitFile({ type: 'asset', fileName: 'renderChunk.txt' }); generateBundle = this.emitFile({ type: 'asset', name: 'generateBundle.txt' }); generateBundleNamed = this.emitFile({ type: 'asset', fileName: 'generateBundle.txt' }); return ( `export const renderStart = import.meta.ROLLUP_FILE_URL_${renderStart};\n` + `export const renderStartNamed = import.meta.ROLLUP_FILE_URL_${renderStartNamed};\n` + `export const renderStartNamedImmediately = '${this.getFileName(renderStartNamed)}';\n` + `export const bannerNamed = import.meta.ROLLUP_FILE_URL_${bannerNamed};\n` + `export const footerNamed = import.meta.ROLLUP_FILE_URL_${footerNamed};\n` + `export const introNamed = import.meta.ROLLUP_FILE_URL_${introNamed};\n` + `export const outroNamed = import.meta.ROLLUP_FILE_URL_${outroNamed};\n` + `export const renderChunkNamed = import.meta.ROLLUP_FILE_URL_${renderChunkNamed};\n` + `export const generateBundleNamed = import.meta.ROLLUP_FILE_URL_${generateBundleNamed};\n` ); }, renderStart() { this.setAssetSource(renderStart, 'renderStart'); this.setAssetSource(renderStartNamed, 'renderStart'); }, banner() { this.setAssetSource(banner, 'banner'); this.setAssetSource(bannerNamed, 'banner'); }, footer() { this.setAssetSource(footer, 'footer'); this.setAssetSource(footerNamed, 'footer'); }, intro() { this.setAssetSource(intro, 'intro'); this.setAssetSource(introNamed, 'intro'); }, outro() { this.setAssetSource(outro, 'outro'); this.setAssetSource(outroNamed, 'outro'); }, renderChunk() { this.setAssetSource(renderChunk, 'renderChunk'); this.setAssetSource(renderChunkNamed, 'renderChunk'); }, generateBundle(options) { const localAsset = this.emitFile({ type: 'asset', name: 'generateBundle-format.txt' }); const localAssetNamed = this.emitFile({ type: 'asset', fileName: 'generateBundle-format.txt' }); this.setAssetSource(localAsset, options.format); this.setAssetSource(localAssetNamed, options.format); this.setAssetSource( generateBundle, `generateBundle ${options.format} with ${this.getFileName(localAsset)}` ); this.setAssetSource( generateBundleNamed, `generateBundle ${options.format} with ${this.getFileName(localAsset)}` ); } } } }); rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/000077500000000000000000000000001450520414700273435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/000077500000000000000000000000001450520414700301045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/000077500000000000000000000000001450520414700314065ustar00rootroot00000000000000banner-8c7ed2d9.txt000066400000000000000000000000061450520414700345600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsbannerfooter-0301844c.txt000066400000000000000000000000061450520414700343460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsfootergenerateBundle-6922b0a1.txt000066400000000000000000000001011450520414700360500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsgenerateBundle amd with assets/generateBundle-format-240389f4.txtgenerateBundle-format-240389f4.txt000066400000000000000000000000031450520414700372740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsamdintro-c432b372.txt000066400000000000000000000000051450520414700342650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsintrooutro-1e5fe046.txt000066400000000000000000000000051450520414700343700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsoutrorenderChunk-aa9e49b7.txt000066400000000000000000000000131450520414700355550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsrenderChunkrenderStart-981aa2ea.txt000066400000000000000000000000131450520414700355700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsrenderStartrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/banner.txt000066400000000000000000000000061450520414700321060ustar00rootroot00000000000000bannerrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/footer.txt000066400000000000000000000000061450520414700321370ustar00rootroot00000000000000footergenerateBundle-format.txt000066400000000000000000000000031450520414700347710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amdamdrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/generateBundle.txt000066400000000000000000000001011450520414700335610ustar00rootroot00000000000000generateBundle amd with assets/generateBundle-format-240389f4.txtrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/intro.txt000066400000000000000000000000051450520414700317730ustar00rootroot00000000000000introrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/main.js000066400000000000000000000023451450520414700313720ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const renderStart = new URL(require.toUrl('./assets/renderStart-981aa2ea.txt'), document.baseURI).href; const renderStartNamed = new URL(require.toUrl('./renderStart.txt'), document.baseURI).href; const renderStartNamedImmediately = 'renderStart.txt'; const bannerNamed = new URL(require.toUrl('./banner.txt'), document.baseURI).href; const footerNamed = new URL(require.toUrl('./footer.txt'), document.baseURI).href; const introNamed = new URL(require.toUrl('./intro.txt'), document.baseURI).href; const outroNamed = new URL(require.toUrl('./outro.txt'), document.baseURI).href; const renderChunkNamed = new URL(require.toUrl('./renderChunk.txt'), document.baseURI).href; const generateBundleNamed = new URL(require.toUrl('./generateBundle.txt'), document.baseURI).href; exports.bannerNamed = bannerNamed; exports.footerNamed = footerNamed; exports.generateBundleNamed = generateBundleNamed; exports.introNamed = introNamed; exports.outroNamed = outroNamed; exports.renderChunkNamed = renderChunkNamed; exports.renderStart = renderStart; exports.renderStartNamed = renderStartNamed; exports.renderStartNamedImmediately = renderStartNamedImmediately; })); rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/outro.txt000066400000000000000000000000051450520414700320100ustar00rootroot00000000000000outrorollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/renderChunk.txt000066400000000000000000000000131450520414700331070ustar00rootroot00000000000000renderChunkrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/renderStart.txt000066400000000000000000000000131450520414700331340ustar00rootroot00000000000000renderStartrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/000077500000000000000000000000001450520414700301225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/000077500000000000000000000000001450520414700314245ustar00rootroot00000000000000banner-8c7ed2d9.txt000066400000000000000000000000061450520414700345760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsbannerfooter-0301844c.txt000066400000000000000000000000061450520414700343640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsfootergenerateBundle-b1a5f14c.txt000066400000000000000000000001011450520414700362260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsgenerateBundle cjs with assets/generateBundle-format-4efb05bc.txtgenerateBundle-format-4efb05bc.txt000066400000000000000000000000031450520414700376010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetscjsintro-c432b372.txt000066400000000000000000000000051450520414700343030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsintrooutro-1e5fe046.txt000066400000000000000000000000051450520414700344060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsoutrorenderChunk-aa9e49b7.txt000066400000000000000000000000131450520414700355730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsrenderChunkrenderStart-981aa2ea.txt000066400000000000000000000000131450520414700356060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsrenderStartrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/banner.txt000066400000000000000000000000061450520414700321240ustar00rootroot00000000000000bannerrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/footer.txt000066400000000000000000000000061450520414700321550ustar00rootroot00000000000000footergenerateBundle-format.txt000066400000000000000000000000031450520414700350070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjscjsrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/generateBundle.txt000066400000000000000000000001011450520414700335770ustar00rootroot00000000000000generateBundle cjs with assets/generateBundle-format-4efb05bc.txtrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/intro.txt000066400000000000000000000000051450520414700320110ustar00rootroot00000000000000introrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/main.js000066400000000000000000000044541450520414700314130ustar00rootroot00000000000000'use strict'; const renderStart = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/renderStart-981aa2ea.txt').href : new URL('assets/renderStart-981aa2ea.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const renderStartNamed = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/renderStart.txt').href : new URL('renderStart.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const renderStartNamedImmediately = 'renderStart.txt'; const bannerNamed = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/banner.txt').href : new URL('banner.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const footerNamed = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/footer.txt').href : new URL('footer.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const introNamed = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/intro.txt').href : new URL('intro.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const outroNamed = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/outro.txt').href : new URL('outro.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const renderChunkNamed = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/renderChunk.txt').href : new URL('renderChunk.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const generateBundleNamed = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/generateBundle.txt').href : new URL('generateBundle.txt', document.currentScript && document.currentScript.src || document.baseURI).href); exports.bannerNamed = bannerNamed; exports.footerNamed = footerNamed; exports.generateBundleNamed = generateBundleNamed; exports.introNamed = introNamed; exports.outroNamed = outroNamed; exports.renderChunkNamed = renderChunkNamed; exports.renderStart = renderStart; exports.renderStartNamed = renderStartNamed; exports.renderStartNamedImmediately = renderStartNamedImmediately; rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/outro.txt000066400000000000000000000000051450520414700320260ustar00rootroot00000000000000outrorollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/renderChunk.txt000066400000000000000000000000131450520414700331250ustar00rootroot00000000000000renderChunkrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/renderStart.txt000066400000000000000000000000131450520414700331520ustar00rootroot00000000000000renderStartrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/000077500000000000000000000000001450520414700277525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/000077500000000000000000000000001450520414700312545ustar00rootroot00000000000000banner-8c7ed2d9.txt000066400000000000000000000000061450520414700344260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsbannerfooter-0301844c.txt000066400000000000000000000000061450520414700342140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsfootergenerateBundle-668db42d.txt000066400000000000000000000001001450520414700360120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsgenerateBundle es with assets/generateBundle-format-c0bc1e08.txtgenerateBundle-format-c0bc1e08.txt000066400000000000000000000000021450520414700373430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsesintro-c432b372.txt000066400000000000000000000000051450520414700341330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsintrooutro-1e5fe046.txt000066400000000000000000000000051450520414700342360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsoutrorenderChunk-aa9e49b7.txt000066400000000000000000000000131450520414700354230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsrenderChunkrenderStart-981aa2ea.txt000066400000000000000000000000131450520414700354360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsrenderStartrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/banner.txt000066400000000000000000000000061450520414700317540ustar00rootroot00000000000000bannerrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/footer.txt000066400000000000000000000000061450520414700320050ustar00rootroot00000000000000footergenerateBundle-format.txt000066400000000000000000000000021450520414700346360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/esesrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/generateBundle.txt000066400000000000000000000001001450520414700334260ustar00rootroot00000000000000generateBundle es with assets/generateBundle-format-c0bc1e08.txtrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/intro.txt000066400000000000000000000000051450520414700316410ustar00rootroot00000000000000introrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/main.js000066400000000000000000000014251450520414700312360ustar00rootroot00000000000000const renderStart = new URL('assets/renderStart-981aa2ea.txt', import.meta.url).href; const renderStartNamed = new URL('renderStart.txt', import.meta.url).href; const renderStartNamedImmediately = 'renderStart.txt'; const bannerNamed = new URL('banner.txt', import.meta.url).href; const footerNamed = new URL('footer.txt', import.meta.url).href; const introNamed = new URL('intro.txt', import.meta.url).href; const outroNamed = new URL('outro.txt', import.meta.url).href; const renderChunkNamed = new URL('renderChunk.txt', import.meta.url).href; const generateBundleNamed = new URL('generateBundle.txt', import.meta.url).href; export { bannerNamed, footerNamed, generateBundleNamed, introNamed, outroNamed, renderChunkNamed, renderStart, renderStartNamed, renderStartNamedImmediately }; rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/outro.txt000066400000000000000000000000051450520414700316560ustar00rootroot00000000000000outrorollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/renderChunk.txt000066400000000000000000000000131450520414700327550ustar00rootroot00000000000000renderChunkrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/renderStart.txt000066400000000000000000000000131450520414700330020ustar00rootroot00000000000000renderStartrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/000077500000000000000000000000001450520414700306675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/000077500000000000000000000000001450520414700321715ustar00rootroot00000000000000banner-8c7ed2d9.txt000066400000000000000000000000061450520414700353430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsbannerfooter-0301844c.txt000066400000000000000000000000061450520414700351310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsfootergenerateBundle-b0505b8f.txt000066400000000000000000000001041450520414700367230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsgenerateBundle system with assets/generateBundle-format-bbc5e661.txtgenerateBundle-format-bbc5e661.txt000066400000000000000000000000061450520414700402740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetssystemintro-c432b372.txt000066400000000000000000000000051450520414700350500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsintrooutro-1e5fe046.txt000066400000000000000000000000051450520414700351530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsoutrorenderChunk-aa9e49b7.txt000066400000000000000000000000131450520414700363400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsrenderChunkrenderStart-981aa2ea.txt000066400000000000000000000000131450520414700363530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsrenderStartrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/banner.txt000066400000000000000000000000061450520414700326710ustar00rootroot00000000000000bannerrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/footer.txt000066400000000000000000000000061450520414700327220ustar00rootroot00000000000000footergenerateBundle-format.txt000066400000000000000000000000061450520414700355570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/systemsystemgenerateBundle.txt000066400000000000000000000001041450520414700342700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/systemgenerateBundle system with assets/generateBundle-format-bbc5e661.txtrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/intro.txt000066400000000000000000000000051450520414700325560ustar00rootroot00000000000000introrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/main.js000066400000000000000000000017741450520414700321620ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const renderStart = exports('renderStart', new URL('assets/renderStart-981aa2ea.txt', module.meta.url).href); const renderStartNamed = exports('renderStartNamed', new URL('renderStart.txt', module.meta.url).href); const renderStartNamedImmediately = exports('renderStartNamedImmediately', 'renderStart.txt'); const bannerNamed = exports('bannerNamed', new URL('banner.txt', module.meta.url).href); const footerNamed = exports('footerNamed', new URL('footer.txt', module.meta.url).href); const introNamed = exports('introNamed', new URL('intro.txt', module.meta.url).href); const outroNamed = exports('outroNamed', new URL('outro.txt', module.meta.url).href); const renderChunkNamed = exports('renderChunkNamed', new URL('renderChunk.txt', module.meta.url).href); const generateBundleNamed = exports('generateBundleNamed', new URL('generateBundle.txt', module.meta.url).href); }) }; })); rollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/outro.txt000066400000000000000000000000051450520414700325730ustar00rootroot00000000000000outrorollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/renderChunk.txt000066400000000000000000000000131450520414700336720ustar00rootroot00000000000000renderChunkrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/renderStart.txt000066400000000000000000000000131450520414700337170ustar00rootroot00000000000000renderStartrollup-3.29.4/test/chunking-form/samples/emit-file/set-asset-source/main.js000066400000000000000000000000251450520414700266620ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/empty-chunks/000077500000000000000000000000001450520414700227515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-chunks/_config.js000066400000000000000000000002351450520414700247130ustar00rootroot00000000000000module.exports = defineTest({ description: 'empty chunk pruning', expectedWarnings: ['EMPTY_BUNDLE'], options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/000077500000000000000000000000001450520414700247115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/amd/000077500000000000000000000000001450520414700254525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/amd/main1.js000066400000000000000000000000541450520414700270140ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/amd/main2.js000066400000000000000000000000541450520414700270150ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/cjs/000077500000000000000000000000001450520414700254705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/cjs/main1.js000066400000000000000000000000171450520414700270310ustar00rootroot00000000000000'use strict'; rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/cjs/main2.js000066400000000000000000000000171450520414700270320ustar00rootroot00000000000000'use strict'; rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/es/000077500000000000000000000000001450520414700253205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/es/main1.js000066400000000000000000000000011450520414700266520ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/es/main2.js000066400000000000000000000000011450520414700266530ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/system/000077500000000000000000000000001450520414700262355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/system/main1.js000066400000000000000000000001471450520414700276020ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/empty-chunks/_expected/system/main2.js000066400000000000000000000001471450520414700276030ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/empty-chunks/dep.js000066400000000000000000000000751450520414700240610ustar00rootroot00000000000000import {treeshaken} from './secondaryDep.js'; treeshaken(); rollup-3.29.4/test/chunking-form/samples/empty-chunks/main1.js000066400000000000000000000000221450520414700243060ustar00rootroot00000000000000import './dep.js';rollup-3.29.4/test/chunking-form/samples/empty-chunks/main2.js000066400000000000000000000000221450520414700243070ustar00rootroot00000000000000import './dep.js';rollup-3.29.4/test/chunking-form/samples/empty-chunks/secondaryDep.js000066400000000000000000000000401450520414700257210ustar00rootroot00000000000000export function treeshaken () {}rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/000077500000000000000000000000001450520414700253265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_config.js000066400000000000000000000032551450520414700272750ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { getObject } = require('../../../utils'); module.exports = defineTest({ description: 'associates empty modules with chunks if tree-shaking is disabled for them', options: { input: ['main1.js', 'main2.js'], plugins: { name: 'test-plugin', resolveId(id) { if (id.startsWith('empty')) { if (id === 'emptyResolved') { return { id, moduleSideEffects: 'no-treeshake' }; } return id; } }, load(id) { if (id.startsWith('empty')) { if (id === 'emptyLoaded') { return { code: '', moduleSideEffects: 'no-treeshake' }; } return ''; } }, transform(code, id) { if (id === 'emptyTransformed') { return { code: '', moduleSideEffects: 'no-treeshake' }; } }, generateBundle(options, bundle) { assert.deepStrictEqual( getObject( [...this.getModuleIds()].map(id => [ id.startsWith('empty') ? id : path.relative(__dirname, id), this.getModuleInfo(id).moduleSideEffects ]) ), { empty: true, emptyLoaded: 'no-treeshake', emptyResolved: 'no-treeshake', emptyTransformed: 'no-treeshake', 'main1.js': true, 'main2.js': true } ); assert.deepStrictEqual( getObject( Object.entries(bundle).map(([chunkId, chunk]) => [ chunkId, Object.keys(chunk.modules).map(moduleId => path.relative(__dirname, moduleId)) ]) ), { 'main1.js': ['emptyResolved', 'main1.js'], 'main2.js': ['emptyLoaded', 'main2.js'], 'generated-emptyTransformed.js': ['emptyTransformed'] } ); } } } }); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/000077500000000000000000000000001450520414700272665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/amd/000077500000000000000000000000001450520414700300275ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000000541450520414700356040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/amddefine((function () { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/amd/main1.js000066400000000000000000000001641450520414700313730ustar00rootroot00000000000000define(['./generated-emptyTransformed'], (function (emptyTransformed) { 'use strict'; console.log('main1'); })); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/amd/main2.js000066400000000000000000000001641450520414700313740ustar00rootroot00000000000000define(['./generated-emptyTransformed'], (function (emptyTransformed) { 'use strict'; console.log('main2'); })); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/cjs/000077500000000000000000000000001450520414700300455ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000000171450520414700356210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/cjs'use strict'; rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/cjs/main1.js000066400000000000000000000001221450520414700314030ustar00rootroot00000000000000'use strict'; require('./generated-emptyTransformed.js'); console.log('main1'); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/cjs/main2.js000066400000000000000000000001221450520414700314040ustar00rootroot00000000000000'use strict'; require('./generated-emptyTransformed.js'); console.log('main2'); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/es/000077500000000000000000000000001450520414700276755ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000000011450520414700354420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/es rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/es/main1.js000066400000000000000000000001011450520414700312300ustar00rootroot00000000000000import './generated-emptyTransformed.js'; console.log('main1'); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/es/main2.js000066400000000000000000000001011450520414700312310ustar00rootroot00000000000000import './generated-emptyTransformed.js'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/system/000077500000000000000000000000001450520414700306125ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000001471450520414700363720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/system/main1.js000066400000000000000000000002631450520414700321560ustar00rootroot00000000000000System.register(['./generated-emptyTransformed.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main1'); }) }; })); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/_expected/system/main2.js000066400000000000000000000002631450520414700321570ustar00rootroot00000000000000System.register(['./generated-emptyTransformed.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/main1.js000066400000000000000000000001311450520414700266640ustar00rootroot00000000000000import 'empty'; import 'emptyResolved'; import 'emptyTransformed'; console.log('main1'); rollup-3.29.4/test/chunking-form/samples/empty-module-no-treeshake/main2.js000066400000000000000000000001271450520414700266720ustar00rootroot00000000000000import 'empty'; import 'emptyLoaded'; import 'emptyTransformed'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/entry-aliases/000077500000000000000000000000001450520414700231025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-aliases/_config.js000066400000000000000000000003651450520414700250500ustar00rootroot00000000000000module.exports = defineTest({ description: 'alias module dependency inlining', options: { input: { 'main1.js': 'main1.js', 'main1-alias.js': 'main1.js', 'main2.js': 'main2.js' }, output: { entryFileNames: '[name]' } } }); rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/000077500000000000000000000000001450520414700250425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/amd/000077500000000000000000000000001450520414700256035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/amd/main1-alias.js000066400000000000000000000001651450520414700302370ustar00rootroot00000000000000define(['exports', './main1'], (function (exports, main1_js) { 'use strict'; exports.name = main1_js.name; })); rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/amd/main1.js000066400000000000000000000001521450520414700271440ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var name = 'name'; exports.name = name; })); rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/amd/main2.js000066400000000000000000000001351450520414700271460ustar00rootroot00000000000000define(['./main1'], (function (main1_js) { 'use strict'; console.log(main1_js.name); })); rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/cjs/000077500000000000000000000000001450520414700256215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/cjs/main1-alias.js000066400000000000000000000001261450520414700302520ustar00rootroot00000000000000'use strict'; var main1_js = require('./main1.js'); exports.name = main1_js.name; rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/cjs/main1.js000066400000000000000000000000701450520414700271610ustar00rootroot00000000000000'use strict'; var name = 'name'; exports.name = name; rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/cjs/main2.js000066400000000000000000000001221450520414700271600ustar00rootroot00000000000000'use strict'; var main1_js = require('./main1.js'); console.log(main1_js.name); rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/es/000077500000000000000000000000001450520414700254515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/es/main1-alias.js000066400000000000000000000000431450520414700301000ustar00rootroot00000000000000export { name } from './main1.js'; rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/es/main1.js000066400000000000000000000000451450520414700270130ustar00rootroot00000000000000var name = 'name'; export { name }; rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/es/main2.js000066400000000000000000000000671450520414700270200ustar00rootroot00000000000000import { name } from './main1.js'; console.log(name); rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/system/000077500000000000000000000000001450520414700263665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/system/main1-alias.js000066400000000000000000000003011450520414700310120ustar00rootroot00000000000000System.register(['./main1.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('name', module.name); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/system/main1.js000066400000000000000000000002241450520414700277270ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var name = exports('name', 'name'); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-aliases/_expected/system/main2.js000066400000000000000000000003201450520414700277250ustar00rootroot00000000000000System.register(['./main1.js'], (function () { 'use strict'; var name; return { setters: [function (module) { name = module.name; }], execute: (function () { console.log(name); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-aliases/dep.js000066400000000000000000000000321450520414700242030ustar00rootroot00000000000000export var name = 'name'; rollup-3.29.4/test/chunking-form/samples/entry-aliases/main1.js000066400000000000000000000000411450520414700244400ustar00rootroot00000000000000export { name } from './dep.js'; rollup-3.29.4/test/chunking-form/samples/entry-aliases/main2.js000066400000000000000000000000641450520414700244460ustar00rootroot00000000000000import { name } from './dep.js'; console.log(name); rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/000077500000000000000000000000001450520414700250325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_config.js000066400000000000000000000002031450520414700267670ustar00rootroot00000000000000module.exports = defineTest({ description: 'entry chunk export mode checks', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/000077500000000000000000000000001450520414700267725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/amd/000077500000000000000000000000001450520414700275335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/amd/main1.js000066400000000000000000000001071450520414700310740ustar00rootroot00000000000000define(['./main2'], (function (main2) { 'use strict'; main2(); })); rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/amd/main2.js000066400000000000000000000001541450520414700310770ustar00rootroot00000000000000define((function () { 'use strict'; function fn () { console.log('main fn'); } return fn; })); rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/cjs/000077500000000000000000000000001450520414700275515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/cjs/main1.js000066400000000000000000000000741450520414700311150ustar00rootroot00000000000000'use strict'; var main2 = require('./main2.js'); main2(); rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/cjs/main2.js000066400000000000000000000001221450520414700311100ustar00rootroot00000000000000'use strict'; function fn () { console.log('main fn'); } module.exports = fn; rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/es/000077500000000000000000000000001450520414700274015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/es/main1.js000066400000000000000000000000441450520414700307420ustar00rootroot00000000000000import fn from './main2.js'; fn(); rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/es/main2.js000066400000000000000000000001101450520414700307350ustar00rootroot00000000000000function fn () { console.log('main fn'); } export { fn as default }; rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/system/000077500000000000000000000000001450520414700303165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/system/main1.js000066400000000000000000000003021450520414700316540ustar00rootroot00000000000000System.register(['./main2.js'], (function () { 'use strict'; var fn; return { setters: [function (module) { fn = module.default; }], execute: (function () { fn(); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/_expected/system/main2.js000066400000000000000000000003221450520414700316570ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('default', fn); function fn () { console.log('main fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/main1.js000066400000000000000000000000451450520414700263740ustar00rootroot00000000000000import fn from './main2.js'; fn(); rollup-3.29.4/test/chunking-form/samples/entry-chunk-export-mode/main2.js000066400000000000000000000000741450520414700263770ustar00rootroot00000000000000export default function fn () { console.log('main fn'); } rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/000077500000000000000000000000001450520414700260245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_config.js000066400000000000000000000002621450520414700277660ustar00rootroot00000000000000module.exports = defineTest({ description: 'Handles entry points that contain no own code except imports and exports', options: { input: ['main.js', 'm1.js', 'm2.js'] } }); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/000077500000000000000000000000001450520414700277645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/000077500000000000000000000000001450520414700305255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/generated-m1.js000066400000000000000000000002461450520414700333360ustar00rootroot00000000000000define(['exports', './m2'], (function (exports, m2) { 'use strict'; var ms = /*#__PURE__*/Object.freeze({ __proto__: null, m2: m2 }); exports.ms = ms; })); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/m1.js000066400000000000000000000001371450520414700314010ustar00rootroot00000000000000define(['exports', './m2'], (function (exports, m2) { 'use strict'; exports.m2 = m2; })); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/m2.js000066400000000000000000000001101450520414700313710ustar00rootroot00000000000000define((function () { 'use strict'; var m2 = 'm2'; return m2; })); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/main.js000066400000000000000000000001421450520414700320040ustar00rootroot00000000000000define(['./generated-m1', './m2'], (function (m1, m2) { 'use strict'; console.log(m1.ms); })); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/000077500000000000000000000000001450520414700305435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/generated-m1.js000066400000000000000000000002031450520414700333450ustar00rootroot00000000000000'use strict'; var m2 = require('./m2.js'); var ms = /*#__PURE__*/Object.freeze({ __proto__: null, m2: m2 }); exports.ms = ms; rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/m1.js000066400000000000000000000001001450520414700314050ustar00rootroot00000000000000'use strict'; var m2 = require('./m2.js'); exports.m2 = m2; rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/m2.js000066400000000000000000000000641450520414700314170ustar00rootroot00000000000000'use strict'; var m2 = 'm2'; module.exports = m2; rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/main.js000066400000000000000000000001371450520414700320260ustar00rootroot00000000000000'use strict'; var m1 = require('./generated-m1.js'); require('./m2.js'); console.log(m1.ms); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/es/000077500000000000000000000000001450520414700303735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/es/generated-m1.js000066400000000000000000000001641450520414700332030ustar00rootroot00000000000000import m2 from './m2.js'; var ms = /*#__PURE__*/Object.freeze({ __proto__: null, m2: m2 }); export { ms as m }; rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/es/m1.js000066400000000000000000000000511450520414700312420ustar00rootroot00000000000000export { default as m2 } from './m2.js'; rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/es/m2.js000066400000000000000000000000521450520414700312440ustar00rootroot00000000000000var m2 = 'm2'; export { m2 as default }; rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/es/main.js000066400000000000000000000001211450520414700316470ustar00rootroot00000000000000import { m as ms } from './generated-m1.js'; import './m2.js'; console.log(ms); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/system/000077500000000000000000000000001450520414700313105ustar00rootroot00000000000000generated-m1.js000066400000000000000000000004421450520414700340400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/systemSystem.register(['./m2.js'], (function (exports) { 'use strict'; var m2; return { setters: [function (module) { m2 = module.default; }], execute: (function () { var ms = /*#__PURE__*/Object.freeze({ __proto__: null, m2: m2 }); exports('m', ms); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/system/m1.js000066400000000000000000000002771450520414700321710ustar00rootroot00000000000000System.register(['./m2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('m2', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/system/m2.js000066400000000000000000000002231450520414700321610ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var m2 = exports('default', 'm2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/_expected/system/main.js000066400000000000000000000003371450520414700325750ustar00rootroot00000000000000System.register(['./generated-m1.js', './m2.js'], (function () { 'use strict'; var ms; return { setters: [function (module) { ms = module.m; }, null], execute: (function () { console.log(ms); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/m1.js000066400000000000000000000000521450520414700266740ustar00rootroot00000000000000import m2 from './m2.js'; export { m2 }; rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/m2.js000066400000000000000000000000251450520414700266750ustar00rootroot00000000000000export default 'm2'; rollup-3.29.4/test/chunking-form/samples/entry-point-without-own-code/main.js000066400000000000000000000000611450520414700273030ustar00rootroot00000000000000import * as ms from './m1.js'; console.log(ms); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/000077500000000000000000000000001450520414700255165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_config.js000066400000000000000000000003021450520414700274530ustar00rootroot00000000000000module.exports = defineTest({ description: 'optimizes chunks when a dynamic entry point without own code is imported from another entry', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/000077500000000000000000000000001450520414700274565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/amd/000077500000000000000000000000001450520414700302175ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001501450520414700340520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 'foo'; exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/amd/main1.js000066400000000000000000000001461450520414700315630ustar00rootroot00000000000000define(['./generated-dynamic'], (function (dynamic) { 'use strict'; console.log(dynamic.foo); })); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/amd/main2.js000066400000000000000000000002621450520414700315630ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(console.log); })); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/cjs/000077500000000000000000000000001450520414700302355ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000000661450520414700340760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/cjs'use strict'; const foo = 'foo'; exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/cjs/main1.js000066400000000000000000000001331450520414700315750ustar00rootroot00000000000000'use strict'; var dynamic = require('./generated-dynamic.js'); console.log(dynamic.foo); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/cjs/main2.js000066400000000000000000000001641450520414700316020ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(console.log); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/es/000077500000000000000000000000001450520414700300655ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000000441450520414700337220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/esconst foo = 'foo'; export { foo }; rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/es/main1.js000066400000000000000000000001011450520414700314200ustar00rootroot00000000000000import { foo } from './generated-dynamic.js'; console.log(foo); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/es/main2.js000066400000000000000000000000641450520414700314310ustar00rootroot00000000000000import('./generated-dynamic.js').then(console.log); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/system/000077500000000000000000000000001450520414700310025ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002231450520414700346360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 'foo'); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/system/main1.js000066400000000000000000000003301450520414700323410ustar00rootroot00000000000000System.register(['./generated-dynamic.js'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.foo; }], execute: (function () { console.log(foo); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/_expected/system/main2.js000066400000000000000000000002631450520414700323470ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic.js').then(console.log); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/dynamic.js000066400000000000000000000000401450520414700274720ustar00rootroot00000000000000export { foo } from './foo.js'; rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/foo.js000066400000000000000000000000321450520414700266320ustar00rootroot00000000000000export const foo = 'foo'; rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/main1.js000066400000000000000000000000671450520414700270640ustar00rootroot00000000000000import { foo } from './dynamic.js'; console.log(foo); rollup-3.29.4/test/chunking-form/samples/entry-without-code-dynamic/main2.js000066400000000000000000000000521450520414700270570ustar00rootroot00000000000000import('./dynamic.js').then(console.log); rollup-3.29.4/test/chunking-form/samples/entry-without-code/000077500000000000000000000000001450520414700240745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code/_config.js000066400000000000000000000002731450520414700260400ustar00rootroot00000000000000module.exports = defineTest({ description: 'optimizes chunks when an entry point without own code is imported from another entry', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/000077500000000000000000000000001450520414700260345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/amd/000077500000000000000000000000001450520414700265755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/amd/main1.js000066400000000000000000000001261450520414700301370ustar00rootroot00000000000000define(['./main2'], (function (main2) { 'use strict'; console.log(main2.foo); })); rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/amd/main2.js000066400000000000000000000001501450520414700301350ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 'foo'; exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/cjs/000077500000000000000000000000001450520414700266135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/cjs/main1.js000066400000000000000000000001131450520414700301510ustar00rootroot00000000000000'use strict'; var main2 = require('./main2.js'); console.log(main2.foo); rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/cjs/main2.js000066400000000000000000000000661450520414700301610ustar00rootroot00000000000000'use strict'; const foo = 'foo'; exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/es/000077500000000000000000000000001450520414700264435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/es/main1.js000066400000000000000000000000651450520414700300070ustar00rootroot00000000000000import { foo } from './main2.js'; console.log(foo); rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/es/main2.js000066400000000000000000000000441450520414700300050ustar00rootroot00000000000000const foo = 'foo'; export { foo }; rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/system/000077500000000000000000000000001450520414700273605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/system/main1.js000066400000000000000000000003141450520414700307210ustar00rootroot00000000000000System.register(['./main2.js'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.foo; }], execute: (function () { console.log(foo); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-without-code/_expected/system/main2.js000066400000000000000000000002231450520414700307210ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 'foo'); }) }; })); rollup-3.29.4/test/chunking-form/samples/entry-without-code/foo.js000066400000000000000000000000321450520414700252100ustar00rootroot00000000000000export const foo = 'foo'; rollup-3.29.4/test/chunking-form/samples/entry-without-code/main1.js000066400000000000000000000000651450520414700254400ustar00rootroot00000000000000import { foo } from './main2.js'; console.log(foo); rollup-3.29.4/test/chunking-form/samples/entry-without-code/main2.js000066400000000000000000000000401450520414700254320ustar00rootroot00000000000000export { foo } from './foo.js'; rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/000077500000000000000000000000001450520414700243225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_config.js000066400000000000000000000002421450520414700262620ustar00rootroot00000000000000module.exports = defineTest({ description: 'entry point facade creation', options: { input: { main1alias: 'main1.js', main2alias: 'main2.js' } } }); rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/000077500000000000000000000000001450520414700262625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/000077500000000000000000000000001450520414700270235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/generated-main2.js000066400000000000000000000003061450520414700323220ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main1alias.js000066400000000000000000000001551450520414700314010ustar00rootroot00000000000000define(['./generated-main2'], (function (main2alias) { 'use strict'; main2alias.log(main2alias.dep); })); rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main2alias.js000066400000000000000000000001461450520414700314020ustar00rootroot00000000000000define(['./generated-main2'], (function (main2alias) { 'use strict'; return main2alias.log; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/000077500000000000000000000000001450520414700270415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/generated-main2.js000066400000000000000000000002061450520414700323370ustar00rootroot00000000000000'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main1alias.js000066400000000000000000000001421450520414700314130ustar00rootroot00000000000000'use strict'; var main2alias = require('./generated-main2.js'); main2alias.log(main2alias.dep); rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main2alias.js000066400000000000000000000001451450520414700314170ustar00rootroot00000000000000'use strict'; var main2alias = require('./generated-main2.js'); module.exports = main2alias.log; rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/es/000077500000000000000000000000001450520414700266715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/es/generated-main2.js000066400000000000000000000001601450520414700321660ustar00rootroot00000000000000var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } export { dep as d, log as l }; rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main1alias.js000066400000000000000000000001061450520414700312430ustar00rootroot00000000000000import { l as log, d as dep } from './generated-main2.js'; log(dep); rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main2alias.js000066400000000000000000000000651450520414700312500ustar00rootroot00000000000000export { l as default } from './generated-main2.js'; rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/system/000077500000000000000000000000001450520414700276065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/system/generated-main2.js000066400000000000000000000004201450520414700331020ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('l', log); var dep = exports('d', { x: 42 }); function log (x) { if (dep) { console.log(x); } } }) }; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main1alias.js000066400000000000000000000003441450520414700321640ustar00rootroot00000000000000System.register(['./generated-main2.js'], (function () { 'use strict'; var log, dep; return { setters: [function (module) { log = module.l; dep = module.d; }], execute: (function () { log(dep); }) }; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main2alias.js000066400000000000000000000003131450520414700321610ustar00rootroot00000000000000System.register(['./generated-main2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.l); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/dep.js000066400000000000000000000000301450520414700254210ustar00rootroot00000000000000export default { x: 42 }rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/main1.js000066400000000000000000000001041450520414700256600ustar00rootroot00000000000000import dep from './dep.js'; import log from './main2.js'; log(dep);rollup-3.29.4/test/chunking-form/samples/entrypoint-aliasing/main2.js000066400000000000000000000001451450520414700256660ustar00rootroot00000000000000import dep from './dep.js'; export default function log (x) { if (dep) { console.log(x); } }rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/000077500000000000000000000000001450520414700237365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_config.js000066400000000000000000000002001450520414700256700ustar00rootroot00000000000000module.exports = defineTest({ description: 'entry point facade creation', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/000077500000000000000000000000001450520414700256765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/amd/000077500000000000000000000000001450520414700264375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/amd/generated-main2.js000066400000000000000000000003061450520414700317360ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/amd/main1.js000066400000000000000000000001361450520414700300020ustar00rootroot00000000000000define(['./generated-main2'], (function (main2) { 'use strict'; main2.log(main2.dep); })); rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/amd/main2.js000066400000000000000000000001341450520414700300010ustar00rootroot00000000000000define(['./generated-main2'], (function (main2) { 'use strict'; return main2.log; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/cjs/000077500000000000000000000000001450520414700264555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/cjs/generated-main2.js000066400000000000000000000002061450520414700317530ustar00rootroot00000000000000'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main1.js000066400000000000000000000001231450520414700300140ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main2.js'); main2.log(main2.dep); rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main2.js000066400000000000000000000001331450520414700300160ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main2.js'); module.exports = main2.log; rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/es/000077500000000000000000000000001450520414700263055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/es/generated-main2.js000066400000000000000000000001601450520414700316020ustar00rootroot00000000000000var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } export { dep as d, log as l }; rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/es/main1.js000066400000000000000000000001061450520414700276450ustar00rootroot00000000000000import { l as log, d as dep } from './generated-main2.js'; log(dep); rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/es/main2.js000066400000000000000000000000651450520414700276520ustar00rootroot00000000000000export { l as default } from './generated-main2.js'; rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/system/000077500000000000000000000000001450520414700272225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/system/generated-main2.js000066400000000000000000000004201450520414700325160ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('l', log); var dep = exports('d', { x: 42 }); function log (x) { if (dep) { console.log(x); } } }) }; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/system/main1.js000066400000000000000000000003441450520414700305660ustar00rootroot00000000000000System.register(['./generated-main2.js'], (function () { 'use strict'; var log, dep; return { setters: [function (module) { log = module.l; dep = module.d; }], execute: (function () { log(dep); }) }; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/_expected/system/main2.js000066400000000000000000000003131450520414700305630ustar00rootroot00000000000000System.register(['./generated-main2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.l); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/dep.js000066400000000000000000000000301450520414700250350ustar00rootroot00000000000000export default { x: 42 }rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/main1.js000066400000000000000000000001041450520414700252740ustar00rootroot00000000000000import dep from './dep.js'; import log from './main2.js'; log(dep);rollup-3.29.4/test/chunking-form/samples/entrypoint-facade/main2.js000066400000000000000000000001451450520414700253020ustar00rootroot00000000000000import dep from './dep.js'; export default function log (x) { if (dep) { console.log(x); } }rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/000077500000000000000000000000001450520414700253655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_config.js000066400000000000000000000002151450520414700273250ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly imports the default from an entry point', options: { input: ['main', 'dep'] } }); rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/000077500000000000000000000000001450520414700273255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/amd/000077500000000000000000000000001450520414700300665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/amd/dep.js000066400000000000000000000001101450520414700311640ustar00rootroot00000000000000define((function () { 'use strict'; var dep = 42; return dep; })); rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/amd/main.js000066400000000000000000000001451450520414700313500ustar00rootroot00000000000000define(['exports', './dep'], (function (exports, dep) { 'use strict'; exports.value = dep; })); rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/cjs/000077500000000000000000000000001450520414700301045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/cjs/dep.js000066400000000000000000000000641450520414700312120ustar00rootroot00000000000000'use strict'; var dep = 42; module.exports = dep; rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/cjs/main.js000066400000000000000000000001061450520414700313630ustar00rootroot00000000000000'use strict'; var dep = require('./dep.js'); exports.value = dep; rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/es/000077500000000000000000000000001450520414700277345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/es/dep.js000066400000000000000000000000521450520414700310370ustar00rootroot00000000000000var dep = 42; export { dep as default }; rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/es/main.js000066400000000000000000000000551450520414700312160ustar00rootroot00000000000000export { default as value } from './dep.js'; rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/system/000077500000000000000000000000001450520414700306515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/system/dep.js000066400000000000000000000002221450520414700317530ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var dep = exports('default', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/_expected/system/main.js000066400000000000000000000003031450520414700321270ustar00rootroot00000000000000System.register(['./dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/dep.js000066400000000000000000000000231450520414700264660ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/export-default-from-entry/main.js000066400000000000000000000000501450520414700266420ustar00rootroot00000000000000export {default as value} from './dep'; rollup-3.29.4/test/chunking-form/samples/external-imports/000077500000000000000000000000001450520414700236375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-imports/_config.js000066400000000000000000000004321450520414700256000ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses correct interop per chunk when importing from external modules', options: { external: module => module.includes('external'), input: ['main-default.js', 'main-named.js', 'main-namespace'], output: { interop: 'compat' } } }); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/000077500000000000000000000000001450520414700255775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/amd/000077500000000000000000000000001450520414700263405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/amd/main-default.js000066400000000000000000000011551450520414700312460ustar00rootroot00000000000000define(['external-all', 'external-default', 'external-default-named', 'external-default-namespace'], (function (foo, bar, baz, quux) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } var foo__default = /*#__PURE__*/_interopDefaultCompat(foo); var bar__default = /*#__PURE__*/_interopDefaultCompat(bar); var baz__default = /*#__PURE__*/_interopDefaultCompat(baz); var quux__default = /*#__PURE__*/_interopDefaultCompat(quux); console.log(foo__default.default, bar__default.default, baz__default.default, quux__default.default); })); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/amd/main-named.js000066400000000000000000000003401450520414700307010ustar00rootroot00000000000000define(['external-all', 'external-named', 'external-default-named', 'external-named-namespace'], (function (foo, externalNamed, baz, quux) { 'use strict'; console.log(foo.foo, externalNamed.bar, baz.baz, quux.quux); })); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/amd/main-namespace.js000066400000000000000000000017021450520414700315540ustar00rootroot00000000000000define(['external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], (function (foo, bar, quux, quux$1) { 'use strict'; function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo); var bar__namespace = /*#__PURE__*/_interopNamespaceCompat(bar); var quux__namespace = /*#__PURE__*/_interopNamespaceCompat(quux); var quux__namespace$1 = /*#__PURE__*/_interopNamespaceCompat(quux$1); console.log(foo__namespace, bar__namespace, quux__namespace, quux__namespace$1); })); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/cjs/000077500000000000000000000000001450520414700263565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/cjs/main-default.js000066400000000000000000000012041450520414700312570ustar00rootroot00000000000000'use strict'; var foo = require('external-all'); var bar = require('external-default'); var baz = require('external-default-named'); var quux = require('external-default-namespace'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } var foo__default = /*#__PURE__*/_interopDefaultCompat(foo); var bar__default = /*#__PURE__*/_interopDefaultCompat(bar); var baz__default = /*#__PURE__*/_interopDefaultCompat(baz); var quux__default = /*#__PURE__*/_interopDefaultCompat(quux); console.log(foo__default.default, bar__default.default, baz__default.default, quux__default.default); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/cjs/main-named.js000066400000000000000000000003741450520414700307260ustar00rootroot00000000000000'use strict'; var foo = require('external-all'); var externalNamed = require('external-named'); var baz = require('external-default-named'); var quux = require('external-named-namespace'); console.log(foo.foo, externalNamed.bar, baz.baz, quux.quux); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/cjs/main-namespace.js000066400000000000000000000017111450520414700315720ustar00rootroot00000000000000'use strict'; var foo = require('external-all'); var bar = require('external-namespace'); var quux = require('external-default-namespace'); var quux$1 = require('external-named-namespace'); function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo); var bar__namespace = /*#__PURE__*/_interopNamespaceCompat(bar); var quux__namespace = /*#__PURE__*/_interopNamespaceCompat(quux); var quux__namespace$1 = /*#__PURE__*/_interopNamespaceCompat(quux$1); console.log(foo__namespace, bar__namespace, quux__namespace, quux__namespace$1); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/es/000077500000000000000000000000001450520414700262065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/es/main-default.js000066400000000000000000000003441450520414700311130ustar00rootroot00000000000000import foo__default from 'external-all'; import bar from 'external-default'; import baz from 'external-default-named'; import quux__default from 'external-default-namespace'; console.log(foo__default, bar, baz, quux__default); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/es/main-named.js000066400000000000000000000003141450520414700305500ustar00rootroot00000000000000import { foo } from 'external-all'; import { bar } from 'external-named'; import { baz } from 'external-default-named'; import { quux } from 'external-named-namespace'; console.log(foo, bar, baz, quux); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/es/main-namespace.js000066400000000000000000000003361450520414700314240ustar00rootroot00000000000000import * as foo from 'external-all'; import * as bar from 'external-namespace'; import * as quux from 'external-default-namespace'; import * as quux$1 from 'external-named-namespace'; console.log(foo, bar, quux, quux$1); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/system/000077500000000000000000000000001450520414700271235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/system/main-default.js000066400000000000000000000010131450520414700320220ustar00rootroot00000000000000System.register(['external-all', 'external-default', 'external-default-named', 'external-default-namespace'], (function () { 'use strict'; var foo__default, bar, baz, quux__default; return { setters: [function (module) { foo__default = module.default; }, function (module) { bar = module.default; }, function (module) { baz = module.default; }, function (module) { quux__default = module.default; }], execute: (function () { console.log(foo__default, bar, baz, quux__default); }) }; })); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/system/main-named.js000066400000000000000000000007021450520414700314660ustar00rootroot00000000000000System.register(['external-all', 'external-named', 'external-default-named', 'external-named-namespace'], (function () { 'use strict'; var foo, bar, baz, quux; return { setters: [function (module) { foo = module.foo; }, function (module) { bar = module.bar; }, function (module) { baz = module.baz; }, function (module) { quux = module.quux; }], execute: (function () { console.log(foo, bar, baz, quux); }) }; })); rollup-3.29.4/test/chunking-form/samples/external-imports/_expected/system/main-namespace.js000066400000000000000000000007021450520414700323360ustar00rootroot00000000000000System.register(['external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], (function () { 'use strict'; var foo, bar, quux, quux$1; return { setters: [function (module) { foo = module; }, function (module) { bar = module; }, function (module) { quux = module; }, function (module) { quux$1 = module; }], execute: (function () { console.log(foo, bar, quux, quux$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/external-imports/main-default.js000066400000000000000000000002771450520414700265510ustar00rootroot00000000000000import foo from 'external-all'; import bar from 'external-default'; import baz from 'external-default-named'; import quux from 'external-default-namespace'; console.log(foo, bar, baz, quux); rollup-3.29.4/test/chunking-form/samples/external-imports/main-named.js000066400000000000000000000003131450520414700262000ustar00rootroot00000000000000import { foo } from 'external-all'; import { bar } from 'external-named'; import { baz } from 'external-default-named'; import { quux } from 'external-named-namespace'; console.log(foo, bar, baz, quux); rollup-3.29.4/test/chunking-form/samples/external-imports/main-namespace.js000066400000000000000000000003271450520414700270550ustar00rootroot00000000000000import * as foo from 'external-all'; import * as bar from 'external-namespace'; import * as baz from 'external-default-namespace'; import * as quux from 'external-named-namespace'; console.log(foo, bar, baz, quux); rollup-3.29.4/test/chunking-form/samples/external-reexports/000077500000000000000000000000001450520414700241755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-reexports/_config.js000066400000000000000000000004341450520414700261400ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses correct interop per chunk when reexporting from external modules', options: { external: module => module.includes('external'), input: ['main-default.js', 'main-named.js', 'main-namespace'], output: { interop: 'compat' } } }); rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/000077500000000000000000000000001450520414700261355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/amd/000077500000000000000000000000001450520414700266765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/amd/main-default.js000066400000000000000000000023321450520414700316020ustar00rootroot00000000000000define(['exports', 'external-all', 'external-default', 'external-default-named', 'external-default-namespace'], (function (exports, externalAll, externalDefault, externalDefaultNamed, externalDefaultNamespace) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } var externalAll__default = /*#__PURE__*/_interopDefaultCompat(externalAll); var externalDefault__default = /*#__PURE__*/_interopDefaultCompat(externalDefault); var externalDefaultNamed__default = /*#__PURE__*/_interopDefaultCompat(externalDefaultNamed); var externalDefaultNamespace__default = /*#__PURE__*/_interopDefaultCompat(externalDefaultNamespace); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return externalAll__default.default; } }); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return externalDefault__default.default; } }); Object.defineProperty(exports, 'baz', { enumerable: true, get: function () { return externalDefaultNamed__default.default; } }); Object.defineProperty(exports, 'quux', { enumerable: true, get: function () { return externalDefaultNamespace__default.default; } }); })); rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/amd/main-named.js000066400000000000000000000012771450520414700312510ustar00rootroot00000000000000define(['exports', 'external-all', 'external-named', 'external-default-named', 'external-named-namespace'], (function (exports, externalAll, externalNamed, externalDefaultNamed, externalNamedNamespace) { 'use strict'; Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return externalAll.foo; } }); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return externalNamed.bar; } }); Object.defineProperty(exports, 'baz', { enumerable: true, get: function () { return externalDefaultNamed.baz; } }); Object.defineProperty(exports, 'quux', { enumerable: true, get: function () { return externalNamedNamespace.quux; } }); })); rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/amd/main-namespace.js000066400000000000000000000025521450520414700321160ustar00rootroot00000000000000define(['exports', 'external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], (function (exports, externalAll, externalNamespace$1, externalDefaultNamespace, externalNamedNamespace) { 'use strict'; function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var externalAll__namespace = /*#__PURE__*/_interopNamespaceCompat(externalAll); var externalNamespace__namespace = /*#__PURE__*/_interopNamespaceCompat(externalNamespace$1); var externalDefaultNamespace__namespace = /*#__PURE__*/_interopNamespaceCompat(externalDefaultNamespace); var externalNamedNamespace__namespace = /*#__PURE__*/_interopNamespaceCompat(externalNamedNamespace); const externalNamespace = 1; const externalNamespace__ns = 1; console.log(externalNamespace, externalNamespace__ns); exports.foo = externalAll__namespace; exports.bar = externalNamespace__namespace; exports.baz = externalDefaultNamespace__namespace; exports.quux = externalNamedNamespace__namespace; })); rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/cjs/000077500000000000000000000000001450520414700267145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/cjs/main-default.js000066400000000000000000000023161450520414700316220ustar00rootroot00000000000000'use strict'; var externalAll = require('external-all'); var externalDefault = require('external-default'); var externalDefaultNamed = require('external-default-named'); var externalDefaultNamespace = require('external-default-namespace'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } var externalAll__default = /*#__PURE__*/_interopDefaultCompat(externalAll); var externalDefault__default = /*#__PURE__*/_interopDefaultCompat(externalDefault); var externalDefaultNamed__default = /*#__PURE__*/_interopDefaultCompat(externalDefaultNamed); var externalDefaultNamespace__default = /*#__PURE__*/_interopDefaultCompat(externalDefaultNamespace); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return externalAll__default.default; } }); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return externalDefault__default.default; } }); Object.defineProperty(exports, 'baz', { enumerable: true, get: function () { return externalDefaultNamed__default.default; } }); Object.defineProperty(exports, 'quux', { enumerable: true, get: function () { return externalDefaultNamespace__default.default; } }); rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/cjs/main-named.js000066400000000000000000000012701450520414700312600ustar00rootroot00000000000000'use strict'; var externalAll = require('external-all'); var externalNamed = require('external-named'); var externalDefaultNamed = require('external-default-named'); var externalNamedNamespace = require('external-named-namespace'); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return externalAll.foo; } }); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return externalNamed.bar; } }); Object.defineProperty(exports, 'baz', { enumerable: true, get: function () { return externalDefaultNamed.baz; } }); Object.defineProperty(exports, 'quux', { enumerable: true, get: function () { return externalNamedNamespace.quux; } }); rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/cjs/main-namespace.js000066400000000000000000000025271450520414700321360ustar00rootroot00000000000000'use strict'; var externalAll = require('external-all'); var externalNamespace$1 = require('external-namespace'); var externalDefaultNamespace = require('external-default-namespace'); var externalNamedNamespace = require('external-named-namespace'); function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var externalAll__namespace = /*#__PURE__*/_interopNamespaceCompat(externalAll); var externalNamespace__namespace = /*#__PURE__*/_interopNamespaceCompat(externalNamespace$1); var externalDefaultNamespace__namespace = /*#__PURE__*/_interopNamespaceCompat(externalDefaultNamespace); var externalNamedNamespace__namespace = /*#__PURE__*/_interopNamespaceCompat(externalNamedNamespace); const externalNamespace = 1; const externalNamespace__ns = 1; console.log(externalNamespace, externalNamespace__ns); exports.foo = externalAll__namespace; exports.bar = externalNamespace__namespace; exports.baz = externalDefaultNamespace__namespace; exports.quux = externalNamedNamespace__namespace; rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/es/000077500000000000000000000000001450520414700265445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/es/main-default.js000066400000000000000000000003311450520414700314450ustar00rootroot00000000000000export { default as foo } from 'external-all'; export { default as bar } from 'external-default'; export { default as baz } from 'external-default-named'; export { default as quux } from 'external-default-namespace'; rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/es/main-named.js000066400000000000000000000002511450520414700311060ustar00rootroot00000000000000export { foo } from 'external-all'; export { bar } from 'external-named'; export { baz } from 'external-default-named'; export { quux } from 'external-named-namespace'; rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/es/main-namespace.js000066400000000000000000000010071450520414700317560ustar00rootroot00000000000000import * as externalAll from 'external-all'; export { externalAll as foo }; import * as externalNamespace$1 from 'external-namespace'; export { externalNamespace$1 as bar }; import * as externalDefaultNamespace from 'external-default-namespace'; export { externalDefaultNamespace as baz }; import * as externalNamedNamespace from 'external-named-namespace'; export { externalNamedNamespace as quux }; const externalNamespace = 1; const externalNamespace__ns = 1; console.log(externalNamespace, externalNamespace__ns); rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/system/000077500000000000000000000000001450520414700274615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/system/main-default.js000066400000000000000000000007061450520414700323700ustar00rootroot00000000000000System.register(['external-all', 'external-default', 'external-default-named', 'external-default-namespace'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.default); }, function (module) { exports('bar', module.default); }, function (module) { exports('baz', module.default); }, function (module) { exports('quux', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/system/main-named.js000066400000000000000000000006631450520414700320320ustar00rootroot00000000000000System.register(['external-all', 'external-named', 'external-default-named', 'external-named-namespace'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.foo); }, function (module) { exports('bar', module.bar); }, function (module) { exports('baz', module.baz); }, function (module) { exports('quux', module.quux); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/external-reexports/_expected/system/main-namespace.js000066400000000000000000000010471450520414700326770ustar00rootroot00000000000000System.register(['external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module); }, function (module) { exports('bar', module); }, function (module) { exports('baz', module); }, function (module) { exports('quux', module); }], execute: (function () { const externalNamespace = 1; const externalNamespace__ns = 1; console.log(externalNamespace, externalNamespace__ns); }) }; })); rollup-3.29.4/test/chunking-form/samples/external-reexports/main-default.js000066400000000000000000000003311450520414700270760ustar00rootroot00000000000000export { default as foo } from 'external-all'; export { default as bar } from 'external-default'; export { default as baz } from 'external-default-named'; export { default as quux } from 'external-default-namespace'; rollup-3.29.4/test/chunking-form/samples/external-reexports/main-named.js000066400000000000000000000002511450520414700265370ustar00rootroot00000000000000export { foo } from 'external-all'; export { bar } from 'external-named'; export { baz } from 'external-default-named'; export { quux } from 'external-named-namespace'; rollup-3.29.4/test/chunking-form/samples/external-reexports/main-namespace.js000066400000000000000000000004531450520414700274130ustar00rootroot00000000000000export * as foo from 'external-all'; export * as bar from 'external-namespace'; export * as baz from 'external-default-namespace'; export * as quux from 'external-named-namespace'; const externalNamespace = 1; const externalNamespace__ns = 1; console.log(externalNamespace, externalNamespace__ns); rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/000077500000000000000000000000001450520414700265325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_config.js000066400000000000000000000003521450520414700304740ustar00rootroot00000000000000module.exports = defineTest({ description: 'ignores external reexports of other entries when finding facades', options: { external: ['external'], input: ['main.js', 'other.js'] }, expectedWarnings: ['CIRCULAR_DEPENDENCY'] }); rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/000077500000000000000000000000001450520414700304725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/amd/000077500000000000000000000000001450520414700312335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/amd/main.js000066400000000000000000000003271450520414700325170ustar00rootroot00000000000000define(['exports', './other', 'external'], (function (exports, other, external) { 'use strict'; Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external.foo; } }); })); rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/amd/other.js000066400000000000000000000003621450520414700327130ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; console.log('other'); console.log('main'); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external.bar; } }); })); rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/cjs/000077500000000000000000000000001450520414700312515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/cjs/main.js000066400000000000000000000002671450520414700325400ustar00rootroot00000000000000'use strict'; require('./other.js'); var external = require('external'); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external.foo; } }); rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/cjs/other.js000066400000000000000000000003131450520414700327250ustar00rootroot00000000000000'use strict'; var external = require('external'); console.log('other'); console.log('main'); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external.bar; } }); rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/es/000077500000000000000000000000001450520414700311015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/es/main.js000066400000000000000000000000651450520414700323640ustar00rootroot00000000000000import './other.js'; export { foo } from 'external'; rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/es/other.js000066400000000000000000000001151450520414700325550ustar00rootroot00000000000000export { bar } from 'external'; console.log('other'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/system/000077500000000000000000000000001450520414700320165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/system/main.js000066400000000000000000000003211450520414700332740ustar00rootroot00000000000000System.register(['./other.js', 'external'], (function (exports) { 'use strict'; return { setters: [null, function (module) { exports('foo', module.foo); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/_expected/system/other.js000066400000000000000000000003561450520414700335010ustar00rootroot00000000000000System.register(['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('bar', module.bar); }], execute: (function () { console.log('other'); console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/main.js000066400000000000000000000001071450520414700300120ustar00rootroot00000000000000import './other'; console.log('main'); export { foo } from 'external'; rollup-3.29.4/test/chunking-form/samples/facades-with-external-reexports/other.js000066400000000000000000000001071450520414700302070ustar00rootroot00000000000000import './main'; console.log('other'); export { bar } from 'external'; rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/000077500000000000000000000000001450520414700247125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_config.js000066400000000000000000000003231450520414700266520ustar00rootroot00000000000000module.exports = defineTest({ description: 'ignores reexports of other entries when finding facades', options: { input: ['main.js', 'other.js', 'third.js'] }, expectedWarnings: ['CIRCULAR_DEPENDENCY'] }); rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/000077500000000000000000000000001450520414700266525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/amd/000077500000000000000000000000001450520414700274135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/amd/main.js000066400000000000000000000001771450520414700307020ustar00rootroot00000000000000define(['exports', './other', './third'], (function (exports, other, third) { 'use strict'; exports.foo = third.foo; })); rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/amd/other.js000066400000000000000000000002321450520414700310670ustar00rootroot00000000000000define(['exports', './third'], (function (exports, third) { 'use strict'; console.log('other'); console.log('main'); exports.bar = third.bar; })); rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/amd/third.js000066400000000000000000000002471450520414700310660ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('third'); const foo = 'foo'; const bar = 'bar'; exports.bar = bar; exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/cjs/000077500000000000000000000000001450520414700274315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/cjs/main.js000066400000000000000000000001451450520414700307130ustar00rootroot00000000000000'use strict'; require('./other.js'); var third = require('./third.js'); exports.foo = third.foo; rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/cjs/other.js000066400000000000000000000001711450520414700311070ustar00rootroot00000000000000'use strict'; var third = require('./third.js'); console.log('other'); console.log('main'); exports.bar = third.bar; rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/cjs/third.js000066400000000000000000000001621450520414700311000ustar00rootroot00000000000000'use strict'; console.log('third'); const foo = 'foo'; const bar = 'bar'; exports.bar = bar; exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/es/000077500000000000000000000000001450520414700272615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/es/main.js000066400000000000000000000000671450520414700305460ustar00rootroot00000000000000import './other.js'; export { foo } from './third.js'; rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/es/other.js000066400000000000000000000001171450520414700307370ustar00rootroot00000000000000export { bar } from './third.js'; console.log('other'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/es/third.js000066400000000000000000000001221450520414700307240ustar00rootroot00000000000000console.log('third'); const foo = 'foo'; const bar = 'bar'; export { bar, foo }; rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/system/000077500000000000000000000000001450520414700301765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/system/main.js000066400000000000000000000003231450520414700314560ustar00rootroot00000000000000System.register(['./other.js', './third.js'], (function (exports) { 'use strict'; return { setters: [null, function (module) { exports('foo', module.foo); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/system/other.js000066400000000000000000000003601450520414700316540ustar00rootroot00000000000000System.register(['./third.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('bar', module.bar); }], execute: (function () { console.log('other'); console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/_expected/system/third.js000066400000000000000000000003221450520414700316430ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('third'); const foo = exports('foo', 'foo'); const bar = exports('bar', 'bar'); }) }; })); rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/main.js000066400000000000000000000001061450520414700261710ustar00rootroot00000000000000import './other'; console.log('main'); export { foo } from './third'; rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/other.js000066400000000000000000000001061450520414700263660ustar00rootroot00000000000000import './main'; console.log('other'); export { bar } from './third'; rollup-3.29.4/test/chunking-form/samples/facades-with-reexports/third.js000066400000000000000000000001121450520414700263540ustar00rootroot00000000000000console.log('third'); export const foo = 'foo'; export const bar = 'bar'; rollup-3.29.4/test/chunking-form/samples/filenames-patterns/000077500000000000000000000000001450520414700241235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_config.js000066400000000000000000000003711450520414700260660ustar00rootroot00000000000000module.exports = defineTest({ description: 'filenames custom pattern', options: { input: ['main1.js', 'main2.js'], output: { entryFileNames: 'entry-[name]-[hash]-[format].js', chunkFileNames: 'chunk-[name]-[hash]-[format].js' } } }); rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/000077500000000000000000000000001450520414700260635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/amd/000077500000000000000000000000001450520414700266245ustar00rootroot00000000000000chunk-main2-a7baadb6-amd.js000066400000000000000000000003061450520414700333220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; })); entry-main1-94fe149e-amd.js000066400000000000000000000001471450520414700331600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/amddefine(['./chunk-main2-a7baadb6-amd'], (function (main2) { 'use strict'; main2.log(main2.dep); })); entry-main2-16bafa95-amd.js000066400000000000000000000001451450520414700332230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/amddefine(['./chunk-main2-a7baadb6-amd'], (function (main2) { 'use strict'; return main2.log; })); rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/cjs/000077500000000000000000000000001450520414700266425ustar00rootroot00000000000000chunk-main2-399c15fc-cjs.js000066400000000000000000000002061450520414700331540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/cjs'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; entry-main1-2934d4fa-cjs.js000066400000000000000000000001341450520414700331760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/cjs'use strict'; var main2 = require('./chunk-main2-399c15fc-cjs.js'); main2.log(main2.dep); entry-main2-523204ff-cjs.js000066400000000000000000000001441450520414700331130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/cjs'use strict'; var main2 = require('./chunk-main2-399c15fc-cjs.js'); module.exports = main2.log; rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/es/000077500000000000000000000000001450520414700264725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-c42fce1a-es.js000066400000000000000000000001601450520414700330340ustar00rootroot00000000000000var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } export { dep as d, log as l }; rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-6f12c5b2-es.js000066400000000000000000000001161450520414700327270ustar00rootroot00000000000000import { l as log, d as dep } from './chunk-main2-c42fce1a-es.js'; log(dep); rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-a9b323b4-es.js000066400000000000000000000000751450520414700327330ustar00rootroot00000000000000export { l as default } from './chunk-main2-c42fce1a-es.js'; rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/system/000077500000000000000000000000001450520414700274075ustar00rootroot00000000000000chunk-main2-9cc03624-system.js000066400000000000000000000004201450520414700343730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('l', log); var dep = exports('d', { x: 42 }); function log (x) { if (dep) { console.log(x); } } }) }; })); entry-main1-720299cf-system.js000066400000000000000000000003601450520414700344360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/systemSystem.register(['./chunk-main2-9cc03624-system.js'], (function () { 'use strict'; var log, dep; return { setters: [function (module) { log = module.l; dep = module.d; }], execute: (function () { log(dep); }) }; })); entry-main2-c3cb1622-system.js000066400000000000000000000003271450520414700345020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/filenames-patterns/_expected/systemSystem.register(['./chunk-main2-9cc03624-system.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.l); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/filenames-patterns/dep.js000066400000000000000000000000301450520414700252220ustar00rootroot00000000000000export default { x: 42 }rollup-3.29.4/test/chunking-form/samples/filenames-patterns/main1.js000066400000000000000000000001041450520414700254610ustar00rootroot00000000000000import dep from './dep.js'; import log from './main2.js'; log(dep);rollup-3.29.4/test/chunking-form/samples/filenames-patterns/main2.js000066400000000000000000000001451450520414700254670ustar00rootroot00000000000000import dep from './dep.js'; export default function log (x) { if (dep) { console.log(x); } }rollup-3.29.4/test/chunking-form/samples/generated-code/000077500000000000000000000000001450520414700231705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/000077500000000000000000000000001450520414700274205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_config.js000066400000000000000000000002671450520414700313670ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not use arrow functions', options: { input: ['main', 'main2'], output: { generatedCode: { arrowFunctions: false } } } }); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/000077500000000000000000000000001450520414700313605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/amd/000077500000000000000000000000001450520414700321215ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000005051450520414700351650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 'dep2'; Promise.resolve().then(function () { return dep1; }).then(console.log); const bar = 'dep1' + foo; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports.bar = bar; exports.dep1 = dep1; exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/amd/main.js000066400000000000000000000001471450520414700334050ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; console.log(dep1.foo, dep1.bar); })); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/amd/main2.js000066400000000000000000000003251450520414700334650ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dep1'], resolve, reject); }).then(function (n) { return n.dep1; }).then(console.log); })); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/cjs/000077500000000000000000000000001450520414700321375ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000004131450520414700352010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/cjs'use strict'; const foo = 'dep2'; Promise.resolve().then(function () { return dep1; }).then(console.log); const bar = 'dep1' + foo; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports.bar = bar; exports.dep1 = dep1; exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/cjs/main.js000066400000000000000000000001341450520414700334170ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); console.log(dep1.foo, dep1.bar); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/cjs/main2.js000066400000000000000000000002271450520414700335040ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dep1.js'); }).then(function (n) { return n.dep1; }).then(console.log); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/es/000077500000000000000000000000001450520414700317675ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000003531450520414700350340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/esconst foo = 'dep2'; Promise.resolve().then(function () { return dep1; }).then(console.log); const bar = 'dep1' + foo; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); export { bar as b, dep1 as d, foo as f }; rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/es/main.js000066400000000000000000000001221450520414700332440ustar00rootroot00000000000000import { f as foo, b as bar } from './generated-dep1.js'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/es/main2.js000066400000000000000000000001241450520414700333300ustar00rootroot00000000000000import('./generated-dep1.js').then(function (n) { return n.d; }).then(console.log); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/system/000077500000000000000000000000001450520414700327045ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000005651450520414700357560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('f', 'dep2'); Promise.resolve().then(function () { return dep1; }).then(console.log); const bar = exports('b', 'dep1' + foo); var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports('d', dep1); }) }; })); main.js000066400000000000000000000003601450520414700341060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/systemSystem.register(['./generated-dep1.js'], (function () { 'use strict'; var foo, bar; return { setters: [function (module) { foo = module.f; bar = module.b; }], execute: (function () { console.log(foo, bar); }) }; })); main2.js000066400000000000000000000003231450520414700341670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dep1.js').then(function (n) { return n.d; }).then(console.log); }) }; })); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/dep1.js000066400000000000000000000001021450520414700306000ustar00rootroot00000000000000import { foo } from './dep2.js'; export const bar = 'dep1' + foo; rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/dep2.js000066400000000000000000000001021450520414700306010ustar00rootroot00000000000000export const foo = 'dep2'; import('./dep1.js').then(console.log); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/main.js000066400000000000000000000001321450520414700306760ustar00rootroot00000000000000import { bar } from './dep1.js'; import { foo } from './dep2.js'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-false/main2.js000066400000000000000000000000471450520414700307650ustar00rootroot00000000000000import('./dep1.js').then(console.log); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/000077500000000000000000000000001450520414700273055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_config.js000066400000000000000000000002561450520414700312520ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses arrow functions', options: { input: ['main', 'main2'], output: { generatedCode: { arrowFunctions: true } } } }); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/000077500000000000000000000000001450520414700312455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/amd/000077500000000000000000000000001450520414700320065ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000004631450520414700350550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 'dep2'; Promise.resolve().then(() => dep1).then(console.log); const bar = 'dep1' + foo; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports.bar = bar; exports.dep1 = dep1; exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/amd/main.js000066400000000000000000000001471450520414700332720ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; console.log(dep1.foo, dep1.bar); })); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/amd/main2.js000066400000000000000000000002661450520414700333560ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise((resolve, reject) => require(['./generated-dep1'], resolve, reject)).then(n => n.dep1).then(console.log); })); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/cjs/000077500000000000000000000000001450520414700320245ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000003711450520414700350710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/cjs'use strict'; const foo = 'dep2'; Promise.resolve().then(() => dep1).then(console.log); const bar = 'dep1' + foo; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports.bar = bar; exports.dep1 = dep1; exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/cjs/main.js000066400000000000000000000001341450520414700333040ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); console.log(dep1.foo, dep1.bar); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/cjs/main2.js000066400000000000000000000001611450520414700333660ustar00rootroot00000000000000'use strict'; Promise.resolve().then(() => require('./generated-dep1.js')).then(n => n.dep1).then(console.log); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/es/000077500000000000000000000000001450520414700316545ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000003311450520414700347150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/esconst foo = 'dep2'; Promise.resolve().then(() => dep1).then(console.log); const bar = 'dep1' + foo; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); export { bar as b, dep1 as d, foo as f }; rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/es/main.js000066400000000000000000000001221450520414700331310ustar00rootroot00000000000000import { f as foo, b as bar } from './generated-dep1.js'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/es/main2.js000066400000000000000000000001001450520414700332070ustar00rootroot00000000000000import('./generated-dep1.js').then(n => n.d).then(console.log); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/system/000077500000000000000000000000001450520414700325715ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000005431450520414700356370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('f', 'dep2'); Promise.resolve().then(() => dep1).then(console.log); const bar = exports('b', 'dep1' + foo); var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar }); exports('d', dep1); }) }; })); main.js000066400000000000000000000003501450520414700337720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/systemSystem.register(['./generated-dep1.js'], (function () { 'use strict'; var foo, bar; return { setters: [module => { foo = module.f; bar = module.b; }], execute: (function () { console.log(foo, bar); }) }; })); main2.js000066400000000000000000000002771450520414700340640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dep1.js').then(n => n.d).then(console.log); }) }; })); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/dep1.js000066400000000000000000000001021450520414700304650ustar00rootroot00000000000000import { foo } from './dep2.js'; export const bar = 'dep1' + foo; rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/dep2.js000066400000000000000000000001021450520414700304660ustar00rootroot00000000000000export const foo = 'dep2'; import('./dep1.js').then(console.log); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/main.js000066400000000000000000000001321450520414700305630ustar00rootroot00000000000000import { bar } from './dep1.js'; import { foo } from './dep2.js'; console.log(foo, bar); rollup-3.29.4/test/chunking-form/samples/generated-code/arrow-functions-true/main2.js000066400000000000000000000000471450520414700306520ustar00rootroot00000000000000import('./dep1.js').then(console.log); rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/000077500000000000000000000000001450520414700307425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_config.js000066400000000000000000000004071450520414700327050ustar00rootroot00000000000000module.exports = defineTest({ description: 'escapes reserved names used as props', options: { input: ['main', 'main2'], external: ['external'], output: { exports: 'named', generatedCode: { reservedNamesAsProps: false }, name: 'bundle' } } }); rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/000077500000000000000000000000001450520414700327025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/amd/000077500000000000000000000000001450520414700334435ustar00rootroot00000000000000main.js000066400000000000000000000001641450520414700346470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/amddefine(['exports', './main2'], (function (exports, main2) { 'use strict'; exports.foo = main2["default"]; })); main2.js000066400000000000000000000002571450520414700347340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var main2 = 42; exports["default"] = main2; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/cjs/000077500000000000000000000000001450520414700334615ustar00rootroot00000000000000main.js000066400000000000000000000001251450520414700346620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/cjs'use strict'; var main2 = require('./main2.js'); exports.foo = main2["default"]; main2.js000066400000000000000000000001741450520414700347500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main2 = 42; exports["default"] = main2; rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/es/000077500000000000000000000000001450520414700333115ustar00rootroot00000000000000main.js000066400000000000000000000000551450520414700345140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/esexport { default as foo } from './main2.js'; main2.js000066400000000000000000000000561450520414700345770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/esvar main2 = 42; export { main2 as default }; system/000077500000000000000000000000001450520414700341475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expectedmain.js000066400000000000000000000003201450520414700354240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/systemSystem.register('bundle', ['./main2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module["default"]); }], execute: (function () { }) }; })); main2.js000066400000000000000000000002361450520414700355140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/systemSystem.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main2 = exports('default', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/main.js000066400000000000000000000000551450520414700322240ustar00rootroot00000000000000export { default as foo } from './main2.js'; rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-false/main2.js000066400000000000000000000000231450520414700323010ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/000077500000000000000000000000001450520414700306275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_config.js000066400000000000000000000004061450520414700325710ustar00rootroot00000000000000module.exports = defineTest({ description: 'escapes reserved names used as props', options: { input: ['main', 'main2'], external: ['external'], output: { exports: 'named', generatedCode: { reservedNamesAsProps: true }, name: 'bundle' } } }); rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/000077500000000000000000000000001450520414700325675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/amd/000077500000000000000000000000001450520414700333305ustar00rootroot00000000000000main.js000066400000000000000000000001611450520414700345310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/amddefine(['exports', './main2'], (function (exports, main2) { 'use strict'; exports.foo = main2.default; })); main2.js000066400000000000000000000002541450520414700346160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var main2 = 42; exports.default = main2; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/cjs/000077500000000000000000000000001450520414700333465ustar00rootroot00000000000000main.js000066400000000000000000000001221450520414700345440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/cjs'use strict'; var main2 = require('./main2.js'); exports.foo = main2.default; main2.js000066400000000000000000000001711450520414700346320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main2 = 42; exports.default = main2; rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/es/000077500000000000000000000000001450520414700331765ustar00rootroot00000000000000main.js000066400000000000000000000000551450520414700344010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/esexport { default as foo } from './main2.js'; main2.js000066400000000000000000000000561450520414700344640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/esvar main2 = 42; export { main2 as default }; system/000077500000000000000000000000001450520414700340345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expectedmain.js000066400000000000000000000003151450520414700353150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/systemSystem.register('bundle', ['./main2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.default); }], execute: (function () { }) }; })); main2.js000066400000000000000000000002361450520414700354010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/systemSystem.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main2 = exports('default', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/main.js000066400000000000000000000000551450520414700321110ustar00rootroot00000000000000export { default as foo } from './main2.js'; rollup-3.29.4/test/chunking-form/samples/generated-code/reserved-names-as-props-true/main2.js000066400000000000000000000000231450520414700321660ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/hashing/000077500000000000000000000000001450520414700217435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/000077500000000000000000000000001450520414700253265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_config.js000066400000000000000000000002671450520414700272750ustar00rootroot00000000000000module.exports = defineTest({ description: 'deduplicates hashes for identical files', options: { input: ['main1', 'main2'], output: { entryFileNames: 'entry-[hash].js' } } }); rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/000077500000000000000000000000001450520414700272665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/000077500000000000000000000000001450520414700300275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-7061c38c.js000066400000000000000000000001011450520414700325720ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/amd/entry-82a5a8a4.js000066400000000000000000000001011450520414700326510ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/000077500000000000000000000000001450520414700300455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-8011025d.js000066400000000000000000000000441450520414700325240ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/cjs/entry-fc7b26ff.js000066400000000000000000000000441450520414700330450ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/000077500000000000000000000000001450520414700276755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-2b8647b5.js000066400000000000000000000000251450520414700324520ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/es/entry-369b04c8.js000066400000000000000000000000251450520414700324510ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/system/000077500000000000000000000000001450520414700306125ustar00rootroot00000000000000entry-54240e14.js000066400000000000000000000001761450520414700332240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); entry-ed8fdbb3.js000066400000000000000000000001761450520414700336150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/main1.js000066400000000000000000000000251450520414700266660ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/hashing/deconflict-hashes/main2.js000066400000000000000000000000251450520414700266670ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/000077500000000000000000000000001450520414700241365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_config.js000066400000000000000000000002341450520414700260770ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports double hashes in patterns', options: { output: { entryFileNames: '[hash]/entry-[hash].js' } } }); rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/000077500000000000000000000000001450520414700260765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/amd/000077500000000000000000000000001450520414700266375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/amd/7061c38c/000077500000000000000000000000001450520414700277155ustar00rootroot00000000000000entry-7061c38c.js000066400000000000000000000001011450520414700324010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/amd/7061c38cdefine((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/cjs/000077500000000000000000000000001450520414700266555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/cjs/8011025d/000077500000000000000000000000001450520414700276415ustar00rootroot00000000000000entry-8011025d.js000066400000000000000000000000441450520414700322410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/cjs/8011025d'use strict'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/es/000077500000000000000000000000001450520414700265055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/es/2b8647b5/000077500000000000000000000000001450520414700275705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/es/2b8647b5/entry-2b8647b5.js000066400000000000000000000000251450520414700323450ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/system/000077500000000000000000000000001450520414700274225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/system/54240e14/000077500000000000000000000000001450520414700304125ustar00rootroot00000000000000entry-54240e14.js000066400000000000000000000001761450520414700330240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/_expected/system/54240e14System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/hashing/double-hash/main.js000066400000000000000000000000251450520414700254150ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/000077500000000000000000000000001450520414700236365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_config.js000066400000000000000000000007421450520414700256030ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows configurable hash size', options: { input: ['main1.js', 'main2.js'], plugins: [ { name: 'test', buildStart() { this.emitFile({ type: 'asset', name: 'test.txt', source: 'test' }); } } ], output: { entryFileNames: ({ name }) => name === 'main1' ? '[name]-[hash:8].js' : '[name]-[hash:10].js', chunkFileNames: '[name]-[hash:14].js', assetFileNames: '[name]-[hash:18][extname]' } } }); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/000077500000000000000000000000001450520414700255765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/amd/000077500000000000000000000000001450520414700263375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/amd/dep-5905830720d5f3.js000066400000000000000000000001001450520414700312020ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dep'); })); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/amd/main1-eb0f074f.js000066400000000000000000000001371450520414700311160ustar00rootroot00000000000000define(['./dep-5905830720d5f3'], (function (dep) { 'use strict'; console.log('main1'); })); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/amd/main2-b24fb22e7f.js000066400000000000000000000001371450520414700313470ustar00rootroot00000000000000define(['./dep-5905830720d5f3'], (function (dep) { 'use strict'; console.log('main2'); })); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/amd/test-9f86d081884c7d659a.txt000066400000000000000000000000041450520414700324070ustar00rootroot00000000000000testrollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/cjs/000077500000000000000000000000001450520414700263555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/cjs/dep-0f12b4bf62a634.js000066400000000000000000000000431450520414700314320ustar00rootroot00000000000000'use strict'; console.log('dep'); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main1-87405ba3.js000066400000000000000000000001121450520414700307650ustar00rootroot00000000000000'use strict'; require('./dep-0f12b4bf62a634.js'); console.log('main1'); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/cjs/main2-b2c59bdf14.js000066400000000000000000000001121450520414700313560ustar00rootroot00000000000000'use strict'; require('./dep-0f12b4bf62a634.js'); console.log('main2'); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/cjs/test-9f86d081884c7d659a.txt000066400000000000000000000000041450520414700324250ustar00rootroot00000000000000testrollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/es/000077500000000000000000000000001450520414700262055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/es/dep-cd6f5744f7fc9c.js000066400000000000000000000000241450520414700314550ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/es/main1-bcca55a1.js000066400000000000000000000000711450520414700310300ustar00rootroot00000000000000import './dep-cd6f5744f7fc9c.js'; console.log('main1'); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/es/main2-83d7b451fa.js000066400000000000000000000000711450520414700311350ustar00rootroot00000000000000import './dep-cd6f5744f7fc9c.js'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/es/test-9f86d081884c7d659a.txt000066400000000000000000000000041450520414700322550ustar00rootroot00000000000000testrollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/system/000077500000000000000000000000001450520414700271225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/system/dep-626bb5df3105f7.js000066400000000000000000000001751450520414700322170ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep'); }) }; })); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/system/main1-c5eecf00.js000066400000000000000000000002531450520414700317550ustar00rootroot00000000000000System.register(['./dep-626bb5df3105f7.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main1'); }) }; })); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/system/main2-842e475e5e.js000066400000000000000000000002531450520414700320050ustar00rootroot00000000000000System.register(['./dep-626bb5df3105f7.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main2'); }) }; })); test-9f86d081884c7d659a.txt000066400000000000000000000000041450520414700331130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/_expected/systemtestrollup-3.29.4/test/chunking-form/samples/hashing/hash-size/dep.js000066400000000000000000000000241450520414700247400ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/main1.js000066400000000000000000000000521450520414700251760ustar00rootroot00000000000000import "./dep.js"; console.log('main1'); rollup-3.29.4/test/chunking-form/samples/hashing/hash-size/main2.js000066400000000000000000000000521450520414700251770ustar00rootroot00000000000000import "./dep.js"; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/hashing/random-match/000077500000000000000000000000001450520414700243155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_config.js000066400000000000000000000002621450520414700262570ustar00rootroot00000000000000module.exports = defineTest({ description: 'leaves random hash matches untransformed', options: { output: { entryFileNames: 'entry-[hash]-!~{001}~-!~{123}~.js' } } }); rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_expected/000077500000000000000000000000001450520414700262555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_expected/amd/000077500000000000000000000000001450520414700270165ustar00rootroot00000000000000entry-a38385ce-a38385ce-!~{123}~.js000066400000000000000000000001671450520414700342740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_expected/amddefine((function () { 'use strict'; console.log('replaced: a38385ce'); console.log('not replaced: !~{123}~'); })); rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_expected/cjs/000077500000000000000000000000001450520414700270345ustar00rootroot00000000000000entry-55937672-55937672-!~{123}~.js000066400000000000000000000001311450520414700336610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_expected/cjs'use strict'; console.log('replaced: 55937672'); console.log('not replaced: !~{123}~'); rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_expected/es/000077500000000000000000000000001450520414700266645ustar00rootroot00000000000000entry-3e8c77bc-3e8c77bc-!~{123}~.js000066400000000000000000000001121450520414700342740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_expected/esconsole.log('replaced: 3e8c77bc'); console.log('not replaced: !~{123}~'); rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_expected/system/000077500000000000000000000000001450520414700276015ustar00rootroot00000000000000entry-49c9800c-49c9800c-!~{123}~.js000066400000000000000000000002661450520414700347170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/random-match/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('replaced: 49c9800c'); console.log('not replaced: !~{123}~'); }) }; })); rollup-3.29.4/test/chunking-form/samples/hashing/random-match/main.js000066400000000000000000000001121450520414700255710ustar00rootroot00000000000000console.log('replaced: !~{001}~'); console.log('not replaced: !~{123}~'); rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/000077500000000000000000000000001450520414700265145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_config.js000066400000000000000000000003431450520414700304560ustar00rootroot00000000000000module.exports = defineTest({ description: 'Does not fail when calculating the hash of a file containing a tree-shaken dynamic import', options: { input: ['main.js'], output: { entryFileNames: '[hash].js' } } }); rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/000077500000000000000000000000001450520414700304545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/amd/000077500000000000000000000000001450520414700312155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/amd/09da348a.js000066400000000000000000000001141450520414700327040ustar00rootroot00000000000000define((function () { 'use strict'; var main = null; return main; })); rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/cjs/000077500000000000000000000000001450520414700312335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/cjs/b99f90f4.js000066400000000000000000000000701450520414700327420ustar00rootroot00000000000000'use strict'; var main = null; module.exports = main; rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/es/000077500000000000000000000000001450520414700310635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/es/55aeacf8.js000066400000000000000000000000561450520414700327230ustar00rootroot00000000000000var main = null; export { main as default }; rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/system/000077500000000000000000000000001450520414700320005ustar00rootroot00000000000000e65da870.js000066400000000000000000000002251450520414700334210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', null); }) }; })); rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/foo.js000066400000000000000000000000231450520414700276300ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/hashing/tree-shaken-dynamic-hash/main.js000066400000000000000000000000641450520414700277760ustar00rootroot00000000000000export default false ? import('./foo.js') : null; rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/000077500000000000000000000000001450520414700247745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_config.js000066400000000000000000000005611450520414700267400ustar00rootroot00000000000000const { loader } = require('../../../utils.js'); module.exports = defineTest({ description: 'ignores queries and hashes for chunk names when preserving modules', options: { input: ['a.js?query', 'b.js#hash'], output: { preserveModules: true }, plugins: [ loader({ 'a.js?query': "console.log('a');", 'b.js#hash': "console.log('b');" }) ] } }); rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/000077500000000000000000000000001450520414700267345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/000077500000000000000000000000001450520414700274755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/_virtual/000077500000000000000000000000001450520414700313225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/_virtual/a.js000066400000000000000000000000761450520414700321030ustar00rootroot00000000000000define((function () { 'use strict'; console.log('a'); })); rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/_virtual/b.js000066400000000000000000000000761450520414700321040ustar00rootroot00000000000000define((function () { 'use strict'; console.log('b'); })); rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/000077500000000000000000000000001450520414700275135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/_virtual/000077500000000000000000000000001450520414700313405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/_virtual/a.js000066400000000000000000000000411450520414700321110ustar00rootroot00000000000000'use strict'; console.log('a'); rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/_virtual/b.js000066400000000000000000000000411450520414700321120ustar00rootroot00000000000000'use strict'; console.log('b'); rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/000077500000000000000000000000001450520414700273435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/_virtual/000077500000000000000000000000001450520414700311705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/_virtual/a.js000066400000000000000000000000221450520414700317400ustar00rootroot00000000000000console.log('a'); rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/_virtual/b.js000066400000000000000000000000221450520414700317410ustar00rootroot00000000000000console.log('b'); rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/000077500000000000000000000000001450520414700302605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/_virtual/000077500000000000000000000000001450520414700321055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/_virtual/a.js000066400000000000000000000001731450520414700326640ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('a'); }) }; })); rollup-3.29.4/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/_virtual/b.js000066400000000000000000000001731450520414700326650ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('b'); }) }; })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/000077500000000000000000000000001450520414700245605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/000077500000000000000000000000001450520414700317105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_config.js000066400000000000000000000005441450520414700336550ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly emits a chunk when it is implicitly loaded after an empty entry module', expectedWarnings: ['EMPTY_BUNDLE'], options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: ['main'] }); } } } }); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/000077500000000000000000000000001450520414700336505ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700343325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expectedgenerated-dep.js000066400000000000000000000001001450520414700373630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/amddefine((function () { 'use strict'; console.log('dep'); })); main.js000066400000000000000000000000541450520414700356130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/amddefine((function () { 'use strict'; })); cjs/000077500000000000000000000000001450520414700343505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expectedgenerated-dep.js000066400000000000000000000000431450520414700374070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/cjs'use strict'; console.log('dep'); main.js000066400000000000000000000000171450520414700356300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/cjs'use strict'; es/000077500000000000000000000000001450520414700342005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expectedgenerated-dep.js000066400000000000000000000000241450520414700372360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/esconsole.log('dep'); main.js000066400000000000000000000000011450520414700354510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/es system/000077500000000000000000000000001450520414700351155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expectedgenerated-dep.js000066400000000000000000000001751450520414700401620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep'); }) }; })); main.js000066400000000000000000000001471450520414700364010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/dep.js000066400000000000000000000000241450520414700330120ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/main.js000066400000000000000000000000001450520414700331600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/000077500000000000000000000000001450520414700334735ustar00rootroot00000000000000_config.js000066400000000000000000000130021450520414700353520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryconst assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_LIB = path.join(__dirname, 'lib.js'); const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = defineTest({ description: 'makes sure emitted entry points are never implicit dependencies', options: { preserveEntrySignatures: 'allow-extension', plugins: { name: 'test-plugin', async buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: [ID_MAIN] }); await new Promise(resolve => setTimeout(resolve, 200)); this.emitFile({ type: 'chunk', id: 'dep.js' }); }, buildEnd() { assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN))), { id: ID_MAIN, assertions: {}, ast: { type: 'Program', start: 0, end: 51, body: [ { type: 'ImportDeclaration', start: 0, end: 30, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 14, imported: { type: 'Identifier', start: 9, end: 14, name: 'value' }, local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } }, { type: 'ExpressionStatement', start: 31, end: 50, expression: { type: 'CallExpression', start: 31, end: 49, callee: { type: 'MemberExpression', start: 31, end: 42, object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, optional: false }, arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } ], sourceType: 'module' }, code: "import { value } from './lib';\nconsole.log(value);\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: ID_LIB, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { id: ID_DEP, assertions: {}, ast: { type: 'Program', start: 0, end: 51, body: [ { type: 'ImportDeclaration', start: 0, end: 30, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 14, imported: { type: 'Identifier', start: 9, end: 14, name: 'value' }, local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } }, { type: 'ExpressionStatement', start: 31, end: 50, expression: { type: 'CallExpression', start: 31, end: 49, callee: { type: 'MemberExpression', start: 31, end: 42, object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, optional: false }, arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } ], sourceType: 'module' }, code: "import { value } from './lib';\nconsole.log(value);\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: ID_LIB, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); }, generateBundle(options, bundle) { const main = bundle['main.js']; assert.deepStrictEqual(main.implicitlyLoadedBefore, [], 'main.implicitlyLoadedBefore'); assert.strictEqual(main.isEntry, true, 'main.isEntry'); assert.strictEqual(main.isDynamicEntry, false, 'main.isDynamicEntry'); assert.strictEqual(main.isImplicitEntry, false, 'main.isImplicitEntry'); const dep = bundle['generated-dep.js']; assert.deepStrictEqual(dep.implicitlyLoadedBefore, [], 'dep.implicitlyLoadedBefore'); assert.strictEqual(dep.isEntry, true, 'dep.isEntry'); assert.strictEqual(dep.isDynamicEntry, false, 'dep.isDynamicEntry'); assert.strictEqual(dep.isImplicitEntry, false, 'dep.isImplicitEntry'); } } } }); _expected/000077500000000000000000000000001450520414700353545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryamd/000077500000000000000000000000001450520414700361155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expectedgenerated-dep.js000066400000000000000000000001341450520414700411550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/amddefine(['./generated-lib'], (function (lib) { 'use strict'; console.log(lib.value); })); generated-lib.js000066400000000000000000000001531450520414700411540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); main.js000066400000000000000000000001341450520414700373750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/amddefine(['./generated-lib'], (function (lib) { 'use strict'; console.log(lib.value); })); cjs/000077500000000000000000000000001450520414700361335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expectedgenerated-dep.js000066400000000000000000000001211450520414700411670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/cjs'use strict'; var lib = require('./generated-lib.js'); console.log(lib.value); generated-lib.js000066400000000000000000000000711450520414700411710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/cjs'use strict'; const value = 42; exports.value = value; main.js000066400000000000000000000001211450520414700374070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/cjs'use strict'; var lib = require('./generated-lib.js'); console.log(lib.value); es/000077500000000000000000000000001450520414700357635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expectedgenerated-dep.js000066400000000000000000000001061450520414700410220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/esimport { v as value } from './generated-lib.js'; console.log(value); generated-lib.js000066400000000000000000000000521450520414700410200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/esconst value = 42; export { value as v }; main.js000066400000000000000000000001061450520414700372420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/esimport { v as value } from './generated-lib.js'; console.log(value); system/000077500000000000000000000000001450520414700367005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expectedgenerated-dep.js000066400000000000000000000003301450520414700417360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/systemSystem.register(['./generated-lib.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log(value); }) }; })); generated-lib.js000066400000000000000000000002201450520414700417320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('v', 42); }) }; })); main.js000066400000000000000000000003301450520414700401560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/systemSystem.register(['./generated-lib.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log(value); }) }; })); dep.js000066400000000000000000000000631450520414700345210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryimport { value } from './lib'; console.log(value); lib.js000066400000000000000000000000311450520414700345120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryexport const value = 42; main.js000066400000000000000000000000631450520414700346750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryimport { value } from './lib'; console.log(value); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/000077500000000000000000000000001450520414700320425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_config.js000066400000000000000000000126151450520414700340110ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_LIB = path.join(__dirname, 'lib.js'); const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = defineTest({ description: 'makes sure actual entry points are never implicit dependencies', options: { input: ['main', 'dep'], preserveEntrySignatures: 'allow-extension', plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: [ID_MAIN] }); }, buildEnd() { assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN))), { id: ID_MAIN, assertions: {}, ast: { type: 'Program', start: 0, end: 51, body: [ { type: 'ImportDeclaration', start: 0, end: 30, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 14, imported: { type: 'Identifier', start: 9, end: 14, name: 'value' }, local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } }, { type: 'ExpressionStatement', start: 31, end: 50, expression: { type: 'CallExpression', start: 31, end: 49, callee: { type: 'MemberExpression', start: 31, end: 42, object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, optional: false }, arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } ], sourceType: 'module' }, code: "import { value } from './lib';\nconsole.log(value);\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: ID_LIB, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { id: ID_DEP, assertions: {}, ast: { type: 'Program', start: 0, end: 51, body: [ { type: 'ImportDeclaration', start: 0, end: 30, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 14, imported: { type: 'Identifier', start: 9, end: 14, name: 'value' }, local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } }, { type: 'ExpressionStatement', start: 31, end: 50, expression: { type: 'CallExpression', start: 31, end: 49, callee: { type: 'MemberExpression', start: 31, end: 42, object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, optional: false }, arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } ], sourceType: 'module' }, code: "import { value } from './lib';\nconsole.log(value);\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exports: [], exportedBindings: { '.': [] }, hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: ID_LIB, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); }, generateBundle(options, bundle) { const main = bundle['main.js']; assert.deepStrictEqual(main.implicitlyLoadedBefore, [], 'main.implicitlyLoadedBefore'); assert.strictEqual(main.isEntry, true, 'main.isEntry'); assert.strictEqual(main.isDynamicEntry, false, 'main.isDynamicEntry'); assert.strictEqual(main.isImplicitEntry, false, 'main.isImplicitEntry'); const dep = bundle['dep.js']; assert.deepStrictEqual(dep.implicitlyLoadedBefore, [], 'dep.implicitlyLoadedBefore'); assert.strictEqual(dep.isEntry, true, 'dep.isEntry'); assert.strictEqual(dep.isDynamicEntry, false, 'dep.isDynamicEntry'); assert.strictEqual(dep.isImplicitEntry, false, 'dep.isImplicitEntry'); } } } }); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/000077500000000000000000000000001450520414700340025ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700344645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expecteddep.js000066400000000000000000000001341450520414700355700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/amddefine(['./generated-lib'], (function (lib) { 'use strict'; console.log(lib.value); })); generated-lib.js000066400000000000000000000001531450520414700375230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); main.js000066400000000000000000000001341450520414700357440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/amddefine(['./generated-lib'], (function (lib) { 'use strict'; console.log(lib.value); })); cjs/000077500000000000000000000000001450520414700345025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expecteddep.js000066400000000000000000000001211450520414700356020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/cjs'use strict'; var lib = require('./generated-lib.js'); console.log(lib.value); generated-lib.js000066400000000000000000000000711450520414700375400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/cjs'use strict'; const value = 42; exports.value = value; main.js000066400000000000000000000001211450520414700357560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/cjs'use strict'; var lib = require('./generated-lib.js'); console.log(lib.value); es/000077500000000000000000000000001450520414700343325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expecteddep.js000066400000000000000000000001061450520414700354350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/esimport { v as value } from './generated-lib.js'; console.log(value); generated-lib.js000066400000000000000000000000521450520414700373670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/esconst value = 42; export { value as v }; main.js000066400000000000000000000001061450520414700356110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/esimport { v as value } from './generated-lib.js'; console.log(value); system/000077500000000000000000000000001450520414700352475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expecteddep.js000066400000000000000000000003301450520414700363510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/systemSystem.register(['./generated-lib.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log(value); }) }; })); generated-lib.js000066400000000000000000000002201450520414700403010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('v', 42); }) }; })); main.js000066400000000000000000000003301450520414700365250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/systemSystem.register(['./generated-lib.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log(value); }) }; })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/dep.js000066400000000000000000000000631450520414700331470ustar00rootroot00000000000000import { value } from './lib'; console.log(value); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/lib.js000066400000000000000000000000311450520414700331400ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/main.js000066400000000000000000000000631450520414700333230ustar00rootroot00000000000000import { value } from './lib'; console.log(value); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/000077500000000000000000000000001450520414700310375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_config.js000066400000000000000000000300141450520414700327770ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN1 = path.join(__dirname, 'main1.js'); const ID_MAIN2 = path.join(__dirname, 'main2.js'); const ID_LIB1 = path.join(__dirname, 'lib1.js'); const ID_LIB1B = path.join(__dirname, 'lib1b.js'); const ID_LIB2 = path.join(__dirname, 'lib2.js'); const ID_LIB3 = path.join(__dirname, 'lib3.js'); const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = defineTest({ description: 'supports emitting the same chunk with different and multiple dependencies', options: { input: ['main1', 'main2'], plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: [ID_MAIN1] }); this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: [ID_MAIN1, ID_MAIN2] }); this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: [ID_MAIN2] }); }, buildEnd() { assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN1))), { id: ID_MAIN1, assertions: {}, ast: { type: 'Program', start: 0, end: 137, body: [ { type: 'ImportDeclaration', start: 0, end: 30, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 13, imported: { type: 'Identifier', start: 9, end: 13, name: 'lib1' }, local: { type: 'Identifier', start: 9, end: 13, name: 'lib1' } } ], source: { type: 'Literal', start: 21, end: 29, value: './lib1', raw: "'./lib1'" } }, { type: 'ImportDeclaration', start: 31, end: 63, specifiers: [ { type: 'ImportSpecifier', start: 40, end: 45, imported: { type: 'Identifier', start: 40, end: 45, name: 'lib1b' }, local: { type: 'Identifier', start: 40, end: 45, name: 'lib1b' } } ], source: { type: 'Literal', start: 53, end: 62, value: './lib1b', raw: "'./lib1b'" } }, { type: 'ImportDeclaration', start: 64, end: 94, specifiers: [ { type: 'ImportSpecifier', start: 73, end: 77, imported: { type: 'Identifier', start: 73, end: 77, name: 'lib2' }, local: { type: 'Identifier', start: 73, end: 77, name: 'lib2' } } ], source: { type: 'Literal', start: 85, end: 93, value: './lib2', raw: "'./lib2'" } }, { type: 'ExpressionStatement', start: 95, end: 136, expression: { type: 'CallExpression', start: 95, end: 135, callee: { type: 'MemberExpression', start: 95, end: 106, object: { type: 'Identifier', start: 95, end: 102, name: 'console' }, property: { type: 'Identifier', start: 103, end: 106, name: 'log' }, computed: false, optional: false }, arguments: [ { type: 'Literal', start: 107, end: 114, value: 'main1', raw: "'main1'" }, { type: 'Identifier', start: 116, end: 120, name: 'lib1' }, { type: 'Identifier', start: 123, end: 128, name: 'lib1b' }, { type: 'Identifier', start: 130, end: 134, name: 'lib2' } ], optional: false } } ], sourceType: 'module' }, code: "import { lib1 } from './lib1';\nimport { lib1b } from './lib1b';\nimport { lib2 } from './lib2';\nconsole.log('main1', lib1, lib1b, lib2);\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [ID_DEP], importedIdResolutions: [ { assertions: {}, external: false, id: ID_LIB1, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }, { assertions: {}, external: false, id: ID_LIB1B, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }, { assertions: {}, external: false, id: ID_LIB2, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_LIB1, ID_LIB1B, ID_LIB2], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN2))), { id: ID_MAIN2, assertions: {}, ast: { type: 'Program', start: 0, end: 136, body: [ { type: 'ImportDeclaration', start: 0, end: 30, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 13, imported: { type: 'Identifier', start: 9, end: 13, name: 'lib1' }, local: { type: 'Identifier', start: 9, end: 13, name: 'lib1' } } ], source: { type: 'Literal', start: 21, end: 29, value: './lib1', raw: "'./lib1'" } }, { type: 'ImportDeclaration', start: 31, end: 63, specifiers: [ { type: 'ImportSpecifier', start: 40, end: 45, imported: { type: 'Identifier', start: 40, end: 45, name: 'lib1b' }, local: { type: 'Identifier', start: 40, end: 45, name: 'lib1b' } } ], source: { type: 'Literal', start: 53, end: 62, value: './lib1b', raw: "'./lib1b'" } }, { type: 'ImportDeclaration', start: 64, end: 94, specifiers: [ { type: 'ImportSpecifier', start: 73, end: 77, imported: { type: 'Identifier', start: 73, end: 77, name: 'lib3' }, local: { type: 'Identifier', start: 73, end: 77, name: 'lib3' } } ], source: { type: 'Literal', start: 85, end: 93, value: './lib3', raw: "'./lib3'" } }, { type: 'ExpressionStatement', start: 95, end: 135, expression: { type: 'CallExpression', start: 95, end: 134, callee: { type: 'MemberExpression', start: 95, end: 106, object: { type: 'Identifier', start: 95, end: 102, name: 'console' }, property: { type: 'Identifier', start: 103, end: 106, name: 'log' }, computed: false, optional: false }, arguments: [ { type: 'Literal', start: 107, end: 114, value: 'main2', raw: "'main2'" }, { type: 'Identifier', start: 116, end: 120, name: 'lib1' }, { type: 'Identifier', start: 122, end: 127, name: 'lib1b' }, { type: 'Identifier', start: 129, end: 133, name: 'lib3' } ], optional: false } } ], sourceType: 'module' }, code: "import { lib1 } from './lib1';\nimport { lib1b } from './lib1b';\nimport { lib3 } from './lib3';\nconsole.log('main2', lib1, lib1b, lib3);\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [ID_DEP], importedIdResolutions: [ { assertions: {}, external: false, id: ID_LIB1, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }, { assertions: {}, external: false, id: ID_LIB1B, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }, { assertions: {}, external: false, id: ID_LIB3, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_LIB1, ID_LIB1B, ID_LIB3], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { id: ID_DEP, assertions: {}, ast: { type: 'Program', start: 0, end: 124, body: [ { type: 'ImportDeclaration', start: 0, end: 30, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 13, imported: { type: 'Identifier', start: 9, end: 13, name: 'lib1' }, local: { type: 'Identifier', start: 9, end: 13, name: 'lib1' } } ], source: { type: 'Literal', start: 21, end: 29, value: './lib1', raw: "'./lib1'" } }, { type: 'ImportDeclaration', start: 31, end: 61, specifiers: [ { type: 'ImportSpecifier', start: 40, end: 44, imported: { type: 'Identifier', start: 40, end: 44, name: 'lib2' }, local: { type: 'Identifier', start: 40, end: 44, name: 'lib2' } } ], source: { type: 'Literal', start: 52, end: 60, value: './lib2', raw: "'./lib2'" } }, { type: 'ImportDeclaration', start: 62, end: 92, specifiers: [ { type: 'ImportSpecifier', start: 71, end: 75, imported: { type: 'Identifier', start: 71, end: 75, name: 'lib3' }, local: { type: 'Identifier', start: 71, end: 75, name: 'lib3' } } ], source: { type: 'Literal', start: 83, end: 91, value: './lib3', raw: "'./lib3'" } }, { type: 'ExpressionStatement', start: 93, end: 123, expression: { type: 'CallExpression', start: 93, end: 122, callee: { type: 'MemberExpression', start: 93, end: 104, object: { type: 'Identifier', start: 93, end: 100, name: 'console' }, property: { type: 'Identifier', start: 101, end: 104, name: 'log' }, computed: false, optional: false }, arguments: [ { type: 'Identifier', start: 105, end: 109, name: 'lib1' }, { type: 'Identifier', start: 111, end: 115, name: 'lib2' }, { type: 'Identifier', start: 117, end: 121, name: 'lib3' } ], optional: false } } ], sourceType: 'module' }, code: "import { lib1 } from './lib1';\nimport { lib2 } from './lib2';\nimport { lib3 } from './lib3';\nconsole.log(lib1, lib2, lib3);\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [ID_MAIN1, ID_MAIN2], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: ID_LIB1, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }, { assertions: {}, external: false, id: ID_LIB2, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }, { assertions: {}, external: false, id: ID_LIB3, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_LIB1, ID_LIB2, ID_LIB3], importers: [], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); } } } }); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/000077500000000000000000000000001450520414700327775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amd/000077500000000000000000000000001450520414700335405ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002531450520414700365230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amddefine(['./generated-lib1b', './generated-lib2', './generated-lib3'], (function (lib1b, lib2, lib3) { 'use strict'; console.log(lib1b.lib1, lib2.lib2, lib3.lib3); })); generated-lib1b.js000066400000000000000000000002351450520414700367440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const lib1 = 'lib1'; const lib1b = 'lib1b'; exports.lib1 = lib1; exports.lib1b = lib1b; })); generated-lib2.js000066400000000000000000000001541450520414700366030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const lib2 = 'lib2'; exports.lib2 = lib2; })); generated-lib3.js000066400000000000000000000001541450520414700366040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const lib3 = 'lib3'; exports.lib3 = lib3; })); main1.js000066400000000000000000000002351450520414700350240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amddefine(['./generated-lib1b', './generated-lib2'], (function (lib1b, lib2) { 'use strict'; console.log('main1', lib1b.lib1, lib1b.lib1b, lib2.lib2); })); main2.js000066400000000000000000000002341450520414700350240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amddefine(['./generated-lib1b', './generated-lib3'], (function (lib1b, lib3) { 'use strict'; console.log('main2', lib1b.lib1, lib1b.lib1b, lib3.lib3); })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs/000077500000000000000000000000001450520414700335565ustar00rootroot00000000000000generated-dep.js000066400000000000000000000003021450520414700365340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs'use strict'; var lib1b = require('./generated-lib1b.js'); var lib2 = require('./generated-lib2.js'); var lib3 = require('./generated-lib3.js'); console.log(lib1b.lib1, lib2.lib2, lib3.lib3); generated-lib1b.js000066400000000000000000000001511450520414700367570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs'use strict'; const lib1 = 'lib1'; const lib1b = 'lib1b'; exports.lib1 = lib1; exports.lib1b = lib1b; generated-lib2.js000066400000000000000000000000721450520414700366200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs'use strict'; const lib2 = 'lib2'; exports.lib2 = lib2; generated-lib3.js000066400000000000000000000000721450520414700366210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs'use strict'; const lib3 = 'lib3'; exports.lib3 = lib3; main1.js000066400000000000000000000002431450520414700350410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs'use strict'; var lib1b = require('./generated-lib1b.js'); var lib2 = require('./generated-lib2.js'); console.log('main1', lib1b.lib1, lib1b.lib1b, lib2.lib2); main2.js000066400000000000000000000002421450520414700350410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs'use strict'; var lib1b = require('./generated-lib1b.js'); var lib3 = require('./generated-lib3.js'); console.log('main2', lib1b.lib1, lib1b.lib1b, lib3.lib3); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/es/000077500000000000000000000000001450520414700334065ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002641450520414700363730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/esimport { l as lib1 } from './generated-lib1b.js'; import { l as lib2 } from './generated-lib2.js'; import { l as lib3 } from './generated-lib3.js'; console.log(lib1, lib2, lib3); generated-lib1b.js000066400000000000000000000001201450520414700366030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/esconst lib1 = 'lib1'; const lib1b = 'lib1b'; export { lib1b as a, lib1 as l }; generated-lib2.js000066400000000000000000000000541450520414700364500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/esconst lib2 = 'lib2'; export { lib2 as l }; generated-lib3.js000066400000000000000000000000541450520414700364510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/esconst lib3 = 'lib3'; export { lib3 as l }; main1.js000066400000000000000000000002321450520414700346670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/esimport { l as lib1, a as lib1b } from './generated-lib1b.js'; import { l as lib2 } from './generated-lib2.js'; console.log('main1', lib1, lib1b, lib2); main2.js000066400000000000000000000002311450520414700346670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/esimport { l as lib1, a as lib1b } from './generated-lib1b.js'; import { l as lib3 } from './generated-lib3.js'; console.log('main2', lib1, lib1b, lib3); system/000077500000000000000000000000001450520414700342445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expectedgenerated-dep.js000066400000000000000000000005671450520414700373160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/systemSystem.register(['./generated-lib1b.js', './generated-lib2.js', './generated-lib3.js'], (function () { 'use strict'; var lib1, lib2, lib3; return { setters: [function (module) { lib1 = module.l; }, function (module) { lib2 = module.l; }, function (module) { lib3 = module.l; }], execute: (function () { console.log(lib1, lib2, lib3); }) }; })); generated-lib1b.js000066400000000000000000000002741450520414700375320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const lib1 = exports('l', 'lib1'); const lib1b = exports('a', 'lib1b'); }) }; })); generated-lib2.js000066400000000000000000000002231450520414700373630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const lib2 = exports('l', 'lib2'); }) }; })); generated-lib3.js000066400000000000000000000002231450520414700373640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const lib3 = exports('l', 'lib3'); }) }; })); main1.js000066400000000000000000000005241450520414700356100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/systemSystem.register(['./generated-lib1b.js', './generated-lib2.js'], (function () { 'use strict'; var lib1, lib1b, lib2; return { setters: [function (module) { lib1 = module.l; lib1b = module.a; }, function (module) { lib2 = module.l; }], execute: (function () { console.log('main1', lib1, lib1b, lib2); }) }; })); main2.js000066400000000000000000000005231450520414700356100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/systemSystem.register(['./generated-lib1b.js', './generated-lib3.js'], (function () { 'use strict'; var lib1, lib1b, lib3; return { setters: [function (module) { lib1 = module.l; lib1b = module.a; }, function (module) { lib3 = module.l; }], execute: (function () { console.log('main2', lib1, lib1b, lib3); }) }; })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/dep.js000066400000000000000000000001741450520414700321470ustar00rootroot00000000000000import { lib1 } from './lib1'; import { lib2 } from './lib2'; import { lib3 } from './lib3'; console.log(lib1, lib2, lib3); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/lib1.js000066400000000000000000000000341450520414700322210ustar00rootroot00000000000000export const lib1 = 'lib1'; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/lib1b.js000066400000000000000000000000361450520414700323650ustar00rootroot00000000000000export const lib1b = 'lib1b'; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/lib2.js000066400000000000000000000000341450520414700322220ustar00rootroot00000000000000export const lib2 = 'lib2'; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/lib3.js000066400000000000000000000000341450520414700322230ustar00rootroot00000000000000export const lib3 = 'lib3'; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/main1.js000066400000000000000000000002111450520414700323740ustar00rootroot00000000000000import { lib1 } from './lib1'; import { lib1b } from './lib1b'; import { lib2 } from './lib2'; console.log('main1', lib1, lib1b, lib2); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/main2.js000066400000000000000000000002101450520414700323740ustar00rootroot00000000000000import { lib1 } from './lib1'; import { lib1b } from './lib1b'; import { lib3 } from './lib3'; console.log('main2', lib1, lib1b, lib3); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/000077500000000000000000000000001450520414700335405ustar00rootroot00000000000000_config.js000066400000000000000000000005201450520414700354200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionmodule.exports = defineTest({ description: 'supports implicit dependencies when emitting files', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: ['main.js'], preserveSignature: 'allow-extension' }); } } } }); _expected/000077500000000000000000000000001450520414700354215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionamd/000077500000000000000000000000001450520414700361625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expectedgenerated-dep.js000066400000000000000000000004411450520414700412230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const value = 42; console.log(value); new Promise(function (resolve, reject) { require(['./generated-dynamicDep'], resolve, reject); }); const dep = 'dep'; exports.dep = dep; exports.value = value; })); generated-dynamicDep.js000066400000000000000000000001341450520414700425270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/amddefine(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.value); })); main.js000066400000000000000000000001011450520414700374340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/amddefine((function () { 'use strict'; console.log('main'); })); cjs/000077500000000000000000000000001450520414700362005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expectedgenerated-dep.js000066400000000000000000000003121450520414700412360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/cjs'use strict'; const value = 42; console.log(value); Promise.resolve().then(function () { return require('./generated-dynamicDep.js'); }); const dep = 'dep'; exports.dep = dep; exports.value = value; generated-dynamicDep.js000066400000000000000000000001211450520414700425410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); console.log(dep.value); main.js000066400000000000000000000000441450520414700374600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/cjs'use strict'; console.log('main'); es/000077500000000000000000000000001450520414700360305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expectedgenerated-dep.js000066400000000000000000000001741450520414700410740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/esconst value = 42; console.log(value); import('./generated-dynamicDep.js'); const dep = 'dep'; export { dep, value as v }; generated-dynamicDep.js000066400000000000000000000001061450520414700423740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/esimport { v as value } from './generated-dep.js'; console.log(value); main.js000066400000000000000000000000251450520414700373070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/esconsole.log('main'); system/000077500000000000000000000000001450520414700367455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expectedgenerated-dep.js000066400000000000000000000004051450520414700420060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const value = exports('v', 42); console.log(value); module.import('./generated-dynamicDep.js'); const dep = exports('dep', 'dep'); }) }; })); generated-dynamicDep.js000066400000000000000000000003301450520414700433100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log(value); }) }; })); main.js000066400000000000000000000001761450520414700402330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); dep.js000066400000000000000000000001451450520414700345670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionimport { value } from './lib'; console.log(value); import('./dynamicDep'); export const dep = 'dep'; dynamicDep.js000066400000000000000000000000631450520414700360730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionimport { value } from './lib'; console.log(value); lib.js000066400000000000000000000000311450520414700345570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionexport const value = 42; main.js000066400000000000000000000000251450520414700347400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionconsole.log('main'); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/000077500000000000000000000000001450520414700315025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_config.js000066400000000000000000000005041450520414700334430ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports implicit dependencies when emitting files', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: ['main.js'], preserveSignature: false }); } } } }); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/000077500000000000000000000000001450520414700334425ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700341245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expectedgenerated-dep.js000066400000000000000000000003711450520414700371670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const value = 42; console.log(value); new Promise(function (resolve, reject) { require(['./generated-dynamicDep'], resolve, reject); }); exports.value = value; })); generated-dynamicDep.js000066400000000000000000000001341450520414700404710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/amddefine(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.value); })); main.js000066400000000000000000000001011450520414700353760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/amddefine((function () { 'use strict'; console.log('main'); })); cjs/000077500000000000000000000000001450520414700341425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expectedgenerated-dep.js000066400000000000000000000002441450520414700372040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/cjs'use strict'; const value = 42; console.log(value); Promise.resolve().then(function () { return require('./generated-dynamicDep.js'); }); exports.value = value; generated-dynamicDep.js000066400000000000000000000001211450520414700405030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); console.log(dep.value); main.js000066400000000000000000000000441450520414700354220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/cjs'use strict'; console.log('main'); es/000077500000000000000000000000001450520414700337725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expectedgenerated-dep.js000066400000000000000000000001441450520414700370330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/esconst value = 42; console.log(value); import('./generated-dynamicDep.js'); export { value as v }; generated-dynamicDep.js000066400000000000000000000001061450520414700403360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/esimport { v as value } from './generated-dep.js'; console.log(value); main.js000066400000000000000000000000251450520414700352510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/esconsole.log('main'); system/000077500000000000000000000000001450520414700347075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expectedgenerated-dep.js000066400000000000000000000003371450520414700377540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const value = exports('v', 42); console.log(value); module.import('./generated-dynamicDep.js'); }) }; })); generated-dynamicDep.js000066400000000000000000000003301450520414700412520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log(value); }) }; })); main.js000066400000000000000000000001761450520414700361750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/dep.js000066400000000000000000000001451450520414700326100ustar00rootroot00000000000000import { value } from './lib'; console.log(value); import('./dynamicDep'); export const dep = 'dep'; dynamicDep.js000066400000000000000000000000631450520414700340350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-falseimport { value } from './lib'; console.log(value); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/lib.js000066400000000000000000000000311450520414700326000ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/main.js000066400000000000000000000000251450520414700327610ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/000077500000000000000000000000001450520414700317205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_config.js000066400000000000000000000005071450520414700336640ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports implicit dependencies when emitting files', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: ['main.js'], preserveSignature: 'strict' }); } } } }); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/000077500000000000000000000000001450520414700336605ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700343425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expectedgenerated-dep.js000066400000000000000000000004411450520414700374030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const value = 42; console.log(value); new Promise(function (resolve, reject) { require(['./generated-dynamicDep'], resolve, reject); }); const dep = 'dep'; exports.dep = dep; exports.value = value; })); generated-dep2.js000066400000000000000000000001611450520414700374640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/amddefine(['exports', './generated-dep'], (function (exports, dep) { 'use strict'; exports.dep = dep.dep; })); generated-dynamicDep.js000066400000000000000000000001341450520414700407070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/amddefine(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.value); })); main.js000066400000000000000000000001011450520414700356140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/amddefine((function () { 'use strict'; console.log('main'); })); cjs/000077500000000000000000000000001450520414700343605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expectedgenerated-dep.js000066400000000000000000000003121450520414700374160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/cjs'use strict'; const value = 42; console.log(value); Promise.resolve().then(function () { return require('./generated-dynamicDep.js'); }); const dep = 'dep'; exports.dep = dep; exports.value = value; generated-dep2.js000066400000000000000000000001221450520414700374770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); exports.dep = dep.dep; generated-dynamicDep.js000066400000000000000000000001211450520414700407210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); console.log(dep.value); main.js000066400000000000000000000000441450520414700356400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/cjs'use strict'; console.log('main'); es/000077500000000000000000000000001450520414700342105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expectedgenerated-dep.js000066400000000000000000000002011450520414700372430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/esconst value = 42; console.log(value); import('./generated-dynamicDep.js'); const dep = 'dep'; export { dep as d, value as v }; generated-dep2.js000066400000000000000000000000571450520414700373360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/esexport { d as dep } from './generated-dep.js'; generated-dynamicDep.js000066400000000000000000000001061450520414700405540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/esimport { v as value } from './generated-dep.js'; console.log(value); main.js000066400000000000000000000000251450520414700354670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/esconsole.log('main'); system/000077500000000000000000000000001450520414700351255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expectedgenerated-dep.js000066400000000000000000000004031450520414700401640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const value = exports('v', 42); console.log(value); module.import('./generated-dynamicDep.js'); const dep = exports('d', 'dep'); }) }; })); generated-dep2.js000066400000000000000000000003051450520414700402470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/systemSystem.register(['./generated-dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('dep', module.d); }], execute: (function () { }) }; })); generated-dynamicDep.js000066400000000000000000000003301450520414700414700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log(value); }) }; })); main.js000066400000000000000000000001761450520414700364130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/dep.js000066400000000000000000000001451450520414700330260ustar00rootroot00000000000000import { value } from './lib'; console.log(value); import('./dynamicDep'); export const dep = 'dep'; dynamicDep.js000066400000000000000000000000631450520414700342530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strictimport { value } from './lib'; console.log(value); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/lib.js000066400000000000000000000000311450520414700330160ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/main.js000066400000000000000000000000251450520414700331770ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/000077500000000000000000000000001450520414700307275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_config.js000066400000000000000000000010351450520414700326700ustar00rootroot00000000000000const assert = require('node:assert'); let referenceId; module.exports = defineTest({ description: 'handles implicit dependencies where the dependant is inlined into the same chunk', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { plugins: { name: 'test-plugin', buildStart() { referenceId = this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: ['lib.js'] }); }, generateBundle() { assert.strictEqual(this.getFileName(referenceId), 'generated-dep.js'); } } } }); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/000077500000000000000000000000001450520414700326675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/amd/000077500000000000000000000000001450520414700334305ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001611450520414700364110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/amddefine(['exports', './generated-lib'], (function (exports, dep) { 'use strict'; exports.dep = dep.dep; })); generated-lib.js000066400000000000000000000003271450520414700364130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const dep = 'dep'; console.log('lib', dep); var lib = /*#__PURE__*/Object.freeze({ __proto__: null }); exports.dep = dep; exports.lib = lib; })); main.js000066400000000000000000000003011450520414700346250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-lib'], resolve, reject); }).then(function (n) { return n.lib; }); })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/cjs/000077500000000000000000000000001450520414700334465ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001221450520414700364240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/cjs'use strict'; var dep = require('./generated-lib.js'); exports.dep = dep.dep; generated-lib.js000066400000000000000000000002401450520414700364230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/cjs'use strict'; const dep = 'dep'; console.log('lib', dep); var lib = /*#__PURE__*/Object.freeze({ __proto__: null }); exports.dep = dep; exports.lib = lib; main.js000066400000000000000000000002031450520414700346440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-lib.js'); }).then(function (n) { return n.lib; }); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/es/000077500000000000000000000000001450520414700332765ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000571450520414700362630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/esexport { d as dep } from './generated-lib.js'; generated-lib.js000066400000000000000000000002121450520414700362520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/esconst dep = 'dep'; console.log('lib', dep); var lib = /*#__PURE__*/Object.freeze({ __proto__: null }); export { dep as d, lib as l }; main.js000066400000000000000000000001011450520414700344710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/esimport('./generated-lib.js').then(function (n) { return n.l; }); system/000077500000000000000000000000001450520414700341345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expectedgenerated-dep.js000066400000000000000000000003051450520414700371740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/systemSystem.register(['./generated-lib.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('dep', module.d); }], execute: (function () { }) }; })); generated-lib.js000066400000000000000000000004121450520414700371710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const dep = exports('d', 'dep'); console.log('lib', dep); var lib = /*#__PURE__*/Object.freeze({ __proto__: null }); exports('l', lib); }) }; })); main.js000066400000000000000000000003001450520414700354070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-lib.js').then(function (n) { return n.l; }); }) }; })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/dep.js000066400000000000000000000000521450520414700320320ustar00rootroot00000000000000import './lib'; export const dep = 'dep'; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/lib.js000066400000000000000000000000661450520414700320350ustar00rootroot00000000000000import { dep } from './dep'; console.log('lib', dep); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/main.js000066400000000000000000000000211450520414700322020ustar00rootroot00000000000000import('./lib'); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/000077500000000000000000000000001450520414700327305ustar00rootroot00000000000000_config.js000066400000000000000000000006511450520414700346150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectmodule.exports = defineTest({ description: 'handles shared dependencies between implicit chunks without side-effects', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'core.js', implicitlyLoadedAfterOneOf: ['main'] }); this.emitFile({ type: 'chunk', id: 'button.js', implicitlyLoadedAfterOneOf: ['main'] }); } } } }); _expected/000077500000000000000000000000001450520414700346115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectamd/000077500000000000000000000000001450520414700353525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expectedgenerated-button.js000066400000000000000000000002031450520414700411520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/amddefine(['exports', './main'], (function (exports, main) { 'use strict'; const bar = main.foo + 'bar'; exports.bar = bar; })); generated-core.js000066400000000000000000000001521450520414700405720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/amddefine(['exports', './main'], (function (exports, main) { 'use strict'; exports.foo = main.foo; })); main.js000066400000000000000000000001501450520414700366300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 'foo'; exports.foo = foo; })); cjs/000077500000000000000000000000001450520414700353705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expectedgenerated-button.js000066400000000000000000000001431450520414700411730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/cjs'use strict'; var main = require('./main.js'); const bar = main.foo + 'bar'; exports.bar = bar; generated-core.js000066400000000000000000000001131450520414700406050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/cjs'use strict'; var main = require('./main.js'); exports.foo = main.foo; main.js000066400000000000000000000000661450520414700366540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/cjs'use strict'; const foo = 'foo'; exports.foo = foo; es/000077500000000000000000000000001450520414700352205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expectedgenerated-button.js000066400000000000000000000001141450520414700410210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/esimport { foo } from './main.js'; const bar = foo + 'bar'; export { bar }; generated-core.js000066400000000000000000000000411450520414700404350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/esexport { foo } from './main.js'; main.js000066400000000000000000000000441450520414700365000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/esconst foo = 'foo'; export { foo }; system/000077500000000000000000000000001450520414700361355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expectedgenerated-button.js000066400000000000000000000003511450520414700417410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var foo; return { setters: [function (module) { foo = module.foo; }], execute: (function () { const bar = exports('bar', foo + 'bar'); }) }; })); generated-core.js000066400000000000000000000002761450520414700413640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.foo); }], execute: (function () { }) }; })); main.js000066400000000000000000000002231450520414700374140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 'foo'); }) }; })); button.js000066400000000000000000000000471450520414700345230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectexport { bar } from './shared/button'; core.js000066400000000000000000000000501450520414700341320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectexport { foo } from './shared/core.js'; main.js000066400000000000000000000000501450520414700341260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectexport { foo } from './shared/core.js'; shared/000077500000000000000000000000001450520414700341175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectbutton.js000066400000000000000000000001011450520414700357600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/sharedimport { foo } from './core.js'; export const bar = foo + 'bar'; core.js000066400000000000000000000000321450520414700354000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/sharedexport const foo = 'foo'; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/000077500000000000000000000000001450520414700320105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_config.js000066400000000000000000000004561450520414700337570ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles shared dependencies when there are only reexports', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'implicit.js', implicitlyLoadedAfterOneOf: ['main'] }); } } } }); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/000077500000000000000000000000001450520414700337505ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700344325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expectedgenerated-implicit.js000066400000000000000000000001521450520414700405340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/amddefine(['exports', './main'], (function (exports, main) { 'use strict'; exports.foo = main.foo; })); main.js000066400000000000000000000001531450520414700357130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 'shared'; exports.foo = foo; })); cjs/000077500000000000000000000000001450520414700344505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expectedgenerated-implicit.js000066400000000000000000000001131450520414700405470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/cjs'use strict'; var main = require('./main.js'); exports.foo = main.foo; main.js000066400000000000000000000000711450520414700357300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/cjs'use strict'; const foo = 'shared'; exports.foo = foo; es/000077500000000000000000000000001450520414700343005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expectedgenerated-implicit.js000066400000000000000000000000411450520414700403770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/esexport { foo } from './main.js'; main.js000066400000000000000000000000471450520414700355630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/esconst foo = 'shared'; export { foo }; system/000077500000000000000000000000001450520414700352155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expectedgenerated-implicit.js000066400000000000000000000002761450520414700413260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.foo); }], execute: (function () { }) }; })); main.js000066400000000000000000000002261450520414700364770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 'shared'); }) }; })); implicit.js000066400000000000000000000000351450520414700340770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexportexport * from './shared.js'; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/main.js000066400000000000000000000000351450520414700332700ustar00rootroot00000000000000export * from './shared.js'; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/shared.js000066400000000000000000000000351450520414700336120ustar00rootroot00000000000000export const foo = 'shared'; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/000077500000000000000000000000001450520414700301555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_config.js000066400000000000000000000126461450520414700321300ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_LIB = path.join(__dirname, 'lib.js'); const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = defineTest({ description: 'supports implicit dependencies when emitting files', options: { preserveEntrySignatures: 'allow-extension', plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: [ID_MAIN] }); }, buildEnd() { assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN))), { id: ID_MAIN, assertions: {}, ast: { type: 'Program', start: 0, end: 51, body: [ { type: 'ImportDeclaration', start: 0, end: 30, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 14, imported: { type: 'Identifier', start: 9, end: 14, name: 'value' }, local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } }, { type: 'ExpressionStatement', start: 31, end: 50, expression: { type: 'CallExpression', start: 31, end: 49, callee: { type: 'MemberExpression', start: 31, end: 42, object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, optional: false }, arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } ], sourceType: 'module' }, code: "import { value } from './lib';\nconsole.log(value);\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [ID_DEP], importedIdResolutions: [ { assertions: {}, external: false, id: ID_LIB, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { id: ID_DEP, assertions: {}, ast: { type: 'Program', start: 0, end: 51, body: [ { type: 'ImportDeclaration', start: 0, end: 30, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 14, imported: { type: 'Identifier', start: 9, end: 14, name: 'value' }, local: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], source: { type: 'Literal', start: 22, end: 29, value: './lib', raw: "'./lib'" } }, { type: 'ExpressionStatement', start: 31, end: 50, expression: { type: 'CallExpression', start: 31, end: 49, callee: { type: 'MemberExpression', start: 31, end: 42, object: { type: 'Identifier', start: 31, end: 38, name: 'console' }, property: { type: 'Identifier', start: 39, end: 42, name: 'log' }, computed: false, optional: false }, arguments: [{ type: 'Identifier', start: 43, end: 48, name: 'value' }], optional: false } } ], sourceType: 'module' }, code: "import { value } from './lib';\nconsole.log(value);\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [ID_MAIN], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: ID_LIB, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_LIB], importers: [], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); }, generateBundle(options, bundle) { const main = bundle['main.js']; assert.deepStrictEqual( main.implicitlyLoadedBefore, ['generated-dep.js'], 'main.implicitlyLoadedBefore' ); assert.strictEqual(main.isEntry, true, 'main.isEntry'); assert.strictEqual(main.isDynamicEntry, false, 'main.isDynamicEntry'); assert.strictEqual(main.isImplicitEntry, false, 'main.isImplicitEntry'); const dep = bundle['generated-dep.js']; assert.deepStrictEqual(dep.implicitlyLoadedBefore, [], 'dep.implicitlyLoadedBefore'); assert.strictEqual(dep.isEntry, false, 'dep.isEntry'); assert.strictEqual(dep.isDynamicEntry, false, 'dep.isDynamicEntry'); assert.strictEqual(dep.isImplicitEntry, true, 'dep.isImplicitEntry'); } } } }); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/000077500000000000000000000000001450520414700321155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/amd/000077500000000000000000000000001450520414700326565ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001251450520414700356370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/amddefine(['./main'], (function (main) { 'use strict'; console.log(main.value); })); main.js000066400000000000000000000002011450520414700340520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; console.log(value); exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/cjs/000077500000000000000000000000001450520414700326745ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001121450520414700356510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/cjs'use strict'; var main = require('./main.js'); console.log(main.value); main.js000066400000000000000000000001161450520414700340750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/cjs'use strict'; const value = 42; console.log(value); exports.value = value; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/es/000077500000000000000000000000001450520414700325245ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000751450520414700355110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/esimport { v as value } from './main.js'; console.log(value); main.js000066400000000000000000000000771450520414700337330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/esconst value = 42; console.log(value); export { value as v }; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/system/000077500000000000000000000000001450520414700334415ustar00rootroot00000000000000generated-dep.js000066400000000000000000000003171450520414700364250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log(value); }) }; })); main.js000066400000000000000000000002501450520414700346410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('v', 42); console.log(value); }) }; })); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/dep.js000066400000000000000000000000631450520414700312620ustar00rootroot00000000000000import { value } from './lib'; console.log(value); rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/lib.js000066400000000000000000000000311450520414700312530ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/chunking-form/samples/implicit-dependencies/single-dependency/main.js000066400000000000000000000000631450520414700314360ustar00rootroot00000000000000import { value } from './lib'; console.log(value); rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/000077500000000000000000000000001450520414700253355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/0/000077500000000000000000000000001450520414700254745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/0/1/000077500000000000000000000000001450520414700256345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/0/1/nested.js000066400000000000000000000000441450520414700274520ustar00rootroot00000000000000export const url = import.meta.url; rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_config.js000066400000000000000000000005601450520414700273000ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'supports nested numeric paths without issues on Windows', options: { output: { preserveModules: true }, plugins: [ { name: 'test', generateBundle(options, bundle) { assert.deepStrictEqual(Object.keys(bundle), ['main.js', '0/1/nested.js']); } } ] } }); rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/000077500000000000000000000000001450520414700272755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/amd/000077500000000000000000000000001450520414700300365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/amd/0/000077500000000000000000000000001450520414700301755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/amd/0/1/000077500000000000000000000000001450520414700303355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/amd/0/1/nested.js000066400000000000000000000002371450520414700321570ustar00rootroot00000000000000define(['module', 'exports'], (function (module, exports) { 'use strict'; const url = new URL(module.uri, document.baseURI).href; exports.url = url; })); rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/amd/main.js000066400000000000000000000001641450520414700313210ustar00rootroot00000000000000define(['exports', './0/1/nested'], (function (exports, nested) { 'use strict'; exports.url = nested.url; })); rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/cjs/000077500000000000000000000000001450520414700300545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/cjs/0/000077500000000000000000000000001450520414700302135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/cjs/0/1/000077500000000000000000000000001450520414700303535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/cjs/0/1/nested.js000066400000000000000000000005211450520414700321710ustar00rootroot00000000000000'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; const url = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('0/1/nested.js', document.baseURI).href)); exports.url = url; rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/cjs/main.js000066400000000000000000000001251450520414700313340ustar00rootroot00000000000000'use strict'; var nested = require('./0/1/nested.js'); exports.url = nested.url; rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/es/000077500000000000000000000000001450520414700277045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/es/0/000077500000000000000000000000001450520414700300435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/es/0/1/000077500000000000000000000000001450520414700302035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/es/0/1/nested.js000066400000000000000000000000561450520414700320240ustar00rootroot00000000000000const url = import.meta.url; export { url }; rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/es/main.js000066400000000000000000000000471450520414700311670ustar00rootroot00000000000000export { url } from './0/1/nested.js'; rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/system/000077500000000000000000000000001450520414700306215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/system/0/000077500000000000000000000000001450520414700307605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/system/0/1/000077500000000000000000000000001450520414700311205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/system/0/1/nested.js000066400000000000000000000002451450520414700327410ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const url = exports('url', module.meta.url); }) }; })); rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/_expected/system/main.js000066400000000000000000000003041450520414700321000ustar00rootroot00000000000000System.register(['./0/1/nested.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('url', module.url); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/import-meta-numeric-paths/main.js000066400000000000000000000000471450520414700266200ustar00rootroot00000000000000export { url } from './0/1/nested.js'; rollup-3.29.4/test/chunking-form/samples/import-meta-url/000077500000000000000000000000001450520414700233605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_config.js000066400000000000000000000002621450520414700253220ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports import.meta.url', options: { preserveEntrySignatures: false, output: { chunkFileNames: 'nested/chunk.js' } } }); rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/000077500000000000000000000000001450520414700253205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/amd/000077500000000000000000000000001450520414700260615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/amd/main.js000066400000000000000000000006451450520414700273500ustar00rootroot00000000000000define(['module', 'require', 'exports'], (function (module, require, exports) { 'use strict'; function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerHTML += url + '
'; } } log('main: ' + new URL(module.uri, document.baseURI).href); new Promise(function (resolve, reject) { require(['./nested/chunk'], resolve, reject); }); exports.log = log; })); rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/amd/nested/000077500000000000000000000000001450520414700273435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/amd/nested/chunk.js000066400000000000000000000002221450520414700310050ustar00rootroot00000000000000define(['module', '../main'], (function (module, main) { 'use strict'; main.log('nested: ' + new URL(module.uri, document.baseURI).href); })); rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/cjs/000077500000000000000000000000001450520414700260775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/cjs/main.js000066400000000000000000000010501450520414700273550ustar00rootroot00000000000000'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerHTML += url + '
'; } } log('main: ' + (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('main.js', document.baseURI).href))); Promise.resolve().then(function () { return require('./nested/chunk.js'); }); exports.log = log; rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/cjs/nested/000077500000000000000000000000001450520414700273615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/cjs/nested/chunk.js000066400000000000000000000005551450520414700310340ustar00rootroot00000000000000'use strict'; var main = require('../main.js'); var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; main.log('nested: ' + (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('nested/chunk.js', document.baseURI).href))); rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/es/000077500000000000000000000000001450520414700257275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/es/main.js000066400000000000000000000003371450520414700272140ustar00rootroot00000000000000function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerHTML += url + '
'; } } log('main: ' + import.meta.url); import('./nested/chunk.js'); export { log as l }; rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/es/nested/000077500000000000000000000000001450520414700272115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/es/nested/chunk.js000066400000000000000000000001131450520414700306520ustar00rootroot00000000000000import { l as log } from '../main.js'; log('nested: ' + import.meta.url); rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/system/000077500000000000000000000000001450520414700266445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/system/main.js000066400000000000000000000005671450520414700301360ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { exports('l', log); function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerHTML += url + '
'; } } log('main: ' + module.meta.url); module.import('./nested/chunk.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/system/nested/000077500000000000000000000000001450520414700301265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-meta-url/_expected/system/nested/chunk.js000066400000000000000000000003521450520414700315740ustar00rootroot00000000000000System.register(['../main.js'], (function (exports, module) { 'use strict'; var log; return { setters: [function (module) { log = module.l; }], execute: (function () { log('nested: ' + module.meta.url); }) }; })); rollup-3.29.4/test/chunking-form/samples/import-meta-url/index-amd.html000066400000000000000000000003431450520414700261140ustar00rootroot00000000000000 AMD rollup-3.29.4/test/chunking-form/samples/import-meta-url/index-es.html000066400000000000000000000002741450520414700257650ustar00rootroot00000000000000 ES Module rollup-3.29.4/test/chunking-form/samples/import-meta-url/index-system.html000066400000000000000000000004061450520414700266770ustar00rootroot00000000000000 SystemJS rollup-3.29.4/test/chunking-form/samples/import-meta-url/log.js000066400000000000000000000002211450520414700244720ustar00rootroot00000000000000export function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerHTML += url + '
'; } } rollup-3.29.4/test/chunking-form/samples/import-meta-url/main.js000066400000000000000000000001241450520414700246370ustar00rootroot00000000000000import {log} from './log'; log('main: ' + import.meta.url); import('./nested.js'); rollup-3.29.4/test/chunking-form/samples/import-meta-url/nested.js000066400000000000000000000000771450520414700252040ustar00rootroot00000000000000import {log} from './log'; log('nested: ' + import.meta.url); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/000077500000000000000000000000001450520414700255525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_config.js000066400000000000000000000002361450520414700275150ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunk duplicate import deshadowing', options: { input: ['main1.js', 'main2.js', 'first.js', 'head.js'] } }); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/000077500000000000000000000000001450520414700275125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/amd/000077500000000000000000000000001450520414700302535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/amd/first.js000066400000000000000000000001211450520414700317320ustar00rootroot00000000000000define((function () { 'use strict'; var head2 = 'first'; return head2; })); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/amd/head.js000066400000000000000000000001161450520414700315100ustar00rootroot00000000000000define(['./first'], (function (first) { 'use strict'; return first; })); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/amd/main1.js000066400000000000000000000001471450520414700316200ustar00rootroot00000000000000define(['./first'], (function (first) { 'use strict'; console.log(first); console.log(first); })); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/amd/main2.js000066400000000000000000000001471450520414700316210ustar00rootroot00000000000000define(['./first'], (function (first) { 'use strict'; console.log(first); console.log(first); })); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/000077500000000000000000000000001450520414700302715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/first.js000066400000000000000000000000751450520414700317600ustar00rootroot00000000000000'use strict'; var head2 = 'first'; module.exports = head2; rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/head.js000066400000000000000000000001151450520414700315250ustar00rootroot00000000000000'use strict'; var first = require('./first.js'); module.exports = first; rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/main1.js000066400000000000000000000001331450520414700316310ustar00rootroot00000000000000'use strict'; var first = require('./first.js'); console.log(first); console.log(first); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/main2.js000066400000000000000000000001331450520414700316320ustar00rootroot00000000000000'use strict'; var first = require('./first.js'); console.log(first); console.log(first); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/es/000077500000000000000000000000001450520414700301215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/es/first.js000066400000000000000000000000631450520414700316050ustar00rootroot00000000000000var head2 = 'first'; export { head2 as default }; rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/es/head.js000066400000000000000000000000461450520414700313600ustar00rootroot00000000000000export { default } from './first.js'; rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/es/main1.js000066400000000000000000000001111450520414700314550ustar00rootroot00000000000000import head2 from './first.js'; console.log(head2); console.log(head2); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/es/main2.js000066400000000000000000000001111450520414700314560ustar00rootroot00000000000000import head2 from './first.js'; console.log(head2); console.log(head2); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/system/000077500000000000000000000000001450520414700310365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/system/first.js000066400000000000000000000002311450520414700325170ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var head2 = exports('default', 'first'); }) }; })); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/system/head.js000066400000000000000000000003071450520414700322750ustar00rootroot00000000000000System.register(['./first.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/system/main1.js000066400000000000000000000003551450520414700324040ustar00rootroot00000000000000System.register(['./first.js'], (function () { 'use strict'; var head2; return { setters: [function (module) { head2 = module.default; }], execute: (function () { console.log(head2); console.log(head2); }) }; })); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/_expected/system/main2.js000066400000000000000000000003551450520414700324050ustar00rootroot00000000000000System.register(['./first.js'], (function () { 'use strict'; var head2; return { setters: [function (module) { head2 = module.default; }], execute: (function () { console.log(head2); console.log(head2); }) }; })); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/first.js000066400000000000000000000000271450520414700272360ustar00rootroot00000000000000export default 'first';rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/head.js000066400000000000000000000000451450520414700270100ustar00rootroot00000000000000export { default } from './first.js';rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/main1.js000066400000000000000000000001501450520414700271110ustar00rootroot00000000000000import head1 from './first.js'; import head2 from './head.js'; console.log(head1); console.log(head2); rollup-3.29.4/test/chunking-form/samples/import-variable-duplicates/main2.js000066400000000000000000000001501450520414700271120ustar00rootroot00000000000000import head1 from './first.js'; import head2 from './head.js'; console.log(head1); console.log(head2); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/000077500000000000000000000000001450520414700250625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/000077500000000000000000000000001450520414700323145ustar00rootroot00000000000000_config.js000066400000000000000000000001571450520414700342020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedmodule.exports = defineTest({ description: 'chained dynamic import that imports something already loaded' }); _expected/000077500000000000000000000000001450520414700341755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedamd/000077500000000000000000000000001450520414700347365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expectedgenerated-dynamic1.js000066400000000000000000000002731450520414700407370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); console.log('dynamic1'); })); generated-dynamic2.js000066400000000000000000000001601450520414700407330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/amddefine(['exports', './main'], (function (exports, main) { 'use strict'; exports.shared = main.shared; })); main.js000066400000000000000000000003531450520414700362210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); exports.shared = shared; })); cjs/000077500000000000000000000000001450520414700347545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expectedgenerated-dynamic1.js000066400000000000000000000001741450520414700407550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); console.log('dynamic1'); generated-dynamic2.js000066400000000000000000000001211450520414700407460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/cjs'use strict'; var main = require('./main.js'); exports.shared = main.shared; main.js000066400000000000000000000002271450520414700362370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/cjs'use strict'; const shared = 'shared'; Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); exports.shared = shared; es/000077500000000000000000000000001450520414700346045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expectedgenerated-dynamic1.js000066400000000000000000000000741450520414700406040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/esimport('./generated-dynamic2.js'); console.log('dynamic1'); generated-dynamic2.js000066400000000000000000000000441450520414700406020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/esexport { shared } from './main.js'; main.js000066400000000000000000000001211450520414700360600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/esconst shared = 'shared'; import('./generated-dynamic1.js'); export { shared }; system/000077500000000000000000000000001450520414700355215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expectedgenerated-dynamic1.js000066400000000000000000000002761450520414700415250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic2.js'); console.log('dynamic1'); }) }; })); generated-dynamic2.js000066400000000000000000000003041450520414700415160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('shared', module.shared); }], execute: (function () { }) }; })); main.js000066400000000000000000000003221450520414700370000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('shared', 'shared'); module.import('./generated-dynamic1.js'); }) }; })); dynamic1.js000066400000000000000000000000621450520414700342760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedimport('./dynamic2.js'); console.log('dynamic1'); dynamic2.js000066400000000000000000000000461450520414700343010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedexport { shared } from './shared.js'; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/main.js000066400000000000000000000000771450520414700336020ustar00rootroot00000000000000export { shared } from './shared.js'; import('./dynamic1.js'); shared.js000066400000000000000000000000401450520414700340330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedexport const shared = 'shared'; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/000077500000000000000000000000001450520414700320035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_config.js000066400000000000000000000001231450520414700337410ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles circular dynamic imports' }); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/000077500000000000000000000000001450520414700337435ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700344255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expectedgenerated-dynamic1.js000066400000000000000000000002731450520414700404260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); console.log('dynamic1'); })); generated-dynamic2.js000066400000000000000000000002551450520414700404270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./main'], resolve, reject); }); console.log('dynamic2'); })); main.js000066400000000000000000000004311450520414700357050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); console.log('main'); })); cjs/000077500000000000000000000000001450520414700344435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expectedgenerated-dynamic1.js000066400000000000000000000001741450520414700404440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); console.log('dynamic1'); generated-dynamic2.js000066400000000000000000000001561450520414700404450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./main.js'); }); console.log('dynamic2'); main.js000066400000000000000000000003141450520414700357230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); console.log('main'); es/000077500000000000000000000000001450520414700342735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expectedgenerated-dynamic1.js000066400000000000000000000000741450520414700402730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/esimport('./generated-dynamic2.js'); console.log('dynamic1'); generated-dynamic2.js000066400000000000000000000000561450520414700402740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/esimport('./main.js'); console.log('dynamic2'); main.js000066400000000000000000000001331450520414700355520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/esimport('./generated-dynamic2.js'); import('./generated-dynamic1.js'); console.log('main'); system/000077500000000000000000000000001450520414700352105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expectedgenerated-dynamic1.js000066400000000000000000000002761450520414700412140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic2.js'); console.log('dynamic1'); }) }; })); generated-dynamic2.js000066400000000000000000000002601450520414700412060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./main.js'); console.log('dynamic2'); }) }; })); main.js000066400000000000000000000003471450520414700364760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic2.js'); module.import('./generated-dynamic1.js'); console.log('main'); }) }; })); dynamic1.js000066400000000000000000000000621450520414700337650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-importsimport('./dynamic2.js'); console.log('dynamic1'); dynamic2.js000066400000000000000000000000561450520414700337710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-importsimport('./main.js'); console.log('dynamic2'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/main.js000066400000000000000000000001071450520414700332630ustar00rootroot00000000000000import('./dynamic2.js'); import('./dynamic1.js'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/000077500000000000000000000000001450520414700264255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_config.js000066400000000000000000000003071450520414700303670ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not avoid separate chunks if too many modules dynamically import the same chunk', options: { input: ['main1', 'main2', 'main3', 'main4'] } }); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/000077500000000000000000000000001450520414700303655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amd/000077500000000000000000000000001450520414700311265ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001611450520414700341070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'shared'; exports.value = value; })); generated-dynamic1.js000066400000000000000000000003361450520414700350500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amddefine(['require', './generated-dep'], (function (require, dep) { 'use strict'; console.log('dynamic1', dep.value); new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); })); generated-dynamic2.js000066400000000000000000000001501450520414700350430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amddefine(['./generated-dep'], (function (dep) { 'use strict'; console.log('dynamic2', dep.value); })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amd/main1.js000066400000000000000000000003331450520414700324700ustar00rootroot00000000000000define(['require', './generated-dep'], (function (require, dep) { 'use strict'; console.log('main1', dep.value); new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amd/main2.js000066400000000000000000000003331450520414700324710ustar00rootroot00000000000000define(['require', './generated-dep'], (function (require, dep) { 'use strict'; console.log('main1', dep.value); new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amd/main3.js000066400000000000000000000003331450520414700324720ustar00rootroot00000000000000define(['require', './generated-dep'], (function (require, dep) { 'use strict'; console.log('main1', dep.value); new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amd/main4.js000066400000000000000000000003331450520414700324730ustar00rootroot00000000000000define(['require', './generated-dep'], (function (require, dep) { 'use strict'; console.log('main1', dep.value); new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs/000077500000000000000000000000001450520414700311445ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000771450520414700341330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs'use strict'; const value = 'shared'; exports.value = value; generated-dynamic1.js000066400000000000000000000002611450520414700350630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); console.log('dynamic1', dep.value); Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); generated-dynamic2.js000066400000000000000000000001351450520414700350640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); console.log('dynamic2', dep.value); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs/main1.js000066400000000000000000000002561450520414700325120ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep.value); Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs/main2.js000066400000000000000000000002561450520414700325130ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep.value); Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs/main3.js000066400000000000000000000002561450520414700325140ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep.value); Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs/main4.js000066400000000000000000000002561450520414700325150ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep.value); Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/es/000077500000000000000000000000001450520414700307745ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000601450520414700337530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/esconst value = 'shared'; export { value as v }; generated-dynamic1.js000066400000000000000000000001651450520414700347160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/esimport { v as value } from './generated-dep.js'; console.log('dynamic1', value); import('./generated-dynamic2.js'); generated-dynamic2.js000066400000000000000000000001221450520414700347100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/esimport { v as value } from './generated-dep.js'; console.log('dynamic2', value); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/es/main1.js000066400000000000000000000001621450520414700323360ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('main1', value); import('./generated-dynamic1.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/es/main2.js000066400000000000000000000001621450520414700323370ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('main1', value); import('./generated-dynamic1.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/es/main3.js000066400000000000000000000001621450520414700323400ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('main1', value); import('./generated-dynamic1.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/es/main4.js000066400000000000000000000001621450520414700323410ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('main1', value); import('./generated-dynamic1.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/system/000077500000000000000000000000001450520414700317115ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002261450520414700346740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('v', 'shared'); }) }; })); generated-dynamic1.js000066400000000000000000000004401450520414700356270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/systemSystem.register(['./generated-dep.js'], (function (exports, module) { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('dynamic1', value); module.import('./generated-dynamic2.js'); }) }; })); generated-dynamic2.js000066400000000000000000000003441450520414700356330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('dynamic2', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/system/main1.js000066400000000000000000000004351450520414700332560ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function (exports, module) { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main1', value); module.import('./generated-dynamic1.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/system/main2.js000066400000000000000000000004351450520414700332570ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function (exports, module) { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main1', value); module.import('./generated-dynamic1.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/system/main3.js000066400000000000000000000004351450520414700332600ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function (exports, module) { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main1', value); module.import('./generated-dynamic1.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/system/main4.js000066400000000000000000000004351450520414700332610ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function (exports, module) { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main1', value); module.import('./generated-dynamic1.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/dep.js000066400000000000000000000000371450520414700275330ustar00rootroot00000000000000export const value = 'shared'; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/dynamic1.js000066400000000000000000000001341450520414700304660ustar00rootroot00000000000000import { value } from './dep.js'; console.log('dynamic1', value); import('./dynamic2.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/dynamic2.js000066400000000000000000000001021450520414700304620ustar00rootroot00000000000000import { value } from './dep.js'; console.log('dynamic2', value); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/main1.js000066400000000000000000000001301450520414700277620ustar00rootroot00000000000000import { value } from './dep.js'; console.log('main1', value); import('./dynamic1.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/main2.js000066400000000000000000000001301450520414700277630ustar00rootroot00000000000000import { value } from './dep.js'; console.log('main1', value); import('./dynamic1.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/main3.js000066400000000000000000000001301450520414700277640ustar00rootroot00000000000000import { value } from './dep.js'; console.log('main1', value); import('./dynamic1.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/cut-off/main4.js000066400000000000000000000001301450520414700277650ustar00rootroot00000000000000import { value } from './dep.js'; console.log('main1', value); import('./dynamic1.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/000077500000000000000000000000001450520414700335355ustar00rootroot00000000000000_config.js000066400000000000000000000001571450520414700354230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1module.exports = defineTest({ description: 'inlines dynamic imports that are already statically imported' }); _expected/000077500000000000000000000000001450520414700354165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1amd/000077500000000000000000000000001450520414700361575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expectedmain.js000066400000000000000000000011621450520414700374410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expected/amddefine(['exports'], (function (exports) { 'use strict'; Promise.resolve().then(function () { return main; }).then(console.log); console.log('dep1'); const value1 = 'dep1'; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, value1: value1 }); Promise.resolve().then(function () { return dep1; }).then(console.log); console.log('dep2'); const value2 = 'dep2'; Promise.resolve().then(function () { return main; }).then(console.log); console.log('main', value1, value2); const value = 'main'; var main = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); exports.value = value; })); cjs/000077500000000000000000000000001450520414700361755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expectedmain.js000066400000000000000000000010601450520414700374540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expected/cjs'use strict'; Promise.resolve().then(function () { return main; }).then(console.log); console.log('dep1'); const value1 = 'dep1'; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, value1: value1 }); Promise.resolve().then(function () { return dep1; }).then(console.log); console.log('dep2'); const value2 = 'dep2'; Promise.resolve().then(function () { return main; }).then(console.log); console.log('main', value1, value2); const value = 'main'; var main = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); exports.value = value; es/000077500000000000000000000000001450520414700360255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expectedmain.js000066400000000000000000000010341450520414700373050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expected/esPromise.resolve().then(function () { return main; }).then(console.log); console.log('dep1'); const value1 = 'dep1'; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, value1: value1 }); Promise.resolve().then(function () { return dep1; }).then(console.log); console.log('dep2'); const value2 = 'dep2'; Promise.resolve().then(function () { return main; }).then(console.log); console.log('main', value1, value2); const value = 'main'; var main = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); export { value }; system/000077500000000000000000000000001450520414700367425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expectedmain.js000066400000000000000000000012731450520414700402270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { Promise.resolve().then(function () { return main; }).then(console.log); console.log('dep1'); const value1 = 'dep1'; var dep1 = /*#__PURE__*/Object.freeze({ __proto__: null, value1: value1 }); Promise.resolve().then(function () { return dep1; }).then(console.log); console.log('dep2'); const value2 = 'dep2'; Promise.resolve().then(function () { return main; }).then(console.log); console.log('main', value1, value2); const value = exports('value', 'main'); var main = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); }) }; })); dep1.js000066400000000000000000000001321450520414700346410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1import('./main.js').then(console.log); console.log('dep1'); export const value1 = 'dep1'; dep2.js000066400000000000000000000001321450520414700346420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1import('./dep1.js').then(console.log); console.log('dep2'); export const value2 = 'dep2'; main.js000066400000000000000000000002621450520414700347400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1import { value1 } from './dep1.js'; import { value2 } from './dep2.js'; import('./main.js').then(console.log); console.log('main', value1, value2); export const value = 'main'; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/000077500000000000000000000000001450520414700335365ustar00rootroot00000000000000_config.js000066400000000000000000000002021450520414700354130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2module.exports = defineTest({ description: 'inlines dynamic imports that are already statically imported by their importers' }); _expected/000077500000000000000000000000001450520414700354175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2amd/000077500000000000000000000000001450520414700361605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expectedmain.js000066400000000000000000000010071450520414700374400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expected/amddefine((function () { 'use strict'; Promise.resolve().then(function () { return dynamic2; }).then(console.log); console.log('dynamic1'); const value1 = 'dynamic1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, value1: value1 }); console.log('dynamic2'); const value2 = 'dynamic2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, value2: value2 }); Promise.resolve().then(function () { return dynamic1; }).then(console.log); console.log('main', value1, value2); })); cjs/000077500000000000000000000000001450520414700361765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expectedmain.js000066400000000000000000000007341450520414700374640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expected/cjs'use strict'; Promise.resolve().then(function () { return dynamic2; }).then(console.log); console.log('dynamic1'); const value1 = 'dynamic1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, value1: value1 }); console.log('dynamic2'); const value2 = 'dynamic2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, value2: value2 }); Promise.resolve().then(function () { return dynamic1; }).then(console.log); console.log('main', value1, value2); es/000077500000000000000000000000001450520414700360265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expectedmain.js000066400000000000000000000007151450520414700373130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expected/esPromise.resolve().then(function () { return dynamic2; }).then(console.log); console.log('dynamic1'); const value1 = 'dynamic1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, value1: value1 }); console.log('dynamic2'); const value2 = 'dynamic2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, value2: value2 }); Promise.resolve().then(function () { return dynamic1; }).then(console.log); console.log('main', value1, value2); system/000077500000000000000000000000001450520414700367435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expectedmain.js000066400000000000000000000011401450520414700402210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { Promise.resolve().then(function () { return dynamic2; }).then(console.log); console.log('dynamic1'); const value1 = 'dynamic1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, value1: value1 }); console.log('dynamic2'); const value2 = 'dynamic2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, value2: value2 }); Promise.resolve().then(function () { return dynamic1; }).then(console.log); console.log('main', value1, value2); }) }; })); dynamic1.js000066400000000000000000000001461450520414700355230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2import('./dynamic2.js').then(console.log); console.log('dynamic1'); export const value1 = 'dynamic1'; dynamic2.js000066400000000000000000000000731450520414700355230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2console.log('dynamic2'); export const value2 = 'dynamic2'; main.js000066400000000000000000000002411450520414700347360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2import { value1 } from './dynamic1.js'; import { value2 } from './dynamic2.js'; import('./dynamic1.js').then(console.log); console.log('main', value1, value2); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/000077500000000000000000000000001450520414700336715ustar00rootroot00000000000000_config.js000066400000000000000000000001761450520414700355600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stagemodule.exports = defineTest({ description: 'handles if a dynamically imported module imports another module dynamically' }); _expected/000077500000000000000000000000001450520414700355525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stageamd/000077500000000000000000000000001450520414700363135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expectedgenerated-dynamic1.js000066400000000000000000000002411450520414700423070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); })); generated-dynamic2.js000066400000000000000000000002231450520414700423100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/amddefine(['exports', './main'], (function (exports, main) { 'use strict'; console.log('dynamic2', main.value); exports.value = main.value; })); main.js000066400000000000000000000004111450520414700375710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const value = 'shared'; console.log('dynamic1', value); new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); exports.value = value; })); cjs/000077500000000000000000000000001450520414700363315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expectedgenerated-dynamic1.js000066400000000000000000000001431450520414700423260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); generated-dynamic2.js000066400000000000000000000001631450520414700423310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/cjs'use strict'; var main = require('./main.js'); console.log('dynamic2', main.value); exports.value = main.value; main.js000066400000000000000000000002641450520414700376150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/cjs'use strict'; const value = 'shared'; console.log('dynamic1', value); Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); exports.value = value; es/000077500000000000000000000000001450520414700361615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expectedgenerated-dynamic1.js000066400000000000000000000000431450520414700421550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/esimport('./generated-dynamic2.js'); generated-dynamic2.js000066400000000000000000000001271450520414700421610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/esimport { value } from './main.js'; console.log('dynamic2', value); export { value }; main.js000066400000000000000000000001571450520414700374460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/esconst value = 'shared'; console.log('dynamic1', value); import('./generated-dynamic1.js'); export { value }; system/000077500000000000000000000000001450520414700370765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expectedgenerated-dynamic1.js000066400000000000000000000002421450520414700430730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic2.js'); }) }; })); generated-dynamic2.js000066400000000000000000000004111450520414700430720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var value; return { setters: [function (module) { value = module.value; exports('value', module.value); }], execute: (function () { console.log('dynamic2', value); }) }; })); main.js000066400000000000000000000003631450520414700403620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const value = exports('value', 'shared'); console.log('dynamic1', value); module.import('./generated-dynamic1.js'); }) }; })); dep.js000066400000000000000000000000371450520414700347200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stageexport const value = 'shared'; dynamic1.js000066400000000000000000000000311450520414700356470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stageimport('./dynamic2.js'); dynamic2.js000066400000000000000000000001251450520414700356540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stageimport { value } from './dep.js'; console.log('dynamic2', value); export { value }; main.js000066400000000000000000000001561450520414700350760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stageimport { value } from './dep.js'; console.log('dynamic1', value); import('./dynamic1.js'); export { value }; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/000077500000000000000000000000001450520414700314405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_config.js000066400000000000000000000001761450520414700334060ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles if a dynamically imported module imports another module dynamically' }); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/000077500000000000000000000000001450520414700334005ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700340625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expectedgenerated-dynamic1.js000066400000000000000000000004111450520414700400550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const value = 'shared'; console.log('dynamic1', value); new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); exports.value = value; })); generated-dynamic2.js000066400000000000000000000002551450520414700400640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/amddefine(['exports', './generated-dynamic1'], (function (exports, dynamic1) { 'use strict'; console.log('dynamic2', dynamic1.value); exports.value = dynamic1.value; })); main.js000066400000000000000000000002411450520414700353410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); })); cjs/000077500000000000000000000000001450520414700341005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expectedgenerated-dynamic1.js000066400000000000000000000002641450520414700401010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/cjs'use strict'; const value = 'shared'; console.log('dynamic1', value); Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); exports.value = value; generated-dynamic2.js000066400000000000000000000002151450520414700400760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/cjs'use strict'; var dynamic1 = require('./generated-dynamic1.js'); console.log('dynamic2', dynamic1.value); exports.value = dynamic1.value; main.js000066400000000000000000000001431450520414700353600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); es/000077500000000000000000000000001450520414700337305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expectedgenerated-dynamic1.js000066400000000000000000000001571450520414700377320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/esconst value = 'shared'; console.log('dynamic1', value); import('./generated-dynamic2.js'); export { value }; generated-dynamic2.js000066400000000000000000000001451450520414700377300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/esimport { value } from './generated-dynamic1.js'; console.log('dynamic2', value); export { value }; main.js000066400000000000000000000000431450520414700352070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/esimport('./generated-dynamic1.js'); system/000077500000000000000000000000001450520414700346455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expectedgenerated-dynamic1.js000066400000000000000000000003631450520414700406460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const value = exports('value', 'shared'); console.log('dynamic1', value); module.import('./generated-dynamic2.js'); }) }; })); generated-dynamic2.js000066400000000000000000000004271450520414700406500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/systemSystem.register(['./generated-dynamic1.js'], (function (exports) { 'use strict'; var value; return { setters: [function (module) { value = module.value; exports('value', module.value); }], execute: (function () { console.log('dynamic2', value); }) }; })); main.js000066400000000000000000000002421450520414700361250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic1.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/dep.js000066400000000000000000000000371450520414700325460ustar00rootroot00000000000000export const value = 'shared'; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/dynamic1.js000066400000000000000000000001561450520414700335050ustar00rootroot00000000000000import { value } from './dep.js'; console.log('dynamic1', value); import('./dynamic2.js'); export { value }; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/dynamic2.js000066400000000000000000000001251450520414700335020ustar00rootroot00000000000000import { value } from './dep.js'; console.log('dynamic2', value); export { value }; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/main.js000066400000000000000000000000311450520414700327140ustar00rootroot00000000000000import('./dynamic1.js'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/000077500000000000000000000000001450520414700312165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_config.js000066400000000000000000000002501450520414700331550ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps chunks separate when not in memory for all dynamic imports', options: { input: ['main1', 'main2', 'main3'] } }); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/000077500000000000000000000000001450520414700331565ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700336405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expectedgenerated-dep.js000066400000000000000000000001611450520414700367000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value1 = 'dep'; exports.value1 = value1; })); generated-dynamic.js000066400000000000000000000001501450520414700375520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amddefine(['./generated-dep'], (function (dep) { 'use strict'; console.log('dynamic', dep.value1); })); generated-shared.js000066400000000000000000000003341450520414700374000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amddefine(['require', './generated-dep'], (function (require, dep) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); console.log('shared', dep.value1); })); main1.js000066400000000000000000000001701450520414700352010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amddefine(['./generated-shared', './generated-dep'], (function (shared, dep) { 'use strict'; console.log('main1'); })); main2.js000066400000000000000000000001701450520414700352020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amddefine(['./generated-shared', './generated-dep'], (function (shared, dep) { 'use strict'; console.log('main2'); })); main3.js000066400000000000000000000002701450520414700352040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); console.log('main3'); })); cjs/000077500000000000000000000000001450520414700336565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expectedgenerated-dep.js000066400000000000000000000000771450520414700367240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs'use strict'; const value1 = 'dep'; exports.value1 = value1; generated-dynamic.js000066400000000000000000000001351450520414700375730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); console.log('dynamic', dep.value1); generated-shared.js000066400000000000000000000002571450520414700374220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); console.log('shared', dep.value1); main1.js000066400000000000000000000001471450520414700352230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs'use strict'; require('./generated-shared.js'); require('./generated-dep.js'); console.log('main1'); main2.js000066400000000000000000000001471450520414700352240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs'use strict'; require('./generated-shared.js'); require('./generated-dep.js'); console.log('main2'); main3.js000066400000000000000000000001711450520414700352220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); console.log('main3'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/000077500000000000000000000000001450520414700335655ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000571450520414700365520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esconst value1 = 'dep'; export { value1 as v }; generated-dynamic.js000066400000000000000000000001231450520414700374200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esimport { v as value1 } from './generated-dep.js'; console.log('dynamic', value1); generated-shared.js000066400000000000000000000001641450520414700372470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esimport { v as value1 } from './generated-dep.js'; import('./generated-dynamic.js'); console.log('shared', value1); main1.js000066400000000000000000000001241450520414700350460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esimport './generated-shared.js'; import './generated-dep.js'; console.log('main1'); main2.js000066400000000000000000000001241450520414700350470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esimport './generated-shared.js'; import './generated-dep.js'; console.log('main2'); main3.js000066400000000000000000000000711450520414700350510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esimport('./generated-dynamic.js'); console.log('main3'); system/000077500000000000000000000000001450520414700344235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expectedgenerated-dep.js000066400000000000000000000002241450520414700374630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value1 = exports('v', 'dep'); }) }; })); generated-dynamic.js000066400000000000000000000003461450520414700403440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var value1; return { setters: [function (module) { value1 = module.v; }], execute: (function () { console.log('dynamic', value1); }) }; })); generated-shared.js000066400000000000000000000004401450520414700401610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/systemSystem.register(['./generated-dep.js'], (function (exports, module) { 'use strict'; var value1; return { setters: [function (module) { value1 = module.v; }], execute: (function () { module.import('./generated-dynamic.js'); console.log('shared', value1); }) }; })); main1.js000066400000000000000000000003051450520414700357640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/systemSystem.register(['./generated-shared.js', './generated-dep.js'], (function () { 'use strict'; return { setters: [null, null], execute: (function () { console.log('main1'); }) }; })); main2.js000066400000000000000000000003051450520414700357650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/systemSystem.register(['./generated-shared.js', './generated-dep.js'], (function () { 'use strict'; return { setters: [null, null], execute: (function () { console.log('main2'); }) }; })); main3.js000066400000000000000000000002731450520414700357720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic.js'); console.log('main3'); }) }; })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/dep.js000066400000000000000000000000351450520414700323220ustar00rootroot00000000000000export const value1 = 'dep'; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/dynamic.js000066400000000000000000000001031450520414700331720ustar00rootroot00000000000000import { value1 } from './dep.js'; console.log('dynamic', value1); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/main1.js000066400000000000000000000000551450520414700325610ustar00rootroot00000000000000import './shared.js'; console.log('main1'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/main2.js000066400000000000000000000000551450520414700325620ustar00rootroot00000000000000import './shared.js'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/main3.js000066400000000000000000000000571450520414700325650ustar00rootroot00000000000000import('./dynamic.js'); console.log('main3'); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/shared.js000066400000000000000000000001321450520414700330160ustar00rootroot00000000000000import { value1 } from './dep.js'; import('./dynamic.js'); console.log('shared', value1); multi-entry-different-and-shared-dependencies/000077500000000000000000000000001450520414700356705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks_config.js000066400000000000000000000003271450520414700376340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesmodule.exports = defineTest({ description: 'avoids chunks for always loaded dependencies if multiple entry points with different dependencies have dynamic imports', options: { input: ['main1', 'main2'] } }); _expected/000077500000000000000000000000001450520414700376305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesamd/000077500000000000000000000000001450520414700403715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expectedgenerated-dynamic.js000066400000000000000000000005161450520414700443110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/amddefine(['exports', './generated-from-main-1-and-dynamic', './generated-from-main-1-and-2'], (function (exports, fromMain1AndDynamic, fromMain1And2) { 'use strict'; console.log('dynamic1', fromMain1AndDynamic.value1, fromMain1And2.value2); exports.value1 = fromMain1AndDynamic.value1; exports.value2 = fromMain1And2.value2; })); generated-from-main-1-and-2.js000066400000000000000000000002571450520414700456110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value2 = 'all'; const value3 = 'main1 and main2'; exports.value2 = value2; exports.value3 = value3; })); generated-from-main-1-and-dynamic.js000066400000000000000000000001771450520414700470750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value1 = 'main1 and dynamic'; exports.value1 = value1; })); main1.js000066400000000000000000000007761450520414700417460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/amddefine(['require', 'exports', './generated-from-main-1-and-dynamic', './generated-from-main-1-and-2'], (function (require, exports, fromMain1AndDynamic, fromMain1And2) { 'use strict'; console.log('main1', fromMain1AndDynamic.value1, fromMain1And2.value2, fromMain1And2.value3); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); exports.value1 = fromMain1AndDynamic.value1; exports.value2 = fromMain1And2.value2; exports.value3 = fromMain1And2.value3; })); main2.js000066400000000000000000000005701450520414700417370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/amddefine(['require', 'exports', './generated-from-main-1-and-2'], (function (require, exports, fromMain1And2) { 'use strict'; console.log('main2', fromMain1And2.value2, fromMain1And2.value3); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); exports.value2 = fromMain1And2.value2; exports.value3 = fromMain1And2.value3; })); cjs/000077500000000000000000000000001450520414700404075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expectedgenerated-dynamic.js000066400000000000000000000004761450520414700443340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/cjs'use strict'; var fromMain1AndDynamic = require('./generated-from-main-1-and-dynamic.js'); var fromMain1And2 = require('./generated-from-main-1-and-2.js'); console.log('dynamic1', fromMain1AndDynamic.value1, fromMain1And2.value2); exports.value1 = fromMain1AndDynamic.value1; exports.value2 = fromMain1And2.value2; generated-from-main-1-and-2.js000066400000000000000000000001731450520414700456240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/cjs'use strict'; const value2 = 'all'; const value3 = 'main1 and main2'; exports.value2 = value2; exports.value3 = value3; generated-from-main-1-and-dynamic.js000066400000000000000000000001151450520414700471030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/cjs'use strict'; const value1 = 'main1 and dynamic'; exports.value1 = value1; main1.js000066400000000000000000000007131450520414700417530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/cjs'use strict'; var fromMain1AndDynamic = require('./generated-from-main-1-and-dynamic.js'); var fromMain1And2 = require('./generated-from-main-1-and-2.js'); console.log('main1', fromMain1AndDynamic.value1, fromMain1And2.value2, fromMain1And2.value3); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); exports.value1 = fromMain1AndDynamic.value1; exports.value2 = fromMain1And2.value2; exports.value3 = fromMain1And2.value3; main2.js000066400000000000000000000004651450520414700417600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/cjs'use strict'; var fromMain1And2 = require('./generated-from-main-1-and-2.js'); console.log('main2', fromMain1And2.value2, fromMain1And2.value3); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); exports.value2 = fromMain1And2.value2; exports.value3 = fromMain1And2.value3; es/000077500000000000000000000000001450520414700402375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expectedgenerated-dynamic.js000066400000000000000000000003141450520414700441530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/esimport { v as value1 } from './generated-from-main-1-and-dynamic.js'; import { v as value2 } from './generated-from-main-1-and-2.js'; console.log('dynamic1', value1, value2); export { value1, value2 }; generated-from-main-1-and-2.js000066400000000000000000000001371450520414700454540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/esconst value2 = 'all'; const value3 = 'main1 and main2'; export { value3 as a, value2 as v }; generated-from-main-1-and-dynamic.js000066400000000000000000000000751450520414700467400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/esconst value1 = 'main1 and dynamic'; export { value1 as v }; main1.js000066400000000000000000000004101450520414700415750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/esimport { v as value1 } from './generated-from-main-1-and-dynamic.js'; import { v as value2, a as value3 } from './generated-from-main-1-and-2.js'; console.log('main1', value1, value2, value3); import('./generated-dynamic.js'); export { value1, value2, value3 }; main2.js000066400000000000000000000002621450520414700416030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/esimport { v as value2, a as value3 } from './generated-from-main-1-and-2.js'; console.log('main2', value2, value3); import('./generated-dynamic.js'); export { value2, value3 }; system/000077500000000000000000000000001450520414700411545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expectedgenerated-dynamic.js000066400000000000000000000006451450520414700450770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/systemSystem.register(['./generated-from-main-1-and-dynamic.js', './generated-from-main-1-and-2.js'], (function (exports) { 'use strict'; var value1, value2; return { setters: [function (module) { value1 = module.v; exports('value1', module.v); }, function (module) { value2 = module.v; exports('value2', module.v); }], execute: (function () { console.log('dynamic1', value1, value2); }) }; })); generated-from-main-1-and-2.js000066400000000000000000000003101450520414700463620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value2 = exports('v', 'all'); const value3 = exports('a', 'main1 and main2'); }) }; })); generated-from-main-1-and-dynamic.js000066400000000000000000000002421450520414700476510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value1 = exports('v', 'main1 and dynamic'); }) }; })); main1.js000066400000000000000000000010201450520414700425100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/systemSystem.register(['./generated-from-main-1-and-dynamic.js', './generated-from-main-1-and-2.js'], (function (exports, module) { 'use strict'; var value1, value2, value3; return { setters: [function (module) { value1 = module.v; exports('value1', module.v); }, function (module) { value2 = module.v; value3 = module.a; exports({ value2: module.v, value3: module.a }); }], execute: (function () { console.log('main1', value1, value2, value3); module.import('./generated-dynamic.js'); }) }; })); main2.js000066400000000000000000000006071450520414700425230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/systemSystem.register(['./generated-from-main-1-and-2.js'], (function (exports, module) { 'use strict'; var value2, value3; return { setters: [function (module) { value2 = module.v; value3 = module.a; exports({ value2: module.v, value3: module.a }); }], execute: (function () { console.log('main2', value2, value3); module.import('./generated-dynamic.js'); }) }; })); dynamic.js000066400000000000000000000002431450520414700376510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesimport { value1 } from './from-main-1-and-dynamic.js'; import { value2 } from './from-all.js'; console.log('dynamic1', value1, value2); export { value1, value2 }; from-all.js000066400000000000000000000000351450520414700377350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesexport const value2 = 'all'; from-main-1-and-2.js000066400000000000000000000000511450520414700411440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesexport const value3 = 'main1 and main2'; from-main-1-and-dynamic.js000066400000000000000000000000531450520414700424310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesexport const value1 = 'main1 and dynamic'; main1.js000066400000000000000000000003711450520414700372340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesimport { value1 } from './from-main-1-and-dynamic.js'; import { value2 } from './from-all.js'; import { value3 } from './from-main-1-and-2.js'; console.log('main1', value1, value2, value3); import('./dynamic.js'); export { value1, value2, value3 }; main2.js000066400000000000000000000002621450520414700372340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesimport { value2 } from './from-all.js'; import { value3 } from './from-main-1-and-2.js'; console.log('main2', value2, value3); import('./dynamic.js'); export { value2, value3 }; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/000077500000000000000000000000001450520414700337435ustar00rootroot00000000000000_config.js000066400000000000000000000003271450520414700356300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesmodule.exports = defineTest({ description: 'avoids chunks for always loaded dependencies if multiple entry points with different dependencies have dynamic imports', options: { input: ['main1', 'main2'] } }); _expected/000077500000000000000000000000001450520414700356245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesamd/000077500000000000000000000000001450520414700363655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expectedgenerated-dep1.js000066400000000000000000000001651450520414700415120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value1 = 'shared1'; exports.value1 = value1; })); generated-dep2.js000066400000000000000000000001651450520414700415130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value2 = 'shared2'; exports.value2 = value2; })); generated-dynamic.js000066400000000000000000000003461450520414700423060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/amddefine(['exports', './generated-dep1', './generated-dep2'], (function (exports, dep1, dep2) { 'use strict'; console.log('dynamic1', dep1.value1, dep2.value2); exports.value1 = dep1.value1; exports.value2 = dep2.value2; })); main1.js000066400000000000000000000006041450520414700377300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/amddefine(['require', 'exports', './generated-dep1', './generated-dep2'], (function (require, exports, dep1, dep2) { 'use strict'; const something = 'something'; console.log('main1', dep1.value1, dep2.value2, something); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); exports.value1 = dep1.value1; exports.value2 = dep2.value2; })); main2.js000066400000000000000000000004221450520414700377270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/amddefine(['require', 'exports', './generated-dep2'], (function (require, exports, dep2) { 'use strict'; console.log('main2', dep2.value2); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); exports.value2 = dep2.value2; })); cjs/000077500000000000000000000000001450520414700364035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expectedgenerated-dep1.js000066400000000000000000000001031450520414700415200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/cjs'use strict'; const value1 = 'shared1'; exports.value1 = value1; generated-dep2.js000066400000000000000000000001031450520414700415210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/cjs'use strict'; const value2 = 'shared2'; exports.value2 = value2; generated-dynamic.js000066400000000000000000000003261450520414700423220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/cjs'use strict'; var dep1 = require('./generated-dep1.js'); var dep2 = require('./generated-dep2.js'); console.log('dynamic1', dep1.value1, dep2.value2); exports.value1 = dep1.value1; exports.value2 = dep2.value2; main1.js000066400000000000000000000005211450520414700377440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/cjs'use strict'; var dep1 = require('./generated-dep1.js'); var dep2 = require('./generated-dep2.js'); const something = 'something'; console.log('main1', dep1.value1, dep2.value2, something); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); exports.value1 = dep1.value1; exports.value2 = dep2.value2; main2.js000066400000000000000000000003201450520414700377420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/cjs'use strict'; var dep2 = require('./generated-dep2.js'); console.log('main2', dep2.value2); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); exports.value2 = dep2.value2; es/000077500000000000000000000000001450520414700362335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expectedgenerated-dep1.js000066400000000000000000000000631450520414700413550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esconst value1 = 'shared1'; export { value1 as v }; generated-dep2.js000066400000000000000000000000631450520414700413560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esconst value2 = 'shared2'; export { value2 as v }; generated-dynamic.js000066400000000000000000000002541450520414700421520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esimport { v as value1 } from './generated-dep1.js'; import { v as value2 } from './generated-dep2.js'; console.log('dynamic1', value1, value2); export { value1, value2 }; main1.js000066400000000000000000000003661450520414700376030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esimport { v as value1 } from './generated-dep1.js'; import { v as value2 } from './generated-dep2.js'; const something = 'something'; console.log('main1', value1, value2, something); import('./generated-dynamic.js'); export { value1, value2 }; main2.js000066400000000000000000000002101450520414700375700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esimport { v as value2 } from './generated-dep2.js'; console.log('main2', value2); import('./generated-dynamic.js'); export { value2 }; system/000077500000000000000000000000001450520414700371505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expectedgenerated-dep1.js000066400000000000000000000002301450520414700422660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value1 = exports('v', 'shared1'); }) }; })); generated-dep2.js000066400000000000000000000002301450520414700422670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value2 = exports('v', 'shared2'); }) }; })); generated-dynamic.js000066400000000000000000000006051450520414700430670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/systemSystem.register(['./generated-dep1.js', './generated-dep2.js'], (function (exports) { 'use strict'; var value1, value2; return { setters: [function (module) { value1 = module.v; exports('value1', module.v); }, function (module) { value2 = module.v; exports('value2', module.v); }], execute: (function () { console.log('dynamic1', value1, value2); }) }; })); main1.js000066400000000000000000000007441450520414700405200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/systemSystem.register(['./generated-dep1.js', './generated-dep2.js'], (function (exports, module) { 'use strict'; var value1, value2; return { setters: [function (module) { value1 = module.v; exports('value1', module.v); }, function (module) { value2 = module.v; exports('value2', module.v); }], execute: (function () { const something = 'something'; console.log('main1', value1, value2, something); module.import('./generated-dynamic.js'); }) }; })); main2.js000066400000000000000000000005001450520414700405070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/systemSystem.register(['./generated-dep2.js'], (function (exports, module) { 'use strict'; var value2; return { setters: [function (module) { value2 = module.v; exports('value2', module.v); }], execute: (function () { console.log('main2', value2); module.import('./generated-dynamic.js'); }) }; })); dep1.js000066400000000000000000000000411450520414700350460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesexport const value1 = 'shared1'; dep2.js000066400000000000000000000000411450520414700350470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesexport const value2 = 'shared2'; dynamic.js000066400000000000000000000002141450520414700356430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesimport { value1 } from './dep1.js'; import { value2 } from './dep2.js'; console.log('dynamic1', value1, value2); export { value1, value2 }; main1.js000066400000000000000000000003371450520414700352320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesimport { value1 } from './dep1.js'; import { value2 } from './dep2.js'; import { something } from './only-from-main-1.js'; console.log('main1', value1, value2, something); import('./dynamic.js'); export { value1, value2 }; main2.js000066400000000000000000000001551450520414700352310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesimport { value2 } from './dep2.js'; console.log('main2', value2); import('./dynamic.js'); export { value2 }; only-from-main-1.js000066400000000000000000000000461450520414700372240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesexport const something = 'something'; multi-entry-partly-already-loaded-dynamic/000077500000000000000000000000001450520414700350745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks_config.js000066400000000000000000000003271450520414700370400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicmodule.exports = defineTest({ description: 'avoids chunks for always loaded dependencies if multiple entry points with different dependencies have dynamic imports', options: { input: ['main1', 'main2'] } }); _expected/000077500000000000000000000000001450520414700370345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicamd/000077500000000000000000000000001450520414700375755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expectedgenerated-dep2.js000066400000000000000000000001651450520414700427230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value2 = 'shared2'; exports.value2 = value2; })); generated-dynamic1.js000066400000000000000000000002641450520414700435760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/amddefine(['exports', './main1', './generated-dep2'], (function (exports, main1, dep2) { 'use strict'; console.log('dynamic1', main1.value1); exports.value1 = main1.value1; })); generated-dynamic2.js000066400000000000000000000002401450520414700435710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/amddefine(['exports', './generated-dep2'], (function (exports, dep2) { 'use strict'; console.log('dynamic2', dep2.value2); exports.value2 = dep2.value2; })); main1.js000066400000000000000000000005211450520414700411360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/amddefine(['require', 'exports', './generated-dep2'], (function (require, exports, dep2) { 'use strict'; const value1 = 'shared1'; console.log('main1', value1, dep2.value2); new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); exports.value2 = dep2.value2; exports.value1 = value1; })); main2.js000066400000000000000000000004231450520414700411400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/amddefine(['require', 'exports', './generated-dep2'], (function (require, exports, dep2) { 'use strict'; console.log('main2', dep2.value2); new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); exports.value2 = dep2.value2; })); cjs/000077500000000000000000000000001450520414700376135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expectedgenerated-dep2.js000066400000000000000000000001031450520414700427310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/cjs'use strict'; const value2 = 'shared2'; exports.value2 = value2; generated-dynamic1.js000066400000000000000000000002321450520414700436070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/cjs'use strict'; var main1 = require('./main1.js'); require('./generated-dep2.js'); console.log('dynamic1', main1.value1); exports.value1 = main1.value1; generated-dynamic2.js000066400000000000000000000002001450520414700436030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/cjs'use strict'; var dep2 = require('./generated-dep2.js'); console.log('dynamic2', dep2.value2); exports.value2 = dep2.value2; main1.js000066400000000000000000000004151450520414700411560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/cjs'use strict'; var dep2 = require('./generated-dep2.js'); const value1 = 'shared1'; console.log('main1', value1, dep2.value2); Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); exports.value2 = dep2.value2; exports.value1 = value1; main2.js000066400000000000000000000003211450520414700411530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/cjs'use strict'; var dep2 = require('./generated-dep2.js'); console.log('main2', dep2.value2); Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); exports.value2 = dep2.value2; es/000077500000000000000000000000001450520414700374435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expectedgenerated-dep2.js000066400000000000000000000000631450520414700425660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esconst value2 = 'shared2'; export { value2 as v }; generated-dynamic1.js000066400000000000000000000001711450520414700434410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esimport { value1 } from './main1.js'; import './generated-dep2.js'; console.log('dynamic1', value1); export { value1 }; generated-dynamic2.js000066400000000000000000000001511450520414700434400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esimport { v as value2 } from './generated-dep2.js'; console.log('dynamic2', value2); export { value2 }; main1.js000066400000000000000000000002641450520414700410100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esimport { v as value2 } from './generated-dep2.js'; const value1 = 'shared1'; console.log('main1', value1, value2); import('./generated-dynamic1.js'); export { value1, value2 }; main2.js000066400000000000000000000002111450520414700410010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esimport { v as value2 } from './generated-dep2.js'; console.log('main2', value2); import('./generated-dynamic2.js'); export { value2 }; system/000077500000000000000000000000001450520414700403605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expectedgenerated-dep2.js000066400000000000000000000002301450520414700434770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value2 = exports('v', 'shared2'); }) }; })); generated-dynamic1.js000066400000000000000000000004551450520414700443630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/systemSystem.register(['./main1.js', './generated-dep2.js'], (function (exports) { 'use strict'; var value1; return { setters: [function (module) { value1 = module.value1; exports('value1', module.value1); }, null], execute: (function () { console.log('dynamic1', value1); }) }; })); generated-dynamic2.js000066400000000000000000000004171450520414700443620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/systemSystem.register(['./generated-dep2.js'], (function (exports) { 'use strict'; var value2; return { setters: [function (module) { value2 = module.v; exports('value2', module.v); }], execute: (function () { console.log('dynamic2', value2); }) }; })); main1.js000066400000000000000000000005721450520414700417270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/systemSystem.register(['./generated-dep2.js'], (function (exports, module) { 'use strict'; var value2; return { setters: [function (module) { value2 = module.v; exports('value2', module.v); }], execute: (function () { const value1 = exports('value1', 'shared1'); console.log('main1', value1, value2); module.import('./generated-dynamic1.js'); }) }; })); main2.js000066400000000000000000000005011450520414700417200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/systemSystem.register(['./generated-dep2.js'], (function (exports, module) { 'use strict'; var value2; return { setters: [function (module) { value2 = module.v; exports('value2', module.v); }], execute: (function () { console.log('main2', value2); module.import('./generated-dynamic2.js'); }) }; })); dep1.js000066400000000000000000000000411450520414700362560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicexport const value1 = 'shared1'; dep2.js000066400000000000000000000000411450520414700362570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicexport const value2 = 'shared2'; dynamic1.js000066400000000000000000000001301450520414700371310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicimport { value1 } from './dep1.js'; console.log('dynamic1', value1); export { value1 }; dynamic2.js000066400000000000000000000001301450520414700371320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicimport { value2 } from './dep2.js'; console.log('dynamic2', value2); export { value2 }; main1.js000066400000000000000000000002421450520414700364350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicimport { value1 } from './dep1.js'; import { value2 } from './dep2.js'; console.log('main1', value1, value2); import('./dynamic1.js'); export { value1, value2 }; main2.js000066400000000000000000000001561450520414700364420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicimport { value2 } from './dep2.js'; console.log('main2', value2); import('./dynamic2.js'); export { value2 }; multi-entry-shared-static-with-dynamic-import/000077500000000000000000000000001450520414700357305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks_config.js000066400000000000000000000003271450520414700376740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importmodule.exports = defineTest({ description: 'avoids chunks for always loaded dependencies if multiple entry points with different dependencies have dynamic imports', options: { input: ['main1', 'main2'] } }); _expected/000077500000000000000000000000001450520414700376705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importamd/000077500000000000000000000000001450520414700404315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expectedgenerated-dynamic.js000066400000000000000000000001611450520414700443450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/amddefine(['./generated-shared'], (function (shared) { 'use strict'; console.log('dynamic', shared.value1); })); generated-shared.js000066400000000000000000000004071450520414700441720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const value1 = 'dep'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); console.log('shared', value1); exports.value1 = value1; })); main1.js000066400000000000000000000001401450520414700417670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/amddefine(['./generated-shared'], (function (shared) { 'use strict'; console.log('main1'); })); main2.js000066400000000000000000000001401450520414700417700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/amddefine(['./generated-shared'], (function (shared) { 'use strict'; console.log('main2'); })); cjs/000077500000000000000000000000001450520414700404475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expectedgenerated-dynamic.js000066400000000000000000000001461450520414700443660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/cjs'use strict'; var shared = require('./generated-shared.js'); console.log('dynamic', shared.value1); generated-shared.js000066400000000000000000000002621450520414700442070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/cjs'use strict'; const value1 = 'dep'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); console.log('shared', value1); exports.value1 = value1; main1.js000066400000000000000000000001101450520414700420020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/cjs'use strict'; require('./generated-shared.js'); console.log('main1'); main2.js000066400000000000000000000001101450520414700420030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/cjs'use strict'; require('./generated-shared.js'); console.log('main2'); es/000077500000000000000000000000001450520414700402775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expectedgenerated-dynamic.js000066400000000000000000000001261450520414700442140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/esimport { v as value1 } from './generated-shared.js'; console.log('dynamic', value1); generated-shared.js000066400000000000000000000001611450520414700440350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/esconst value1 = 'dep'; import('./generated-dynamic.js'); console.log('shared', value1); export { value1 as v }; main1.js000066400000000000000000000000671450520414700416450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/esimport './generated-shared.js'; console.log('main1'); main2.js000066400000000000000000000000671450520414700416460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/esimport './generated-shared.js'; console.log('main2'); system/000077500000000000000000000000001450520414700412145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expectedgenerated-dynamic.js000066400000000000000000000003511450520414700451310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/systemSystem.register(['./generated-shared.js'], (function () { 'use strict'; var value1; return { setters: [function (module) { value1 = module.v; }], execute: (function () { console.log('dynamic', value1); }) }; })); generated-shared.js000066400000000000000000000003531450520414700447550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const value1 = exports('v', 'dep'); module.import('./generated-dynamic.js'); console.log('shared', value1); }) }; })); main1.js000066400000000000000000000002511450520414700425550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/systemSystem.register(['./generated-shared.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main1'); }) }; })); main2.js000066400000000000000000000002511450520414700425560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/systemSystem.register(['./generated-shared.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main2'); }) }; })); dep.js000066400000000000000000000000351450520414700370340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importexport const value1 = 'dep'; dynamic.js000066400000000000000000000001031450520414700377040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importimport { value1 } from './dep.js'; console.log('dynamic', value1); main1.js000066400000000000000000000000551450520414700372730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importimport './shared.js'; console.log('main1'); main2.js000066400000000000000000000000551450520414700372740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importimport './shared.js'; console.log('main2'); shared.js000066400000000000000000000001321450520414700375300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importimport { value1 } from './dep.js'; import('./dynamic.js'); console.log('shared', value1); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/000077500000000000000000000000001450520414700333115ustar00rootroot00000000000000_config.js000066400000000000000000000003141450520414700351720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsmodule.exports = defineTest({ description: 'does not create a separate chunk if a dynamically imported chunk shares a dependency with its importer, and dynamic chunk imported from multiple places' }); _expected/000077500000000000000000000000001450520414700351725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsamd/000077500000000000000000000000001450520414700357335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expectedgenerated-dynamic.js000066400000000000000000000002221450520414700416450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/amddefine(['exports', './main'], (function (exports, main) { 'use strict'; console.log('dynamic', main.value); exports.value = main.value; })); main.js000066400000000000000000000006001450520414700372110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const value = 'shared'; console.log('a', value); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); console.log('main', value); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); exports.value = value; })); cjs/000077500000000000000000000000001450520414700357515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expectedgenerated-dynamic.js000066400000000000000000000001621450520414700416660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/cjs'use strict'; var main = require('./main.js'); console.log('dynamic', main.value); exports.value = main.value; main.js000066400000000000000000000004341450520414700372340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/cjs'use strict'; const value = 'shared'; console.log('a', value); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); console.log('main', value); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); exports.value = value; es/000077500000000000000000000000001450520414700356015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expectedgenerated-dynamic.js000066400000000000000000000001261450520414700415160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/esimport { value } from './main.js'; console.log('dynamic', value); export { value }; main.js000066400000000000000000000002461450520414700370650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/esconst value = 'shared'; console.log('a', value); import('./generated-dynamic.js'); console.log('main', value); import('./generated-dynamic.js'); export { value }; system/000077500000000000000000000000001450520414700365165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expectedgenerated-dynamic.js000066400000000000000000000004101450520414700424270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var value; return { setters: [function (module) { value = module.value; exports('value', module.value); }], execute: (function () { console.log('dynamic', value); }) }; })); main.js000066400000000000000000000004671450520414700400070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const value = exports('value', 'shared'); console.log('a', value); module.import('./generated-dynamic.js'); console.log('main', value); module.import('./generated-dynamic.js'); }) }; })); a.js000066400000000000000000000001231450520414700340040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsimport { value } from './dep.js'; console.log('a', value); import('./dynamic.js'); dep.js000066400000000000000000000000371450520414700343400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsexport const value = 'shared'; dynamic.js000066400000000000000000000001231450520414700352100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsimport { value } from './dep.js'; console.log('dynamic', value); export { value }; main.js000066400000000000000000000001711450520414700345130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsimport { value } from './dep.js'; import './a.js'; console.log('main', value); import('./dynamic.js'); export { value }; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/000077500000000000000000000000001450520414700277655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_config.js000066400000000000000000000002331450520414700317250ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not create a separate chunk if a dynamically imported chunk shares a dependency with its importer' }); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/000077500000000000000000000000001450520414700317255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/amd/000077500000000000000000000000001450520414700324665ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002221450520414700363210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/amddefine(['exports', './main'], (function (exports, main) { 'use strict'; console.log('dynamic', main.value); exports.value = main.value; })); main.js000066400000000000000000000004041450520414700336670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const value = 'shared'; console.log('main', value); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/cjs/000077500000000000000000000000001450520414700325045ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001621450520414700363420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/cjs'use strict'; var main = require('./main.js'); console.log('dynamic', main.value); exports.value = main.value; main.js000066400000000000000000000002571450520414700337130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/cjs'use strict'; const value = 'shared'; console.log('main', value); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); exports.value = value; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/es/000077500000000000000000000000001450520414700323345ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001261450520414700361720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/esimport { value } from './main.js'; console.log('dynamic', value); export { value }; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/es/main.js000066400000000000000000000001521450520414700336140ustar00rootroot00000000000000const value = 'shared'; console.log('main', value); import('./generated-dynamic.js'); export { value }; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/system/000077500000000000000000000000001450520414700332515ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000004101450520414700371030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var value; return { setters: [function (module) { value = module.value; exports('value', module.value); }], execute: (function () { console.log('dynamic', value); }) }; })); main.js000066400000000000000000000003561450520414700344600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const value = exports('value', 'shared'); console.log('main', value); module.import('./generated-dynamic.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/dep.js000066400000000000000000000000371450520414700310730ustar00rootroot00000000000000export const value = 'shared'; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/dynamic.js000066400000000000000000000001231450520414700317430ustar00rootroot00000000000000import { value } from './dep.js'; console.log('dynamic', value); export { value }; rollup-3.29.4/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/main.js000066400000000000000000000001501450520414700312430ustar00rootroot00000000000000import { value } from './dep.js'; console.log('main', value); import('./dynamic.js'); export { value }; rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/000077500000000000000000000000001450520414700274535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_config.js000066400000000000000000000003251450520414700314150ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not drop indirect reexports when preserving modules', expectedWarnings: ['MIXED_EXPORTS'], options: { output: { name: 'bundle', preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/000077500000000000000000000000001450520414700314135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/000077500000000000000000000000001450520414700321545ustar00rootroot00000000000000components/000077500000000000000000000000001450520414700342625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amdindex.js000066400000000000000000000002511450520414700357250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/componentsdefine(['exports', './sub/index'], (function (exports, index) { 'use strict'; const baz = { bar: index.default }; exports.foo = index.foo; exports.baz = baz; })); sub/000077500000000000000000000000001450520414700350535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/componentsindex.js000066400000000000000000000003261450520414700365210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/components/subdefine(['exports'], (function (exports) { 'use strict'; const foo = 'bar'; var bar = () => {}; exports.default = bar; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/main.js000066400000000000000000000002671450520414700334430ustar00rootroot00000000000000define(['exports', './components/index', './components/sub/index'], (function (exports, index, index$1) { 'use strict'; exports.baz = index.baz; exports.foo = index$1.foo; })); rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/000077500000000000000000000000001450520414700321725ustar00rootroot00000000000000components/000077500000000000000000000000001450520414700343005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjsindex.js000066400000000000000000000002101450520414700357360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/components'use strict'; var index = require('./sub/index.js'); const baz = { bar: index.default }; exports.foo = index.foo; exports.baz = baz; sub/000077500000000000000000000000001450520414700350715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/componentsindex.js000066400000000000000000000002411450520414700365330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/components/sub'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo = 'bar'; var bar = () => {}; exports.default = bar; exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/main.js000066400000000000000000000002501450520414700334510ustar00rootroot00000000000000'use strict'; var index = require('./components/index.js'); var index$1 = require('./components/sub/index.js'); exports.baz = index.baz; exports.foo = index$1.foo; rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/000077500000000000000000000000001450520414700320225ustar00rootroot00000000000000components/000077500000000000000000000000001450520414700341305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/esindex.js000066400000000000000000000001571450520414700356000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/componentsimport bar from './sub/index.js'; export { foo } from './sub/index.js'; const baz = { bar }; export { baz }; sub/000077500000000000000000000000001450520414700347215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/componentsindex.js000066400000000000000000000001101450520414700363560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/components/subconst foo = 'bar'; var bar = () => {}; export { bar as default, foo }; rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/main.js000066400000000000000000000001361450520414700333040ustar00rootroot00000000000000export { baz } from './components/index.js'; export { foo } from './components/sub/index.js'; rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/000077500000000000000000000000001450520414700327375ustar00rootroot00000000000000components/000077500000000000000000000000001450520414700350455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/systemindex.js000066400000000000000000000004271450520414700365150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/componentsSystem.register('bundle', ['./sub/index.js'], (function (exports) { 'use strict'; var bar; return { setters: [function (module) { bar = module.default; exports('foo', module.foo); }], execute: (function () { const baz = exports('baz', { bar }); }) }; })); sub/000077500000000000000000000000001450520414700356365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/componentsindex.js000066400000000000000000000003101450520414700372750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/components/subSystem.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 'bar'); var bar = exports('default', () => {}); }) }; })); main.js000066400000000000000000000004511450520414700341420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/systemSystem.register('bundle', ['./components/index.js', './components/sub/index.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('baz', module.baz); }, function (module) { exports('foo', module.foo); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/components/000077500000000000000000000000001450520414700316405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/components/index.js000066400000000000000000000001251450520414700333030ustar00rootroot00000000000000import bar, { foo } from './sub/index'; export const baz = { bar }; export { foo }; rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/components/sub/000077500000000000000000000000001450520414700324315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/components/sub/index.js000066400000000000000000000000751450520414700341000ustar00rootroot00000000000000const foo = 'bar'; export { foo }; export default () => {}; rollup-3.29.4/test/chunking-form/samples/indirect-reexports-preserve-modules/main.js000066400000000000000000000001051450520414700307310ustar00rootroot00000000000000import { baz, foo } from './components/index'; export { baz, foo }; rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/000077500000000000000000000000001450520414700305035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_config.js000066400000000000000000000005051450520414700324450ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to configure the interop type per reexported default from an external dependency', options: { input: ['default', 'defaultOnly', 'esModule', 'auto'], external: id => id.startsWith('external'), output: { interop(id) { return id.split('-')[1]; } } } }); rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/000077500000000000000000000000001450520414700324435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/amd/000077500000000000000000000000001450520414700332045ustar00rootroot00000000000000auto.js000066400000000000000000000004171450520414700344350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/amddefine(['external-auto'], (function (externalAuto) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); return externalAuto__default.default; })); default.js000066400000000000000000000001531450520414700351060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/amddefine(['external-default'], (function (externalDefault) { 'use strict'; return externalDefault; })); defaultOnly.js000066400000000000000000000001531450520414700357500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/amddefine(['external-default'], (function (externalDefault) { 'use strict'; return externalDefault; })); esModule.js000066400000000000000000000001661450520414700352430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/amddefine(['external-esModule'], (function (externalEsModule) { 'use strict'; return externalEsModule.default; })); rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/cjs/000077500000000000000000000000001450520414700332225ustar00rootroot00000000000000auto.js000066400000000000000000000004111450520414700344450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/cjs'use strict'; var externalAuto = require('external-auto'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); module.exports = externalAuto__default.default; default.js000066400000000000000000000001471450520414700351270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/cjs'use strict'; var externalDefault = require('external-default'); module.exports = externalDefault; defaultOnly.js000066400000000000000000000001471450520414700357710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/cjs'use strict'; var externalDefault = require('external-default'); module.exports = externalDefault; esModule.js000066400000000000000000000001621450520414700352550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/cjs'use strict'; var externalEsModule = require('external-esModule'); module.exports = externalEsModule.default; rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/es/000077500000000000000000000000001450520414700330525ustar00rootroot00000000000000auto.js000066400000000000000000000000511450520414700342750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/esexport { default } from 'external-auto'; default.js000066400000000000000000000000541450520414700347540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/esexport { default } from 'external-default'; defaultOnly.js000066400000000000000000000000541450520414700356160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/esexport { default } from 'external-default'; esModule.js000066400000000000000000000000551450520414700351060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/esexport { default } from 'external-esModule'; rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/system/000077500000000000000000000000001450520414700337675ustar00rootroot00000000000000auto.js000066400000000000000000000003121450520414700352120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/systemSystem.register(['external-auto'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.default); }], execute: (function () { }) }; })); default.js000066400000000000000000000003151450520414700356710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/systemSystem.register(['external-default'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.default); }], execute: (function () { }) }; })); defaultOnly.js000066400000000000000000000003151450520414700365330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/systemSystem.register(['external-default'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.default); }], execute: (function () { }) }; })); esModule.js000066400000000000000000000003161450520414700360230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/systemSystem.register(['external-esModule'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/auto.js000066400000000000000000000000511450520414700320050ustar00rootroot00000000000000export { default } from 'external-auto'; rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/default.js000066400000000000000000000000541450520414700324640ustar00rootroot00000000000000export { default } from 'external-default'; rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/defaultOnly.js000066400000000000000000000000541450520414700333260ustar00rootroot00000000000000export { default } from 'external-default'; rollup-3.29.4/test/chunking-form/samples/interop-per-reexported-default-dependency/esModule.js000066400000000000000000000000551450520414700326160ustar00rootroot00000000000000export { default } from 'external-esModule'; rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/000077500000000000000000000000001450520414700252065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_config.js000066400000000000000000000003201450520414700271430ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoid facades if possible when using manual chunks', options: { input: ['main1', 'main2'], output: { manualChunks: { manual: ['main2'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/000077500000000000000000000000001450520414700271465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/amd/000077500000000000000000000000001450520414700277075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/amd/main1.js000066400000000000000000000001471450520414700312540ustar00rootroot00000000000000define(['./main2'], (function (manual) { 'use strict'; console.log('main', manual.reexported); })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/amd/main2.js000066400000000000000000000002171450520414700312530ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 42; console.log('main2', value); exports.reexported = value; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/cjs/000077500000000000000000000000001450520414700277255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/cjs/main1.js000066400000000000000000000001341450520414700312660ustar00rootroot00000000000000'use strict'; var manual = require('./main2.js'); console.log('main', manual.reexported); rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/cjs/main2.js000066400000000000000000000001341450520414700312670ustar00rootroot00000000000000'use strict'; const value = 42; console.log('main2', value); exports.reexported = value; rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/es/000077500000000000000000000000001450520414700275555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/es/main1.js000066400000000000000000000001171450520414700311170ustar00rootroot00000000000000import { reexported as value } from './main2.js'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/es/main2.js000066400000000000000000000001211450520414700311130ustar00rootroot00000000000000const value = 42; console.log('main2', value); export { value as reexported }; rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/system/000077500000000000000000000000001450520414700304725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/system/main1.js000066400000000000000000000003411450520414700320330ustar00rootroot00000000000000System.register(['./main2.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.reexported; }], execute: (function () { console.log('main', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/system/main2.js000066400000000000000000000002721450520414700320370ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('reexported', 42); console.log('main2', value); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/dep.js000066400000000000000000000000311450520414700263060ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/main1.js000066400000000000000000000000741450520414700265520ustar00rootroot00000000000000import { value } from './dep'; console.log('main', value); rollup-3.29.4/test/chunking-form/samples/manual-chunk-avoid-facade/main2.js000066400000000000000000000001371450520414700265530ustar00rootroot00000000000000import {value} from './dep.js'; console.log('main2', value); export { value as reexported }; rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/000077500000000000000000000000001450520414700274575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_config.js000066400000000000000000000004511450520414700314210ustar00rootroot00000000000000module.exports = defineTest({ expectedWarnings: ['EMPTY_BUNDLE'], description: 'Uses entry alias if manual chunks contain entry chunks with different alias', options: { input: { main: 'main.js', main2: 'main2.js' }, output: { manualChunks: { outer: ['outer'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/000077500000000000000000000000001450520414700314175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/amd/000077500000000000000000000000001450520414700321605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/amd/main.js000066400000000000000000000002301450520414700334350ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/amd/main2.js000066400000000000000000000000751450520414700335260ustar00rootroot00000000000000define(['./main'], (function (outer) { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/cjs/000077500000000000000000000000001450520414700321765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/cjs/main.js000066400000000000000000000001441450520414700334570ustar00rootroot00000000000000'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/cjs/main2.js000066400000000000000000000000461450520414700335420ustar00rootroot00000000000000'use strict'; require('./main.js'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/es/000077500000000000000000000000001450520414700320265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/es/main.js000066400000000000000000000001201450520414700333010ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/es/main2.js000066400000000000000000000000241450520414700333660ustar00rootroot00000000000000import './main.js'; rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/system/000077500000000000000000000000001450520414700327435ustar00rootroot00000000000000main.js000066400000000000000000000003051450520414700341440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); main2.js000066400000000000000000000002051450520414700342250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/dep.js000066400000000000000000000000241450520414700305610ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/main.js000066400000000000000000000001031450520414700307330ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/main2.js000066400000000000000000000000231450520414700310160ustar00rootroot00000000000000import './dep.js'; rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-conflict/outer.js000066400000000000000000000000501450520414700311460ustar00rootroot00000000000000import './main'; console.log('outer'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/000077500000000000000000000000001450520414700267525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_config.js000066400000000000000000000003721450520414700307160ustar00rootroot00000000000000module.exports = defineTest({ description: 'Identifies the entry chunk with the manual chunk that contains it if the aliases match', options: { input: { main: 'main.js' }, output: { manualChunks: { main: ['outer'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/000077500000000000000000000000001450520414700307125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/amd/000077500000000000000000000000001450520414700314535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/amd/main.js000066400000000000000000000002301450520414700327300ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/cjs/000077500000000000000000000000001450520414700314715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/cjs/main.js000066400000000000000000000001441450520414700327520ustar00rootroot00000000000000'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/es/000077500000000000000000000000001450520414700313215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/es/main.js000066400000000000000000000001201450520414700325740ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/system/000077500000000000000000000000001450520414700322365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/system/main.js000066400000000000000000000003051450520414700335160ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/dep.js000066400000000000000000000000241450520414700300540ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/main.js000066400000000000000000000001031450520414700302260ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-3.29.4/test/chunking-form/samples/manual-chunk-contains-entry-match/outer.js000066400000000000000000000000501450520414700304410ustar00rootroot00000000000000import './main'; console.log('outer'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/000077500000000000000000000000001450520414700262545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_config.js000066400000000000000000000003771450520414700302250ustar00rootroot00000000000000module.exports = defineTest({ description: 'Uses entry alias if manual chunks are entry chunks with different alias', options: { input: { main: 'main.js', main2: 'main2.js' }, output: { manualChunks: { other: ['main'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/000077500000000000000000000000001450520414700302145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/amd/000077500000000000000000000000001450520414700307555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/amd/main.js000066400000000000000000000002301450520414700322320ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/amd/main2.js000066400000000000000000000000751450520414700323230ustar00rootroot00000000000000define(['./main'], (function (other) { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/cjs/000077500000000000000000000000001450520414700307735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/cjs/main.js000066400000000000000000000001441450520414700322540ustar00rootroot00000000000000'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/cjs/main2.js000066400000000000000000000000461450520414700323370ustar00rootroot00000000000000'use strict'; require('./main.js'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/es/000077500000000000000000000000001450520414700306235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/es/main.js000066400000000000000000000001201450520414700320760ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/es/main2.js000066400000000000000000000000241450520414700321630ustar00rootroot00000000000000import './main.js'; rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/system/000077500000000000000000000000001450520414700315405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/system/main.js000066400000000000000000000003051450520414700330200ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/system/main2.js000066400000000000000000000002051450520414700331010ustar00rootroot00000000000000System.register(['./main.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/dep.js000066400000000000000000000000241450520414700273560ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/main.js000066400000000000000000000001031450520414700275300ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-conflict/main2.js000066400000000000000000000000231450520414700276130ustar00rootroot00000000000000import './dep.js'; rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/000077500000000000000000000000001450520414700255475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_config.js000066400000000000000000000004001450520414700275030ustar00rootroot00000000000000module.exports = defineTest({ description: 'Identifies the entry chunk with the manual chunk that has the same entry if the aliases match', options: { input: { main: 'main.js' }, output: { manualChunks: { main: ['main'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/000077500000000000000000000000001450520414700275075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/amd/000077500000000000000000000000001450520414700302505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/amd/main.js000066400000000000000000000002301450520414700315250ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/cjs/000077500000000000000000000000001450520414700302665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/cjs/main.js000066400000000000000000000001441450520414700315470ustar00rootroot00000000000000'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/es/000077500000000000000000000000001450520414700301165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/es/main.js000066400000000000000000000001201450520414700313710ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/system/000077500000000000000000000000001450520414700310335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/system/main.js000066400000000000000000000003051450520414700323130ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/dep.js000066400000000000000000000000241450520414700266510ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-is-entry-match/main.js000066400000000000000000000001031450520414700270230ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/000077500000000000000000000000001450520414700252705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_config.js000066400000000000000000000003451450520414700272340ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles manual chunks where the root is not part of the module graph', options: { input: ['main.js'], output: { manualChunks: { manual: ['manual-entry.js'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/000077500000000000000000000000001450520414700272305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/amd/000077500000000000000000000000001450520414700277715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/amd/generated-manual.js000066400000000000000000000001051450520414700335340ustar00rootroot00000000000000define((function () { 'use strict'; console.log('included'); })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/amd/main.js000066400000000000000000000001371450520414700312540ustar00rootroot00000000000000define(['./generated-manual'], (function (manual) { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/cjs/000077500000000000000000000000001450520414700300075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/cjs/generated-manual.js000066400000000000000000000000501450520414700335510ustar00rootroot00000000000000'use strict'; console.log('included'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/cjs/main.js000066400000000000000000000001071450520414700312670ustar00rootroot00000000000000'use strict'; require('./generated-manual.js'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/es/000077500000000000000000000000001450520414700276375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/es/generated-manual.js000066400000000000000000000000311450520414700334000ustar00rootroot00000000000000console.log('included'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/es/main.js000066400000000000000000000000661450520414700311230ustar00rootroot00000000000000import './generated-manual.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/system/000077500000000000000000000000001450520414700305545ustar00rootroot00000000000000generated-manual.js000066400000000000000000000002021450520414700342360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('included'); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/_expected/system/main.js000066400000000000000000000002501450520414700320330ustar00rootroot00000000000000System.register(['./generated-manual.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/main.js000066400000000000000000000000611450520414700265470ustar00rootroot00000000000000import './manual-included'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/manual-entry.js000066400000000000000000000000711450520414700302400ustar00rootroot00000000000000import './manual-included'; function test() {} test(); rollup-3.29.4/test/chunking-form/samples/manual-chunk-not-included/manual-included.js000066400000000000000000000000311450520414700306620ustar00rootroot00000000000000console.log('included'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/000077500000000000000000000000001450520414700263145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_config.js000066400000000000000000000004421450520414700302560ustar00rootroot00000000000000module.exports = defineTest({ description: 'manual chunks can have other manual chunks as dependencies', options: { input: ['main.js'], output: { manualChunks: { 'manual-outer': ['outer.js'], 'manual-inner': ['inner.js'], 'manual-middle': ['middle.js'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/000077500000000000000000000000001450520414700302545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/amd/000077500000000000000000000000001450520414700310155ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000001021450520414700356070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/amddefine((function () { 'use strict'; console.log('inner'); })); generated-manual-middle.js000066400000000000000000000001541450520414700357410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/amddefine(['./generated-manual-inner'], (function (manualInner) { 'use strict'; console.log('middle'); })); generated-manual-outer.js000066400000000000000000000001551450520414700356420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/amddefine(['./generated-manual-middle'], (function (manualMiddle) { 'use strict'; console.log('outer'); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/amd/main.js000066400000000000000000000002761450520414700323040ustar00rootroot00000000000000define(['./generated-manual-outer', './generated-manual-middle', './generated-manual-inner'], (function (manualOuter, manualMiddle, manualInner) { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs/000077500000000000000000000000001450520414700310335ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000000451450520414700356330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs'use strict'; console.log('inner'); generated-manual-middle.js000066400000000000000000000001171450520414700357560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs'use strict'; require('./generated-manual-inner.js'); console.log('middle'); generated-manual-outer.js000066400000000000000000000001171450520414700356560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs'use strict'; require('./generated-manual-middle.js'); console.log('outer'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs/main.js000066400000000000000000000002361450520414700323160ustar00rootroot00000000000000'use strict'; require('./generated-manual-outer.js'); require('./generated-manual-middle.js'); require('./generated-manual-inner.js'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/es/000077500000000000000000000000001450520414700306635ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000000261450520414700354620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/esconsole.log('inner'); generated-manual-middle.js000066400000000000000000000000761450520414700356120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/esimport './generated-manual-inner.js'; console.log('middle'); generated-manual-outer.js000066400000000000000000000000761450520414700355120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/esimport './generated-manual-middle.js'; console.log('outer'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/es/main.js000066400000000000000000000002111450520414700321370ustar00rootroot00000000000000import './generated-manual-outer.js'; import './generated-manual-middle.js'; import './generated-manual-inner.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/system/000077500000000000000000000000001450520414700316005ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000001771450520414700364060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('inner'); }) }; })); generated-manual-middle.js000066400000000000000000000002601450520414700365220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/systemSystem.register(['./generated-manual-inner.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('middle'); }) }; })); generated-manual-outer.js000066400000000000000000000002601450520414700364220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/systemSystem.register(['./generated-manual-middle.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('outer'); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/_expected/system/main.js000066400000000000000000000003711450520414700330630ustar00rootroot00000000000000System.register(['./generated-manual-outer.js', './generated-manual-middle.js', './generated-manual-inner.js'], (function () { 'use strict'; return { setters: [null, null, null], execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/inner.js000066400000000000000000000000261450520414700277630ustar00rootroot00000000000000console.log('inner'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/main.js000066400000000000000000000000531450520414700275740ustar00rootroot00000000000000import './outer.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/middle.js000066400000000000000000000000551450520414700301100ustar00rootroot00000000000000import './inner.js'; console.log('middle'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-different-nested/outer.js000066400000000000000000000000551450520414700300100ustar00rootroot00000000000000import './middle.js'; console.log('outer'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/000077500000000000000000000000001450520414700260765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_config.js000066400000000000000000000003241450520414700300370ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates facades for dynamic manual chunks if necessary', options: { input: ['main.js'], output: { manualChunks: { dynamic: ['dynamic1.js'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/000077500000000000000000000000001450520414700300365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/amd/000077500000000000000000000000001450520414700305775ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000011701450520414700344350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const DEP = 'DEP'; const DYNAMIC_2 = 'DYNAMIC_2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_2: DYNAMIC_2 }); const DYNAMIC_3 = 'DYNAMIC_3'; var dynamic3 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_3: DYNAMIC_3 }); const DYNAMIC_1 = 'DYNAMIC_1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DEP: DEP, DYNAMIC_1: DYNAMIC_1, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports.DEP = DEP; exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; exports.dynamic3 = dynamic3; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/amd/main.js000066400000000000000000000011051450520414700320560ustar00rootroot00000000000000define(['require', './generated-dynamic'], (function (require, dynamic) { 'use strict'; Promise.all([new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic1; }), new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic2; }), new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic3; })]).then( results => console.log(results, dynamic.DEP) ); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/cjs/000077500000000000000000000000001450520414700306155ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000010611450520414700344520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/cjs'use strict'; const DEP = 'DEP'; const DYNAMIC_2 = 'DYNAMIC_2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_2: DYNAMIC_2 }); const DYNAMIC_3 = 'DYNAMIC_3'; var dynamic3 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_3: DYNAMIC_3 }); const DYNAMIC_1 = 'DYNAMIC_1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DEP: DEP, DYNAMIC_1: DYNAMIC_1, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports.DEP = DEP; exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; exports.dynamic3 = dynamic3; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/cjs/main.js000066400000000000000000000007751450520414700321100ustar00rootroot00000000000000'use strict'; var dynamic = require('./generated-dynamic.js'); Promise.all([Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic1; }), Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic2; }), Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic3; })]).then( results => console.log(results, dynamic.DEP) ); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/es/000077500000000000000000000000001450520414700304455ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000007721450520414700343120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/esconst DEP = 'DEP'; const DYNAMIC_2 = 'DYNAMIC_2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_2: DYNAMIC_2 }); const DYNAMIC_3 = 'DYNAMIC_3'; var dynamic3 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_3: DYNAMIC_3 }); const DYNAMIC_1 = 'DYNAMIC_1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DEP: DEP, DYNAMIC_1: DYNAMIC_1, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); export { DEP as D, dynamic3 as a, dynamic1 as b, dynamic2 as d }; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/es/main.js000066400000000000000000000005001450520414700317220ustar00rootroot00000000000000import { D as DEP } from './generated-dynamic.js'; Promise.all([import('./generated-dynamic.js').then(function (n) { return n.b; }), import('./generated-dynamic.js').then(function (n) { return n.d; }), import('./generated-dynamic.js').then(function (n) { return n.a; })]).then( results => console.log(results, DEP) ); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/system/000077500000000000000000000000001450520414700313625ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000012741450520414700352250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const DEP = exports('D', 'DEP'); const DYNAMIC_2 = 'DYNAMIC_2'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_2: DYNAMIC_2 }); exports('d', dynamic2); const DYNAMIC_3 = 'DYNAMIC_3'; var dynamic3 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_3: DYNAMIC_3 }); exports('a', dynamic3); const DYNAMIC_1 = 'DYNAMIC_1'; var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DEP: DEP, DYNAMIC_1: DYNAMIC_1, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports('b', dynamic1); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/system/main.js000066400000000000000000000007721450520414700326520ustar00rootroot00000000000000System.register(['./generated-dynamic.js'], (function (exports, module) { 'use strict'; var DEP; return { setters: [function (module) { DEP = module.D; }], execute: (function () { Promise.all([module.import('./generated-dynamic.js').then(function (n) { return n.b; }), module.import('./generated-dynamic.js').then(function (n) { return n.d; }), module.import('./generated-dynamic.js').then(function (n) { return n.a; })]).then( results => console.log(results, DEP) ); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/dep.js000066400000000000000000000000321450520414700271770ustar00rootroot00000000000000export const DEP = 'DEP'; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/dynamic1.js000066400000000000000000000001761450520414700301450ustar00rootroot00000000000000export * from './dep.js'; export * from './dynamic2.js'; export * from './dynamic3.js'; export const DYNAMIC_1 = 'DYNAMIC_1'; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/dynamic2.js000066400000000000000000000000461450520414700301420ustar00rootroot00000000000000export const DYNAMIC_2 = 'DYNAMIC_2'; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/dynamic3.js000066400000000000000000000000461450520414700301430ustar00rootroot00000000000000export const DYNAMIC_3 = 'DYNAMIC_3'; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-facades/main.js000066400000000000000000000002461450520414700273620ustar00rootroot00000000000000import { DEP } from './dep'; Promise.all([import('./dynamic1.js'), import('./dynamic2.js'), import('./dynamic3.js')]).then( results => console.log(results, DEP) ); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/000077500000000000000000000000001450520414700272275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_config.js000066400000000000000000000003051450520414700311670ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles name conflicts in manual chunks', options: { input: ['main.js'], output: { manualChunks: { dynamic: ['dynamic1.js'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/000077500000000000000000000000001450520414700311675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/amd/000077500000000000000000000000001450520414700317305ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000007341450520414700355730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('dynamic2'); const DYNAMIC_A = 'DYNAMIC_A'; const DYNAMIC_B = 'DYNAMIC_B'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_A, DYNAMIC_B: DYNAMIC_B }); console.log('dynamic1'); var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_B, DYNAMIC_B: DYNAMIC_A }); exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/amd/main.js000066400000000000000000000006351450520414700332160ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic1; }).then(result => console.log(result)); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(function (n) { return n.dynamic2; }).then(result => console.log(result)); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/cjs/000077500000000000000000000000001450520414700317465ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000006341450520414700356100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/cjs'use strict'; console.log('dynamic2'); const DYNAMIC_A = 'DYNAMIC_A'; const DYNAMIC_B = 'DYNAMIC_B'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_A, DYNAMIC_B: DYNAMIC_B }); console.log('dynamic1'); var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_B, DYNAMIC_B: DYNAMIC_A }); exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/cjs/main.js000066400000000000000000000005211450520414700332260ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic1; }).then(result => console.log(result)); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(function (n) { return n.dynamic2; }).then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/es/000077500000000000000000000000001450520414700315765ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000005741450520414700354430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/esconsole.log('dynamic2'); const DYNAMIC_A = 'DYNAMIC_A'; const DYNAMIC_B = 'DYNAMIC_B'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_A, DYNAMIC_B: DYNAMIC_B }); console.log('dynamic1'); var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_B, DYNAMIC_B: DYNAMIC_A }); export { dynamic1 as a, dynamic2 as d }; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/es/main.js000066400000000000000000000003221450520414700330550ustar00rootroot00000000000000import('./generated-dynamic.js').then(function (n) { return n.a; }).then(result => console.log(result)); import('./generated-dynamic.js').then(function (n) { return n.d; }).then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/system/000077500000000000000000000000001450520414700325135ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000010371450520414700363530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dynamic2'); const DYNAMIC_A = 'DYNAMIC_A'; const DYNAMIC_B = 'DYNAMIC_B'; var dynamic2 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_A, DYNAMIC_B: DYNAMIC_B }); exports('d', dynamic2); console.log('dynamic1'); var dynamic1 = /*#__PURE__*/Object.freeze({ __proto__: null, DYNAMIC_A: DYNAMIC_B, DYNAMIC_B: DYNAMIC_A }); exports('a', dynamic1); }) }; })); main.js000066400000000000000000000005331450520414700337170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic.js').then(function (n) { return n.a; }).then(result => console.log(result)); module.import('./generated-dynamic.js').then(function (n) { return n.d; }).then(result => console.log(result)); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/dynamic1.js000066400000000000000000000001471450520414700312740ustar00rootroot00000000000000console.log('dynamic1'); export { DYNAMIC_A as DYNAMIC_B, DYNAMIC_B as DYNAMIC_A } from './dynamic2'; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/dynamic2.js000066400000000000000000000001461450520414700312740ustar00rootroot00000000000000console.log('dynamic2'); export const DYNAMIC_A = 'DYNAMIC_A'; export const DYNAMIC_B = 'DYNAMIC_B'; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/main.js000066400000000000000000000001721450520414700305110ustar00rootroot00000000000000import('./dynamic1.js').then(result => console.log(result)); import('./dynamic2.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/000077500000000000000000000000001450520414700245125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_config.js000066400000000000000000000002731450520414700264560ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports dynamic manual chunks', options: { input: ['main.js'], output: { manualChunks: { dynamic: ['dynamic.js'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/000077500000000000000000000000001450520414700264525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/amd/000077500000000000000000000000001450520414700272135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/amd/generated-dynamic.js000066400000000000000000000002401450520414700331250ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; exports.DYNAMIC_USED_BY_A = DYNAMIC_USED_BY_A; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/amd/main.js000066400000000000000000000003361450520414700304770ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/cjs/000077500000000000000000000000001450520414700272315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/cjs/generated-dynamic.js000066400000000000000000000001561450520414700331510ustar00rootroot00000000000000'use strict'; const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; exports.DYNAMIC_USED_BY_A = DYNAMIC_USED_BY_A; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/cjs/main.js000066400000000000000000000002401450520414700305070ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/es/000077500000000000000000000000001450520414700270615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/es/generated-dynamic.js000066400000000000000000000001161450520414700327750ustar00rootroot00000000000000const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; export { DYNAMIC_USED_BY_A }; rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/es/main.js000066400000000000000000000001401450520414700303360ustar00rootroot00000000000000import('./generated-dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/system/000077500000000000000000000000001450520414700277765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/system/generated-dynamic.js000066400000000000000000000002751450520414700337200ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const DYNAMIC_USED_BY_A = exports('DYNAMIC_USED_BY_A', 'DYNAMIC_USED_BY_A'); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/_expected/system/main.js000066400000000000000000000003371450520414700312630ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/dynamic.js000066400000000000000000000000651450520414700264750ustar00rootroot00000000000000export const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A';rollup-3.29.4/test/chunking-form/samples/manual-chunks-dynamic/main.js000066400000000000000000000001261450520414700257730ustar00rootroot00000000000000import('./dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/000077500000000000000000000000001450520414700247135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_config.js000066400000000000000000000011531450520414700266550ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows to define manual chunks via a function', options: { input: ['main-a'], output: { manualChunks(id) { if (id[id.length - 5] === '-') { return `chunk-${id[id.length - 4]}`; } } }, plugins: [ { generateBundle(options, bundle) { // This also asserts the sorting order, which should be alphabetical // between the manual chunks assert.deepStrictEqual(Object.keys(bundle), [ 'main-a.js', 'generated-chunk-c.js', 'generated-chunk-b.js' ]); } } ] } }); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/000077500000000000000000000000001450520414700266535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/amd/000077500000000000000000000000001450520414700274145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/amd/generated-chunk-b.js000066400000000000000000000002131450520414700332310ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dep2'); console.log('dep-b'); console.log('dep2-b'); console.log('dep3-b'); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/amd/generated-chunk-c.js000066400000000000000000000001411450520414700332320ustar00rootroot00000000000000define(['./generated-chunk-b'], (function (chunkB) { 'use strict'; console.log('dep-c'); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/amd/main-a.js000066400000000000000000000003421450520414700311130ustar00rootroot00000000000000define(['./generated-chunk-c', './generated-chunk-b'], (function (chunkC, chunkB) { 'use strict'; console.log('dep1'); console.log('dep-a'); console.log('dep2-a'); console.log('dep3-a'); console.log('main-a'); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/cjs/000077500000000000000000000000001450520414700274325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/cjs/generated-chunk-b.js000066400000000000000000000001531450520414700332520ustar00rootroot00000000000000'use strict'; console.log('dep2'); console.log('dep-b'); console.log('dep2-b'); console.log('dep3-b'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/cjs/generated-chunk-c.js000066400000000000000000000001111450520414700332450ustar00rootroot00000000000000'use strict'; require('./generated-chunk-b.js'); console.log('dep-c'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/cjs/main-a.js000066400000000000000000000003121450520414700311260ustar00rootroot00000000000000'use strict'; require('./generated-chunk-c.js'); require('./generated-chunk-b.js'); console.log('dep1'); console.log('dep-a'); console.log('dep2-a'); console.log('dep3-a'); console.log('main-a'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/es/000077500000000000000000000000001450520414700272625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/es/generated-chunk-b.js000066400000000000000000000001341450520414700331010ustar00rootroot00000000000000console.log('dep2'); console.log('dep-b'); console.log('dep2-b'); console.log('dep3-b'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/es/generated-chunk-c.js000066400000000000000000000000701450520414700331010ustar00rootroot00000000000000import './generated-chunk-b.js'; console.log('dep-c'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/es/main-a.js000066400000000000000000000002671450520414700307670ustar00rootroot00000000000000import './generated-chunk-c.js'; import './generated-chunk-b.js'; console.log('dep1'); console.log('dep-a'); console.log('dep2-a'); console.log('dep3-a'); console.log('main-a'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/system/000077500000000000000000000000001450520414700301775ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000003161450520414700337410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep2'); console.log('dep-b'); console.log('dep2-b'); console.log('dep3-b'); }) }; })); generated-chunk-c.js000066400000000000000000000002521450520414700337410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/systemSystem.register(['./generated-chunk-b.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('dep-c'); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/_expected/system/main-a.js000066400000000000000000000004641450520414700317030ustar00rootroot00000000000000System.register(['./generated-chunk-c.js', './generated-chunk-b.js'], (function () { 'use strict'; return { setters: [null, null], execute: (function () { console.log('dep1'); console.log('dep-a'); console.log('dep2-a'); console.log('dep3-a'); console.log('main-a'); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/dep-a.js000066400000000000000000000000721450520414700262360ustar00rootroot00000000000000import './dep-c'; import './dep1'; console.log('dep-a'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/dep-b.js000066400000000000000000000000501450520414700262330ustar00rootroot00000000000000import './dep2'; console.log('dep-b'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/dep-c.js000066400000000000000000000000501450520414700262340ustar00rootroot00000000000000import './dep2'; console.log('dep-c'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/dep1.js000066400000000000000000000000251450520414700260770ustar00rootroot00000000000000console.log('dep1'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/dep2-a.js000066400000000000000000000000271450520414700263200ustar00rootroot00000000000000console.log('dep2-a'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/dep2-b.js000066400000000000000000000000271450520414700263210ustar00rootroot00000000000000console.log('dep2-b'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/dep2.js000066400000000000000000000000251450520414700261000ustar00rootroot00000000000000console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/dep3-a.js000066400000000000000000000000271450520414700263210ustar00rootroot00000000000000console.log('dep3-a'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/dep3-b.js000066400000000000000000000000271450520414700263220ustar00rootroot00000000000000console.log('dep3-b'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-function/main-a.js000066400000000000000000000002261450520414700264130ustar00rootroot00000000000000import './dep-c'; import './dep-a'; import './dep2-a' import './dep3-a' import './dep-b'; import './dep2-b' import './dep3-b' console.log('main-a'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/000077500000000000000000000000001450520414700243505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_config.js000066400000000000000000000003331450520414700263110ustar00rootroot00000000000000module.exports = defineTest({ description: 'manual chunks can contain nested modules', options: { input: ['main.js'], output: { manualChunks: { manual: ['middle.js', 'inner.js', 'outer.js'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/000077500000000000000000000000001450520414700263105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/amd/000077500000000000000000000000001450520414700270515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/amd/generated-manual.js000066400000000000000000000001631450520414700326200ustar00rootroot00000000000000define((function () { 'use strict'; console.log('inner'); console.log('middle'); console.log('outer'); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/amd/main.js000066400000000000000000000001371450520414700303340ustar00rootroot00000000000000define(['./generated-manual'], (function (manual) { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/cjs/000077500000000000000000000000001450520414700270675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/cjs/generated-manual.js000066400000000000000000000001241450520414700326330ustar00rootroot00000000000000'use strict'; console.log('inner'); console.log('middle'); console.log('outer'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/cjs/main.js000066400000000000000000000001071450520414700303470ustar00rootroot00000000000000'use strict'; require('./generated-manual.js'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/es/000077500000000000000000000000001450520414700267175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/es/generated-manual.js000066400000000000000000000001051450520414700324620ustar00rootroot00000000000000console.log('inner'); console.log('middle'); console.log('outer'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/es/main.js000066400000000000000000000000661450520414700302030ustar00rootroot00000000000000import './generated-manual.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/system/000077500000000000000000000000001450520414700276345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/system/generated-manual.js000066400000000000000000000002641450520414700334050ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('inner'); console.log('middle'); console.log('outer'); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/_expected/system/main.js000066400000000000000000000002501450520414700311130ustar00rootroot00000000000000System.register(['./generated-manual.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/inner.js000066400000000000000000000000261450520414700260170ustar00rootroot00000000000000console.log('inner'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/main.js000066400000000000000000000000531450520414700256300ustar00rootroot00000000000000import './outer.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/middle.js000066400000000000000000000000551450520414700261440ustar00rootroot00000000000000import './inner.js'; console.log('middle'); rollup-3.29.4/test/chunking-form/samples/manual-chunks-nested/outer.js000066400000000000000000000000551450520414700260440ustar00rootroot00000000000000import './middle.js'; console.log('outer'); rollup-3.29.4/test/chunking-form/samples/manual-chunks/000077500000000000000000000000001450520414700230705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks/_config.js000066400000000000000000000003231450520414700250300ustar00rootroot00000000000000module.exports = defineTest({ description: 'manual chunks support', options: { input: ['main.js'], output: { manualChunks: { lib1: ['lib1.js'], deps2and3: ['dep2.js', 'dep3.js'] } } } }); rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/000077500000000000000000000000001450520414700250305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/amd/000077500000000000000000000000001450520414700255715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/amd/generated-deps2and3.js000066400000000000000000000004761450520414700316550ustar00rootroot00000000000000define(['exports', './generated-lib1'], (function (exports, lib1) { 'use strict'; function fn$2 () { console.log('lib2 fn'); } function fn$1 () { fn$2(); console.log('dep2 fn'); } function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn$1; exports.fn$1 = fn; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/amd/generated-lib1.js000066400000000000000000000002061450520414700307100ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/amd/main.js000066400000000000000000000004251450520414700270540ustar00rootroot00000000000000define(['./generated-deps2and3', './generated-lib1'], (function (deps2and3, lib1) { 'use strict'; function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); deps2and3.fn(); deps2and3.fn$1(); } } return Main; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/cjs/000077500000000000000000000000001450520414700256075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/cjs/generated-deps2and3.js000066400000000000000000000004061450520414700316640ustar00rootroot00000000000000'use strict'; var lib1 = require('./generated-lib1.js'); function fn$2 () { console.log('lib2 fn'); } function fn$1 () { fn$2(); console.log('dep2 fn'); } function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn$1; exports.fn$1 = fn; rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/cjs/generated-lib1.js000066400000000000000000000001161450520414700307260ustar00rootroot00000000000000'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/cjs/main.js000066400000000000000000000004051450520414700270700ustar00rootroot00000000000000'use strict'; var deps2and3 = require('./generated-deps2and3.js'); require('./generated-lib1.js'); function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); deps2and3.fn(); deps2and3.fn$1(); } } module.exports = Main; rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/es/000077500000000000000000000000001450520414700254375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/es/generated-deps2and3.js000066400000000000000000000003631450520414700315160ustar00rootroot00000000000000import { f as fn$3 } from './generated-lib1.js'; function fn$2 () { console.log('lib2 fn'); } function fn$1 () { fn$2(); console.log('dep2 fn'); } function fn () { fn$3(); console.log('dep3 fn'); } export { fn as a, fn$1 as f }; rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/es/generated-lib1.js000066400000000000000000000001021450520414700305510ustar00rootroot00000000000000function fn () { console.log('lib1 fn'); } export { fn as f }; rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/es/main.js000066400000000000000000000003631450520414700267230ustar00rootroot00000000000000import { f as fn$1, a as fn$2 } from './generated-deps2and3.js'; import './generated-lib1.js'; function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); fn$1(); fn$2(); } } export { Main as default }; rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/system/000077500000000000000000000000001450520414700263545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/system/generated-deps2and3.js000066400000000000000000000007631450520414700324370ustar00rootroot00000000000000System.register(['./generated-lib1.js'], (function (exports) { 'use strict'; var fn$3; return { setters: [function (module) { fn$3 = module.f; }], execute: (function () { exports({ a: fn, f: fn$1 }); function fn$2 () { console.log('lib2 fn'); } function fn$1 () { fn$2(); console.log('dep2 fn'); } function fn () { fn$3(); console.log('dep3 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/system/generated-lib1.js000066400000000000000000000003141450520414700314730ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', fn); function fn () { console.log('lib1 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks/_expected/system/main.js000066400000000000000000000007411450520414700276400ustar00rootroot00000000000000System.register(['./generated-deps2and3.js', './generated-lib1.js'], (function (exports) { 'use strict'; var fn$1, fn$2; return { setters: [function (module) { fn$1 = module.f; fn$2 = module.a; }, null], execute: (function () { function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); fn$1(); fn$2(); } } exports('default', Main); }) }; })); rollup-3.29.4/test/chunking-form/samples/manual-chunks/dep1.js000066400000000000000000000000631450520414700242560ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-3.29.4/test/chunking-form/samples/manual-chunks/dep2.js000066400000000000000000000001501450520414700242540ustar00rootroot00000000000000import { fn as libfn } from './lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-3.29.4/test/chunking-form/samples/manual-chunks/dep3.js000066400000000000000000000002201450520414700242530ustar00rootroot00000000000000import { fn as libfn, treeshaked } from './lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-3.29.4/test/chunking-form/samples/manual-chunks/lib1.js000066400000000000000000000001751450520414700242600ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-3.29.4/test/chunking-form/samples/manual-chunks/lib2.js000066400000000000000000000000631450520414700242550ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-3.29.4/test/chunking-form/samples/manual-chunks/main.js000066400000000000000000000003721450520414700243540ustar00rootroot00000000000000import { fn } from './dep1.js'; import { fn as fn2 } from './dep2.js'; import { fn as fn3, default as treeshaked } from './dep3.js'; if (false) { treeshaked(); } export default class Main { constructor () { fn(); fn2(); fn3(); } }rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/000077500000000000000000000000001450520414700257775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/1.js000066400000000000000000000000251450520414700264720ustar00rootroot00000000000000export const x1 = 1; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/2.js000066400000000000000000000000251450520414700264730ustar00rootroot00000000000000export const x2 = 2; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/3.js000066400000000000000000000000251450520414700264740ustar00rootroot00000000000000export const x3 = 3; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/4.js000066400000000000000000000000251450520414700264750ustar00rootroot00000000000000export const x4 = 4; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/5.js000066400000000000000000000000251450520414700264760ustar00rootroot00000000000000export const x5 = 5; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_config.js000066400000000000000000000013231450520414700277400ustar00rootroot00000000000000const assert = require('node:assert'); const { promises: fs } = require('node:fs'); const { wait } = require('../../../utils'); const fsWriteFile = fs.writeFile; let currentWrites = 0; let maxWrites = 0; module.exports = defineTest({ description: 'maxParallelFileOps limits write operations', options: { maxParallelFileOps: 3, output: { preserveModules: true } }, before() { fs.writeFile = async (path, content) => { currentWrites++; maxWrites = Math.max(maxWrites, currentWrites); await fsWriteFile(path, content); await wait(50); currentWrites--; }; }, after() { fs.writeFile = fsWriteFile; assert.strictEqual(maxWrites, 3, 'Wrong number of parallel file writes: ' + maxWrites); } }); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/000077500000000000000000000000001450520414700277375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/amd/000077500000000000000000000000001450520414700305005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/amd/1.js000066400000000000000000000001411450520414700311720ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const x1 = 1; exports.x1 = x1; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/amd/2.js000066400000000000000000000001411450520414700311730ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const x2 = 2; exports.x2 = x2; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/amd/3.js000066400000000000000000000001411450520414700311740ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const x3 = 3; exports.x3 = x3; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/amd/4.js000066400000000000000000000001411450520414700311750ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const x4 = 4; exports.x4 = x4; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/amd/5.js000066400000000000000000000001411450520414700311760ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const x5 = 5; exports.x5 = x5; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/amd/main.js000066400000000000000000000003411450520414700317600ustar00rootroot00000000000000define(['exports', './1', './2', './3', './4', './5'], (function (exports, _1, _2, _3, _4, _5) { 'use strict'; exports.x1 = _1.x1; exports.x2 = _2.x2; exports.x3 = _3.x3; exports.x4 = _4.x4; exports.x5 = _5.x5; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/000077500000000000000000000000001450520414700305165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/1.js000066400000000000000000000000571450520414700312160ustar00rootroot00000000000000'use strict'; const x1 = 1; exports.x1 = x1; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/2.js000066400000000000000000000000571450520414700312170ustar00rootroot00000000000000'use strict'; const x2 = 2; exports.x2 = x2; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/3.js000066400000000000000000000000571450520414700312200ustar00rootroot00000000000000'use strict'; const x3 = 3; exports.x3 = x3; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/4.js000066400000000000000000000000571450520414700312210ustar00rootroot00000000000000'use strict'; const x4 = 4; exports.x4 = x4; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/5.js000066400000000000000000000000571450520414700312220ustar00rootroot00000000000000'use strict'; const x5 = 5; exports.x5 = x5; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/main.js000066400000000000000000000004021450520414700317740ustar00rootroot00000000000000'use strict'; var _1 = require('./1.js'); var _2 = require('./2.js'); var _3 = require('./3.js'); var _4 = require('./4.js'); var _5 = require('./5.js'); exports.x1 = _1.x1; exports.x2 = _2.x2; exports.x3 = _3.x3; exports.x4 = _4.x4; exports.x5 = _5.x5; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/es/000077500000000000000000000000001450520414700303465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/es/1.js000066400000000000000000000000361450520414700310430ustar00rootroot00000000000000const x1 = 1; export { x1 }; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/es/2.js000066400000000000000000000000361450520414700310440ustar00rootroot00000000000000const x2 = 2; export { x2 }; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/es/3.js000066400000000000000000000000361450520414700310450ustar00rootroot00000000000000const x3 = 3; export { x3 }; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/es/4.js000066400000000000000000000000361450520414700310460ustar00rootroot00000000000000const x4 = 4; export { x4 }; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/es/5.js000066400000000000000000000000361450520414700310470ustar00rootroot00000000000000const x5 = 5; export { x5 }; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/es/main.js000066400000000000000000000002211450520414700316230ustar00rootroot00000000000000export { x1 } from './1.js'; export { x2 } from './2.js'; export { x3 } from './3.js'; export { x4 } from './4.js'; export { x5 } from './5.js'; rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/system/000077500000000000000000000000001450520414700312635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/system/1.js000066400000000000000000000002151450520414700317570ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const x1 = exports('x1', 1); }) }; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/system/2.js000066400000000000000000000002151450520414700317600ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const x2 = exports('x2', 2); }) }; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/system/3.js000066400000000000000000000002151450520414700317610ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const x3 = exports('x3', 3); }) }; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/system/4.js000066400000000000000000000002151450520414700317620ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const x4 = exports('x4', 4); }) }; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/system/5.js000066400000000000000000000002151450520414700317630ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const x5 = exports('x5', 5); }) }; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/_expected/system/main.js000066400000000000000000000006711450520414700325510ustar00rootroot00000000000000System.register(['./1.js', './2.js', './3.js', './4.js', './5.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('x1', module.x1); }, function (module) { exports('x2', module.x2); }, function (module) { exports('x3', module.x3); }, function (module) { exports('x4', module.x4); }, function (module) { exports('x5', module.x5); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/max-parallel-file-operations/main.js000066400000000000000000000001511450520414700272560ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/000077500000000000000000000000001450520414700231635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/000077500000000000000000000000001450520414700305135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_config.js000066400000000000000000000003231450520414700324530ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoids circular dependencies when merging chunks', options: { input: ['main1.js', 'main2.js', 'main3.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/000077500000000000000000000000001450520414700324535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/amd/000077500000000000000000000000001450520414700332145ustar00rootroot00000000000000generated-main1.js000066400000000000000000000005341450520414700364360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/amddefine(['exports', './generated-small'], (function (exports, small) { 'use strict'; const result = small.small + '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'; console.log(result); const generated = 'generated' + result; exports.generated = generated; exports.result = result; })); generated-small.js000066400000000000000000000001541450520414700365370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small = '1'; exports.small = small; })); main1.js000066400000000000000000000002371450520414700345020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/amddefine(['exports', './generated-main1', './generated-small'], (function (exports, main1, small) { 'use strict'; exports.generated = main1.generated; })); main2.js000066400000000000000000000001771450520414700345060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/amddefine(['./generated-main1', './generated-small'], (function (main1, small) { 'use strict'; console.log(main1.result); })); main3.js000066400000000000000000000001421450520414700344770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.small); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/cjs/000077500000000000000000000000001450520414700332325ustar00rootroot00000000000000generated-main1.js000066400000000000000000000004711450520414700364540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/cjs'use strict'; var small = require('./generated-small.js'); const result = small.small + '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'; console.log(result); const generated = 'generated' + result; exports.generated = generated; exports.result = result; generated-small.js000066400000000000000000000000721450520414700365540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/cjs'use strict'; const small = '1'; exports.small = small; main1.js000066400000000000000000000002051450520414700345130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/cjs'use strict'; var main1 = require('./generated-main1.js'); require('./generated-small.js'); exports.generated = main1.generated; main2.js000066400000000000000000000001711450520414700345160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/cjs'use strict'; var main1 = require('./generated-main1.js'); require('./generated-small.js'); console.log(main1.result); main3.js000066400000000000000000000001271450520414700345200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/es/000077500000000000000000000000001450520414700330625ustar00rootroot00000000000000generated-main1.js000066400000000000000000000004321450520414700363010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/esimport { s as small } from './generated-small.js'; const result = small + '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'; console.log(result); const generated = 'generated' + result; export { generated as g, result as r }; generated-small.js000066400000000000000000000000531450520414700364030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/esconst small = '1'; export { small as s }; main1.js000066400000000000000000000001261450520414700343450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/esexport { g as generated } from './generated-main1.js'; import './generated-small.js'; main2.js000066400000000000000000000001511450520414700343440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/esimport { r as result } from './generated-main1.js'; import './generated-small.js'; console.log(result); main3.js000066400000000000000000000001101450520414700343400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/esimport { s as small } from './generated-small.js'; console.log(small); system/000077500000000000000000000000001450520414700337205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expectedgenerated-main1.js000066400000000000000000000006541450520414700372240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/systemSystem.register(['./generated-small.js'], (function (exports) { 'use strict'; var small; return { setters: [function (module) { small = module.s; }], execute: (function () { const result = exports('r', small + '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'); console.log(result); const generated = exports('g', 'generated' + result); }) }; })); generated-small.js000066400000000000000000000002211450520414700373150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small = exports('s', '1'); }) }; })); main1.js000066400000000000000000000003531450520414700352640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/systemSystem.register(['./generated-main1.js', './generated-small.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('generated', module.g); }, null], execute: (function () { }) }; })); main2.js000066400000000000000000000003731450520414700352670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/systemSystem.register(['./generated-main1.js', './generated-small.js'], (function () { 'use strict'; var result; return { setters: [function (module) { result = module.r; }, null], execute: (function () { console.log(result); }) }; })); main3.js000066400000000000000000000003321450520414700352630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var small; return { setters: [function (module) { small = module.s; }], execute: (function () { console.log(small); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/main1.js000066400000000000000000000001271450520414700320560ustar00rootroot00000000000000import { result } from './side-effect'; export const generated = 'generated' + result; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/main2.js000066400000000000000000000000761450520414700320620ustar00rootroot00000000000000import { result } from './side-effect'; console.log(result); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/main3.js000066400000000000000000000000661450520414700320620ustar00rootroot00000000000000import { small } from './small'; console.log(small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/side-effect.js000066400000000000000000000002741450520414700332320ustar00rootroot00000000000000import { small } from './small'; export const result = small + '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'; console.log(result); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies/small.js000066400000000000000000000000321450520414700321540ustar00rootroot00000000000000export const small = '1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/000077500000000000000000000000001450520414700305755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_config.js000066400000000000000000000003231450520414700325350ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoids circular dependencies when merging chunks', options: { input: ['main1.js', 'main2.js', 'main3.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/000077500000000000000000000000001450520414700325355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/amd/000077500000000000000000000000001450520414700332765ustar00rootroot00000000000000generated-main3.js000066400000000000000000000004541450520414700365230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const second = 1; const shared = second + 'shared'; const main1 = 1; const main2 = 2; const main3 = 3; exports.main1 = main1; exports.main2 = main2; exports.main3 = main3; exports.second = second; exports.shared = shared; })); main1.js000066400000000000000000000002731450520414700345640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/amddefine(['exports', './generated-main3'], (function (exports, main1) { 'use strict'; exports.main1 = main1.main1; exports.second = main1.second; exports.shared = main1.shared; })); main2.js000066400000000000000000000002331450520414700345610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/amddefine(['exports', './generated-main3'], (function (exports, main1) { 'use strict'; exports.main2 = main1.main2; exports.shared = main1.shared; })); main3.js000066400000000000000000000002331450520414700345620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/amddefine(['exports', './generated-main3'], (function (exports, main1) { 'use strict'; exports.main3 = main1.main3; exports.second = main1.second; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/cjs/000077500000000000000000000000001450520414700333145ustar00rootroot00000000000000generated-main3.js000066400000000000000000000003621450520414700365370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/cjs'use strict'; const second = 1; const shared = second + 'shared'; const main1 = 1; const main2 = 2; const main3 = 3; exports.main1 = main1; exports.main2 = main2; exports.main3 = main3; exports.second = second; exports.shared = shared; main1.js000066400000000000000000000002321450520414700345750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/cjs'use strict'; var main1 = require('./generated-main3.js'); exports.main1 = main1.main1; exports.second = main1.second; exports.shared = main1.shared; main2.js000066400000000000000000000001731450520414700346020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/cjs'use strict'; var main1 = require('./generated-main3.js'); exports.main2 = main1.main2; exports.shared = main1.shared; main3.js000066400000000000000000000001731450520414700346030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/cjs'use strict'; var main1 = require('./generated-main3.js'); exports.main3 = main1.main3; exports.second = main1.second; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/es/000077500000000000000000000000001450520414700331445ustar00rootroot00000000000000generated-main3.js000066400000000000000000000002651450520414700363710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/esconst second = 1; const shared = second + 'shared'; const main1 = 1; const main2 = 2; const main3 = 3; export { second as a, main2 as b, main3 as c, main1 as m, shared as s }; main1.js000066400000000000000000000001151450520414700344250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/esexport { m as main1, a as second, s as shared } from './generated-main3.js'; main2.js000066400000000000000000000001001450520414700344200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/esexport { b as main2, s as shared } from './generated-main3.js'; main3.js000066400000000000000000000001001450520414700344210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/esexport { c as main3, a as second } from './generated-main3.js'; system/000077500000000000000000000000001450520414700340025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expectedgenerated-main3.js000066400000000000000000000004551450520414700373070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const second = exports('a', 1); const shared = exports('s', second + 'shared'); const main1 = exports('m', 1); const main2 = exports('b', 2); const main3 = exports('c', 3); }) }; })); main1.js000066400000000000000000000003571450520414700353520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/systemSystem.register(['./generated-main3.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ main1: module.m, second: module.a, shared: module.s }); }], execute: (function () { }) }; })); main2.js000066400000000000000000000003351450520414700353470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/systemSystem.register(['./generated-main3.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ main2: module.b, shared: module.s }); }], execute: (function () { }) }; })); main3.js000066400000000000000000000003351450520414700353500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/_expected/systemSystem.register(['./generated-main3.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ main3: module.c, second: module.a }); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/main1.js000066400000000000000000000001361450520414700321400ustar00rootroot00000000000000export { shared } from './shared'; export { second } from './second'; export const main1 = 1; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/main2.js000066400000000000000000000000731450520414700321410ustar00rootroot00000000000000export { shared } from './shared'; export const main2 = 2; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/main3.js000066400000000000000000000000731450520414700321420ustar00rootroot00000000000000export { second } from './second'; export const main3 = 3; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/second.js000066400000000000000000000000311450520414700324000ustar00rootroot00000000000000export const second = 1; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-circular-dependencies2/shared.js000066400000000000000000000001141450520414700323750ustar00rootroot00000000000000import { second } from './second'; export const shared = second + 'shared'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/000077500000000000000000000000001450520414700310125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_config.js000066400000000000000000000003661450520414700327610ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not merge chunks if a dependency would introduce a new side effect', options: { input: ['main1.js', 'main2.js', 'main3.js', 'main4.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/000077500000000000000000000000001450520414700327525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/amd/000077500000000000000000000000001450520414700335135ustar00rootroot00000000000000generated-chunk.js000066400000000000000000000003511450520414700370350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/amddefine(['exports', './generated-effect'], (function (exports, effect) { 'use strict'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; })); generated-effect.js000066400000000000000000000002501450520414700371570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/amddefine((function () { 'use strict'; console.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); })); generated-small.js000066400000000000000000000001541450520414700370360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small = '0'; exports.small = small; })); main1.js000066400000000000000000000001421450520414700347740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.small); })); main2.js000066400000000000000000000001761450520414700350040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/amddefine(['./generated-chunk', './generated-effect'], (function (chunk, effect) { 'use strict'; console.log(chunk.big); })); main3.js000066400000000000000000000001311450520414700347740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/amddefine(['./generated-effect'], (function (effect) { 'use strict'; console.log(); })); main4.js000066400000000000000000000002471450520414700350050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/amddefine(['./generated-small', './generated-chunk', './generated-effect'], (function (small, chunk, effect) { 'use strict'; console.log(small.small, chunk.big); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/cjs/000077500000000000000000000000001450520414700335315ustar00rootroot00000000000000generated-chunk.js000066400000000000000000000002731450520414700370560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/cjs'use strict'; require('./generated-effect.js'); const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; generated-effect.js000066400000000000000000000002131450520414700371740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/cjs'use strict'; console.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); generated-small.js000066400000000000000000000000721450520414700370530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/cjs'use strict'; const small = '0'; exports.small = small; main1.js000066400000000000000000000001271450520414700350150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.small); main2.js000066400000000000000000000001671450520414700350220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/cjs'use strict'; var chunk = require('./generated-chunk.js'); require('./generated-effect.js'); console.log(chunk.big); main3.js000066400000000000000000000001011450520414700350070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/cjs'use strict'; require('./generated-effect.js'); console.log(); main4.js000066400000000000000000000002611450520414700350170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/cjs'use strict'; var small = require('./generated-small.js'); var chunk = require('./generated-chunk.js'); require('./generated-effect.js'); console.log(small.small, chunk.big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/es/000077500000000000000000000000001450520414700333615ustar00rootroot00000000000000generated-chunk.js000066400000000000000000000002541450520414700367050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/esimport './generated-effect.js'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { big as b }; generated-effect.js000066400000000000000000000001741450520414700370320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/esconsole.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); generated-small.js000066400000000000000000000000531450520414700367020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/esconst small = '0'; export { small as s }; main1.js000066400000000000000000000001101450520414700346350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/esimport { s as small } from './generated-small.js'; console.log(small); main2.js000066400000000000000000000001441450520414700346450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/esimport { b as big } from './generated-chunk.js'; import './generated-effect.js'; console.log(big); main3.js000066400000000000000000000000601450520414700346430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/esimport './generated-effect.js'; console.log(); main4.js000066400000000000000000000002361450520414700346510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/esimport { s as small } from './generated-small.js'; import { b as big } from './generated-chunk.js'; import './generated-effect.js'; console.log(small, big); system/000077500000000000000000000000001450520414700342175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expectedgenerated-chunk.js000066400000000000000000000004401450520414700376170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/systemSystem.register(['./generated-effect.js'], (function (exports) { 'use strict'; return { setters: [null], execute: (function () { const big = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); generated-effect.js000066400000000000000000000003451450520414700377470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); generated-small.js000066400000000000000000000002211450520414700376140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small = exports('s', '0'); }) }; })); main1.js000066400000000000000000000003321450520414700355600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var small; return { setters: [function (module) { small = module.s; }], execute: (function () { console.log(small); }) }; })); main2.js000066400000000000000000000003631450520414700355650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/systemSystem.register(['./generated-chunk.js', './generated-effect.js'], (function () { 'use strict'; var big; return { setters: [function (module) { big = module.b; }, null], execute: (function () { console.log(big); }) }; })); main3.js000066400000000000000000000002421450520414700355620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/systemSystem.register(['./generated-effect.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log(); }) }; })); main4.js000066400000000000000000000005071450520414700355670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/_expected/systemSystem.register(['./generated-small.js', './generated-chunk.js', './generated-effect.js'], (function () { 'use strict'; var small, big; return { setters: [function (module) { small = module.s; }, function (module) { big = module.b; }, null], execute: (function () { console.log(small, big); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/chunk.js000066400000000000000000000002171450520414700324600ustar00rootroot00000000000000import './effect'; export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/effect.js000066400000000000000000000001741450520414700326060ustar00rootroot00000000000000console.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/main1.js000066400000000000000000000000661450520414700323570ustar00rootroot00000000000000import { small } from './small'; console.log(small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/main2.js000066400000000000000000000000621450520414700323540ustar00rootroot00000000000000import { big } from './chunk'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/main3.js000066400000000000000000000000431450520414700323540ustar00rootroot00000000000000import './effect'; console.log(); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/main4.js000066400000000000000000000001551450520414700323610ustar00rootroot00000000000000import { small } from './small'; import { big } from './chunk'; import './effect'; console.log(small, big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/avoid-transitive-side-effects/small.js000066400000000000000000000000321450520414700324530ustar00rootroot00000000000000export const small = '0'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/000077500000000000000000000000001450520414700265015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_config.js000066400000000000000000000004571450520414700304510ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses the merge target that is closest', options: { input: [ 'main1.js', 'main2.js', 'main3.js', 'main4.js', 'main5.js', 'main6.js', 'main7.js', 'main8.js', 'main9.js' ], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/000077500000000000000000000000001450520414700304415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/000077500000000000000000000000001450520414700312025ustar00rootroot00000000000000generated-small2.js000066400000000000000000000004011450520414700346020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small1 = '12345678901234567890123456789012345678901234567890'; const small2 = '12345678901234567890123456789012345678901234567890'; exports.small1 = small1; exports.small2 = small2; })); generated-small4.js000066400000000000000000000004011450520414700346040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small3 = '12345678901234567890123456789012345678901234567890'; const small4 = '12345678901234567890123456789012345678901234567890'; exports.small3 = small3; exports.small4 = small4; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/main1.js000066400000000000000000000002231450520414700325420ustar00rootroot00000000000000define(['./generated-small2', './generated-small4'], (function (small2, small4) { 'use strict'; console.log(small2.small1, small4.small3); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/main2.js000066400000000000000000000002231450520414700325430ustar00rootroot00000000000000define(['./generated-small2', './generated-small4'], (function (small2, small4) { 'use strict'; console.log(small2.small2, small4.small4); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/main3.js000066400000000000000000000002421450520414700325450ustar00rootroot00000000000000define(['./generated-small2', './generated-small4'], (function (small2, small4) { 'use strict'; console.log(small2.small1, small2.small2, small4.small3); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/main4.js000066400000000000000000000002421450520414700325460ustar00rootroot00000000000000define(['./generated-small2', './generated-small4'], (function (small2, small4) { 'use strict'; console.log(small2.small2, small4.small3, small4.small4); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/main5.js000066400000000000000000000002611450520414700325500ustar00rootroot00000000000000define(['./generated-small2', './generated-small4'], (function (small2, small4) { 'use strict'; console.log(small2.small1, small2.small2, small4.small3, small4.small4); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/main6.js000066400000000000000000000001461450520414700325530ustar00rootroot00000000000000define(['./generated-small2'], (function (small2) { 'use strict'; console.log(small2.small1); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/main7.js000066400000000000000000000001461450520414700325540ustar00rootroot00000000000000define(['./generated-small2'], (function (small2) { 'use strict'; console.log(small2.small2); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/main8.js000066400000000000000000000001461450520414700325550ustar00rootroot00000000000000define(['./generated-small4'], (function (small4) { 'use strict'; console.log(small4.small3); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/amd/main9.js000066400000000000000000000001461450520414700325560ustar00rootroot00000000000000define(['./generated-small4'], (function (small4) { 'use strict'; console.log(small4.small4); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/000077500000000000000000000000001450520414700312205ustar00rootroot00000000000000generated-small2.js000066400000000000000000000003151450520414700346240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs'use strict'; const small1 = '12345678901234567890123456789012345678901234567890'; const small2 = '12345678901234567890123456789012345678901234567890'; exports.small1 = small1; exports.small2 = small2; generated-small4.js000066400000000000000000000003151450520414700346260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs'use strict'; const small3 = '12345678901234567890123456789012345678901234567890'; const small4 = '12345678901234567890123456789012345678901234567890'; exports.small3 = small3; exports.small4 = small4; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/main1.js000066400000000000000000000002311450520414700325570ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); var small4 = require('./generated-small4.js'); console.log(small2.small1, small4.small3); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/main2.js000066400000000000000000000002311450520414700325600ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); var small4 = require('./generated-small4.js'); console.log(small2.small2, small4.small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/main3.js000066400000000000000000000002501450520414700325620ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); var small4 = require('./generated-small4.js'); console.log(small2.small1, small2.small2, small4.small3); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/main4.js000066400000000000000000000002501450520414700325630ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); var small4 = require('./generated-small4.js'); console.log(small2.small2, small4.small3, small4.small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/main5.js000066400000000000000000000002671450520414700325740ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); var small4 = require('./generated-small4.js'); console.log(small2.small1, small2.small2, small4.small3, small4.small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/main6.js000066400000000000000000000001331450520414700325650ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); console.log(small2.small1); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/main7.js000066400000000000000000000001331450520414700325660ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); console.log(small2.small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/main8.js000066400000000000000000000001331450520414700325670ustar00rootroot00000000000000'use strict'; var small4 = require('./generated-small4.js'); console.log(small4.small3); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/cjs/main9.js000066400000000000000000000001331450520414700325700ustar00rootroot00000000000000'use strict'; var small4 = require('./generated-small4.js'); console.log(small4.small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/000077500000000000000000000000001450520414700310505ustar00rootroot00000000000000generated-small2.js000066400000000000000000000002611450520414700344540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/esconst small1 = '12345678901234567890123456789012345678901234567890'; const small2 = '12345678901234567890123456789012345678901234567890'; export { small2 as a, small1 as s }; generated-small4.js000066400000000000000000000002611450520414700344560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/esconst small3 = '12345678901234567890123456789012345678901234567890'; const small4 = '12345678901234567890123456789012345678901234567890'; export { small4 as a, small3 as s }; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/main1.js000066400000000000000000000002101450520414700324040ustar00rootroot00000000000000import { s as small1 } from './generated-small2.js'; import { s as small3 } from './generated-small4.js'; console.log(small1, small3); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/main2.js000066400000000000000000000002101450520414700324050ustar00rootroot00000000000000import { a as small2 } from './generated-small2.js'; import { a as small4 } from './generated-small4.js'; console.log(small2, small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/main3.js000066400000000000000000000002351450520414700324150ustar00rootroot00000000000000import { s as small1, a as small2 } from './generated-small2.js'; import { s as small3 } from './generated-small4.js'; console.log(small1, small2, small3); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/main4.js000066400000000000000000000002351450520414700324160ustar00rootroot00000000000000import { a as small2 } from './generated-small2.js'; import { s as small3, a as small4 } from './generated-small4.js'; console.log(small2, small3, small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/main5.js000066400000000000000000000002621450520414700324170ustar00rootroot00000000000000import { s as small1, a as small2 } from './generated-small2.js'; import { s as small3, a as small4 } from './generated-small4.js'; console.log(small1, small2, small3, small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/main6.js000066400000000000000000000001131450520414700324130ustar00rootroot00000000000000import { s as small1 } from './generated-small2.js'; console.log(small1); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/main7.js000066400000000000000000000001131450520414700324140ustar00rootroot00000000000000import { a as small2 } from './generated-small2.js'; console.log(small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/main8.js000066400000000000000000000001131450520414700324150ustar00rootroot00000000000000import { s as small3 } from './generated-small4.js'; console.log(small3); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/es/main9.js000066400000000000000000000001131450520414700324160ustar00rootroot00000000000000import { a as small4 } from './generated-small4.js'; console.log(small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/000077500000000000000000000000001450520414700317655ustar00rootroot00000000000000generated-small2.js000066400000000000000000000004321450520414700353710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small1 = exports('s', '12345678901234567890123456789012345678901234567890'); const small2 = exports('a', '12345678901234567890123456789012345678901234567890'); }) }; })); generated-small4.js000066400000000000000000000004321450520414700353730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small3 = exports('s', '12345678901234567890123456789012345678901234567890'); const small4 = exports('a', '12345678901234567890123456789012345678901234567890'); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/main1.js000066400000000000000000000004661450520414700333360ustar00rootroot00000000000000System.register(['./generated-small2.js', './generated-small4.js'], (function () { 'use strict'; var small1, small3; return { setters: [function (module) { small1 = module.s; }, function (module) { small3 = module.s; }], execute: (function () { console.log(small1, small3); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/main2.js000066400000000000000000000004661450520414700333370ustar00rootroot00000000000000System.register(['./generated-small2.js', './generated-small4.js'], (function () { 'use strict'; var small2, small4; return { setters: [function (module) { small2 = module.a; }, function (module) { small4 = module.a; }], execute: (function () { console.log(small2, small4); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/main3.js000066400000000000000000000005341450520414700333340ustar00rootroot00000000000000System.register(['./generated-small2.js', './generated-small4.js'], (function () { 'use strict'; var small1, small2, small3; return { setters: [function (module) { small1 = module.s; small2 = module.a; }, function (module) { small3 = module.s; }], execute: (function () { console.log(small1, small2, small3); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/main4.js000066400000000000000000000005341450520414700333350ustar00rootroot00000000000000System.register(['./generated-small2.js', './generated-small4.js'], (function () { 'use strict'; var small2, small3, small4; return { setters: [function (module) { small2 = module.a; }, function (module) { small3 = module.s; small4 = module.a; }], execute: (function () { console.log(small2, small3, small4); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/main5.js000066400000000000000000000006021450520414700333320ustar00rootroot00000000000000System.register(['./generated-small2.js', './generated-small4.js'], (function () { 'use strict'; var small1, small2, small3, small4; return { setters: [function (module) { small1 = module.s; small2 = module.a; }, function (module) { small3 = module.s; small4 = module.a; }], execute: (function () { console.log(small1, small2, small3, small4); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/main6.js000066400000000000000000000003361450520414700333370ustar00rootroot00000000000000System.register(['./generated-small2.js'], (function () { 'use strict'; var small1; return { setters: [function (module) { small1 = module.s; }], execute: (function () { console.log(small1); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/main7.js000066400000000000000000000003361450520414700333400ustar00rootroot00000000000000System.register(['./generated-small2.js'], (function () { 'use strict'; var small2; return { setters: [function (module) { small2 = module.a; }], execute: (function () { console.log(small2); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/main8.js000066400000000000000000000003361450520414700333410ustar00rootroot00000000000000System.register(['./generated-small4.js'], (function () { 'use strict'; var small3; return { setters: [function (module) { small3 = module.s; }], execute: (function () { console.log(small3); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/_expected/system/main9.js000066400000000000000000000003361450520414700333420ustar00rootroot00000000000000System.register(['./generated-small4.js'], (function () { 'use strict'; var small4; return { setters: [function (module) { small4 = module.a; }], execute: (function () { console.log(small4); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/main1.js000066400000000000000000000001441450520414700300430ustar00rootroot00000000000000import { small1 } from './small1'; import { small3 } from './small3'; console.log(small1, small3); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/main2.js000066400000000000000000000001441450520414700300440ustar00rootroot00000000000000import { small2 } from './small2'; import { small4 } from './small4'; console.log(small2, small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/main3.js000066400000000000000000000002171450520414700300460ustar00rootroot00000000000000import { small1 } from './small1'; import { small2 } from './small2'; import { small3 } from './small3'; console.log(small1, small2, small3); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/main4.js000066400000000000000000000002171450520414700300470ustar00rootroot00000000000000import { small2 } from './small2'; import { small3 } from './small3'; import { small4 } from './small4'; console.log(small2, small3, small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/main5.js000066400000000000000000000002721450520414700300510ustar00rootroot00000000000000import { small1 } from './small1'; import { small2 } from './small2'; import { small3 } from './small3'; import { small4 } from './small4'; console.log(small1, small2, small3, small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/main6.js000066400000000000000000000000711450520414700300470ustar00rootroot00000000000000import { small1 } from './small1'; console.log(small1); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/main7.js000066400000000000000000000000711450520414700300500ustar00rootroot00000000000000import { small2 } from './small2'; console.log(small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/main8.js000066400000000000000000000000711450520414700300510ustar00rootroot00000000000000import { small3 } from './small3'; console.log(small3); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/main9.js000066400000000000000000000000711450520414700300520ustar00rootroot00000000000000import { small4 } from './small4'; console.log(small4); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/small1.js000066400000000000000000000001141450520414700302240ustar00rootroot00000000000000export const small1 = '12345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/small2.js000066400000000000000000000001141450520414700302250ustar00rootroot00000000000000export const small2 = '12345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/small3.js000066400000000000000000000001141450520414700302260ustar00rootroot00000000000000export const small3 = '12345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/best-merge-target/small4.js000066400000000000000000000001141450520414700302270ustar00rootroot00000000000000export const small4 = '12345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/000077500000000000000000000000001450520414700311275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_config.js000066400000000000000000000003631450520414700330730ustar00rootroot00000000000000module.exports = defineTest({ description: 'ignores correlated side effects if they cannot be merged', options: { input: ['main1.js', 'main2.js', 'main3.js', 'main4.js', 'main5.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/000077500000000000000000000000001450520414700330675ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700335515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expectedgenerated-small1.js000066400000000000000000000003551450520414700372370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small1 = '1'; exports.small1 = small1; })); generated-small2.js000066400000000000000000000003631450520414700372370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('other effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small2 = '2'; exports.small2 = small2; })); main1.js000066400000000000000000000002231450520414700351110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/amddefine(['./generated-small1', './generated-small2'], (function (small1, small2) { 'use strict'; console.log(small1.small1, small2.small2); })); main2.js000066400000000000000000000001461450520414700351160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/amddefine(['./generated-small1'], (function (small1) { 'use strict'; console.log(small1.small1); })); main3.js000066400000000000000000000001461450520414700351170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/amddefine(['./generated-small2'], (function (small2) { 'use strict'; console.log(small2.small2); })); main4.js000066400000000000000000000001771450520414700351240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/amddefine(['./generated-small1', './generated-small2'], (function (small1, small2) { 'use strict'; console.log('main 4'); })); main5.js000066400000000000000000000001771450520414700351250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/amddefine(['./generated-small1', './generated-small2'], (function (small1, small2) { 'use strict'; console.log('main 5'); })); cjs/000077500000000000000000000000001450520414700335675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expectedgenerated-small1.js000066400000000000000000000002721450520414700372530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/cjs'use strict'; console.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small1 = '1'; exports.small1 = small1; generated-small2.js000066400000000000000000000003001450520414700372440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/cjs'use strict'; console.log('other effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small2 = '2'; exports.small2 = small2; main1.js000066400000000000000000000002311450520414700351260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/cjs'use strict'; var small1 = require('./generated-small1.js'); var small2 = require('./generated-small2.js'); console.log(small1.small1, small2.small2); main2.js000066400000000000000000000001331450520414700351300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/cjs'use strict'; var small1 = require('./generated-small1.js'); console.log(small1.small1); main3.js000066400000000000000000000001331450520414700351310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/cjs'use strict'; var small2 = require('./generated-small2.js'); console.log(small2.small2); main4.js000066400000000000000000000001531450520414700351340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/cjs'use strict'; require('./generated-small1.js'); require('./generated-small2.js'); console.log('main 4'); main5.js000066400000000000000000000001531450520414700351350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/cjs'use strict'; require('./generated-small1.js'); require('./generated-small2.js'); console.log('main 5'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/es/000077500000000000000000000000001450520414700334765ustar00rootroot00000000000000generated-small1.js000066400000000000000000000002521450520414700371010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/esconsole.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small1 = '1'; export { small1 as s }; generated-small2.js000066400000000000000000000002601450520414700371010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/esconsole.log('other effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small2 = '2'; export { small2 as s }; main1.js000066400000000000000000000002101450520414700347530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/esimport { s as small1 } from './generated-small1.js'; import { s as small2 } from './generated-small2.js'; console.log(small1, small2); main2.js000066400000000000000000000001131450520414700347560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/esimport { s as small1 } from './generated-small1.js'; console.log(small1); main3.js000066400000000000000000000001131450520414700347570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/esimport { s as small2 } from './generated-small2.js'; console.log(small2); main4.js000066400000000000000000000001301450520414700347570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/esimport './generated-small1.js'; import './generated-small2.js'; console.log('main 4'); main5.js000066400000000000000000000001301450520414700347600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/esimport './generated-small1.js'; import './generated-small2.js'; console.log('main 5'); system/000077500000000000000000000000001450520414700343345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expectedgenerated-small1.js000066400000000000000000000004221450520414700400150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small1 = exports('s', '1'); }) }; })); generated-small2.js000066400000000000000000000004301450520414700400150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('other effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small2 = exports('s', '2'); }) }; })); main1.js000066400000000000000000000004661450520414700357050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/systemSystem.register(['./generated-small1.js', './generated-small2.js'], (function () { 'use strict'; var small1, small2; return { setters: [function (module) { small1 = module.s; }, function (module) { small2 = module.s; }], execute: (function () { console.log(small1, small2); }) }; })); main2.js000066400000000000000000000003361450520414700357020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/systemSystem.register(['./generated-small1.js'], (function () { 'use strict'; var small1; return { setters: [function (module) { small1 = module.s; }], execute: (function () { console.log(small1); }) }; })); main3.js000066400000000000000000000003361450520414700357030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/systemSystem.register(['./generated-small2.js'], (function () { 'use strict'; var small2; return { setters: [function (module) { small2 = module.s; }], execute: (function () { console.log(small2); }) }; })); main4.js000066400000000000000000000003111450520414700356750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/systemSystem.register(['./generated-small1.js', './generated-small2.js'], (function () { 'use strict'; return { setters: [null, null], execute: (function () { console.log('main 4'); }) }; })); main5.js000066400000000000000000000003111450520414700356760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/_expected/systemSystem.register(['./generated-small1.js', './generated-small2.js'], (function () { 'use strict'; return { setters: [null, null], execute: (function () { console.log('main 5'); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/effect.js000066400000000000000000000001741450520414700327230ustar00rootroot00000000000000console.log('effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/main1.js000066400000000000000000000002201450520414700324640ustar00rootroot00000000000000import './effect'; import './other-effect'; import { small1 } from './small1'; import { small2 } from './small2'; console.log(small1, small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/main2.js000066400000000000000000000001141450520414700324670ustar00rootroot00000000000000import './effect'; import { small1 } from './small1'; console.log(small1); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/main3.js000066400000000000000000000001221450520414700324670ustar00rootroot00000000000000import './other-effect'; import { small2 } from './small2'; console.log(small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/main4.js000066400000000000000000000001041450520414700324700ustar00rootroot00000000000000import './effect'; import './other-effect'; console.log('main 4'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/main5.js000066400000000000000000000001041450520414700324710ustar00rootroot00000000000000import './effect'; import './other-effect'; console.log('main 5'); other-effect.js000066400000000000000000000002021450520414700337530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effectsconsole.log('other effect 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/small1.js000066400000000000000000000000331450520414700326520ustar00rootroot00000000000000export const small1 = '1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/ignore-correlated-side-effects/small2.js000066400000000000000000000000331450520414700326530ustar00rootroot00000000000000export const small2 = '2'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/000077500000000000000000000000001450520414700312475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_config.js000066400000000000000000000004201450520414700332050ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges small chunks into shared chunks that are loaded by a non-close super-set of entry points', options: { input: ['main1.js', 'main2.js', 'main3.js', 'main4.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/000077500000000000000000000000001450520414700332075ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700336715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expectedgenerated-shared.js000066400000000000000000000002641450520414700374330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small = '1'; const shared = '1'; console.log('effect'); exports.shared = shared; exports.small = small; })); main1.js000066400000000000000000000001641450520414700352350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/amddefine(['./generated-shared'], (function (shared) { 'use strict'; console.log(shared.shared, shared.small); })); main2.js000066400000000000000000000001641450520414700352360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/amddefine(['./generated-shared'], (function (shared) { 'use strict'; console.log(shared.shared, shared.small); })); main3.js000066400000000000000000000001461450520414700352370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/amddefine(['./generated-shared'], (function (shared) { 'use strict'; console.log(shared.shared); })); main4.js000066400000000000000000000001461450520414700352400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/amddefine(['./generated-shared'], (function (shared) { 'use strict'; console.log(shared.shared); })); cjs/000077500000000000000000000000001450520414700337075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expectedgenerated-shared.js000066400000000000000000000001771450520414700374540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/cjs'use strict'; const small = '1'; const shared = '1'; console.log('effect'); exports.shared = shared; exports.small = small; main1.js000066400000000000000000000001511450520414700352470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/cjs'use strict'; var shared = require('./generated-shared.js'); console.log(shared.shared, shared.small); main2.js000066400000000000000000000001511450520414700352500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/cjs'use strict'; var shared = require('./generated-shared.js'); console.log(shared.shared, shared.small); main3.js000066400000000000000000000001331450520414700352510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/cjs'use strict'; var shared = require('./generated-shared.js'); console.log(shared.shared); main4.js000066400000000000000000000001331450520414700352520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/cjs'use strict'; var shared = require('./generated-shared.js'); console.log(shared.shared); es/000077500000000000000000000000001450520414700335375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expectedgenerated-shared.js000066400000000000000000000001441450520414700372760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/esconst small = '1'; const shared = '1'; console.log('effect'); export { small as a, shared as s }; main1.js000066400000000000000000000001361450520414700351020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/esimport { s as shared, a as small } from './generated-shared.js'; console.log(shared, small); main2.js000066400000000000000000000001361450520414700351030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/esimport { s as shared, a as small } from './generated-shared.js'; console.log(shared, small); main3.js000066400000000000000000000001131450520414700350770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/esimport { s as shared } from './generated-shared.js'; console.log(shared); main4.js000066400000000000000000000001131450520414700351000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/esimport { s as shared } from './generated-shared.js'; console.log(shared); system/000077500000000000000000000000001450520414700344545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expectedgenerated-shared.js000066400000000000000000000003211450520414700402100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small = exports('a', '1'); const shared = exports('s', '1'); console.log('effect'); }) }; })); main1.js000066400000000000000000000004011450520414700360120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/systemSystem.register(['./generated-shared.js'], (function () { 'use strict'; var shared, small; return { setters: [function (module) { shared = module.s; small = module.a; }], execute: (function () { console.log(shared, small); }) }; })); main2.js000066400000000000000000000004011450520414700360130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/systemSystem.register(['./generated-shared.js'], (function () { 'use strict'; var shared, small; return { setters: [function (module) { shared = module.s; small = module.a; }], execute: (function () { console.log(shared, small); }) }; })); main3.js000066400000000000000000000003361450520414700360230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/systemSystem.register(['./generated-shared.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { console.log(shared); }) }; })); main4.js000066400000000000000000000003361450520414700360240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/_expected/systemSystem.register(['./generated-shared.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { console.log(shared); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/main1.js000066400000000000000000000001411450520414700326060ustar00rootroot00000000000000import { small } from './small'; import { shared } from './shared'; console.log(shared, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/main2.js000066400000000000000000000001411450520414700326070ustar00rootroot00000000000000import { small } from './small'; import { shared } from './shared'; console.log(shared, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/main3.js000066400000000000000000000000711450520414700326120ustar00rootroot00000000000000import { shared } from './shared'; console.log(shared); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/main4.js000066400000000000000000000000711450520414700326130ustar00rootroot00000000000000import { shared } from './shared'; console.log(shared); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/shared.js000066400000000000000000000000621450520414700330510ustar00rootroot00000000000000export const shared = '1'; console.log('effect'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-distant-shared/small.js000066400000000000000000000000321450520414700327100ustar00rootroot00000000000000export const small = '1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/000077500000000000000000000000001450520414700276035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_config.js000066400000000000000000000026521450520414700315520ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges small chunks into shared chunks that are loaded by a super-set of entry points', options: { input: ['main1.js', 'main2.js', 'main3.js'], output: { experimentalMinChunkSize: 100 } }, logs: [ { level: 'info', code: 'OPTIMIZE_CHUNK_STATUS', message: 'After merging chunks, there are\n4 chunks, of which\n3 are below minChunkSize.' }, { level: 'info', code: 'OPTIMIZE_CHUNK_STATUS', message: 'After merging chunks, there are\n4 chunks, of which\n3 are below minChunkSize.' }, { level: 'info', code: 'OPTIMIZE_CHUNK_STATUS', message: 'After merging chunks, there are\n4 chunks, of which\n3 are below minChunkSize.' }, { level: 'info', code: 'OPTIMIZE_CHUNK_STATUS', message: 'After merging chunks, there are\n4 chunks, of which\n3 are below minChunkSize.' }, { level: 'info', code: 'OPTIMIZE_CHUNK_STATUS', message: 'Initially, there are\n5 chunks, of which\n4 are below minChunkSize.' }, { level: 'info', code: 'OPTIMIZE_CHUNK_STATUS', message: 'Initially, there are\n5 chunks, of which\n4 are below minChunkSize.' }, { level: 'info', code: 'OPTIMIZE_CHUNK_STATUS', message: 'Initially, there are\n5 chunks, of which\n4 are below minChunkSize.' }, { level: 'info', code: 'OPTIMIZE_CHUNK_STATUS', message: 'Initially, there are\n5 chunks, of which\n4 are below minChunkSize.' } ] }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/000077500000000000000000000000001450520414700315435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/amd/000077500000000000000000000000001450520414700323045ustar00rootroot00000000000000generated-small.js000066400000000000000000000003661450520414700356340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small = '1'; exports.big = big; exports.small = small; })); main1.js000066400000000000000000000001551450520414700335710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.big, small.small); })); main2.js000066400000000000000000000001551450520414700335720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.big, small.small); })); main3.js000066400000000000000000000001401450520414700335650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.big); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/cjs/000077500000000000000000000000001450520414700323225ustar00rootroot00000000000000generated-small.js000066400000000000000000000003021450520414700356400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/cjs'use strict'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small = '1'; exports.big = big; exports.small = small; main1.js000066400000000000000000000001421450520414700336030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.big, small.small); main2.js000066400000000000000000000001421450520414700336040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.big, small.small); main3.js000066400000000000000000000001251450520414700336060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/es/000077500000000000000000000000001450520414700321525ustar00rootroot00000000000000generated-small.js000066400000000000000000000002521450520414700354740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/esconst big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small = '1'; export { big as b, small as s }; main1.js000066400000000000000000000001271450520414700334360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/esimport { b as big, s as small } from './generated-small.js'; console.log(big, small); main2.js000066400000000000000000000001271450520414700334370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/esimport { b as big, s as small } from './generated-small.js'; console.log(big, small); main3.js000066400000000000000000000001041450520414700334330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/esimport { b as big } from './generated-small.js'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/system/000077500000000000000000000000001450520414700330675ustar00rootroot00000000000000generated-small.js000066400000000000000000000004271450520414700364150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const big = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small = exports('s', '1'); }) }; })); main1.js000066400000000000000000000003671450520414700343610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var big, small; return { setters: [function (module) { big = module.b; small = module.s; }], execute: (function () { console.log(big, small); }) }; })); main2.js000066400000000000000000000003671450520414700343620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var big, small; return { setters: [function (module) { big = module.b; small = module.s; }], execute: (function () { console.log(big, small); }) }; })); main3.js000066400000000000000000000003241450520414700343540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var big; return { setters: [function (module) { big = module.b; }], execute: (function () { console.log(big); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/big.js000066400000000000000000000001731450520414700307030ustar00rootroot00000000000000export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/main1.js000066400000000000000000000001301450520414700311400ustar00rootroot00000000000000import { big } from './big'; import { small } from './small'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/main2.js000066400000000000000000000001301450520414700311410ustar00rootroot00000000000000import { big } from './big'; import { small } from './small'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/main3.js000066400000000000000000000000601450520414700311440ustar00rootroot00000000000000import { big } from './big'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-chunk-into-shared/small.js000066400000000000000000000000321450520414700312440ustar00rootroot00000000000000export const small = '1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/000077500000000000000000000000001450520414700307435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_config.js000066400000000000000000000003221450520414700327020ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges correlated side effects with pure chunks', options: { input: ['main1.js', 'main2.js', 'main3.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/000077500000000000000000000000001450520414700327035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/amd/000077500000000000000000000000001450520414700334445ustar00rootroot00000000000000generated-small1.js000066400000000000000000000002101450520414700370410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('effect'); const small1 = '1'; exports.small1 = small1; })); generated-small2.js000066400000000000000000000002161450520414700370500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('other effect'); const small2 = '2'; exports.small2 = small2; })); main1.js000066400000000000000000000002231450520414700347250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/amddefine(['./generated-small1', './generated-small2'], (function (small1, small2) { 'use strict'; console.log(small1.small1, small2.small2); })); main2.js000066400000000000000000000001461450520414700347320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/amddefine(['./generated-small1'], (function (small1) { 'use strict'; console.log(small1.small1); })); main3.js000066400000000000000000000001461450520414700347330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/amddefine(['./generated-small2'], (function (small2) { 'use strict'; console.log(small2.small2); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/cjs/000077500000000000000000000000001450520414700334625ustar00rootroot00000000000000generated-small1.js000066400000000000000000000001251450520414700370640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/cjs'use strict'; console.log('effect'); const small1 = '1'; exports.small1 = small1; generated-small2.js000066400000000000000000000001331450520414700370640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/cjs'use strict'; console.log('other effect'); const small2 = '2'; exports.small2 = small2; main1.js000066400000000000000000000002311450520414700347420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/cjs'use strict'; var small1 = require('./generated-small1.js'); var small2 = require('./generated-small2.js'); console.log(small1.small1, small2.small2); main2.js000066400000000000000000000001331450520414700347440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/cjs'use strict'; var small1 = require('./generated-small1.js'); console.log(small1.small1); main3.js000066400000000000000000000001331450520414700347450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/cjs'use strict'; var small2 = require('./generated-small2.js'); console.log(small2.small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/es/000077500000000000000000000000001450520414700333125ustar00rootroot00000000000000generated-small1.js000066400000000000000000000001051450520414700367120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/esconsole.log('effect'); const small1 = '1'; export { small1 as s }; generated-small2.js000066400000000000000000000001131450520414700367120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/esconsole.log('other effect'); const small2 = '2'; export { small2 as s }; main1.js000066400000000000000000000002101450520414700345670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/esimport { s as small1 } from './generated-small1.js'; import { s as small2 } from './generated-small2.js'; console.log(small1, small2); main2.js000066400000000000000000000001131450520414700345720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/esimport { s as small1 } from './generated-small1.js'; console.log(small1); main3.js000066400000000000000000000001131450520414700345730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/esimport { s as small2 } from './generated-small2.js'; console.log(small2); system/000077500000000000000000000000001450520414700341505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expectedgenerated-small1.js000066400000000000000000000002551450520414700376350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('effect'); const small1 = exports('s', '1'); }) }; })); generated-small2.js000066400000000000000000000002631450520414700376350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('other effect'); const small2 = exports('s', '2'); }) }; })); main1.js000066400000000000000000000004661450520414700355210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/systemSystem.register(['./generated-small1.js', './generated-small2.js'], (function () { 'use strict'; var small1, small2; return { setters: [function (module) { small1 = module.s; }, function (module) { small2 = module.s; }], execute: (function () { console.log(small1, small2); }) }; })); main2.js000066400000000000000000000003361450520414700355160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/systemSystem.register(['./generated-small1.js'], (function () { 'use strict'; var small1; return { setters: [function (module) { small1 = module.s; }], execute: (function () { console.log(small1); }) }; })); main3.js000066400000000000000000000003361450520414700355170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/_expected/systemSystem.register(['./generated-small2.js'], (function () { 'use strict'; var small2; return { setters: [function (module) { small2 = module.s; }], execute: (function () { console.log(small2); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/effect.js000066400000000000000000000000271450520414700325340ustar00rootroot00000000000000console.log('effect'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/main1.js000066400000000000000000000002201450520414700323000ustar00rootroot00000000000000import './effect'; import './other-effect'; import { small1 } from './small1'; import { small2 } from './small2'; console.log(small1, small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/main2.js000066400000000000000000000001141450520414700323030ustar00rootroot00000000000000import './effect'; import { small1 } from './small1'; console.log(small1); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/main3.js000066400000000000000000000001221450520414700323030ustar00rootroot00000000000000import './other-effect'; import { small2 } from './small2'; console.log(small2); other-effect.js000066400000000000000000000000351450520414700335730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effectsconsole.log('other effect'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/small1.js000066400000000000000000000000341450520414700324670ustar00rootroot00000000000000 export const small1 = '1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-correlated-side-effects/small2.js000066400000000000000000000000341450520414700324700ustar00rootroot00000000000000 export const small2 = '2'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/000077500000000000000000000000001450520414700307355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_config.js000066400000000000000000000003361450520414700327010ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges chunks if their dependency side effects are the same', options: { input: ['main1.js', 'main2.js', 'main3.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/000077500000000000000000000000001450520414700326755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/amd/000077500000000000000000000000001450520414700334365ustar00rootroot00000000000000generated-small.js000066400000000000000000000004171450520414700367630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('effect'); const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small = '0'; exports.big = big; exports.small = small; })); main1.js000066400000000000000000000001551450520414700347230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.big, small.small); })); main2.js000066400000000000000000000001551450520414700347240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.big, small.small); })); main3.js000066400000000000000000000001401450520414700347170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.big); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/cjs/000077500000000000000000000000001450520414700334545ustar00rootroot00000000000000generated-small.js000066400000000000000000000003321450520414700367750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/cjs'use strict'; console.log('effect'); const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small = '0'; exports.big = big; exports.small = small; main1.js000066400000000000000000000001421450520414700347350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.big, small.small); main2.js000066400000000000000000000001421450520414700347360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.big, small.small); main3.js000066400000000000000000000001251450520414700347400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/es/000077500000000000000000000000001450520414700333045ustar00rootroot00000000000000generated-small.js000066400000000000000000000003021450520414700366220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/esconsole.log('effect'); const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small = '0'; export { big as b, small as s }; main1.js000066400000000000000000000001271450520414700345700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/esimport { b as big, s as small } from './generated-small.js'; console.log(big, small); main2.js000066400000000000000000000001271450520414700345710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/esimport { b as big, s as small } from './generated-small.js'; console.log(big, small); main3.js000066400000000000000000000001041450520414700345650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/esimport { b as big } from './generated-small.js'; console.log(big); system/000077500000000000000000000000001450520414700341425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expectedgenerated-small.js000066400000000000000000000004621450520414700375460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('effect'); const big = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small = exports('s', '0'); }) }; })); main1.js000066400000000000000000000003671450520414700355130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var big, small; return { setters: [function (module) { big = module.b; small = module.s; }], execute: (function () { console.log(big, small); }) }; })); main2.js000066400000000000000000000003671450520414700355140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var big, small; return { setters: [function (module) { big = module.b; small = module.s; }], execute: (function () { console.log(big, small); }) }; })); main3.js000066400000000000000000000003241450520414700355060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var big; return { setters: [function (module) { big = module.b; }], execute: (function () { console.log(big); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/big.js000066400000000000000000000002171450520414700320340ustar00rootroot00000000000000import './effect'; export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/effect.js000066400000000000000000000000271450520414700325260ustar00rootroot00000000000000console.log('effect'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/main1.js000066400000000000000000000001301450520414700322720ustar00rootroot00000000000000import { big } from './big'; import { small } from './small'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/main2.js000066400000000000000000000001301450520414700322730ustar00rootroot00000000000000import { big } from './big'; import { small } from './small'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/main3.js000066400000000000000000000000601450520414700322760ustar00rootroot00000000000000import { big } from './big'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dependency-side-effects/small.js000066400000000000000000000000561450520414700324040ustar00rootroot00000000000000import './effect'; export const small = '0'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/000077500000000000000000000000001450520414700323765ustar00rootroot00000000000000_config.js000066400000000000000000000004071450520414700342620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effectsmodule.exports = defineTest({ description: "merges chunks if their dependency side effects are a subset of the other's correlated side effects", options: { input: ['main1.js', 'main2.js', 'main3.js'], output: { experimentalMinChunkSize: 100 } } }); _expected/000077500000000000000000000000001450520414700342575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effectsamd/000077500000000000000000000000001450520414700350205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expectedgenerated-small.js000066400000000000000000000004171450520414700404240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('effect'); const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small = '0'; exports.big = big; exports.small = small; })); main1.js000066400000000000000000000001551450520414700363640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.big, small.small); })); main2.js000066400000000000000000000001531450520414700363630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/amddefine(['./generated-small'], (function (small$1) { 'use strict'; console.log(small$1.big, small); })); main3.js000066400000000000000000000001421450520414700363620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/amddefine(['./generated-small'], (function (small) { 'use strict'; console.log(small.small); })); cjs/000077500000000000000000000000001450520414700350365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expectedgenerated-small.js000066400000000000000000000003321450520414700404360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/cjs'use strict'; console.log('effect'); const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small = '0'; exports.big = big; exports.small = small; main1.js000066400000000000000000000001421450520414700363760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.big, small.small); main2.js000066400000000000000000000001401450520414700363750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/cjs'use strict'; var small$1 = require('./generated-small.js'); console.log(small$1.big, small); main3.js000066400000000000000000000001271450520414700364030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/cjs'use strict'; var small = require('./generated-small.js'); console.log(small.small); es/000077500000000000000000000000001450520414700346665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expectedgenerated-small.js000066400000000000000000000003021450520414700402630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/esconsole.log('effect'); const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small = '0'; export { big as b, small as s }; main1.js000066400000000000000000000001271450520414700362310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/esimport { b as big, s as small } from './generated-small.js'; console.log(big, small); main2.js000066400000000000000000000001131450520414700362250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/esimport { b as big } from './generated-small.js'; console.log(big, small); main3.js000066400000000000000000000001101450520414700362230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/esimport { s as small } from './generated-small.js'; console.log(small); system/000077500000000000000000000000001450520414700356035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expectedgenerated-small.js000066400000000000000000000004621450520414700412070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('effect'); const big = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small = exports('s', '0'); }) }; })); main1.js000066400000000000000000000003671450520414700371540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var big, small; return { setters: [function (module) { big = module.b; small = module.s; }], execute: (function () { console.log(big, small); }) }; })); main2.js000066400000000000000000000003331450520414700371460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var big; return { setters: [function (module) { big = module.b; }], execute: (function () { console.log(big, small); }) }; })); main3.js000066400000000000000000000003321450520414700371460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/_expected/systemSystem.register(['./generated-small.js'], (function () { 'use strict'; var small; return { setters: [function (module) { small = module.s; }], execute: (function () { console.log(small); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effects/big.js000066400000000000000000000001731450520414700334760ustar00rootroot00000000000000export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; effect.js000066400000000000000000000000271450520414700341100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effectsconsole.log('effect'); main1.js000066400000000000000000000001531450520414700336610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effectsimport './effect'; import { big } from './big'; import { small } from './small'; console.log(big, small); main2.js000066400000000000000000000001121450520414700336550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effectsimport './effect'; import { big } from './big'; console.log(big, small); main3.js000066400000000000000000000000661450520414700336660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effectsimport { small } from './small'; console.log(small); small.js000066400000000000000000000000561450520414700337660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-despite-correlated-side-effectsimport './effect'; export const small = '0'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/000077500000000000000000000000001450520414700273775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_config.js000066400000000000000000000002631450520414700313420ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges small chunks with side effects into suitable pure chunks', options: { output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/000077500000000000000000000000001450520414700313375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/amd/000077500000000000000000000000001450520414700321005ustar00rootroot00000000000000generated-small2.js000066400000000000000000000005331450520414700355060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small1 = 'small1'; var small1$1 = /*#__PURE__*/Object.freeze({ __proto__: null, small1: small1 }); const small2 = 'small2'; var small2$1 = /*#__PURE__*/Object.freeze({ __proto__: null, small2: small2 }); exports.small1 = small1$1; exports.small2 = small2$1; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/amd/main.js000066400000000000000000000011021450520414700333540ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small1 = new Promise(function (resolve, reject) { require(['./generated-small2'], resolve, reject); }).then(function (n) { return n.small1; }); const small2 = new Promise(function (resolve, reject) { require(['./generated-small2'], resolve, reject); }).then(function (n) { return n.small2; }); exports.big = big; exports.small1 = small1; exports.small2 = small2; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/cjs/000077500000000000000000000000001450520414700321165ustar00rootroot00000000000000generated-small2.js000066400000000000000000000004371450520414700355270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/cjs'use strict'; const small1 = 'small1'; var small1$1 = /*#__PURE__*/Object.freeze({ __proto__: null, small1: small1 }); const small2 = 'small2'; var small2$1 = /*#__PURE__*/Object.freeze({ __proto__: null, small2: small2 }); exports.small1 = small1$1; exports.small2 = small2$1; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/cjs/main.js000066400000000000000000000007351450520414700334050ustar00rootroot00000000000000'use strict'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small1 = Promise.resolve().then(function () { return require('./generated-small2.js'); }).then(function (n) { return n.small1; }); const small2 = Promise.resolve().then(function () { return require('./generated-small2.js'); }).then(function (n) { return n.small2; }); exports.big = big; exports.small1 = small1; exports.small2 = small2; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/es/000077500000000000000000000000001450520414700317465ustar00rootroot00000000000000generated-small2.js000066400000000000000000000004031450520414700353500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/esconst small1 = 'small1'; var small1$1 = /*#__PURE__*/Object.freeze({ __proto__: null, small1: small1 }); const small2 = 'small2'; var small2$1 = /*#__PURE__*/Object.freeze({ __proto__: null, small2: small2 }); export { small2$1 as a, small1$1 as s }; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/es/main.js000066400000000000000000000004751450520414700332360ustar00rootroot00000000000000const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; const small1 = import('./generated-small2.js').then(function (n) { return n.s; }); const small2 = import('./generated-small2.js').then(function (n) { return n.a; }); export { big, small1, small2 }; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/system/000077500000000000000000000000001450520414700326635ustar00rootroot00000000000000generated-small2.js000066400000000000000000000006321450520414700362710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small1 = 'small1'; var small1$1 = /*#__PURE__*/Object.freeze({ __proto__: null, small1: small1 }); exports('s', small1$1); const small2 = 'small2'; var small2$1 = /*#__PURE__*/Object.freeze({ __proto__: null, small2: small2 }); exports('a', small2$1); }) }; })); main.js000066400000000000000000000007411450520414700340700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const big = exports('big', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); const small1 = exports('small1', module.import('./generated-small2.js').then(function (n) { return n.s; })); const small2 = exports('small2', module.import('./generated-small2.js').then(function (n) { return n.a; })); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/main.js000066400000000000000000000003211450520414700306550ustar00rootroot00000000000000export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export const small1 = import('./small1'); export const small2 = import('./small2'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/small1.js000066400000000000000000000000401450520414700311200ustar00rootroot00000000000000export const small1 = 'small1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-dynamic-imports/small2.js000066400000000000000000000000401450520414700311210ustar00rootroot00000000000000export const small2 = 'small2'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/000077500000000000000000000000001450520414700310355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_config.js000066400000000000000000000003261450520414700330000ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges small chunks with side effects into suitable pure chunks', options: { input: ['main1.js', 'main2.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/000077500000000000000000000000001450520414700327755ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700334575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expectedmain1.js000066400000000000000000000002651450520414700350250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small = '12345678901234567890123456789012345678901234567890'; console.log('effect'); exports.small = small; })); main2.js000066400000000000000000000001611450520414700350210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/amddefine(['exports', './main1'], (function (exports, main1) { 'use strict'; exports.small = main1.small; })); cjs/000077500000000000000000000000001450520414700334755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expectedmain1.js000066400000000000000000000002021450520414700350320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/cjs'use strict'; const small = '12345678901234567890123456789012345678901234567890'; console.log('effect'); exports.small = small; main2.js000066400000000000000000000001221450520414700350340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/cjs'use strict'; var main1 = require('./main1.js'); exports.small = main1.small; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/es/000077500000000000000000000000001450520414700334045ustar00rootroot00000000000000main1.js000066400000000000000000000001561450520414700346720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/esconst small = '12345678901234567890123456789012345678901234567890'; console.log('effect'); export { small }; main2.js000066400000000000000000000000441450520414700346670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/esexport { small } from './main1.js'; system/000077500000000000000000000000001450520414700342425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expectedmain1.js000066400000000000000000000003401450520414700356020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small = exports('small', '12345678901234567890123456789012345678901234567890'); console.log('effect'); }) }; })); main2.js000066400000000000000000000003031450520414700356020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/_expected/systemSystem.register(['./main1.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('small', module.small); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/big.js000066400000000000000000000001731450520414700321350ustar00rootroot00000000000000export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/main1.js000066400000000000000000000000411450520414700323730ustar00rootroot00000000000000export { small } from './small'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/main2.js000066400000000000000000000000411450520414700323740ustar00rootroot00000000000000export { small } from './small'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-small-side-effect-chunks/small.js000066400000000000000000000001421450520414700325000ustar00rootroot00000000000000export const small = '12345678901234567890123456789012345678901234567890'; console.log('effect'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/000077500000000000000000000000001450520414700262435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_config.js000066400000000000000000000003421450520414700302040ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges unrelated small chunks if there is no better alternative', options: { input: ['main1.js', 'main2.js', 'main3.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/000077500000000000000000000000001450520414700302035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/amd/000077500000000000000000000000001450520414700307445ustar00rootroot00000000000000generated-small2.js000066400000000000000000000002371450520414700343530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small1 = '1'; const small2 = '1'; exports.small1 = small1; exports.small2 = small2; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/amd/main1.js000066400000000000000000000001651450520414700323110ustar00rootroot00000000000000define(['./generated-small2'], (function (small2) { 'use strict'; console.log(small2.small1, small2.small2); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/amd/main2.js000066400000000000000000000001461450520414700323110ustar00rootroot00000000000000define(['./generated-small2'], (function (small2) { 'use strict'; console.log(small2.small1); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/amd/main3.js000066400000000000000000000001461450520414700323120ustar00rootroot00000000000000define(['./generated-small2'], (function (small2) { 'use strict'; console.log(small2.small2); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/cjs/000077500000000000000000000000001450520414700307625ustar00rootroot00000000000000generated-small2.js000066400000000000000000000001531450520414700343660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/cjs'use strict'; const small1 = '1'; const small2 = '1'; exports.small1 = small1; exports.small2 = small2; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/cjs/main1.js000066400000000000000000000001521450520414700323230ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); console.log(small2.small1, small2.small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/cjs/main2.js000066400000000000000000000001331450520414700323230ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); console.log(small2.small1); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/cjs/main3.js000066400000000000000000000001331450520414700323240ustar00rootroot00000000000000'use strict'; var small2 = require('./generated-small2.js'); console.log(small2.small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/es/000077500000000000000000000000001450520414700306125ustar00rootroot00000000000000generated-small2.js000066400000000000000000000001171450520414700342160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/esconst small1 = '1'; const small2 = '1'; export { small2 as a, small1 as s }; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/es/main1.js000066400000000000000000000001401450520414700321500ustar00rootroot00000000000000import { s as small1, a as small2 } from './generated-small2.js'; console.log(small1, small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/es/main2.js000066400000000000000000000001131450520414700321510ustar00rootroot00000000000000import { s as small1 } from './generated-small2.js'; console.log(small1); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/es/main3.js000066400000000000000000000001131450520414700321520ustar00rootroot00000000000000import { a as small2 } from './generated-small2.js'; console.log(small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/system/000077500000000000000000000000001450520414700315275ustar00rootroot00000000000000generated-small2.js000066400000000000000000000002701450520414700351330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small1 = exports('s', '1'); const small2 = exports('a', '1'); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/system/main1.js000066400000000000000000000004041450520414700330700ustar00rootroot00000000000000System.register(['./generated-small2.js'], (function () { 'use strict'; var small1, small2; return { setters: [function (module) { small1 = module.s; small2 = module.a; }], execute: (function () { console.log(small1, small2); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/system/main2.js000066400000000000000000000003361450520414700330750ustar00rootroot00000000000000System.register(['./generated-small2.js'], (function () { 'use strict'; var small1; return { setters: [function (module) { small1 = module.s; }], execute: (function () { console.log(small1); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/_expected/system/main3.js000066400000000000000000000003361450520414700330760ustar00rootroot00000000000000System.register(['./generated-small2.js'], (function () { 'use strict'; var small2; return { setters: [function (module) { small2 = module.a; }], execute: (function () { console.log(small2); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/main1.js000066400000000000000000000001441450520414700276050ustar00rootroot00000000000000import { small1 } from './small1'; import { small2 } from './small2'; console.log(small1, small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/main2.js000066400000000000000000000000711450520414700276050ustar00rootroot00000000000000import { small1 } from './small1'; console.log(small1); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/main3.js000066400000000000000000000000711450520414700276060ustar00rootroot00000000000000import { small2 } from './small2'; console.log(small2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/small1.js000066400000000000000000000000331450520414700277660ustar00rootroot00000000000000export const small1 = '1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/merge-unrelated/small2.js000066400000000000000000000000331450520414700277670ustar00rootroot00000000000000export const small2 = '1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/000077500000000000000000000000001450520414700275105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_config.js000066400000000000000000000003351450520414700314530ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not merge chunks if all chunks are below the size limit', options: { input: ['main1.js', 'main2.js', 'main3.js'], output: { experimentalMinChunkSize: 1 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/000077500000000000000000000000001450520414700314505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/amd/000077500000000000000000000000001450520414700322115ustar00rootroot00000000000000generated-big.js000066400000000000000000000003111450520414700351600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; })); generated-small.js000066400000000000000000000001541450520414700355340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small = '1'; exports.small = small; })); main1.js000066400000000000000000000002031450520414700334700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/amddefine(['./generated-big', './generated-small'], (function (big, small) { 'use strict'; console.log(big.big, small.small); })); main2.js000066400000000000000000000002031450520414700334710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/amddefine(['./generated-big', './generated-small'], (function (big, small) { 'use strict'; console.log(big.big, small.small); })); main3.js000066400000000000000000000001321450520414700334730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/amddefine(['./generated-big'], (function (big) { 'use strict'; console.log(big.big); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/cjs/000077500000000000000000000000001450520414700322275ustar00rootroot00000000000000generated-big.js000066400000000000000000000002271450520414700352040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/cjs'use strict'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; generated-small.js000066400000000000000000000000721450520414700355510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/cjs'use strict'; const small = '1'; exports.small = small; main1.js000066400000000000000000000002111450520414700335050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/cjs'use strict'; var big = require('./generated-big.js'); var small = require('./generated-small.js'); console.log(big.big, small.small); main2.js000066400000000000000000000002111450520414700335060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/cjs'use strict'; var big = require('./generated-big.js'); var small = require('./generated-small.js'); console.log(big.big, small.small); main3.js000066400000000000000000000001171450520414700335140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/cjs'use strict'; var big = require('./generated-big.js'); console.log(big.big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/es/000077500000000000000000000000001450520414700320575ustar00rootroot00000000000000generated-big.js000066400000000000000000000002121450520414700350260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/esconst big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { big as b }; generated-small.js000066400000000000000000000000531450520414700354000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/esconst small = '1'; export { small as s }; main1.js000066400000000000000000000001741450520414700333450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/esimport { b as big } from './generated-big.js'; import { s as small } from './generated-small.js'; console.log(big, small); main2.js000066400000000000000000000001741450520414700333460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/esimport { b as big } from './generated-big.js'; import { s as small } from './generated-small.js'; console.log(big, small); main3.js000066400000000000000000000001021450520414700333360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/esimport { b as big } from './generated-big.js'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/system/000077500000000000000000000000001450520414700327745ustar00rootroot00000000000000generated-big.js000066400000000000000000000003621450520414700357510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const big = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); generated-small.js000066400000000000000000000002211450520414700363120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small = exports('s', '1'); }) }; })); main1.js000066400000000000000000000004461450520414700342640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/systemSystem.register(['./generated-big.js', './generated-small.js'], (function () { 'use strict'; var big, small; return { setters: [function (module) { big = module.b; }, function (module) { small = module.s; }], execute: (function () { console.log(big, small); }) }; })); main2.js000066400000000000000000000004461450520414700342650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/systemSystem.register(['./generated-big.js', './generated-small.js'], (function () { 'use strict'; var big, small; return { setters: [function (module) { big = module.b; }, function (module) { small = module.s; }], execute: (function () { console.log(big, small); }) }; })); main3.js000066400000000000000000000003221450520414700342570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/_expected/systemSystem.register(['./generated-big.js'], (function () { 'use strict'; var big; return { setters: [function (module) { big = module.b; }], execute: (function () { console.log(big); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/big.js000066400000000000000000000001731450520414700306100ustar00rootroot00000000000000export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/main1.js000066400000000000000000000001301450520414700310450ustar00rootroot00000000000000import { big } from './big'; import { small } from './small'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/main2.js000066400000000000000000000001301450520414700310460ustar00rootroot00000000000000import { big } from './big'; import { small } from './small'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/main3.js000066400000000000000000000000601450520414700310510ustar00rootroot00000000000000import { big } from './big'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-for-big-chunks/small.js000066400000000000000000000000321450520414700311510ustar00rootroot00000000000000export const small = '1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/000077500000000000000000000000001450520414700272335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_config.js000066400000000000000000000003251450520414700311750ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not merge small chunks that have side effects', options: { input: ['main1.js', 'main2.js', 'main3.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/000077500000000000000000000000001450520414700311735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/amd/000077500000000000000000000000001450520414700317345ustar00rootroot00000000000000generated-big.js000066400000000000000000000003111450520414700347030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; })); generated-small.js000066400000000000000000000002041450520414700352530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/amddefine(['exports'], (function (exports) { 'use strict'; console.log('effect'); const small = '1'; exports.small = small; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/amd/main1.js000066400000000000000000000002031450520414700332720ustar00rootroot00000000000000define(['./generated-big', './generated-small'], (function (big, small) { 'use strict'; console.log(big.big, small.small); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/amd/main2.js000066400000000000000000000002031450520414700332730ustar00rootroot00000000000000define(['./generated-big', './generated-small'], (function (big, small) { 'use strict'; console.log(big.big, small.small); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/amd/main3.js000066400000000000000000000001321450520414700332750ustar00rootroot00000000000000define(['./generated-big'], (function (big) { 'use strict'; console.log(big.big); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/cjs/000077500000000000000000000000001450520414700317525ustar00rootroot00000000000000generated-big.js000066400000000000000000000002271450520414700347270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/cjs'use strict'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; generated-small.js000066400000000000000000000001211450520414700352670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/cjs'use strict'; console.log('effect'); const small = '1'; exports.small = small; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/cjs/main1.js000066400000000000000000000002111450520414700333070ustar00rootroot00000000000000'use strict'; var big = require('./generated-big.js'); var small = require('./generated-small.js'); console.log(big.big, small.small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/cjs/main2.js000066400000000000000000000002111450520414700333100ustar00rootroot00000000000000'use strict'; var big = require('./generated-big.js'); var small = require('./generated-small.js'); console.log(big.big, small.small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/cjs/main3.js000066400000000000000000000001171450520414700333160ustar00rootroot00000000000000'use strict'; var big = require('./generated-big.js'); console.log(big.big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/es/000077500000000000000000000000001450520414700316025ustar00rootroot00000000000000generated-big.js000066400000000000000000000002121450520414700345510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/esconst big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { big as b }; generated-small.js000066400000000000000000000001021450520414700351160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/esconsole.log('effect'); const small = '1'; export { small as s }; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/es/main1.js000066400000000000000000000001741450520414700331470ustar00rootroot00000000000000import { b as big } from './generated-big.js'; import { s as small } from './generated-small.js'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/es/main2.js000066400000000000000000000001741450520414700331500ustar00rootroot00000000000000import { b as big } from './generated-big.js'; import { s as small } from './generated-small.js'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/es/main3.js000066400000000000000000000001021450520414700331400ustar00rootroot00000000000000import { b as big } from './generated-big.js'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/system/000077500000000000000000000000001450520414700325175ustar00rootroot00000000000000generated-big.js000066400000000000000000000003621450520414700354740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const big = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); generated-small.js000066400000000000000000000002531450520414700360420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('effect'); const small = exports('s', '1'); }) }; })); main1.js000066400000000000000000000004461450520414700340070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/systemSystem.register(['./generated-big.js', './generated-small.js'], (function () { 'use strict'; var big, small; return { setters: [function (module) { big = module.b; }, function (module) { small = module.s; }], execute: (function () { console.log(big, small); }) }; })); main2.js000066400000000000000000000004461450520414700340100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/systemSystem.register(['./generated-big.js', './generated-small.js'], (function () { 'use strict'; var big, small; return { setters: [function (module) { big = module.b; }, function (module) { small = module.s; }], execute: (function () { console.log(big, small); }) }; })); main3.js000066400000000000000000000003221450520414700340020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/_expected/systemSystem.register(['./generated-big.js'], (function () { 'use strict'; var big; return { setters: [function (module) { big = module.b; }], execute: (function () { console.log(big); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/big.js000066400000000000000000000001731450520414700303330ustar00rootroot00000000000000export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/main1.js000066400000000000000000000001301450520414700305700ustar00rootroot00000000000000import { big } from './big'; import { small } from './small'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/main2.js000066400000000000000000000001301450520414700305710ustar00rootroot00000000000000import { big } from './big'; import { small } from './small'; console.log(big, small); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/main3.js000066400000000000000000000000601450520414700305740ustar00rootroot00000000000000import { big } from './big'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/no-merge-side-effects/small.js000066400000000000000000000000611450520414700306760ustar00rootroot00000000000000console.log('effect'); export const small = '1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/000077500000000000000000000000001450520414700303505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_config.js000066400000000000000000000004321450520414700323110ustar00rootroot00000000000000module.exports = defineTest({ description: 'when there are two valid merge targets, the one that is loaded under more similar conditions is preferred', options: { input: ['main1.js', 'main2.js', 'main3.js', 'main4.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/000077500000000000000000000000001450520414700323105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/amd/000077500000000000000000000000001450520414700330515ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000003731450520414700364600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small = '0'; const big1 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big1 = big1; exports.small = small; })); generated-chunk2.js000066400000000000000000000003161450520414700364560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const big2 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big2 = big2; })); main1.js000066400000000000000000000002351450520414700343350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/amddefine(['./generated-chunk1', './generated-chunk2'], (function (chunk1, chunk2) { 'use strict'; console.log(chunk1.small, chunk1.big1, chunk2.big2); })); main2.js000066400000000000000000000002351450520414700343360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/amddefine(['./generated-chunk1', './generated-chunk2'], (function (chunk1, chunk2) { 'use strict'; console.log(chunk1.small, chunk1.big1, chunk2.big2); })); main3.js000066400000000000000000000002171450520414700343370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/amddefine(['./generated-chunk1', './generated-chunk2'], (function (chunk1, chunk2) { 'use strict'; console.log(chunk1.big1, chunk2.big2); })); main4.js000066400000000000000000000001441450520414700343370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/amddefine(['./generated-chunk2'], (function (chunk2) { 'use strict'; console.log(chunk2.big2); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/cjs/000077500000000000000000000000001450520414700330675ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000003061450520414700364720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/cjs'use strict'; const small = '0'; const big1 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big1 = big1; exports.small = small; generated-chunk2.js000066400000000000000000000002331450520414700364720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/cjs'use strict'; const big2 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big2 = big2; main1.js000066400000000000000000000002431450520414700343520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/cjs'use strict'; var chunk1 = require('./generated-chunk1.js'); var chunk2 = require('./generated-chunk2.js'); console.log(chunk1.small, chunk1.big1, chunk2.big2); main2.js000066400000000000000000000002431450520414700343530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/cjs'use strict'; var chunk1 = require('./generated-chunk1.js'); var chunk2 = require('./generated-chunk2.js'); console.log(chunk1.small, chunk1.big1, chunk2.big2); main3.js000066400000000000000000000002251450520414700343540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/cjs'use strict'; var chunk1 = require('./generated-chunk1.js'); var chunk2 = require('./generated-chunk2.js'); console.log(chunk1.big1, chunk2.big2); main4.js000066400000000000000000000001311450520414700343510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/cjs'use strict'; var chunk2 = require('./generated-chunk2.js'); console.log(chunk2.big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/es/000077500000000000000000000000001450520414700327175ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000002551450520414700363250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/esconst small = '0'; const big1 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { big1 as b, small as s }; generated-chunk2.js000066400000000000000000000002151450520414700363220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/esconst big2 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { big2 as b }; main1.js000066400000000000000000000002231450520414700342000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/esimport { s as small, b as big1 } from './generated-chunk1.js'; import { b as big2 } from './generated-chunk2.js'; console.log(small, big1, big2); main2.js000066400000000000000000000002231450520414700342010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/esimport { s as small, b as big1 } from './generated-chunk1.js'; import { b as big2 } from './generated-chunk2.js'; console.log(small, big1, big2); main3.js000066400000000000000000000002001450520414700341750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/esimport { b as big1 } from './generated-chunk1.js'; import { b as big2 } from './generated-chunk2.js'; console.log(big1, big2); main4.js000066400000000000000000000001071450520414700342040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/esimport { b as big2 } from './generated-chunk2.js'; console.log(big2); system/000077500000000000000000000000001450520414700335555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expectedgenerated-chunk1.js000066400000000000000000000004341450520414700372410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small = exports('s', '0'); const big1 = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); generated-chunk2.js000066400000000000000000000003671450520414700372470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const big2 = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); main1.js000066400000000000000000000005151450520414700351210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/systemSystem.register(['./generated-chunk1.js', './generated-chunk2.js'], (function () { 'use strict'; var small, big1, big2; return { setters: [function (module) { small = module.s; big1 = module.b; }, function (module) { big2 = module.b; }], execute: (function () { console.log(small, big1, big2); }) }; })); main2.js000066400000000000000000000005151450520414700351220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/systemSystem.register(['./generated-chunk1.js', './generated-chunk2.js'], (function () { 'use strict'; var small, big1, big2; return { setters: [function (module) { small = module.s; big1 = module.b; }, function (module) { big2 = module.b; }], execute: (function () { console.log(small, big1, big2); }) }; })); main3.js000066400000000000000000000004521450520414700351230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/systemSystem.register(['./generated-chunk1.js', './generated-chunk2.js'], (function () { 'use strict'; var big1, big2; return { setters: [function (module) { big1 = module.b; }, function (module) { big2 = module.b; }], execute: (function () { console.log(big1, big2); }) }; })); main4.js000066400000000000000000000003301450520414700351170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/_expected/systemSystem.register(['./generated-chunk2.js'], (function () { 'use strict'; var big2; return { setters: [function (module) { big2 = module.b; }], execute: (function () { console.log(big2); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/chunk1.js000066400000000000000000000001751450520414700321020ustar00rootroot00000000000000export const big1 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/chunk2.js000066400000000000000000000001751450520414700321030ustar00rootroot00000000000000export const big2 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/main1.js000066400000000000000000000002041450520414700317070ustar00rootroot00000000000000import { small } from './small'; import { big1 } from './chunk1'; import { big2 } from './chunk2'; console.log(small, big1, big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/main2.js000066400000000000000000000002041450520414700317100ustar00rootroot00000000000000import { small } from './small'; import { big1 } from './chunk1'; import { big2 } from './chunk2'; console.log(small, big1, big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/main3.js000066400000000000000000000001341450520414700317130ustar00rootroot00000000000000import { big1 } from './chunk1'; import { big2 } from './chunk2'; console.log(big1, big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/main4.js000066400000000000000000000000651450520414700317170ustar00rootroot00000000000000import { big2 } from './chunk2'; console.log(big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-a/small.js000066400000000000000000000000321450520414700320110ustar00rootroot00000000000000export const small = '0'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/000077500000000000000000000000001450520414700303515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_config.js000066400000000000000000000004321450520414700323120ustar00rootroot00000000000000module.exports = defineTest({ description: 'when there are two valid merge targets, the one that is loaded under more similar conditions is preferred', options: { input: ['main1.js', 'main2.js', 'main3.js', 'main4.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/000077500000000000000000000000001450520414700323115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/amd/000077500000000000000000000000001450520414700330525ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000003731450520414700364610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small = '0'; const big1 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big1 = big1; exports.small = small; })); generated-chunk2.js000066400000000000000000000003161450520414700364570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const big2 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big2 = big2; })); main1.js000066400000000000000000000002351450520414700343360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/amddefine(['./generated-chunk1', './generated-chunk2'], (function (chunk1, chunk2) { 'use strict'; console.log(chunk1.small, chunk1.big1, chunk2.big2); })); main2.js000066400000000000000000000002351450520414700343370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/amddefine(['./generated-chunk1', './generated-chunk2'], (function (chunk1, chunk2) { 'use strict'; console.log(chunk1.small, chunk1.big1, chunk2.big2); })); main3.js000066400000000000000000000002171450520414700343400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/amddefine(['./generated-chunk2', './generated-chunk1'], (function (chunk2, chunk1) { 'use strict'; console.log(chunk1.big1, chunk2.big2); })); main4.js000066400000000000000000000001441450520414700343400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/amddefine(['./generated-chunk2'], (function (chunk2) { 'use strict'; console.log(chunk2.big2); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/cjs/000077500000000000000000000000001450520414700330705ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000003061450520414700364730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/cjs'use strict'; const small = '0'; const big1 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big1 = big1; exports.small = small; generated-chunk2.js000066400000000000000000000002331450520414700364730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/cjs'use strict'; const big2 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big2 = big2; main1.js000066400000000000000000000002431450520414700343530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/cjs'use strict'; var chunk1 = require('./generated-chunk1.js'); var chunk2 = require('./generated-chunk2.js'); console.log(chunk1.small, chunk1.big1, chunk2.big2); main2.js000066400000000000000000000002431450520414700343540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/cjs'use strict'; var chunk1 = require('./generated-chunk1.js'); var chunk2 = require('./generated-chunk2.js'); console.log(chunk1.small, chunk1.big1, chunk2.big2); main3.js000066400000000000000000000002251450520414700343550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/cjs'use strict'; var chunk2 = require('./generated-chunk2.js'); var chunk1 = require('./generated-chunk1.js'); console.log(chunk1.big1, chunk2.big2); main4.js000066400000000000000000000001311450520414700343520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/cjs'use strict'; var chunk2 = require('./generated-chunk2.js'); console.log(chunk2.big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/es/000077500000000000000000000000001450520414700327205ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000002551450520414700363260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/esconst small = '0'; const big1 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { big1 as b, small as s }; generated-chunk2.js000066400000000000000000000002151450520414700363230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/esconst big2 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { big2 as b }; main1.js000066400000000000000000000002231450520414700342010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/esimport { s as small, b as big1 } from './generated-chunk1.js'; import { b as big2 } from './generated-chunk2.js'; console.log(small, big1, big2); main2.js000066400000000000000000000002231450520414700342020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/esimport { s as small, b as big1 } from './generated-chunk1.js'; import { b as big2 } from './generated-chunk2.js'; console.log(small, big1, big2); main3.js000066400000000000000000000002001450520414700341760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/esimport { b as big2 } from './generated-chunk2.js'; import { b as big1 } from './generated-chunk1.js'; console.log(big1, big2); main4.js000066400000000000000000000001071450520414700342050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/esimport { b as big2 } from './generated-chunk2.js'; console.log(big2); system/000077500000000000000000000000001450520414700335565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expectedgenerated-chunk1.js000066400000000000000000000004341450520414700372420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small = exports('s', '0'); const big1 = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); generated-chunk2.js000066400000000000000000000003671450520414700372500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const big2 = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); main1.js000066400000000000000000000005151450520414700351220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/systemSystem.register(['./generated-chunk1.js', './generated-chunk2.js'], (function () { 'use strict'; var small, big1, big2; return { setters: [function (module) { small = module.s; big1 = module.b; }, function (module) { big2 = module.b; }], execute: (function () { console.log(small, big1, big2); }) }; })); main2.js000066400000000000000000000005151450520414700351230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/systemSystem.register(['./generated-chunk1.js', './generated-chunk2.js'], (function () { 'use strict'; var small, big1, big2; return { setters: [function (module) { small = module.s; big1 = module.b; }, function (module) { big2 = module.b; }], execute: (function () { console.log(small, big1, big2); }) }; })); main3.js000066400000000000000000000004521450520414700351240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/systemSystem.register(['./generated-chunk2.js', './generated-chunk1.js'], (function () { 'use strict'; var big2, big1; return { setters: [function (module) { big2 = module.b; }, function (module) { big1 = module.b; }], execute: (function () { console.log(big1, big2); }) }; })); main4.js000066400000000000000000000003301450520414700351200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/_expected/systemSystem.register(['./generated-chunk2.js'], (function () { 'use strict'; var big2; return { setters: [function (module) { big2 = module.b; }], execute: (function () { console.log(big2); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/chunk1.js000066400000000000000000000001751450520414700321030ustar00rootroot00000000000000export const big1 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/chunk2.js000066400000000000000000000001751450520414700321040ustar00rootroot00000000000000export const big2 = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/main1.js000066400000000000000000000002041450520414700317100ustar00rootroot00000000000000import { small } from './small'; import { big2 } from './chunk2'; import { big1 } from './chunk1'; console.log(small, big1, big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/main2.js000066400000000000000000000002041450520414700317110ustar00rootroot00000000000000import { small } from './small'; import { big2 } from './chunk2'; import { big1 } from './chunk1'; console.log(small, big1, big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/main3.js000066400000000000000000000001341450520414700317140ustar00rootroot00000000000000import { big2 } from './chunk2'; import { big1 } from './chunk1'; console.log(big1, big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/main4.js000066400000000000000000000000651450520414700317200ustar00rootroot00000000000000import { big2 } from './chunk2'; console.log(big2); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-close-merge-target-b/small.js000066400000000000000000000000321450520414700320120ustar00rootroot00000000000000export const small = '0'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/000077500000000000000000000000001450520414700303535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_config.js000066400000000000000000000003671450520414700323230ustar00rootroot00000000000000module.exports = defineTest({ description: 'when there are two equally valid merge targets, the smaller is preferred', options: { input: ['main1.js', 'main2.js', 'main3.js', 'main4.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/000077500000000000000000000000001450520414700323135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/amd/000077500000000000000000000000001450520414700330545ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000003701450520414700364600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small = '0'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; exports.small = small; })); generated-chunk2.js000066400000000000000000000004621450520414700364630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const huge = '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.huge = huge; })); main1.js000066400000000000000000000002341450520414700343370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/amddefine(['./generated-chunk1', './generated-chunk2'], (function (chunk1, chunk2) { 'use strict'; console.log(chunk1.small, chunk1.big, chunk2.huge); })); main2.js000066400000000000000000000002341450520414700343400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/amddefine(['./generated-chunk1', './generated-chunk2'], (function (chunk1, chunk2) { 'use strict'; console.log(chunk1.small, chunk1.big, chunk2.huge); })); main3.js000066400000000000000000000001431450520414700343400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/amddefine(['./generated-chunk1'], (function (chunk1) { 'use strict'; console.log(chunk1.big); })); main4.js000066400000000000000000000001441450520414700343420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/amddefine(['./generated-chunk2'], (function (chunk2) { 'use strict'; console.log(chunk2.huge); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/cjs/000077500000000000000000000000001450520414700330725ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000003031450520414700364720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/cjs'use strict'; const small = '0'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; exports.small = small; generated-chunk2.js000066400000000000000000000003771450520414700365060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/cjs'use strict'; const huge = '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.huge = huge; main1.js000066400000000000000000000002421450520414700343540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/cjs'use strict'; var chunk1 = require('./generated-chunk1.js'); var chunk2 = require('./generated-chunk2.js'); console.log(chunk1.small, chunk1.big, chunk2.huge); main2.js000066400000000000000000000002421450520414700343550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/cjs'use strict'; var chunk1 = require('./generated-chunk1.js'); var chunk2 = require('./generated-chunk2.js'); console.log(chunk1.small, chunk1.big, chunk2.huge); main3.js000066400000000000000000000001301450520414700343520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/cjs'use strict'; var chunk1 = require('./generated-chunk1.js'); console.log(chunk1.big); main4.js000066400000000000000000000001311450520414700343540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/cjs'use strict'; var chunk2 = require('./generated-chunk2.js'); console.log(chunk2.huge); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/es/000077500000000000000000000000001450520414700327225ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000002531450520414700363260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/esconst small = '0'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { big as b, small as s }; generated-chunk2.js000066400000000000000000000003611450520414700363270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/esconst huge = '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { huge as h }; main1.js000066400000000000000000000002211450520414700342010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/esimport { s as small, b as big } from './generated-chunk1.js'; import { h as huge } from './generated-chunk2.js'; console.log(small, big, huge); main2.js000066400000000000000000000002211450520414700342020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/esimport { s as small, b as big } from './generated-chunk1.js'; import { h as huge } from './generated-chunk2.js'; console.log(small, big, huge); main3.js000066400000000000000000000001051450520414700342040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/esimport { b as big } from './generated-chunk1.js'; console.log(big); main4.js000066400000000000000000000001071450520414700342070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/esimport { h as huge } from './generated-chunk2.js'; console.log(huge); system/000077500000000000000000000000001450520414700335605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expectedgenerated-chunk1.js000066400000000000000000000004331450520414700372430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small = exports('s', '0'); const big = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); generated-chunk2.js000066400000000000000000000005331450520414700372450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const huge = exports('h', '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); main1.js000066400000000000000000000005121450520414700351210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/systemSystem.register(['./generated-chunk1.js', './generated-chunk2.js'], (function () { 'use strict'; var small, big, huge; return { setters: [function (module) { small = module.s; big = module.b; }, function (module) { huge = module.h; }], execute: (function () { console.log(small, big, huge); }) }; })); main2.js000066400000000000000000000005121450520414700351220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/systemSystem.register(['./generated-chunk1.js', './generated-chunk2.js'], (function () { 'use strict'; var small, big, huge; return { setters: [function (module) { small = module.s; big = module.b; }, function (module) { huge = module.h; }], execute: (function () { console.log(small, big, huge); }) }; })); main3.js000066400000000000000000000003251450520414700351250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/systemSystem.register(['./generated-chunk1.js'], (function () { 'use strict'; var big; return { setters: [function (module) { big = module.b; }], execute: (function () { console.log(big); }) }; })); main4.js000066400000000000000000000003301450520414700351220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/_expected/systemSystem.register(['./generated-chunk2.js'], (function () { 'use strict'; var huge; return { setters: [function (module) { huge = module.h; }], execute: (function () { console.log(huge); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/chunk1.js000066400000000000000000000001741450520414700321040ustar00rootroot00000000000000export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/chunk2.js000066400000000000000000000003411450520414700321010ustar00rootroot00000000000000export const huge = '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/main1.js000066400000000000000000000002021450520414700317100ustar00rootroot00000000000000import { small } from './small'; import { big } from './chunk1'; import { huge } from './chunk2'; console.log(small, big, huge); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/main2.js000066400000000000000000000002021450520414700317110ustar00rootroot00000000000000import { small } from './small'; import { big } from './chunk1'; import { huge } from './chunk2'; console.log(small, big, huge); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/main3.js000066400000000000000000000000631450520414700317170ustar00rootroot00000000000000import { big } from './chunk1'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/main4.js000066400000000000000000000000651450520414700317220ustar00rootroot00000000000000import { huge } from './chunk2'; console.log(huge); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-a/small.js000066400000000000000000000000321450520414700320140ustar00rootroot00000000000000export const small = '0'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/000077500000000000000000000000001450520414700303545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_config.js000066400000000000000000000003671450520414700323240ustar00rootroot00000000000000module.exports = defineTest({ description: 'when there are two equally valid merge targets, the smaller is preferred', options: { input: ['main1.js', 'main2.js', 'main3.js', 'main4.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/000077500000000000000000000000001450520414700323145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/amd/000077500000000000000000000000001450520414700330555ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000004621450520414700364630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const huge = '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.huge = huge; })); generated-chunk2.js000066400000000000000000000003701450520414700364620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const small = '0'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; exports.small = small; })); main1.js000066400000000000000000000002341450520414700343400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/amddefine(['./generated-chunk2', './generated-chunk1'], (function (chunk2, chunk1) { 'use strict'; console.log(chunk2.small, chunk2.big, chunk1.huge); })); main2.js000066400000000000000000000002341450520414700343410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/amddefine(['./generated-chunk2', './generated-chunk1'], (function (chunk2, chunk1) { 'use strict'; console.log(chunk2.small, chunk2.big, chunk1.huge); })); main3.js000066400000000000000000000001441450520414700343420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/amddefine(['./generated-chunk1'], (function (chunk1) { 'use strict'; console.log(chunk1.huge); })); main4.js000066400000000000000000000001431450520414700343420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/amddefine(['./generated-chunk2'], (function (chunk2) { 'use strict'; console.log(chunk2.big); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/cjs/000077500000000000000000000000001450520414700330735ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000003771450520414700365060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/cjs'use strict'; const huge = '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.huge = huge; generated-chunk2.js000066400000000000000000000003031450520414700364740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/cjs'use strict'; const small = '0'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; exports.big = big; exports.small = small; main1.js000066400000000000000000000002421450520414700343550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/cjs'use strict'; var chunk2 = require('./generated-chunk2.js'); var chunk1 = require('./generated-chunk1.js'); console.log(chunk2.small, chunk2.big, chunk1.huge); main2.js000066400000000000000000000002421450520414700343560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/cjs'use strict'; var chunk2 = require('./generated-chunk2.js'); var chunk1 = require('./generated-chunk1.js'); console.log(chunk2.small, chunk2.big, chunk1.huge); main3.js000066400000000000000000000001311450520414700343540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/cjs'use strict'; var chunk1 = require('./generated-chunk1.js'); console.log(chunk1.huge); main4.js000066400000000000000000000001301450520414700343540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/cjs'use strict'; var chunk2 = require('./generated-chunk2.js'); console.log(chunk2.big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/es/000077500000000000000000000000001450520414700327235ustar00rootroot00000000000000generated-chunk1.js000066400000000000000000000003611450520414700363270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/esconst huge = '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { huge as h }; generated-chunk2.js000066400000000000000000000002531450520414700363300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/esconst small = '0'; const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; export { big as b, small as s }; main1.js000066400000000000000000000002211450520414700342020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/esimport { s as small, b as big } from './generated-chunk2.js'; import { h as huge } from './generated-chunk1.js'; console.log(small, big, huge); main2.js000066400000000000000000000002211450520414700342030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/esimport { s as small, b as big } from './generated-chunk2.js'; import { h as huge } from './generated-chunk1.js'; console.log(small, big, huge); main3.js000066400000000000000000000001071450520414700342070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/esimport { h as huge } from './generated-chunk1.js'; console.log(huge); main4.js000066400000000000000000000001051450520414700342060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/esimport { b as big } from './generated-chunk2.js'; console.log(big); system/000077500000000000000000000000001450520414700335615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expectedgenerated-chunk1.js000066400000000000000000000005331450520414700372450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const huge = exports('h', '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); generated-chunk2.js000066400000000000000000000004331450520414700372450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const small = exports('s', '0'); const big = exports('b', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); }) }; })); main1.js000066400000000000000000000005121450520414700351220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/systemSystem.register(['./generated-chunk2.js', './generated-chunk1.js'], (function () { 'use strict'; var small, big, huge; return { setters: [function (module) { small = module.s; big = module.b; }, function (module) { huge = module.h; }], execute: (function () { console.log(small, big, huge); }) }; })); main2.js000066400000000000000000000005121450520414700351230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/systemSystem.register(['./generated-chunk2.js', './generated-chunk1.js'], (function () { 'use strict'; var small, big, huge; return { setters: [function (module) { small = module.s; big = module.b; }, function (module) { huge = module.h; }], execute: (function () { console.log(small, big, huge); }) }; })); main3.js000066400000000000000000000003301450520414700351220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/systemSystem.register(['./generated-chunk1.js'], (function () { 'use strict'; var huge; return { setters: [function (module) { huge = module.h; }], execute: (function () { console.log(huge); }) }; })); main4.js000066400000000000000000000003251450520414700351270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/_expected/systemSystem.register(['./generated-chunk2.js'], (function () { 'use strict'; var big; return { setters: [function (module) { big = module.b; }], execute: (function () { console.log(big); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/chunk1.js000066400000000000000000000003411450520414700321010ustar00rootroot00000000000000export const huge = '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/chunk2.js000066400000000000000000000001741450520414700321060ustar00rootroot00000000000000export const big = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/main1.js000066400000000000000000000002021450520414700317110ustar00rootroot00000000000000import { small } from './small'; import { huge } from './chunk1'; import { big } from './chunk2'; console.log(small, big, huge); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/main2.js000066400000000000000000000002021450520414700317120ustar00rootroot00000000000000import { small } from './small'; import { huge } from './chunk1'; import { big } from './chunk2'; console.log(small, big, huge); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/main3.js000066400000000000000000000000651450520414700317220ustar00rootroot00000000000000import { huge } from './chunk1'; console.log(huge); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/main4.js000066400000000000000000000000631450520414700317210ustar00rootroot00000000000000import { big } from './chunk2'; console.log(big); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/prefer-small-merge-target-b/small.js000066400000000000000000000000321450520414700320150ustar00rootroot00000000000000export const small = '0'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/000077500000000000000000000000001450520414700275245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_config.js000066400000000000000000000003461450520414700314710ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks external imports as side effects', options: { input: ['main1.js', 'main2.js'], external: ['external1', 'external2'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/000077500000000000000000000000001450520414700314645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/amd/000077500000000000000000000000001450520414700322255ustar00rootroot00000000000000generated-shared.js000066400000000000000000000001031450520414700357000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/amddefine((function () { 'use strict'; console.log('shared'); })); main1.js000066400000000000000000000003461450520414700335140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/amddefine(['exports', 'external1', './generated-shared'], (function (exports, external1, shared) { 'use strict'; Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external1.foo; } }); })); main2.js000066400000000000000000000003461450520414700335150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/amddefine(['exports', 'external2', './generated-shared'], (function (exports, external2, shared) { 'use strict'; Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external2.foo; } }); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/cjs/000077500000000000000000000000001450520414700322435ustar00rootroot00000000000000generated-shared.js000066400000000000000000000000461450520414700357240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/cjs'use strict'; console.log('shared'); main1.js000066400000000000000000000003051450520414700335250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/cjs'use strict'; var external1 = require('external1'); require('./generated-shared.js'); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external1.foo; } }); main2.js000066400000000000000000000003051450520414700335260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/cjs'use strict'; var external2 = require('external2'); require('./generated-shared.js'); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external2.foo; } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/es/000077500000000000000000000000001450520414700320735ustar00rootroot00000000000000generated-shared.js000066400000000000000000000000271450520414700355530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/esconsole.log('shared'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/es/main1.js000066400000000000000000000001011450520414700334260ustar00rootroot00000000000000export { foo } from 'external1'; import './generated-shared.js'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/es/main2.js000066400000000000000000000001011450520414700334270ustar00rootroot00000000000000export { foo } from 'external2'; import './generated-shared.js'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/system/000077500000000000000000000000001450520414700330105ustar00rootroot00000000000000generated-shared.js000066400000000000000000000002001450520414700364610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('shared'); }) }; })); main1.js000066400000000000000000000003351450520414700342750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/systemSystem.register(['external1', './generated-shared.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.foo); }, null], execute: (function () { }) }; })); main2.js000066400000000000000000000003351450520414700342760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/_expected/systemSystem.register(['external2', './generated-shared.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.foo); }, null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/main1.js000066400000000000000000000000641450520414700310670ustar00rootroot00000000000000export { foo } from 'external1'; import './shared'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/main2.js000066400000000000000000000000641450520414700310700ustar00rootroot00000000000000export { foo } from 'external2'; import './shared'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects/shared.js000066400000000000000000000000271450520414700313270ustar00rootroot00000000000000console.log('shared'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/000077500000000000000000000000001450520414700276065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_config.js000066400000000000000000000005201450520414700315450ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not tracks external imports as side effects if they are marked as side effect free', options: { input: ['main1.js', 'main2.js'], external: ['external1', 'external2'], treeshake: { moduleSideEffects: 'no-external' }, output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/000077500000000000000000000000001450520414700315465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/amd/000077500000000000000000000000001450520414700323075ustar00rootroot00000000000000main1.js000066400000000000000000000003671450520414700336010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/amddefine(['exports', 'external1', 'external2'], (function (exports, external1, external2) { 'use strict'; console.log('shared'); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external1.foo; } }); })); main2.js000066400000000000000000000003621450520414700335750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/amddefine(['exports', 'external2', './main1', 'external1'], (function (exports, external2, main1, external1) { 'use strict'; Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external2.foo; } }); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/cjs/000077500000000000000000000000001450520414700323255ustar00rootroot00000000000000main1.js000066400000000000000000000003171450520414700336120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/cjs'use strict'; var external1 = require('external1'); require('external2'); console.log('shared'); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external1.foo; } }); main2.js000066400000000000000000000003201450520414700336050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/cjs'use strict'; var external2 = require('external2'); require('./main1.js'); require('external1'); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external2.foo; } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/es/000077500000000000000000000000001450520414700321555ustar00rootroot00000000000000main1.js000066400000000000000000000001151450520414700334360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/esexport { foo } from 'external1'; import 'external2'; console.log('shared'); main2.js000066400000000000000000000001121450520414700334340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/esexport { foo } from 'external2'; import './main1.js'; import 'external1'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/system/000077500000000000000000000000001450520414700330725ustar00rootroot00000000000000main1.js000066400000000000000000000003521450520414700343560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/systemSystem.register(['external1', 'external2'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.foo); }, null], execute: (function () { console.log('shared'); }) }; })); main2.js000066400000000000000000000003451450520414700343610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/_expected/systemSystem.register(['external2', './main1.js', 'external1'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.foo); }, null, null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/main1.js000066400000000000000000000000641450520414700311510ustar00rootroot00000000000000export { foo } from 'external1'; import './shared'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/main2.js000066400000000000000000000000641450520414700311520ustar00rootroot00000000000000export { foo } from 'external2'; import './shared'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/track-external-effects2/shared.js000066400000000000000000000000271450520414700314110ustar00rootroot00000000000000console.log('shared'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/000077500000000000000000000000001450520414700255445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_config.js000066400000000000000000000003251450520414700275060ustar00rootroot00000000000000module.exports = defineTest({ description: 'takes tree-shaking into account and ignores top-level comments', options: { input: ['main1.js', 'main2.js'], output: { experimentalMinChunkSize: 100 } } }); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/000077500000000000000000000000001450520414700275045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/amd/000077500000000000000000000000001450520414700302455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/amd/main1.js000066400000000000000000000002131450520414700316040ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('shared'); const main = 'main'; exports.main = main; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/amd/main2.js000066400000000000000000000001241450520414700316060ustar00rootroot00000000000000define(['./main1'], (function (main1) { 'use strict'; console.log('other'); })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/cjs/000077500000000000000000000000001450520414700302635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/cjs/main1.js000066400000000000000000000001221450520414700316210ustar00rootroot00000000000000'use strict'; console.log('shared'); const main = 'main'; exports.main = main; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/cjs/main2.js000066400000000000000000000000751450520414700316310ustar00rootroot00000000000000'use strict'; require('./main1.js'); console.log('other'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/es/000077500000000000000000000000001450520414700301135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/es/main1.js000066400000000000000000000000771450520414700314620ustar00rootroot00000000000000console.log('shared'); const main = 'main'; export { main }; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/es/main2.js000066400000000000000000000000541450520414700314560ustar00rootroot00000000000000import './main1.js'; console.log('other'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/system/000077500000000000000000000000001450520414700310305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/system/main1.js000066400000000000000000000003131450520414700323700ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('shared'); const main = exports('main', 'main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/_expected/system/main2.js000066400000000000000000000002361450520414700323750ustar00rootroot00000000000000System.register(['./main1.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('other'); }) }; })); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/main1.js000066400000000000000000000002221450520414700271030ustar00rootroot00000000000000export const main = 'main'; /* a very long comment exceeding 100 characters -------------------------------------------- */ import './shared'; rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/main2.js000066400000000000000000000000511450520414700271040ustar00rootroot00000000000000import './shared'; console.log('other'); rollup-3.29.4/test/chunking-form/samples/min-chunk-size/tree-shaking/shared.js000066400000000000000000000002621450520414700273500ustar00rootroot00000000000000console.log('shared'); /* a very long comment exceeding 100 characters -------------------------------------------- */ export const unused = 'also very long and very unused'; rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/000077500000000000000000000000001450520414700251315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_config.js000066400000000000000000000003111450520414700270660ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to force the minification of internal exports', options: { input: ['main1.js', 'main2.js'], output: { minifyInternalExports: true } } }); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/000077500000000000000000000000001450520414700270715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/amd/000077500000000000000000000000001450520414700276325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/amd/generated-shared2.js000066400000000000000000000003651450520414700334600ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const shared1 = 'shared1'; const foo$1 = 'foo1'; var shared2 = 'shared2'; const foo = 'foo2'; exports.a = shared2; exports.b = foo; exports.f = foo$1; exports.s = shared1; })); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/amd/main1.js000066400000000000000000000001721450520414700311750ustar00rootroot00000000000000define(['./generated-shared2'], (function (shared2) { 'use strict'; console.log(shared2.s, shared2.a, shared2.f); })); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/amd/main2.js000066400000000000000000000001721450520414700311760ustar00rootroot00000000000000define(['./generated-shared2'], (function (shared2) { 'use strict'; console.log(shared2.s, shared2.a, shared2.b); })); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/cjs/000077500000000000000000000000001450520414700276505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/cjs/generated-shared2.js000066400000000000000000000002751450520414700334760ustar00rootroot00000000000000'use strict'; const shared1 = 'shared1'; const foo$1 = 'foo1'; var shared2 = 'shared2'; const foo = 'foo2'; exports.a = shared2; exports.b = foo; exports.f = foo$1; exports.s = shared1; rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/cjs/main1.js000066400000000000000000000001571450520414700312160ustar00rootroot00000000000000'use strict'; var shared2 = require('./generated-shared2.js'); console.log(shared2.s, shared2.a, shared2.f); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/cjs/main2.js000066400000000000000000000001571450520414700312170ustar00rootroot00000000000000'use strict'; var shared2 = require('./generated-shared2.js'); console.log(shared2.s, shared2.a, shared2.b); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/es/000077500000000000000000000000001450520414700275005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/es/generated-shared2.js000066400000000000000000000002351450520414700333220ustar00rootroot00000000000000const shared1 = 'shared1'; const foo$1 = 'foo1'; var shared2 = 'shared2'; const foo = 'foo2'; export { shared2 as a, foo as b, foo$1 as f, shared1 as s }; rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/es/main1.js000066400000000000000000000001641450520414700310440ustar00rootroot00000000000000import { s as shared1, a as shared2, f as foo } from './generated-shared2.js'; console.log(shared1, shared2, foo); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/es/main2.js000066400000000000000000000001641450520414700310450ustar00rootroot00000000000000import { s as shared1, a as shared2, b as foo } from './generated-shared2.js'; console.log(shared1, shared2, foo); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/system/000077500000000000000000000000001450520414700304155ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000004201450520414700341540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const shared1 = exports('s', 'shared1'); const foo$1 = exports('f', 'foo1'); var shared2 = exports('a', 'shared2'); const foo = exports('b', 'foo2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/system/main1.js000066400000000000000000000004501450520414700317570ustar00rootroot00000000000000System.register(['./generated-shared2.js'], (function () { 'use strict'; var shared1, shared2, foo; return { setters: [function (module) { shared1 = module.s; shared2 = module.a; foo = module.f; }], execute: (function () { console.log(shared1, shared2, foo); }) }; })); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/_expected/system/main2.js000066400000000000000000000004501450520414700317600ustar00rootroot00000000000000System.register(['./generated-shared2.js'], (function () { 'use strict'; var shared1, shared2, foo; return { setters: [function (module) { shared1 = module.s; shared2 = module.a; foo = module.b; }], execute: (function () { console.log(shared1, shared2, foo); }) }; })); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/main1.js000066400000000000000000000001601450520414700264710ustar00rootroot00000000000000import { shared1, foo } from './shared1'; import shared2 from './shared2'; console.log(shared1, shared2, foo); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/main2.js000066400000000000000000000001641450520414700264760ustar00rootroot00000000000000import { shared1 } from './shared1'; import shared2, { foo } from './shared2'; console.log(shared1, shared2, foo); rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/shared1.js000066400000000000000000000000751450520414700270200ustar00rootroot00000000000000export const shared1 = 'shared1'; export const foo = 'foo1'; rollup-3.29.4/test/chunking-form/samples/minify-internal-exports/shared2.js000066400000000000000000000000651450520414700270200ustar00rootroot00000000000000export default 'shared2'; export const foo = 'foo2'; rollup-3.29.4/test/chunking-form/samples/missing-export-compact/000077500000000000000000000000001450520414700247365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_config.js000066400000000000000000000003351450520414700267010ustar00rootroot00000000000000module.exports = defineTest({ description: 'missing export compact', expectedWarnings: ['SHIMMED_EXPORT'], options: { input: ['main.js', 'dep.js'], shimMissingExports: true, output: { compact: true } } }); rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/000077500000000000000000000000001450520414700266765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/amd/000077500000000000000000000000001450520414700274375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/amd/dep.js000066400000000000000000000003261450520414700305460ustar00rootroot00000000000000define(['exports'],(function(exports){'use strict';var _missingExportShim=void 0;function x (arg) { sideEffect(arg); }exports.missingExport=_missingExportShim;exports.missingFn=_missingExportShim;exports.x=x;}));rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/amd/main.js000066400000000000000000000001271450520414700307210ustar00rootroot00000000000000define(['./dep'],(function(dep){'use strict';dep.missingFn(); dep.x(dep.missingFn);}));rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/cjs/000077500000000000000000000000001450520414700274555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/cjs/dep.js000066400000000000000000000002541450520414700305640ustar00rootroot00000000000000'use strict';var _missingExportShim=void 0;function x (arg) { sideEffect(arg); }exports.missingExport=_missingExportShim;exports.missingFn=_missingExportShim;exports.x=x;rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/cjs/main.js000066400000000000000000000001171450520414700307360ustar00rootroot00000000000000'use strict';var dep=require('./dep.js');dep.missingFn(); dep.x(dep.missingFn);rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/es/000077500000000000000000000000001450520414700273055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/es/dep.js000066400000000000000000000002231450520414700304100ustar00rootroot00000000000000var _missingExportShim=void 0;function x (arg) { sideEffect(arg); }export{_missingExportShim as missingExport,_missingExportShim as missingFn,x};rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/es/main.js000066400000000000000000000001451450520414700305670ustar00rootroot00000000000000import {missingFn as _missingExportShim,x}from'./dep.js';_missingExportShim(); x(_missingExportShim);rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/system/000077500000000000000000000000001450520414700302225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/system/dep.js000066400000000000000000000003621450520414700313310ustar00rootroot00000000000000System.register([],(function(exports){'use strict';return{execute:(function(){exports('x',x);var _missingExportShim=void 0;function x (arg) { sideEffect(arg); }exports({missingExport:_missingExportShim,missingFn:_missingExportShim});})}}));rollup-3.29.4/test/chunking-form/samples/missing-export-compact/_expected/system/main.js000066400000000000000000000003511450520414700315030ustar00rootroot00000000000000System.register(['./dep.js'],(function(){'use strict';var _missingExportShim,x;return{setters:[function(module){_missingExportShim=module.missingFn;x=module.x;}],execute:(function(){_missingExportShim(); x(_missingExportShim);})}}));rollup-3.29.4/test/chunking-form/samples/missing-export-compact/dep.js000066400000000000000000000000571450520414700260460ustar00rootroot00000000000000export function x (arg) { sideEffect(arg); } rollup-3.29.4/test/chunking-form/samples/missing-export-compact/main.js000066400000000000000000000001301450520414700262120ustar00rootroot00000000000000import { missingExport, missingFn, x } from './dep.js'; missingFn(); x(missingExport); rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/000077500000000000000000000000001450520414700274055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_config.js000066400000000000000000000003731450520414700313520ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles using dependencies with shimmed missing exports as ', expectedWarnings: ['SHIMMED_EXPORT'], options: { input: ['main.js'], shimMissingExports: true, output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/000077500000000000000000000000001450520414700313455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/amd/000077500000000000000000000000001450520414700321065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/amd/dep1.js000066400000000000000000000005431450520414700332770ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var _missingExportShim = void 0; console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); exports.missing1 = _missingExportShim; })); rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/amd/dep2.js000066400000000000000000000005241450520414700332770ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var _missingExportShim = void 0; console.log('This is the output when a missing export is reexported'); var _missingExportShim$1 = void 0; console.log(_missingExportShim$1); exports.missing2 = _missingExportShim; exports.previousShimmedExport = _missingExportShim$1; })); rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/amd/main.js000066400000000000000000000002231450520414700333650ustar00rootroot00000000000000define(['./dep1', './dep2'], (function (dep1, dep2) { 'use strict'; console.log(dep1.missing1, dep2.missing2, dep2.previousShimmedExport); })); rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/cjs/000077500000000000000000000000001450520414700321245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/cjs/dep1.js000066400000000000000000000004521450520414700333140ustar00rootroot00000000000000'use strict'; var _missingExportShim = void 0; console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); exports.missing1 = _missingExportShim; rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/cjs/dep2.js000066400000000000000000000004361450520414700333170ustar00rootroot00000000000000'use strict'; var _missingExportShim = void 0; console.log('This is the output when a missing export is reexported'); var _missingExportShim$1 = void 0; console.log(_missingExportShim$1); exports.missing2 = _missingExportShim; exports.previousShimmedExport = _missingExportShim$1; rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/cjs/main.js000066400000000000000000000002311450520414700334020ustar00rootroot00000000000000'use strict'; var dep1 = require('./dep1.js'); var dep2 = require('./dep2.js'); console.log(dep1.missing1, dep2.missing2, dep2.previousShimmedExport); rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/es/000077500000000000000000000000001450520414700317545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/es/dep1.js000066400000000000000000000004371450520414700331470ustar00rootroot00000000000000var _missingExportShim = void 0; console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); export { _missingExportShim as missing1 }; rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/es/dep2.js000066400000000000000000000004141450520414700331430ustar00rootroot00000000000000var _missingExportShim = void 0; console.log('This is the output when a missing export is reexported'); var _missingExportShim$1 = void 0; console.log(_missingExportShim$1); export { _missingExportShim as missing2, _missingExportShim$1 as previousShimmedExport }; rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/es/main.js000066400000000000000000000003671450520414700332440ustar00rootroot00000000000000import { missing1 as _missingExportShim } from './dep1.js'; import { missing2 as _missingExportShim$1, previousShimmedExport as _missingExportShim$2 } from './dep2.js'; console.log(_missingExportShim, _missingExportShim$1, _missingExportShim$2); rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/system/000077500000000000000000000000001450520414700326715ustar00rootroot00000000000000dep1.js000066400000000000000000000006451450520414700340060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var _missingExportShim = void 0; console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); exports('missing1', _missingExportShim); }) }; })); dep2.js000066400000000000000000000005711450520414700340050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var _missingExportShim = void 0; console.log('This is the output when a missing export is reexported'); var _missingExportShim$1 = exports('previousShimmedExport', void 0); console.log(_missingExportShim$1); exports('missing2', _missingExportShim); }) }; })); main.js000066400000000000000000000007361450520414700341020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/systemSystem.register(['./dep1.js', './dep2.js'], (function () { 'use strict'; var _missingExportShim, _missingExportShim$1, _missingExportShim$2; return { setters: [function (module) { _missingExportShim = module.missing1; }, function (module) { _missingExportShim$1 = module.missing2; _missingExportShim$2 = module.previousShimmedExport; }], execute: (function () { console.log(_missingExportShim, _missingExportShim$1, _missingExportShim$2); }) }; })); rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/dep1.js000066400000000000000000000003211450520414700305700ustar00rootroot00000000000000console.log('This is the output when a missing export is used internally but not reexported'); function almostUseUnused(useIt) { if (useIt) { console.log(_missingExportShim); } } almostUseUnused(false); rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/dep2.js000066400000000000000000000003011450520414700305670ustar00rootroot00000000000000console.log('This is the output when a missing export is reexported'); var _missingExportShim = void 0; console.log(_missingExportShim); export {_missingExportShim as previousShimmedExport} rollup-3.29.4/test/chunking-form/samples/missing-export-reused-deconflicting/main.js000066400000000000000000000002341450520414700306660ustar00rootroot00000000000000import { missing1 } from './dep1.js'; import { missing2, previousShimmedExport } from './dep2.js'; console.log(missing1, missing2, previousShimmedExport); rollup-3.29.4/test/chunking-form/samples/missing-export/000077500000000000000000000000001450520414700233125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export/_config.js000066400000000000000000000003041450520414700252510ustar00rootroot00000000000000module.exports = defineTest({ description: 'missing export', expectedWarnings: ['SHIMMED_EXPORT', 'MIXED_EXPORTS'], options: { input: ['main.js', 'dep.js'], shimMissingExports: true } }); rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/000077500000000000000000000000001450520414700252525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/amd/000077500000000000000000000000001450520414700260135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/amd/dep.js000066400000000000000000000005451450520414700271250ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var _missingExportShim = void 0; function x (arg) { sideEffect(arg); } exports.default = _missingExportShim; exports.missingExport = _missingExportShim; exports.missingFn = _missingExportShim; exports.x = x; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/amd/main.js000066400000000000000000000001421450520414700272720ustar00rootroot00000000000000define(['./dep'], (function (dep) { 'use strict'; dep.missingFn(); dep.x(dep.missingFn); })); rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/cjs/000077500000000000000000000000001450520414700260315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/cjs/dep.js000066400000000000000000000004431450520414700271400ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _missingExportShim = void 0; function x (arg) { sideEffect(arg); } exports.default = _missingExportShim; exports.missingExport = _missingExportShim; exports.missingFn = _missingExportShim; exports.x = x; rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/cjs/main.js000066400000000000000000000001261450520414700273120ustar00rootroot00000000000000'use strict'; var dep = require('./dep.js'); dep.missingFn(); dep.x(dep.missingFn); rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/es/000077500000000000000000000000001450520414700256615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/es/dep.js000066400000000000000000000002761450520414700267740ustar00rootroot00000000000000var _missingExportShim = void 0; function x (arg) { sideEffect(arg); } export { _missingExportShim as default, _missingExportShim as missingExport, _missingExportShim as missingFn, x }; rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/es/main.js000066400000000000000000000001551450520414700271440ustar00rootroot00000000000000import { missingFn as _missingExportShim, x } from './dep.js'; _missingExportShim(); x(_missingExportShim); rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/system/000077500000000000000000000000001450520414700265765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/system/dep.js000066400000000000000000000005771450520414700277150ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('x', x); var _missingExportShim = void 0; function x (arg) { sideEffect(arg); } exports({ default: _missingExportShim, missingExport: _missingExportShim, missingFn: _missingExportShim }); }) }; })); rollup-3.29.4/test/chunking-form/samples/missing-export/_expected/system/main.js000066400000000000000000000004401450520414700300560ustar00rootroot00000000000000System.register(['./dep.js'], (function () { 'use strict'; var _missingExportShim, x; return { setters: [function (module) { _missingExportShim = module.missingFn; x = module.x; }], execute: (function () { _missingExportShim(); x(_missingExportShim); }) }; })); rollup-3.29.4/test/chunking-form/samples/missing-export/dep.js000066400000000000000000000000571450520414700244220ustar00rootroot00000000000000export function x (arg) { sideEffect(arg); } rollup-3.29.4/test/chunking-form/samples/missing-export/main.js000066400000000000000000000001701450520414700245720ustar00rootroot00000000000000import missingDefault, { missingExport, missingFn, x } from './dep.js'; missingFn(); x(missingExport, missingDefault); rollup-3.29.4/test/chunking-form/samples/multi-chunking/000077500000000000000000000000001450520414700232605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multi-chunking/_config.js000066400000000000000000000002001450520414700252120ustar00rootroot00000000000000module.exports = defineTest({ description: 'simple chunking', options: { input: ['main1.js', 'main2.js', 'main3.js'] } }); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/000077500000000000000000000000001450520414700252205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/amd/000077500000000000000000000000001450520414700257615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/amd/generated-dep1.js000066400000000000000000000001421450520414700311010ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 1; exports.num = num; })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/amd/generated-dep2.js000066400000000000000000000001421450520414700311020ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 2; exports.num = num; })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/amd/generated-dep3.js000066400000000000000000000001421450520414700311030ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 3; exports.num = num; })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/amd/main1.js000066400000000000000000000002021450520414700273160ustar00rootroot00000000000000define(['./generated-dep1', './generated-dep2'], (function (dep1, dep2) { 'use strict'; console.log(dep1.num + dep2.num); })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/amd/main2.js000066400000000000000000000002021450520414700273170ustar00rootroot00000000000000define(['./generated-dep2', './generated-dep3'], (function (dep2, dep3) { 'use strict'; console.log(dep2.num + dep3.num); })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/amd/main3.js000066400000000000000000000002021450520414700273200ustar00rootroot00000000000000define(['./generated-dep1', './generated-dep3'], (function (dep1, dep3) { 'use strict'; console.log(dep1.num + dep3.num); })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/cjs/000077500000000000000000000000001450520414700257775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/cjs/generated-dep1.js000066400000000000000000000000601450520414700311160ustar00rootroot00000000000000'use strict'; var num = 1; exports.num = num; rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/cjs/generated-dep2.js000066400000000000000000000000601450520414700311170ustar00rootroot00000000000000'use strict'; var num = 2; exports.num = num; rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/cjs/generated-dep3.js000066400000000000000000000000601450520414700311200ustar00rootroot00000000000000'use strict'; var num = 3; exports.num = num; rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/cjs/main1.js000066400000000000000000000002101450520414700273330ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); var dep2 = require('./generated-dep2.js'); console.log(dep1.num + dep2.num); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/cjs/main2.js000066400000000000000000000002101450520414700273340ustar00rootroot00000000000000'use strict'; var dep2 = require('./generated-dep2.js'); var dep3 = require('./generated-dep3.js'); console.log(dep2.num + dep3.num); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/cjs/main3.js000066400000000000000000000002101450520414700273350ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); var dep3 = require('./generated-dep3.js'); console.log(dep1.num + dep3.num); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/es/000077500000000000000000000000001450520414700256275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/es/generated-dep1.js000066400000000000000000000000431450520414700307470ustar00rootroot00000000000000var num = 1; export { num as n }; rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/es/generated-dep2.js000066400000000000000000000000431450520414700307500ustar00rootroot00000000000000var num = 2; export { num as n }; rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/es/generated-dep3.js000066400000000000000000000000431450520414700307510ustar00rootroot00000000000000var num = 3; export { num as n }; rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/es/main1.js000066400000000000000000000001751450520414700271750ustar00rootroot00000000000000import { n as num } from './generated-dep1.js'; import { n as num$1 } from './generated-dep2.js'; console.log(num + num$1); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/es/main2.js000066400000000000000000000001751450520414700271760ustar00rootroot00000000000000import { n as num } from './generated-dep2.js'; import { n as num$1 } from './generated-dep3.js'; console.log(num + num$1); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/es/main3.js000066400000000000000000000001751450520414700271770ustar00rootroot00000000000000import { n as num } from './generated-dep1.js'; import { n as num$1 } from './generated-dep3.js'; console.log(num + num$1); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/system/000077500000000000000000000000001450520414700265445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/system/generated-dep1.js000066400000000000000000000002131450520414700316630ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 1); }) }; })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/system/generated-dep2.js000066400000000000000000000002131450520414700316640ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 2); }) }; })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/system/generated-dep3.js000066400000000000000000000002131450520414700316650ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 3); }) }; })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/system/main1.js000066400000000000000000000004471450520414700301140ustar00rootroot00000000000000System.register(['./generated-dep1.js', './generated-dep2.js'], (function () { 'use strict'; var num, num$1; return { setters: [function (module) { num = module.n; }, function (module) { num$1 = module.n; }], execute: (function () { console.log(num + num$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/system/main2.js000066400000000000000000000004471450520414700301150ustar00rootroot00000000000000System.register(['./generated-dep2.js', './generated-dep3.js'], (function () { 'use strict'; var num, num$1; return { setters: [function (module) { num = module.n; }, function (module) { num$1 = module.n; }], execute: (function () { console.log(num + num$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/_expected/system/main3.js000066400000000000000000000004471450520414700301160ustar00rootroot00000000000000System.register(['./generated-dep1.js', './generated-dep3.js'], (function () { 'use strict'; var num, num$1; return { setters: [function (module) { num = module.n; }, function (module) { num$1 = module.n; }], execute: (function () { console.log(num + num$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/multi-chunking/dep1.js000066400000000000000000000000231450520414700244420ustar00rootroot00000000000000export var num = 1;rollup-3.29.4/test/chunking-form/samples/multi-chunking/dep2.js000066400000000000000000000000231450520414700244430ustar00rootroot00000000000000export var num = 2;rollup-3.29.4/test/chunking-form/samples/multi-chunking/dep3.js000066400000000000000000000000231450520414700244440ustar00rootroot00000000000000export var num = 3;rollup-3.29.4/test/chunking-form/samples/multi-chunking/main1.js000066400000000000000000000001461450520414700246240ustar00rootroot00000000000000import { num as num1 } from './dep1'; import { num as num2 } from './dep2'; console.log(num1 + num2);rollup-3.29.4/test/chunking-form/samples/multi-chunking/main2.js000066400000000000000000000001461450520414700246250ustar00rootroot00000000000000import { num as num1 } from './dep2'; import { num as num2 } from './dep3'; console.log(num1 + num2);rollup-3.29.4/test/chunking-form/samples/multi-chunking/main3.js000066400000000000000000000001461450520414700246260ustar00rootroot00000000000000import { num as num1 } from './dep1'; import { num as num2 } from './dep3'; console.log(num1 + num2);rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/000077500000000000000000000000001450520414700246265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_config.js000066400000000000000000000003321450520414700265660ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles multiple entry points with a shared dependency', options: { input: ['main', 'other'], output: { chunkFileNames: 'chunks/[name].js' } }, runAmd: true }); rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/000077500000000000000000000000001450520414700265665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/amd/000077500000000000000000000000001450520414700273275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/amd/main.js000066400000000000000000000001511450520414700306060ustar00rootroot00000000000000define(['./other'], (function (other) { 'use strict'; assert.equal(other.sharedValue, 'shared'); })); rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/amd/other.js000066400000000000000000000002031450520414700310010ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const sharedValue = 'shared'; exports.sharedValue = sharedValue; })); rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/cjs/000077500000000000000000000000001450520414700273455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/cjs/main.js000066400000000000000000000001361450520414700306270ustar00rootroot00000000000000'use strict'; var other = require('./other.js'); assert.equal(other.sharedValue, 'shared'); rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/cjs/other.js000066400000000000000000000001211450520414700310160ustar00rootroot00000000000000'use strict'; const sharedValue = 'shared'; exports.sharedValue = sharedValue; rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/es/000077500000000000000000000000001450520414700271755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/es/main.js000066400000000000000000000001201450520414700304500ustar00rootroot00000000000000import { sharedValue } from './other.js'; assert.equal(sharedValue, 'shared'); rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/es/other.js000066400000000000000000000000671450520414700306570ustar00rootroot00000000000000const sharedValue = 'shared'; export { sharedValue }; rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/system/000077500000000000000000000000001450520414700301125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/system/main.js000066400000000000000000000003671450520414700314020ustar00rootroot00000000000000System.register(['./other.js'], (function () { 'use strict'; var sharedValue; return { setters: [function (module) { sharedValue = module.sharedValue; }], execute: (function () { assert.equal(sharedValue, 'shared'); }) }; })); rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/_expected/system/other.js000066400000000000000000000002461450520414700315730ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const sharedValue = exports('sharedValue', 'shared'); }) }; })); rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/main.js000066400000000000000000000001161450520414700261060ustar00rootroot00000000000000import { sharedValue } from './shared'; assert.equal(sharedValue, 'shared'); rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/other.js000066400000000000000000000000501450520414700263000ustar00rootroot00000000000000export { sharedValue } from './shared'; rollup-3.29.4/test/chunking-form/samples/multiple-entry-points/shared.js000066400000000000000000000000451450520414700264310ustar00rootroot00000000000000export const sharedValue = 'shared'; rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/000077500000000000000000000000001450520414700262035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_config.js000066400000000000000000000002111450520414700301370ustar00rootroot00000000000000module.exports = defineTest({ description: 'handle namespace imports from chunks', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/000077500000000000000000000000001450520414700301435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/amd/000077500000000000000000000000001450520414700307045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/amd/main1.js000066400000000000000000000001351450520414700322460ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var p = 42; exports.p = p; })); rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/amd/main2.js000066400000000000000000000001261450520414700322470ustar00rootroot00000000000000define(['./main1'], (function (main1) { 'use strict'; console.log( main1.p ); })); rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/cjs/000077500000000000000000000000001450520414700307225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/cjs/main1.js000066400000000000000000000000531450520414700322630ustar00rootroot00000000000000'use strict'; var p = 42; exports.p = p; rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/cjs/main2.js000066400000000000000000000001131450520414700322610ustar00rootroot00000000000000'use strict'; var main1 = require('./main1.js'); console.log( main1.p ); rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/es/000077500000000000000000000000001450520414700305525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/es/main1.js000066400000000000000000000000331450520414700321110ustar00rootroot00000000000000var p = 42; export { p }; rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/es/main2.js000066400000000000000000000000631450520414700321150ustar00rootroot00000000000000import { p } from './main1.js'; console.log( p ); rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/system/000077500000000000000000000000001450520414700314675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/system/main1.js000066400000000000000000000002121450520414700330250ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var p = exports('p', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/_expected/system/main2.js000066400000000000000000000003061450520414700330320ustar00rootroot00000000000000System.register(['./main1.js'], (function () { 'use strict'; var p; return { setters: [function (module) { p = module.p; }], execute: (function () { console.log( p ); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/main1.js000066400000000000000000000000231450520414700275410ustar00rootroot00000000000000export var p = 42; rollup-3.29.4/test/chunking-form/samples/namespace-imports-from-chunks/main2.js000066400000000000000000000000761450520414700275520ustar00rootroot00000000000000import * as main1 from './main1.js'; console.log( main1.p ); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/000077500000000000000000000000001450520414700250325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_config.js000066400000000000000000000001741450520414700267760ustar00rootroot00000000000000module.exports = defineTest({ description: 'namespace object import', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/000077500000000000000000000000001450520414700267725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/amd/000077500000000000000000000000001450520414700275335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/amd/generated-main2.js000066400000000000000000000003461450520414700330360ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var a = 'a'; var b = 'a'; var main2 = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); exports.a = a; exports.b = b; exports.main2 = main2; })); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/amd/main1.js000066400000000000000000000001721450520414700310760ustar00rootroot00000000000000define(['./generated-main2'], (function (main2) { 'use strict'; console.log(main2.a); console.log(main2.main2); })); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/amd/main2.js000066400000000000000000000002111450520414700310710ustar00rootroot00000000000000define(['exports', './generated-main2'], (function (exports, main2) { 'use strict'; exports.a = main2.a; exports.b = main2.b; })); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/cjs/000077500000000000000000000000001450520414700275515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/cjs/generated-main2.js000066400000000000000000000002541450520414700330520ustar00rootroot00000000000000'use strict'; var a = 'a'; var b = 'a'; var main2 = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); exports.a = a; exports.b = b; exports.main2 = main2; rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/cjs/main1.js000066400000000000000000000001561450520414700311160ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main2.js'); console.log(main2.a); console.log(main2.main2); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/cjs/main2.js000066400000000000000000000001511450520414700311120ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main2.js'); exports.a = main2.a; exports.b = main2.b; rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/es/000077500000000000000000000000001450520414700274015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/es/generated-main2.js000066400000000000000000000002051450520414700326760ustar00rootroot00000000000000var a = 'a'; var b = 'a'; var main2 = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); export { a, b, main2 as m }; rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/es/main1.js000066400000000000000000000001341450520414700307420ustar00rootroot00000000000000import { a, m as main2 } from './generated-main2.js'; console.log(a); console.log(main2); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/es/main2.js000066400000000000000000000000551450520414700307450ustar00rootroot00000000000000export { a, b } from './generated-main2.js'; rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/system/000077500000000000000000000000001450520414700303165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/system/generated-main2.js000066400000000000000000000004351450520414700336200ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var a = exports('a', 'a'); var b = exports('b', 'a'); var main2 = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); exports('m', main2); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/system/main1.js000066400000000000000000000004021450520414700316550ustar00rootroot00000000000000System.register(['./generated-main2.js'], (function () { 'use strict'; var a, main2; return { setters: [function (module) { a = module.a; main2 = module.m; }], execute: (function () { console.log(a); console.log(main2); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/_expected/system/main2.js000066400000000000000000000003241450520414700316610ustar00rootroot00000000000000System.register(['./generated-main2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ a: module.a, b: module.b }); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-object-import/dep.js000066400000000000000000000000731450520414700261400ustar00rootroot00000000000000import * as main2 from './main2.js'; console.log(main2.a);rollup-3.29.4/test/chunking-form/samples/namespace-object-import/main1.js000066400000000000000000000001141450520414700263710ustar00rootroot00000000000000import * as main2 from './main2.js'; import './dep.js'; console.log(main2);rollup-3.29.4/test/chunking-form/samples/namespace-object-import/main2.js000066400000000000000000000000471450520414700263770ustar00rootroot00000000000000export var a = 'a'; export var b = 'a';rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/000077500000000000000000000000001450520414700266415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_config.js000066400000000000000000000003651450520414700306070ustar00rootroot00000000000000module.exports = defineTest({ description: 'renders namespaces with reexports that conflict with existing imports', options: { input: ['main1.js', 'main2.js', 'main3.js'], external: ['external'], output: { exports: 'named' } } }); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/000077500000000000000000000000001450520414700306015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/000077500000000000000000000000001450520414700313425ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001711450520414700343240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const reexported = 1; exports.reexported = reexported; })); generated-index.js000066400000000000000000000004031450520414700346610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amddefine(['exports', './generated-dep', 'external'], (function (exports, dep, external) { 'use strict'; console.log(external.reexported); var lib = /*#__PURE__*/Object.freeze({ __proto__: null, reexported: dep.reexported }); exports.lib = lib; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main1.js000066400000000000000000000002161450520414700327040ustar00rootroot00000000000000define(['./generated-index', './generated-dep', 'external'], (function (index, dep, external) { 'use strict'; console.log(index.lib); })); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main2.js000066400000000000000000000002231450520414700327030ustar00rootroot00000000000000define(['./generated-index', './generated-dep', 'external'], (function (index, dep, external) { 'use strict'; console.log(dep.reexported); })); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main3.js000066400000000000000000000001411450520414700327030ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.reexported); })); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/000077500000000000000000000000001450520414700313605ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001071450520414700343410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs'use strict'; const reexported = 1; exports.reexported = reexported; generated-index.js000066400000000000000000000003551450520414700347050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); var external = require('external'); console.log(external.reexported); var lib = /*#__PURE__*/Object.freeze({ __proto__: null, reexported: dep.reexported }); exports.lib = lib; rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main1.js000066400000000000000000000002111450520414700327150ustar00rootroot00000000000000'use strict'; var index = require('./generated-index.js'); require('./generated-dep.js'); require('external'); console.log(index.lib); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main2.js000066400000000000000000000002141450520414700327210ustar00rootroot00000000000000'use strict'; require('./generated-index.js'); var dep = require('./generated-dep.js'); require('external'); console.log(dep.reexported); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main3.js000066400000000000000000000001261450520414700327240ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log(dep.reexported); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/000077500000000000000000000000001450520414700312105ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000631450520414700341720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/esconst reexported = 1; export { reexported as r }; generated-index.js000066400000000000000000000003471450520414700345360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/esimport { r as reexported$1 } from './generated-dep.js'; import { reexported } from 'external'; console.log(reexported); var lib = /*#__PURE__*/Object.freeze({ __proto__: null, reexported: reexported$1 }); export { lib as l }; rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main1.js000066400000000000000000000001641450520414700325540ustar00rootroot00000000000000import { l as lib } from './generated-index.js'; import './generated-dep.js'; import 'external'; console.log(lib); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main2.js000066400000000000000000000002021450520414700325460ustar00rootroot00000000000000import './generated-index.js'; import { r as reexported } from './generated-dep.js'; import 'external'; console.log(reexported); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main3.js000066400000000000000000000001201450520414700325460ustar00rootroot00000000000000import { r as reexported } from './generated-dep.js'; console.log(reexported); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/000077500000000000000000000000001450520414700321255ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002241450520414700351060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const reexported = exports('r', 1); }) }; })); generated-index.js000066400000000000000000000007001450520414700354440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/systemSystem.register(['./generated-dep.js', 'external'], (function (exports) { 'use strict'; var reexported$1, reexported; return { setters: [function (module) { reexported$1 = module.r; }, function (module) { reexported = module.reexported; }], execute: (function () { console.log(reexported); var lib = /*#__PURE__*/Object.freeze({ __proto__: null, reexported: reexported$1 }); exports('l', lib); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main1.js000066400000000000000000000004021450520414700334640ustar00rootroot00000000000000System.register(['./generated-index.js', './generated-dep.js', 'external'], (function () { 'use strict'; var lib; return { setters: [function (module) { lib = module.l; }, null, null], execute: (function () { console.log(lib); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main2.js000066400000000000000000000004271450520414700334740ustar00rootroot00000000000000System.register(['./generated-index.js', './generated-dep.js', 'external'], (function () { 'use strict'; var reexported; return { setters: [null, function (module) { reexported = module.r; }, null], execute: (function () { console.log(reexported); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main3.js000066400000000000000000000003471450520414700334760ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var reexported; return { setters: [function (module) { reexported = module.r; }], execute: (function () { console.log(reexported); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/dep.js000066400000000000000000000000351450520414700277450ustar00rootroot00000000000000export const reexported = 1; rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/index.js000066400000000000000000000001441450520414700303050ustar00rootroot00000000000000export { reexported } from './dep'; import { reexported } from 'external'; console.log(reexported); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/main1.js000066400000000000000000000000621450520414700302020ustar00rootroot00000000000000import * as lib from './index'; console.log(lib); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/main2.js000066400000000000000000000000751450520414700302070ustar00rootroot00000000000000import * as lib from './index'; console.log(lib.reexported); rollup-3.29.4/test/chunking-form/samples/namespace-reexport-name-conflict/main3.js000066400000000000000000000000751450520414700302100ustar00rootroot00000000000000import { reexported } from './dep'; console.log(reexported); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/000077500000000000000000000000001450520414700243075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_config.js000066400000000000000000000002711450520414700262510ustar00rootroot00000000000000module.exports = defineTest({ description: 'namespace rendering with reexports', options: { input: ['main.js', 'hsl2hsv.js', 'index.js'], output: { exports: 'named' } } }); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/000077500000000000000000000000001450520414700262475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/amd/000077500000000000000000000000001450520414700270105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/amd/generated-index.js000066400000000000000000000003711450520414700324120ustar00rootroot00000000000000define(['exports', './hsl2hsv'], (function (exports, hsl2hsv$1) { 'use strict'; var hsl2hsv = 'asdf'; console.log(hsl2hsv); var lib = /*#__PURE__*/Object.freeze({ __proto__: null, hsl2hsv: hsl2hsv$1.default }); exports.lib = lib; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/amd/hsl2hsv.js000066400000000000000000000005101450520414700307330ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var hsl2hsv = (h, s, l) => { const t = s * (l < 0.5 ? 1 : 1 - l), V = 1 + t, S = 2 * t / V ; return [h, S, V]; }; var p = 5; exports.default = hsl2hsv; exports.p = p; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/amd/index.js000066400000000000000000000002271450520414700304560ustar00rootroot00000000000000define(['exports', './hsl2hsv', './generated-index'], (function (exports, hsl2hsv, index) { 'use strict'; exports.hsl2hsv = hsl2hsv.default; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/amd/main.js000066400000000000000000000004251450520414700302730ustar00rootroot00000000000000define(['exports', './generated-index', './hsl2hsv'], (function (exports, index, hsl2hsv) { 'use strict'; console.log(hsl2hsv.p); var main = new Map(Object.entries(index.lib)); exports.default = main; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/cjs/000077500000000000000000000000001450520414700270265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/cjs/generated-index.js000066400000000000000000000003241450520414700324260ustar00rootroot00000000000000'use strict'; var hsl2hsv$1 = require('./hsl2hsv.js'); var hsl2hsv = 'asdf'; console.log(hsl2hsv); var lib = /*#__PURE__*/Object.freeze({ __proto__: null, hsl2hsv: hsl2hsv$1.default }); exports.lib = lib; rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/cjs/hsl2hsv.js000066400000000000000000000004041450520414700307530ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var hsl2hsv = (h, s, l) => { const t = s * (l < 0.5 ? 1 : 1 - l), V = 1 + t, S = 2 * t / V ; return [h, S, V]; }; var p = 5; exports.default = hsl2hsv; exports.p = p; rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/cjs/index.js000066400000000000000000000001751450520414700304760ustar00rootroot00000000000000'use strict'; var hsl2hsv = require('./hsl2hsv.js'); require('./generated-index.js'); exports.hsl2hsv = hsl2hsv.default; rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/cjs/main.js000066400000000000000000000004041450520414700303060ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var index = require('./generated-index.js'); var hsl2hsv = require('./hsl2hsv.js'); console.log(hsl2hsv.p); var main = new Map(Object.entries(index.lib)); exports.default = main; rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/es/000077500000000000000000000000001450520414700266565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/es/generated-index.js000066400000000000000000000002741450520414700322620ustar00rootroot00000000000000import hsl2hsv$1 from './hsl2hsv.js'; var hsl2hsv = 'asdf'; console.log(hsl2hsv); var lib = /*#__PURE__*/Object.freeze({ __proto__: null, hsl2hsv: hsl2hsv$1 }); export { lib as l }; rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/es/hsl2hsv.js000066400000000000000000000002551450520414700306070ustar00rootroot00000000000000var hsl2hsv = (h, s, l) => { const t = s * (l < 0.5 ? 1 : 1 - l), V = 1 + t, S = 2 * t / V ; return [h, S, V]; }; var p = 5; export { hsl2hsv as default, p }; rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/es/index.js000066400000000000000000000001221450520414700303160ustar00rootroot00000000000000export { default as hsl2hsv } from './hsl2hsv.js'; import './generated-index.js'; rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/es/main.js000066400000000000000000000002521450520414700301370ustar00rootroot00000000000000import { l as lib } from './generated-index.js'; import { p } from './hsl2hsv.js'; console.log(p); var main = new Map(Object.entries(lib)); export { main as default }; rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/system/000077500000000000000000000000001450520414700275735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/system/generated-index.js000066400000000000000000000005671450520414700332040ustar00rootroot00000000000000System.register(['./hsl2hsv.js'], (function (exports) { 'use strict'; var hsl2hsv$1; return { setters: [function (module) { hsl2hsv$1 = module.default; }], execute: (function () { var hsl2hsv = 'asdf'; console.log(hsl2hsv); var lib = /*#__PURE__*/Object.freeze({ __proto__: null, hsl2hsv: hsl2hsv$1 }); exports('l', lib); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/system/hsl2hsv.js000066400000000000000000000005121450520414700315200ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var hsl2hsv = exports('default', (h, s, l) => { const t = s * (l < 0.5 ? 1 : 1 - l), V = 1 + t, S = 2 * t / V ; return [h, S, V]; }); var p = exports('p', 5); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/system/index.js000066400000000000000000000003471450520414700312440ustar00rootroot00000000000000System.register(['./hsl2hsv.js', './generated-index.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('hsl2hsv', module.default); }, null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/_expected/system/main.js000066400000000000000000000005261450520414700310600ustar00rootroot00000000000000System.register(['./generated-index.js', './hsl2hsv.js'], (function (exports) { 'use strict'; var lib, p; return { setters: [function (module) { lib = module.l; }, function (module) { p = module.p; }], execute: (function () { console.log(p); var main = exports('default', new Map(Object.entries(lib))); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/hsl2hsv.js000066400000000000000000000002351450520414700262360ustar00rootroot00000000000000export default (h, s, l) => { const t = s * (l < 0.5 ? 1 : 1 - l), V = 1 + t, S = 1 > 0 ? 2 * t / V : 0; return [h, S, V]; }; export var p = 5; rollup-3.29.4/test/chunking-form/samples/namespace-reexports/index.js000066400000000000000000000001361450520414700257540ustar00rootroot00000000000000export { default as hsl2hsv } from './hsl2hsv'; var hsl2hsv = 'asdf'; console.log(hsl2hsv); rollup-3.29.4/test/chunking-form/samples/namespace-reexports/main.js000066400000000000000000000001741450520414700255730ustar00rootroot00000000000000import * as lib from './index'; import { p } from './hsl2hsv'; console.log(p); export default new Map(Object.entries(lib)); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/000077500000000000000000000000001450520414700242325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_config.js000066400000000000000000000002331450520414700261720ustar00rootroot00000000000000module.exports = defineTest({ description: 'internal reexported namespaces over chunk boundaries', options: { input: ['main-a.js', 'main-b.js'] } }); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/000077500000000000000000000000001450520414700261725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/amd/000077500000000000000000000000001450520414700267335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/amd/generated-other.js000066400000000000000000000004521450520414700323470ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; class Broken { } Broken.doSomething = function() { console.log('broken'); }; Broken.doSomething(); class Other { } Other.doSomething = function() { console.log('other'); }; exports.Broken = Broken; exports.Other = Other; })); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/amd/main-a.js000066400000000000000000000002001450520414700304230ustar00rootroot00000000000000define(['./generated-other'], (function (other) { 'use strict'; other.Other.doSomething(); other.Broken.doSomething(); })); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/amd/main-b.js000066400000000000000000000001431450520414700304320ustar00rootroot00000000000000define(['./generated-other'], (function (other) { 'use strict'; other.Other.doSomething(); })); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/cjs/000077500000000000000000000000001450520414700267515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/cjs/generated-other.js000066400000000000000000000003611450520414700323640ustar00rootroot00000000000000'use strict'; class Broken { } Broken.doSomething = function() { console.log('broken'); }; Broken.doSomething(); class Other { } Other.doSomething = function() { console.log('other'); }; exports.Broken = Broken; exports.Other = Other; rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/cjs/main-a.js000066400000000000000000000001641450520414700304520ustar00rootroot00000000000000'use strict'; var other = require('./generated-other.js'); other.Other.doSomething(); other.Broken.doSomething(); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/cjs/main-b.js000066400000000000000000000001301450520414700304440ustar00rootroot00000000000000'use strict'; var other = require('./generated-other.js'); other.Other.doSomething(); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/es/000077500000000000000000000000001450520414700266015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/es/generated-other.js000066400000000000000000000003261450520414700322150ustar00rootroot00000000000000class Broken { } Broken.doSomething = function() { console.log('broken'); }; Broken.doSomething(); class Other { } Other.doSomething = function() { console.log('other'); }; export { Broken as B, Other as O }; rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/es/main-a.js000066400000000000000000000001541450520414700303010ustar00rootroot00000000000000import { O as Other, B as Broken } from './generated-other.js'; Other.doSomething(); Broken.doSomething(); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/es/main-b.js000066400000000000000000000001111450520414700302730ustar00rootroot00000000000000import { O as Other } from './generated-other.js'; Other.doSomething(); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/system/000077500000000000000000000000001450520414700275165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/system/generated-other.js000066400000000000000000000005361450520414700331350ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { class Broken { } exports('B', Broken); Broken.doSomething = function() { console.log('broken'); }; Broken.doSomething(); class Other { } exports('O', Other); Other.doSomething = function() { console.log('other'); }; }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/system/main-a.js000066400000000000000000000004221450520414700312140ustar00rootroot00000000000000System.register(['./generated-other.js'], (function () { 'use strict'; var Other, Broken; return { setters: [function (module) { Other = module.O; Broken = module.B; }], execute: (function () { Other.doSomething(); Broken.doSomething(); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/_expected/system/main-b.js000066400000000000000000000003331450520414700312160ustar00rootroot00000000000000System.register(['./generated-other.js'], (function () { 'use strict'; var Other; return { setters: [function (module) { Other = module.O; }], execute: (function () { Other.doSomething(); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-retracing/broken.js000066400000000000000000000001231450520414700260440ustar00rootroot00000000000000export class Broken { } Broken.doSomething = function() { console.log('broken'); }rollup-3.29.4/test/chunking-form/samples/namespace-retracing/foo.js000066400000000000000000000000311450520414700253450ustar00rootroot00000000000000export * from './broken';rollup-3.29.4/test/chunking-form/samples/namespace-retracing/main-a.js000066400000000000000000000001651450520414700257340ustar00rootroot00000000000000import * as other from './other'; import * as foo from './foo'; other.Other.doSomething(); foo.Broken.doSomething();rollup-3.29.4/test/chunking-form/samples/namespace-retracing/main-b.js000066400000000000000000000000751450520414700257350ustar00rootroot00000000000000import * as other from './other'; other.Other.doSomething();rollup-3.29.4/test/chunking-form/samples/namespace-retracing/other.js000066400000000000000000000002131450520414700257050ustar00rootroot00000000000000import { Broken } from './broken'; Broken.doSomething(); export class Other { } Other.doSomething = function() { console.log('other'); }rollup-3.29.4/test/chunking-form/samples/namespace-tostring/000077500000000000000000000000001450520414700241255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/000077500000000000000000000000001450520414700314255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_config.js000066400000000000000000000003571450520414700333740ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to dynamic imports of entry chunks with default export mode', options: { input: ['main', 'foo'], output: { generatedCode: { symbols: true } } } }); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/000077500000000000000000000000001450520414700333655ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700340475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000001101450520414700351600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/amddefine((function () { 'use strict'; var foo = 42; return foo; })); main.js000066400000000000000000000006131450520414700353310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/amddefine(['require'], (function (require) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } new Promise(function (resolve, reject) { require(['./foo'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(console.log); })); cjs/000077500000000000000000000000001450520414700340655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000000641450520414700352060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/cjs'use strict'; var foo = 42; module.exports = foo; main.js000066400000000000000000000004671450520414700353560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/cjs'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./foo.js')); }).then(console.log); es/000077500000000000000000000000001450520414700337155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000000521450520414700350330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/esvar foo = 42; export { foo as default }; main.js000066400000000000000000000000461450520414700351770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/esimport('./foo.js').then(console.log); system/000077500000000000000000000000001450520414700346325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000002221450520414700357470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('default', 42); }) }; })); main.js000066400000000000000000000002451450520414700361150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./foo.js').then(console.log); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/foo.js000066400000000000000000000000231450520414700325410ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/main.js000066400000000000000000000000431450520414700327040ustar00rootroot00000000000000import('./foo').then(console.log); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/000077500000000000000000000000001450520414700270615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_config.js000066400000000000000000000002521450520414700310220ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to dynamic imports', options: { output: { generatedCode: { symbols: true } } } }); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/000077500000000000000000000000001450520414700310215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/amd/000077500000000000000000000000001450520414700315625ustar00rootroot00000000000000generated-foo.js000066400000000000000000000002601450520414700345560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const bar = 42; exports.bar = bar; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); })); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/amd/main.js000066400000000000000000000002561450520414700330470ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-foo'], resolve, reject); }).then(console.log); })); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/cjs/000077500000000000000000000000001450520414700316005ustar00rootroot00000000000000generated-foo.js000066400000000000000000000001751450520414700346010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/cjs'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const bar = 42; exports.bar = bar; rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/cjs/main.js000066400000000000000000000001601450520414700330570ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-foo.js'); }).then(console.log); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/es/000077500000000000000000000000001450520414700314305ustar00rootroot00000000000000generated-foo.js000066400000000000000000000000411450520414700344210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/esconst bar = 42; export { bar }; rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/es/main.js000066400000000000000000000000601450520414700327060ustar00rootroot00000000000000import('./generated-foo.js').then(console.log); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/system/000077500000000000000000000000001450520414700323455ustar00rootroot00000000000000generated-foo.js000066400000000000000000000002201450520414700353350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const bar = exports('bar', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/system/main.js000066400000000000000000000002571450520414700336330ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-foo.js').then(console.log); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/foo.js000066400000000000000000000000271450520414700302010ustar00rootroot00000000000000export const bar = 42; rollup-3.29.4/test/chunking-form/samples/namespace-tostring/dynamic-import/main.js000066400000000000000000000000431450520414700303400ustar00rootroot00000000000000import('./foo').then(console.log); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/000077500000000000000000000000001450520414700237035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_config.js000066400000000000000000000001751450520414700256500ustar00rootroot00000000000000module.exports = defineTest({ description: 'Something', options: { input: ['main-a.js', 'main-b.js', 'main-c.js'] } }); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/000077500000000000000000000000001450520414700256435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/amd/000077500000000000000000000000001450520414700264045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/amd/generated-bar.js000066400000000000000000000002041450520414700314360ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function bar() { console.log('bar'); } exports.bar = bar; })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/amd/generated-broken.js000066400000000000000000000002201450520414700321500ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function broken() { console.log('broken'); } exports.broken = broken; })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/amd/generated-foo.js000066400000000000000000000002041450520414700314550ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function foo() { console.log('foo'); } exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/amd/main-a.js000066400000000000000000000001771450520414700301110ustar00rootroot00000000000000define(['./generated-foo', './generated-broken'], (function (foo, broken) { 'use strict'; foo.foo(); broken.broken(); })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/amd/main-b.js000066400000000000000000000002651450520414700301100ustar00rootroot00000000000000define(['./generated-foo', './generated-bar', './generated-broken'], (function (foo, bar, broken) { 'use strict'; foo.foo(); broken.broken(); bar.bar(); broken.broken(); })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/amd/main-c.js000066400000000000000000000001771450520414700301130ustar00rootroot00000000000000define(['./generated-bar', './generated-broken'], (function (bar, broken) { 'use strict'; bar.bar(); broken.broken(); })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/cjs/000077500000000000000000000000001450520414700264225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/cjs/generated-bar.js000066400000000000000000000001141450520414700314540ustar00rootroot00000000000000'use strict'; function bar() { console.log('bar'); } exports.bar = bar; rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/cjs/generated-broken.js000066400000000000000000000001301450520414700321660ustar00rootroot00000000000000'use strict'; function broken() { console.log('broken'); } exports.broken = broken; rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/cjs/generated-foo.js000066400000000000000000000001141450520414700314730ustar00rootroot00000000000000'use strict'; function foo() { console.log('foo'); } exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-a.js000066400000000000000000000002041450520414700301160ustar00rootroot00000000000000'use strict'; var foo = require('./generated-foo.js'); var broken = require('./generated-broken.js'); foo.foo(); broken.broken(); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-b.js000066400000000000000000000003111450520414700301160ustar00rootroot00000000000000'use strict'; var foo = require('./generated-foo.js'); var bar = require('./generated-bar.js'); var broken = require('./generated-broken.js'); foo.foo(); broken.broken(); bar.bar(); broken.broken(); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-c.js000066400000000000000000000002041450520414700301200ustar00rootroot00000000000000'use strict'; var bar = require('./generated-bar.js'); var broken = require('./generated-broken.js'); bar.bar(); broken.broken(); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/es/000077500000000000000000000000001450520414700262525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/es/generated-bar.js000066400000000000000000000000771450520414700313140ustar00rootroot00000000000000function bar() { console.log('bar'); } export { bar as b }; rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/es/generated-broken.js000066400000000000000000000001101450520414700320140ustar00rootroot00000000000000function broken() { console.log('broken'); } export { broken as b }; rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/es/generated-foo.js000066400000000000000000000000771450520414700313330ustar00rootroot00000000000000function foo() { console.log('foo'); } export { foo as f }; rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/es/main-a.js000066400000000000000000000001661450520414700277550ustar00rootroot00000000000000import { f as foo } from './generated-foo.js'; import { b as broken } from './generated-broken.js'; foo(); broken(); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/es/main-b.js000066400000000000000000000002661450520414700277570ustar00rootroot00000000000000import { f as foo } from './generated-foo.js'; import { b as bar } from './generated-bar.js'; import { b as broken } from './generated-broken.js'; foo(); broken(); bar(); broken(); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/es/main-c.js000066400000000000000000000001661450520414700277570ustar00rootroot00000000000000import { b as bar } from './generated-bar.js'; import { b as broken } from './generated-broken.js'; bar(); broken(); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/system/000077500000000000000000000000001450520414700271675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/system/generated-bar.js000066400000000000000000000003111450520414700322200ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('b', bar); function bar() { console.log('bar'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/system/generated-broken.js000066400000000000000000000003221450520414700327360ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('b', broken); function broken() { console.log('broken'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/system/generated-foo.js000066400000000000000000000003111450520414700322370ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', foo); function foo() { console.log('foo'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/system/main-a.js000066400000000000000000000004441450520414700306710ustar00rootroot00000000000000System.register(['./generated-foo.js', './generated-broken.js'], (function () { 'use strict'; var foo, broken; return { setters: [function (module) { foo = module.f; }, function (module) { broken = module.b; }], execute: (function () { foo(); broken(); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/system/main-b.js000066400000000000000000000006021450520414700306660ustar00rootroot00000000000000System.register(['./generated-foo.js', './generated-bar.js', './generated-broken.js'], (function () { 'use strict'; var foo, bar, broken; return { setters: [function (module) { foo = module.f; }, function (module) { bar = module.b; }, function (module) { broken = module.b; }], execute: (function () { foo(); broken(); bar(); broken(); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/_expected/system/main-c.js000066400000000000000000000004441450520414700306730ustar00rootroot00000000000000System.register(['./generated-bar.js', './generated-broken.js'], (function () { 'use strict'; var bar, broken; return { setters: [function (module) { bar = module.b; }, function (module) { broken = module.b; }], execute: (function () { bar(); broken(); }) }; })); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/bar.js000066400000000000000000000001121450520414700247770ustar00rootroot00000000000000export * from './broken'; export function bar() { console.log('bar'); }rollup-3.29.4/test/chunking-form/samples/namespace-tracing/broken.js000066400000000000000000000000661450520414700255230ustar00rootroot00000000000000export function broken() { console.log('broken'); } rollup-3.29.4/test/chunking-form/samples/namespace-tracing/foo.js000066400000000000000000000001121450520414700250160ustar00rootroot00000000000000export * from './broken'; export function foo() { console.log('foo'); }rollup-3.29.4/test/chunking-form/samples/namespace-tracing/main-a.js000066400000000000000000000000671450520414700254060ustar00rootroot00000000000000import * as foo from './foo'; foo.foo(); foo.broken();rollup-3.29.4/test/chunking-form/samples/namespace-tracing/main-b.js000066400000000000000000000001571450520414700254070ustar00rootroot00000000000000import * as foo from './foo'; import * as bar from './bar'; foo.foo(); foo.broken(); bar.bar(); bar.broken(); rollup-3.29.4/test/chunking-form/samples/namespace-tracing/main-c.js000066400000000000000000000000701450520414700254020ustar00rootroot00000000000000import * as bar from './bar'; bar.bar(); bar.broken(); rollup-3.29.4/test/chunking-form/samples/nested-chunks/000077500000000000000000000000001450520414700230755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_config.js000066400000000000000000000002421450520414700250350ustar00rootroot00000000000000module.exports = defineTest({ description: 'nested chunks', options: { input: { main1: 'main1', 'nested/main2': 'main2' }, external: './external.js' } }); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/000077500000000000000000000000001450520414700250355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/amd/000077500000000000000000000000001450520414700255765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/amd/generated-dep.js000066400000000000000000000001531450520414700306370ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/amd/generated-dynamic.js000066400000000000000000000001531450520414700315130ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 43; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/amd/main1.js000066400000000000000000000014721450520414700271450ustar00rootroot00000000000000define(['require', './generated-dep'], (function (require, dep) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } console.log('main1', dep.value); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(result => console.log(result)); new Promise(function (resolve, reject) { require(['./external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }).then(result => console.log(result)); })); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/amd/nested/000077500000000000000000000000001450520414700270605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/amd/nested/main2.js000066400000000000000000000014751450520414700304330ustar00rootroot00000000000000define(['require', '../generated-dep'], (function (require, dep) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } console.log('main2', dep.value); new Promise(function (resolve, reject) { require(['../generated-dynamic'], resolve, reject); }).then(result => console.log(result)); new Promise(function (resolve, reject) { require(['../external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }).then(result => console.log(result)); })); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/cjs/000077500000000000000000000000001450520414700256145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/cjs/generated-dep.js000066400000000000000000000000711450520414700306540ustar00rootroot00000000000000'use strict'; const value = 42; exports.value = value; rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/cjs/generated-dynamic.js000066400000000000000000000000711450520414700315300ustar00rootroot00000000000000'use strict'; const value = 43; exports.value = value; rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/cjs/main1.js000066400000000000000000000004171450520414700271610ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep.value); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(result => console.log(result)); import('./external.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/cjs/nested/000077500000000000000000000000001450520414700270765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/cjs/nested/main2.js000066400000000000000000000004221450520414700304400ustar00rootroot00000000000000'use strict'; var dep = require('../generated-dep.js'); console.log('main2', dep.value); Promise.resolve().then(function () { return require('../generated-dynamic.js'); }).then(result => console.log(result)); import('../external.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/es/000077500000000000000000000000001450520414700254445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/es/generated-dep.js000066400000000000000000000000521450520414700305030ustar00rootroot00000000000000const value = 42; export { value as v }; rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/es/generated-dynamic.js000066400000000000000000000000451450520414700313610ustar00rootroot00000000000000const value = 43; export { value }; rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/es/main1.js000066400000000000000000000003231450520414700270050ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('main1', value); import('./generated-dynamic.js').then(result => console.log(result)); import('./external.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/es/nested/000077500000000000000000000000001450520414700267265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/es/nested/main2.js000066400000000000000000000003261450520414700302730ustar00rootroot00000000000000import { v as value } from '../generated-dep.js'; console.log('main2', value); import('../generated-dynamic.js').then(result => console.log(result)); import('../external.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/system/000077500000000000000000000000001450520414700263615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/system/generated-dep.js000066400000000000000000000002201450520414700314150ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('v', 42); }) }; })); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/system/generated-dynamic.js000066400000000000000000000002241450520414700322750ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 43); }) }; })); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/system/main1.js000066400000000000000000000006101450520414700277210ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function (exports, module) { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main1', value); module.import('./generated-dynamic.js').then(result => console.log(result)); module.import('./external.js').then(result => console.log(result)); }) }; })); rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/system/nested/000077500000000000000000000000001450520414700276435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-chunks/_expected/system/nested/main2.js000066400000000000000000000006131450520414700312070ustar00rootroot00000000000000System.register(['../generated-dep.js'], (function (exports, module) { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main2', value); module.import('../generated-dynamic.js').then(result => console.log(result)); module.import('../external.js').then(result => console.log(result)); }) }; })); rollup-3.29.4/test/chunking-form/samples/nested-chunks/dep.js000066400000000000000000000000311450520414700241750ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/chunking-form/samples/nested-chunks/dynamic.js000066400000000000000000000000311450520414700250510ustar00rootroot00000000000000export const value = 43; rollup-3.29.4/test/chunking-form/samples/nested-chunks/main1.js000066400000000000000000000002721450520414700244410ustar00rootroot00000000000000import { value } from './dep.js'; console.log('main1', value); import('./dynamic.js').then(result => console.log(result)); import('./external.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/nested-chunks/main2.js000066400000000000000000000002721450520414700244420ustar00rootroot00000000000000import { value } from './dep.js'; console.log('main2', value); import('./dynamic.js').then(result => console.log(result)); import('./external.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/000077500000000000000000000000001450520414700247215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_config.js000066400000000000000000000002051450520414700266600ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles dynamic imports containing dynamic imports', options: { input: 'main' } }); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/000077500000000000000000000000001450520414700266615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/000077500000000000000000000000001450520414700274225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic1.js000066400000000000000000000002731450520414700334230ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); console.log('dynamic1'); })); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic2.js000066400000000000000000000002731450520414700334240ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic3'], resolve, reject); }); console.log('dynamic2'); })); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic3.js000066400000000000000000000002731450520414700334250ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic4'], resolve, reject); }); console.log('dynamic3'); })); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic4.js000066400000000000000000000002731450520414700334260ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic5'], resolve, reject); }); console.log('dynamic4'); })); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic5.js000066400000000000000000000001051450520414700334210ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dynamic5'); })); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/main.js000066400000000000000000000002671450520414700307110ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/000077500000000000000000000000001450520414700274405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic1.js000066400000000000000000000001741450520414700334410ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); console.log('dynamic1'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic2.js000066400000000000000000000001741450520414700334420ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic3.js'); }); console.log('dynamic2'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic3.js000066400000000000000000000001741450520414700334430ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic4.js'); }); console.log('dynamic3'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic4.js000066400000000000000000000001741450520414700334440ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic5.js'); }); console.log('dynamic4'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic5.js000066400000000000000000000000501450520414700334360ustar00rootroot00000000000000'use strict'; console.log('dynamic5'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/main.js000066400000000000000000000001701450520414700307200ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); console.log('main'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/es/000077500000000000000000000000001450520414700272705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic1.js000066400000000000000000000000741450520414700332700ustar00rootroot00000000000000import('./generated-dynamic2.js'); console.log('dynamic1'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic2.js000066400000000000000000000000741450520414700332710ustar00rootroot00000000000000import('./generated-dynamic3.js'); console.log('dynamic2'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic3.js000066400000000000000000000000741450520414700332720ustar00rootroot00000000000000import('./generated-dynamic4.js'); console.log('dynamic3'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic4.js000066400000000000000000000000741450520414700332730ustar00rootroot00000000000000import('./generated-dynamic5.js'); console.log('dynamic4'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic5.js000066400000000000000000000000311450520414700332650ustar00rootroot00000000000000console.log('dynamic5'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/es/main.js000066400000000000000000000000701450520414700305470ustar00rootroot00000000000000import('./generated-dynamic1.js'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/system/000077500000000000000000000000001450520414700302055ustar00rootroot00000000000000generated-dynamic1.js000066400000000000000000000002761450520414700341320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic2.js'); console.log('dynamic1'); }) }; })); generated-dynamic2.js000066400000000000000000000002761450520414700341330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic3.js'); console.log('dynamic2'); }) }; })); generated-dynamic3.js000066400000000000000000000002761450520414700341340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic4.js'); console.log('dynamic3'); }) }; })); generated-dynamic4.js000066400000000000000000000002761450520414700341350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic5.js'); console.log('dynamic4'); }) }; })); generated-dynamic5.js000066400000000000000000000002021450520414700341230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dynamic5'); }) }; })); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/_expected/system/main.js000066400000000000000000000002721450520414700314700ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic1.js'); console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/dynamic1.js000066400000000000000000000000621450520414700267620ustar00rootroot00000000000000import('./dynamic2.js'); console.log('dynamic1'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/dynamic2.js000066400000000000000000000000621450520414700267630ustar00rootroot00000000000000import('./dynamic3.js'); console.log('dynamic2'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/dynamic3.js000066400000000000000000000000621450520414700267640ustar00rootroot00000000000000import('./dynamic4.js'); console.log('dynamic3'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/dynamic4.js000066400000000000000000000000621450520414700267650ustar00rootroot00000000000000import('./dynamic5.js'); console.log('dynamic4'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/dynamic5.js000066400000000000000000000000311450520414700267620ustar00rootroot00000000000000console.log('dynamic5'); rollup-3.29.4/test/chunking-form/samples/nested-dynamic-imports/main.js000066400000000000000000000000561450520414700262040ustar00rootroot00000000000000import('./dynamic1.js'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/000077500000000000000000000000001450520414700255435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_config.js000066400000000000000000000003141450520414700275030ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to disable the minification of internal exports', options: { input: ['main1.js', 'main2.js'], output: { minifyInternalExports: false } } }); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/000077500000000000000000000000001450520414700275035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/amd/000077500000000000000000000000001450520414700302445ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000004071450520414700340100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const shared1 = 'shared1'; const foo$1 = 'foo1'; var shared2 = 'shared2'; const foo = 'foo2'; exports.foo = foo$1; exports.foo$1 = foo; exports.shared1 = shared1; exports.shared2 = shared2; })); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/amd/main1.js000066400000000000000000000002101450520414700316000ustar00rootroot00000000000000define(['./generated-shared2'], (function (shared2) { 'use strict'; console.log(shared2.shared1, shared2.shared2, shared2.foo); })); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/amd/main2.js000066400000000000000000000002121450520414700316030ustar00rootroot00000000000000define(['./generated-shared2'], (function (shared2) { 'use strict'; console.log(shared2.shared1, shared2.shared2, shared2.foo$1); })); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/cjs/000077500000000000000000000000001450520414700302625ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000003171450520414700340260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/cjs'use strict'; const shared1 = 'shared1'; const foo$1 = 'foo1'; var shared2 = 'shared2'; const foo = 'foo2'; exports.foo = foo$1; exports.foo$1 = foo; exports.shared1 = shared1; exports.shared2 = shared2; rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/cjs/main1.js000066400000000000000000000001751450520414700316300ustar00rootroot00000000000000'use strict'; var shared2 = require('./generated-shared2.js'); console.log(shared2.shared1, shared2.shared2, shared2.foo); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/cjs/main2.js000066400000000000000000000001771450520414700316330ustar00rootroot00000000000000'use strict'; var shared2 = require('./generated-shared2.js'); console.log(shared2.shared1, shared2.shared2, shared2.foo$1); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/es/000077500000000000000000000000001450520414700301125ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000002311450520414700336510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/esconst shared1 = 'shared1'; const foo$1 = 'foo1'; var shared2 = 'shared2'; const foo = 'foo2'; export { foo$1 as foo, foo as foo$1, shared1, shared2 }; rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/es/main1.js000066400000000000000000000001451450520414700314550ustar00rootroot00000000000000import { shared1, shared2, foo } from './generated-shared2.js'; console.log(shared1, shared2, foo); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/es/main2.js000066400000000000000000000001561450520414700314600ustar00rootroot00000000000000import { shared1, shared2, foo$1 as foo } from './generated-shared2.js'; console.log(shared1, shared2, foo); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/system/000077500000000000000000000000001450520414700310275ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000004421450520414700345720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const shared1 = exports('shared1', 'shared1'); const foo$1 = exports('foo', 'foo1'); var shared2 = exports('shared2', 'shared2'); const foo = exports('foo$1', 'foo2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/system/main1.js000066400000000000000000000004661450520414700324000ustar00rootroot00000000000000System.register(['./generated-shared2.js'], (function () { 'use strict'; var shared1, shared2, foo; return { setters: [function (module) { shared1 = module.shared1; shared2 = module.shared2; foo = module.foo; }], execute: (function () { console.log(shared1, shared2, foo); }) }; })); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/_expected/system/main2.js000066400000000000000000000004701450520414700323740ustar00rootroot00000000000000System.register(['./generated-shared2.js'], (function () { 'use strict'; var shared1, shared2, foo; return { setters: [function (module) { shared1 = module.shared1; shared2 = module.shared2; foo = module.foo$1; }], execute: (function () { console.log(shared1, shared2, foo); }) }; })); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/main1.js000066400000000000000000000001601450520414700271030ustar00rootroot00000000000000import { shared1, foo } from './shared1'; import shared2 from './shared2'; console.log(shared1, shared2, foo); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/main2.js000066400000000000000000000001641450520414700271100ustar00rootroot00000000000000import { shared1 } from './shared1'; import shared2, { foo } from './shared2'; console.log(shared1, shared2, foo); rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/shared1.js000066400000000000000000000000751450520414700274320ustar00rootroot00000000000000export const shared1 = 'shared1'; export const foo = 'foo1'; rollup-3.29.4/test/chunking-form/samples/no-minify-internal-exports/shared2.js000066400000000000000000000000651450520414700274320ustar00rootroot00000000000000export default 'shared2'; export const foo = 'foo2'; rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/000077500000000000000000000000001450520414700244025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_config.js000066400000000000000000000004541450520414700263470ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes all imports when setting moduleSideEffects to "no-treeshake"', options: { input: ['main1', 'main2'], plugins: { transform(code, id) { if (id.includes('main')) { return { moduleSideEffects: 'no-treeshake' }; } } } } }); rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/000077500000000000000000000000001450520414700263425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/amd/000077500000000000000000000000001450520414700271035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/amd/generated-empty.js000066400000000000000000000000541450520414700325320ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/amd/main1.js000066400000000000000000000001611450520414700304440ustar00rootroot00000000000000define(['./generated-empty'], (function (empty) { 'use strict'; console.log('main1'); const unused = 1; })); rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/amd/main2.js000066400000000000000000000001611450520414700304450ustar00rootroot00000000000000define(['./generated-empty'], (function (empty) { 'use strict'; console.log('main2'); const unused = 2; })); rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/cjs/000077500000000000000000000000001450520414700271215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/cjs/generated-empty.js000066400000000000000000000000171450520414700325470ustar00rootroot00000000000000'use strict'; rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/cjs/main1.js000066400000000000000000000001311450520414700304570ustar00rootroot00000000000000'use strict'; require('./generated-empty.js'); console.log('main1'); const unused = 1; rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/cjs/main2.js000066400000000000000000000001311450520414700304600ustar00rootroot00000000000000'use strict'; require('./generated-empty.js'); console.log('main2'); const unused = 2; rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/es/000077500000000000000000000000001450520414700267515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/es/generated-empty.js000066400000000000000000000000011450520414700323700ustar00rootroot00000000000000 rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/es/main1.js000066400000000000000000000001101450520414700303040ustar00rootroot00000000000000import './generated-empty.js'; console.log('main1'); const unused = 1; rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/es/main2.js000066400000000000000000000001101450520414700303050ustar00rootroot00000000000000import './generated-empty.js'; console.log('main2'); const unused = 2; rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/system/000077500000000000000000000000001450520414700276665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/system/generated-empty.js000066400000000000000000000001471450520414700333200ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/system/main1.js000066400000000000000000000002751450520414700312350ustar00rootroot00000000000000System.register(['./generated-empty.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main1'); const unused = 1; }) }; })); rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/_expected/system/main2.js000066400000000000000000000002751450520414700312360ustar00rootroot00000000000000System.register(['./generated-empty.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main2'); const unused = 2; }) }; })); rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/empty.js000066400000000000000000000000001450520414700260640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/main1.js000066400000000000000000000000731450520414700257450ustar00rootroot00000000000000import './empty'; console.log('main1'); const unused = 1; rollup-3.29.4/test/chunking-form/samples/no-treeshake-imports/main2.js000066400000000000000000000000731450520414700257460ustar00rootroot00000000000000import './empty'; console.log('main2'); const unused = 2; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/000077500000000000000000000000001450520414700254765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/000077500000000000000000000000001450520414700306265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_config.js000066400000000000000000000002311450520414700325640ustar00rootroot00000000000000module.exports = defineTest({ description: 'Never creates facades for allow-extension', options: { preserveEntrySignatures: 'allow-extension' } }); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/000077500000000000000000000000001450520414700325665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/amd/000077500000000000000000000000001450520414700333275ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001441450520414700371650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/amddefine(['./main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); main.js000066400000000000000000000005561450520414700345400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; const unused = 'unused'; const dynamic = new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); globalThis.sharedStatic = shared; exports.dynamic = dynamic; exports.shared = shared; exports.unused = unused; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/cjs/000077500000000000000000000000001450520414700333455ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001311450520414700371770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/cjs'use strict'; var main = require('./main.js'); globalThis.sharedDynamic = main.shared; main.js000066400000000000000000000004261450520414700345520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/cjs'use strict'; const shared = 'shared'; const unused = 'unused'; const dynamic = Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); globalThis.sharedStatic = shared; exports.dynamic = dynamic; exports.shared = shared; exports.unused = unused; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/es/000077500000000000000000000000001450520414700331755ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001151450520414700370310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/esimport { s as shared } from './main.js'; globalThis.sharedDynamic = shared; main.js000066400000000000000000000002621450520414700344000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/esconst shared = 'shared'; const unused = 'unused'; const dynamic = import('./generated-dynamic.js'); globalThis.sharedStatic = shared; export { dynamic, shared as s, unused }; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/system/000077500000000000000000000000001450520414700341125ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003401450520414700377460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { globalThis.sharedDynamic = shared; }) }; })); main.js000066400000000000000000000005051450520414700353150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); const unused = exports('unused', 'unused'); const dynamic = exports('dynamic', module.import('./generated-dynamic.js')); globalThis.sharedStatic = shared; }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/dynamic.js000066400000000000000000000001071450520414700326060ustar00rootroot00000000000000import { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/lib.js000066400000000000000000000000401450520414700317240ustar00rootroot00000000000000export const shared = 'shared'; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/allow-extension/main.js000066400000000000000000000002261450520414700321100ustar00rootroot00000000000000import { shared } from './lib.js'; export const unused = 'unused'; export const dynamic = import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/000077500000000000000000000000001450520414700322755ustar00rootroot00000000000000_config.js000066400000000000000000000002561450520414700341630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exportsmodule.exports = defineTest({ description: 'Does not create a facade for exports-only if there are no exports', options: { preserveEntrySignatures: 'exports-only' } }); _expected/000077500000000000000000000000001450520414700341565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exportsamd/000077500000000000000000000000001450520414700347175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expectedgenerated-dynamic.js000066400000000000000000000001441450520414700406340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/amddefine(['./main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); main.js000066400000000000000000000004161450520414700362020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); globalThis.sharedStatic = shared; exports.shared = shared; })); cjs/000077500000000000000000000000001450520414700347355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expectedgenerated-dynamic.js000066400000000000000000000001311450520414700406460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/cjs'use strict'; var main = require('./main.js'); globalThis.sharedDynamic = main.shared; main.js000066400000000000000000000002711450520414700362170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/cjs'use strict'; const shared = 'shared'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); globalThis.sharedStatic = shared; exports.shared = shared; es/000077500000000000000000000000001450520414700345655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expectedgenerated-dynamic.js000066400000000000000000000001151450520414700405000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/esimport { s as shared } from './main.js'; globalThis.sharedDynamic = shared; main.js000066400000000000000000000001701450520414700360450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/esconst shared = 'shared'; import('./generated-dynamic.js'); globalThis.sharedStatic = shared; export { shared as s }; system/000077500000000000000000000000001450520414700355025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expectedgenerated-dynamic.js000066400000000000000000000003401450520414700414150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { globalThis.sharedDynamic = shared; }) }; })); main.js000066400000000000000000000003621450520414700367650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); module.import('./generated-dynamic.js'); globalThis.sharedStatic = shared; }) }; })); dynamic.js000066400000000000000000000001071450520414700341760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exportsimport { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/lib.js000066400000000000000000000000401450520414700333730ustar00rootroot00000000000000export const shared = 'shared'; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/main.js000066400000000000000000000001371450520414700335600ustar00rootroot00000000000000import { shared } from './lib.js'; import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/000077500000000000000000000000001450520414700301615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_config.js000066400000000000000000000002601450520414700321210ustar00rootroot00000000000000module.exports = defineTest({ description: 'Creates a facade if necessary for exports-only if there are exports', options: { preserveEntrySignatures: 'exports-only' } }); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/000077500000000000000000000000001450520414700321215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/amd/000077500000000000000000000000001450520414700326625ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001561450520414700365230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/amddefine(['./generated-main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); generated-main.js000066400000000000000000000005561450520414700360270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; const unused = 'unused'; const dynamic = new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); globalThis.sharedStatic = shared; exports.dynamic = dynamic; exports.shared = shared; exports.unused = unused; })); main.js000066400000000000000000000002331450520414700340630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/amddefine(['exports', './generated-main'], (function (exports, main) { 'use strict'; exports.dynamic = main.dynamic; exports.unused = main.unused; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/cjs/000077500000000000000000000000001450520414700327005ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001431450520414700365350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/cjs'use strict'; var main = require('./generated-main.js'); globalThis.sharedDynamic = main.shared; generated-main.js000066400000000000000000000004261450520414700360410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/cjs'use strict'; const shared = 'shared'; const unused = 'unused'; const dynamic = Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); globalThis.sharedStatic = shared; exports.dynamic = dynamic; exports.shared = shared; exports.unused = unused; main.js000066400000000000000000000001731450520414700341040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/cjs'use strict'; var main = require('./generated-main.js'); exports.dynamic = main.dynamic; exports.unused = main.unused; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/es/000077500000000000000000000000001450520414700325305ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001271450520414700363670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/esimport { s as shared } from './generated-main.js'; globalThis.sharedDynamic = shared; generated-main.js000066400000000000000000000002741450520414700356720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/esconst shared = 'shared'; const unused = 'unused'; const dynamic = import('./generated-dynamic.js'); globalThis.sharedStatic = shared; export { dynamic as d, shared as s, unused as u }; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/es/main.js000066400000000000000000000001011450520414700340020ustar00rootroot00000000000000export { d as dynamic, u as unused } from './generated-main.js'; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/system/000077500000000000000000000000001450520414700334455ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003521450520414700373040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/systemSystem.register(['./generated-main.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { globalThis.sharedDynamic = shared; }) }; })); generated-main.js000066400000000000000000000004721450520414700366070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); const unused = exports('u', 'unused'); const dynamic = exports('d', module.import('./generated-dynamic.js')); globalThis.sharedStatic = shared; }) }; })); main.js000066400000000000000000000003361450520414700346520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/systemSystem.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ dynamic: module.d, unused: module.u }); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/dynamic.js000066400000000000000000000001071450520414700321410ustar00rootroot00000000000000import { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/lib.js000066400000000000000000000000401450520414700312570ustar00rootroot00000000000000export const shared = 'shared'; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/exports-only/main.js000066400000000000000000000002261450520414700314430ustar00rootroot00000000000000import { shared } from './lib.js'; export const unused = 'unused'; export const dynamic = import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/000077500000000000000000000000001450520414700265705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_config.js000066400000000000000000000002461450520414700305340ustar00rootroot00000000000000module.exports = defineTest({ description: 'Does not include entry exports and does not preserve the signature', options: { preserveEntrySignatures: false } }); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/000077500000000000000000000000001450520414700305305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/amd/000077500000000000000000000000001450520414700312715ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001441450520414700351270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/amddefine(['./main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/amd/main.js000066400000000000000000000004161450520414700325540ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); globalThis.sharedStatic = shared; exports.shared = shared; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/cjs/000077500000000000000000000000001450520414700313075ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001311450520414700351410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/cjs'use strict'; var main = require('./main.js'); globalThis.sharedDynamic = main.shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/cjs/main.js000066400000000000000000000002711450520414700325710ustar00rootroot00000000000000'use strict'; const shared = 'shared'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); globalThis.sharedStatic = shared; exports.shared = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/es/000077500000000000000000000000001450520414700311375ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001151450520414700347730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/esimport { s as shared } from './main.js'; globalThis.sharedDynamic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/es/main.js000066400000000000000000000001701450520414700324170ustar00rootroot00000000000000const shared = 'shared'; import('./generated-dynamic.js'); globalThis.sharedStatic = shared; export { shared as s }; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/system/000077500000000000000000000000001450520414700320545ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003401450520414700357100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { globalThis.sharedDynamic = shared; }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/_expected/system/main.js000066400000000000000000000003621450520414700333370ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); module.import('./generated-dynamic.js'); globalThis.sharedStatic = shared; }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/dynamic.js000066400000000000000000000001071450520414700305500ustar00rootroot00000000000000import { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/lib.js000066400000000000000000000000401450520414700276660ustar00rootroot00000000000000export const shared = 'shared'; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/false/main.js000066400000000000000000000002261450520414700300520ustar00rootroot00000000000000import { shared } from './lib.js'; export const unused = 'unused'; export const dynamic = import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/000077500000000000000000000000001450520414700313665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_config.js000066400000000000000000000013621450520414700333320ustar00rootroot00000000000000module.exports = defineTest({ description: 'Allows overriding behaviour for emitted chunks', options: { input: [], preserveEntrySignatures: 'allow-extension', plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'strict/main.js', name: 'strict', preserveSignature: 'strict' }); this.emitFile({ type: 'chunk', id: 'allow-extension/main.js', name: 'allow-extension', preserveSignature: 'allow-extension' }); this.emitFile({ type: 'chunk', id: 'false/main.js', name: 'false', preserveSignature: false }); this.emitFile({ type: 'chunk', id: 'not-specified/main.js', name: 'not-specified' }); } } } }); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/000077500000000000000000000000001450520414700333265ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700340105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expectedgenerated-allow-extension.js000066400000000000000000000004571450520414700414400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; console.log(shared); new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); const unused = 42; exports.shared = shared; exports.unused = unused; })); generated-dynamic.js000066400000000000000000000001441450520414700377250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['./generated-main'], (function (strict) { 'use strict'; console.log(strict.shared); })); generated-dynamic2.js000066400000000000000000000001771450520414700400150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['./generated-allow-extension'], (function (allowExtension) { 'use strict'; console.log(allowExtension.shared); })); generated-dynamic3.js000066400000000000000000000001451450520414700400110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['./generated-false'], (function (_false) { 'use strict'; console.log(_false.shared); })); generated-dynamic4.js000066400000000000000000000001711450520414700400110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['./generated-not-specified'], (function (notSpecified) { 'use strict'; console.log(notSpecified.shared); })); generated-false.js000066400000000000000000000004011450520414700373670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; console.log(shared); new Promise(function (resolve, reject) { require(['./generated-dynamic3'], resolve, reject); }); exports.shared = shared; })); generated-main.js000066400000000000000000000004561450520414700372330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; console.log(shared); new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); const unused = 42; exports.shared = shared; exports.unused = unused; })); generated-not-specified.js000066400000000000000000000004571450520414700410410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; console.log(shared); new Promise(function (resolve, reject) { require(['./generated-dynamic4'], resolve, reject); }); const unused = 42; exports.shared = shared; exports.unused = unused; })); generated-strict.js000066400000000000000000000001761450520414700376160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['exports', './generated-main'], (function (exports, strict) { 'use strict'; exports.unused = strict.unused; })); cjs/000077500000000000000000000000001450520414700340265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expectedgenerated-allow-extension.js000066400000000000000000000003301450520414700414440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; const shared = 'shared'; console.log(shared); Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); const unused = 42; exports.shared = shared; exports.unused = unused; generated-dynamic.js000066400000000000000000000001311450520414700377370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; var strict = require('./generated-main.js'); console.log(strict.shared); generated-dynamic2.js000066400000000000000000000001641450520414700400270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; var allowExtension = require('./generated-allow-extension.js'); console.log(allowExtension.shared); generated-dynamic3.js000066400000000000000000000001321450520414700400230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; var _false = require('./generated-false.js'); console.log(_false.shared); generated-dynamic4.js000066400000000000000000000001561450520414700400320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; var notSpecified = require('./generated-not-specified.js'); console.log(notSpecified.shared); generated-false.js000066400000000000000000000002541450520414700374130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; const shared = 'shared'; console.log(shared); Promise.resolve().then(function () { return require('./generated-dynamic3.js'); }); exports.shared = shared; generated-main.js000066400000000000000000000003271450520414700372460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; const shared = 'shared'; console.log(shared); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); const unused = 42; exports.shared = shared; exports.unused = unused; generated-not-specified.js000066400000000000000000000003301450520414700410450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; const shared = 'shared'; console.log(shared); Promise.resolve().then(function () { return require('./generated-dynamic4.js'); }); const unused = 42; exports.shared = shared; exports.unused = unused; generated-strict.js000066400000000000000000000001371450520414700376310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; var strict = require('./generated-main.js'); exports.unused = strict.unused; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/es/000077500000000000000000000000001450520414700337355ustar00rootroot00000000000000generated-allow-extension.js000066400000000000000000000002061450520414700412760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esconst shared = 'shared'; console.log(shared); import('./generated-dynamic2.js'); const unused = 42; export { shared as s, unused }; generated-dynamic.js000066400000000000000000000001111450520414700375650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esimport { s as shared } from './generated-main.js'; console.log(shared); generated-dynamic2.js000066400000000000000000000001241450520414700376530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esimport { s as shared } from './generated-allow-extension.js'; console.log(shared); generated-dynamic3.js000066400000000000000000000001121450520414700376510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esimport { s as shared } from './generated-false.js'; console.log(shared); generated-dynamic4.js000066400000000000000000000001221450520414700376530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esimport { s as shared } from './generated-not-specified.js'; console.log(shared); generated-false.js000066400000000000000000000001531450520414700372410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esconst shared = 'shared'; console.log(shared); import('./generated-dynamic3.js'); export { shared as s }; generated-main.js000066400000000000000000000002121450520414700370670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esconst shared = 'shared'; console.log(shared); import('./generated-dynamic.js'); const unused = 42; export { shared as s, unused as u }; generated-not-specified.js000066400000000000000000000002061450520414700406770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esconst shared = 'shared'; console.log(shared); import('./generated-dynamic4.js'); const unused = 42; export { shared as s, unused }; generated-strict.js000066400000000000000000000000631450520414700374570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esexport { u as unused } from './generated-main.js'; system/000077500000000000000000000000001450520414700345735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expectedgenerated-allow-extension.js000066400000000000000000000004161450520414700422160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); console.log(shared); module.import('./generated-dynamic2.js'); const unused = exports('unused', 42); }) }; })); generated-dynamic.js000066400000000000000000000003341450520414700405110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/systemSystem.register(['./generated-main.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { console.log(shared); }) }; })); generated-dynamic2.js000066400000000000000000000003471450520414700405770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/systemSystem.register(['./generated-allow-extension.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { console.log(shared); }) }; })); generated-dynamic3.js000066400000000000000000000003351450520414700405750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/systemSystem.register(['./generated-false.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { console.log(shared); }) }; })); generated-dynamic4.js000066400000000000000000000003451450520414700405770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/systemSystem.register(['./generated-not-specified.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { console.log(shared); }) }; })); generated-false.js000066400000000000000000000003451450520414700401610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); console.log(shared); module.import('./generated-dynamic3.js'); }) }; })); generated-main.js000066400000000000000000000004101450520414700400040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); console.log(shared); module.import('./generated-dynamic.js'); const unused = exports('u', 42); }) }; })); generated-not-specified.js000066400000000000000000000004161450520414700416170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); console.log(shared); module.import('./generated-dynamic4.js'); const unused = exports('unused', 42); }) }; })); generated-strict.js000066400000000000000000000003111450520414700403700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/systemSystem.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('unused', module.u); }], execute: (function () { }) }; })); allow-extension/000077500000000000000000000000001450520414700344375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugindynamic.js000066400000000000000000000000701450520414700364160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/allow-extensionimport { shared } from './lib.js'; console.log(shared); lib.js000066400000000000000000000000401450520414700355350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/allow-extensionexport const shared = 'shared'; main.js000066400000000000000000000001521450520414700357170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/allow-extensionimport { shared } from './lib.js'; console.log(shared); import('./dynamic.js'); export const unused = 42; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/false/000077500000000000000000000000001450520414700324605ustar00rootroot00000000000000dynamic.js000066400000000000000000000000701450520414700343600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/falseimport { shared } from './lib.js'; console.log(shared); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/false/lib.js000066400000000000000000000000401450520414700335560ustar00rootroot00000000000000export const shared = 'shared'; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/false/main.js000066400000000000000000000001521450520414700337400ustar00rootroot00000000000000import { shared } from './lib.js'; console.log(shared); import('./dynamic.js'); export const unused = 42; not-specified/000077500000000000000000000000001450520414700340405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugindynamic.js000066400000000000000000000000701450520414700360170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/not-specifiedimport { shared } from './lib.js'; console.log(shared); lib.js000066400000000000000000000000401450520414700351360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/not-specifiedexport const shared = 'shared'; main.js000066400000000000000000000001521450520414700353200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/not-specifiedimport { shared } from './lib.js'; console.log(shared); import('./dynamic.js'); export const unused = 42; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/strict/000077500000000000000000000000001450520414700326765ustar00rootroot00000000000000dynamic.js000066400000000000000000000000701450520414700345760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/strictimport { shared } from './lib.js'; console.log(shared); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/strict/lib.js000066400000000000000000000000401450520414700337740ustar00rootroot00000000000000export const shared = 'shared'; main.js000066400000000000000000000001521450520414700340770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/strictimport { shared } from './lib.js'; console.log(shared); import('./dynamic.js'); export const unused = 42; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/000077500000000000000000000000001450520414700270065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_config.js000066400000000000000000000002401450520414700307440ustar00rootroot00000000000000module.exports = defineTest({ description: 'Creates a facade if necessary for strict entry signatures', options: { preserveEntrySignatures: 'strict' } }); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/000077500000000000000000000000001450520414700307465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/amd/000077500000000000000000000000001450520414700315075ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001561450520414700353500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/amddefine(['./generated-main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); generated-main.js000066400000000000000000000005561450520414700346540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const shared = 'shared'; const unused = 'unused'; const dynamic = new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }); globalThis.sharedStatic = shared; exports.dynamic = dynamic; exports.shared = shared; exports.unused = unused; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/amd/main.js000066400000000000000000000002331450520414700327670ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, main) { 'use strict'; exports.dynamic = main.dynamic; exports.unused = main.unused; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/cjs/000077500000000000000000000000001450520414700315255ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001431450520414700353620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/cjs'use strict'; var main = require('./generated-main.js'); globalThis.sharedDynamic = main.shared; generated-main.js000066400000000000000000000004261450520414700346660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/cjs'use strict'; const shared = 'shared'; const unused = 'unused'; const dynamic = Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); globalThis.sharedStatic = shared; exports.dynamic = dynamic; exports.shared = shared; exports.unused = unused; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/cjs/main.js000066400000000000000000000001731450520414700330100ustar00rootroot00000000000000'use strict'; var main = require('./generated-main.js'); exports.dynamic = main.dynamic; exports.unused = main.unused; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/es/000077500000000000000000000000001450520414700313555ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001271450520414700352140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/esimport { s as shared } from './generated-main.js'; globalThis.sharedDynamic = shared; generated-main.js000066400000000000000000000002741450520414700345170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/esconst shared = 'shared'; const unused = 'unused'; const dynamic = import('./generated-dynamic.js'); globalThis.sharedStatic = shared; export { dynamic as d, shared as s, unused as u }; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/es/main.js000066400000000000000000000001011450520414700326270ustar00rootroot00000000000000export { d as dynamic, u as unused } from './generated-main.js'; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/system/000077500000000000000000000000001450520414700322725ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003521450520414700361310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/systemSystem.register(['./generated-main.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { globalThis.sharedDynamic = shared; }) }; })); generated-main.js000066400000000000000000000004721450520414700354340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); const unused = exports('u', 'unused'); const dynamic = exports('d', module.import('./generated-dynamic.js')); globalThis.sharedStatic = shared; }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/system/main.js000066400000000000000000000003361450520414700335560ustar00rootroot00000000000000System.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ dynamic: module.d, unused: module.u }); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/dynamic.js000066400000000000000000000001071450520414700307660ustar00rootroot00000000000000import { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/lib.js000066400000000000000000000000401450520414700301040ustar00rootroot00000000000000export const shared = 'shared'; rollup-3.29.4/test/chunking-form/samples/preserve-entry-signatures/strict/main.js000066400000000000000000000002261450520414700302700ustar00rootroot00000000000000import { shared } from './lib.js'; export const unused = 'unused'; export const dynamic = import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/000077500000000000000000000000001450520414700270325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_config.js000066400000000000000000000002731450520414700307760ustar00rootroot00000000000000module.exports = defineTest({ description: 'Uses entry point semantics for all files when preserving modules', options: { input: 'main.js', output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/000077500000000000000000000000001450520414700307725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/amd/000077500000000000000000000000001450520414700315335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/amd/default.js000066400000000000000000000001171450520414700335140ustar00rootroot00000000000000define((function () { 'use strict'; var foo = 'default'; return foo; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/amd/main.js000066400000000000000000000011121450520414700330100ustar00rootroot00000000000000define(['require', './default', './named'], (function (require, _default, named) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } console.log(_default, named.value); new Promise(function (resolve, reject) { require(['./default'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(result => console.log(result.default)); new Promise(function (resolve, reject) { require(['./named'], resolve, reject); }).then(result => console.log(result.value)); return _default; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/amd/named.js000066400000000000000000000001601450520414700331520ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 'named'; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/cjs/000077500000000000000000000000001450520414700315515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/cjs/default.js000066400000000000000000000000731450520414700335330ustar00rootroot00000000000000'use strict'; var foo = 'default'; module.exports = foo; rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/cjs/main.js000066400000000000000000000010231450520414700330270ustar00rootroot00000000000000'use strict'; var _default = require('./default.js'); var named = require('./named.js'); function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } console.log(_default, named.value); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./default.js')); }).then(result => console.log(result.default)); Promise.resolve().then(function () { return require('./named.js'); }).then(result => console.log(result.value)); module.exports = _default; rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/cjs/named.js000066400000000000000000000000761450520414700331760ustar00rootroot00000000000000'use strict'; const value = 'named'; exports.value = value; rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/es/000077500000000000000000000000001450520414700314015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/es/default.js000066400000000000000000000000611450520414700333600ustar00rootroot00000000000000var foo = 'default'; export { foo as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/es/main.js000066400000000000000000000003771450520414700326720ustar00rootroot00000000000000import foo from './default.js'; import { value } from './named.js'; console.log(foo, value); import('./default.js').then(result => console.log(result.default)); import('./named.js').then(result => console.log(result.value)); export { foo as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/es/named.js000066400000000000000000000000521450520414700330200ustar00rootroot00000000000000const value = 'named'; export { value }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/system/000077500000000000000000000000001450520414700323165ustar00rootroot00000000000000default.js000066400000000000000000000002311450520414700342150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('default', 'default'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/system/main.js000066400000000000000000000007571450520414700336110ustar00rootroot00000000000000System.register(['./default.js', './named.js'], (function (exports, module) { 'use strict'; var foo, value; return { setters: [function (module) { foo = module.default; exports('default', module.default); }, function (module) { value = module.value; }], execute: (function () { console.log(foo, value); module.import('./default.js').then(result => console.log(result.default)); module.import('./named.js').then(result => console.log(result.value)); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/system/named.js000066400000000000000000000002311450520414700337340ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 'named'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/default.js000066400000000000000000000000321450520414700310070ustar00rootroot00000000000000export default 'default'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/main.js000066400000000000000000000004051450520414700303130ustar00rootroot00000000000000import foo from './default.js'; import { value } from './named.js'; console.log(foo, value); export { default } from './default.js'; import('./default').then(result => console.log(result.default)); import('./named').then(result => console.log(result.value)); rollup-3.29.4/test/chunking-form/samples/preserve-modules-auto-export-mode/named.js000066400000000000000000000000361450520414700304530ustar00rootroot00000000000000export const value = 'named'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/000077500000000000000000000000001450520414700254465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_config.js000066400000000000000000000004651450520414700274150ustar00rootroot00000000000000const commonjs = require('@rollup/plugin-commonjs'); module.exports = defineTest({ description: 'Handles output from @rollup/plugin-commonjs', expectedWarnings: ['MIXED_EXPORTS'], options: { input: 'main.js', external: ['external'], plugins: [commonjs()], output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/000077500000000000000000000000001450520414700274065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/000077500000000000000000000000001450520414700301475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/_virtual/000077500000000000000000000000001450520414700317745ustar00rootroot00000000000000_commonjsHelpers.js000066400000000000000000000004141450520414700355610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } exports.getDefaultExportFromCjs = getDefaultExportFromCjs; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/_virtual/other.js000066400000000000000000000001551450520414700334540ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var other = {}; exports.__exports = other; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/commonjs.js000066400000000000000000000005751450520414700323410ustar00rootroot00000000000000define(['./_virtual/_commonjsHelpers', 'external', './other', './_virtual/other'], (function (_commonjsHelpers, require$$0, other$1, other) { 'use strict'; const external = require$$0; const { value } = other.__exports; console.log(external, value); var commonjs = 42; var value$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(commonjs); return value$1; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/main.js000066400000000000000000000001771450520414700314360ustar00rootroot00000000000000define(['./commonjs', 'external'], (function (commonjs, require$$0) { 'use strict'; console.log(commonjs, require$$0); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/other.js000066400000000000000000000001751450520414700316310ustar00rootroot00000000000000define(['./_virtual/other'], (function (other) { 'use strict'; other.__exports.value = 43; return other.__exports; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/000077500000000000000000000000001450520414700301655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/_virtual/000077500000000000000000000000001450520414700320125ustar00rootroot00000000000000_commonjsHelpers.js000066400000000000000000000003301450520414700355740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/_virtual'use strict'; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } exports.getDefaultExportFromCjs = getDefaultExportFromCjs; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/_virtual/other.js000066400000000000000000000000731450520414700334710ustar00rootroot00000000000000'use strict'; var other = {}; exports.__exports = other; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/commonjs.js000066400000000000000000000006311450520414700323500ustar00rootroot00000000000000'use strict'; var _commonjsHelpers = require('./_virtual/_commonjsHelpers.js'); var require$$0 = require('external'); require('./other.js'); var other = require('./_virtual/other.js'); const external = require$$0; const { value } = other.__exports; console.log(external, value); var commonjs = 42; var value$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(commonjs); module.exports = value$1; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/main.js000066400000000000000000000002021450520414700314410ustar00rootroot00000000000000'use strict'; var commonjs = require('./commonjs.js'); var require$$0 = require('external'); console.log(commonjs, require$$0); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/other.js000066400000000000000000000001731450520414700316450ustar00rootroot00000000000000'use strict'; var other = require('./_virtual/other.js'); other.__exports.value = 43; module.exports = other.__exports; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/000077500000000000000000000000001450520414700300155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/_virtual/000077500000000000000000000000001450520414700316425ustar00rootroot00000000000000_commonjsHelpers.js000066400000000000000000000002621450520414700354300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/_virtualfunction getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } export { getDefaultExportFromCjs }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/_virtual/other.js000066400000000000000000000000601450520414700333150ustar00rootroot00000000000000var other = {}; export { other as __exports }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/commonjs.js000066400000000000000000000006051450520414700322010ustar00rootroot00000000000000import { getDefaultExportFromCjs } from './_virtual/_commonjsHelpers.js'; import require$$0 from 'external'; import './other.js'; import { __exports as other } from './_virtual/other.js'; const external = require$$0; const { value } = other; console.log(external, value); var commonjs = 42; var value$1 = /*@__PURE__*/getDefaultExportFromCjs(commonjs); export { value$1 as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/main.js000066400000000000000000000001471450520414700313010ustar00rootroot00000000000000import value from './commonjs.js'; import require$$0 from 'external'; console.log(value, require$$0); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/other.js000066400000000000000000000001531450520414700314730ustar00rootroot00000000000000import { __exports as other } from './_virtual/other.js'; other.value = 43; export { other as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/000077500000000000000000000000001450520414700307325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/_virtual/000077500000000000000000000000001450520414700325575ustar00rootroot00000000000000_commonjsHelpers.js000066400000000000000000000005041450520414700363440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('getDefaultExportFromCjs', getDefaultExportFromCjs); function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } }) }; })); other.js000066400000000000000000000002261450520414700341570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var other = exports('__exports', {}); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/commonjs.js000066400000000000000000000012221450520414700331120ustar00rootroot00000000000000System.register(['./_virtual/_commonjsHelpers.js', 'external', './other.js', './_virtual/other.js'], (function (exports) { 'use strict'; var getDefaultExportFromCjs, require$$0, other; return { setters: [function (module) { getDefaultExportFromCjs = module.getDefaultExportFromCjs; }, function (module) { require$$0 = module.default; }, null, function (module) { other = module.__exports; }], execute: (function () { const external = require$$0; const { value } = other; console.log(external, value); var commonjs = 42; var value$1 = exports('default', /*@__PURE__*/getDefaultExportFromCjs(commonjs)); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/main.js000066400000000000000000000004661450520414700322220ustar00rootroot00000000000000System.register(['./commonjs.js', 'external'], (function () { 'use strict'; var value, require$$0; return { setters: [function (module) { value = module.default; }, function (module) { require$$0 = module.default; }], execute: (function () { console.log(value, require$$0); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/other.js000066400000000000000000000004171450520414700324130ustar00rootroot00000000000000System.register(['./_virtual/other.js'], (function (exports) { 'use strict'; var other; return { setters: [function (module) { other = module.__exports; exports('default', module.__exports); }], execute: (function () { other.value = 43; }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/commonjs.js000066400000000000000000000002011450520414700276220ustar00rootroot00000000000000const external = require('external'); const { value } = require('./other'); console.log(external, value); module.exports = 42; rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/main.js000066400000000000000000000001411450520414700267240ustar00rootroot00000000000000import value from './commonjs'; import external from 'external'; console.log(value, external); rollup-3.29.4/test/chunking-form/samples/preserve-modules-commonjs/other.js000066400000000000000000000000241450520414700271210ustar00rootroot00000000000000exports.value = 43; rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/000077500000000000000000000000001450520414700301215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_config.js000066400000000000000000000003231450520414700320610ustar00rootroot00000000000000module.exports = defineTest({ description: 'import namespace from chunks with default export mode when preserving modules', options: { input: ['main', 'lib'], output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/000077500000000000000000000000001450520414700320615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/amd/000077500000000000000000000000001450520414700326225ustar00rootroot00000000000000lib.js000066400000000000000000000001131450520414700336420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/amddefine((function () { 'use strict'; var lib = 'foo'; return lib; })); main.js000066400000000000000000000007621450520414700340320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/amddefine(['require', 'exports', './lib'], (function (require, exports, lib) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } var lib__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(lib); console.log(lib__namespace); new Promise(function (resolve, reject) { require(['./lib'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(console.log); exports.lib = lib__namespace; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/cjs/000077500000000000000000000000001450520414700326405ustar00rootroot00000000000000lib.js000066400000000000000000000000671450520414700336700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/cjs'use strict'; var lib = 'foo'; module.exports = lib; main.js000066400000000000000000000006311450520414700340430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/cjs'use strict'; var lib = require('./lib.js'); function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } var lib__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(lib); console.log(lib__namespace); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./lib.js')); }).then(console.log); exports.lib = lib__namespace; rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/es/000077500000000000000000000000001450520414700324705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/es/lib.js000066400000000000000000000000551450520414700335740ustar00rootroot00000000000000var lib = 'foo'; export { lib as default }; main.js000066400000000000000000000001531450520414700336720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/esimport * as lib from './lib.js'; console.log(lib); import('./lib.js').then(console.log); export { lib }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/system/000077500000000000000000000000001450520414700334055ustar00rootroot00000000000000lib.js000066400000000000000000000002251450520414700344310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var lib = exports('default', 'foo'); }) }; })); main.js000066400000000000000000000004401450520414700346060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/systemSystem.register(['./lib.js'], (function (exports, module) { 'use strict'; var lib; return { setters: [function (module) { lib = module; exports('lib', module); }], execute: (function () { console.log(lib); module.import('./lib.js').then(console.log); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/lib.js000066400000000000000000000000261450520414700312230ustar00rootroot00000000000000export default 'foo'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace/main.js000066400000000000000000000001511450520414700314000ustar00rootroot00000000000000import * as lib from './lib.js'; console.log(lib); import('./lib.js').then(console.log); export { lib }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/000077500000000000000000000000001450520414700302035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_config.js000066400000000000000000000003231450520414700321430ustar00rootroot00000000000000module.exports = defineTest({ description: 'import namespace from chunks with default export mode when preserving modules', options: { input: ['main', 'lib'], output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/000077500000000000000000000000001450520414700321435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/amd/000077500000000000000000000000001450520414700327045ustar00rootroot00000000000000lib.js000066400000000000000000000001131450520414700337240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/amddefine((function () { 'use strict'; var lib = 'foo'; return lib; })); main.js000066400000000000000000000004051450520414700341060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/amddefine(['./lib'], (function (lib) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } var lib__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(lib); console.log(lib__namespace); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/cjs/000077500000000000000000000000001450520414700327225ustar00rootroot00000000000000lib.js000066400000000000000000000000671450520414700337520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/cjs'use strict'; var lib = 'foo'; module.exports = lib; main.js000066400000000000000000000003701450520414700341250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/cjs'use strict'; var lib = require('./lib.js'); function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } var lib__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(lib); console.log(lib__namespace); rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/es/000077500000000000000000000000001450520414700325525ustar00rootroot00000000000000lib.js000066400000000000000000000000551450520414700335770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/esvar lib = 'foo'; export { lib as default }; main.js000066400000000000000000000000641450520414700337550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/esimport * as lib from './lib.js'; console.log(lib); rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/system/000077500000000000000000000000001450520414700334675ustar00rootroot00000000000000lib.js000066400000000000000000000002251450520414700345130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var lib = exports('default', 'foo'); }) }; })); main.js000066400000000000000000000003061450520414700346710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/systemSystem.register(['./lib.js'], (function () { 'use strict'; var lib; return { setters: [function (module) { lib = module; }], execute: (function () { console.log(lib); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/lib.js000066400000000000000000000000261450520414700313050ustar00rootroot00000000000000export default 'foo'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-default-mode-namespace2/main.js000066400000000000000000000000631450520414700314640ustar00rootroot00000000000000import * as lib from './lib.js'; console.log(lib); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/000077500000000000000000000000001450520414700267405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_config.js000066400000000000000000000002721450520414700307030ustar00rootroot00000000000000module.exports = defineTest({ description: 'dynamic imports are handled correctly when preserving modules', options: { input: ['main.js'], output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/000077500000000000000000000000001450520414700307005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/amd/000077500000000000000000000000001450520414700314415ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000001631450520414700351310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'included'; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/amd/main.js000066400000000000000000000003031450520414700327170ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./dynamic-included'], resolve, reject); }).then(result => console.log(result)); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/cjs/000077500000000000000000000000001450520414700314575ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000001011450520414700351370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/cjs'use strict'; const value = 'included'; exports.value = value; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/cjs/main.js000066400000000000000000000002051450520414700327360ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./dynamic-included.js'); }).then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/es/000077500000000000000000000000001450520414700313075ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000000551450520414700347770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/esconst value = 'included'; export { value }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/es/main.js000066400000000000000000000001051450520414700325650ustar00rootroot00000000000000import('./dynamic-included.js').then(result => console.log(result)); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/system/000077500000000000000000000000001450520414700322245ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000002341450520414700357130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 'included'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/system/main.js000066400000000000000000000003041450520414700335030ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./dynamic-included.js').then(result => console.log(result)); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/dynamic-included.js000066400000000000000000000000411450520414700325020ustar00rootroot00000000000000export const value = 'included'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/dynamic-removed.js000066400000000000000000000000401450520414700323530ustar00rootroot00000000000000export const value = 'removed'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-imports/main.js000066400000000000000000000002551450520414700302240ustar00rootroot00000000000000import('./dynamic-included').then(result => console.log(result)); const include = false; if (include) { import('./dynamic-removed').then(result => console.log(result)); } rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/000077500000000000000000000000001450520414700271775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_config.js000066400000000000000000000003011450520414700311330ustar00rootroot00000000000000module.exports = defineTest({ description: 'Preserve modules properly handles internal namespace imports (#2576)', options: { input: ['main.js'], output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/000077500000000000000000000000001450520414700311375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/000077500000000000000000000000001450520414700317005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/m1.js000066400000000000000000000001751450520414700325560ustar00rootroot00000000000000define(['exports', './m2', './m3'], (function (exports, m2, m3) { 'use strict'; exports.m2 = m2; exports.m3 = m3; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/m2.js000066400000000000000000000001111450520414700325450ustar00rootroot00000000000000define((function () { 'use strict'; var m2 = {a:1}; return m2; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/m3.js000066400000000000000000000001111450520414700325460ustar00rootroot00000000000000define((function () { 'use strict'; var m3 = {b:2}; return m3; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/main.js000066400000000000000000000001111450520414700331530ustar00rootroot00000000000000define(['./m1'], (function (m1) { 'use strict'; console.log(m1); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/000077500000000000000000000000001450520414700317165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/m1.js000066400000000000000000000001561450520414700325730ustar00rootroot00000000000000'use strict'; var m2 = require('./m2.js'); var m3 = require('./m3.js'); exports.m2 = m2; exports.m3 = m3; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/m2.js000066400000000000000000000000651450520414700325730ustar00rootroot00000000000000'use strict'; var m2 = {a:1}; module.exports = m2; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/m3.js000066400000000000000000000000651450520414700325740ustar00rootroot00000000000000'use strict'; var m3 = {b:2}; module.exports = m3; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/main.js000066400000000000000000000000761450520414700332030ustar00rootroot00000000000000'use strict'; var m1 = require('./m1.js'); console.log(m1); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/000077500000000000000000000000001450520414700315465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/m1.js000066400000000000000000000001221450520414700324140ustar00rootroot00000000000000export { default as m2 } from './m2.js'; export { default as m3 } from './m3.js'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/m2.js000066400000000000000000000000531450520414700324200ustar00rootroot00000000000000var m2 = {a:1}; export { m2 as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/m3.js000066400000000000000000000000531450520414700324210ustar00rootroot00000000000000var m3 = {b:2}; export { m3 as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/main.js000066400000000000000000000000611450520414700330250ustar00rootroot00000000000000import * as m1 from './m1.js'; console.log(m1); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/000077500000000000000000000000001450520414700324635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/m1.js000066400000000000000000000004051450520414700333350ustar00rootroot00000000000000System.register(['./m2.js', './m3.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('m2', module.default); }, function (module) { exports('m3', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/m2.js000066400000000000000000000002241450520414700333350ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var m2 = exports('default', {a:1}); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/m3.js000066400000000000000000000002241450520414700333360ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var m3 = exports('default', {b:2}); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/main.js000066400000000000000000000003021450520414700337400ustar00rootroot00000000000000System.register(['./m1.js'], (function () { 'use strict'; var m1; return { setters: [function (module) { m1 = module; }], execute: (function () { console.log(m1); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/m1.js000066400000000000000000000001361450520414700300520ustar00rootroot00000000000000import m2 from './m2.js'; import m3 from './m3.js'; // console.log('m1'); export { m2, m3 }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/m2.js000066400000000000000000000000431450520414700300500ustar00rootroot00000000000000var m2 = {a:1}; export default m2; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/m3.js000066400000000000000000000000431450520414700300510ustar00rootroot00000000000000var m3 = {b:2}; export default m3; rollup-3.29.4/test/chunking-form/samples/preserve-modules-dynamic-namespace/main.js000066400000000000000000000000611450520414700304560ustar00rootroot00000000000000import * as ms from './m1.js'; console.log(ms); rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/000077500000000000000000000000001450520414700247575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_config.js000066400000000000000000000002451450520414700267220ustar00rootroot00000000000000module.exports = defineTest({ description: 'Preserve modules remove empty dependencies', options: { input: 'main.js', output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/000077500000000000000000000000001450520414700267175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/amd/000077500000000000000000000000001450520414700274605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/amd/main.js000066400000000000000000000001231450520414700307360ustar00rootroot00000000000000define(['./two'], (function (two) { 'use strict'; window.APP = { a: two }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/amd/two.js000066400000000000000000000001041450520414700306220ustar00rootroot00000000000000define((function () { 'use strict'; var a = {}; return a; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/cjs/000077500000000000000000000000001450520414700274765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/cjs/main.js000066400000000000000000000001101450520414700307500ustar00rootroot00000000000000'use strict'; var two = require('./two.js'); window.APP = { a: two }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/cjs/two.js000066400000000000000000000000601450520414700306410ustar00rootroot00000000000000'use strict'; var a = {}; module.exports = a; rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/es/000077500000000000000000000000001450520414700273265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/es/main.js000066400000000000000000000000571450520414700306120ustar00rootroot00000000000000import a from './two.js'; window.APP = { a }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/es/two.js000066400000000000000000000000461450520414700304750ustar00rootroot00000000000000var a = {}; export { a as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/system/000077500000000000000000000000001450520414700302435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/system/main.js000066400000000000000000000003141450520414700315230ustar00rootroot00000000000000System.register(['./two.js'], (function () { 'use strict'; var a; return { setters: [function (module) { a = module.default; }], execute: (function () { window.APP = { a }; }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/_expected/system/two.js000066400000000000000000000002201450520414700314040ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var a = exports('default', {}); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/main.js000066400000000000000000000000571450520414700262430ustar00rootroot00000000000000import { a } from './one'; window.APP = { a };rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/one.js000066400000000000000000000001151450520414700260730ustar00rootroot00000000000000export { default as a } from './two'; export { default as b } from './three';rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/three.js000066400000000000000000000000221450520414700264160ustar00rootroot00000000000000export default {};rollup-3.29.4/test/chunking-form/samples/preserve-modules-empty/two.js000066400000000000000000000000221450520414700261200ustar00rootroot00000000000000export default {};rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/000077500000000000000000000000001450520414700262315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_config.js000066400000000000000000000002711450520414700301730ustar00rootroot00000000000000module.exports = defineTest({ description: 'confirm export aliases are preserved in modules', options: { input: ['main1.js', 'main2.js'], output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/000077500000000000000000000000001450520414700301715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/amd/000077500000000000000000000000001450520414700307325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/amd/dep.js000066400000000000000000000001701450520414700320360ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 1; exports.bar = foo; exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/amd/main1.js000066400000000000000000000001771450520414700323020ustar00rootroot00000000000000define(['exports', './dep'], (function (exports, dep) { 'use strict'; exports.bar = dep.foo; exports.foo = dep.foo; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/amd/main2.js000066400000000000000000000001471450520414700323000ustar00rootroot00000000000000define(['exports', './dep'], (function (exports, dep) { 'use strict'; exports.bar = dep.foo; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/cjs/000077500000000000000000000000001450520414700307505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/cjs/dep.js000066400000000000000000000001051450520414700320520ustar00rootroot00000000000000'use strict'; const foo = 1; exports.bar = foo; exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/cjs/main1.js000066400000000000000000000001371450520414700323140ustar00rootroot00000000000000'use strict'; var dep = require('./dep.js'); exports.bar = dep.foo; exports.foo = dep.foo; rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/cjs/main2.js000066400000000000000000000001101450520414700323040ustar00rootroot00000000000000'use strict'; var dep = require('./dep.js'); exports.bar = dep.foo; rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/es/000077500000000000000000000000001450520414700306005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/es/dep.js000066400000000000000000000000541450520414700317050ustar00rootroot00000000000000const foo = 1; export { foo as bar, foo }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/es/main1.js000066400000000000000000000000541450520414700321420ustar00rootroot00000000000000export { foo as bar, foo } from './dep.js'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/es/main2.js000066400000000000000000000000471450520414700321450ustar00rootroot00000000000000export { foo as bar } from './dep.js'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/system/000077500000000000000000000000001450520414700315155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/system/dep.js000066400000000000000000000002401450520414700326170ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; exports({ foo: foo, bar: foo }); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/system/main1.js000066400000000000000000000003201450520414700330530ustar00rootroot00000000000000System.register(['./dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ bar: module.foo, foo: module.foo }); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/_expected/system/main2.js000066400000000000000000000002751450520414700330650ustar00rootroot00000000000000System.register(['./dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('bar', module.foo); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/dep.js000066400000000000000000000000531450520414700273350ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar };rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/main1.js000066400000000000000000000000411450520414700275670ustar00rootroot00000000000000export { foo, bar } from './dep';rollup-3.29.4/test/chunking-form/samples/preserve-modules-export-alias/main2.js000066400000000000000000000000341450520414700275720ustar00rootroot00000000000000export { bar } from './dep';rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/000077500000000000000000000000001450520414700270545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_config.js000066400000000000000000000014271450520414700310220ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const expectedNames = new Set([ 'nested/a', 'b.str', 'c', 'd', 'e', 'f', 'g', 'h', 'main', 'no-ext' ]); module.exports = defineTest({ description: 'entryFileNames pattern supported in combination with preserveModules', options: { input: 'src/main.js', output: { entryFileNames({ name }) { assert.ok(expectedNames.has(name), `Unexpected name ${name}.`); return '[name]-[format]-[hash].js'; }, preserveModules: true }, plugins: [ { name: 'str-plugin', transform(code, id) { switch (path.extname(id)) { case '.str': { return { code: `export default "${code.trim()}"` }; } default: { return null; } } } } ] } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/000077500000000000000000000000001450520414700310145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/000077500000000000000000000000001450520414700315555ustar00rootroot00000000000000b.str-amd-f73e15b9.js000066400000000000000000000010011450520414700347560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var b = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; return b; })); c-amd-c1bed163.js000066400000000000000000000001041450520414700342160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var c = 42; return c; })); d-amd-f5c92c04.js000066400000000000000000000001041450520414700341460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var d = 42; return d; })); e-amd-f393b98d.js000066400000000000000000000001041450520414700341630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var e = 42; return e; })); f-amd-df81ac71.js000066400000000000000000000001041450520414700342270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var f = 42; return f; })); g-amd-1f750b5c.js000066400000000000000000000001041450520414700341460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var g = 42; return g; })); h-amd-a60c0f22.js000066400000000000000000000001041450520414700341360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var h = 42; return h; })); main-amd-addffa50.js000066400000000000000000000006701450520414700350720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine(['exports', './nested/a-amd-5dc7856c', './b.str-amd-f73e15b9', './c-amd-c1bed163', './d-amd-f5c92c04', './e-amd-f393b98d', './f-amd-df81ac71', './g-amd-1f750b5c', './h-amd-a60c0f22', './no-ext-amd-9d2c6ef6'], (function (exports, a, b, c, d, e, f, g, h, noExt) { 'use strict'; exports.a = a; exports.b = b; exports.c = c; exports.d = d; exports.e = e; exports.f = f; exports.g = g; exports.h = h; exports.x = noExt; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nested/000077500000000000000000000000001450520414700330375ustar00rootroot00000000000000a-amd-5dc7856c.js000066400000000000000000000001121450520414700354350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nesteddefine((function () { 'use strict'; var a = 'banana'; return a; })); no-ext-amd-9d2c6ef6.js000066400000000000000000000001221450520414700352260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var noExt = 'no-ext'; return noExt; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/000077500000000000000000000000001450520414700315735ustar00rootroot00000000000000b.str-cjs-6703f3b2.js000066400000000000000000000007551450520414700347400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var b = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; module.exports = b; c-cjs-71ac0098.js000066400000000000000000000000601450520414700341170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var c = 42; module.exports = c; d-cjs-9b009b8f.js000066400000000000000000000000601450520414700342070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var d = 42; module.exports = d; e-cjs-831dad1f.js000066400000000000000000000000601450520414700342600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var e = 42; module.exports = e; f-cjs-39905a99.js000066400000000000000000000000601450520414700340620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var f = 42; module.exports = f; g-cjs-3328e22b.js000066400000000000000000000000601450520414700341210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var g = 42; module.exports = g; h-cjs-d8541d4b.js000066400000000000000000000000601450520414700342070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var h = 42; module.exports = h; main-cjs-cb43c6df.js000066400000000000000000000010311450520414700350420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var a = require('./nested/a-cjs-80f9b8c3.js'); var b = require('./b.str-cjs-6703f3b2.js'); var c = require('./c-cjs-71ac0098.js'); var d = require('./d-cjs-9b009b8f.js'); var e = require('./e-cjs-831dad1f.js'); var f = require('./f-cjs-39905a99.js'); var g = require('./g-cjs-3328e22b.js'); var h = require('./h-cjs-d8541d4b.js'); var noExt = require('./no-ext-cjs-500f8f81.js'); exports.a = a; exports.b = b; exports.c = c; exports.d = d; exports.e = e; exports.f = f; exports.g = g; exports.h = h; exports.x = noExt; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested/000077500000000000000000000000001450520414700330555ustar00rootroot00000000000000a-cjs-80f9b8c3.js000066400000000000000000000000661450520414700354770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested'use strict'; var a = 'banana'; module.exports = a; no-ext-cjs-500f8f81.js000066400000000000000000000000761450520414700351230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var noExt = 'no-ext'; module.exports = noExt; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/000077500000000000000000000000001450520414700314235ustar00rootroot00000000000000b.str-es-3ce883b1.js000066400000000000000000000007431450520414700345010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar b = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; export { b as default }; c-es-7b7256f9.js000066400000000000000000000000461450520414700336220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar c = 42; export { c as default }; d-es-1616849c.js000066400000000000000000000000461450520414700335350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar d = 42; export { d as default }; e-es-e18089fa.js000066400000000000000000000000461450520414700336760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar e = 42; export { e as default }; f-es-c1646e12.js000066400000000000000000000000461450520414700336050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar f = 42; export { f as default }; g-es-968f87d2.js000066400000000000000000000000461450520414700336340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar g = 42; export { g as default }; h-es-05491bfa.js000066400000000000000000000000461450520414700336670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar h = 42; export { h as default }; main-es-f8350081.js000066400000000000000000000007331450520414700342320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esexport { default as a } from './nested/a-es-125ea65c.js'; export { default as b } from './b.str-es-3ce883b1.js'; export { default as c } from './c-es-7b7256f9.js'; export { default as d } from './d-es-1616849c.js'; export { default as e } from './e-es-e18089fa.js'; export { default as f } from './f-es-c1646e12.js'; export { default as g } from './g-es-968f87d2.js'; export { default as h } from './h-es-05491bfa.js'; export { default as x } from './no-ext-es-1f34b6e8.js'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nested/000077500000000000000000000000001450520414700327055ustar00rootroot00000000000000a-es-125ea65c.js000066400000000000000000000000541450520414700351410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nestedvar a = 'banana'; export { a as default }; no-ext-es-1f34b6e8.js000066400000000000000000000000641450520414700346610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar noExt = 'no-ext'; export { noExt as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/000077500000000000000000000000001450520414700323405ustar00rootroot00000000000000b.str-system-2fa3160e.js000066400000000000000000000011151450520414700363140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var b = exports('default', "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."); }) }; })); c-system-9442eacd.js000066400000000000000000000002201450520414700355720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var c = exports('default', 42); }) }; })); d-system-1a05eeda.js000066400000000000000000000002201450520414700356410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var d = exports('default', 42); }) }; })); e-system-f73caf6a.js000066400000000000000000000002201450520414700356550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var e = exports('default', 42); }) }; })); f-system-b3b06e3f.js000066400000000000000000000002201450520414700355700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var f = exports('default', 42); }) }; })); g-system-9b3ad652.js000066400000000000000000000002201450520414700355160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var g = exports('default', 42); }) }; })); h-system-6c6b48ca.js000066400000000000000000000002201450520414700356000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var h = exports('default', 42); }) }; })); main-system-d08bfef5.js000066400000000000000000000015751450520414700363760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register(['./nested/a-system-db94ffc0.js', './b.str-system-2fa3160e.js', './c-system-9442eacd.js', './d-system-1a05eeda.js', './e-system-f73caf6a.js', './f-system-b3b06e3f.js', './g-system-9b3ad652.js', './h-system-6c6b48ca.js', './no-ext-system-0cf938a8.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('a', module.default); }, function (module) { exports('b', module.default); }, function (module) { exports('c', module.default); }, function (module) { exports('d', module.default); }, function (module) { exports('e', module.default); }, function (module) { exports('f', module.default); }, function (module) { exports('g', module.default); }, function (module) { exports('h', module.default); }, function (module) { exports('x', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nested/000077500000000000000000000000001450520414700336225ustar00rootroot00000000000000a-system-db94ffc0.js000066400000000000000000000002261450520414700371420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nestedSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var a = exports('default', 'banana'); }) }; })); no-ext-system-0cf938a8.js000066400000000000000000000002321450520414700365130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var noExt = exports('default', 'no-ext'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/000077500000000000000000000000001450520414700276435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/b.str000066400000000000000000000006761450520414700306270ustar00rootroot00000000000000Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/c.mjs000066400000000000000000000000231450520414700305730ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/d.cjs000066400000000000000000000000231450520414700305620ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/e.jsx000066400000000000000000000000231450520414700306100ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/f.mts000066400000000000000000000000231450520414700306100ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/g.cts000066400000000000000000000000231450520414700305770ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/h.tsx000066400000000000000000000000231450520414700306250ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/main.js000066400000000000000000000005571450520414700311340ustar00rootroot00000000000000export { default as a } from './nested/a.ts'; export { default as b } from './b.str'; export { default as c } from './c.mjs'; export { default as d } from './d.cjs'; export { default as e } from './e.jsx'; export { default as f } from './f.mts'; export { default as g } from './g.cts'; export { default as h } from './h.tsx'; export { default as x } from './no-ext'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/nested/000077500000000000000000000000001450520414700311255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/nested/a.ts000066400000000000000000000000311450520414700317070ustar00rootroot00000000000000export default 'banana'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-filename-pattern/src/no-ext000066400000000000000000000000301450520414700307710ustar00rootroot00000000000000export default 'no-ext' rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/000077500000000000000000000000001450520414700271355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_config.js000066400000000000000000000006331450520414700311010ustar00rootroot00000000000000module.exports = defineTest({ description: 'Preserve modules id case sensitive', options: { input: 'main.js', output: { preserveModules: true }, plugins: [ { resolveId(id) { if (id.toLowerCase().includes('one')) { return id; } }, load(id) { if (id.toLowerCase().includes('one')) { return `export default '${id.replace('\0', '')}'`; } } } ] } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/000077500000000000000000000000001450520414700310755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/000077500000000000000000000000001450520414700316365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/_virtual/000077500000000000000000000000001450520414700334635ustar00rootroot00000000000000_One1.js000066400000000000000000000001131450520414700346760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var c = 'One1.js'; return c; })); _One2.js000066400000000000000000000001121450520414700346760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var b = 'One.js'; return b; })); _one.js000066400000000000000000000001121450520414700346540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var a = 'one.js'; return a; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/main.js000066400000000000000000000002471450520414700331230ustar00rootroot00000000000000define(['./_virtual/_one', './_virtual/_One2', './_virtual/_One1'], (function (_one, _One, _One1) { 'use strict'; window.APP = { a: _one, b: _One, c: _One1 }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/000077500000000000000000000000001450520414700316545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/000077500000000000000000000000001450520414700335015ustar00rootroot00000000000000_One1.js000066400000000000000000000000671450520414700347240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var c = 'One1.js'; module.exports = c; _One2.js000066400000000000000000000000661450520414700347240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var b = 'One.js'; module.exports = b; _one.js000066400000000000000000000000661450520414700347020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var a = 'one.js'; module.exports = a; rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/main.js000066400000000000000000000002761450520414700331430ustar00rootroot00000000000000'use strict'; var _one = require('./_virtual/_one.js'); var _One = require('./_virtual/_One2.js'); var _One1 = require('./_virtual/_One1.js'); window.APP = { a: _one, b: _One, c: _One1 }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/000077500000000000000000000000001450520414700315045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/_virtual/000077500000000000000000000000001450520414700333315ustar00rootroot00000000000000_One1.js000066400000000000000000000000551450520414700345510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/_virtualvar c = 'One1.js'; export { c as default }; _One2.js000066400000000000000000000000541450520414700345510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/_virtualvar b = 'One.js'; export { b as default }; _one.js000066400000000000000000000000541450520414700345270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/_virtualvar a = 'one.js'; export { a as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/main.js000066400000000000000000000002111450520414700327600ustar00rootroot00000000000000import a from './_virtual/_one.js'; import b from './_virtual/_One2.js'; import c from './_virtual/_One1.js'; window.APP = { a, b, c }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/system/000077500000000000000000000000001450520414700324215ustar00rootroot00000000000000_virtual/000077500000000000000000000000001450520414700341675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/system_One1.js000066400000000000000000000002271450520414700354670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var c = exports('default', 'One1.js'); }) }; })); _One2.js000066400000000000000000000002261450520414700354670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var b = exports('default', 'One.js'); }) }; })); _one.js000066400000000000000000000002261450520414700354450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var a = exports('default', 'one.js'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/system/main.js000066400000000000000000000005601450520414700337040ustar00rootroot00000000000000System.register(['./_virtual/_one.js', './_virtual/_One2.js', './_virtual/_One1.js'], (function () { 'use strict'; var a, b, c; return { setters: [function (module) { a = module.default; }, function (module) { b = module.default; }, function (module) { c = module.default; }], execute: (function () { window.APP = { a, b, c }; }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-id-case-sensitive/main.js000066400000000000000000000001521450520414700304150ustar00rootroot00000000000000import a from '\0one.js'; import b from '\0One.js'; import c from '\0One1.js'; window.APP = { a, b, c }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/000077500000000000000000000000001450520414700271465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_config.js000066400000000000000000000003271450520414700311120ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects "named" export mode in all chunks when preserving modules', options: { input: 'main.js', output: { exports: 'named', preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/000077500000000000000000000000001450520414700311065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/amd/000077500000000000000000000000001450520414700316475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/amd/default.js000066400000000000000000000002571450520414700336350ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var foo = 'default'; exports.default = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/amd/main.js000066400000000000000000000010231450520414700331250ustar00rootroot00000000000000define(['require', 'exports', './default', './named'], (function (require, exports, _default, named) { 'use strict'; console.log(_default.default, named.value); new Promise(function (resolve, reject) { require(['./default'], resolve, reject); }).then(result => console.log(result.default)); new Promise(function (resolve, reject) { require(['./named'], resolve, reject); }).then(result => console.log(result.value)); exports.default = _default.default; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/amd/named.js000066400000000000000000000001601450520414700332660ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 'named'; exports.value = value; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/cjs/000077500000000000000000000000001450520414700316655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/cjs/default.js000066400000000000000000000001741450520414700336510ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var foo = 'default'; exports.default = foo; rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/cjs/main.js000066400000000000000000000007231450520414700331510ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _default = require('./default.js'); var named = require('./named.js'); console.log(_default.default, named.value); Promise.resolve().then(function () { return require('./default.js'); }).then(result => console.log(result.default)); Promise.resolve().then(function () { return require('./named.js'); }).then(result => console.log(result.value)); exports.default = _default.default; rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/cjs/named.js000066400000000000000000000000761450520414700333120ustar00rootroot00000000000000'use strict'; const value = 'named'; exports.value = value; rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/es/000077500000000000000000000000001450520414700315155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/es/default.js000066400000000000000000000000611450520414700334740ustar00rootroot00000000000000var foo = 'default'; export { foo as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/es/main.js000066400000000000000000000003771450520414700330060ustar00rootroot00000000000000import foo from './default.js'; import { value } from './named.js'; console.log(foo, value); import('./default.js').then(result => console.log(result.default)); import('./named.js').then(result => console.log(result.value)); export { foo as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/es/named.js000066400000000000000000000000521450520414700331340ustar00rootroot00000000000000const value = 'named'; export { value }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/system/000077500000000000000000000000001450520414700324325ustar00rootroot00000000000000default.js000066400000000000000000000002311450520414700343310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('default', 'default'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/system/main.js000066400000000000000000000007571450520414700337250ustar00rootroot00000000000000System.register(['./default.js', './named.js'], (function (exports, module) { 'use strict'; var foo, value; return { setters: [function (module) { foo = module.default; exports('default', module.default); }, function (module) { value = module.value; }], execute: (function () { console.log(foo, value); module.import('./default.js').then(result => console.log(result.default)); module.import('./named.js').then(result => console.log(result.value)); }) }; })); named.js000066400000000000000000000002311450520414700337710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 'named'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/default.js000066400000000000000000000000321450520414700311230ustar00rootroot00000000000000export default 'default'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/main.js000066400000000000000000000004051450520414700304270ustar00rootroot00000000000000import foo from './default.js'; import { value } from './named.js'; console.log(foo, value); export { default } from './default.js'; import('./default').then(result => console.log(result.default)); import('./named').then(result => console.log(result.value)); rollup-3.29.4/test/chunking-form/samples/preserve-modules-named-export-mode/named.js000066400000000000000000000000361450520414700305670ustar00rootroot00000000000000export const value = 'named'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/000077500000000000000000000000001450520414700312715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_config.js000066400000000000000000000002341450520414700332320ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles doing a namespace reexport of a reexport', options: { output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/000077500000000000000000000000001450520414700332315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/amd/000077500000000000000000000000001450520414700337725ustar00rootroot00000000000000dep.js000066400000000000000000000001561450520414700350230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'foo'; exports.value = value; })); main.js000066400000000000000000000001521450520414700351730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/amddefine(['./reexport', './dep'], (function (reexport, dep) { 'use strict'; console.log(dep.value); })); reexport.js000066400000000000000000000001051450520414700361150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/amddefine((function () { 'use strict'; console.log('reexport'); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/cjs/000077500000000000000000000000001450520414700340105ustar00rootroot00000000000000dep.js000066400000000000000000000000741450520414700350400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/cjs'use strict'; const value = 'foo'; exports.value = value; main.js000066400000000000000000000001411450520414700352070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/cjs'use strict'; require('./reexport.js'); var dep = require('./dep.js'); console.log(dep.value); reexport.js000066400000000000000000000000501450520414700361320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/cjs'use strict'; console.log('reexport'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/es/000077500000000000000000000000001450520414700336405ustar00rootroot00000000000000dep.js000066400000000000000000000000501450520414700346620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/esconst value = 'foo'; export { value }; main.js000066400000000000000000000001171450520414700350420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/esimport './reexport.js'; import { value } from './dep.js'; console.log(value); reexport.js000066400000000000000000000000311450520414700357610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/esconsole.log('reexport'); system/000077500000000000000000000000001450520414700344765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expecteddep.js000066400000000000000000000002271450520414700356050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 'foo'); }) }; })); main.js000066400000000000000000000003511450520414700357570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/systemSystem.register(['./reexport.js', './dep.js'], (function () { 'use strict'; var value; return { setters: [null, function (module) { value = module.value; }], execute: (function () { console.log(value); }) }; })); reexport.js000066400000000000000000000002021450520414700366760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('reexport'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/dep.js000066400000000000000000000000341450520414700323740ustar00rootroot00000000000000export const value = 'foo'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/main.js000066400000000000000000000000721450520414700325520ustar00rootroot00000000000000import { value } from './reexport2'; console.log(value); rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/reexport.js000066400000000000000000000000731450520414700334770ustar00rootroot00000000000000export { value } from './dep.js'; console.log('reexport'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-namespace-reexport-reexport/reexport2.js000066400000000000000000000000371450520414700335610ustar00rootroot00000000000000export * from './reexport.js'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/000077500000000000000000000000001450520414700302745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_config.js000066400000000000000000000002771450520414700322440ustar00rootroot00000000000000module.exports = defineTest({ description: 'confirm exports are deconflicted when exporting nested index aliases', options: { input: 'main.js', output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/000077500000000000000000000000001450520414700322345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/000077500000000000000000000000001450520414700327755ustar00rootroot00000000000000main.js000066400000000000000000000002731450520414700342020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amddefine(['exports', './module-a/v1/index', './module-b/v1/index'], (function (exports, index, index$1) { 'use strict'; exports.ModuleA_V1 = index; exports.ModuleB_V1 = index$1; })); module-a/000077500000000000000000000000001450520414700344215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amdv1/000077500000000000000000000000001450520414700347475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/module-aindex.js000066400000000000000000000002041450520414700364100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/module-a/v1define(['exports'], (function (exports) { 'use strict'; const TEST_MODULE_A = 'A'; exports.TEST_MODULE_A = TEST_MODULE_A; })); module-b/000077500000000000000000000000001450520414700344225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amdv1/000077500000000000000000000000001450520414700347505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/module-bindex.js000066400000000000000000000002041450520414700364110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/module-b/v1define(['exports'], (function (exports) { 'use strict'; const TEST_MODULE_B = 'A'; exports.TEST_MODULE_B = TEST_MODULE_B; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/000077500000000000000000000000001450520414700330135ustar00rootroot00000000000000main.js000066400000000000000000000002541450520414700342170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs'use strict'; var index = require('./module-a/v1/index.js'); var index$1 = require('./module-b/v1/index.js'); exports.ModuleA_V1 = index; exports.ModuleB_V1 = index$1; module-a/000077500000000000000000000000001450520414700344375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjsv1/000077500000000000000000000000001450520414700347655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-aindex.js000066400000000000000000000001221450520414700364250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-a/v1'use strict'; const TEST_MODULE_A = 'A'; exports.TEST_MODULE_A = TEST_MODULE_A; module-b/000077500000000000000000000000001450520414700344405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjsv1/000077500000000000000000000000001450520414700347665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-bindex.js000066400000000000000000000001221450520414700364260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-b/v1'use strict'; const TEST_MODULE_B = 'A'; exports.TEST_MODULE_B = TEST_MODULE_B; rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/000077500000000000000000000000001450520414700326435ustar00rootroot00000000000000main.js000066400000000000000000000002461450520414700340500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/esimport * as index from './module-a/v1/index.js'; export { index as ModuleA_V1 }; import * as index$1 from './module-b/v1/index.js'; export { index$1 as ModuleB_V1 }; module-a/000077500000000000000000000000001450520414700342675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/esv1/000077500000000000000000000000001450520414700346155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/module-aindex.js000066400000000000000000000000661450520414700362640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/module-a/v1const TEST_MODULE_A = 'A'; export { TEST_MODULE_A }; module-b/000077500000000000000000000000001450520414700342705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/esv1/000077500000000000000000000000001450520414700346165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/module-bindex.js000066400000000000000000000000661450520414700362650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/module-b/v1const TEST_MODULE_B = 'A'; export { TEST_MODULE_B }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/system/000077500000000000000000000000001450520414700335605ustar00rootroot00000000000000main.js000066400000000000000000000004431450520414700347640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/systemSystem.register(['./module-a/v1/index.js', './module-b/v1/index.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('ModuleA_V1', module); }, function (module) { exports('ModuleB_V1', module); }], execute: (function () { }) }; })); module-a/000077500000000000000000000000001450520414700352045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/systemv1/000077500000000000000000000000001450520414700355325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/system/module-aindex.js000066400000000000000000000002451450520414700372000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/system/module-a/v1System.register([], (function (exports) { 'use strict'; return { execute: (function () { const TEST_MODULE_A = exports('TEST_MODULE_A', 'A'); }) }; })); module-b/000077500000000000000000000000001450520414700352055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/systemv1/000077500000000000000000000000001450520414700355335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/system/module-bindex.js000066400000000000000000000002451450520414700372010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/system/module-b/v1System.register([], (function (exports) { 'use strict'; return { execute: (function () { const TEST_MODULE_B = exports('TEST_MODULE_B', 'A'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/main.js000066400000000000000000000001011450520414700315460ustar00rootroot00000000000000export * from './module-a/index' export * from './module-b/index'rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/000077500000000000000000000000001450520414700317775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/index.js000066400000000000000000000000771450520414700334500ustar00rootroot00000000000000import * as ModuleA_V1 from './v1/index' export { ModuleA_V1 }rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/v1/000077500000000000000000000000001450520414700323255ustar00rootroot00000000000000index.js000066400000000000000000000000401450520414700337050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/v1export const TEST_MODULE_A = 'A'rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/000077500000000000000000000000001450520414700320005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/index.js000066400000000000000000000000771450520414700334510ustar00rootroot00000000000000import * as ModuleB_V1 from './v1/index' export { ModuleB_V1 }rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/v1/000077500000000000000000000000001450520414700323265ustar00rootroot00000000000000index.js000066400000000000000000000000401450520414700337060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/v1export const TEST_MODULE_B = 'A'rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/000077500000000000000000000000001450520414700264225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_config.js000066400000000000000000000002601450520414700303620ustar00rootroot00000000000000module.exports = defineTest({ description: 'confirm exports are preserved when exporting a module', options: { input: 'main.js', output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/000077500000000000000000000000001450520414700303625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/000077500000000000000000000000001450520414700311235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/inner/000077500000000000000000000000001450520414700322365ustar00rootroot00000000000000more_inner/000077500000000000000000000000001450520414700343145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/innersomething.js000066400000000000000000000002021450520414700366410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/inner/more_innerdefine(['exports'], (function (exports) { 'use strict'; const Something = 'Hello World'; exports.Something = Something; })); some_effect.js000066400000000000000000000001101450520414700347640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/innerdefine((function () { 'use strict'; console.log('side-effect'); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/main.js000066400000000000000000000002721450520414700324060ustar00rootroot00000000000000define(['exports', './inner/more_inner/something', './inner/some_effect'], (function (exports, something, some_effect) { 'use strict'; exports.Something = something.Something; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/000077500000000000000000000000001450520414700311415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/inner/000077500000000000000000000000001450520414700322545ustar00rootroot00000000000000more_inner/000077500000000000000000000000001450520414700343325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/innersomething.js000066400000000000000000000001201450520414700366560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/inner/more_inner'use strict'; const Something = 'Hello World'; exports.Something = Something; some_effect.js000066400000000000000000000000531450520414700350100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/inner'use strict'; console.log('side-effect'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/main.js000066400000000000000000000002321450520414700324200ustar00rootroot00000000000000'use strict'; var something = require('./inner/more_inner/something.js'); require('./inner/some_effect.js'); exports.Something = something.Something; rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/000077500000000000000000000000001450520414700307715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/inner/000077500000000000000000000000001450520414700321045ustar00rootroot00000000000000more_inner/000077500000000000000000000000001450520414700341625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/innersomething.js000066400000000000000000000000701450520414700365120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/inner/more_innerconst Something = 'Hello World'; export { Something }; some_effect.js000066400000000000000000000000341450520414700346370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/innerconsole.log('side-effect'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/main.js000066400000000000000000000001361450520414700322530ustar00rootroot00000000000000export { Something } from './inner/more_inner/something.js'; import './inner/some_effect.js'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/000077500000000000000000000000001450520414700317065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/inner/000077500000000000000000000000001450520414700330215ustar00rootroot00000000000000more_inner/000077500000000000000000000000001450520414700350775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/innersomething.js000066400000000000000000000002471450520414700374350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/inner/more_innerSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const Something = exports('Something', 'Hello World'); }) }; })); some_effect.js000066400000000000000000000002051450520414700355540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/innerSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('side-effect'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/main.js000066400000000000000000000004001450520414700331620ustar00rootroot00000000000000System.register(['./inner/more_inner/something.js', './inner/some_effect.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('Something', module.Something); }, null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/inner/000077500000000000000000000000001450520414700275355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/inner/index.js000066400000000000000000000000741450520414700312030ustar00rootroot00000000000000export * from './more_inner/index'; import './some_effect'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/inner/more_inner/000077500000000000000000000000001450520414700316725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/inner/more_inner/index.js000066400000000000000000000000351450520414700333350ustar00rootroot00000000000000export * from './something'; something.js000066400000000000000000000000501450520414700341410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/inner/more_innerexport const Something = 'Hello World'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/inner/some_effect.js000066400000000000000000000000341450520414700323470ustar00rootroot00000000000000console.log('side-effect'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-nested-export/main.js000066400000000000000000000000371450520414700277040ustar00rootroot00000000000000export * from './inner/index'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/000077500000000000000000000000001450520414700272455ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_config.js000066400000000000000000000002561450520414700312120ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports and exports of non-entry points are tracked', options: { input: 'main.js', output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/000077500000000000000000000000001450520414700312055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/amd/000077500000000000000000000000001450520414700317465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/amd/dep2.js000066400000000000000000000001141450520414700331320ustar00rootroot00000000000000define((function () { 'use strict'; function foo() {} return foo; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/amd/main.js000066400000000000000000000001131450520414700332230ustar00rootroot00000000000000define(['./dep2'], (function (dep2) { 'use strict'; return dep2; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/cjs/000077500000000000000000000000001450520414700317645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/cjs/dep2.js000066400000000000000000000000701450520414700331510ustar00rootroot00000000000000'use strict'; function foo() {} module.exports = foo; rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/cjs/main.js000066400000000000000000000001121450520414700332400ustar00rootroot00000000000000'use strict'; var dep2 = require('./dep2.js'); module.exports = dep2; rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/es/000077500000000000000000000000001450520414700316145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/es/dep2.js000066400000000000000000000000561450520414700330050ustar00rootroot00000000000000function foo() {} export { foo as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/es/main.js000066400000000000000000000000731450520414700330760ustar00rootroot00000000000000import foo from './dep2.js'; export { foo as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/system/000077500000000000000000000000001450520414700325315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/system/dep2.js000066400000000000000000000002371450520414700337230ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo() {} }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/system/main.js000066400000000000000000000003511450520414700340120ustar00rootroot00000000000000System.register(['./dep2.js'], (function (exports) { 'use strict'; var foo; return { setters: [function (module) { foo = module.default; exports('default', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/dep1.js000066400000000000000000000000411450520414700304270ustar00rootroot00000000000000export { default } from './dep2';rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/dep2.js000066400000000000000000000000351450520414700304330ustar00rootroot00000000000000export default function() {};rollup-3.29.4/test/chunking-form/samples/preserve-modules-non-entry-imports/main.js000066400000000000000000000000561450520414700305300ustar00rootroot00000000000000import foo from './dep1'; export default foo;rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/000077500000000000000000000000001450520414700263125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_config.js000066400000000000000000000003301450520414700302500ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly resolves imports via a proxy module as direct imports when preserving modules', options: { external: 'external', output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/000077500000000000000000000000001450520414700302525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/amd/000077500000000000000000000000001450520414700310135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/amd/main.js000066400000000000000000000002211450520414700322700ustar00rootroot00000000000000define(['external'], (function (path) { 'use strict'; console.log(path.normalize('foo\\bar')); console.log(path.normalize('foo\\bar')); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/amd/proxy.js000066400000000000000000000001151450520414700325270ustar00rootroot00000000000000define(['external'], (function (path) { 'use strict'; return path; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/cjs/000077500000000000000000000000001450520414700310315ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/cjs/main.js000066400000000000000000000002021450520414700323050ustar00rootroot00000000000000'use strict'; var path = require('external'); console.log(path.normalize('foo\\bar')); console.log(path.normalize('foo\\bar')); rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/cjs/proxy.js000066400000000000000000000001111450520414700325410ustar00rootroot00000000000000'use strict'; var path = require('external'); module.exports = path; rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/es/000077500000000000000000000000001450520414700306615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/es/main.js000066400000000000000000000001601450520414700321400ustar00rootroot00000000000000import path from 'external'; console.log(path.normalize('foo\\bar')); console.log(path.normalize('foo\\bar')); rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/es/proxy.js000066400000000000000000000001011450520414700323700ustar00rootroot00000000000000import path from 'external'; export { default } from 'external'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/system/000077500000000000000000000000001450520414700315765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/system/main.js000066400000000000000000000004231450520414700330570ustar00rootroot00000000000000System.register(['external'], (function () { 'use strict'; var path; return { setters: [function (module) { path = module.default; }], execute: (function () { console.log(path.normalize('foo\\bar')); console.log(path.normalize('foo\\bar')); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/_expected/system/proxy.js000066400000000000000000000003521450520414700333150ustar00rootroot00000000000000System.register(['external'], (function (exports) { 'use strict'; var path; return { setters: [function (module) { path = module.default; exports('default', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/main.js000066400000000000000000000002261450520414700275740ustar00rootroot00000000000000import path from 'external'; import proxyPath from './proxy'; console.log(path.normalize('foo\\bar')); console.log(proxyPath.normalize('foo\\bar')); rollup-3.29.4/test/chunking-form/samples/preserve-modules-proxy-import/proxy.js000066400000000000000000000000621450520414700300270ustar00rootroot00000000000000import path from 'external'; export default path; rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/000077500000000000000000000000001450520414700270535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_config.js000066400000000000000000000002401450520414700310110ustar00rootroot00000000000000module.exports = defineTest({ description: 'change the module destination', options: { input: 'src/lib/main.js', output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/000077500000000000000000000000001450520414700310135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/amd/000077500000000000000000000000001450520414700315545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/amd/dep.js000066400000000000000000000002051450520414700326570ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('dep fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/amd/lib/000077500000000000000000000000001450520414700323225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/amd/lib/main.js000066400000000000000000000002101450520414700335750ustar00rootroot00000000000000define(['../dep'], (function (dep) { 'use strict'; class Main { constructor () { dep.fn(); } } return Main; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/cjs/000077500000000000000000000000001450520414700315725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/cjs/dep.js000066400000000000000000000001151450520414700326750ustar00rootroot00000000000000'use strict'; function fn () { console.log('dep fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/cjs/lib/000077500000000000000000000000001450520414700323405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/cjs/lib/main.js000066400000000000000000000001741450520414700336240ustar00rootroot00000000000000'use strict'; var dep = require('../dep.js'); class Main { constructor () { dep.fn(); } } module.exports = Main; rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/es/000077500000000000000000000000001450520414700314225ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/es/dep.js000066400000000000000000000000741450520414700325310ustar00rootroot00000000000000function fn () { console.log('dep fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/es/lib/000077500000000000000000000000001450520414700321705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/es/lib/main.js000066400000000000000000000001561450520414700334540ustar00rootroot00000000000000import { fn } from '../dep.js'; class Main { constructor () { fn(); } } export { Main as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/system/000077500000000000000000000000001450520414700323375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/system/dep.js000066400000000000000000000003141450520414700334430ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('dep fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/system/lib/000077500000000000000000000000001450520414700331055ustar00rootroot00000000000000main.js000066400000000000000000000004611450520414700343110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/system/libSystem.register(['../dep.js'], (function (exports) { 'use strict'; var fn; return { setters: [function (module) { fn = module.fn; }], execute: (function () { class Main { constructor () { fn(); } } exports('default', Main); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/src/000077500000000000000000000000001450520414700276425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/src/dep.js000066400000000000000000000000621450520414700307460ustar00rootroot00000000000000export function fn () { console.log('dep fn'); }rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/src/lib/000077500000000000000000000000001450520414700304105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-reaching-outside/src/lib/main.js000066400000000000000000000001341450520414700316700ustar00rootroot00000000000000import { fn } from '../dep'; export default class Main { constructor () { fn(); } }rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/000077500000000000000000000000001450520414700246045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_config.js000066400000000000000000000014611450520414700265500ustar00rootroot00000000000000const commonjs = require('@rollup/plugin-commonjs'); const resolve = require('@rollup/plugin-node-resolve').default; module.exports = defineTest({ description: 'confirm preserveModulesRoot restructures src appropriately', expectedWarnings: ['MIXED_EXPORTS'], options: { input: ['src/under-build.js', 'src/below/module.js'], plugins: [ { name: 'convert-slashes', // This simulates converted slashes as used by e.g. Vite async resolveId(source, importer, options) { const resolved = await this.resolve(source, importer, { ...options, skipSelf: true }); return { ...resolved, id: resolved.id.replace(/\\/g, '/') }; } }, resolve({ moduleDirectories: ['custom_modules'] }), commonjs() ], output: { preserveModules: true, preserveModulesRoot: 'src' } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/000077500000000000000000000000001450520414700265445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/000077500000000000000000000000001450520414700273055ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/_virtual/000077500000000000000000000000001450520414700311325ustar00rootroot00000000000000_commonjsHelpers.js000066400000000000000000000004141450520414700347170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } exports.getDefaultExportFromCjs = getDefaultExportFromCjs; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/_virtual/index.js000066400000000000000000000001651450520414700326010ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var myBasePkg = {}; exports.__exports = myBasePkg; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/below/000077500000000000000000000000001450520414700304155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/below/module.js000066400000000000000000000001221450520414700322330ustar00rootroot00000000000000define(['./module2'], (function (module) { 'use strict'; return module; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/below/module2.js000066400000000000000000000005331450520414700323230ustar00rootroot00000000000000define(['../_virtual/_commonjsHelpers', '../custom_modules/@my-scope/my-base-pkg/index', '../_virtual/index'], (function (_commonjsHelpers, index$1, index) { 'use strict'; const base2 = index.__exports; var module = { base2, }; var module$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(module); return module$1; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/000077500000000000000000000000001450520414700323475ustar00rootroot00000000000000@my-scope/000077500000000000000000000000001450520414700341245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modulesmy-base-pkg/000077500000000000000000000000001450520414700362405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/@my-scopeindex.js000066400000000000000000000003471450520414700377110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/@my-scope/my-base-pkgdefine(['../../../_virtual/index'], (function (index) { 'use strict'; Object.defineProperty(index.__exports, '__esModule', { value: true }); var hello = 'world'; index.__exports.hello = hello; return index.__exports; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/under-build.js000066400000000000000000000001371450520414700320560ustar00rootroot00000000000000define(['./under-build2'], (function (underBuild) { 'use strict'; return underBuild; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/amd/under-build2.js000066400000000000000000000005361450520414700321430ustar00rootroot00000000000000define(['./_virtual/_commonjsHelpers', './custom_modules/@my-scope/my-base-pkg/index', './_virtual/index'], (function (_commonjsHelpers, index$1, index) { 'use strict'; const base = index.__exports; var underBuild = { base }; var underBuild$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(underBuild); return underBuild$1; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/000077500000000000000000000000001450520414700273235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/_virtual/000077500000000000000000000000001450520414700311505ustar00rootroot00000000000000_commonjsHelpers.js000066400000000000000000000003301450520414700347320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/_virtual'use strict'; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } exports.getDefaultExportFromCjs = getDefaultExportFromCjs; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/_virtual/index.js000066400000000000000000000001031450520414700326070ustar00rootroot00000000000000'use strict'; var myBasePkg = {}; exports.__exports = myBasePkg; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/below/000077500000000000000000000000001450520414700304335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/below/module.js000066400000000000000000000001251450520414700322540ustar00rootroot00000000000000'use strict'; var module$1 = require('./module2.js'); module.exports = module$1; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/below/module2.js000066400000000000000000000005471450520414700323460ustar00rootroot00000000000000'use strict'; var _commonjsHelpers = require('../_virtual/_commonjsHelpers.js'); require('../custom_modules/@my-scope/my-base-pkg/index.js'); var index = require('../_virtual/index.js'); const base2 = index.__exports; var module$1 = { base2, }; var module$2 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(module$1); module.exports = module$2; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/000077500000000000000000000000001450520414700323655ustar00rootroot00000000000000@my-scope/000077500000000000000000000000001450520414700341425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modulesmy-base-pkg/000077500000000000000000000000001450520414700362565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/@my-scopeindex.js000066400000000000000000000003431450520414700377230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/@my-scope/my-base-pkg'use strict'; var index = require('../../../_virtual/index.js'); Object.defineProperty(index.__exports, '__esModule', { value: true }); var hello = 'world'; index.__exports.hello = hello; module.exports = index.__exports; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/under-build.js000066400000000000000000000001361450520414700320730ustar00rootroot00000000000000'use strict'; var underBuild = require('./under-build2.js'); module.exports = underBuild; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/cjs/under-build2.js000066400000000000000000000005541450520414700321610ustar00rootroot00000000000000'use strict'; var _commonjsHelpers = require('./_virtual/_commonjsHelpers.js'); require('./custom_modules/@my-scope/my-base-pkg/index.js'); var index = require('./_virtual/index.js'); const base = index.__exports; var underBuild = { base }; var underBuild$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(underBuild); module.exports = underBuild$1; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/000077500000000000000000000000001450520414700271535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/_virtual/000077500000000000000000000000001450520414700310005ustar00rootroot00000000000000_commonjsHelpers.js000066400000000000000000000002621450520414700345660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/_virtualfunction getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } export { getDefaultExportFromCjs }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/_virtual/index.js000066400000000000000000000000701450520414700324420ustar00rootroot00000000000000var myBasePkg = {}; export { myBasePkg as __exports }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/below/000077500000000000000000000000001450520414700302635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/below/module.js000066400000000000000000000000501450520414700321010ustar00rootroot00000000000000export { default } from './module2.js'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/below/module2.js000066400000000000000000000005321450520414700321700ustar00rootroot00000000000000import { getDefaultExportFromCjs } from '../_virtual/_commonjsHelpers.js'; import '../custom_modules/@my-scope/my-base-pkg/index.js'; import { __exports as myBasePkg } from '../_virtual/index.js'; const base2 = myBasePkg; var module = { base2, }; var module$1 = /*@__PURE__*/getDefaultExportFromCjs(module); export { module$1 as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/000077500000000000000000000000001450520414700322155ustar00rootroot00000000000000@my-scope/000077500000000000000000000000001450520414700337725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modulesmy-base-pkg/000077500000000000000000000000001450520414700361065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/@my-scopeindex.js000066400000000000000000000003311450520414700375500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/@my-scope/my-base-pkgimport { __exports as myBasePkg } from '../../../_virtual/index.js'; Object.defineProperty(myBasePkg, '__esModule', { value: true }); var hello = 'world'; myBasePkg.hello = hello; export { myBasePkg as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/under-build.js000066400000000000000000000000551450520414700317230ustar00rootroot00000000000000export { default } from './under-build2.js'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/es/under-build2.js000066400000000000000000000005431450520414700320070ustar00rootroot00000000000000import { getDefaultExportFromCjs } from './_virtual/_commonjsHelpers.js'; import './custom_modules/@my-scope/my-base-pkg/index.js'; import { __exports as myBasePkg } from './_virtual/index.js'; const base = myBasePkg; var underBuild = { base }; var underBuild$1 = /*@__PURE__*/getDefaultExportFromCjs(underBuild); export { underBuild$1 as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/000077500000000000000000000000001450520414700300705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/_virtual/000077500000000000000000000000001450520414700317155ustar00rootroot00000000000000_commonjsHelpers.js000066400000000000000000000005041450520414700355020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('getDefaultExportFromCjs', getDefaultExportFromCjs); function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/_virtual/index.js000066400000000000000000000002321450520414700333570ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var myBasePkg = exports('__exports', {}); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/below/000077500000000000000000000000001450520414700312005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/below/module.js000066400000000000000000000003111450520414700330160ustar00rootroot00000000000000System.register(['./module2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/below/module2.js000066400000000000000000000011431450520414700331040ustar00rootroot00000000000000System.register(['../_virtual/_commonjsHelpers.js', '../custom_modules/@my-scope/my-base-pkg/index.js', '../_virtual/index.js'], (function (exports) { 'use strict'; var getDefaultExportFromCjs, myBasePkg; return { setters: [function (module) { getDefaultExportFromCjs = module.getDefaultExportFromCjs; }, null, function (module) { myBasePkg = module.__exports; }], execute: (function () { const base2 = myBasePkg; var module$1 = { base2, }; var module$2 = exports('default', /*@__PURE__*/getDefaultExportFromCjs(module$1)); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/000077500000000000000000000000001450520414700331325ustar00rootroot00000000000000@my-scope/000077500000000000000000000000001450520414700347075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modulesmy-base-pkg/000077500000000000000000000000001450520414700370235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/@my-scopeindex.js000066400000000000000000000006031450520414700404670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/@my-scope/my-base-pkgSystem.register(['../../../_virtual/index.js'], (function (exports) { 'use strict'; var myBasePkg; return { setters: [function (module) { myBasePkg = module.__exports; exports('default', module.__exports); }], execute: (function () { Object.defineProperty(myBasePkg, '__esModule', { value: true }); var hello = 'world'; myBasePkg.hello = hello; }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/under-build.js000066400000000000000000000003161450520414700326400ustar00rootroot00000000000000System.register(['./under-build2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/_expected/system/under-build2.js000066400000000000000000000011011450520414700327130ustar00rootroot00000000000000System.register(['./_virtual/_commonjsHelpers.js', './custom_modules/@my-scope/my-base-pkg/index.js', './_virtual/index.js'], (function (exports) { 'use strict'; var getDefaultExportFromCjs, myBasePkg; return { setters: [function (module) { getDefaultExportFromCjs = module.getDefaultExportFromCjs; }, null, function (module) { myBasePkg = module.__exports; }], execute: (function () { const base = myBasePkg; var underBuild = { base }; var underBuild$1 = exports('default', /*@__PURE__*/getDefaultExportFromCjs(underBuild)); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/custom_modules/000077500000000000000000000000001450520414700276465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/custom_modules/@my-scope/000077500000000000000000000000001450520414700315025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/custom_modules/@my-scope/my-base-pkg/000077500000000000000000000000001450520414700336165ustar00rootroot00000000000000index.js000066400000000000000000000001741450520414700352060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/custom_modules/@my-scope/my-base-pkg'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var hello = 'world'; exports.hello = hello; package.json000066400000000000000000000001461450520414700360260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/custom_modules/@my-scope/my-base-pkg{ "name": "@my-scope/my-base-pkg", "version": "1.0.0", "main": "index.js", "license": "MIT" } rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/src/000077500000000000000000000000001450520414700253735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/src/below/000077500000000000000000000000001450520414700265035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/src/below/module.js000066400000000000000000000001161450520414700303240ustar00rootroot00000000000000const base2 = require('@my-scope/my-base-pkg') module.exports = { base2, } rollup-3.29.4/test/chunking-form/samples/preserve-modules-root/src/under-build.js000066400000000000000000000001141450520414700301370ustar00rootroot00000000000000const base = require('@my-scope/my-base-pkg'); module.exports = { base }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/000077500000000000000000000000001450520414700274265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_config.js000066400000000000000000000012331450520414700313670ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'scriptified assets have extension in preserveModules output filename', options: { input: 'src/main.js', output: { preserveModules: true }, plugins: [ { name: 'str-num-plugin', transform(code, id) { switch (path.extname(id)) { case '.num': { return { code: `export default ${code.trim()}` }; } case '.str': { return { code: `export default "${code.trim()}"` }; } case '': { return { code: 'export default "COULDN\'T TRANSFORM"' }; } default: { return null; } } } } ] } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/000077500000000000000000000000001450520414700313665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/amd/000077500000000000000000000000001450520414700321275ustar00rootroot00000000000000answer.num.js000066400000000000000000000001161450520414700345010ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/amddefine((function () { 'use strict'; var answer = 42; return answer; })); lorem.str.js000066400000000000000000000010111450520414700343240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/amddefine((function () { 'use strict'; var lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; return lorem; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/amd/main.js000066400000000000000000000003141450520414700334070ustar00rootroot00000000000000define(['exports', './answer.num', './lorem.str', './no-ext'], (function (exports, answer, lorem, noExt) { 'use strict'; exports.answer = answer; exports.lorem = lorem; exports.noExt = noExt; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/amd/no-ext.js000066400000000000000000000001361450520414700336770ustar00rootroot00000000000000define((function () { 'use strict'; var noExt = "COULDN'T TRANSFORM"; return noExt; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/cjs/000077500000000000000000000000001450520414700321455ustar00rootroot00000000000000answer.num.js000066400000000000000000000000721450520414700345200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/cjs'use strict'; var answer = 42; module.exports = answer; lorem.str.js000066400000000000000000000007651450520414700343610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/cjs'use strict'; var lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; module.exports = lorem; rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/cjs/main.js000066400000000000000000000003151450520414700334260ustar00rootroot00000000000000'use strict'; var answer = require('./answer.num.js'); var lorem = require('./lorem.str.js'); var noExt = require('./no-ext.js'); exports.answer = answer; exports.lorem = lorem; exports.noExt = noExt; rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/cjs/no-ext.js000066400000000000000000000001121450520414700337070ustar00rootroot00000000000000'use strict'; var noExt = "COULDN'T TRANSFORM"; module.exports = noExt; rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/es/000077500000000000000000000000001450520414700317755ustar00rootroot00000000000000answer.num.js000066400000000000000000000000601450520414700343450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/esvar answer = 42; export { answer as default }; lorem.str.js000066400000000000000000000007531450520414700342060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/esvar lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; export { lorem as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/es/main.js000066400000000000000000000002301450520414700332520ustar00rootroot00000000000000export { default as answer } from './answer.num.js'; export { default as lorem } from './lorem.str.js'; export { default as noExt } from './no-ext.js'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/es/no-ext.js000066400000000000000000000001001450520414700335340ustar00rootroot00000000000000var noExt = "COULDN'T TRANSFORM"; export { noExt as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/system/000077500000000000000000000000001450520414700327125ustar00rootroot00000000000000answer.num.js000066400000000000000000000002251450520414700352650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var answer = exports('default', 42); }) }; })); lorem.str.js000066400000000000000000000011211450520414700351110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var lorem = exports('default', "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."); }) }; })); main.js000066400000000000000000000005501450520414700341150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/systemSystem.register(['./answer.num.js', './lorem.str.js', './no-ext.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('answer', module.default); }, function (module) { exports('lorem', module.default); }, function (module) { exports('noExt', module.default); }], execute: (function () { }) }; })); no-ext.js000066400000000000000000000002461450520414700344050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var noExt = exports('default', "COULDN'T TRANSFORM"); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/src/000077500000000000000000000000001450520414700302155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/src/answer.num000066400000000000000000000000031450520414700322260ustar00rootroot0000000000000042 rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/src/lorem.str000066400000000000000000000006761450520414700320760ustar00rootroot00000000000000Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/src/main.js000066400000000000000000000002171450520414700314770ustar00rootroot00000000000000export { default as answer } from './answer.num'; export { default as lorem } from './lorem.str'; export { default as noExt } from './no-ext'; rollup-3.29.4/test/chunking-form/samples/preserve-modules-scriptified-assets/src/no-ext000066400000000000000000000000111450520414700313420ustar00rootroot00000000000000WHATEVER rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/000077500000000000000000000000001450520414700262415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_config.js000066400000000000000000000002341450520414700302020ustar00rootroot00000000000000module.exports = defineTest({ description: 'single entry names file correctly', options: { input: 'main.js', output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_expected/000077500000000000000000000000001450520414700302015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_expected/amd/000077500000000000000000000000001450520414700307425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_expected/amd/main.js000066400000000000000000000000731450520414700322240ustar00rootroot00000000000000define((function () { 'use strict'; console.log(); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_expected/cjs/000077500000000000000000000000001450520414700307605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_expected/cjs/main.js000066400000000000000000000000361450520414700322410ustar00rootroot00000000000000'use strict'; console.log(); rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_expected/es/000077500000000000000000000000001450520414700306105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_expected/es/main.js000066400000000000000000000000171450520414700320700ustar00rootroot00000000000000console.log(); rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_expected/system/000077500000000000000000000000001450520414700315255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/_expected/system/main.js000066400000000000000000000001701450520414700330050ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log(); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-single-entry/main.js000066400000000000000000000000151450520414700275170ustar00rootroot00000000000000console.log()rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/000077500000000000000000000000001450520414700274505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_config.js000066400000000000000000000005751450520414700314210ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'Supports chunk names from config when preserving modules', options: { input: { 'main-entry': 'main.js' }, output: { preserveModules: true }, plugins: [ { buildStart() { this.emitFile({ type: 'chunk', id: path.join(__dirname, 'b.js'), name: 'emitted' }); } } ] } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/000077500000000000000000000000001450520414700314105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/amd/000077500000000000000000000000001450520414700321515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/amd/a.js000066400000000000000000000000761450520414700327320ustar00rootroot00000000000000define((function () { 'use strict'; console.log('a'); })); emitted.js000066400000000000000000000000761450520414700340660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/amddefine((function () { 'use strict'; console.log('b'); })); main-entry.js000066400000000000000000000001131450520414700345060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/amddefine(['./a'], (function (a) { 'use strict'; console.log('main'); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/cjs/000077500000000000000000000000001450520414700321675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/cjs/a.js000066400000000000000000000000411450520414700327400ustar00rootroot00000000000000'use strict'; console.log('a'); emitted.js000066400000000000000000000000411450520414700340740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/cjs'use strict'; console.log('b'); main-entry.js000066400000000000000000000000701450520414700345260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/cjs'use strict'; require('./a.js'); console.log('main'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/es/000077500000000000000000000000001450520414700320175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/es/a.js000066400000000000000000000000221450520414700325670ustar00rootroot00000000000000console.log('a'); emitted.js000066400000000000000000000000221450520414700337230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/esconsole.log('b'); main-entry.js000066400000000000000000000000471450520414700343620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/esimport './a.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/system/000077500000000000000000000000001450520414700327345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/system/a.js000066400000000000000000000001731450520414700335130ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('a'); }) }; })); emitted.js000066400000000000000000000001731450520414700346470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('b'); }) }; })); main-entry.js000066400000000000000000000002311450520414700352720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/_expected/systemSystem.register(['./a.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/a.js000066400000000000000000000000221450520414700302200ustar00rootroot00000000000000console.log('a'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/b.js000066400000000000000000000000221450520414700302210ustar00rootroot00000000000000console.log('b'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-special-chunk-names/main.js000066400000000000000000000000461450520414700307320ustar00rootroot00000000000000import './a.js'; console.log('main'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/000077500000000000000000000000001450520414700322065ustar00rootroot00000000000000_config.js000066400000000000000000000022011450520414700340640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-patternmodule.exports = defineTest({ description: 'Generates actual files whose filename adheres to entryFileNames for virtual modules when preserving modules', options: { input: 'main.js', output: { preserveModules: true, entryFileNames: '[name]-[format]-[hash].mjs' }, plugins: [ { resolveId(id) { if (id === '\0virtualModule') return id; if (id === '\0virtualWithExt.js') return id; if (id === '\0virtualWithAssetExt.str') return id; }, load(id) { if (id === '\0virtualModule') return 'export const virtual = "Virtual!";\n'; if (id === '\0virtualWithExt.js') return 'export const virtual2 = "Virtual2!";\n'; if (id === '\0virtualWithAssetExt.str') return 'export const virtual3 = "Virtual3!";\n'; }, transform(code, id) { if (id === '\0virtualModule') return null; if (id === '\0virtualWithExt.js') return null; if (id === '\0virtualWithAssetExt.str') return null; return ( 'import {virtual} from "\0virtualModule";\nimport {virtual2} from "\0virtualWithExt.js";\nimport {virtual3} from "\0virtualWithAssetExt.str";' + code ); } } ] } }); _expected/000077500000000000000000000000001450520414700340675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-patternamd/000077500000000000000000000000001450520414700346305ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected_virtual/000077500000000000000000000000001450520414700364555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd_virtualModule-amd-03552e5c.mjs000066400000000000000000000001711450520414700437720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual = "Virtual!"; exports.virtual = virtual; })); _virtualWithAssetExt.str-amd-724c602d.mjs000066400000000000000000000001751450520414700457540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual3 = "Virtual3!"; exports.virtual3 = virtual3; })); _virtualWithExt-amd-e9dc1b7e.mjs000066400000000000000000000001751450520414700443750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual2 = "Virtual2!"; exports.virtual2 = virtual2; })); main-amd-30156411.mjs000066400000000000000000000006331450520414700377320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amddefine(['./_virtual/_virtualModule-amd-03552e5c.mjs', './_virtual/_virtualWithExt-amd-e9dc1b7e.mjs', './_virtual/_virtualWithAssetExt.str-amd-724c602d.mjs'], (function (_virtualModule, _virtualWithExt, _virtualWithAssetExt) { 'use strict'; assert.equal(_virtualModule.virtual, 'Virtual!'); assert.equal(_virtualWithExt.virtual2, 'Virtual2!'); assert.equal(_virtualWithAssetExt.virtual3, 'Virtual3!'); })); cjs/000077500000000000000000000000001450520414700346465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected_virtual/000077500000000000000000000000001450520414700364735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs_virtualModule-cjs-bbe1ad5e.mjs000066400000000000000000000001071450520414700443220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual'use strict'; const virtual = "Virtual!"; exports.virtual = virtual; _virtualWithAssetExt.str-cjs-0e561611.mjs000066400000000000000000000001131450520414700457150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual'use strict'; const virtual3 = "Virtual3!"; exports.virtual3 = virtual3; _virtualWithExt-cjs-b148ca33.mjs000066400000000000000000000001131450520414700442460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual'use strict'; const virtual2 = "Virtual2!"; exports.virtual2 = virtual2; main-cjs-23637a85.mjs000066400000000000000000000006471450520414700400710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs'use strict'; var _virtualModule = require('./_virtual/_virtualModule-cjs-bbe1ad5e.mjs'); var _virtualWithExt = require('./_virtual/_virtualWithExt-cjs-b148ca33.mjs'); var _virtualWithAssetExt = require('./_virtual/_virtualWithAssetExt.str-cjs-0e561611.mjs'); assert.equal(_virtualModule.virtual, 'Virtual!'); assert.equal(_virtualWithExt.virtual2, 'Virtual2!'); assert.equal(_virtualWithAssetExt.virtual3, 'Virtual3!'); es/000077500000000000000000000000001450520414700344765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected_virtual/000077500000000000000000000000001450520414700363235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es_virtualModule-es-22303f19.mjs000066400000000000000000000000611450520414700434220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtualconst virtual = "Virtual!"; export { virtual }; _virtualWithAssetExt.str-es-07beb78c.mjs000066400000000000000000000000641450520414700456330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtualconst virtual3 = "Virtual3!"; export { virtual3 }; _virtualWithExt-es-6330be37.mjs000066400000000000000000000000641450520414700436570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtualconst virtual2 = "Virtual2!"; export { virtual2 }; main-es-956265de.mjs000066400000000000000000000005121450520414700376270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/esimport { virtual } from './_virtual/_virtualModule-es-22303f19.mjs'; import { virtual2 } from './_virtual/_virtualWithExt-es-6330be37.mjs'; import { virtual3 } from './_virtual/_virtualWithAssetExt.str-es-07beb78c.mjs'; assert.equal(virtual, 'Virtual!'); assert.equal(virtual2, 'Virtual2!'); assert.equal(virtual3, 'Virtual3!'); system/000077500000000000000000000000001450520414700354135ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected_virtual/000077500000000000000000000000001450520414700372405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system_virtualModule-system-26bc5070.mjs000066400000000000000000000002401450520414700453320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const virtual = exports('virtual', "Virtual!"); }) }; })); _virtualWithAssetExt.str-system-98927794.mjs000066400000000000000000000002431450520414700472110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const virtual3 = exports('virtual3', "Virtual3!"); }) }; })); _virtualWithExt-system-11e583df.mjs000066400000000000000000000002431450520414700455740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const virtual2 = exports('virtual2', "Virtual2!"); }) }; })); main-system-36e9b93b.mjs000066400000000000000000000011151450520414700415360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/systemSystem.register(['./_virtual/_virtualModule-system-26bc5070.mjs', './_virtual/_virtualWithExt-system-11e583df.mjs', './_virtual/_virtualWithAssetExt.str-system-98927794.mjs'], (function () { 'use strict'; var virtual, virtual2, virtual3; return { setters: [function (module) { virtual = module.virtual; }, function (module) { virtual2 = module.virtual2; }, function (module) { virtual3 = module.virtual3; }], execute: (function () { assert.equal(virtual, 'Virtual!'); assert.equal(virtual2, 'Virtual2!'); assert.equal(virtual3, 'Virtual3!'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/main.js000066400000000000000000000001551450520414700334710ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); assert.equal(virtual2, 'Virtual2!'); assert.equal(virtual3, 'Virtual3!'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/000077500000000000000000000000001450520414700267555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_config.js000066400000000000000000000010551450520414700307200ustar00rootroot00000000000000module.exports = defineTest({ description: 'Generates actual files for virtual modules when preserving modules', options: { input: 'main.js', output: { preserveModules: true }, plugins: [ { resolveId(id) { if (id === '\0virtualModule') return id; }, load(id) { if (id !== '\0virtualModule') return null; return 'export const virtual = "Virtual!";\n'; }, transform(code, id) { if (id === '\0virtualModule') return null; return 'import {virtual} from "\0virtualModule";\n' + code; } } ] } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/000077500000000000000000000000001450520414700307155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/amd/000077500000000000000000000000001450520414700314565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/amd/_virtual/000077500000000000000000000000001450520414700333035ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000001711450520414700365540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual = "Virtual!"; exports.virtual = virtual; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/amd/main.js000066400000000000000000000002131450520414700327340ustar00rootroot00000000000000define(['./_virtual/_virtualModule'], (function (_virtualModule) { 'use strict'; assert.equal(_virtualModule.virtual, 'Virtual!'); })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/cjs/000077500000000000000000000000001450520414700314745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/cjs/_virtual/000077500000000000000000000000001450520414700333215ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000001071450520414700365710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/cjs/_virtual'use strict'; const virtual = "Virtual!"; exports.virtual = virtual; rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/cjs/main.js000066400000000000000000000002001450520414700327460ustar00rootroot00000000000000'use strict'; var _virtualModule = require('./_virtual/_virtualModule.js'); assert.equal(_virtualModule.virtual, 'Virtual!'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/es/000077500000000000000000000000001450520414700313245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/es/_virtual/000077500000000000000000000000001450520414700331515ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000000611450520414700364200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/es/_virtualconst virtual = "Virtual!"; export { virtual }; rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/es/main.js000066400000000000000000000001341450520414700326040ustar00rootroot00000000000000import { virtual } from './_virtual/_virtualModule.js'; assert.equal(virtual, 'Virtual!'); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/system/000077500000000000000000000000001450520414700322415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/system/_virtual/000077500000000000000000000000001450520414700340665ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000002401450520414700373340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const virtual = exports('virtual', "Virtual!"); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/system/main.js000066400000000000000000000003731450520414700335260ustar00rootroot00000000000000System.register(['./_virtual/_virtualModule.js'], (function () { 'use strict'; var virtual; return { setters: [function (module) { virtual = module.virtual; }], execute: (function () { assert.equal(virtual, 'Virtual!'); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules-virtual-modules/main.js000066400000000000000000000000431450520414700302340ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); rollup-3.29.4/test/chunking-form/samples/preserve-modules/000077500000000000000000000000001450520414700236235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_config.js000066400000000000000000000002421450520414700255630ustar00rootroot00000000000000module.exports = defineTest({ description: 'Rewrite modules in-place', options: { input: ['main1.js', 'main2.js'], output: { preserveModules: true } } }); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/000077500000000000000000000000001450520414700255635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/000077500000000000000000000000001450520414700263245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/deps/000077500000000000000000000000001450520414700272575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/deps/dep1.js000066400000000000000000000002061450520414700304440ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('dep1 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/deps/dep2.js000066400000000000000000000002521450520414700304460ustar00rootroot00000000000000define(['exports', '../lib/lib2'], (function (exports, lib2) { 'use strict'; function fn () { lib2.fn(); console.log('dep2 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/deps/dep3.js000066400000000000000000000002521450520414700304470ustar00rootroot00000000000000define(['exports', '../lib/lib1'], (function (exports, lib1) { 'use strict'; function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/lib/000077500000000000000000000000001450520414700270725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/lib/lib1.js000066400000000000000000000002061450520414700302550ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/lib/lib2.js000066400000000000000000000002061450520414700302560ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib2 fn'); } exports.fn = fn; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/main1.js000066400000000000000000000002671450520414700276740ustar00rootroot00000000000000define(['./deps/dep1', './deps/dep2'], (function (dep1, dep2) { 'use strict'; class Main1 { constructor () { dep1.fn(); dep2.fn(); } } return Main1; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/amd/main2.js000066400000000000000000000002671450520414700276750ustar00rootroot00000000000000define(['./deps/dep2', './deps/dep3'], (function (dep2, dep3) { 'use strict'; class Main2 { constructor () { dep3.fn(); dep2.fn(); } } return Main2; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/000077500000000000000000000000001450520414700263425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/deps/000077500000000000000000000000001450520414700272755ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/deps/dep1.js000066400000000000000000000001161450520414700304620ustar00rootroot00000000000000'use strict'; function fn () { console.log('dep1 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/deps/dep2.js000066400000000000000000000002021450520414700304570ustar00rootroot00000000000000'use strict'; var lib2 = require('../lib/lib2.js'); function fn () { lib2.fn(); console.log('dep2 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/deps/dep3.js000066400000000000000000000002021450520414700304600ustar00rootroot00000000000000'use strict'; var lib1 = require('../lib/lib1.js'); function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/lib/000077500000000000000000000000001450520414700271105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/lib/lib1.js000066400000000000000000000001161450520414700302730ustar00rootroot00000000000000'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/lib/lib2.js000066400000000000000000000001161450520414700302740ustar00rootroot00000000000000'use strict'; function fn () { console.log('lib2 fn'); } exports.fn = fn; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/main1.js000066400000000000000000000002721450520414700277060ustar00rootroot00000000000000'use strict'; var dep1 = require('./deps/dep1.js'); var dep2 = require('./deps/dep2.js'); class Main1 { constructor () { dep1.fn(); dep2.fn(); } } module.exports = Main1; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/cjs/main2.js000066400000000000000000000002721450520414700277070ustar00rootroot00000000000000'use strict'; var dep2 = require('./deps/dep2.js'); var dep3 = require('./deps/dep3.js'); class Main2 { constructor () { dep3.fn(); dep2.fn(); } } module.exports = Main2; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/000077500000000000000000000000001450520414700261725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/deps/000077500000000000000000000000001450520414700271255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/deps/dep1.js000066400000000000000000000000751450520414700303160ustar00rootroot00000000000000function fn () { console.log('dep1 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/deps/dep2.js000066400000000000000000000001651450520414700303170ustar00rootroot00000000000000import { fn as fn$1 } from '../lib/lib2.js'; function fn () { fn$1(); console.log('dep2 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/deps/dep3.js000066400000000000000000000001651450520414700303200ustar00rootroot00000000000000import { fn as fn$1 } from '../lib/lib1.js'; function fn () { fn$1(); console.log('dep3 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/lib/000077500000000000000000000000001450520414700267405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/lib/lib1.js000066400000000000000000000000751450520414700301270ustar00rootroot00000000000000function fn () { console.log('lib1 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/lib/lib2.js000066400000000000000000000000751450520414700301300ustar00rootroot00000000000000function fn () { console.log('lib2 fn'); } export { fn }; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/main1.js000066400000000000000000000002561450520414700275400ustar00rootroot00000000000000import { fn } from './deps/dep1.js'; import { fn as fn$1 } from './deps/dep2.js'; class Main1 { constructor () { fn(); fn$1(); } } export { Main1 as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/es/main2.js000066400000000000000000000002561450520414700275410ustar00rootroot00000000000000import { fn as fn$1 } from './deps/dep2.js'; import { fn } from './deps/dep3.js'; class Main2 { constructor () { fn(); fn$1(); } } export { Main2 as default }; rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/000077500000000000000000000000001450520414700271075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/deps/000077500000000000000000000000001450520414700300425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/deps/dep1.js000066400000000000000000000003151450520414700312300ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('dep1 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/deps/dep2.js000066400000000000000000000004731450520414700312360ustar00rootroot00000000000000System.register(['../lib/lib2.js'], (function (exports) { 'use strict'; var fn$1; return { setters: [function (module) { fn$1 = module.fn; }], execute: (function () { exports('fn', fn); function fn () { fn$1(); console.log('dep2 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/deps/dep3.js000066400000000000000000000004731450520414700312370ustar00rootroot00000000000000System.register(['../lib/lib1.js'], (function (exports) { 'use strict'; var fn$1; return { setters: [function (module) { fn$1 = module.fn; }], execute: (function () { exports('fn', fn); function fn () { fn$1(); console.log('dep3 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/lib/000077500000000000000000000000001450520414700276555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/lib/lib1.js000066400000000000000000000003151450520414700310410ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('lib1 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/lib/lib2.js000066400000000000000000000003151450520414700310420ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('lib2 fn'); } }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/main1.js000066400000000000000000000006251450520414700304550ustar00rootroot00000000000000System.register(['./deps/dep1.js', './deps/dep2.js'], (function (exports) { 'use strict'; var fn, fn$1; return { setters: [function (module) { fn = module.fn; }, function (module) { fn$1 = module.fn; }], execute: (function () { class Main1 { constructor () { fn(); fn$1(); } } exports('default', Main1); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/_expected/system/main2.js000066400000000000000000000006251450520414700304560ustar00rootroot00000000000000System.register(['./deps/dep2.js', './deps/dep3.js'], (function (exports) { 'use strict'; var fn$1, fn; return { setters: [function (module) { fn$1 = module.fn; }, function (module) { fn = module.fn; }], execute: (function () { class Main2 { constructor () { fn(); fn$1(); } } exports('default', Main2); }) }; })); rollup-3.29.4/test/chunking-form/samples/preserve-modules/deps/000077500000000000000000000000001450520414700245565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/deps/dep1.js000066400000000000000000000000631450520414700257440ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-3.29.4/test/chunking-form/samples/preserve-modules/deps/dep2.js000066400000000000000000000001551450520414700257470ustar00rootroot00000000000000import { fn as libfn } from '../lib/lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-3.29.4/test/chunking-form/samples/preserve-modules/deps/dep3.js000066400000000000000000000002251450520414700257460ustar00rootroot00000000000000import { fn as libfn, treeshaked } from '../lib/lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-3.29.4/test/chunking-form/samples/preserve-modules/lib/000077500000000000000000000000001450520414700243715ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/preserve-modules/lib/lib1.js000066400000000000000000000001751450520414700255610ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-3.29.4/test/chunking-form/samples/preserve-modules/lib/lib2.js000066400000000000000000000000631450520414700255560ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-3.29.4/test/chunking-form/samples/preserve-modules/main1.js000066400000000000000000000002341450520414700251650ustar00rootroot00000000000000import { fn } from './deps/dep1.js'; import { fn as fn2 } from './deps/dep2.js'; export default class Main1 { constructor () { fn(); fn2(); } }rollup-3.29.4/test/chunking-form/samples/preserve-modules/main2.js000066400000000000000000000003231450520414700251650ustar00rootroot00000000000000import { fn } from './deps/dep2.js'; import { fn as fn2, default as treeshaked } from './deps/dep3.js'; if (false) { treeshaked(); } export default class Main2 { constructor () { fn2(); fn(); } }rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/000077500000000000000000000000001450520414700242725ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_config.js000066400000000000000000000002151450520414700262320ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows reexporting from other entry points', options: { input: ['main', 'otherEntry'] } }); rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/000077500000000000000000000000001450520414700262325ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/amd/000077500000000000000000000000001450520414700267735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/amd/generated-main.js000066400000000000000000000002301450520414700322040ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let a = {}; let b = {}; let c = {}; exports.a = a; exports.b = b; exports.c = c; })); rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/amd/main.js000066400000000000000000000002271450520414700302560ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, otherEntry) { 'use strict'; exports.a = otherEntry.a; exports.c = otherEntry.c; })); rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/amd/otherEntry.js000066400000000000000000000002271450520414700314750ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, otherEntry) { 'use strict'; exports.b = otherEntry.b; exports.c = otherEntry.c; })); rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/cjs/000077500000000000000000000000001450520414700270115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/cjs/generated-main.js000066400000000000000000000001421450520414700322240ustar00rootroot00000000000000'use strict'; let a = {}; let b = {}; let c = {}; exports.a = a; exports.b = b; exports.c = c; rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/cjs/main.js000066400000000000000000000001671450520414700302770ustar00rootroot00000000000000'use strict'; var otherEntry = require('./generated-main.js'); exports.a = otherEntry.a; exports.c = otherEntry.c; rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/cjs/otherEntry.js000066400000000000000000000001671450520414700315160ustar00rootroot00000000000000'use strict'; var otherEntry = require('./generated-main.js'); exports.b = otherEntry.b; exports.c = otherEntry.c; rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/es/000077500000000000000000000000001450520414700266415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/es/generated-main.js000066400000000000000000000000721450520414700320560ustar00rootroot00000000000000let a = {}; let b = {}; let c = {}; export { a, b, c }; rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/es/main.js000066400000000000000000000000541450520414700301220ustar00rootroot00000000000000export { a, c } from './generated-main.js'; rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/es/otherEntry.js000066400000000000000000000000541450520414700313410ustar00rootroot00000000000000export { b, c } from './generated-main.js'; rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/system/000077500000000000000000000000001450520414700275565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/system/generated-main.js000066400000000000000000000003051450520414700327720ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { let a = exports('a', {}); let b = exports('b', {}); let c = exports('c', {}); }) }; })); rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/system/main.js000066400000000000000000000003231450520414700310360ustar00rootroot00000000000000System.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ a: module.a, c: module.c }); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/_expected/system/otherEntry.js000066400000000000000000000003231450520414700322550ustar00rootroot00000000000000System.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ b: module.b, c: module.c }); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/common.js000066400000000000000000000000461450520414700261200ustar00rootroot00000000000000export let a = {}; export let b = {}; rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/main.js000066400000000000000000000001061450520414700255510ustar00rootroot00000000000000export { a } from './common.js'; export { c } from './otherEntry.js'; rollup-3.29.4/test/chunking-form/samples/reexport-from-entry/otherEntry.js000066400000000000000000000000641450520414700267730ustar00rootroot00000000000000export { b } from './common.js'; export let c = {}; rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/000077500000000000000000000000001450520414700243675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_config.js000066400000000000000000000002341450520414700263300ustar00rootroot00000000000000module.exports = defineTest({ description: 'Tracing reexport shortpaths to entry points', options: { input: ['main1.js', 'main2.js', 'main3.js'] } }); rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/000077500000000000000000000000001450520414700263275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/amd/000077500000000000000000000000001450520414700270705ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/amd/main1.js000066400000000000000000000001221450520414700304260ustar00rootroot00000000000000define(['./main2'], (function (main2) { 'use strict'; return main2.foo; })); rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/amd/main2.js000066400000000000000000000001751450520414700304370ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function foo() {} console.log('dep2'); exports.foo = foo; })); rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/amd/main3.js000066400000000000000000000000761450520414700304400ustar00rootroot00000000000000define(['./main2'], (function (main2) { 'use strict'; })); rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/cjs/000077500000000000000000000000001450520414700271065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/cjs/main1.js000066400000000000000000000001211450520414700304430ustar00rootroot00000000000000'use strict'; var main2 = require('./main2.js'); module.exports = main2.foo; rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/cjs/main2.js000066400000000000000000000001121450520414700304440ustar00rootroot00000000000000'use strict'; function foo() {} console.log('dep2'); exports.foo = foo; rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/cjs/main3.js000066400000000000000000000000471450520414700304540ustar00rootroot00000000000000'use strict'; require('./main2.js'); rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/es/000077500000000000000000000000001450520414700267365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/es/main1.js000066400000000000000000000001051450520414700302750ustar00rootroot00000000000000import { f as foo } from './main2.js'; export { foo as default }; rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/es/main2.js000066400000000000000000000000751450520414700303040ustar00rootroot00000000000000function foo() {} console.log('dep2'); export { foo as f }; rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/es/main3.js000066400000000000000000000000251450520414700303000ustar00rootroot00000000000000import './main2.js'; rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/system/000077500000000000000000000000001450520414700276535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/system/main1.js000066400000000000000000000003361450520414700312200ustar00rootroot00000000000000System.register(['./main2.js'], (function (exports) { 'use strict'; var foo; return { setters: [function (module) { foo = module.f; exports('default', module.f); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/system/main2.js000066400000000000000000000002611450520414700312160ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', foo); function foo() {} console.log('dep2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/_expected/system/main3.js000066400000000000000000000002061450520414700312160ustar00rootroot00000000000000System.register(['./main2.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/dep1.js000066400000000000000000000000411450520414700255510ustar00rootroot00000000000000export { default } from './dep2';rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/dep2.js000066400000000000000000000000621450520414700255550ustar00rootroot00000000000000export default function() {} console.log('dep2'); rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/main1.js000066400000000000000000000000561450520414700257330ustar00rootroot00000000000000import foo from './dep1'; export default foo; rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/main2.js000066400000000000000000000000241450520414700257270ustar00rootroot00000000000000import './dep1.js'; rollup-3.29.4/test/chunking-form/samples/reexport-shortpaths/main3.js000066400000000000000000000000241450520414700257300ustar00rootroot00000000000000import './dep2.js'; rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/000077500000000000000000000000001450520414700267655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_config.js000066400000000000000000000003621450520414700307300ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows relative external dependencies outside of output dir', options: { input: { main: 'main.js', 'nested/main': 'nested/main.js' }, external(id) { return id.startsWith('../'); } } }); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/000077500000000000000000000000001450520414700307255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/amd/000077500000000000000000000000001450520414700314665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/amd/main.js000066400000000000000000000002141450520414700327450ustar00rootroot00000000000000define(['../first', '../../second'], (function (first_js, second_js) { 'use strict'; console.log(first_js.first, second_js.second); })); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/amd/nested/000077500000000000000000000000001450520414700327505ustar00rootroot00000000000000main.js000066400000000000000000000002221450520414700341470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/amd/nesteddefine(['../../first', '../../../second'], (function (first_js, second_js) { 'use strict'; console.log(first_js.first, second_js.second); })); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/cjs/000077500000000000000000000000001450520414700315045ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/cjs/main.js000066400000000000000000000002221450520414700327620ustar00rootroot00000000000000'use strict'; var first_js = require('../first.js'); var second_js = require('../../second.js'); console.log(first_js.first, second_js.second); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/cjs/nested/000077500000000000000000000000001450520414700327665ustar00rootroot00000000000000main.js000066400000000000000000000002301450520414700341640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/cjs/nested'use strict'; var first_js = require('../../first.js'); var second_js = require('../../../second.js'); console.log(first_js.first, second_js.second); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/es/000077500000000000000000000000001450520414700313345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/es/main.js000066400000000000000000000001541450520414700326160ustar00rootroot00000000000000import { first } from '../first.js'; import { second } from '../../second.js'; console.log(first, second); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/es/nested/000077500000000000000000000000001450520414700326165ustar00rootroot00000000000000main.js000066400000000000000000000001621450520414700340200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/es/nestedimport { first } from '../../first.js'; import { second } from '../../../second.js'; console.log(first, second); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/system/000077500000000000000000000000001450520414700322515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/system/main.js000066400000000000000000000004541450520414700335360ustar00rootroot00000000000000System.register(['../first.js', '../../second.js'], (function () { 'use strict'; var first, second; return { setters: [function (module) { first = module.first; }, function (module) { second = module.second; }], execute: (function () { console.log(first, second); }) }; })); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/system/nested/000077500000000000000000000000001450520414700335335ustar00rootroot00000000000000main.js000066400000000000000000000004621450520414700347400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/_expected/system/nestedSystem.register(['../../first.js', '../../../second.js'], (function () { 'use strict'; var first, second; return { setters: [function (module) { first = module.first; }, function (module) { second = module.second; }], execute: (function () { console.log(first, second); }) }; })); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/main.js000066400000000000000000000001531450520414700302460ustar00rootroot00000000000000import { first } from '../first.js'; import { second } from '../../second.js'; console.log(first, second); rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/nested/000077500000000000000000000000001450520414700302475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/relative-external-outside-output/nested/main.js000066400000000000000000000001611450520414700315270ustar00rootroot00000000000000import { first } from '../../first.js'; import { second } from '../../../second.js'; console.log(first, second); rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/000077500000000000000000000000001450520414700247205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_config.js000066400000000000000000000045411450520414700266660ustar00rootroot00000000000000const assert = require('node:assert'); const { replaceDirectoryInStringifiedObject } = require('../../../utils'); module.exports = defineTest({ description: 'replaces hashes when mutating chunk info in renderChunk', options: { input: ['main1', 'main2'], plugins: { renderChunk(code, chunk, options, { chunks }) { if (chunk.fileName.includes('main2')) { const main1Chunk = Object.keys(chunks).find(fileName => fileName.includes('main1')); chunk.imports.push(main1Chunk); chunk.importedBindings[main1Chunk] = ['added']; return `import { added } from ${JSON.stringify( `./${main1Chunk}` )};\nconsole.log(added);\n${code}`; } chunk.exports.push('added'); return `${code}\nexport const added = 'added';`; }, generateBundle(options, bundle) { const sanitizedBundle = JSON.parse( replaceDirectoryInStringifiedObject(bundle, __dirname).replace( /(entry-\w+)-\w+\.js/g, (match, name) => `${name}.js` ) ); for (const fileName of Object.keys(sanitizedBundle)) { delete sanitizedBundle[fileName].code; delete sanitizedBundle[fileName].modules; } assert.deepStrictEqual(sanitizedBundle, { 'entry-main1.js': { exports: ['added'], facadeModuleId: '**/main1.js', isDynamicEntry: false, isEntry: true, isImplicitEntry: false, moduleIds: ['**/main1.js'], name: 'main1', type: 'chunk', dynamicImports: [], fileName: 'entry-main1.js', implicitlyLoadedBefore: [], importedBindings: {}, imports: [], preliminaryFileName: 'entry-main1-!~{001}~.js', referencedFiles: [], map: null, sourcemapFileName: null }, 'entry-main2.js': { exports: [], facadeModuleId: '**/main2.js', isDynamicEntry: false, isEntry: true, isImplicitEntry: false, moduleIds: ['**/main2.js'], name: 'main2', type: 'chunk', dynamicImports: [], fileName: 'entry-main2.js', implicitlyLoadedBefore: [], importedBindings: { 'entry-main1.js': ['added'] }, imports: ['entry-main1.js'], preliminaryFileName: 'entry-main2-!~{002}~.js', referencedFiles: [], map: null, sourcemapFileName: null } }); } }, output: { entryFileNames: 'entry-[name]-[hash].js', chunkFileNames: 'chunk-[name]-[hash].js' } } }); rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/000077500000000000000000000000001450520414700266605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/amd/000077500000000000000000000000001450520414700274215ustar00rootroot00000000000000entry-main1-31ed1903.js000066400000000000000000000001401450520414700331060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/amddefine((function () { 'use strict'; console.log('main1'); })); export const added = 'added'; entry-main2-4c3da82f.js000066400000000000000000000002111450520414700332530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/amdimport { added } from "./entry-main1-31ed1903.js"; console.log(added); define((function () { 'use strict'; console.log('main2'); })); rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/cjs/000077500000000000000000000000001450520414700274375ustar00rootroot00000000000000entry-main1-c6673fa5.js000066400000000000000000000001031450520414700332160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/cjs'use strict'; console.log('main1'); export const added = 'added'; entry-main2-a3a04675.js000066400000000000000000000001541450520414700331330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/cjsimport { added } from "./entry-main1-c6673fa5.js"; console.log(added); 'use strict'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/es/000077500000000000000000000000001450520414700272675ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main1-56d7d368.js000066400000000000000000000000641450520414700330610ustar00rootroot00000000000000console.log('main1'); export const added = 'added'; rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/es/entry-main2-7827261c.js000066400000000000000000000001351450520414700327720ustar00rootroot00000000000000import { added } from "./entry-main1-56d7d368.js"; console.log(added); console.log('main2'); rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/system/000077500000000000000000000000001450520414700302045ustar00rootroot00000000000000entry-main1-d7dc9358.js000066400000000000000000000002351450520414700337770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main1'); }) }; })); export const added = 'added'; entry-main2-f1bbcc21.js000066400000000000000000000003061450520414700341100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/_expected/systemimport { added } from "./entry-main1-d7dc9358.js"; console.log(added); System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main2'); }) }; })); rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/main1.js000066400000000000000000000000261450520414700262610ustar00rootroot00000000000000console.log('main1'); rollup-3.29.4/test/chunking-form/samples/render-chunk-transform/main2.js000066400000000000000000000000261450520414700262620ustar00rootroot00000000000000console.log('main2'); rollup-3.29.4/test/chunking-form/samples/render-chunk/000077500000000000000000000000001450520414700227075ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk/_config.js000066400000000000000000000023031450520414700246470ustar00rootroot00000000000000const assert = require('node:assert'); const { replaceDirectoryInStringifiedObject } = require('../../../utils'); module.exports = defineTest({ description: 'transforms chunks in the renderChunk hook, also transforming hashes added in the hook', options: { input: ['main1', 'main2'], plugins: { transform(code) { const referenceId = this.emitFile({ type: 'asset', name: 'test', source: 'test' }); return `${code}\nconsole.log('referenced asset', import.meta.ROLLUP_FILE_URL_${referenceId});`; }, renderChunk(code, chunk, options, { chunks }) { // Ensure the entries in "chunks" reference the actual chunk objects assert.strictEqual(chunks[chunk.fileName], chunk); return ( code + `\nconsole.log(${replaceDirectoryInStringifiedObject(chunk, __dirname)});` + `\nconsole.log('all chunks', ${JSON.stringify(Object.keys(chunks))})` + `\nconsole.log('referenced asset in renderChunk', '${this.getFileName( this.emitFile({ type: 'asset', name: 'test', source: 'test' }) )}');` ); } }, output: { entryFileNames: 'entry-[name]-[hash].js', chunkFileNames: 'chunk-[name]-[hash].js', assetFileNames: 'asset-[name]-[hash][extname]' } } }); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/000077500000000000000000000000001450520414700246475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/amd/000077500000000000000000000000001450520414700254105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/amd/asset-test-9f86d081000066400000000000000000000000041450520414700305100ustar00rootroot00000000000000testrollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/amd/chunk-dep2-af768b5f.js000066400000000000000000000021621450520414700311350ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; var num = 2; console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); exports.num = num; })); console.log({ "exports": [ "num" ], "facadeModuleId": null, "isDynamicEntry": false, "isEntry": false, "isImplicitEntry": false, "moduleIds": [ "**/dep2.js" ], "name": "dep2", "type": "chunk", "dynamicImports": [], "fileName": "chunk-dep2-af768b5f.js", "implicitlyLoadedBefore": [], "importedBindings": {}, "imports": [], "modules": { "**/dep2.js": { "code": "\tvar num = 2;\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 117 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-62378d9a.js","entry-main2-d26bed01.js","chunk-dep2-af768b5f.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/amd/entry-main1-62378d9a.js000066400000000000000000000032001450520414700311720ustar00rootroot00000000000000define(['require', './chunk-dep2-af768b5f'], (function (require, dep2) { 'use strict'; var num = 1; console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); console.log(num + dep2.num); console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); })); console.log({ "exports": [], "facadeModuleId": "**/main1.js", "isDynamicEntry": false, "isEntry": true, "isImplicitEntry": false, "moduleIds": [ "**/dep1.js", "**/main1.js" ], "name": "main1", "type": "chunk", "dynamicImports": [], "fileName": "entry-main1-62378d9a.js", "implicitlyLoadedBefore": [], "importedBindings": { "chunk-dep2-af768b5f.js": [ "num" ] }, "imports": [ "chunk-dep2-af768b5f.js" ], "modules": { "**/dep1.js": { "code": "\tvar num = 1;\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 117 }, "**/main1.js": { "code": "\tconsole.log(num + dep2.num);\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], "renderedLength": 133 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-62378d9a.js","entry-main2-d26bed01.js","chunk-dep2-af768b5f.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/amd/entry-main2-d26bed01.js000066400000000000000000000032001450520414700313130ustar00rootroot00000000000000define(['require', './chunk-dep2-af768b5f'], (function (require, dep2) { 'use strict'; var num = 3; console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); console.log(dep2.num + num); console.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href); })); console.log({ "exports": [], "facadeModuleId": "**/main2.js", "isDynamicEntry": false, "isEntry": true, "isImplicitEntry": false, "moduleIds": [ "**/dep3.js", "**/main2.js" ], "name": "main2", "type": "chunk", "dynamicImports": [], "fileName": "entry-main2-d26bed01.js", "implicitlyLoadedBefore": [], "importedBindings": { "chunk-dep2-af768b5f.js": [ "num" ] }, "imports": [ "chunk-dep2-af768b5f.js" ], "modules": { "**/dep3.js": { "code": "\tvar num = 3;\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 117 }, "**/main2.js": { "code": "\tconsole.log(dep2.num + num);\n\tconsole.log('referenced asset', new URL(require.toUrl('./asset-test-9f86d081'), document.baseURI).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], "renderedLength": 133 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-62378d9a.js","entry-main2-d26bed01.js","chunk-dep2-af768b5f.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/cjs/000077500000000000000000000000001450520414700254265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/cjs/asset-test-9f86d081000066400000000000000000000000041450520414700305260ustar00rootroot00000000000000testrollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/cjs/chunk-dep2-8d89c265.js000066400000000000000000000025271450520414700310240ustar00rootroot00000000000000'use strict'; var num = 2; console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); exports.num = num; console.log({ "exports": [ "num" ], "facadeModuleId": null, "isDynamicEntry": false, "isEntry": false, "isImplicitEntry": false, "moduleIds": [ "**/dep2.js" ], "name": "dep2", "type": "chunk", "dynamicImports": [], "fileName": "chunk-dep2-8d89c265.js", "implicitlyLoadedBefore": [], "importedBindings": {}, "imports": [], "modules": { "**/dep2.js": { "code": "var num = 2;\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 269 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-5be92ae4.js","entry-main2-20c5a0f4.js","chunk-dep2-8d89c265.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main1-5be92ae4.js000066400000000000000000000042661450520414700313560ustar00rootroot00000000000000'use strict'; var dep2 = require('./chunk-dep2-8d89c265.js'); var num = 1; console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log(num + dep2.num); console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log({ "exports": [], "facadeModuleId": "**/main1.js", "isDynamicEntry": false, "isEntry": true, "isImplicitEntry": false, "moduleIds": [ "**/dep1.js", "**/main1.js" ], "name": "main1", "type": "chunk", "dynamicImports": [], "fileName": "entry-main1-5be92ae4.js", "implicitlyLoadedBefore": [], "importedBindings": { "chunk-dep2-8d89c265.js": [ "num" ] }, "imports": [ "chunk-dep2-8d89c265.js" ], "modules": { "**/dep1.js": { "code": "var num = 1;\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 269 }, "**/main1.js": { "code": "console.log(num + dep2.num);\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 102, "removedExports": [], "renderedExports": [], "renderedLength": 285 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-5be92ae4.js","entry-main2-20c5a0f4.js","chunk-dep2-8d89c265.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/cjs/entry-main2-20c5a0f4.js000066400000000000000000000042661450520414700312630ustar00rootroot00000000000000'use strict'; var dep2 = require('./chunk-dep2-8d89c265.js'); var num = 3; console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log(dep2.num + num); console.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href)); console.log({ "exports": [], "facadeModuleId": "**/main2.js", "isDynamicEntry": false, "isEntry": true, "isImplicitEntry": false, "moduleIds": [ "**/dep3.js", "**/main2.js" ], "name": "main2", "type": "chunk", "dynamicImports": [], "fileName": "entry-main2-20c5a0f4.js", "implicitlyLoadedBefore": [], "importedBindings": { "chunk-dep2-8d89c265.js": [ "num" ] }, "imports": [ "chunk-dep2-8d89c265.js" ], "modules": { "**/dep3.js": { "code": "var num = 3;\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 269 }, "**/main2.js": { "code": "console.log(dep2.num + num);\nconsole.log('referenced asset', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/asset-test-9f86d081').href : new URL('asset-test-9f86d081', document.currentScript && document.currentScript.src || document.baseURI).href));", "originalLength": 102, "removedExports": [], "renderedExports": [], "renderedLength": 285 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-5be92ae4.js","entry-main2-20c5a0f4.js","chunk-dep2-8d89c265.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/es/000077500000000000000000000000001450520414700252565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/es/asset-test-9f86d081000066400000000000000000000000041450520414700303560ustar00rootroot00000000000000testrollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/es/chunk-dep2-0da9d5f1.js000066400000000000000000000017631450520414700307760ustar00rootroot00000000000000var num = 2; console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); export { num as n }; console.log({ "exports": [ "n" ], "facadeModuleId": null, "isDynamicEntry": false, "isEntry": false, "isImplicitEntry": false, "moduleIds": [ "**/dep2.js" ], "name": "dep2", "type": "chunk", "dynamicImports": [], "fileName": "chunk-dep2-0da9d5f1.js", "implicitlyLoadedBefore": [], "importedBindings": {}, "imports": [], "modules": { "**/dep2.js": { "code": "var num = 2;\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 99 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-f3f64fb9.js","entry-main2-d0add96f.js","chunk-dep2-0da9d5f1.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/es/entry-main1-f3f64fb9.js000066400000000000000000000027751450520414700312220ustar00rootroot00000000000000import { n as num$1 } from './chunk-dep2-0da9d5f1.js'; var num = 1; console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); console.log(num + num$1); console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); console.log({ "exports": [], "facadeModuleId": "**/main1.js", "isDynamicEntry": false, "isEntry": true, "isImplicitEntry": false, "moduleIds": [ "**/dep1.js", "**/main1.js" ], "name": "main1", "type": "chunk", "dynamicImports": [], "fileName": "entry-main1-f3f64fb9.js", "implicitlyLoadedBefore": [], "importedBindings": { "chunk-dep2-0da9d5f1.js": [ "n" ] }, "imports": [ "chunk-dep2-0da9d5f1.js" ], "modules": { "**/dep1.js": { "code": "var num = 1;\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 99 }, "**/main1.js": { "code": "console.log(num + num$1);\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], "renderedLength": 112 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-f3f64fb9.js","entry-main2-d0add96f.js","chunk-dep2-0da9d5f1.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/es/entry-main2-d0add96f.js000066400000000000000000000027751450520414700312730ustar00rootroot00000000000000import { n as num$1 } from './chunk-dep2-0da9d5f1.js'; var num = 3; console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); console.log(num$1 + num); console.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href); console.log({ "exports": [], "facadeModuleId": "**/main2.js", "isDynamicEntry": false, "isEntry": true, "isImplicitEntry": false, "moduleIds": [ "**/dep3.js", "**/main2.js" ], "name": "main2", "type": "chunk", "dynamicImports": [], "fileName": "entry-main2-d0add96f.js", "implicitlyLoadedBefore": [], "importedBindings": { "chunk-dep2-0da9d5f1.js": [ "n" ] }, "imports": [ "chunk-dep2-0da9d5f1.js" ], "modules": { "**/dep3.js": { "code": "var num = 3;\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 99 }, "**/main2.js": { "code": "console.log(num$1 + num);\nconsole.log('referenced asset', new URL('asset-test-9f86d081', import.meta.url).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], "renderedLength": 112 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-f3f64fb9.js","entry-main2-d0add96f.js","chunk-dep2-0da9d5f1.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/system/000077500000000000000000000000001450520414700261735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/system/asset-test-9f86d081000066400000000000000000000000041450520414700312730ustar00rootroot00000000000000testrollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/system/chunk-dep2-be1287c1.js000066400000000000000000000022011450520414700316160ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var num = exports('n', 2); console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); }) }; })); console.log({ "exports": [ "n" ], "facadeModuleId": null, "isDynamicEntry": false, "isEntry": false, "isImplicitEntry": false, "moduleIds": [ "**/dep2.js" ], "name": "dep2", "type": "chunk", "dynamicImports": [], "fileName": "chunk-dep2-be1287c1.js", "implicitlyLoadedBefore": [], "importedBindings": {}, "imports": [], "modules": { "**/dep2.js": { "code": "\t\t\tvar num = exports('n', 2);\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 113 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-f0891ef8.js","entry-main2-ef5991ab.js","chunk-dep2-be1287c1.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/system/entry-main1-f0891ef8.js000066400000000000000000000032771450520414700320560ustar00rootroot00000000000000System.register(['./chunk-dep2-be1287c1.js'], (function (exports, module) { 'use strict'; var num$1; return { setters: [function (module) { num$1 = module.n; }], execute: (function () { var num = 1; console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); console.log(num + num$1); console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); }) }; })); console.log({ "exports": [], "facadeModuleId": "**/main1.js", "isDynamicEntry": false, "isEntry": true, "isImplicitEntry": false, "moduleIds": [ "**/dep1.js", "**/main1.js" ], "name": "main1", "type": "chunk", "dynamicImports": [], "fileName": "entry-main1-f0891ef8.js", "implicitlyLoadedBefore": [], "importedBindings": { "chunk-dep2-be1287c1.js": [ "n" ] }, "imports": [ "chunk-dep2-be1287c1.js" ], "modules": { "**/dep1.js": { "code": "\t\t\tvar num = 1;\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 99 }, "**/main1.js": { "code": "\t\t\tconsole.log(num + num$1);\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], "renderedLength": 112 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-f0891ef8.js","entry-main2-ef5991ab.js","chunk-dep2-be1287c1.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/_expected/system/entry-main2-ef5991ab.js000066400000000000000000000032771450520414700321320ustar00rootroot00000000000000System.register(['./chunk-dep2-be1287c1.js'], (function (exports, module) { 'use strict'; var num$1; return { setters: [function (module) { num$1 = module.n; }], execute: (function () { var num = 3; console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); console.log(num$1 + num); console.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href); }) }; })); console.log({ "exports": [], "facadeModuleId": "**/main2.js", "isDynamicEntry": false, "isEntry": true, "isImplicitEntry": false, "moduleIds": [ "**/dep3.js", "**/main2.js" ], "name": "main2", "type": "chunk", "dynamicImports": [], "fileName": "entry-main2-ef5991ab.js", "implicitlyLoadedBefore": [], "importedBindings": { "chunk-dep2-be1287c1.js": [ "n" ] }, "imports": [ "chunk-dep2-be1287c1.js" ], "modules": { "**/dep3.js": { "code": "\t\t\tvar num = 3;\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", "originalLength": 19, "removedExports": [], "renderedExports": [ "num" ], "renderedLength": 99 }, "**/main2.js": { "code": "\t\t\tconsole.log(num$1 + num);\n\t\t\tconsole.log('referenced asset', new URL('asset-test-9f86d081', module.meta.url).href);", "originalLength": 102, "removedExports": [], "renderedExports": [], "renderedLength": 112 } }, "referencedFiles": [ "asset-test-9f86d081" ] }); console.log('all chunks', ["entry-main1-f0891ef8.js","entry-main2-ef5991ab.js","chunk-dep2-be1287c1.js"]) console.log('referenced asset in renderChunk', 'asset-test-9f86d081'); rollup-3.29.4/test/chunking-form/samples/render-chunk/dep1.js000066400000000000000000000000231450520414700240710ustar00rootroot00000000000000export var num = 1;rollup-3.29.4/test/chunking-form/samples/render-chunk/dep2.js000066400000000000000000000000231450520414700240720ustar00rootroot00000000000000export var num = 2;rollup-3.29.4/test/chunking-form/samples/render-chunk/dep3.js000066400000000000000000000000231450520414700240730ustar00rootroot00000000000000export var num = 3;rollup-3.29.4/test/chunking-form/samples/render-chunk/main1.js000066400000000000000000000001461450520414700242530ustar00rootroot00000000000000import { num as num1 } from './dep1'; import { num as num2 } from './dep2'; console.log(num1 + num2);rollup-3.29.4/test/chunking-form/samples/render-chunk/main2.js000066400000000000000000000001461450520414700242540ustar00rootroot00000000000000import { num as num1 } from './dep2'; import { num as num2 } from './dep3'; console.log(num1 + num2);rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/000077500000000000000000000000001450520414700245335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_config.js000066400000000000000000000012351450520414700264760ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'supports custom rendering for dynamic imports', options: { plugins: { name: 'test-plugin', resolveDynamicImport(specifier) { if (typeof specifier === 'object' && specifier.name === 'someResolvedVariable') { return 'someCustomlyResolvedVariable'; } }, renderDynamicImport({ customResolution, format, moduleId, targetModuleId }) { return { left: `${format}SpecialHandler(`, right: `, '${path.relative(__dirname, moduleId)}', '${ targetModuleId && path.relative(__dirname, targetModuleId) }', ${customResolution})` }; } } } }); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/000077500000000000000000000000001450520414700264735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/amd/000077500000000000000000000000001450520414700272345ustar00rootroot00000000000000generated-imported-via-special-handler.js000066400000000000000000000001041450520414700370730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/amddefine((function () { 'use strict'; console.log('special'); })); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/amd/main.js000066400000000000000000000005211450520414700305140ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; amdSpecialHandler('./generated-imported-via-special-handler', 'main.js', 'imported-via-special-handler.js', null); amdSpecialHandler(someVariable, 'main.js', 'null', null); amdSpecialHandler(someCustomlyResolvedVariable, 'main.js', 'null', someCustomlyResolvedVariable); })); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/cjs/000077500000000000000000000000001450520414700272525ustar00rootroot00000000000000generated-imported-via-special-handler.js000066400000000000000000000000471450520414700371170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/cjs'use strict'; console.log('special'); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/cjs/main.js000066400000000000000000000004411450520414700305330ustar00rootroot00000000000000'use strict'; cjsSpecialHandler('./generated-imported-via-special-handler.js', 'main.js', 'imported-via-special-handler.js', null); cjsSpecialHandler(someVariable, 'main.js', 'null', null); cjsSpecialHandler(someCustomlyResolvedVariable, 'main.js', 'null', someCustomlyResolvedVariable); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/es/000077500000000000000000000000001450520414700271025ustar00rootroot00000000000000generated-imported-via-special-handler.js000066400000000000000000000000301450520414700367370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/esconsole.log('special'); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/es/main.js000066400000000000000000000004171450520414700303660ustar00rootroot00000000000000esSpecialHandler('./generated-imported-via-special-handler.js', 'main.js', 'imported-via-special-handler.js', null); esSpecialHandler(someVariable, 'main.js', 'null', null); esSpecialHandler(someCustomlyResolvedVariable, 'main.js', 'null', someCustomlyResolvedVariable); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/system/000077500000000000000000000000001450520414700300175ustar00rootroot00000000000000generated-imported-via-special-handler.js000066400000000000000000000002011450520414700376540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('special'); }) }; })); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/_expected/system/main.js000066400000000000000000000006311450520414700313010ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { systemSpecialHandler('./generated-imported-via-special-handler.js', 'main.js', 'imported-via-special-handler.js', null); systemSpecialHandler(someVariable, 'main.js', 'null', null); systemSpecialHandler(someCustomlyResolvedVariable, 'main.js', 'null', someCustomlyResolvedVariable); }) }; })); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/imported-via-special-handler.js000066400000000000000000000000301450520414700325130ustar00rootroot00000000000000console.log('special'); rollup-3.29.4/test/chunking-form/samples/render-dynamic-import/main.js000066400000000000000000000001411450520414700260110ustar00rootroot00000000000000import('./imported-via-special-handler.js'); import(someVariable); import(someResolvedVariable); rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/000077500000000000000000000000001450520414700247335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_config.js000066400000000000000000000040341450520414700266760ustar00rootroot00000000000000const path = require('node:path'); const EXISTING = path.resolve(__dirname, 'existing.js'); module.exports = defineTest({ description: 'Supports all resolution formats for dynamic imports', options: { plugins: { resolveId(source) { switch (source) { case 'existing-name': { return EXISTING; } case './direct-relative-external': { return false; } case './indirect-relative-external': { return { id: 'to-indirect-relative-external', external: true }; } case 'direct-absolute-external': { return false; } case 'indirect-absolute-external': { return { id: 'to-indirect-absolute-external', external: true }; } } }, resolveDynamicImport(specifier) { if (typeof specifier === 'string') { switch (specifier) { case 'existing-name': { return EXISTING; } case './direct-relative-external': case '../direct-relative-external': { return false; } case './indirect-relative-external': case '../indirect-relative-external': { return { id: 'to-indirect-relative-external', external: true }; } case 'direct-absolute-external': { return false; } case 'indirect-absolute-external': { return { id: 'to-indirect-absolute-external', external: true }; } default: { throw new Error(`Unexpected import ${specifier}`); } } } switch (specifier.left.value) { case 'dynamic-direct-external': { return false; } case 'dynamic-indirect-external': { return { id: 'to-dynamic-indirect-external', external: true }; } case 'dynamic-indirect-existing': { return { id: EXISTING, external: false }; } case 'dynamic-replaced': { return `'my' + 'replacement'`; } default: { throw new Error(`Unexpected import ${specifier.left.value}`); } } } } } }); rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_expected/000077500000000000000000000000001450520414700266735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_expected/amd/000077500000000000000000000000001450520414700274345ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_expected/amd/main.js000066400000000000000000000054351450520414700307250ustar00rootroot00000000000000define(['require', './direct-relative-external', 'to-indirect-relative-external', 'direct-absolute-external', 'to-indirect-absolute-external'], (function (require, directRelativeExternal, toIndirectRelativeExternal, directAbsoluteExternal, toIndirectAbsoluteExternal) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } // nested Promise.resolve().then(function () { return existing; }); new Promise(function (resolve, reject) { require(['./direct-relative-external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); new Promise(function (resolve, reject) { require(['to-indirect-relative-external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); new Promise(function (resolve, reject) { require(['direct-absolute-external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); new Promise(function (resolve, reject) { require(['to-indirect-absolute-external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); console.log('existing'); var existing = /*#__PURE__*/Object.freeze({ __proto__: null }); //main Promise.resolve().then(function () { return existing; }); new Promise(function (resolve, reject) { require(['./direct-relative-external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); new Promise(function (resolve, reject) { require(['to-indirect-relative-external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); new Promise(function (resolve, reject) { require(['direct-absolute-external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); new Promise(function (resolve, reject) { require(['to-indirect-absolute-external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })('dynamic-direct-external' + unknown); new Promise(function (resolve, reject) { require(['to-dynamic-indirect-external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); Promise.resolve().then(function () { return existing; }); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })('my' + 'replacement'); })); rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_expected/cjs/000077500000000000000000000000001450520414700274525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_expected/cjs/main.js000066400000000000000000000015701450520414700307370ustar00rootroot00000000000000'use strict'; require('./direct-relative-external'); require('to-indirect-relative-external'); require('direct-absolute-external'); require('to-indirect-absolute-external'); // nested Promise.resolve().then(function () { return existing; }); import('./direct-relative-external'); import('to-indirect-relative-external'); import('direct-absolute-external'); import('to-indirect-absolute-external'); console.log('existing'); var existing = /*#__PURE__*/Object.freeze({ __proto__: null }); //main Promise.resolve().then(function () { return existing; }); import('./direct-relative-external'); import('to-indirect-relative-external'); import('direct-absolute-external'); import('to-indirect-absolute-external'); import('dynamic-direct-external' + unknown); import('to-dynamic-indirect-external'); Promise.resolve().then(function () { return existing; }); import('my' + 'replacement'); rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_expected/es/000077500000000000000000000000001450520414700273025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_expected/es/main.js000066400000000000000000000015411450520414700305650ustar00rootroot00000000000000import './direct-relative-external'; import 'to-indirect-relative-external'; import 'direct-absolute-external'; import 'to-indirect-absolute-external'; // nested Promise.resolve().then(function () { return existing; }); import('./direct-relative-external'); import('to-indirect-relative-external'); import('direct-absolute-external'); import('to-indirect-absolute-external'); console.log('existing'); var existing = /*#__PURE__*/Object.freeze({ __proto__: null }); //main Promise.resolve().then(function () { return existing; }); import('./direct-relative-external'); import('to-indirect-relative-external'); import('direct-absolute-external'); import('to-indirect-absolute-external'); import('dynamic-direct-external' + unknown); import('to-dynamic-indirect-external'); Promise.resolve().then(function () { return existing; }); import('my' + 'replacement'); rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_expected/system/000077500000000000000000000000001450520414700302175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/_expected/system/main.js000066400000000000000000000021451450520414700315030ustar00rootroot00000000000000System.register(['./direct-relative-external', 'to-indirect-relative-external', 'direct-absolute-external', 'to-indirect-absolute-external'], (function (exports, module) { 'use strict'; return { setters: [null, null, null, null], execute: (function () { // nested Promise.resolve().then(function () { return existing; }); module.import('./direct-relative-external'); module.import('to-indirect-relative-external'); module.import('direct-absolute-external'); module.import('to-indirect-absolute-external'); console.log('existing'); var existing = /*#__PURE__*/Object.freeze({ __proto__: null }); //main Promise.resolve().then(function () { return existing; }); module.import('./direct-relative-external'); module.import('to-indirect-relative-external'); module.import('direct-absolute-external'); module.import('to-indirect-absolute-external'); module.import('dynamic-direct-external' + unknown); module.import('to-dynamic-indirect-external'); Promise.resolve().then(function () { return existing; }); module.import('my' + 'replacement'); }) }; })); rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/existing.js000066400000000000000000000000721450520414700271220ustar00rootroot00000000000000export const value = 'existing'; console.log('existing'); rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/main.js000066400000000000000000000010651450520414700262170ustar00rootroot00000000000000import './nested/nested.js'; import 'existing-name'; import './direct-relative-external'; import './indirect-relative-external'; import 'direct-absolute-external'; import 'indirect-absolute-external'; //main import(`existing-name`); import('./direct-relative-external'); import('./indirect-relative-external'); import('direct-absolute-external'); import('indirect-absolute-external'); import('dynamic-direct-external' + unknown); import('dynamic-indirect-external' + unknown); import('dynamic-indirect-existing' + unknown); import('dynamic-replaced' + unknown); rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/nested/000077500000000000000000000000001450520414700262155ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-dynamic-import/nested/nested.js000066400000000000000000000002751450520414700300410ustar00rootroot00000000000000// nested import('existing-name'); import('../direct-relative-external'); import('../indirect-relative-external'); import('direct-absolute-external'); import('indirect-absolute-external'); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/000077500000000000000000000000001450520414700235165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_config.js000066400000000000000000000023501450520414700254600ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to configure file urls', options: { output: { chunkFileNames: 'nested/chunk.js' }, plugins: [ { resolveId(id) { if (id.endsWith('solved')) { return id; } }, load(id) { if (id.endsWith('solved')) { const assetId = this.emitFile({ type: 'asset', name: `asset-${id}.txt`, source: `Asset for: ${id}` }); const chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); return ( `export const asset = import.meta.ROLLUP_FILE_URL_${assetId};\n` + `export const chunk = import.meta.ROLLUP_FILE_URL_${chunkId};` ); } }, resolveFileUrl({ chunkId, fileName, format, moduleId, referenceId, relativePath }) { if (!moduleId.endsWith('resolved')) { return `'chunkId=${chunkId}:moduleId=${moduleId .replace(/\\/g, '/') .split('/') .slice(-2) .join( '/' )}:fileName=${fileName}:format=${format}:relativePath=${relativePath}:referenceId=${referenceId}'`; } return null; } }, { resolveFileUrl({ moduleId }) { if (moduleId === 'resolved') { return `'resolved'`; } return null; } } ] } }); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/000077500000000000000000000000001450520414700254565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/amd/000077500000000000000000000000001450520414700262175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/amd/assets/000077500000000000000000000000001450520414700275215ustar00rootroot00000000000000asset-resolved-9e0f7ca5.txt000066400000000000000000000000231450520414700343570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/amd/assetsAsset for: resolvedasset-solved-230ecafd.txt000066400000000000000000000000211450520414700340720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/amd/assetsAsset for: solvedasset-unresolved-f4c1e86c.txt000066400000000000000000000000251450520414700347240ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/amd/assetsAsset for: unresolvedrollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/amd/main.js000066400000000000000000000007271450520414700275070ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; const asset$1 = 'resolved'; const chunk$1 = 'resolved'; const asset = new URL(require.toUrl('./assets/asset-unresolved-f4c1e86c.txt'), document.baseURI).href; const chunk = new URL(require.toUrl('./nested/chunk2.js'), document.baseURI).href; new Promise(function (resolve, reject) { require(['./nested/chunk'], resolve, reject); }).then(result => console.log(result, chunk$1, chunk, asset$1, asset)); })); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/000077500000000000000000000000001450520414700275015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/chunk.js000066400000000000000000000007041450520414700311500ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const asset = 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=amd:relativePath=../assets/asset-solved-230ecafd.txt:referenceId=6296c678'; const chunk = 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=amd:relativePath=chunk2.js:referenceId=f6c25ae7'; exports.asset = asset; exports.chunk = chunk; })); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/chunk2.js000066400000000000000000000001021450520414700312220ustar00rootroot00000000000000define((function () { 'use strict'; console.log('chunk'); })); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/cjs/000077500000000000000000000000001450520414700262355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/000077500000000000000000000000001450520414700275375ustar00rootroot00000000000000asset-resolved-9e0f7ca5.txt000066400000000000000000000000231450520414700343750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/cjs/assetsAsset for: resolvedasset-solved-230ecafd.txt000066400000000000000000000000211450520414700341100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/cjs/assetsAsset for: solvedasset-unresolved-f4c1e86c.txt000066400000000000000000000000251450520414700347420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/cjs/assetsAsset for: unresolvedrollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/cjs/main.js000066400000000000000000000013231450520414700275160ustar00rootroot00000000000000'use strict'; const asset$1 = 'resolved'; const chunk$1 = 'resolved'; const asset = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-unresolved-f4c1e86c.txt').href : new URL('assets/asset-unresolved-f4c1e86c.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const chunk = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/nested/chunk2.js').href : new URL('nested/chunk2.js', document.currentScript && document.currentScript.src || document.baseURI).href); Promise.resolve().then(function () { return require('./nested/chunk.js'); }).then(result => console.log(result, chunk$1, chunk, asset$1, asset)); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/000077500000000000000000000000001450520414700275175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/chunk.js000066400000000000000000000005741450520414700311730ustar00rootroot00000000000000'use strict'; const asset = 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=cjs:relativePath=../assets/asset-solved-230ecafd.txt:referenceId=6296c678'; const chunk = 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=cjs:relativePath=chunk2.js:referenceId=f6c25ae7'; exports.asset = asset; exports.chunk = chunk; rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/chunk2.js000066400000000000000000000000451450520414700312460ustar00rootroot00000000000000'use strict'; console.log('chunk'); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/es/000077500000000000000000000000001450520414700260655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/es/assets/000077500000000000000000000000001450520414700273675ustar00rootroot00000000000000asset-resolved-9e0f7ca5.txt000066400000000000000000000000231450520414700342250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/es/assetsAsset for: resolvedasset-solved-230ecafd.txt000066400000000000000000000000211450520414700337400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/es/assetsAsset for: solvedasset-unresolved-f4c1e86c.txt000066400000000000000000000000251450520414700345720ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/es/assetsAsset for: unresolvedrollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/es/main.js000066400000000000000000000004611450520414700273500ustar00rootroot00000000000000const asset$1 = 'resolved'; const chunk$1 = 'resolved'; const asset = new URL('assets/asset-unresolved-f4c1e86c.txt', import.meta.url).href; const chunk = new URL('nested/chunk2.js', import.meta.url).href; import('./nested/chunk.js').then(result => console.log(result, chunk$1, chunk, asset$1, asset)); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/es/nested/000077500000000000000000000000001450520414700273475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/es/nested/chunk.js000066400000000000000000000005261450520414700310200ustar00rootroot00000000000000const asset = 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=es:relativePath=../assets/asset-solved-230ecafd.txt:referenceId=6296c678'; const chunk = 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=es:relativePath=chunk2.js:referenceId=f6c25ae7'; export { asset, chunk }; rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/es/nested/chunk2.js000066400000000000000000000000261450520414700310750ustar00rootroot00000000000000console.log('chunk'); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/system/000077500000000000000000000000001450520414700270025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/system/assets/000077500000000000000000000000001450520414700303045ustar00rootroot00000000000000asset-resolved-9e0f7ca5.txt000066400000000000000000000000231450520414700351420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/system/assetsAsset for: resolvedasset-solved-230ecafd.txt000066400000000000000000000000211450520414700346550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/system/assetsAsset for: solvedasset-unresolved-f4c1e86c.txt000066400000000000000000000000251450520414700355070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/system/assetsAsset for: unresolvedrollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/system/main.js000066400000000000000000000006741450520414700302730ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const asset$1 = 'resolved'; const chunk$1 = 'resolved'; const asset = new URL('assets/asset-unresolved-f4c1e86c.txt', module.meta.url).href; const chunk = new URL('nested/chunk2.js', module.meta.url).href; module.import('./nested/chunk.js').then(result => console.log(result, chunk$1, chunk, asset$1, asset)); }) }; })); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/system/nested/000077500000000000000000000000001450520414700302645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/system/nested/chunk.js000066400000000000000000000007431450520414700317360ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const asset = exports('asset', 'chunkId=nested/chunk.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=system:relativePath=../assets/asset-solved-230ecafd.txt:referenceId=6296c678'); const chunk = exports('chunk', 'chunkId=nested/chunk.js:moduleId=solved:fileName=nested/chunk2.js:format=system:relativePath=chunk2.js:referenceId=f6c25ae7'); }) }; })); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/_expected/system/nested/chunk2.js000066400000000000000000000001771450520414700320210ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('chunk'); }) }; })); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/chunk.js000066400000000000000000000000261450520414700251620ustar00rootroot00000000000000console.log('chunk'); rollup-3.29.4/test/chunking-form/samples/resolve-file-url/main.js000066400000000000000000000003241450520414700247770ustar00rootroot00000000000000import { asset as asset1, chunk as chunk1 } from 'resolved'; import { asset as asset2, chunk as chunk2 } from 'unresolved'; import('solved').then(result => console.log(result, chunk1, chunk2, asset1, asset2)); rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/000077500000000000000000000000001450520414700243575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_config.js000066400000000000000000000006431450520414700263240ustar00rootroot00000000000000module.exports = defineTest({ description: 'sanitizes chunk names from virtual entry points', options: { input: ['main1'], plugins: [ { options(options) { options.input = ['\0virtual:entry-1', '\0virtual:entry-2', 'another-[slug]-#result']; return options; }, resolveId(id) { return id; }, load(id) { return 'export default ' + JSON.stringify(id); } } ] } }); rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/000077500000000000000000000000001450520414700263175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/amd/000077500000000000000000000000001450520414700270605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/amd/_virtual_entry-1.js000066400000000000000000000001651450520414700326240ustar00rootroot00000000000000define((function () { 'use strict'; var _virtual_entry1 = "\u0000virtual:entry-1"; return _virtual_entry1; })); rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/amd/_virtual_entry-2.js000066400000000000000000000001651450520414700326250ustar00rootroot00000000000000define((function () { 'use strict'; var _virtual_entry2 = "\u0000virtual:entry-2"; return _virtual_entry2; })); another-_slug_-_result.js000066400000000000000000000002041450520414700337140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/amddefine((function () { 'use strict'; var another__slug___result = "another-[slug]-#result"; return another__slug___result; })); rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/000077500000000000000000000000001450520414700270765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/_virtual_entry-1.js000066400000000000000000000001411450520414700326340ustar00rootroot00000000000000'use strict'; var _virtual_entry1 = "\u0000virtual:entry-1"; module.exports = _virtual_entry1; rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/_virtual_entry-2.js000066400000000000000000000001411450520414700326350ustar00rootroot00000000000000'use strict'; var _virtual_entry2 = "\u0000virtual:entry-2"; module.exports = _virtual_entry2; another-_slug_-_result.js000066400000000000000000000001601450520414700337330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/cjs'use strict'; var another__slug___result = "another-[slug]-#result"; module.exports = another__slug___result; rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/es/000077500000000000000000000000001450520414700267265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/es/_virtual_entry-1.js000066400000000000000000000001271450520414700324700ustar00rootroot00000000000000var _virtual_entry1 = "\u0000virtual:entry-1"; export { _virtual_entry1 as default }; rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/es/_virtual_entry-2.js000066400000000000000000000001271450520414700324710ustar00rootroot00000000000000var _virtual_entry2 = "\u0000virtual:entry-2"; export { _virtual_entry2 as default }; rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/es/another-_slug_-_result.js000066400000000000000000000001461450520414700336460ustar00rootroot00000000000000var another__slug___result = "another-[slug]-#result"; export { another__slug___result as default }; rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/system/000077500000000000000000000000001450520414700276435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/system/_virtual_entry-1.js000066400000000000000000000002631450520414700334060ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var _virtual_entry1 = exports('default', "\u0000virtual:entry-1"); }) }; })); rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/system/_virtual_entry-2.js000066400000000000000000000002631450520414700334070ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var _virtual_entry2 = exports('default', "\u0000virtual:entry-2"); }) }; })); another-_slug_-_result.js000066400000000000000000000002731450520414700345050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var another__slug___result = exports('default', "another-[slug]-#result"); }) }; })); rollup-3.29.4/test/chunking-form/samples/sanitize-chunk-names/main1.js000066400000000000000000000000261450520414700257200ustar00rootroot00000000000000console.log('main1'); rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/000077500000000000000000000000001450520414700254645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_config.js000066400000000000000000000002001450520414700274160ustar00rootroot00000000000000module.exports = defineTest({ description: 'make sure internal exports are sanitized', options: { input: ['main.js'] } }); rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/000077500000000000000000000000001450520414700274245ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/amd/000077500000000000000000000000001450520414700301655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/amd/generated-lazy.js000066400000000000000000000002041450520414700334320ustar00rootroot00000000000000define(['exports', './main'], (function (exports, main) { 'use strict'; var lazy = () => main.v1; exports.default = lazy; })); rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/amd/main.js000066400000000000000000000175651450520414700314650ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; var v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v270, v271, v272; const lazy = new Promise(function (resolve, reject) { require(['./generated-lazy'], resolve, reject); }); exports.lazy = lazy; exports.v1 = v1; exports.v10 = v10; exports.v100 = v100; exports.v101 = v101; exports.v102 = v102; exports.v103 = v103; exports.v104 = v104; exports.v105 = v105; exports.v106 = v106; exports.v107 = v107; exports.v108 = v108; exports.v109 = v109; exports.v11 = v11; exports.v110 = v110; exports.v111 = v111; exports.v112 = v112; exports.v113 = v113; exports.v114 = v114; exports.v115 = v115; exports.v116 = v116; exports.v117 = v117; exports.v118 = v118; exports.v119 = v119; exports.v12 = v12; exports.v120 = v120; exports.v121 = v121; exports.v122 = v122; exports.v123 = v123; exports.v124 = v124; exports.v125 = v125; exports.v126 = v126; exports.v127 = v127; exports.v128 = v128; exports.v129 = v129; exports.v13 = v13; exports.v130 = v130; exports.v131 = v131; exports.v132 = v132; exports.v133 = v133; exports.v134 = v134; exports.v135 = v135; exports.v136 = v136; exports.v137 = v137; exports.v138 = v138; exports.v139 = v139; exports.v14 = v14; exports.v140 = v140; exports.v141 = v141; exports.v142 = v142; exports.v143 = v143; exports.v144 = v144; exports.v145 = v145; exports.v146 = v146; exports.v147 = v147; exports.v148 = v148; exports.v149 = v149; exports.v15 = v15; exports.v150 = v150; exports.v151 = v151; exports.v152 = v152; exports.v153 = v153; exports.v154 = v154; exports.v155 = v155; exports.v156 = v156; exports.v157 = v157; exports.v158 = v158; exports.v159 = v159; exports.v16 = v16; exports.v160 = v160; exports.v161 = v161; exports.v162 = v162; exports.v163 = v163; exports.v164 = v164; exports.v165 = v165; exports.v166 = v166; exports.v167 = v167; exports.v168 = v168; exports.v169 = v169; exports.v17 = v17; exports.v170 = v170; exports.v171 = v171; exports.v172 = v172; exports.v173 = v173; exports.v174 = v174; exports.v175 = v175; exports.v176 = v176; exports.v177 = v177; exports.v178 = v178; exports.v179 = v179; exports.v18 = v18; exports.v180 = v180; exports.v181 = v181; exports.v182 = v182; exports.v183 = v183; exports.v184 = v184; exports.v185 = v185; exports.v186 = v186; exports.v187 = v187; exports.v188 = v188; exports.v189 = v189; exports.v19 = v19; exports.v190 = v190; exports.v191 = v191; exports.v192 = v192; exports.v193 = v193; exports.v194 = v194; exports.v195 = v195; exports.v196 = v196; exports.v197 = v197; exports.v198 = v198; exports.v199 = v199; exports.v2 = v2; exports.v20 = v20; exports.v200 = v200; exports.v201 = v201; exports.v202 = v202; exports.v203 = v203; exports.v204 = v204; exports.v205 = v205; exports.v206 = v206; exports.v207 = v207; exports.v208 = v208; exports.v209 = v209; exports.v21 = v21; exports.v210 = v210; exports.v211 = v211; exports.v212 = v212; exports.v213 = v213; exports.v214 = v214; exports.v215 = v215; exports.v216 = v216; exports.v217 = v217; exports.v218 = v218; exports.v219 = v219; exports.v22 = v22; exports.v220 = v220; exports.v221 = v221; exports.v222 = v222; exports.v223 = v223; exports.v224 = v224; exports.v225 = v225; exports.v226 = v226; exports.v227 = v227; exports.v228 = v228; exports.v229 = v229; exports.v23 = v23; exports.v230 = v230; exports.v231 = v231; exports.v232 = v232; exports.v233 = v233; exports.v234 = v234; exports.v235 = v235; exports.v236 = v236; exports.v237 = v237; exports.v238 = v238; exports.v239 = v239; exports.v24 = v24; exports.v240 = v240; exports.v241 = v241; exports.v242 = v242; exports.v243 = v243; exports.v244 = v244; exports.v245 = v245; exports.v246 = v246; exports.v247 = v247; exports.v248 = v248; exports.v249 = v249; exports.v25 = v25; exports.v250 = v250; exports.v251 = v251; exports.v252 = v252; exports.v253 = v253; exports.v254 = v254; exports.v255 = v255; exports.v256 = v256; exports.v257 = v257; exports.v258 = v258; exports.v259 = v259; exports.v26 = v26; exports.v260 = v260; exports.v261 = v261; exports.v262 = v262; exports.v263 = v263; exports.v264 = v264; exports.v265 = v265; exports.v266 = v266; exports.v267 = v267; exports.v268 = v268; exports.v269 = v269; exports.v27 = v27; exports.v270 = v270; exports.v271 = v271; exports.v272 = v272; exports.v28 = v28; exports.v29 = v29; exports.v3 = v3; exports.v30 = v30; exports.v31 = v31; exports.v32 = v32; exports.v33 = v33; exports.v34 = v34; exports.v35 = v35; exports.v36 = v36; exports.v37 = v37; exports.v38 = v38; exports.v39 = v39; exports.v4 = v4; exports.v40 = v40; exports.v41 = v41; exports.v42 = v42; exports.v43 = v43; exports.v44 = v44; exports.v45 = v45; exports.v46 = v46; exports.v47 = v47; exports.v48 = v48; exports.v49 = v49; exports.v5 = v5; exports.v50 = v50; exports.v51 = v51; exports.v52 = v52; exports.v53 = v53; exports.v54 = v54; exports.v55 = v55; exports.v56 = v56; exports.v57 = v57; exports.v58 = v58; exports.v59 = v59; exports.v6 = v6; exports.v60 = v60; exports.v61 = v61; exports.v62 = v62; exports.v63 = v63; exports.v64 = v64; exports.v65 = v65; exports.v66 = v66; exports.v67 = v67; exports.v68 = v68; exports.v69 = v69; exports.v7 = v7; exports.v70 = v70; exports.v71 = v71; exports.v72 = v72; exports.v73 = v73; exports.v74 = v74; exports.v75 = v75; exports.v76 = v76; exports.v77 = v77; exports.v78 = v78; exports.v79 = v79; exports.v8 = v8; exports.v80 = v80; exports.v81 = v81; exports.v82 = v82; exports.v83 = v83; exports.v84 = v84; exports.v85 = v85; exports.v86 = v86; exports.v87 = v87; exports.v88 = v88; exports.v89 = v89; exports.v9 = v9; exports.v90 = v90; exports.v91 = v91; exports.v92 = v92; exports.v93 = v93; exports.v94 = v94; exports.v95 = v95; exports.v96 = v96; exports.v97 = v97; exports.v98 = v98; exports.v99 = v99; })); rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/cjs/000077500000000000000000000000001450520414700302035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/cjs/generated-lazy.js000066400000000000000000000001441450520414700334530ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); var lazy = () => main.v1; exports.default = lazy; rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/cjs/main.js000066400000000000000000000164021450520414700314700ustar00rootroot00000000000000'use strict'; var v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v270, v271, v272; const lazy = Promise.resolve().then(function () { return require('./generated-lazy.js'); }); exports.lazy = lazy; exports.v1 = v1; exports.v10 = v10; exports.v100 = v100; exports.v101 = v101; exports.v102 = v102; exports.v103 = v103; exports.v104 = v104; exports.v105 = v105; exports.v106 = v106; exports.v107 = v107; exports.v108 = v108; exports.v109 = v109; exports.v11 = v11; exports.v110 = v110; exports.v111 = v111; exports.v112 = v112; exports.v113 = v113; exports.v114 = v114; exports.v115 = v115; exports.v116 = v116; exports.v117 = v117; exports.v118 = v118; exports.v119 = v119; exports.v12 = v12; exports.v120 = v120; exports.v121 = v121; exports.v122 = v122; exports.v123 = v123; exports.v124 = v124; exports.v125 = v125; exports.v126 = v126; exports.v127 = v127; exports.v128 = v128; exports.v129 = v129; exports.v13 = v13; exports.v130 = v130; exports.v131 = v131; exports.v132 = v132; exports.v133 = v133; exports.v134 = v134; exports.v135 = v135; exports.v136 = v136; exports.v137 = v137; exports.v138 = v138; exports.v139 = v139; exports.v14 = v14; exports.v140 = v140; exports.v141 = v141; exports.v142 = v142; exports.v143 = v143; exports.v144 = v144; exports.v145 = v145; exports.v146 = v146; exports.v147 = v147; exports.v148 = v148; exports.v149 = v149; exports.v15 = v15; exports.v150 = v150; exports.v151 = v151; exports.v152 = v152; exports.v153 = v153; exports.v154 = v154; exports.v155 = v155; exports.v156 = v156; exports.v157 = v157; exports.v158 = v158; exports.v159 = v159; exports.v16 = v16; exports.v160 = v160; exports.v161 = v161; exports.v162 = v162; exports.v163 = v163; exports.v164 = v164; exports.v165 = v165; exports.v166 = v166; exports.v167 = v167; exports.v168 = v168; exports.v169 = v169; exports.v17 = v17; exports.v170 = v170; exports.v171 = v171; exports.v172 = v172; exports.v173 = v173; exports.v174 = v174; exports.v175 = v175; exports.v176 = v176; exports.v177 = v177; exports.v178 = v178; exports.v179 = v179; exports.v18 = v18; exports.v180 = v180; exports.v181 = v181; exports.v182 = v182; exports.v183 = v183; exports.v184 = v184; exports.v185 = v185; exports.v186 = v186; exports.v187 = v187; exports.v188 = v188; exports.v189 = v189; exports.v19 = v19; exports.v190 = v190; exports.v191 = v191; exports.v192 = v192; exports.v193 = v193; exports.v194 = v194; exports.v195 = v195; exports.v196 = v196; exports.v197 = v197; exports.v198 = v198; exports.v199 = v199; exports.v2 = v2; exports.v20 = v20; exports.v200 = v200; exports.v201 = v201; exports.v202 = v202; exports.v203 = v203; exports.v204 = v204; exports.v205 = v205; exports.v206 = v206; exports.v207 = v207; exports.v208 = v208; exports.v209 = v209; exports.v21 = v21; exports.v210 = v210; exports.v211 = v211; exports.v212 = v212; exports.v213 = v213; exports.v214 = v214; exports.v215 = v215; exports.v216 = v216; exports.v217 = v217; exports.v218 = v218; exports.v219 = v219; exports.v22 = v22; exports.v220 = v220; exports.v221 = v221; exports.v222 = v222; exports.v223 = v223; exports.v224 = v224; exports.v225 = v225; exports.v226 = v226; exports.v227 = v227; exports.v228 = v228; exports.v229 = v229; exports.v23 = v23; exports.v230 = v230; exports.v231 = v231; exports.v232 = v232; exports.v233 = v233; exports.v234 = v234; exports.v235 = v235; exports.v236 = v236; exports.v237 = v237; exports.v238 = v238; exports.v239 = v239; exports.v24 = v24; exports.v240 = v240; exports.v241 = v241; exports.v242 = v242; exports.v243 = v243; exports.v244 = v244; exports.v245 = v245; exports.v246 = v246; exports.v247 = v247; exports.v248 = v248; exports.v249 = v249; exports.v25 = v25; exports.v250 = v250; exports.v251 = v251; exports.v252 = v252; exports.v253 = v253; exports.v254 = v254; exports.v255 = v255; exports.v256 = v256; exports.v257 = v257; exports.v258 = v258; exports.v259 = v259; exports.v26 = v26; exports.v260 = v260; exports.v261 = v261; exports.v262 = v262; exports.v263 = v263; exports.v264 = v264; exports.v265 = v265; exports.v266 = v266; exports.v267 = v267; exports.v268 = v268; exports.v269 = v269; exports.v27 = v27; exports.v270 = v270; exports.v271 = v271; exports.v272 = v272; exports.v28 = v28; exports.v29 = v29; exports.v3 = v3; exports.v30 = v30; exports.v31 = v31; exports.v32 = v32; exports.v33 = v33; exports.v34 = v34; exports.v35 = v35; exports.v36 = v36; exports.v37 = v37; exports.v38 = v38; exports.v39 = v39; exports.v4 = v4; exports.v40 = v40; exports.v41 = v41; exports.v42 = v42; exports.v43 = v43; exports.v44 = v44; exports.v45 = v45; exports.v46 = v46; exports.v47 = v47; exports.v48 = v48; exports.v49 = v49; exports.v5 = v5; exports.v50 = v50; exports.v51 = v51; exports.v52 = v52; exports.v53 = v53; exports.v54 = v54; exports.v55 = v55; exports.v56 = v56; exports.v57 = v57; exports.v58 = v58; exports.v59 = v59; exports.v6 = v6; exports.v60 = v60; exports.v61 = v61; exports.v62 = v62; exports.v63 = v63; exports.v64 = v64; exports.v65 = v65; exports.v66 = v66; exports.v67 = v67; exports.v68 = v68; exports.v69 = v69; exports.v7 = v7; exports.v70 = v70; exports.v71 = v71; exports.v72 = v72; exports.v73 = v73; exports.v74 = v74; exports.v75 = v75; exports.v76 = v76; exports.v77 = v77; exports.v78 = v78; exports.v79 = v79; exports.v8 = v8; exports.v80 = v80; exports.v81 = v81; exports.v82 = v82; exports.v83 = v83; exports.v84 = v84; exports.v85 = v85; exports.v86 = v86; exports.v87 = v87; exports.v88 = v88; exports.v89 = v89; exports.v9 = v9; exports.v90 = v90; exports.v91 = v91; exports.v92 = v92; exports.v93 = v93; exports.v94 = v94; exports.v95 = v95; exports.v96 = v96; exports.v97 = v97; exports.v98 = v98; exports.v99 = v99; rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/es/000077500000000000000000000000001450520414700300335ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/es/generated-lazy.js000066400000000000000000000001231450520414700333000ustar00rootroot00000000000000import { v1 } from './main.js'; var lazy = () => v1; export { lazy as default }; rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/es/main.js000066400000000000000000000064721450520414700313260ustar00rootroot00000000000000var v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v270, v271, v272; const lazy = import('./generated-lazy.js'); export { lazy, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 }; rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/system/000077500000000000000000000000001450520414700307505ustar00rootroot00000000000000generated-lazy.js000066400000000000000000000003461450520414700341450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var v1; return { setters: [function (module) { v1 = module.v1; }], execute: (function () { var lazy = exports('default', () => v1); }) }; })); rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/_expected/system/main.js000066400000000000000000000133511450520414700322350ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v270, v271, v272; exports({ v1: v1, v2: v2, v3: v3, v4: v4, v5: v5, v6: v6, v7: v7, v8: v8, v9: v9, v10: v10, v11: v11, v12: v12, v13: v13, v14: v14, v15: v15, v16: v16, v17: v17, v18: v18, v19: v19, v20: v20, v21: v21, v22: v22, v23: v23, v24: v24, v25: v25, v26: v26, v27: v27, v28: v28, v29: v29, v30: v30, v31: v31, v32: v32, v33: v33, v34: v34, v35: v35, v36: v36, v37: v37, v38: v38, v39: v39, v40: v40, v41: v41, v42: v42, v43: v43, v44: v44, v45: v45, v46: v46, v47: v47, v48: v48, v49: v49, v50: v50, v51: v51, v52: v52, v53: v53, v54: v54, v55: v55, v56: v56, v57: v57, v58: v58, v59: v59, v60: v60, v61: v61, v62: v62, v63: v63, v64: v64, v65: v65, v66: v66, v67: v67, v68: v68, v69: v69, v70: v70, v71: v71, v72: v72, v73: v73, v74: v74, v75: v75, v76: v76, v77: v77, v78: v78, v79: v79, v80: v80, v81: v81, v82: v82, v83: v83, v84: v84, v85: v85, v86: v86, v87: v87, v88: v88, v89: v89, v90: v90, v91: v91, v92: v92, v93: v93, v94: v94, v95: v95, v96: v96, v97: v97, v98: v98, v99: v99, v100: v100, v101: v101, v102: v102, v103: v103, v104: v104, v105: v105, v106: v106, v107: v107, v108: v108, v109: v109, v110: v110, v111: v111, v112: v112, v113: v113, v114: v114, v115: v115, v116: v116, v117: v117, v118: v118, v119: v119, v120: v120, v121: v121, v122: v122, v123: v123, v124: v124, v125: v125, v126: v126, v127: v127, v128: v128, v129: v129, v130: v130, v131: v131, v132: v132, v133: v133, v134: v134, v135: v135, v136: v136, v137: v137, v138: v138, v139: v139, v140: v140, v141: v141, v142: v142, v143: v143, v144: v144, v145: v145, v146: v146, v147: v147, v148: v148, v149: v149, v150: v150, v151: v151, v152: v152, v153: v153, v154: v154, v155: v155, v156: v156, v157: v157, v158: v158, v159: v159, v160: v160, v161: v161, v162: v162, v163: v163, v164: v164, v165: v165, v166: v166, v167: v167, v168: v168, v169: v169, v170: v170, v171: v171, v172: v172, v173: v173, v174: v174, v175: v175, v176: v176, v177: v177, v178: v178, v179: v179, v180: v180, v181: v181, v182: v182, v183: v183, v184: v184, v185: v185, v186: v186, v187: v187, v188: v188, v189: v189, v190: v190, v191: v191, v192: v192, v193: v193, v194: v194, v195: v195, v196: v196, v197: v197, v198: v198, v199: v199, v200: v200, v201: v201, v202: v202, v203: v203, v204: v204, v205: v205, v206: v206, v207: v207, v208: v208, v209: v209, v210: v210, v211: v211, v212: v212, v213: v213, v214: v214, v215: v215, v216: v216, v217: v217, v218: v218, v219: v219, v220: v220, v221: v221, v222: v222, v223: v223, v224: v224, v225: v225, v226: v226, v227: v227, v228: v228, v229: v229, v230: v230, v231: v231, v232: v232, v233: v233, v234: v234, v235: v235, v236: v236, v237: v237, v238: v238, v239: v239, v240: v240, v241: v241, v242: v242, v243: v243, v244: v244, v245: v245, v246: v246, v247: v247, v248: v248, v249: v249, v250: v250, v251: v251, v252: v252, v253: v253, v254: v254, v255: v255, v256: v256, v257: v257, v258: v258, v259: v259, v260: v260, v261: v261, v262: v262, v263: v263, v264: v264, v265: v265, v266: v266, v267: v267, v268: v268, v269: v269, v270: v270, v271: v271, v272: v272 }); const lazy = exports('lazy', module.import('./generated-lazy.js')); }) }; })); rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/constants.js000066400000000000000000000034161450520414700300420ustar00rootroot00000000000000export var v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v270, v271, v272; rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/lazy.js000066400000000000000000000000731450520414700270010ustar00rootroot00000000000000import { v1 } from './constants'; export default () => v1; rollup-3.29.4/test/chunking-form/samples/sanitize-internal-exports/main.js000066400000000000000000000001031450520414700267400ustar00rootroot00000000000000export * from './constants'; export const lazy = import('./lazy'); rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/000077500000000000000000000000001450520414700260435ustar00rootroot00000000000000avoid-imports-preserve-modules/000077500000000000000000000000001450520414700340605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002761450520414700360270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesmodule.exports = defineTest({ description: 'avoids empty imports if they do not have side-effects when preserving modules (#3359)', options: { output: { preserveModules: true } } }); _expected/000077500000000000000000000000001450520414700360205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesamd/000077500000000000000000000000001450520414700365615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expecteda.js000066400000000000000000000001361450520414700373370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const a = 1; exports.a = a; })); b.js000066400000000000000000000001361450520414700373400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const b = 2; exports.b = b; })); main.js000066400000000000000000000001361450520414700400430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/amddefine(['./a', './one'], (function (a, one) { 'use strict'; console.log(a.a + one.d); })); one.js000066400000000000000000000001561450520414700377020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/amddefine(['exports', './b'], (function (exports, b) { 'use strict'; const d = b.b + 4; exports.d = d; })); cjs/000077500000000000000000000000001450520414700365775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expecteda.js000066400000000000000000000000541450520414700373540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/cjs'use strict'; const a = 1; exports.a = a; b.js000066400000000000000000000000541450520414700373550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/cjs'use strict'; const b = 2; exports.b = b; main.js000066400000000000000000000001441450520414700400600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/cjs'use strict'; var a = require('./a.js'); var one = require('./one.js'); console.log(a.a + one.d); one.js000066400000000000000000000001161450520414700377140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/cjs'use strict'; var b = require('./b.js'); const d = b.b + 4; exports.d = d; es/000077500000000000000000000000001450520414700364275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expecteda.js000066400000000000000000000000341450520414700372020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/esconst a = 1; export { a }; b.js000066400000000000000000000000341450520414700372030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/esconst b = 2; export { b }; main.js000066400000000000000000000001171450520414700377100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/esimport { a } from './a.js'; import { d } from './one.js'; console.log(a + d); one.js000066400000000000000000000000751450520414700375500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/esimport { b } from './b.js'; const d = b + 4; export { d }; system/000077500000000000000000000000001450520414700373445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expecteda.js000066400000000000000000000002131450520414700401160ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const a = exports('a', 1); }) }; })); b.js000066400000000000000000000002131450520414700401170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const b = exports('b', 2); }) }; })); main.js000066400000000000000000000003751450520414700406330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/systemSystem.register(['./a.js', './one.js'], (function () { 'use strict'; var a, d; return { setters: [function (module) { a = module.a; }, function (module) { d = module.d; }], execute: (function () { console.log(a + d); }) }; })); one.js000066400000000000000000000003261450520414700404640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/systemSystem.register(['./b.js'], (function (exports) { 'use strict'; var b; return { setters: [function (module) { b = module.b; }], execute: (function () { const d = exports('d', b + 4); }) }; })); a.js000066400000000000000000000000241450520414700346320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesexport const a = 1; b.js000066400000000000000000000000241450520414700346330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesexport const b = 2; c.js000066400000000000000000000000241450520414700346340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesexport const c = 3; index.js000066400000000000000000000001131450520414700355200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesexport { a } from './a'; export { b } from './b'; export { c } from './c'; main.js000066400000000000000000000001141450520414700353360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesimport { a } from './index'; import { d } from './one'; console.log(a + d); one.js000066400000000000000000000000651450520414700352000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesimport { b } from './index'; export const d = b + 4; avoid-side-effect-free-empty-imports/000077500000000000000000000000001450520414700350105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002721450520414700367530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-importsmodule.exports = defineTest({ description: 'avoids empty imports if they do not have side-effects', options: { input: ['main1', 'main2'], external: ['external-side-effect'] } }); _expected/000077500000000000000000000000001450520414700367505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-importsamd/000077500000000000000000000000001450520414700375115ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expectedmain1.js000066400000000000000000000002411450520414700410510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expected/amddefine(['external-side-effect'], (function (externalSideEffect) { 'use strict'; function onlyUsedByOne() { console.log('Hello'); } onlyUsedByOne(); })); main2.js000066400000000000000000000001561450520414700410570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expected/amddefine(['external-side-effect'], (function (externalSideEffect) { 'use strict'; console.log('main2'); })); cjs/000077500000000000000000000000001450520414700375275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expectedmain1.js000066400000000000000000000001671450520414700410760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expected/cjs'use strict'; require('external-side-effect'); function onlyUsedByOne() { console.log('Hello'); } onlyUsedByOne(); main2.js000066400000000000000000000001071450520414700410710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expected/cjs'use strict'; require('external-side-effect'); console.log('main2'); es/000077500000000000000000000000001450520414700373575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expectedmain1.js000066400000000000000000000001461450520414700407230ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expected/esimport 'external-side-effect'; function onlyUsedByOne() { console.log('Hello'); } onlyUsedByOne(); main2.js000066400000000000000000000000661450520414700407250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expected/esimport 'external-side-effect'; console.log('main2'); system/000077500000000000000000000000001450520414700402745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expectedmain1.js000066400000000000000000000003411450520414700416350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expected/systemSystem.register(['external-side-effect'], (function () { 'use strict'; return { setters: [null], execute: (function () { function onlyUsedByOne() { console.log('Hello'); } onlyUsedByOne(); }) }; })); main2.js000066400000000000000000000002501450520414700416350ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expected/systemSystem.register(['external-side-effect'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main2'); }) }; })); dep1.js000066400000000000000000000001431450520414700361750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-importsimport 'external-side-effect'; export default function onlyUsedByOne() { console.log('Hello'); } main1.js000066400000000000000000000000441450520414700363510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-importsimport dep from './dep1.js'; dep(); main2.js000066400000000000000000000000631450520414700363530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-importsimport dep from './dep1.js'; console.log('main2'); rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/000077500000000000000000000000001450520414700330135ustar00rootroot00000000000000_config.js000066400000000000000000000003111450520414700346710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesmodule.exports = defineTest({ description: 'hoist side-effect imports when avoiding empty imports', options: { input: ['main1', 'main2', 'main3'] }, expectedWarnings: ['CIRCULAR_DEPENDENCY'] }); _expected/000077500000000000000000000000001450520414700346745ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesamd/000077500000000000000000000000001450520414700354355ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expectedgenerated-dep2-effect.js000066400000000000000000000001011450520414700420030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/amddefine((function () { 'use strict'; console.log('dep2'); })); generated-dep4-effect.js000066400000000000000000000001011450520414700420050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/amddefine((function () { 'use strict'; console.log('dep4'); })); main1.js000066400000000000000000000003461450520414700370030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/amddefine(['./generated-dep2-effect', './generated-dep4-effect'], (function (dep2Effect, dep4Effect) { 'use strict'; var value = 42; function onlyUsedByOne(value) { console.log('Hello', value); } onlyUsedByOne(value); })); main2.js000066400000000000000000000002201450520414700367730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/amddefine(['./generated-dep2-effect', './generated-dep4-effect'], (function (dep2Effect, dep4Effect) { 'use strict'; console.log('main2'); })); main3.js000066400000000000000000000001511450520414700367770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/amddefine(['./generated-dep4-effect'], (function (dep4Effect) { 'use strict'; console.log('main3'); })); cjs/000077500000000000000000000000001450520414700354535ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expectedgenerated-dep2-effect.js000066400000000000000000000000441450520414700420270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/cjs'use strict'; console.log('dep2'); generated-dep4-effect.js000066400000000000000000000000441450520414700420310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/cjs'use strict'; console.log('dep4'); main1.js000066400000000000000000000003061450520414700370150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/cjs'use strict'; require('./generated-dep2-effect.js'); require('./generated-dep4-effect.js'); var value = 42; function onlyUsedByOne(value) { console.log('Hello', value); } onlyUsedByOne(value); main2.js000066400000000000000000000001641450520414700370200ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/cjs'use strict'; require('./generated-dep2-effect.js'); require('./generated-dep4-effect.js'); console.log('main2'); main3.js000066400000000000000000000001151450520414700370150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/cjs'use strict'; require('./generated-dep4-effect.js'); console.log('main3'); es/000077500000000000000000000000001450520414700353035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expectedgenerated-dep2-effect.js000066400000000000000000000000251450520414700416560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/esconsole.log('dep2'); generated-dep4-effect.js000066400000000000000000000000251450520414700416600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/esconsole.log('dep4'); main1.js000066400000000000000000000002631450520414700366470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/esimport './generated-dep2-effect.js'; import './generated-dep4-effect.js'; var value = 42; function onlyUsedByOne(value) { console.log('Hello', value); } onlyUsedByOne(value); main2.js000066400000000000000000000001411450520414700366430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/esimport './generated-dep2-effect.js'; import './generated-dep4-effect.js'; console.log('main2'); main3.js000066400000000000000000000000741450520414700366510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/esimport './generated-dep4-effect.js'; console.log('main3'); system/000077500000000000000000000000001450520414700362205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expectedgenerated-dep2-effect.js000066400000000000000000000001761450520414700426020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep2'); }) }; })); generated-dep4-effect.js000066400000000000000000000001761450520414700426040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep4'); }) }; })); main1.js000066400000000000000000000004601450520414700375630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/systemSystem.register(['./generated-dep2-effect.js', './generated-dep4-effect.js'], (function () { 'use strict'; return { setters: [null, null], execute: (function () { var value = 42; function onlyUsedByOne(value) { console.log('Hello', value); } onlyUsedByOne(value); }) }; })); main2.js000066400000000000000000000003221450520414700375610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/systemSystem.register(['./generated-dep2-effect.js', './generated-dep4-effect.js'], (function () { 'use strict'; return { setters: [null, null], execute: (function () { console.log('main2'); }) }; })); main3.js000066400000000000000000000002561450520414700375700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/systemSystem.register(['./generated-dep4-effect.js'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main3'); }) }; })); dep1.js000066400000000000000000000001761450520414700341270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesimport './dep2-effect.js'; import './dep3.js' export default function onlyUsedByOne(value) { console.log('Hello', value); } dep2-effect.js000066400000000000000000000000251450520414700353530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesconsole.log('dep2'); dep3.js000066400000000000000000000000771450520414700341310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesimport './dep1'; import './dep4-effect.js'; export default 42; dep4-effect.js000066400000000000000000000000251450520414700353550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesconsole.log('dep4'); main1.js000066400000000000000000000001101450520414700342670ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesimport dep from './dep1.js'; import value from './dep3.js'; dep(value); main2.js000066400000000000000000000000521450520414700342750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesimport './dep1.js'; console.log('main2'); main3.js000066400000000000000000000000611450520414700342760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesimport './dep4-effect.js'; console.log('main3'); module-side-effects-empty-imports/000077500000000000000000000000001450520414700344375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000003021450520414700363740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-importsmodule.exports = defineTest({ description: 'avoids empty imports if moduleSideEffects are false', options: { input: ['main1', 'main2'], treeshake: { moduleSideEffects: false } } }); _expected/000077500000000000000000000000001450520414700363775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-importsamd/000077500000000000000000000000001450520414700371405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expectedmain1.js000066400000000000000000000002001450520414700404730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/amddefine((function () { 'use strict'; var value = 42; console.log('Ignored side-effect'); console.log('main1', value); })); main2.js000066400000000000000000000001021450520414700404750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/amddefine((function () { 'use strict'; console.log('main2'); })); cjs/000077500000000000000000000000001450520414700371565ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expectedmain1.js000066400000000000000000000001411450520414700405150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/cjs'use strict'; var value = 42; console.log('Ignored side-effect'); console.log('main1', value); main2.js000066400000000000000000000000451450520414700405210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/cjs'use strict'; console.log('main2'); es/000077500000000000000000000000001450520414700370065ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expectedmain1.js000066400000000000000000000001221450520414700403440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/esvar value = 42; console.log('Ignored side-effect'); console.log('main1', value); main2.js000066400000000000000000000000261450520414700403500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/esconsole.log('main2'); system/000077500000000000000000000000001450520414700377235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expectedmain1.js000066400000000000000000000003011450520414700412600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { var value = 42; console.log('Ignored side-effect'); console.log('main1', value); }) }; })); main2.js000066400000000000000000000001771450520414700412740ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main2'); }) }; })); dep.js000066400000000000000000000000671450520414700355500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-importsexport default 42; console.log('Ignored side-effect'); main1.js000066400000000000000000000000731450520414700360020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-importsimport value from './dep.js'; console.log('main1', value); main2.js000066400000000000000000000000641450520414700360030ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-importsimport value from './dep.js'; console.log('main2'); module-side-effects-reexports-1/000077500000000000000000000000001450520414700337775ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002631450520414700357420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1module.exports = defineTest({ description: 'handles re-exports in entry points if moduleSideEffects are false', options: { treeshake: { moduleSideEffects: false } } }); _expected/000077500000000000000000000000001450520414700357375ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1amd/000077500000000000000000000000001450520414700365005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expectedmain.js000066400000000000000000000001531450520414700377610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); cjs/000077500000000000000000000000001450520414700365165ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expectedmain.js000066400000000000000000000000711450520414700377760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expected/cjs'use strict'; const value = 42; exports.value = value; es/000077500000000000000000000000001450520414700363465ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expectedmain.js000066400000000000000000000000451450520414700376270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expected/esconst value = 42; export { value }; system/000077500000000000000000000000001450520414700372635ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expectedmain.js000066400000000000000000000002241450520414700405430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 42); }) }; })); dep1.js000066400000000000000000000000331450520414700351620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1export * from './dep2.js'; dep2.js000066400000000000000000000000311450520414700351610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1export const value = 42; main.js000066400000000000000000000000431450520414700352560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1export { value } from './dep1.js'; module-side-effects-reexports-2/000077500000000000000000000000001450520414700340005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002631450520414700357430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2module.exports = defineTest({ description: 'handles re-exports in entry points if moduleSideEffects are false', options: { treeshake: { moduleSideEffects: false } } }); _expected/000077500000000000000000000000001450520414700357405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2amd/000077500000000000000000000000001450520414700365015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expectedmain.js000066400000000000000000000001531450520414700377620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); cjs/000077500000000000000000000000001450520414700365175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expectedmain.js000066400000000000000000000000711450520414700377770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expected/cjs'use strict'; const value = 42; exports.value = value; es/000077500000000000000000000000001450520414700363475ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expectedmain.js000066400000000000000000000000451450520414700376300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expected/esconst value = 42; export { value }; system/000077500000000000000000000000001450520414700372645ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expectedmain.js000066400000000000000000000002241450520414700405440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 42); }) }; })); dep1.js000066400000000000000000000000331450520414700351630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2export * from './dep2.js'; dep2.js000066400000000000000000000000311450520414700351620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2export const value = 42; main.js000066400000000000000000000000651450520414700352630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2import { value } from './dep1.js'; export { value }; module-side-effects-reexports-3/000077500000000000000000000000001450520414700340015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002631450520414700357440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3module.exports = defineTest({ description: 'handles re-exports in entry points if moduleSideEffects are false', options: { treeshake: { moduleSideEffects: false } } }); _expected/000077500000000000000000000000001450520414700357415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3amd/000077500000000000000000000000001450520414700365025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expectedmain.js000066400000000000000000000001531450520414700377630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); cjs/000077500000000000000000000000001450520414700365205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expectedmain.js000066400000000000000000000000711450520414700400000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expected/cjs'use strict'; const value = 42; exports.value = value; es/000077500000000000000000000000001450520414700363505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expectedmain.js000066400000000000000000000000451450520414700376310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expected/esconst value = 42; export { value }; system/000077500000000000000000000000001450520414700372655ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expectedmain.js000066400000000000000000000002241450520414700405450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 42); }) }; })); dep1.js000066400000000000000000000000331450520414700351640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3export * from './dep2.js'; dep2.js000066400000000000000000000000311450520414700351630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3export const value = 42; main.js000066400000000000000000000000331450520414700352570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3export * from './dep1.js'; rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/000077500000000000000000000000001450520414700251015ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_config.js000066400000000000000000000003661450520414700270500ustar00rootroot00000000000000module.exports = defineTest({ description: 'chunk aliasing with extensions', options: { output: { manualChunks(id) { if (id.endsWith('main.js')) return; if (id.endsWith('a.js')) return 'first'; return 'second'; } } } }); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/000077500000000000000000000000001450520414700270415ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/amd/000077500000000000000000000000001450520414700276025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/amd/generated-first.js000066400000000000000000000000761450520414700332260ustar00rootroot00000000000000define((function () { 'use strict'; console.log('a'); })); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/amd/generated-second.js000066400000000000000000000004031450520414700333440ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('b'); var b = /*#__PURE__*/Object.freeze({ __proto__: null }); console.log('c'); var c = /*#__PURE__*/Object.freeze({ __proto__: null }); exports.b = b; exports.c = c; })); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/amd/main.js000066400000000000000000000006441450520414700310700ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-first'], resolve, reject); }); new Promise(function (resolve, reject) { require(['./generated-second'], resolve, reject); }).then(function (n) { return n.b; }); new Promise(function (resolve, reject) { require(['./generated-second'], resolve, reject); }).then(function (n) { return n.c; }); })); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/000077500000000000000000000000001450520414700276205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/generated-first.js000066400000000000000000000000411450520414700332340ustar00rootroot00000000000000'use strict'; console.log('a'); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/generated-second.js000066400000000000000000000003111450520414700333600ustar00rootroot00000000000000'use strict'; console.log('b'); var b = /*#__PURE__*/Object.freeze({ __proto__: null }); console.log('c'); var c = /*#__PURE__*/Object.freeze({ __proto__: null }); exports.b = b; exports.c = c; rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/main.js000066400000000000000000000005121450520414700311000ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-first.js'); }); Promise.resolve().then(function () { return require('./generated-second.js'); }).then(function (n) { return n.b; }); Promise.resolve().then(function () { return require('./generated-second.js'); }).then(function (n) { return n.c; }); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/es/000077500000000000000000000000001450520414700274505ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/es/generated-first.js000066400000000000000000000000221450520414700330630ustar00rootroot00000000000000console.log('a'); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/es/generated-second.js000066400000000000000000000002551450520414700332170ustar00rootroot00000000000000console.log('b'); var b = /*#__PURE__*/Object.freeze({ __proto__: null }); console.log('c'); var c = /*#__PURE__*/Object.freeze({ __proto__: null }); export { b, c }; rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/es/main.js000066400000000000000000000002501450520414700307270ustar00rootroot00000000000000import('./generated-first.js'); import('./generated-second.js').then(function (n) { return n.b; }); import('./generated-second.js').then(function (n) { return n.c; }); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/system/000077500000000000000000000000001450520414700303655ustar00rootroot00000000000000generated-first.js000066400000000000000000000001731450520414700337300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('a'); }) }; })); generated-second.js000066400000000000000000000005101450520414700340470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('b'); var b = /*#__PURE__*/Object.freeze({ __proto__: null }); exports('b', b); console.log('c'); var c = /*#__PURE__*/Object.freeze({ __proto__: null }); exports('c', c); }) }; })); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/_expected/system/main.js000066400000000000000000000004731450520414700316530ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-first.js'); module.import('./generated-second.js').then(function (n) { return n.b; }); module.import('./generated-second.js').then(function (n) { return n.c; }); }) }; })); rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/a.js000066400000000000000000000000211450520414700256500ustar00rootroot00000000000000console.log('a');rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/b.js000066400000000000000000000000211450520414700256510ustar00rootroot00000000000000console.log('b');rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/c.js000066400000000000000000000000211450520414700256520ustar00rootroot00000000000000console.log('c');rollup-3.29.4/test/chunking-form/samples/single-file-manual-chunk/main.js000066400000000000000000000000661450520414700263650ustar00rootroot00000000000000import('./a.js'); import('./b.js'); import('./c.js'); rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/000077500000000000000000000000001450520414700261615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_config.js000066400000000000000000000011721450520414700301240ustar00rootroot00000000000000module.exports = defineTest({ description: 'observes sourcemapFileNames property when using a function', options: { output: { sourcemap: true, entryFileNames: '[name].js', chunkFileNames: '[name]-[hash].js', sourcemapFileNames: ({ name }) => { switch (name) { case 'main': { // chunkhash should be empty string return 'main[chunkhash].js.map'; } case 'dynamic': { return 'dynamic.js.map'; } case 'dynamic-hashed': { return 'dynamic-[hash:12]-[chunkhash].js.map'; } default: { throw new Error(`Unexpected name ${name}`); } } } } } }); rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/000077500000000000000000000000001450520414700301215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/000077500000000000000000000000001450520414700306625ustar00rootroot00000000000000dynamic-a0f7e361.js000066400000000000000000000001501450520414700337130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/amddefine((function () { 'use strict'; console.log('dynamic'); })); //# sourceMappingURL=dynamic.js.map dynamic-eea0ce30202b-5ec8d44f.js.map000066400000000000000000000003221450520414700364330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd{"version":3,"file":"dynamic-hashed-5ec8d44f.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":";;CAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;;;;;;"}dynamic-hashed-5ec8d44f.js000066400000000000000000000002051450520414700352400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/amddefine((function () { 'use strict'; console.log('dynamic-hashed'); })); //# sourceMappingURL=dynamic-eea0ce30202b-5ec8d44f.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/dynamic.js.map000066400000000000000000000002731450520414700334220ustar00rootroot00000000000000{"version":3,"file":"dynamic-a0f7e361.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":";;CAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;;;;;"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/main.js000066400000000000000000000004471450520414700321510ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./dynamic-a0f7e361'], resolve, reject); }); new Promise(function (resolve, reject) { require(['./dynamic-hashed-5ec8d44f'], resolve, reject); }); })); //# sourceMappingURL=main.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/amd/main.js.map000066400000000000000000000003361450520414700327220ustar00rootroot00000000000000{"version":3,"file":"main.js","sources":["../../main.js"],"sourcesContent":["import('./dynamic.js');\nimport('./dynamic-hashed.js');\n"],"names":[],"mappings":";;AAAA,mDAAO,oBAAc,uBAAC,CAAC;AACvB,mDAAO,2BAAqB,uBAAC;;;;;;"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/000077500000000000000000000000001450520414700307005ustar00rootroot00000000000000dynamic-03a87e17.js000066400000000000000000000001131450520414700336530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs'use strict'; console.log('dynamic'); //# sourceMappingURL=dynamic.js.map dynamic-44faaace9dbc-e21b9079.js.map000066400000000000000000000003161450520414700365470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs{"version":3,"file":"dynamic-hashed-e21b9079.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;;"}dynamic-hashed-e21b9079.js000066400000000000000000000001501450520414700351110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs'use strict'; console.log('dynamic-hashed'); //# sourceMappingURL=dynamic-44faaace9dbc-e21b9079.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/dynamic.js.map000066400000000000000000000002671450520414700334430ustar00rootroot00000000000000{"version":3,"file":"dynamic-03a87e17.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/main.js000066400000000000000000000003331450520414700321610ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./dynamic-03a87e17.js'); }); Promise.resolve().then(function () { return require('./dynamic-hashed-e21b9079.js'); }); //# sourceMappingURL=main.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/cjs/main.js.map000066400000000000000000000003301450520414700327320ustar00rootroot00000000000000{"version":3,"file":"main.js","sources":["../../main.js"],"sourcesContent":["import('./dynamic.js');\nimport('./dynamic-hashed.js');\n"],"names":[],"mappings":";;AAAA,oDAAO,uBAAc,KAAC,CAAC;AACvB,oDAAO,8BAAqB,KAAC;;"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/000077500000000000000000000000001450520414700305305ustar00rootroot00000000000000dynamic-769057acb768-4b06902b.js.map000066400000000000000000000003121450520414700357430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/es{"version":3,"file":"dynamic-hashed-4b06902b.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC"}dynamic-c7ad594d.js000066400000000000000000000000741450520414700336560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/esconsole.log('dynamic'); //# sourceMappingURL=dynamic.js.map dynamic-hashed-4b06902b.js000066400000000000000000000001311450520414700347260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/esconsole.log('dynamic-hashed'); //# sourceMappingURL=dynamic-769057acb768-4b06902b.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/dynamic.js.map000066400000000000000000000002631450520414700332670ustar00rootroot00000000000000{"version":3,"file":"dynamic-c7ad594d.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/main.js000066400000000000000000000001521450520414700320100ustar00rootroot00000000000000import('./dynamic-c7ad594d.js'); import('./dynamic-hashed-4b06902b.js'); //# sourceMappingURL=main.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/es/main.js.map000066400000000000000000000003221450520414700325630ustar00rootroot00000000000000{"version":3,"file":"main.js","sources":["../../main.js"],"sourcesContent":["import('./dynamic.js');\nimport('./dynamic-hashed.js');\n"],"names":[],"mappings":"AAAA,OAAO,uBAAc,CAAC,CAAC;AACvB,OAAO,8BAAqB,CAAC"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/000077500000000000000000000000001450520414700314455ustar00rootroot00000000000000dynamic-883b8003cd49-c0b30ec8.js.map000066400000000000000000000003271450520414700370140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/system{"version":3,"file":"dynamic-hashed-c0b30ec8.js","sources":["../../dynamic-hashed.js"],"sourcesContent":["console.log('dynamic-hashed');\n"],"names":[],"mappings":";;;;;GAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;;;;;;;;"}dynamic-ef271780.js000066400000000000000000000002451450520414700344320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dynamic'); }) }; })); //# sourceMappingURL=dynamic.js.map dynamic-hashed-c0b30ec8.js000066400000000000000000000003021450520414700360020ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dynamic-hashed'); }) }; })); //# sourceMappingURL=dynamic-883b8003cd49-c0b30ec8.js.map dynamic.js.map000066400000000000000000000003001450520414700341150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/system{"version":3,"file":"dynamic-ef271780.js","sources":["../../dynamic.js"],"sourcesContent":["console.log('dynamic');\n"],"names":[],"mappings":";;;;;GAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;;;;;;;;"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/main.js000066400000000000000000000003631450520414700327310ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./dynamic-ef271780.js'); module.import('./dynamic-hashed-c0b30ec8.js'); }) }; })); //# sourceMappingURL=main.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/_expected/system/main.js.map000066400000000000000000000003411450520414700335010ustar00rootroot00000000000000{"version":3,"file":"main.js","sources":["../../main.js"],"sourcesContent":["import('./dynamic.js');\nimport('./dynamic-hashed.js');\n"],"names":[],"mappings":";;;;;AAAA,iBAAO,uBAAc,CAAC,CAAC;AACvB,iBAAO,8BAAqB,CAAC;;;;;;;;"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/dynamic-hashed.js000066400000000000000000000000371450520414700313750ustar00rootroot00000000000000console.log('dynamic-hashed'); rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/dynamic.js000066400000000000000000000000301450520414700301340ustar00rootroot00000000000000console.log('dynamic'); rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names-function/main.js000066400000000000000000000000671450520414700274460ustar00rootroot00000000000000import('./dynamic.js'); import('./dynamic-hashed.js'); rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/000077500000000000000000000000001450520414700243365ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_config.js000066400000000000000000000011441450520414700263000ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'populates sourcemapFileName property of OutputChunk with final name when using sourcemapFileNames option', options: { output: { sourcemap: true, entryFileNames: '[name]-[hash]-[format].js', sourcemapFileNames: '[name]-[chunkhash]-[format]-[hash].js.map' }, plugins: [ { name: 'test-bundle', generateBundle(options, bundle) { const [sourcemapFileName, fileName] = Object.keys(bundle).sort(); assert.strictEqual(bundle[fileName].sourcemapFileName, sourcemapFileName); } } ] } }); rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/000077500000000000000000000000001450520414700262765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/amd/000077500000000000000000000000001450520414700270375ustar00rootroot00000000000000main-543232e9-amd-af8f17da.js.map000066400000000000000000000002641450520414700340540ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/amd{"version":3,"file":"main-543232e9-amd.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":";;CAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;;;;;;"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/amd/main-543232e9-amd.js000066400000000000000000000001661450520414700320610ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 42 ); })); //# sourceMappingURL=main-543232e9-amd-af8f17da.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/000077500000000000000000000000001450520414700270555ustar00rootroot00000000000000main-3fddaf82-cjs-c64b742b.js.map000066400000000000000000000002601450520414700342410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/cjs{"version":3,"file":"main-3fddaf82-cjs.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;;"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/cjs/main-3fddaf82-cjs.js000066400000000000000000000001311450520414700324060ustar00rootroot00000000000000'use strict'; console.log( 42 ); //# sourceMappingURL=main-3fddaf82-cjs-c64b742b.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/es/000077500000000000000000000000001450520414700267055ustar00rootroot00000000000000main-824894f4-es-dbab040a.js.map000066400000000000000000000002531450520414700335560ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/es{"version":3,"file":"main-824894f4-es.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE"}rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/es/main-824894f4-es.js000066400000000000000000000001111450520414700315770ustar00rootroot00000000000000console.log( 42 ); //# sourceMappingURL=main-824894f4-es-dbab040a.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/system/000077500000000000000000000000001450520414700276225ustar00rootroot00000000000000main-6186746c-system-bce3d2ab.js.map000066400000000000000000000002741450520414700354770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/system{"version":3,"file":"main-6186746c-system.js","sources":["../../main.js"],"sourcesContent":["console.log( 42 );\n"],"names":[],"mappings":";;;;;GAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;;;;;;;;"}main-6186746c-system.js000066400000000000000000000002661450520414700333610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log( 42 ); }) }; })); //# sourceMappingURL=main-6186746c-system-bce3d2ab.js.map rollup-3.29.4/test/chunking-form/samples/sourcemap-file-names/main.js000066400000000000000000000000231450520414700256130ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/000077500000000000000000000000001450520414700251205ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/000077500000000000000000000000001450520414700320035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_config.js000066400000000000000000000004231450520414700337440ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles synthetic named exports that are reexported as a default export over several stages', options: { input: ['main.js'], plugins: { transform(code) { return { code, syntheticNamedExports: true }; } } } }); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/000077500000000000000000000000001450520414700337435ustar00rootroot00000000000000amd/000077500000000000000000000000001450520414700344255ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expectedgenerated-component.js000066400000000000000000000013401450520414700407170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/amddefine(['exports', './generated-main'], (function (exports, main) { 'use strict'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var component = { lib: main.lib, lib2: main.lib.named, lib3: main.lib.named.named }; var component$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: component }, [component]); exports.component = component$1; })); generated-main.js000066400000000000000000000006501450520414700376440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; const lib = { named: { named: 42 } }; console.log('side-effect', lib.named); console.log('side-effect', lib.named.named); const component = new Promise(function (resolve, reject) { require(['./generated-component'], resolve, reject); }).then(function (n) { return n.component; }); exports.component = component; exports.lib = lib; })); main.js000066400000000000000000000002451450520414700357100ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/amddefine(['exports', './generated-main'], (function (exports, main) { 'use strict'; exports.component = main.component; exports.lib = main.lib.named.named; })); cjs/000077500000000000000000000000001450520414700344435ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expectedgenerated-component.js000066400000000000000000000012561450520414700407430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/cjs'use strict'; var main = require('./generated-main.js'); function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var component = { lib: main.lib, lib2: main.lib.named, lib3: main.lib.named.named }; var component$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: component }, [component]); exports.component = component$1; generated-main.js000066400000000000000000000005211450520414700376570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/cjs'use strict'; const lib = { named: { named: 42 } }; console.log('side-effect', lib.named); console.log('side-effect', lib.named.named); const component = Promise.resolve().then(function () { return require('./generated-component.js'); }).then(function (n) { return n.component; }); exports.component = component; exports.lib = lib; main.js000066400000000000000000000002051450520414700357220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/cjs'use strict'; var main = require('./generated-main.js'); exports.component = main.component; exports.lib = main.lib.named.named; es/000077500000000000000000000000001450520414700342735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expectedgenerated-component.js000066400000000000000000000012141450520414700405650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/esimport { l as lib } from './generated-main.js'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var component = { lib, lib2: lib.named, lib3: lib.named.named }; var component$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: component }, [component]); export { component$1 as c }; generated-main.js000066400000000000000000000003741450520414700375150ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/esconst lib = { named: { named: 42 } }; console.log('side-effect', lib.named); console.log('side-effect', lib.named.named); const component = import('./generated-component.js').then(function (n) { return n.c; }); export { component as c, lib as l }; main.js000066400000000000000000000002371450520414700355570ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/esimport { l as lib } from './generated-main.js'; export { c as component } from './generated-main.js'; var named = lib.named.named; export { named as lib }; system/000077500000000000000000000000001450520414700352105ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expectedgenerated-component.js000066400000000000000000000015311450520414700415040ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/systemSystem.register(['./generated-main.js'], (function (exports) { 'use strict'; var lib; return { setters: [function (module) { lib = module.l; }], execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var component = { lib, lib2: lib.named, lib3: lib.named.named }; var component$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: component }, [component]); exports('c', component$1); }) }; })); generated-main.js000066400000000000000000000005721450520414700404320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const lib = exports('l', { named: { named: 42 } }); console.log('side-effect', lib.named); console.log('side-effect', lib.named.named); const component = exports('c', module.import('./generated-component.js').then(function (n) { return n.c; })); }) }; })); main.js000066400000000000000000000004161450520414700364730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/systemSystem.register(['./generated-main.js'], (function (exports) { 'use strict'; var lib; return { setters: [function (module) { lib = module.l; exports('component', module.c); }], execute: (function () { exports('lib', lib.named.named); }) }; })); component.js000066400000000000000000000002041450520414700342600ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexportimport lib from './lib'; import lib2 from './lib-reexport2'; import lib3 from './lib-reexport'; export default { lib, lib2, lib3 }; lib-reexport.js000066400000000000000000000001541450520414700346760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexportimport { named } from './lib-reexport2.js'; console.log('side-effect', named); export { named as default }; lib-reexport2.js000066400000000000000000000001421450520414700347550ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexportimport { named } from './lib.js'; console.log('side-effect', named); export { named as default }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/lib.js000066400000000000000000000001011450520414700330770ustar00rootroot00000000000000const lib = { named: { named: 42 } }; export { lib as default }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/main.js000066400000000000000000000001461450520414700332660ustar00rootroot00000000000000export { default as lib } from './lib-reexport.js'; export const component = import('./component.js');deduplicate-synthetic-named-exports-and-default/000077500000000000000000000000001450520414700363025ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports_config.js000066400000000000000000000005101450520414700402400ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultmodule.exports = defineTest({ description: 'handles importing a synthetic named export together with the default export', options: { input: ['main1', 'main2', 'main3'], plugins: [ { name: 'test-plugin', transform(code) { return { code, syntheticNamedExports: true }; } } ] } }); _expected/000077500000000000000000000000001450520414700402425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultamd/000077500000000000000000000000001450520414700410035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expectedmain1.js000066400000000000000000000002341450520414700423450ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var lib = { foo: true, bar: true, baz: true }; exports.foo = lib.foo; exports.lib = lib; })); main2.js000066400000000000000000000002031450520414700423420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/amddefine(['./main1'], (function (main1) { 'use strict'; console.log(main1.lib, main1.lib.foo, main1.lib.bar, main1.lib.baz); })); main3.js000066400000000000000000000001611450520414700423460ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/amddefine(['exports', './main1'], (function (exports, main1) { 'use strict'; exports.foo = main1.lib.foo; })); cjs/000077500000000000000000000000001450520414700410215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expectedmain1.js000066400000000000000000000001511450520414700423610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/cjs'use strict'; var lib = { foo: true, bar: true, baz: true }; exports.foo = lib.foo; exports.lib = lib; main2.js000066400000000000000000000001701450520414700423630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/cjs'use strict'; var main1 = require('./main1.js'); console.log(main1.lib, main1.lib.foo, main1.lib.bar, main1.lib.baz); main3.js000066400000000000000000000001221450520414700423610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/cjs'use strict'; var main1 = require('./main1.js'); exports.foo = main1.lib.foo; es/000077500000000000000000000000001450520414700406515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expectedmain1.js000066400000000000000000000001301450520414700422060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/esvar lib = { foo: true, bar: true, baz: true }; var foo = lib.foo; export { foo, lib }; main2.js000066400000000000000000000001201450520414700422060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/esimport { lib } from './main1.js'; console.log(lib, lib.foo, lib.bar, lib.baz); main3.js000066400000000000000000000001101450520414700422060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/esimport { lib } from './main1.js'; var foo = lib.foo; export { foo }; system/000077500000000000000000000000001450520414700415665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expectedmain1.js000066400000000000000000000003141450520414700431270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var lib = exports('lib', { foo: true, bar: true, baz: true }); exports('foo', lib.foo); }) }; })); main2.js000066400000000000000000000003471450520414700431360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/systemSystem.register(['./main1.js'], (function () { 'use strict'; var lib; return { setters: [function (module) { lib = module.lib; }], execute: (function () { console.log(lib, lib.foo, lib.bar, lib.baz); }) }; })); main3.js000066400000000000000000000003341450520414700431330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/systemSystem.register(['./main1.js'], (function (exports) { 'use strict'; var lib; return { setters: [function (module) { lib = module.lib; }], execute: (function () { exports('foo', lib.foo); }) }; })); lib.js000066400000000000000000000000641450520414700374060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultexport default { foo: true, bar: true, baz: true }; main1.js000066400000000000000000000000601450520414700376410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultexport { default as lib, foo } from './lib.js'; main2.js000066400000000000000000000001201450520414700376370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultimport lib, { foo, bar, baz } from './lib.js'; console.log(lib, foo, bar, baz); main3.js000066400000000000000000000000401450520414700376410ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultexport { foo } from './lib.js'; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/000077500000000000000000000000001450520414700304125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_config.js000066400000000000000000000004611450520414700323550ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles synthetic named exports that are reexported as a default export where both the default and a named export is used', options: { input: ['main.js'], plugins: { transform(code) { return { code, syntheticNamedExports: true }; } } } }); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/000077500000000000000000000000001450520414700323525ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/amd/000077500000000000000000000000001450520414700331135ustar00rootroot00000000000000generated-component.js000066400000000000000000000013051450520414700373270ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/amddefine(['exports', './main'], (function (exports, main) { 'use strict'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var component = { lib: main.lib, someExport: main.lib.someExport }; var component$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: component }, [component]); exports.component = component$1; })); main.js000066400000000000000000000005331450520414700343170ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/amddefine(['require', 'exports'], (function (require, exports) { 'use strict'; var lib = {}; console.log('side-effect', lib); const component = new Promise(function (resolve, reject) { require(['./generated-component'], resolve, reject); }).then(function (n) { return n.component; }); exports.component = component; exports.lib = lib; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/cjs/000077500000000000000000000000001450520414700331315ustar00rootroot00000000000000generated-component.js000066400000000000000000000012231450520414700373440ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/cjs'use strict'; var main = require('./main.js'); function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var component = { lib: main.lib, someExport: main.lib.someExport }; var component$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: component }, [component]); exports.component = component$1; main.js000066400000000000000000000004051450520414700343330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/cjs'use strict'; var lib = {}; console.log('side-effect', lib); const component = Promise.resolve().then(function () { return require('./generated-component.js'); }).then(function (n) { return n.component; }); exports.component = component; exports.lib = lib; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/es/000077500000000000000000000000001450520414700327615ustar00rootroot00000000000000generated-component.js000066400000000000000000000011611450520414700371750ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/esimport { lib } from './main.js'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var component = { lib, someExport: lib.someExport }; var component$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: component }, [component]); export { component$1 as c }; main.js000066400000000000000000000002461450520414700341660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/esvar lib = {}; console.log('side-effect', lib); const component = import('./generated-component.js').then(function (n) { return n.c; }); export { component, lib }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/system/000077500000000000000000000000001450520414700336765ustar00rootroot00000000000000generated-component.js000066400000000000000000000015051450520414700401140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var lib; return { setters: [function (module) { lib = module.lib; }], execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var component = { lib, someExport: lib.someExport }; var component$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: component }, [component]); exports('c', component$1); }) }; })); main.js000066400000000000000000000004651450520414700351060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var lib = exports('lib', {}); console.log('side-effect', lib); const component = exports('component', module.import('./generated-component.js').then(function (n) { return n.c; })); }) }; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/component.js000066400000000000000000000001261450520414700327510ustar00rootroot00000000000000import lib, { someExport } from './lib-reexport'; export default { lib, someExport }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/lib-reexport.js000066400000000000000000000001211450520414700333560ustar00rootroot00000000000000import lib from './lib.js'; console.log('side-effect', lib); export default lib; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/lib.js000066400000000000000000000000231450520414700315110ustar00rootroot00000000000000export default {}; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/default-reexport/main.js000066400000000000000000000001461450520414700316750ustar00rootroot00000000000000export { default as lib } from './lib-reexport.js'; export const component = import('./component.js');rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/000077500000000000000000000000001450520414700300545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_config.js000066400000000000000000000004101450520414700320110ustar00rootroot00000000000000module.exports = defineTest({ description: 'synthetic named exports', options: { input: ['main.js'], plugins: [ { transform(code, id) { if (id.endsWith('dep.js')) { return { code, syntheticNamedExports: true }; } } } ] } }); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/000077500000000000000000000000001450520414700320145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/amd/000077500000000000000000000000001450520414700325555ustar00rootroot00000000000000generated-dep.js000066400000000000000000000012051450520414700355360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/amddefine(['exports'], (function (exports) { 'use strict'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var dep = { foo: 1 }; const bar = 2; var dep$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, default: dep }, [dep]); exports.dep = dep$1; })); main.js000066400000000000000000000003711450520414700337610ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/amddefine(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dep'], resolve, reject); }).then(function (n) { return n.dep; }).then(({ foo, bar, baz }) => console.log(foo, bar, baz)); })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/cjs/000077500000000000000000000000001450520414700325735ustar00rootroot00000000000000generated-dep.js000066400000000000000000000010771450520414700355630ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/cjs'use strict'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var dep = { foo: 1 }; const bar = 2; var dep$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, default: dep }, [dep]); exports.dep = dep$1; main.js000066400000000000000000000002731450520414700340000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-dep.js'); }).then(function (n) { return n.dep; }).then(({ foo, bar, baz }) => console.log(foo, bar, baz)); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/es/000077500000000000000000000000001450520414700324235ustar00rootroot00000000000000generated-dep.js000066400000000000000000000010621450520414700354050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/esfunction _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var dep = { foo: 1 }; const bar = 2; var dep$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, default: dep }, [dep]); export { dep$1 as d }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/es/main.js000066400000000000000000000001711450520414700337040ustar00rootroot00000000000000import('./generated-dep.js').then(function (n) { return n.d; }).then(({ foo, bar, baz }) => console.log(foo, bar, baz)); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/system/000077500000000000000000000000001450520414700333405ustar00rootroot00000000000000generated-dep.js000066400000000000000000000013361450520414700363260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var dep = { foo: 1 }; const bar = 2; var dep$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, default: dep }, [dep]); exports('d', dep$1); }) }; })); main.js000066400000000000000000000003701450520414700345430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/systemSystem.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dep.js').then(function (n) { return n.d; }).then(({ foo, bar, baz }) => console.log(foo, bar, baz)); }) }; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/dep.js000066400000000000000000000000611450520414700311570ustar00rootroot00000000000000export default { foo: 1 }; export const bar = 2; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/dynamic-import/main.js000066400000000000000000000001141450520414700313320ustar00rootroot00000000000000import('./dep.js').then(({ foo, bar, baz }) => console.log(foo, bar, baz)); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/000077500000000000000000000000001450520414700262615ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_config.js000066400000000000000000000004371450520414700302270ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not expose the synthetic namespace if an entry point uses a string value', options: { input: ['main', 'other'], plugins: [ { transform(code) { return { code, syntheticNamedExports: '__synthetic' }; } } ] } }); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/000077500000000000000000000000001450520414700302215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/amd/000077500000000000000000000000001450520414700307625ustar00rootroot00000000000000generated-main.js000066400000000000000000000003111450520414700341140ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const exists = 'exists'; const __synthetic = { synthetic: 'synthetic' }; exports.__synthetic = __synthetic; exports.exists = exists; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/amd/main.js000066400000000000000000000001721450520414700322440ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, main) { 'use strict'; exports.exists = main.exists; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/amd/other.js000066400000000000000000000001571450520414700324440ustar00rootroot00000000000000define(['./generated-main'], (function (main) { 'use strict'; console.log(main.__synthetic.synthetic); })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/cjs/000077500000000000000000000000001450520414700310005ustar00rootroot00000000000000generated-main.js000066400000000000000000000002251450520414700341360ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/cjs'use strict'; const exists = 'exists'; const __synthetic = { synthetic: 'synthetic' }; exports.__synthetic = __synthetic; exports.exists = exists; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/cjs/main.js000066400000000000000000000001331450520414700322570ustar00rootroot00000000000000'use strict'; var main = require('./generated-main.js'); exports.exists = main.exists; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/cjs/other.js000066400000000000000000000001441450520414700324560ustar00rootroot00000000000000'use strict'; var main = require('./generated-main.js'); console.log(main.__synthetic.synthetic); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/es/000077500000000000000000000000001450520414700306305ustar00rootroot00000000000000generated-main.js000066400000000000000000000001641450520414700337700ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/esconst exists = 'exists'; const __synthetic = { synthetic: 'synthetic' }; export { __synthetic as _, exists as e }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/es/main.js000066400000000000000000000000631450520414700321110ustar00rootroot00000000000000export { e as exists } from './generated-main.js'; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/es/other.js000066400000000000000000000001351450520414700323060ustar00rootroot00000000000000import { _ as __synthetic } from './generated-main.js'; console.log(__synthetic.synthetic); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/system/000077500000000000000000000000001450520414700315455ustar00rootroot00000000000000generated-main.js000066400000000000000000000003301450520414700347000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const exists = exports('e', 'exists'); const __synthetic = exports('_', { synthetic: 'synthetic' }); }) }; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/system/main.js000066400000000000000000000003111450520414700330220ustar00rootroot00000000000000System.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('exists', module.e); }], execute: (function () { }) }; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/_expected/system/other.js000066400000000000000000000003651450520414700332300ustar00rootroot00000000000000System.register(['./generated-main.js'], (function () { 'use strict'; var __synthetic; return { setters: [function (module) { __synthetic = module._; }], execute: (function () { console.log(__synthetic.synthetic); }) }; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/main.js000066400000000000000000000001271450520414700275430ustar00rootroot00000000000000export const exists = 'exists'; export const __synthetic = { synthetic: 'synthetic' }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/entry/other.js000066400000000000000000000000741450520414700277410ustar00rootroot00000000000000import { synthetic } from './main'; console.log(synthetic); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/000077500000000000000000000000001450520414700301575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_config.js000066400000000000000000000004471450520414700321260ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoids conflicts with global variables when re-exporting synthetic named exports', options: { plugins: [ { name: 'test-plugin', transform(code) { return { code, syntheticNamedExports: true }; } } ] } }); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/000077500000000000000000000000001450520414700321175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/amd/000077500000000000000000000000001450520414700326605ustar00rootroot00000000000000main.js000066400000000000000000000002541450520414700340640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var dep = { foo: 'bar' }; // This should log a global variable console.log(foo); exports.foo = dep.foo; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/cjs/000077500000000000000000000000001450520414700326765ustar00rootroot00000000000000main.js000066400000000000000000000001701450520414700340770ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/cjs'use strict'; var dep = { foo: 'bar' }; // This should log a global variable console.log(foo); exports.foo = dep.foo; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/es/000077500000000000000000000000001450520414700325265ustar00rootroot00000000000000main.js000066400000000000000000000002001450520414700337210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/esvar dep = { foo: 'bar' }; // This should log a global variable console.log(foo); var foo$1 = dep.foo; export { foo$1 as foo }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/system/000077500000000000000000000000001450520414700334435ustar00rootroot00000000000000main.js000066400000000000000000000003441450520414700346470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var dep = { foo: 'bar' }; // This should log a global variable console.log(foo); exports('foo', dep.foo); }) }; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/dep.js000066400000000000000000000001261450520414700312640ustar00rootroot00000000000000export default { foo: 'bar' }; // This should log a global variable console.log(foo); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/global-conflict/main.js000066400000000000000000000000401450520414700314330ustar00rootroot00000000000000export { foo } from './dep.js'; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/000077500000000000000000000000001450520414700331615ustar00rootroot00000000000000_config.js000066400000000000000000000005661450520414700350530ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2module.exports = defineTest({ description: 'mixed synthetic named exports 2', options: { input: ['main.js', 'main2.js'], plugins: [ { name: 'test-plugin', transform(code, id) { if (id.endsWith('dep1.js') || id.endsWith('dep2.js')) { return { code, syntheticNamedExports: true }; } return null; } } ] } }); _expected/000077500000000000000000000000001450520414700350425ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2amd/000077500000000000000000000000001450520414700356035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expectedgenerated-dep2.js000066400000000000000000000001711450520414700407260ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var dep2 = {bar: {foo: 'works'}}; exports.dep2 = dep2; })); main.js000066400000000000000000000001461450520414700370660ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/amddefine(['./generated-dep2'], (function (dep2) { 'use strict'; console.log(dep2.dep2.bar.foo); })); main2.js000066400000000000000000000001461450520414700371500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/amddefine(['./generated-dep2'], (function (dep2) { 'use strict'; console.log(dep2.dep2.bar.foo); })); cjs/000077500000000000000000000000001450520414700356215ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expectedgenerated-dep2.js000066400000000000000000000001071450520414700407430ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/cjs'use strict'; var dep2 = {bar: {foo: 'works'}}; exports.dep2 = dep2; main.js000066400000000000000000000001331450520414700371000ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/cjs'use strict'; var dep2 = require('./generated-dep2.js'); console.log(dep2.dep2.bar.foo); main2.js000066400000000000000000000001331450520414700371620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/cjs'use strict'; var dep2 = require('./generated-dep2.js'); console.log(dep2.dep2.bar.foo); es/000077500000000000000000000000001450520414700354515ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expectedgenerated-dep2.js000066400000000000000000000000711450520414700405730ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/esvar dep2 = {bar: {foo: 'works'}}; export { dep2 as d }; main.js000066400000000000000000000001151450520414700367300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/esimport { d as dep2 } from './generated-dep2.js'; console.log(dep2.bar.foo); main2.js000066400000000000000000000001151450520414700370120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/esimport { d as dep2 } from './generated-dep2.js'; console.log(dep2.bar.foo); system/000077500000000000000000000000001450520414700363665ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expectedgenerated-dep2.js000066400000000000000000000002401450520414700415060ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var dep2 = exports('d', {bar: {foo: 'works'}}); }) }; })); main.js000066400000000000000000000003361450520414700376520ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/systemSystem.register(['./generated-dep2.js'], (function () { 'use strict'; var dep2; return { setters: [function (module) { dep2 = module.d; }], execute: (function () { console.log(dep2.bar.foo); }) }; })); main2.js000066400000000000000000000003361450520414700377340ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/systemSystem.register(['./generated-dep2.js'], (function () { 'use strict'; var dep2; return { setters: [function (module) { dep2 = module.d; }], execute: (function () { console.log(dep2.bar.foo); }) }; })); dep1.js000066400000000000000000000000511450520414700342650ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2export {bar as default} from './dep2.js';dep2.js000066400000000000000000000000451450520414700342710ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2export default {bar: {foo: 'works'}};main.js000066400000000000000000000000621450520414700343620ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2import { foo } from './dep1.js'; console.log(foo);main2.js000066400000000000000000000000671450520414700344510ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2import { bar } from './dep2.js'; console.log(bar.foo); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/000077500000000000000000000000001450520414700330225ustar00rootroot00000000000000_config.js000066400000000000000000000004641450520414700347110ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exportsmodule.exports = defineTest({ description: 'mixed synthetic named exports', options: { input: ['main.js'], plugins: [ { name: 'test-plugin', resolveId(id) { if (id.endsWith('dep1.js')) { return { id, syntheticNamedExports: true }; } } } ] } }); _expected/000077500000000000000000000000001450520414700347035ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exportsamd/000077500000000000000000000000001450520414700354445ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expectedmain.js000066400000000000000000000015531450520414700367320ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expected/amddefine(['exports'], (function (exports) { 'use strict'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } const d = { fn: 42, hello: 'hola' }; const foo = 100; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: d, foo: foo }, [d]); const stuff = 12; console.log(stuff); console.log(d.fn); console.log(foo); console.log(ns); exports.fn = d.fn; exports.foo = foo; exports.stuff = d.stuff; })); cjs/000077500000000000000000000000001450520414700354625ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expectedmain.js000066400000000000000000000013731450520414700367500ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expected/cjs'use strict'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } const d = { fn: 42, hello: 'hola' }; const foo = 100; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: d, foo: foo }, [d]); const stuff = 12; console.log(stuff); console.log(d.fn); console.log(foo); console.log(ns); exports.fn = d.fn; exports.foo = foo; exports.stuff = d.stuff; es/000077500000000000000000000000001450520414700353125ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expectedmain.js000066400000000000000000000013711450520414700365760ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expected/esfunction _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } const d = { fn: 42, hello: 'hola' }; const foo = 100; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: d, foo: foo }, [d]); const stuff = 12; console.log(stuff); console.log(d.fn); console.log(foo); console.log(ns); var fn = d.fn; var stuff$1 = d.stuff; export { fn, foo, stuff$1 as stuff }; system/000077500000000000000000000000001450520414700362275ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expectedmain.js000066400000000000000000000020421450520414700375070ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } const d = { fn: 42, hello: 'hola' }; const foo = exports('foo', 100); var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: d, foo: foo }, [d]); const stuff = 12; console.log(stuff); console.log(d.fn); console.log(foo); console.log(ns); exports({ fn: d.fn, stuff: d.stuff }); }) }; })); dep1.js000066400000000000000000000001221450520414700341250ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exportsconst d = { fn: 42, hello: 'hola' }; export const foo = 100; export default d;dep2.js000066400000000000000000000000521450520414700341300ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exportsexport {fn, foo, stuff} from './dep1.js'; main.js000066400000000000000000000003121450520414700342210ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exportsimport {fn, foo} from './dep2.js'; export {fn, stuff, foo} from './dep2.js'; import * as ns from './dep1.js'; const stuff = 12; console.log(stuff); console.log(fn); console.log(foo); console.log(ns);rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/000077500000000000000000000000001450520414700273575ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_config.js000066400000000000000000000005171450520414700313240ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles multiple levels of synthetic named exports', options: { input: ['main.js', 'main2.js', 'main3.js', 'main4.js', 'main5.js'], plugins: [ { name: 'test-plugin', transform(code) { return { code, syntheticNamedExports: true }; } } ] } }); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/000077500000000000000000000000001450520414700313175ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/000077500000000000000000000000001450520414700320605ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main.js000066400000000000000000000001611450520414700333400ustar00rootroot00000000000000define((function () { 'use strict'; var main = { one: { two: { three: { four: 42 } } } }; return main; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main2.js000066400000000000000000000001171450520414700334230ustar00rootroot00000000000000define(['./main'], (function (main) { 'use strict'; return main.one; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main3.js000066400000000000000000000001231450520414700334210ustar00rootroot00000000000000define(['./main'], (function (main) { 'use strict'; return main.one.two; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main4.js000066400000000000000000000001311450520414700334210ustar00rootroot00000000000000define(['./main'], (function (main) { 'use strict'; return main.one.two.three; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main5.js000066400000000000000000000001361450520414700334270ustar00rootroot00000000000000define(['./main'], (function (main) { 'use strict'; return main.one.two.three.four; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/000077500000000000000000000000001450520414700320765ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main.js000066400000000000000000000001351450520414700333570ustar00rootroot00000000000000'use strict'; var main = { one: { two: { three: { four: 42 } } } }; module.exports = main; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main2.js000066400000000000000000000001161450520414700334400ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); module.exports = main.one; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main3.js000066400000000000000000000001221450520414700334360ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); module.exports = main.one.two; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main4.js000066400000000000000000000001301450520414700334360ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); module.exports = main.one.two.three; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main5.js000066400000000000000000000001351450520414700334440ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); module.exports = main.one.two.three.four; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/000077500000000000000000000000001450520414700317265ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main.js000066400000000000000000000001231450520414700332040ustar00rootroot00000000000000var main = { one: { two: { three: { four: 42 } } } }; export { main as default }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main2.js000066400000000000000000000001201450520414700332630ustar00rootroot00000000000000import main from './main.js'; var one = main.one; export { one as default }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main3.js000066400000000000000000000001241450520414700332700ustar00rootroot00000000000000import main from './main.js'; var two = main.one.two; export { two as default }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main4.js000066400000000000000000000001361450520414700332740ustar00rootroot00000000000000import main from './main.js'; var three = main.one.two.three; export { three as default }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main5.js000066400000000000000000000001411450520414700332710ustar00rootroot00000000000000import main from './main.js'; var four = main.one.two.three.four; export { four as default }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/system/000077500000000000000000000000001450520414700326435ustar00rootroot00000000000000main.js000066400000000000000000000002721450520414700340470ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', { one: { two: { three: { four: 42 } } } }); }) }; })); main2.js000066400000000000000000000003461450520414700341330ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var main; return { setters: [function (module) { main = module.default; }], execute: (function () { exports('default', main.one); }) }; })); main3.js000066400000000000000000000003521450520414700341310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var main; return { setters: [function (module) { main = module.default; }], execute: (function () { exports('default', main.one.two); }) }; })); main4.js000066400000000000000000000003601450520414700341310ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var main; return { setters: [function (module) { main = module.default; }], execute: (function () { exports('default', main.one.two.three); }) }; })); main5.js000066400000000000000000000003651450520414700341370ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/systemSystem.register(['./main.js'], (function (exports) { 'use strict'; var main; return { setters: [function (module) { main = module.default; }], execute: (function () { exports('default', main.one.two.three.four); }) }; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/main.js000066400000000000000000000000721450520414700306400ustar00rootroot00000000000000export default { one: { two: { three: { four: 42 } } } }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/main2.js000066400000000000000000000000541450520414700307220ustar00rootroot00000000000000export { one as default } from './main.js'; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/main3.js000066400000000000000000000000551450520414700307240ustar00rootroot00000000000000export { two as default } from './main2.js'; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/main4.js000066400000000000000000000000571450520414700307270ustar00rootroot00000000000000export { three as default } from './main3.js'; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/multi-level/main5.js000066400000000000000000000000561450520414700307270ustar00rootroot00000000000000export { four as default } from './main4.js'; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/000077500000000000000000000000001450520414700270545ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_config.js000066400000000000000000000005111450520414700310130ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports re-exported synthetic exports in namespace objects', options: { plugins: [ { name: 'test-plugin', transform(code, id) { if (id.endsWith('synthetic.js')) { return { code, syntheticNamedExports: true }; } } } ] } }); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/000077500000000000000000000000001450520414700310145ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/amd/000077500000000000000000000000001450520414700315555ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/amd/main.js000066400000000000000000000017101450520414700330360ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var synthetic = { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' }; const foo = 'foo'; var synthetic$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: synthetic, foo: foo }, [synthetic]); const bar = 'bar'; var dep = 'not-overwritten'; var dep$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, default: dep, foo: foo, synthetic: synthetic$1 }, [synthetic]); exports.dep = dep$1; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/cjs/000077500000000000000000000000001450520414700315735ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/cjs/main.js000066400000000000000000000015641450520414700330630ustar00rootroot00000000000000'use strict'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var synthetic = { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' }; const foo = 'foo'; var synthetic$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: synthetic, foo: foo }, [synthetic]); const bar = 'bar'; var dep = 'not-overwritten'; var dep$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, default: dep, foo: foo, synthetic: synthetic$1 }, [synthetic]); exports.dep = dep$1; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/es/000077500000000000000000000000001450520414700314235ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/es/main.js000066400000000000000000000015511450520414700327070ustar00rootroot00000000000000function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var synthetic = { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' }; const foo = 'foo'; var synthetic$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: synthetic, foo: foo }, [synthetic]); const bar = 'bar'; var dep = 'not-overwritten'; var dep$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, default: dep, foo: foo, synthetic: synthetic$1 }, [synthetic]); export { dep$1 as dep }; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/system/000077500000000000000000000000001450520414700323405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/system/main.js000066400000000000000000000020771450520414700336300ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var synthetic = { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' }; const foo = 'foo'; var synthetic$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: synthetic, foo: foo }, [synthetic]); const bar = 'bar'; var dep = 'not-overwritten'; var dep$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, default: dep, foo: foo, synthetic: synthetic$1 }, [synthetic]); exports('dep', dep$1); }) }; })); rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/dep.js000066400000000000000000000002111450520414700301540ustar00rootroot00000000000000export * as synthetic from './synthetic.js'; export const bar = 'bar'; export default 'not-overwritten'; export * from './synthetic.js'; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/main.js000066400000000000000000000000411450520414700303310ustar00rootroot00000000000000export * as dep from './dep.js'; rollup-3.29.4/test/chunking-form/samples/synthetic-named-exports/namespace/synthetic.js000066400000000000000000000002201450520414700314160ustar00rootroot00000000000000export default { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' }; export const foo = 'foo'; rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/000077500000000000000000000000001450520414700274405ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_config.js000066400000000000000000000002201450520414700313740ustar00rootroot00000000000000module.exports = defineTest({ description: 'system exports should wrap pure annotations', options: { input: ['main1.js', 'main2.js'] } }); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/000077500000000000000000000000001450520414700314005ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/amd/000077500000000000000000000000001450520414700321415ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002241450520414700351220ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var dep = /*#__PURE__*/ (function() { return 0; })(); exports.dep = dep; })); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/amd/main1.js000066400000000000000000000001371450520414700335050ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('1', dep.dep); })); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/amd/main2.js000066400000000000000000000001371450520414700335060ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('2', dep.dep); })); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/cjs/000077500000000000000000000000001450520414700321575ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001361450520414700351420ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/cjs'use strict'; var dep = /*#__PURE__*/ (function() { return 0; })(); exports.dep = dep; rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/cjs/main1.js000066400000000000000000000001241450520414700335170ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('1', dep.dep); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/cjs/main2.js000066400000000000000000000001241450520414700335200ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('2', dep.dep); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/es/000077500000000000000000000000001450520414700320075ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001211450520414700347640ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/esvar dep = /*#__PURE__*/ (function() { return 0; })(); export { dep as d }; rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/es/main1.js000066400000000000000000000001071450520414700333500ustar00rootroot00000000000000import { d as dep } from './generated-dep.js'; console.log('1', dep); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/es/main2.js000066400000000000000000000001071450520414700333510ustar00rootroot00000000000000import { d as dep } from './generated-dep.js'; console.log('2', dep); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/system/000077500000000000000000000000001450520414700327245ustar00rootroot00000000000000generated-dep.js000066400000000000000000000003051450520414700357050ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var dep = exports('d', /*#__PURE__*/ (function() { return 0; })()); }) }; })); main1.js000066400000000000000000000003271450520414700342120ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var dep; return { setters: [function (module) { dep = module.d; }], execute: (function () { console.log('1', dep); }) }; })); main2.js000066400000000000000000000003271450520414700342130ustar00rootroot00000000000000rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/systemSystem.register(['./generated-dep.js'], (function () { 'use strict'; var dep; return { setters: [function (module) { dep = module.d; }], execute: (function () { console.log('2', dep); }) }; })); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/dep.js000066400000000000000000000001021450520414700305370ustar00rootroot00000000000000export var dep = /*#__PURE__*/ (function() { return 0; })(); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/main1.js000066400000000000000000000000701450520414700310000ustar00rootroot00000000000000import { dep } from './dep.js'; console.log('1', dep); rollup-3.29.4/test/chunking-form/samples/system-exports-wrap-pure-annotation/main2.js000066400000000000000000000000701450520414700310010ustar00rootroot00000000000000import { dep } from './dep.js'; console.log('2', dep); rollup-3.29.4/test/chunking-form/tsconfig.json000066400000000000000000000001701450520414700213630ustar00rootroot00000000000000{ "extends": "../tsconfig.base.json", "include": [ "**/_config.js", "./index.js", "./define.d.ts" ] } rollup-3.29.4/test/cli/000077500000000000000000000000001450520414700146565ustar00rootroot00000000000000rollup-3.29.4/test/cli/define.d.ts000066400000000000000000000001771450520414700167070ustar00rootroot00000000000000import type { TestConfigCli } from '../types'; declare global { function defineTest(config: TestConfigCli): TestConfigCli; } rollup-3.29.4/test/cli/index.js000066400000000000000000000075211450520414700163300ustar00rootroot00000000000000const assert = require('node:assert'); const { exec } = require('node:child_process'); const { existsSync, readFileSync } = require('node:fs'); const { basename, resolve, sep } = require('node:path'); const process = require('node:process'); const { copySync, removeSync, statSync } = require('fs-extra'); const { normaliseOutput, runTestSuiteWithSamples, assertDirectoriesAreEqual } = require('../utils.js'); const cwd = process.cwd(); removeSync(resolve(__dirname, 'node_modules')); copySync(resolve(__dirname, 'node_modules_rename_me'), resolve(__dirname, 'node_modules')); runTestSuiteWithSamples( 'cli', resolve(__dirname, 'samples'), /** * @param {import('../types').TestConfigCli} config */ (directory, config) => { (config.skip ? it.skip : config.solo ? it.only : it)( basename(directory) + ': ' + config.description, async () => { process.chdir(config.cwd || directory); const command = config.command.replace( /(^| )rollup($| )/g, `node ${resolve(__dirname, '../../dist/bin')}${sep}rollup ` ); try { await runTest(config, command); } catch (error) { if (config.retry) { console.error('Initial test run failed: ' + error.message + '\nRETRYING...\n'); return runTest(config, command); } throw error; } } ).timeout(80_000); }, () => process.chdir(cwd) ); async function runTest(config, command) { if (config.before) { await config.before(); } return new Promise((resolve, reject) => { const childProcess = exec( command, { timeout: 40_000, env: { ...process.env, FORCE_COLOR: '0', ...config.env }, killSignal: 'SIGKILL' }, async (error, code, stderr) => { try { if (config.after) { await config.after(error, code, stderr); } if (error && !error.killed) { if (config.error) { if (!config.error(error)) { return resolve(); } } else { return reject(error); } } if (childProcess.signalCode === 'SIGKILL') { return reject(new Error('Test aborted due to timeout.')); } if ('stderr' in config) { const shouldContinue = config.stderr(stderr); if (!shouldContinue) return resolve(); } else if (stderr) { console.error(stderr); } let unintendedError; if (config.execute) { try { const function_ = new Function('require', 'module', 'exports', 'assert', code); const module = { exports: {} }; function_(require, module, module.exports, assert); if (config.error) { unintendedError = new Error('Expected an error while executing output'); } if (config.exports) { config.exports(module.exports); } } catch (error) { if (config.error) { config.error(error); } else { unintendedError = error; } } if (config.show || unintendedError) { console.log(code + '\n\n\n'); } if (config.solo) console.groupEnd(); return unintendedError ? reject(unintendedError) : resolve(); } if (config.result) { config.result(code); return resolve(); } if (config.test) { config.test(); return resolve(); } if (existsSync('_expected') && statSync('_expected').isDirectory()) { assertDirectoriesAreEqual('_actual', '_expected'); return resolve(); } const expected = readFileSync('_expected.js', 'utf8'); assert.equal(normaliseOutput(code), normaliseOutput(expected)); return resolve(); } catch (error) { return reject(error); } } ); childProcess.stderr.on('data', async data => { if (config.abortOnStderr) { try { if (await config.abortOnStderr(data)) { childProcess.kill('SIGTERM'); } } catch (error) { childProcess.kill('SIGTERM'); reject(error); } } }); }); } rollup-3.29.4/test/cli/node_modules/000077500000000000000000000000001450520414700173335ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules/bar/000077500000000000000000000000001450520414700200775ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules/bar/lib/000077500000000000000000000000001450520414700206455ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules/bar/lib/config.js000066400000000000000000000002711450520414700224500ustar00rootroot00000000000000const replace = require('@rollup/plugin-replace'); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/node_modules/bar/package.json000066400000000000000000000000351450520414700223630ustar00rootroot00000000000000{ "main": "lib/config.js" } rollup-3.29.4/test/cli/node_modules/esm-dep/000077500000000000000000000000001450520414700206655ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules/esm-dep/index.js000066400000000000000000000000361450520414700223310ustar00rootroot00000000000000export default 'esm-default'; rollup-3.29.4/test/cli/node_modules/esm-dep/package.json000066400000000000000000000000531450520414700231510ustar00rootroot00000000000000{ "main": "index.js", "type": "module" } rollup-3.29.4/test/cli/node_modules/rollup-config-foo/000077500000000000000000000000001450520414700226745ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules/rollup-config-foo/lib/000077500000000000000000000000001450520414700234425ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules/rollup-config-foo/lib/config.js000066400000000000000000000002711450520414700252450ustar00rootroot00000000000000const replace = require('@rollup/plugin-replace'); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/node_modules/rollup-config-foo/package.json000066400000000000000000000000351450520414700251600ustar00rootroot00000000000000{ "main": "lib/config.js" } rollup-3.29.4/test/cli/node_modules/rollup-plugin-esm-test/000077500000000000000000000000001450520414700237035ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules/rollup-plugin-esm-test/index.mjs000066400000000000000000000003541450520414700255270ustar00rootroot00000000000000export function esmTest() { return { transform(code, id) { if (id.includes("\0")) return null; const name = JSON.stringify(id.replace(/^.*\/advanced-esm\//, "esm-test: ")); return `console.log(${name});\n${code}`; } }; } rollup-3.29.4/test/cli/node_modules/rollup-plugin-esm-test/package.json000066400000000000000000000000561450520414700261720ustar00rootroot00000000000000{ "type": "module", "main": "index.mjs" } rollup-3.29.4/test/cli/node_modules_rename_me/000077500000000000000000000000001450520414700213435ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules_rename_me/bar/000077500000000000000000000000001450520414700221075ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules_rename_me/bar/lib/000077500000000000000000000000001450520414700226555ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules_rename_me/bar/lib/config.js000066400000000000000000000002711450520414700244600ustar00rootroot00000000000000const replace = require('@rollup/plugin-replace'); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/node_modules_rename_me/bar/package.json000066400000000000000000000000351450520414700243730ustar00rootroot00000000000000{ "main": "lib/config.js" } rollup-3.29.4/test/cli/node_modules_rename_me/esm-dep/000077500000000000000000000000001450520414700226755ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules_rename_me/esm-dep/index.js000066400000000000000000000000361450520414700243410ustar00rootroot00000000000000export default 'esm-default'; rollup-3.29.4/test/cli/node_modules_rename_me/esm-dep/package.json000066400000000000000000000000531450520414700251610ustar00rootroot00000000000000{ "main": "index.js", "type": "module" } rollup-3.29.4/test/cli/node_modules_rename_me/rollup-config-foo/000077500000000000000000000000001450520414700247045ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules_rename_me/rollup-config-foo/lib/000077500000000000000000000000001450520414700254525ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules_rename_me/rollup-config-foo/lib/config.js000066400000000000000000000002711450520414700272550ustar00rootroot00000000000000const replace = require('@rollup/plugin-replace'); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/node_modules_rename_me/rollup-config-foo/package.json000066400000000000000000000000351450520414700271700ustar00rootroot00000000000000{ "main": "lib/config.js" } rollup-3.29.4/test/cli/node_modules_rename_me/rollup-plugin-esm-test/000077500000000000000000000000001450520414700257135ustar00rootroot00000000000000rollup-3.29.4/test/cli/node_modules_rename_me/rollup-plugin-esm-test/index.mjs000066400000000000000000000003541450520414700275370ustar00rootroot00000000000000export function esmTest() { return { transform(code, id) { if (id.includes("\0")) return null; const name = JSON.stringify(id.replace(/^.*\/advanced-esm\//, "esm-test: ")); return `console.log(${name});\n${code}`; } }; } rollup-3.29.4/test/cli/node_modules_rename_me/rollup-plugin-esm-test/package.json000066400000000000000000000000561450520414700302020ustar00rootroot00000000000000{ "type": "module", "main": "index.mjs" } rollup-3.29.4/test/cli/samples/000077500000000000000000000000001450520414700163225ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/allow-output-prefix/000077500000000000000000000000001450520414700222715ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/allow-output-prefix/_config.js000066400000000000000000000003001450520414700242240ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows output options to be prefixed with "output."', command: 'rollup main.js --output.format es --output.footer "console.log(\'Rollup!\')"' }); rollup-3.29.4/test/cli/samples/allow-output-prefix/_expected.js000066400000000000000000000000611450520414700245640ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); console.log('Rollup!') rollup-3.29.4/test/cli/samples/allow-output-prefix/main.js000066400000000000000000000000321450520414700235460ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); rollup-3.29.4/test/cli/samples/amd/000077500000000000000000000000001450520414700170635ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/amd/_config.js000066400000000000000000000002361450520414700210260ustar00rootroot00000000000000module.exports = defineTest({ description: 'sets AMD module ID and define function', command: 'rollup -i main.js -f amd --amd.id foo --amd.define defn' }); rollup-3.29.4/test/cli/samples/amd/_expected.js000066400000000000000000000001171450520414700213600ustar00rootroot00000000000000defn('foo', (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/cli/samples/amd/main.js000066400000000000000000000000221450520414700203370ustar00rootroot00000000000000export default 42;rollup-3.29.4/test/cli/samples/banner-intro-outro-footer/000077500000000000000000000000001450520414700233625ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/banner-intro-outro-footer/_config.js000066400000000000000000000003231450520414700253220ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds banner/intro/outro/footer', command: 'rollup -i main.js -f iife --indent --banner "// banner" --intro "// intro" --outro "// outro" --footer "// footer"' }); rollup-3.29.4/test/cli/samples/banner-intro-outro-footer/_expected.js000066400000000000000000000001441450520414700256570ustar00rootroot00000000000000// banner (function () { 'use strict'; // intro console.log( 42 ); // outro })(); // footer rollup-3.29.4/test/cli/samples/banner-intro-outro-footer/main.js000066400000000000000000000000231450520414700246370ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/cli/samples/code-splitting-named-default-inputs/000077500000000000000000000000001450520414700252735ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/code-splitting-named-default-inputs/_config.js000066400000000000000000000010031450520414700272270ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows defining names via CLI', command: 'rollup entry1=main1.js "Entry 2"="main 2.js" "main3.js" --entryFileNames [name]-[hash].js -f es', result(code) { assert.equal( code, '\n' + `//→ entry1-10873415.js:\n` + "console.log('main1');\n" + '\n' + `//→ Entry 2-b2b9d0bf.js:\n` + "console.log('main2');\n" + '\n' + `//→ main3-064cd134.js:\n` + "console.log('main3');\n" ); } }); rollup-3.29.4/test/cli/samples/code-splitting-named-default-inputs/main 2.js000066400000000000000000000000261450520414700266750ustar00rootroot00000000000000console.log('main2'); rollup-3.29.4/test/cli/samples/code-splitting-named-default-inputs/main1.js000066400000000000000000000000261450520414700266340ustar00rootroot00000000000000console.log('main1'); rollup-3.29.4/test/cli/samples/code-splitting-named-default-inputs/main3.js000066400000000000000000000000261450520414700266360ustar00rootroot00000000000000console.log('main3'); rollup-3.29.4/test/cli/samples/code-splitting-named-inputs/000077500000000000000000000000001450520414700236515ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/code-splitting-named-inputs/_config.js000066400000000000000000000010221450520414700256060ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows defining names via CLI', command: 'rollup --entryFileNames [name]-[hash].js --input entry1=main1.js -i "Entry 2"="main 2.js" -i "main3.js" -f es', result(code) { assert.equal( code, '\n' + `//→ entry1-10873415.js:\n` + "console.log('main1');\n" + '\n' + `//→ Entry 2-b2b9d0bf.js:\n` + "console.log('main2');\n" + '\n' + `//→ main3-064cd134.js:\n` + "console.log('main3');\n" ); } }); rollup-3.29.4/test/cli/samples/code-splitting-named-inputs/main 2.js000066400000000000000000000000261450520414700252530ustar00rootroot00000000000000console.log('main2'); rollup-3.29.4/test/cli/samples/code-splitting-named-inputs/main1.js000066400000000000000000000000261450520414700252120ustar00rootroot00000000000000console.log('main1'); rollup-3.29.4/test/cli/samples/code-splitting-named-inputs/main3.js000066400000000000000000000000261450520414700252140ustar00rootroot00000000000000console.log('main3'); rollup-3.29.4/test/cli/samples/config-async-function/000077500000000000000000000000001450520414700225255ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-async-function/_config.js000066400000000000000000000001641450520414700244700ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports using an async function as config', command: 'rollup -c' }); rollup-3.29.4/test/cli/samples/config-async-function/_expected.js000066400000000000000000000000661450520414700250250ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/cli/samples/config-async-function/main.js000066400000000000000000000000231450520414700240020ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/config-async-function/rollup.config.mjs000066400000000000000000000001461450520414700260220ustar00rootroot00000000000000export default async () => ({ input: 'main.js', output: { format: 'cjs', exports: 'auto' } }); rollup-3.29.4/test/cli/samples/config-cjs-dirname/000077500000000000000000000000001450520414700217615ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-cjs-dirname/_config.js000066400000000000000000000002101450520414700237140ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not transpile cjs configs and provides correct __filename', command: 'rollup -c' }); rollup-3.29.4/test/cli/samples/config-cjs-dirname/_expected.js000066400000000000000000000001471450520414700242610ustar00rootroot00000000000000console.log('nested/plugin.js'); console.log('plugin.js'); var main = 42; export { main as default }; rollup-3.29.4/test/cli/samples/config-cjs-dirname/main.js000066400000000000000000000000231450520414700232360ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/config-cjs-dirname/nested/000077500000000000000000000000001450520414700232435ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-cjs-dirname/nested/plugin.js000066400000000000000000000002771450520414700251050ustar00rootroot00000000000000const path = require('path'); module.exports = () => ({ transform(code) { return `console.log('${path .relative(process.cwd(), __filename) .replace('\\', '/')}');\n${code}`; } }); rollup-3.29.4/test/cli/samples/config-cjs-dirname/plugin.js000066400000000000000000000002771450520414700236230ustar00rootroot00000000000000const path = require('path'); module.exports = () => ({ transform(code) { return `console.log('${path .relative(process.cwd(), __filename) .replace('\\', '/')}');\n${code}`; } }); rollup-3.29.4/test/cli/samples/config-cjs-dirname/rollup.config.cjs000066400000000000000000000003001450520414700252340ustar00rootroot00000000000000const plugin = require('./plugin'); const nestedPlugin = require('./nested/plugin'); module.exports = { input: 'main.js', output: { format: 'esm' }, plugins: [plugin(), nestedPlugin()] }; rollup-3.29.4/test/cli/samples/config-cwd-case-insensitive-es6/000077500000000000000000000000001450520414700243045ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-cwd-case-insensitive-es6/_config.js000066400000000000000000000004671450520414700262550ustar00rootroot00000000000000function toggleCase(s) { return s == s.toLowerCase() ? s.toUpperCase() : s.toLowerCase(); } module.exports = defineTest({ onlyWindows: true, description: "can load ES6 config with cwd that doesn't match realpath", command: 'rollup -c', cwd: __dirname.replace(/^[a-z]:\\/i, toggleCase), execute: true }); rollup-3.29.4/test/cli/samples/config-cwd-case-insensitive-es6/main.js000066400000000000000000000000341450520414700255630ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-cwd-case-insensitive-es6/rollup.config.mjs000066400000000000000000000002621450520414700276000ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/samples/config-cwd-case-insensitive/000077500000000000000000000000001450520414700236115ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-cwd-case-insensitive/_config.js000066400000000000000000000004631450520414700255560ustar00rootroot00000000000000function toggleCase(s) { return s == s.toLowerCase() ? s.toUpperCase() : s.toLowerCase(); } module.exports = defineTest({ onlyWindows: true, description: "can load config with cwd that doesn't match realpath", command: 'rollup -c', cwd: __dirname.replace(/^[a-z]:\\/i, toggleCase), execute: true }); rollup-3.29.4/test/cli/samples/config-cwd-case-insensitive/main.js000066400000000000000000000000341450520414700250700ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-cwd-case-insensitive/rollup.config.js000066400000000000000000000002671450520414700267350ustar00rootroot00000000000000var replace = require('@rollup/plugin-replace'); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/samples/config-defineConfig-cjs/000077500000000000000000000000001450520414700227225ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-defineConfig-cjs/_config.js000066400000000000000000000002611450520414700246630ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses cjs config file which return config wrapped by defineConfig', command: 'rollup --config rollup.config.js', execute: true }); rollup-3.29.4/test/cli/samples/config-defineConfig-cjs/main.js000066400000000000000000000000251450520414700242010ustar00rootroot00000000000000module.exports = 42; rollup-3.29.4/test/cli/samples/config-defineConfig-cjs/rollup.config.js000066400000000000000000000002231450520414700260360ustar00rootroot00000000000000const { defineConfig } = require('../../../../dist/rollup'); module.exports = defineConfig({ input: 'main.js', output: { format: 'cjs' } }); rollup-3.29.4/test/cli/samples/config-defineConfig-mjs/000077500000000000000000000000001450520414700227345ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-defineConfig-mjs/_config.js000066400000000000000000000002621450520414700246760ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses mjs config file which return config wrapped by defineConfig', command: 'rollup --config rollup.config.mjs', execute: true }); rollup-3.29.4/test/cli/samples/config-defineConfig-mjs/main.js000066400000000000000000000000251450520414700242130ustar00rootroot00000000000000module.exports = 42; rollup-3.29.4/test/cli/samples/config-defineConfig-mjs/rollup.config.mjs000066400000000000000000000002221450520414700262240ustar00rootroot00000000000000import { defineConfig } from "../../../../dist/es/rollup.js" export default defineConfig({ input: 'main.js', output: { format: 'cjs' }, }); rollup-3.29.4/test/cli/samples/config-env-multiple/000077500000000000000000000000001450520414700222065ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-env-multiple/_config.js000066400000000000000000000004051450520414700241470ustar00rootroot00000000000000module.exports = defineTest({ description: 'passes environment variables to config file via multiple --environment values', command: 'rollup --config --environment PRODUCTION,FOO:bar --environment SECOND,KEY:value --environment FOO:foo', execute: true }); rollup-3.29.4/test/cli/samples/config-env-multiple/main.js000066400000000000000000000002311450520414700234640ustar00rootroot00000000000000assert.equal( '__ENVIRONMENT__', 'production' ); assert.equal( '__FOO__', 'foo' ); assert.equal('__SECOND__', 'true'); assert.equal('__KEY__', "value"); rollup-3.29.4/test/cli/samples/config-env-multiple/rollup.config.js000066400000000000000000000005351450520414700253300ustar00rootroot00000000000000var replace = require('@rollup/plugin-replace'); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace({ preventAssignment: true, __ENVIRONMENT__: process.env.PRODUCTION ? 'production' : 'development', __FOO__: process.env.FOO, __SECOND__: process.env.SECOND, __KEY__: process.env.KEY }) ] }; rollup-3.29.4/test/cli/samples/config-env/000077500000000000000000000000001450520414700203555ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-env/_config.js000066400000000000000000000003071450520414700223170ustar00rootroot00000000000000module.exports = defineTest({ description: 'passes environment variables to config file', command: 'rollup --config --environment PRODUCTION,FOO:bar,HOST:http://localhost:4000', execute: true }); rollup-3.29.4/test/cli/samples/config-env/main.js000066400000000000000000000002101450520414700216300ustar00rootroot00000000000000assert.equal( '__ENVIRONMENT__', 'production' ); assert.equal( '__FOO__', 'bar' ); assert.equal( '__HOST__', 'http://localhost:4000' ); rollup-3.29.4/test/cli/samples/config-env/rollup.config.js000066400000000000000000000004741450520414700235010ustar00rootroot00000000000000var replace = require('@rollup/plugin-replace'); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace({ preventAssignment: true, __ENVIRONMENT__: process.env.PRODUCTION ? 'production' : 'development', __FOO__: process.env.FOO, __HOST__: process.env.HOST }) ] }; rollup-3.29.4/test/cli/samples/config-es6/000077500000000000000000000000001450520414700202625ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-es6/_config.js000066400000000000000000000002401450520414700222200ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses ES6 module config file', command: 'rollup --config rollup.config.js --bundleConfigAsCjs', execute: true }); rollup-3.29.4/test/cli/samples/config-es6/main.js000066400000000000000000000000341450520414700215410ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-es6/rollup.config.js000066400000000000000000000003411450520414700233770ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export const ignoresNonDefaultExports = true; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/samples/config-external-function/000077500000000000000000000000001450520414700232325ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-external-function/_config.js000066400000000000000000000002131450520414700251700ustar00rootroot00000000000000module.exports = defineTest({ description: 'external option gets passed from config', command: 'rollup -c -e assert,external-module' }); rollup-3.29.4/test/cli/samples/config-external-function/_expected.js000066400000000000000000000003051450520414700255260ustar00rootroot00000000000000'use strict'; var _config_js = require('./_config.js'); var assert = require('assert'); var externalModule = require('external-module'); assert.ok( _config_js.execute ); externalModule.method(); rollup-3.29.4/test/cli/samples/config-external-function/main.js000066400000000000000000000002111450520414700245060ustar00rootroot00000000000000import { execute } from './_config.js'; import { ok } from 'assert'; import { method } from 'external-module'; ok( execute ); method(); rollup-3.29.4/test/cli/samples/config-external-function/rollup.config.mjs000066400000000000000000000004421450520414700265260ustar00rootroot00000000000000import assert from 'assert'; import { resolve } from 'path'; var config = resolve('./_config.js'); export default { input: 'main.js', output: { format: 'cjs' }, external(id) { return id === config; }, plugins: [ { load(id) { assert.notEqual(id, config); } } ] }; rollup-3.29.4/test/cli/samples/config-external/000077500000000000000000000000001450520414700214075ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-external/_config.js000066400000000000000000000001611450520414700233470ustar00rootroot00000000000000module.exports = defineTest({ description: 'external option gets passed from config', command: 'rollup -c' }); rollup-3.29.4/test/cli/samples/config-external/_expected.js000066400000000000000000000001731450520414700237060ustar00rootroot00000000000000'use strict'; var _config_js = require('./_config.js'); var assert = require('assert'); assert.ok( _config_js.execute ); rollup-3.29.4/test/cli/samples/config-external/main.js000066400000000000000000000001251450520414700226670ustar00rootroot00000000000000import { execute } from './_config.js'; import { ok } from 'assert'; ok( execute ); rollup-3.29.4/test/cli/samples/config-external/rollup.config.mjs000066400000000000000000000004251450520414700247040ustar00rootroot00000000000000import assert from 'assert'; import { resolve } from 'path'; var config = resolve('./_config.js'); export default { input: 'main.js', output: { format: 'cjs' }, external: ['assert', config], plugins: [ { load(id) { assert.notEqual(id, config); } } ] }; rollup-3.29.4/test/cli/samples/config-function-modify-command/000077500000000000000000000000001450520414700243135ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-function-modify-command/_config.js000066400000000000000000000003361450520414700262570ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows cleaning up and modifying the command args in the config file', command: 'rollup --config rollup.config.mjs --some-option="foo" --another-option=42', execute: true }); rollup-3.29.4/test/cli/samples/config-function-modify-command/main.js000066400000000000000000000002241450520414700255730ustar00rootroot00000000000000assert.deepEqual(COMMAND_OPTIONS, { _: [], config: 'rollup.config.mjs', c: 'rollup.config.mjs', 'some-option': 'foo', 'another-option': 42 }); rollup-3.29.4/test/cli/samples/config-function-modify-command/rollup.config.mjs000066400000000000000000000006731450520414700276150ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default commandOptions => { const COMMAND_OPTIONS = JSON.stringify(commandOptions); delete commandOptions['some-option']; delete commandOptions['another-option']; commandOptions.format = 'cjs'; return { input: 'main.js', onwarn(warning) { throw new Error(`Unexpected warning: ${warning.message}`); }, plugins: [replace({ preventAssignment: true, COMMAND_OPTIONS })] }; }; rollup-3.29.4/test/cli/samples/config-function/000077500000000000000000000000001450520414700214125ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-function/_config.js000066400000000000000000000003211450520414700233500ustar00rootroot00000000000000module.exports = defineTest({ description: 'if the config file returns a function then this will be called with the command args', command: 'rollup --config rollup.config.mjs --silent', execute: true }); rollup-3.29.4/test/cli/samples/config-function/main.js000066400000000000000000000001651450520414700226760ustar00rootroot00000000000000assert.deepEqual(COMMAND_OPTIONS, { _: [], config: 'rollup.config.mjs', c: 'rollup.config.mjs', silent: true }); rollup-3.29.4/test/cli/samples/config-function/rollup.config.mjs000066400000000000000000000006341450520414700247110ustar00rootroot00000000000000import assert from 'assert'; import replace from '@rollup/plugin-replace'; export default commandOptions => { assert.equal(commandOptions.silent, true); return { input: 'main.js', output: { format: 'cjs' }, onwarn(warning) { throw new Error(`Unexpected warning: ${warning.message}`); }, plugins: [replace({ preventAssignment: true, COMMAND_OPTIONS: JSON.stringify(commandOptions) })] }; }; rollup-3.29.4/test/cli/samples/config-import-meta/000077500000000000000000000000001450520414700220235ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-import-meta/_config.js000066400000000000000000000002121450520414700237600ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses correct import.meta.url in config files', command: 'rollup -c --bundleConfigAsCjs' }); rollup-3.29.4/test/cli/samples/config-import-meta/_expected.js000066400000000000000000000000541450520414700243200ustar00rootroot00000000000000var test = 'test text'; console.log(test); rollup-3.29.4/test/cli/samples/config-import-meta/main.js000066400000000000000000000000551450520414700233050ustar00rootroot00000000000000import test from 'test'; console.log(test); rollup-3.29.4/test/cli/samples/config-import-meta/plugin/000077500000000000000000000000001450520414700233215ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-import-meta/plugin/plugin.js000066400000000000000000000012311450520414700251520ustar00rootroot00000000000000import { fileURLToPath } from 'url'; import { dirname, resolve } from 'path'; import { readFileSync } from 'fs'; import assert from 'assert'; const __dirname = dirname(fileURLToPath(import.meta.url)); const id = 'test'; const fileName = `test.txt`; function validateImportMeta(importMeta) { assert.strictEqual(importMeta.url, import.meta.url); } validateImportMeta(import.meta); assert.strictEqual(import.meta.foo, undefined); export default () => ({ resolveId(source) { if (source === id) { return source; } }, load(loadedId) { if (loadedId === id) { return `export default '${readFileSync(resolve(__dirname, fileName), 'utf8')}';`; } } }); rollup-3.29.4/test/cli/samples/config-import-meta/plugin/test.txt000066400000000000000000000000111450520414700250310ustar00rootroot00000000000000test textrollup-3.29.4/test/cli/samples/config-import-meta/rollup.config.js000066400000000000000000000002041450520414700251360ustar00rootroot00000000000000import plugin from './plugin/plugin.js'; export default { input: 'main.js', output: { format: 'es' }, plugins: [plugin()] }; rollup-3.29.4/test/cli/samples/config-json/000077500000000000000000000000001450520414700205365ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-json/_config.js000066400000000000000000000002461450520414700225020ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows config file to import json', command: 'rollup --config rollup.config.js --bundleConfigAsCjs', execute: true }); rollup-3.29.4/test/cli/samples/config-json/main.js000066400000000000000000000000501450520414700220130ustar00rootroot00000000000000assert.equal( '__VERSION__', '0.0.1' ); rollup-3.29.4/test/cli/samples/config-json/package.json000066400000000000000000000000271450520414700230230ustar00rootroot00000000000000{ "version": "0.0.1" }rollup-3.29.4/test/cli/samples/config-json/rollup.config.js000066400000000000000000000003561450520414700236610ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; import package_ from './package.json'; module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, __VERSION__: package_.version })] }; rollup-3.29.4/test/cli/samples/config-missing-export/000077500000000000000000000000001450520414700225555ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-missing-export/_config.js000066400000000000000000000004041450520414700245150ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'throws error if config does not export an object', command: 'rollup -c', error(error) { assert.ok(/Config file must export an options object/.test(error.message)); } }); rollup-3.29.4/test/cli/samples/config-missing-export/rollup.config.js000066400000000000000000000000531450520414700256720ustar00rootroot00000000000000/* eslint-disable unicorn/no-empty-file */ rollup-3.29.4/test/cli/samples/config-mjs-plugins/000077500000000000000000000000001450520414700220355ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-mjs-plugins/_config.js000066400000000000000000000002201450520414700237710ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports native esm as well as CJS plugins when using .mjs in Node 13+', command: 'rollup -c' }); rollup-3.29.4/test/cli/samples/config-mjs-plugins/_expected.js000066400000000000000000000002071450520414700243320ustar00rootroot00000000000000#!/usr/bin/env node 'use strict'; console.log('nested/plugin.mjs'); console.log('plugin.mjs'); var main = 42; module.exports = main; rollup-3.29.4/test/cli/samples/config-mjs-plugins/main.js000066400000000000000000000000271450520414700233160ustar00rootroot00000000000000export default ANSWER; rollup-3.29.4/test/cli/samples/config-mjs-plugins/nested/000077500000000000000000000000001450520414700233175ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-mjs-plugins/nested/plugin.mjs000066400000000000000000000003661450520414700253350ustar00rootroot00000000000000import { relative } from 'path'; import { fileURLToPath } from 'url'; export default () => ({ transform(code) { return `console.log('${relative(process.cwd(), fileURLToPath(import.meta.url)).replace( '\\', '/' )}');\n${code}`; } }); rollup-3.29.4/test/cli/samples/config-mjs-plugins/plugin.mjs000066400000000000000000000003661450520414700240530ustar00rootroot00000000000000import { relative } from 'path'; import { fileURLToPath } from 'url'; export default () => ({ transform(code) { return `console.log('${relative(process.cwd(), fileURLToPath(import.meta.url)).replace( '\\', '/' )}');\n${code}`; } }); rollup-3.29.4/test/cli/samples/config-mjs-plugins/rollup.config.mjs000066400000000000000000000005531450520414700253340ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; import { shebang } from 'rollup-plugin-thatworks'; import nestedPlugin from './nested/plugin.mjs'; import plugin from './plugin.mjs'; export default { input: 'main.js', output: { format: 'cjs', exports: 'auto' }, plugins: [shebang(), replace({ preventAssignment: true, ANSWER: 42 }), plugin(), nestedPlugin()] }; rollup-3.29.4/test/cli/samples/config-mjs/000077500000000000000000000000001450520414700203565ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-mjs/_config.js000066400000000000000000000002111450520414700223120ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses config file (.mjs)', command: 'rollup --config rollup.config.mjs', execute: true }); rollup-3.29.4/test/cli/samples/config-mjs/main.js000066400000000000000000000000341450520414700216350ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-mjs/rollup.config.mjs000066400000000000000000000002711450520414700236520ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, ANSWER: 42 } ) ] }; rollup-3.29.4/test/cli/samples/config-multiple-getfilename/000077500000000000000000000000001450520414700236765ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-multiple-getfilename/_config.js000066400000000000000000000002011450520414700256310ustar00rootroot00000000000000module.exports = defineTest({ description: 'returns correct file names for multiple outputs (#3467)', command: 'rollup -c' }); rollup-3.29.4/test/cli/samples/config-multiple-getfilename/_expected/000077500000000000000000000000001450520414700256365ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-multiple-getfilename/_expected/cjs-main.js000066400000000000000000000000661450520414700276770ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/cli/samples/config-multiple-getfilename/_expected/cjs.txt000066400000000000000000000000131450520414700271500ustar00rootroot00000000000000cjs-main.jsrollup-3.29.4/test/cli/samples/config-multiple-getfilename/_expected/es-main.js000066400000000000000000000000541450520414700275240ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/cli/samples/config-multiple-getfilename/_expected/es.txt000066400000000000000000000000121450520414700267770ustar00rootroot00000000000000es-main.jsrollup-3.29.4/test/cli/samples/config-multiple-getfilename/main.js000066400000000000000000000000231450520414700251530ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/config-multiple-getfilename/rollup.config.mjs000066400000000000000000000010261450520414700271710ustar00rootroot00000000000000let fileReference; export default { input: 'main.js', plugins: { name: 'test', buildStart() { fileReference = this.emitFile({ type: 'chunk', id: 'main.js' }); }, generateBundle(options) { this.emitFile({ type: 'asset', fileName: `${options.format}.txt`, source: this.getFileName(fileReference) }); } }, output: [ { format: 'es', dir: '_actual', entryFileNames: 'es-[name].js' }, { format: 'cjs', dir: '_actual', entryFileNames: 'cjs-[name].js', exports: 'auto' } ] }; rollup-3.29.4/test/cli/samples/config-multiple-source-maps/000077500000000000000000000000001450520414700236545ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-multiple-source-maps/_config.js000066400000000000000000000002211450520414700256110ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly generates sourcemaps for multiple outputs', command: 'rollup -c --bundleConfigAsCjs' }); rollup-3.29.4/test/cli/samples/config-multiple-source-maps/_expected/000077500000000000000000000000001450520414700256145ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-multiple-source-maps/_expected/main-cjs.js000066400000000000000000000001201450520414700276440ustar00rootroot00000000000000'use strict'; assert.equal( ANSWER, 42 ); //# sourceMappingURL=main-cjs.js.map rollup-3.29.4/test/cli/samples/config-multiple-source-maps/_expected/main-cjs.js.map000066400000000000000000000002671450520414700304340ustar00rootroot00000000000000{"version":3,"file":"main-cjs.js","sources":["../main.js"],"sourcesContent":["assert.equal( ANSWER, 42 );\n"],"names":[],"mappings":";;AAAA,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;;"}rollup-3.29.4/test/cli/samples/config-multiple-source-maps/_expected/main-es.js000066400000000000000000000001001450520414700274720ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); //# sourceMappingURL=main-es.js.map rollup-3.29.4/test/cli/samples/config-multiple-source-maps/_expected/main-es.js.map000066400000000000000000000002621450520414700302570ustar00rootroot00000000000000{"version":3,"file":"main-es.js","sources":["../main.js"],"sourcesContent":["assert.equal( ANSWER, 42 );\n"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE"}rollup-3.29.4/test/cli/samples/config-multiple-source-maps/main.js000066400000000000000000000000341450520414700251330ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-multiple-source-maps/rollup.config.js000066400000000000000000000004071450520414700267740ustar00rootroot00000000000000export default { input: 'main.js', output: [ { format: 'cjs', dir: '_actual', entryFileNames: '[name]-[format].js', sourcemap: true }, { format: 'es', dir: '_actual', entryFileNames: '[name]-[format].js', sourcemap: true } ] }; rollup-3.29.4/test/cli/samples/config-no-output/000077500000000000000000000000001450520414700215375ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-no-output/_config.js000066400000000000000000000005301450520414700234770ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync, unlinkSync } = require('node:fs'); module.exports = defineTest({ description: 'uses -o from CLI', command: 'rollup -c -o output.js', test() { const output = readFileSync('output.js', 'utf8'); assert.equal(output.trim(), 'console.log(42);'); unlinkSync('output.js'); } }); rollup-3.29.4/test/cli/samples/config-no-output/main.js000066400000000000000000000000201450520414700230110ustar00rootroot00000000000000console.log(42);rollup-3.29.4/test/cli/samples/config-no-output/rollup.config.mjs000066400000000000000000000001041450520414700250260ustar00rootroot00000000000000export default { input: 'main.js', output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/config-override/000077500000000000000000000000001450520414700214045ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-override/_config.js000066400000000000000000000002351450520414700233460ustar00rootroot00000000000000module.exports = defineTest({ description: 'overrides config file with command line arguments', command: 'rollup -c -i main.js -f cjs', execute: true }); rollup-3.29.4/test/cli/samples/config-override/main.js000066400000000000000000000000341450520414700226630ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-override/rollup.config.mjs000066400000000000000000000002621450520414700247000ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'nope.js', output: { format: 'amd' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/samples/config-plugin-entry/000077500000000000000000000000001450520414700222225ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-plugin-entry/_config.js000066400000000000000000000002011450520414700241550ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows plugins to set options.entry', command: 'rollup -c --bundleConfigAsCjs' }); rollup-3.29.4/test/cli/samples/config-plugin-entry/_expected.js000066400000000000000000000000201450520414700245100ustar00rootroot00000000000000console.log(42);rollup-3.29.4/test/cli/samples/config-plugin-entry/main.js000066400000000000000000000000201450520414700234740ustar00rootroot00000000000000console.log(42);rollup-3.29.4/test/cli/samples/config-plugin-entry/rollup.config.js000066400000000000000000000002061450520414700253370ustar00rootroot00000000000000export default { output: { format: 'es' }, plugins: [ { options: options => { options.input = 'main.js'; } } ] }; rollup-3.29.4/test/cli/samples/config-promise-cjs/000077500000000000000000000000001450520414700220205ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-promise-cjs/_config.js000066400000000000000000000002361450520414700237630ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses cjs config file which returns a Promise', command: 'rollup --config rollup.config.cjs', execute: true }); rollup-3.29.4/test/cli/samples/config-promise-cjs/main.js000066400000000000000000000000341450520414700232770ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-promise-cjs/rollup.config.cjs000066400000000000000000000003121450520414700252760ustar00rootroot00000000000000const replace = require('@rollup/plugin-replace'); module.exports = Promise.resolve({ input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }); rollup-3.29.4/test/cli/samples/config-promise-mjs/000077500000000000000000000000001450520414700220325ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-promise-mjs/_config.js000066400000000000000000000002361450520414700237750ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses mjs config file which returns a Promise', command: 'rollup --config rollup.config.mjs', execute: true }); rollup-3.29.4/test/cli/samples/config-promise-mjs/main.js000066400000000000000000000000341450520414700233110ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-promise-mjs/rollup.config.mjs000066400000000000000000000003031450520414700253220ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default Promise.resolve({ input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }); rollup-3.29.4/test/cli/samples/config-promise/000077500000000000000000000000001450520414700212435ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-promise/_config.js000066400000000000000000000002321450520414700232020ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses config file which returns a Promise', command: 'rollup --config rollup.config.mjs', execute: true }); rollup-3.29.4/test/cli/samples/config-promise/main.js000066400000000000000000000000341450520414700225220ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-promise/rollup.config.mjs000066400000000000000000000003371450520414700245420ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export const ignored = 'forces named exports mode'; export default Promise.resolve({ input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ ANSWER: 42 })] }); rollup-3.29.4/test/cli/samples/config-true/000077500000000000000000000000001450520414700205445ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-true/_config.js000066400000000000000000000002121450520414700225010ustar00rootroot00000000000000module.exports = defineTest({ description: 'defaults to rollup.config.js', command: 'rollup -c --bundleConfigAsCjs', execute: true }); rollup-3.29.4/test/cli/samples/config-true/main.js000066400000000000000000000000341450520414700220230ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config-true/rollup.config.js000066400000000000000000000002621450520414700236630ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/samples/config-ts/000077500000000000000000000000001450520414700202135ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-ts/_config.js000066400000000000000000000003051450520414700221530ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports loading TypeScript config files via plugin option', command: 'rollup --config rollup.config.ts --configPlugin typescript', execute: true }); rollup-3.29.4/test/cli/samples/config-ts/main.js000066400000000000000000000000231450520414700214700ustar00rootroot00000000000000assert.ok( true ); rollup-3.29.4/test/cli/samples/config-ts/rollup.config.ts000066400000000000000000000002571450520414700233500ustar00rootroot00000000000000import { RollupOptions } from '../../../../dist/rollup'; const options: RollupOptions = { input: 'main.js', output: { format: 'cjs' } }; export { options as default }; rollup-3.29.4/test/cli/samples/config-type-module/000077500000000000000000000000001450520414700220315ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-type-module/_config.js000066400000000000000000000012001450520414700237640ustar00rootroot00000000000000// @ts-expect-error not included in types const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'tries to load .js config file if package type is "module"', command: 'cd sub && rollup -c rollup.config.js', error: () => true, stderr: stderr => { assertIncludes( stderr, 'ReferenceError: module is not defined in ES module scope\n' + "This file is being treated as an ES module because it has a '.js' file extension and" ); assertIncludes( stderr, 'contains "type": "module". To treat it as a CommonJS script, rename it to use the \'.cjs\' file extension.' ); } }); rollup-3.29.4/test/cli/samples/config-type-module/sub/000077500000000000000000000000001450520414700226225ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-type-module/sub/main.js000066400000000000000000000000211450520414700240750ustar00rootroot00000000000000console.log(42); rollup-3.29.4/test/cli/samples/config-type-module/sub/package.json000066400000000000000000000000261450520414700251060ustar00rootroot00000000000000{ "type": "module" } rollup-3.29.4/test/cli/samples/config-type-module/sub/rollup.config.js000066400000000000000000000001071450520414700257370ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'cjs' } }; rollup-3.29.4/test/cli/samples/config-warnings/000077500000000000000000000000001450520414700214155ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-warnings/_config.js000066400000000000000000000005121450520414700233550ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'displays warnings when a config is loaded', command: 'rollup -c --bundleConfigAsCjs', stderr: stderr => assertIncludes( stderr, 'loaded rollup.config.js with warnings\n(!) Use of eval is strongly discouraged' ) }); rollup-3.29.4/test/cli/samples/config-warnings/_expected.js000066400000000000000000000000001450520414700237010ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config-warnings/main.js000066400000000000000000000000231450520414700226720ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/config-warnings/rollup.config.js000066400000000000000000000001151450520414700245310ustar00rootroot00000000000000export default { input: eval('"main.js"'), output: { format: 'cjs' } }; rollup-3.29.4/test/cli/samples/config/000077500000000000000000000000001450520414700175675ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/config/_config.js000066400000000000000000000002011450520414700215220ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses config file', command: 'rollup --config rollup.config.js', execute: true }); rollup-3.29.4/test/cli/samples/config/main.js000066400000000000000000000000341450520414700210460ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/config/rollup.config.js000066400000000000000000000002671450520414700227130ustar00rootroot00000000000000var replace = require('@rollup/plugin-replace'); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/samples/context/000077500000000000000000000000001450520414700200065ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/context/_config.js000066400000000000000000000002241450520414700217460ustar00rootroot00000000000000module.exports = defineTest({ description: 'Uses --context to set `this` value', command: 'rollup main.js --format commonjs --context window' }); rollup-3.29.4/test/cli/samples/context/_expected.js000066400000000000000000000001101450520414700222740ustar00rootroot00000000000000'use strict'; console.log(window); const foo = 42; exports.foo = foo; rollup-3.29.4/test/cli/samples/context/main.js000066400000000000000000000000521450520414700212650ustar00rootroot00000000000000console.log(this); export const foo = 42; rollup-3.29.4/test/cli/samples/custom-frame-with-pos/000077500000000000000000000000001450520414700224745ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/custom-frame-with-pos/_config.js000066400000000000000000000005671450520414700244460ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'custom (plugin generated) code frame taking priority over pos generated one', command: 'rollup -c', error: () => true, stderr: stderr => assertIncludes( stderr, '[!] (plugin at position 1) Error: My error.\n' + 'main.js (1:5)\n' + 'custom code frame\n' ) }); rollup-3.29.4/test/cli/samples/custom-frame-with-pos/main.js000066400000000000000000000000461450520414700237560ustar00rootroot00000000000000console.log("everyday I'm throwing"); rollup-3.29.4/test/cli/samples/custom-frame-with-pos/rollup.config.js000066400000000000000000000004031450520414700256100ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ { transform() { const error = new Error('My error.'); error.frame = 'custom code frame'; this.error(error, { line: 1, column: 5 }); } } ] }; rollup-3.29.4/test/cli/samples/custom-frame/000077500000000000000000000000001450520414700207245ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/custom-frame/_config.js000066400000000000000000000006601450520414700226700ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'errors with plugin generated code frames also contain stack', command: 'rollup -c', error: () => true, stderr: stderr => { assertIncludes( stderr, '[!] (plugin at position 1) Error: My error.\n' + 'main.js\ncustom code frame\n' + ' at Object.' ); assertIncludes(stderr, 'rollup.config.js:9:19'); } }); rollup-3.29.4/test/cli/samples/custom-frame/main.js000066400000000000000000000000461450520414700222060ustar00rootroot00000000000000console.log("everyday I'm throwing"); rollup-3.29.4/test/cli/samples/custom-frame/rollup.config.js000066400000000000000000000003351450520414700240440ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ { transform() { const error = new Error('My error.'); error.frame = 'custom code frame'; this.error(error); } } ] }; rollup-3.29.4/test/cli/samples/deconflict-entry-point-in-subdir/000077500000000000000000000000001450520414700246145ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/deconflict-entry-point-in-subdir/_config.js000066400000000000000000000003101450520414700265500ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflict entry points with the same name in different directories', command: 'rollup --input main.js --input sub/main.js --format es --dir _actual' }); rollup-3.29.4/test/cli/samples/deconflict-entry-point-in-subdir/_expected/000077500000000000000000000000001450520414700265545ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/deconflict-entry-point-in-subdir/_expected/main.js000066400000000000000000000000251450520414700300330ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/cli/samples/deconflict-entry-point-in-subdir/_expected/main2.js000066400000000000000000000000241450520414700301140ustar00rootroot00000000000000console.log('sub'); rollup-3.29.4/test/cli/samples/deconflict-entry-point-in-subdir/main.js000066400000000000000000000000251450520414700260730ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/cli/samples/deconflict-entry-point-in-subdir/sub/000077500000000000000000000000001450520414700254055ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/deconflict-entry-point-in-subdir/sub/main.js000066400000000000000000000000241450520414700266630ustar00rootroot00000000000000console.log('sub'); rollup-3.29.4/test/cli/samples/duplicate-import-options/000077500000000000000000000000001450520414700232755ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/duplicate-import-options/_config.js000066400000000000000000000005241450520414700252400ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'throws if different types of entries are combined', command: 'rollup main.js --format es --input main.js', error: () => true, stderr(stderr) { assertIncludes(stderr, '[!] Either use --input, or pass input path as argument'); } }); rollup-3.29.4/test/cli/samples/duplicate-import-options/main.js000066400000000000000000000000321450520414700245520ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); rollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/000077500000000000000000000000001450520414700227655ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/_config.js000066400000000000000000000002021450520414700247210ustar00rootroot00000000000000module.exports = defineTest({ description: 'writes files emitted by plugins in different output dirs', command: 'rollup -c' }); rollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/_expected/000077500000000000000000000000001450520414700247255ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/_expected/dist1/000077500000000000000000000000001450520414700257515ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/_expected/dist1/main.js000066400000000000000000000000531450520414700272310ustar00rootroot00000000000000'use strict'; assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/_expected/dist1/myfile000066400000000000000000000000031450520414700271520ustar00rootroot00000000000000abcrollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/_expected/dist2/000077500000000000000000000000001450520414700257525ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/_expected/dist2/main.js000066400000000000000000000000341450520414700272310ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/_expected/dist2/myfile000066400000000000000000000000031450520414700271530ustar00rootroot00000000000000abcrollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/main.js000066400000000000000000000000341450520414700242440ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/emit-file-multiple-dirs/rollup.config.mjs000066400000000000000000000004251450520414700262620ustar00rootroot00000000000000export default { input: 'main.js', output: [ { dir: '_actual/dist1', format: 'cjs' }, { dir: '_actual/dist2', format: 'es' } ], plugins: [ { generateBundle() { this.emitFile({ type: 'asset', fileName: 'myfile', source: 'abc' }); } } ] }; rollup-3.29.4/test/cli/samples/empty-chunk-multiple/000077500000000000000000000000001450520414700224175ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/empty-chunk-multiple/_config.js000066400000000000000000000004361450520414700243640ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'shows warning when multiple chunks empty', command: 'rollup -c', error: () => true, stderr: stderr => assertIncludes(stderr, '(!) Generated empty chunks\n"main1" and "main2"') }); rollup-3.29.4/test/cli/samples/empty-chunk-multiple/main1.js000066400000000000000000000000001450520414700237500ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/empty-chunk-multiple/main2.js000066400000000000000000000000001450520414700237510ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/empty-chunk-multiple/rollup.config.js000066400000000000000000000001261450520414700255350ustar00rootroot00000000000000module.exports = { input: ['main1.js', 'main2.js'], output: { format: 'cjs' } }; rollup-3.29.4/test/cli/samples/empty-chunk/000077500000000000000000000000001450520414700205665ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/empty-chunk/_config.js000066400000000000000000000004111450520414700225240ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'shows warning when chunk empty', command: 'rollup -c', error: () => true, stderr: stderr => assertIncludes(stderr, '(!) Generated an empty chunk\n"main"') }); rollup-3.29.4/test/cli/samples/empty-chunk/main.js000066400000000000000000000000001450520414700220360ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/empty-chunk/rollup.config.js000066400000000000000000000001071450520414700237030ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'cjs' } }; rollup-3.29.4/test/cli/samples/external-modules-auto-global/000077500000000000000000000000001450520414700240165ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/external-modules-auto-global/_config.js000066400000000000000000000005001450520414700257530ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'populates options.external with --global keys', command: 'rollup main.js --format iife --globals mathematics:Math,promises:Promise --external promises', execute: true, stderr(stderr) { assert.ok(!stderr.includes('(!)')); } }); rollup-3.29.4/test/cli/samples/external-modules-auto-global/main.js000066400000000000000000000002101450520414700252710ustar00rootroot00000000000000import { max } from 'mathematics'; import { resolve } from 'promises'; assert.equal( max( 1, 2, 3 ), 3 ); assert.ok( resolve().then ); rollup-3.29.4/test/cli/samples/external-modules/000077500000000000000000000000001450520414700216125ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/external-modules/_config.js000066400000000000000000000004501450520414700235530ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows external modules to be specified with --external=foo,bar,baz', command: 'rollup main.js --format cjs --external=path,util', execute: true, stderr(stderr) { assert.ok(!stderr.includes('(!)')); } }); rollup-3.29.4/test/cli/samples/external-modules/main.js000066400000000000000000000003121450520414700230700ustar00rootroot00000000000000import { relative, normalize } from 'path'; import { format } from 'util'; assert.equal( format( 'it %s', 'works' ), 'it works' ); assert.equal( relative( 'a/b/c', 'a/c/b' ), normalize('../../c/b') ); rollup-3.29.4/test/cli/samples/fail-after-warnings/000077500000000000000000000000001450520414700221625ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/fail-after-warnings/_config.js000066400000000000000000000005371450520414700241310ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'errors on warnings with --failAfterWarnings', command: 'rollup -i main.js --failAfterWarnings', error: () => true, stderr: stderr => { assertIncludes(stderr, '[!] Warnings occurred and --failAfterWarnings flag present'); return true; } }); rollup-3.29.4/test/cli/samples/fail-after-warnings/_expected.js000066400000000000000000000000441450520414700244560ustar00rootroot00000000000000import 'unknown'; console.log(42); rollup-3.29.4/test/cli/samples/fail-after-warnings/main.js000066400000000000000000000000631450520414700234430ustar00rootroot00000000000000import something from 'unknown'; console.log(42); rollup-3.29.4/test/cli/samples/filter-logs/000077500000000000000000000000001450520414700205515ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/filter-logs/_config.js000066400000000000000000000007121450520414700225130ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'filters logs via CLI', command: 'rollup --config --filterLogs="pluginCode:FIRST,pluginCode:SECOND" --filterLogs=pluginCode:THIRD', env: { FORCE_COLOR: undefined, NO_COLOR: true, ROLLUP_FILTER_LOGS: 'pluginCode:FOURTH,pluginCode:FIFTH' }, stderr(stderr) { assert.strictEqual( stderr, ` main.js → stdout... first second third fourth fifth ` ); } }); rollup-3.29.4/test/cli/samples/filter-logs/main.js000066400000000000000000000000231450520414700220260ustar00rootroot00000000000000assert.ok( true ); rollup-3.29.4/test/cli/samples/filter-logs/rollup.config.mjs000066400000000000000000000010571450520414700240500ustar00rootroot00000000000000export default { input: 'main.js', logLevel: 'debug', plugins: [ { name: 'test', buildStart() { this.info({message: 'removed', pluginCode: 'REMOVED'}); this.info({message: 'first', pluginCode: 'FIRST'}); this.info({message: 'second', pluginCode: 'SECOND'}); this.info({message: 'third', pluginCode: 'THIRD'}); this.info({message: 'fourth', pluginCode: 'FOURTH'}); this.info({message: 'fifth', pluginCode: 'FIFTH'}); this.info({message: 'filtered', pluginCode: 'FILTERED'}); }, } ], output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/filter-logs/wrapper.js000077500000000000000000000001321450520414700225660ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; require('../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/format-aliases/000077500000000000000000000000001450520414700212315ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/format-aliases/_config.js000066400000000000000000000001471450520414700231750ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports format aliases', command: 'rollup --config' }); rollup-3.29.4/test/cli/samples/format-aliases/_expected/000077500000000000000000000000001450520414700231715ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/format-aliases/_expected/amd.js000066400000000000000000000002071450520414700242670ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; console.log('main'); exports.value = external; })); rollup-3.29.4/test/cli/samples/format-aliases/_expected/cjs.js000066400000000000000000000001441450520414700243050ustar00rootroot00000000000000'use strict'; var external = require('external'); console.log('main'); exports.value = external; rollup-3.29.4/test/cli/samples/format-aliases/_expected/commonjs.js000066400000000000000000000001441450520414700253530ustar00rootroot00000000000000'use strict'; var external = require('external'); console.log('main'); exports.value = external; rollup-3.29.4/test/cli/samples/format-aliases/_expected/es.js000066400000000000000000000001031450520414700241300ustar00rootroot00000000000000export { default as value } from 'external'; console.log('main'); rollup-3.29.4/test/cli/samples/format-aliases/_expected/esm.js000066400000000000000000000001031450520414700243050ustar00rootroot00000000000000export { default as value } from 'external'; console.log('main'); rollup-3.29.4/test/cli/samples/format-aliases/_expected/iife.js000066400000000000000000000002241450520414700244410ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; console.log('main'); exports.value = external; return exports; })({}, external); rollup-3.29.4/test/cli/samples/format-aliases/_expected/module.js000066400000000000000000000001031450520414700250060ustar00rootroot00000000000000export { default as value } from 'external'; console.log('main'); rollup-3.29.4/test/cli/samples/format-aliases/_expected/system.js000066400000000000000000000003441450520414700250540ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module.default); }], execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/cli/samples/format-aliases/_expected/systemjs.js000066400000000000000000000003441450520414700254110ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module.default); }], execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/cli/samples/format-aliases/_expected/umd.js000066400000000000000000000007121450520414700243140ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; console.log('main'); exports.value = external; })); rollup-3.29.4/test/cli/samples/format-aliases/_expected/undefined.js000066400000000000000000000001031450520414700254620ustar00rootroot00000000000000export { default as value } from 'external'; console.log('main'); rollup-3.29.4/test/cli/samples/format-aliases/main.js000066400000000000000000000001051450520414700225070ustar00rootroot00000000000000import value from 'external'; console.log('main'); export { value }; rollup-3.29.4/test/cli/samples/format-aliases/rollup.config.mjs000066400000000000000000000004751450520414700245330ustar00rootroot00000000000000export default { input: 'main.js', external: 'external', output: [ undefined, 'esm', 'es', 'module', 'cjs', 'commonjs', 'system', 'systemjs', 'amd', 'iife', 'umd' ].map(format => ({ file: `_actual/${format}.js`, format, name: 'bundle', globals: { external: 'external' } })) }; rollup-3.29.4/test/cli/samples/generated-code-preset-override/000077500000000000000000000000001450520414700243055ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/generated-code-preset-override/_config.js000066400000000000000000000002701450520414700262460ustar00rootroot00000000000000module.exports = defineTest({ description: 'overrides the generatedCode option when using presets', command: 'rollup --config --generatedCode es5 --generatedCode.arrowFunctions' }); rollup-3.29.4/test/cli/samples/generated-code-preset-override/_expected.js000066400000000000000000000003651450520414700266070ustar00rootroot00000000000000System.register(['external'], (function (exports) { 'use strict'; return { setters: [module => { exports('baz', module.baz); }], execute: (function () { const foo = 1; exports({ foo: foo, bar: foo, default: foo }); }) }; })); rollup-3.29.4/test/cli/samples/generated-code-preset-override/main.js000066400000000000000000000001331450520414700255640ustar00rootroot00000000000000export { baz } from 'external'; const foo = 1; export { foo, foo as bar, foo as default }; rollup-3.29.4/test/cli/samples/generated-code-preset-override/rollup.config.mjs000066400000000000000000000002621450520414700276010ustar00rootroot00000000000000export default { input: 'main.js', output: { format: 'system', generatedCode: { arrowFunctions: true, objectShorthand: true, reservedNamesAsProps: false } } }; rollup-3.29.4/test/cli/samples/generated-code-unknown-preset/000077500000000000000000000000001450520414700241655ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/generated-code-unknown-preset/_config.js000066400000000000000000000010601450520414700261240ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'overrides the generatedCode option when using presets', command: 'rollup main.js --format es --generatedCode unknown', error: () => true, stderr: stderr => { assertIncludes( stderr, '[!] RollupError: Invalid value "unknown" for option "output.generatedCode" - valid values are "es2015" and "es5". You can also supply an object for more fine-grained control.\n' + 'https://rollupjs.org/configuration-options/#output-generatedcode' ); } }); rollup-3.29.4/test/cli/samples/generated-code-unknown-preset/main.js000066400000000000000000000000251450520414700254440ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/cli/samples/handles-uncaught-errors/000077500000000000000000000000001450520414700230665ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/handles-uncaught-errors/_config.js000066400000000000000000000004101450520414700250230ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'handles uncaught errors', command: 'rollup --config rollup.config.js', error: () => true, stderr(stderr) { assertIncludes(stderr, 'TypeError: foo'); } }); rollup-3.29.4/test/cli/samples/handles-uncaught-errors/main.js000066400000000000000000000000301450520414700243410ustar00rootroot00000000000000assert.equal( 42, 42 ); rollup-3.29.4/test/cli/samples/handles-uncaught-errors/rollup.config.js000066400000000000000000000003231450520414700262030ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ { name: 'test', buildStart() { Promise.resolve().then(() => { throw new TypeError('foo'); }); } } ] }; rollup-3.29.4/test/cli/samples/import-esm-package/000077500000000000000000000000001450520414700220075ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/import-esm-package/_config.js000066400000000000000000000003101450520414700237430ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to import ESM dependencies from transpiled config files', skipIfWindows: true, command: "rollup --config --configPlugin '{transform:c => c}'" }); rollup-3.29.4/test/cli/samples/import-esm-package/_expected/000077500000000000000000000000001450520414700237475ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/import-esm-package/_expected/main.js000066400000000000000000000000431450520414700252260ustar00rootroot00000000000000/* esm-default */ assert.ok(true); rollup-3.29.4/test/cli/samples/import-esm-package/main.js000066400000000000000000000000211450520414700232620ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/cli/samples/import-esm-package/rollup.config.js000066400000000000000000000002221450520414700251220ustar00rootroot00000000000000import esmDep from 'esm-dep'; export default { input: 'main.js', output: { banner: `/* ${esmDep} */`, format: 'es', dir: '_actual' } }; rollup-3.29.4/test/cli/samples/indent-none/000077500000000000000000000000001450520414700205405ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/indent-none/_config.js000066400000000000000000000002151450520414700225000ustar00rootroot00000000000000module.exports = defineTest({ description: 'disables indentation with --no-indent', command: 'rollup main.js --format umd --no-indent' }); rollup-3.29.4/test/cli/samples/indent-none/_expected.js000066400000000000000000000002411450520414700230330ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; assert.equal( 1 + 1, 2 ); })); rollup-3.29.4/test/cli/samples/indent-none/main.js000066400000000000000000000000321450520414700220150ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); rollup-3.29.4/test/cli/samples/interop/000077500000000000000000000000001450520414700200025ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/interop/_config.js000066400000000000000000000002351450520414700217440ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not include the interop block', command: 'rollup -i main.js -f cjs --external test --interop default' }); rollup-3.29.4/test/cli/samples/interop/_expected.js000066400000000000000000000000771450520414700223040ustar00rootroot00000000000000'use strict'; var data = require('test'); assert.ok( data ); rollup-3.29.4/test/cli/samples/interop/main.js000066400000000000000000000000551450520414700212640ustar00rootroot00000000000000import data from 'test'; assert.ok( data ); rollup-3.29.4/test/cli/samples/log-side-effects/000077500000000000000000000000001450520414700214425ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/log-side-effects/_config.js000066400000000000000000000026021450520414700234040ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'logs side effects', command: 'rollup --config', env: { FORCE_COLOR: undefined, NO_COLOR: true }, stderr: stderr => assertIncludes( stderr, `First side effect in dep-mapped.js is at (2:26) 1: const removed = true; 2: const alsoRemoved = true; console.log('mapped effect'); ^ dep-mapped.js (1:0) 1: console.log('mapped effect'); ^ First side effect in dep-long-line.js is at (1:126) 1: /* This side effect is deeply hidden inside a very long line, beyond the 120-character limit that we impose for truncation */ console.lo... ^ dep-long-line.js (1:126) 1: /* This side effect is deeply hidden inside a very long line, beyond the 120-character limit that we impose for truncation */ console.lo... ^ First side effect in main.js is at (3:0) 1: import './dep-mapped'; 2: import './dep-long-line'; 3: console.log('main effect'); ^ 4: console.log('other effect'); main.js (3:0) 1: import './dep-mapped'; 2: import './dep-long-line'; 3: console.log('main effect'); ^ 4: console.log('other effect');` ) }); rollup-3.29.4/test/cli/samples/log-side-effects/dep-long-line.js000066400000000000000000000003011450520414700244240ustar00rootroot00000000000000/* This side effect is deeply hidden inside a very long line, beyond the 120-character limit that we impose for truncation */ console.log('mapped effect'); /* and there is more on this line */ rollup-3.29.4/test/cli/samples/log-side-effects/dep-mapped.js000066400000000000000000000000361450520414700240130ustar00rootroot00000000000000console.log('mapped effect'); rollup-3.29.4/test/cli/samples/log-side-effects/main.js000066400000000000000000000001521450520414700227220ustar00rootroot00000000000000import './dep-mapped'; import './dep-long-line'; console.log('main effect'); console.log('other effect'); rollup-3.29.4/test/cli/samples/log-side-effects/rollup.config.mjs000066400000000000000000000007071450520414700247420ustar00rootroot00000000000000import MagicString from 'magic-string'; export default { input: 'main.js', experimentalLogSideEffects: true, plugins: [ { name: 'insert-lines', transform(code, id) { if (id.endsWith('mapped.js')) { const magicString = new MagicString(code); magicString.prepend('const removed = true;\nconst alsoRemoved = true; '); return { code: magicString.toString(), map: magicString.generateMap({ hires: true }) }; } } } ] }; rollup-3.29.4/test/cli/samples/logs/000077500000000000000000000000001450520414700172665ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/logs/_config.js000066400000000000000000000022561450520414700212350ustar00rootroot00000000000000const assert = require('node:assert'); const BOLD = '\u001B[1m'; const BLUE = '\u001B[34m'; const CYAN = '\u001B[36m'; const GRAY = '\u001B[90m'; const NOCOLOR = '\u001B[39m'; const REGULAR = '\u001B[22m'; module.exports = defineTest({ description: 'displays logs', skipIfWindows: true, command: 'rollup --config', env: { FORCE_COLOR: '1', TERM: 'xterm' }, stderr(stderr) { assert.strictEqual( stderr, `${CYAN} ${BOLD}main.js${REGULAR} → ${BOLD}stdout${REGULAR}...${NOCOLOR} ${BOLD}${CYAN}simple-info${NOCOLOR}${REGULAR} ${BOLD}${CYAN}complex-info${NOCOLOR}${REGULAR} ${GRAY}https://rollupjs.org/https://my-url.net${NOCOLOR} ${BOLD}${BLUE}simple-debug${NOCOLOR}${REGULAR} ${BOLD}${BLUE}complex-debug${NOCOLOR}${REGULAR} ${GRAY}https://rollupjs.org/https://my-url.net${NOCOLOR} ${BOLD}${CYAN}transform-info${NOCOLOR}${REGULAR} ${GRAY}https://rollupjs.org/https://my-url.net${NOCOLOR} ${BOLD}main.js (1:12)${REGULAR} ${GRAY}1: assert.ok( true ); ^${NOCOLOR} ${BOLD}${BLUE}transform-debug${NOCOLOR}${REGULAR} ${GRAY}https://rollupjs.org/https://my-url.net${NOCOLOR} ${BOLD}main.js (1:13)${REGULAR} ${GRAY}1: assert.ok( true ); ^${NOCOLOR} ` ); } }); rollup-3.29.4/test/cli/samples/logs/main.js000066400000000000000000000000231450520414700205430ustar00rootroot00000000000000assert.ok( true ); rollup-3.29.4/test/cli/samples/logs/rollup.config.mjs000066400000000000000000000010311450520414700225550ustar00rootroot00000000000000export default { input: 'main.js', logLevel: 'debug', plugins: [ { name: 'test', buildStart() { this.info('simple-info'); this.info({ message: 'complex-info', url: 'https://my-url.net' }); this.debug('simple-debug'); this.debug({ message: 'complex-debug', url: 'https://my-url.net' }); }, transform() { this.info({ message: 'transform-info', url: 'https://my-url.net' }, 12); this.debug({ message: 'transform-debug', url: 'https://my-url.net' }, 13); } } ], output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/logs/wrapper.js000077500000000000000000000001321450520414700213030ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; require('../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/merge-deprecations/000077500000000000000000000000001450520414700220775ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/merge-deprecations/_config.js000066400000000000000000000002071450520414700240400ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges deprecated with current options', command: 'rollup --config rollup.config.js' }); rollup-3.29.4/test/cli/samples/merge-deprecations/_expected/000077500000000000000000000000001450520414700240375ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/merge-deprecations/_expected/bundle2.js000066400000000000000000000000301450520414700257210ustar00rootroot00000000000000assert.equal( 42, 42 ); rollup-3.29.4/test/cli/samples/merge-deprecations/main.js000066400000000000000000000000341450520414700233560ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/merge-deprecations/rollup.config.js000066400000000000000000000004231450520414700252150ustar00rootroot00000000000000var replace = require('@rollup/plugin-replace'); module.exports = { entry: 'main.js', input: 'main.js', format: 'es', dest: '_actual/bundle1.js', output: { file: '_actual/bundle2.js', format: 'es' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/samples/merge-treeshake-false/000077500000000000000000000000001450520414700224625ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/merge-treeshake-false/_config.js000066400000000000000000000004121450520414700244210ustar00rootroot00000000000000module.exports = defineTest({ description: 'sets all tree-shaking to false if one option disables it', command: 'rollup main.js --format es --external external --treeshake.moduleSideEffects no-external --no-treeshake --no-treeshake.unknownGlobalSideEffects' }); rollup-3.29.4/test/cli/samples/merge-treeshake-false/_expected.js000066400000000000000000000001671450520414700247640ustar00rootroot00000000000000import 'external'; console.log('included internal side-effect'); const unusedGlobal = someGlobal; console.log( 42 );rollup-3.29.4/test/cli/samples/merge-treeshake-false/lib.js000066400000000000000000000000561450520414700235670ustar00rootroot00000000000000console.log('included internal side-effect'); rollup-3.29.4/test/cli/samples/merge-treeshake-false/main.js000066400000000000000000000001311450520414700237370ustar00rootroot00000000000000import 'external'; import './lib'; const unusedGlobal = someGlobal; console.log( 42 ); rollup-3.29.4/test/cli/samples/merge-treeshake/000077500000000000000000000000001450520414700213725ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/merge-treeshake/_config.js000066400000000000000000000003471450520414700233400ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges treeshake options', command: 'rollup main.js --format es --external external --treeshake.moduleSideEffects no-external --treeshake --no-treeshake.unknownGlobalSideEffects' }); rollup-3.29.4/test/cli/samples/merge-treeshake/_expected.js000066400000000000000000000001011450520414700236600ustar00rootroot00000000000000console.log('included internal side-effect'); console.log( 42 );rollup-3.29.4/test/cli/samples/merge-treeshake/lib.js000066400000000000000000000000561450520414700224770ustar00rootroot00000000000000console.log('included internal side-effect'); rollup-3.29.4/test/cli/samples/merge-treeshake/main.js000066400000000000000000000001311450520414700226470ustar00rootroot00000000000000import 'external'; import './lib'; const unusedGlobal = someGlobal; console.log( 42 ); rollup-3.29.4/test/cli/samples/module-name/000077500000000000000000000000001450520414700205255ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/module-name/_config.js000066400000000000000000000002331450520414700224650ustar00rootroot00000000000000module.exports = defineTest({ description: 'generates UMD export with correct name', command: 'rollup main.js --format umd --name myBundle --indent' }); rollup-3.29.4/test/cli/samples/module-name/_expected.js000066400000000000000000000005611450520414700230250ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/cli/samples/module-name/main.js000066400000000000000000000000231450520414700220020ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/multiple-configs/000077500000000000000000000000001450520414700216035ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/multiple-configs/_config.js000066400000000000000000000004471450520414700235520ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'generates output file when multiple configurations are specified and one build fails', command: 'rollup -c', error: error => { assert.ok(/Unexpected Exception/.test(error.message)); return true; } }); rollup-3.29.4/test/cli/samples/multiple-configs/_expected/000077500000000000000000000000001450520414700235435ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/multiple-configs/_expected/bundle1.js000066400000000000000000000000651450520414700254340ustar00rootroot00000000000000'use strict'; var main = 0; module.exports = main; rollup-3.29.4/test/cli/samples/multiple-configs/main.js000066400000000000000000000000221450520414700230570ustar00rootroot00000000000000export default 0; rollup-3.29.4/test/cli/samples/multiple-configs/rollup.config.mjs000066400000000000000000000005251450520414700251010ustar00rootroot00000000000000export default [ { input: 'main.js', output: { file: '_actual/bundle1.js', format: 'cjs', exports: 'auto' } }, { input: 'main.js', plugins: [ { resolveId(id) { throw new Error('Unexpected Exception'); } } ], output: { file: '_actual/bundle2.js', format: 'cjs', exports: 'auto' } } ]; rollup-3.29.4/test/cli/samples/multiple-targets-different-plugins/000077500000000000000000000000001450520414700252475ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/multiple-targets-different-plugins/_config.js000066400000000000000000000002101450520414700272020ustar00rootroot00000000000000module.exports = defineTest({ description: 'generates multiple output files, only one of which is minified', command: 'rollup -c' }); rollup-3.29.4/test/cli/samples/multiple-targets-different-plugins/_expected/000077500000000000000000000000001450520414700272075ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/multiple-targets-different-plugins/_expected/main.js000066400000000000000000000001321450520414700304650ustar00rootroot00000000000000'use strict'; const Hello = 1; console.log(Hello); var main = 0; module.exports = main; rollup-3.29.4/test/cli/samples/multiple-targets-different-plugins/_expected/minified.js000066400000000000000000000000561450520414700313320ustar00rootroot00000000000000"use strict";console.log(1);module.exports=0; rollup-3.29.4/test/cli/samples/multiple-targets-different-plugins/main.js000066400000000000000000000000671450520414700265340ustar00rootroot00000000000000const Hello = 1; console.log(Hello); export default 0; rollup-3.29.4/test/cli/samples/multiple-targets-different-plugins/rollup.config.mjs000066400000000000000000000004211450520414700305400ustar00rootroot00000000000000import terser from '@rollup/plugin-terser'; export default { input: 'main.js', output: [ { format: 'cjs', file: '_actual/main.js', exports: 'auto' }, { format: 'cjs', file: '_actual/minified.js', exports: 'auto', plugins: [terser()] } ] }; rollup-3.29.4/test/cli/samples/multiple-targets-shared-config/000077500000000000000000000000001450520414700243335ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/multiple-targets-shared-config/_config.js000066400000000000000000000001541450520414700262750ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses shared config for each target', command: 'rollup -c' }); rollup-3.29.4/test/cli/samples/multiple-targets-shared-config/_expected/000077500000000000000000000000001450520414700262735ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/multiple-targets-shared-config/_expected/cjs.js000066400000000000000000000001251450520414700274060ustar00rootroot00000000000000'use strict'; var main = 0; module.exports = main; //# sourceMappingURL=cjs.js.map rollup-3.29.4/test/cli/samples/multiple-targets-shared-config/_expected/cjs.js.map000066400000000000000000000002141450520414700301610ustar00rootroot00000000000000{"version":3,"file":"cjs.js","sources":["../main.js"],"sourcesContent":["export default 0;\n"],"names":[],"mappings":";;AAAA,WAAe,CAAC;;;;"}rollup-3.29.4/test/cli/samples/multiple-targets-shared-config/_expected/es.js000066400000000000000000000001121450520414700272320ustar00rootroot00000000000000var main = 0; export { main as default }; //# sourceMappingURL=es.js.map rollup-3.29.4/test/cli/samples/multiple-targets-shared-config/_expected/es.js.map000066400000000000000000000002111450520414700300060ustar00rootroot00000000000000{"version":3,"file":"es.js","sources":["../main.js"],"sourcesContent":["export default 0;\n"],"names":[],"mappings":"AAAA,WAAe,CAAC;;;;"}rollup-3.29.4/test/cli/samples/multiple-targets-shared-config/main.js000066400000000000000000000000221450520414700256070ustar00rootroot00000000000000export default 0; rollup-3.29.4/test/cli/samples/multiple-targets-shared-config/rollup.config.mjs000066400000000000000000000003301450520414700276230ustar00rootroot00000000000000export default { input: 'main.js', output: [ { format: 'cjs', file: '_actual/cjs.js', exports: 'auto', sourcemap: true }, { format: 'es', file: '_actual/es.js', sourcemap: true } ] }; rollup-3.29.4/test/cli/samples/multiple-targets/000077500000000000000000000000001450520414700216245ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/multiple-targets/_config.js000066400000000000000000000002151450520414700235640ustar00rootroot00000000000000module.exports = defineTest({ description: 'generates multiple output files when multiple targets are specified', command: 'rollup -c' }); rollup-3.29.4/test/cli/samples/multiple-targets/_expected/000077500000000000000000000000001450520414700235645ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/multiple-targets/_expected/cjs.js000066400000000000000000000000651450520414700247020ustar00rootroot00000000000000'use strict'; var main = 0; module.exports = main; rollup-3.29.4/test/cli/samples/multiple-targets/_expected/es.js000066400000000000000000000000531450520414700245270ustar00rootroot00000000000000var main = 0; export { main as default }; rollup-3.29.4/test/cli/samples/multiple-targets/main.js000066400000000000000000000000221450520414700231000ustar00rootroot00000000000000export default 0; rollup-3.29.4/test/cli/samples/multiple-targets/rollup.config.mjs000066400000000000000000000002601450520414700251160ustar00rootroot00000000000000export default { input: 'main.js', output: [ { format: 'cjs', file: '_actual/cjs.js', exports: 'auto' }, { format: 'es', file: '_actual/es.js' } ] }; rollup-3.29.4/test/cli/samples/no-color/000077500000000000000000000000001450520414700200525ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/no-color/_config.js000066400000000000000000000006421450520414700220160ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'respects the NO_COLOR environment variable', command: 'rollup -i main1.js -i main2.js -f es', env: { FORCE_COLOR: undefined, NO_COLOR: true }, result(code) { assert.equal( code, '\n' + '//→ main1.js:\n' + "console.log('main1');\n" + '\n' + '//→ main2.js:\n' + "console.log('main2');\n" ); } }); rollup-3.29.4/test/cli/samples/no-color/main1.js000066400000000000000000000000261450520414700214130ustar00rootroot00000000000000console.log('main1'); rollup-3.29.4/test/cli/samples/no-color/main2.js000066400000000000000000000000261450520414700214140ustar00rootroot00000000000000console.log('main2'); rollup-3.29.4/test/cli/samples/no-conflict/000077500000000000000000000000001450520414700205355ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/no-conflict/_config.js000066400000000000000000000001731450520414700225000ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects noConflict option', command: 'rollup --config rollup.config.js' }); rollup-3.29.4/test/cli/samples/no-conflict/_expected.js000066400000000000000000000010311450520414700230260ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { var current = global.conflictyName; var exports = global.conflictyName = factory(); exports.noConflict = function () { global.conflictyName = current; return exports; }; })()); })(this, (function () { 'use strict'; var main = {}; return main; }));rollup-3.29.4/test/cli/samples/no-conflict/main.js000066400000000000000000000000231450520414700220120ustar00rootroot00000000000000export default {}; rollup-3.29.4/test/cli/samples/no-conflict/rollup.config.js000066400000000000000000000001641450520414700236550ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'umd', noConflict: true, name: 'conflictyName' } }; rollup-3.29.4/test/cli/samples/no-strict/000077500000000000000000000000001450520414700202445ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/no-strict/_config.js000066400000000000000000000002031450520414700222010ustar00rootroot00000000000000module.exports = defineTest({ description: 'use no strict option', command: 'rollup -i main.js -f iife --no-strict --indent' }); rollup-3.29.4/test/cli/samples/no-strict/_expected.js000066400000000000000000000000531450520414700225400ustar00rootroot00000000000000(function () { console.log( 42 ); })(); rollup-3.29.4/test/cli/samples/no-strict/main.js000066400000000000000000000000231450520414700215210ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/cli/samples/no-treeshake/000077500000000000000000000000001450520414700207075ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/no-treeshake/_config.js000066400000000000000000000002211450520414700226440ustar00rootroot00000000000000module.exports = defineTest({ description: 'generates IIFE export with all code and overrides config', command: 'rollup -c --no-treeshake' }); rollup-3.29.4/test/cli/samples/no-treeshake/_expected.js000066400000000000000000000001771450520414700232120ustar00rootroot00000000000000var shakeless = (function () { 'use strict'; const version = '1.2.0'; var main = ( x, y ) => x + y; return main; })(); rollup-3.29.4/test/cli/samples/no-treeshake/main.js000066400000000000000000000000741450520414700221720ustar00rootroot00000000000000const version = '1.2.0'; export default ( x, y ) => x + y; rollup-3.29.4/test/cli/samples/no-treeshake/rollup.config.js000066400000000000000000000002201450520414700240200ustar00rootroot00000000000000module.exports = { input: 'main.js', treeshake: { propertyReadSideEffects: false }, output: { format: 'iife', name: 'shakeless' } }; rollup-3.29.4/test/cli/samples/node-config-auto-prefix/000077500000000000000000000000001450520414700227535ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/node-config-auto-prefix/_config.js000066400000000000000000000002721450520414700247160ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses config file installed from npm, automatically adding a rollup-config- prefix', command: 'rollup --config node:foo', execute: true }); rollup-3.29.4/test/cli/samples/node-config-auto-prefix/_expected.js000066400000000000000000000004431450520414700252520ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.myBundle = factory(); }(this, function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/cli/samples/node-config-auto-prefix/main.js000066400000000000000000000000341450520414700242320ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/node-config-not-found/000077500000000000000000000000001450520414700224215ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/node-config-not-found/_config.js000066400000000000000000000004711450520414700243650ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'throws if a config in node_modules cannot be found', command: 'rollup --config node:baz', error: () => true, stderr(stderr) { assertIncludes(stderr, '[!] Could not resolve config file "node:baz"'); } }); rollup-3.29.4/test/cli/samples/node-config-not-found/main.js000066400000000000000000000000341450520414700237000ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/node-config/000077500000000000000000000000001450520414700205125ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/node-config/_config.js000066400000000000000000000002351450520414700224540ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses config file installed from npm', command: 'rollup --config node:bar', cwd: __dirname, execute: true }); rollup-3.29.4/test/cli/samples/node-config/_expected.js000066400000000000000000000004431450520414700230110ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.myBundle = factory(); }(this, function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/cli/samples/node-config/main.js000066400000000000000000000000341450520414700217710ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/paths-output-option/000077500000000000000000000000001450520414700223055ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/paths-output-option/_config.js000066400000000000000000000002131450520414700242430ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows paths to be set as an output option', command: 'rollup --config rollup.config.js' }); rollup-3.29.4/test/cli/samples/paths-output-option/_expected.js000066400000000000000000000000731450520414700246030ustar00rootroot00000000000000'use strict'; var foo = require('bar'); console.log(foo);rollup-3.29.4/test/cli/samples/paths-output-option/main.js000066400000000000000000000000501450520414700235620ustar00rootroot00000000000000import foo from 'foo'; console.log(foo);rollup-3.29.4/test/cli/samples/paths-output-option/rollup.config.js000066400000000000000000000001711450520414700254230ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['foo'], output: { format: 'cjs', paths: { foo: 'bar' } } }; rollup-3.29.4/test/cli/samples/plugin/000077500000000000000000000000001450520414700176205ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/absolute-esm/000077500000000000000000000000001450520414700222205ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/absolute-esm/_config.js000066400000000000000000000003301450520414700241560ustar00rootroot00000000000000const { sep } = require('node:path'); module.exports = defineTest({ description: 'ESM CLI --plugin /absolute/path', command: `rollup main.js -p "${__dirname}${sep}my-esm-plugin.mjs={comment: 'Absolute ESM'}"` }); rollup-3.29.4/test/cli/samples/plugin/absolute-esm/_expected.js000066400000000000000000000000471450520414700245170ustar00rootroot00000000000000// Hello Absolute ESM console.log(2 ); rollup-3.29.4/test/cli/samples/plugin/absolute-esm/main.js000066400000000000000000000000301450520414700234730ustar00rootroot00000000000000console.log(1 ? 2 : 3); rollup-3.29.4/test/cli/samples/plugin/absolute-esm/my-esm-plugin.mjs000066400000000000000000000002271450520414700254370ustar00rootroot00000000000000export default function(options = {}) { const {comment} = options; return { transform(code) { return `// Hello ${comment}\n${code}`; } }; }; rollup-3.29.4/test/cli/samples/plugin/absolute/000077500000000000000000000000001450520414700214365ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/absolute/_config.js000066400000000000000000000003211450520414700233740ustar00rootroot00000000000000const { sep } = require('node:path'); module.exports = defineTest({ description: 'CLI --plugin /absolute/path', command: `rollup main.js -p "${__dirname}${sep}my-plugin.js={VALUE: 'absolute', ZZZ: 1}"` }); rollup-3.29.4/test/cli/samples/plugin/absolute/_expected.js000066400000000000000000000000311450520414700237260ustar00rootroot00000000000000console.log("absolute"); rollup-3.29.4/test/cli/samples/plugin/absolute/main.js000066400000000000000000000000241450520414700227140ustar00rootroot00000000000000console.log(VALUE); rollup-3.29.4/test/cli/samples/plugin/absolute/my-plugin.js000066400000000000000000000005211450520414700237130ustar00rootroot00000000000000module.exports = function(options) { if (options === void 0) options = {}; return { transform(code) { // dumb search and replace for test purposes for (var key in options) { const rx = new RegExp(key, 'g'); const value = JSON.stringify(options[key]); code = code.replace(rx, value); } return code; } }; }; rollup-3.29.4/test/cli/samples/plugin/advanced-esm/000077500000000000000000000000001450520414700221475ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced-esm/_config.js000066400000000000000000000011211450520414700241040ustar00rootroot00000000000000module.exports = defineTest({ description: 'load an ESM-only rollup plugin from node_modules as well as CJS plugins', skipIfWindows: true, // The NodeJS resolution rules for ESM modules are more restrictive than CJS. // Must copy the ESM plugin into the main node_modules in order to use and test it. command: `rm -rf ../../../../../node_modules/rollup-plugin-esm-test && cp -rp ../../../node_modules_rename_me/rollup-plugin-esm-test ../../../../../node_modules/ && rollup -c -p node-resolve,commonjs,esm-test -p "terser={mangle: false, output: {beautify: true, indent_level: 2}}"` }); rollup-3.29.4/test/cli/samples/plugin/advanced-esm/_expected/000077500000000000000000000000001450520414700241075ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced-esm/_expected/cjs.js000066400000000000000000000006111450520414700252220ustar00rootroot00000000000000"use strict"; console.log("esm-test: node_modules/print/index.js"); console.log("esm-test: node_modules/foo/index.js"); var print = function(value) { console.log(value); }, Foo = function() { function Foo(x) { this.x = x; } return Foo.prototype.output = function() { print(this.x); }, Foo; }(); console.log("esm-test: main.js"), new Foo(123).output(), exports.Bar = Foo; rollup-3.29.4/test/cli/samples/plugin/advanced-esm/_expected/es.js000066400000000000000000000005771450520414700250650ustar00rootroot00000000000000console.log("esm-test: node_modules/print/index.js"); console.log("esm-test: node_modules/foo/index.js"); var print = function(value) { console.log(value); }, Foo = function() { function Foo(x) { this.x = x; } return Foo.prototype.output = function() { print(this.x); }, Foo; }(); console.log("esm-test: main.js"), new Foo(123).output(); export { Foo as Bar }; rollup-3.29.4/test/cli/samples/plugin/advanced-esm/main.js000066400000000000000000000001241450520414700234260ustar00rootroot00000000000000import {Foo} from "foo"; var foo = new Foo(123); foo.output(); export {Foo as Bar}; rollup-3.29.4/test/cli/samples/plugin/advanced-esm/node_modules/000077500000000000000000000000001450520414700246245ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced-esm/node_modules/foo/000077500000000000000000000000001450520414700254075ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced-esm/node_modules/foo/index.js000066400000000000000000000001731450520414700270550ustar00rootroot00000000000000var print = require('print'); exports.Foo = class { constructor(x) { this.x = x; } output() { print(this.x); } }; rollup-3.29.4/test/cli/samples/plugin/advanced-esm/node_modules/print/000077500000000000000000000000001450520414700257605ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced-esm/node_modules/print/index.js000066400000000000000000000000731450520414700274250ustar00rootroot00000000000000module.exports = function(value) { console.log(value); }; rollup-3.29.4/test/cli/samples/plugin/advanced-esm/rollup.config.mjs000066400000000000000000000003351450520414700254440ustar00rootroot00000000000000import buble from '@rollup/plugin-buble'; export default { input: 'main.js', plugins: [buble()], output: [ { file: '_actual/cjs.js', format: 'cjs' }, { file: '_actual/es.js', format: 'esm' } ] }; rollup-3.29.4/test/cli/samples/plugin/advanced/000077500000000000000000000000001450520414700213655ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced/_config.js000066400000000000000000000003211450520414700233230ustar00rootroot00000000000000module.exports = defineTest({ description: 'advanced CLI --plugin functionality with rollup config', command: `rollup -c -p node-resolve,commonjs -p "terser={output: {beautify: true, indent_level: 2}}"` }); rollup-3.29.4/test/cli/samples/plugin/advanced/_expected/000077500000000000000000000000001450520414700233255ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced/_expected/cjs.js000066400000000000000000000003371450520414700244450ustar00rootroot00000000000000"use strict"; var t = function(t) { console.log(t); }, o = function() { function o(t) { this.x = t; } return o.prototype.output = function() { t(this.x); }, o; }(); new o(123).output(), exports.Bar = o; rollup-3.29.4/test/cli/samples/plugin/advanced/_expected/es.js000066400000000000000000000003251450520414700242720ustar00rootroot00000000000000var t = function(t) { console.log(t); }, o = function() { function o(t) { this.x = t; } return o.prototype.output = function() { t(this.x); }, o; }(); new o(123).output(); export { o as Bar }; rollup-3.29.4/test/cli/samples/plugin/advanced/main.js000066400000000000000000000001241450520414700226440ustar00rootroot00000000000000import {Foo} from "foo"; var foo = new Foo(123); foo.output(); export {Foo as Bar}; rollup-3.29.4/test/cli/samples/plugin/advanced/node_modules/000077500000000000000000000000001450520414700240425ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced/node_modules/foo/000077500000000000000000000000001450520414700246255ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced/node_modules/foo/index.js000066400000000000000000000001731450520414700262730ustar00rootroot00000000000000var print = require('print'); exports.Foo = class { constructor(x) { this.x = x; } output() { print(this.x); } }; rollup-3.29.4/test/cli/samples/plugin/advanced/node_modules/print/000077500000000000000000000000001450520414700251765ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/advanced/node_modules/print/index.js000066400000000000000000000000731450520414700266430ustar00rootroot00000000000000module.exports = function(value) { console.log(value); }; rollup-3.29.4/test/cli/samples/plugin/advanced/rollup.config.mjs000066400000000000000000000003351450520414700246620ustar00rootroot00000000000000import buble from '@rollup/plugin-buble'; export default { input: 'main.js', plugins: [buble()], output: [ { file: '_actual/cjs.js', format: 'cjs' }, { file: '_actual/es.js', format: 'esm' } ] }; rollup-3.29.4/test/cli/samples/plugin/basic/000077500000000000000000000000001450520414700207015ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/basic/_config.js000066400000000000000000000002241450520414700226410ustar00rootroot00000000000000module.exports = defineTest({ description: 'basic CLI --plugin functionality', command: `rollup main.js -f cjs --plugin @rollup/plugin-buble` }); rollup-3.29.4/test/cli/samples/plugin/basic/_expected.js000066400000000000000000000003061450520414700231760ustar00rootroot00000000000000'use strict'; var Bar = function Bar(value) { this.x = value; }; Bar.prototype.value = function value () { return this.x; }; var bar = new Bar(123); console.log(bar.value()); exports.Bar = Bar; rollup-3.29.4/test/cli/samples/plugin/basic/main.js000066400000000000000000000002211450520414700221560ustar00rootroot00000000000000export class Bar { constructor(value) { this.x = value; } value() { return this.x; } } var bar = new Bar(123); console.log(bar.value()); rollup-3.29.4/test/cli/samples/plugin/cannot-load/000077500000000000000000000000001450520414700220175ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/cannot-load/_config.js000066400000000000000000000005141450520414700237610ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'unknown CLI --plugin results in an error', skipIfWindows: true, command: `echo "console.log(123);" | rollup --plugin foobar`, error(error) { assertIncludes(error.message, '[!] Error: Cannot load plugin "foobar"'); } }); rollup-3.29.4/test/cli/samples/plugin/default-export/000077500000000000000000000000001450520414700225635ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/default-export/_config.js000066400000000000000000000003061450520414700245240ustar00rootroot00000000000000module.exports = defineTest({ description: 'CLI --plugin with default export', skipIfWindows: true, command: `echo 'console.log(VALUE);' | rollup -p "./my-plugin={VALUE: 'default', ZZZ: 1}"` }); rollup-3.29.4/test/cli/samples/plugin/default-export/_expected.js000066400000000000000000000000301450520414700250520ustar00rootroot00000000000000console.log("default"); rollup-3.29.4/test/cli/samples/plugin/default-export/my-plugin.js000066400000000000000000000005221450520414700250410ustar00rootroot00000000000000exports.default = function(options) { if (options === void 0) options = {}; return { transform(code) { // dumb search and replace for test purposes for (var key in options) { const rx = new RegExp(key, 'g'); const value = JSON.stringify(options[key]); code = code.replace(rx, value); } return code; } }; }; rollup-3.29.4/test/cli/samples/plugin/export-not-found/000077500000000000000000000000001450520414700230505ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/export-not-found/_config.js000066400000000000000000000010661450520414700250150ustar00rootroot00000000000000const path = require('node:path'); const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'Throws when the plugin export cannot be found', skipIfWindows: true, command: `echo 'console.log("ignored");' | rollup -p "./my-missing-plugin"`, error(error) { assertIncludes( error.message, `[!] Error: Cannot find entry for plugin "${path.join( __dirname, 'my-missing-plugin' )}". The plugin needs to export a function either as "default" or "myMissingPlugin" for Rollup to recognize it.` ); } }); rollup-3.29.4/test/cli/samples/plugin/export-not-found/_expected.js000066400000000000000000000000341450520414700253430ustar00rootroot00000000000000console.log('transformed'); rollup-3.29.4/test/cli/samples/plugin/export-not-found/my-missing-plugin.js000066400000000000000000000000001450520414700267640ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/invalid-argument/000077500000000000000000000000001450520414700230665ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/invalid-argument/_config.js000066400000000000000000000005331450520414700250310ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'invalid CLI --plugin argument format', skipIfWindows: true, command: `echo "console.log(123);" | rollup --plugin 'foo bar'`, error(error) { assertIncludes(error.message, '[!] Error: Invalid --plugin argument format: "foo bar"'); } }); rollup-3.29.4/test/cli/samples/plugin/object/000077500000000000000000000000001450520414700210665ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/object/_config.js000066400000000000000000000003101450520414700230220ustar00rootroot00000000000000module.exports = defineTest({ description: 'CLI --plugin object', skipIfWindows: true, command: `echo 'console.log(42);' | rollup -f cjs -p '{transform: c => c + String.fromCharCode(10) + c}'` }); rollup-3.29.4/test/cli/samples/plugin/object/_expected.js000066400000000000000000000000621450520414700233620ustar00rootroot00000000000000'use strict'; console.log(42); console.log(42); rollup-3.29.4/test/cli/samples/plugin/relative-camelized/000077500000000000000000000000001450520414700233665ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/relative-camelized/_config.js000066400000000000000000000005641450520414700253350ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles plugins where the export name is the camelized file name', skipIfWindows: true, command: `echo 'console.log("initial");' | rollup ` + '-p "./plugins/my-super-plugin1.js" ' + '-p "./plugins/rollup-plugin-my-super-plugin2.js" ' + '-p "./plugins/rollup-plugin-" ' + '-p "./plugins/@rollup/plugin-supreme"' }); rollup-3.29.4/test/cli/samples/plugin/relative-camelized/_expected.js000066400000000000000000000001671450520414700256700ustar00rootroot00000000000000console.log("initial"); console.log("plugin1"); console.log("plugin2"); console.log("plugin3"); console.log("plugin4");rollup-3.29.4/test/cli/samples/plugin/relative-camelized/plugins/000077500000000000000000000000001450520414700250475ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/relative-camelized/plugins/@rollup/000077500000000000000000000000001450520414700264645ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/relative-camelized/plugins/@rollup/plugin-supreme.js000066400000000000000000000001421450520414700317730ustar00rootroot00000000000000exports.supreme = () => ({ transform(code) { return `${code}console.log("plugin4");\n`; } }); rollup-3.29.4/test/cli/samples/plugin/relative-camelized/plugins/my-super-plugin1.js000066400000000000000000000001511450520414700305400ustar00rootroot00000000000000exports.mySuperPlugin1 = () => ({ transform(code) { return `${code}console.log("plugin1");\n`; } }); rollup-3.29.4/test/cli/samples/plugin/relative-camelized/plugins/rollup-plugin-000066400000000000000000000001471450520414700276620ustar00rootroot00000000000000exports.rollupPlugin = () => ({ transform(code) { return `${code}console.log("plugin3");\n`; } }); rollup-3.29.4/test/cli/samples/plugin/relative-camelized/plugins/rollup-plugin-my-super-plugin2.js000066400000000000000000000001511450520414700333500ustar00rootroot00000000000000exports.mySuperPlugin2 = () => ({ transform(code) { return `${code}console.log("plugin2");\n`; } }); rollup-3.29.4/test/cli/samples/plugin/relative-esm/000077500000000000000000000000001450520414700222155ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/relative-esm/_config.js000066400000000000000000000003401450520414700241540ustar00rootroot00000000000000module.exports = defineTest({ description: 'ESM CLI --plugin ../relative/path', skipIfWindows: true, command: `echo 'console.log(1 ? 2 : 3);' | rollup -p "../absolute-esm/my-esm-plugin.mjs={comment: 'Relative ESM'}"` }); rollup-3.29.4/test/cli/samples/plugin/relative-esm/_expected.js000066400000000000000000000000471450520414700245140ustar00rootroot00000000000000// Hello Relative ESM console.log(2 ); rollup-3.29.4/test/cli/samples/plugin/relative/000077500000000000000000000000001450520414700214335ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/plugin/relative/_config.js000066400000000000000000000003161450520414700233750ustar00rootroot00000000000000module.exports = defineTest({ description: 'CLI --plugin ../relative/path', skipIfWindows: true, command: `echo 'console.log(VALUE);' | rollup -p "../absolute/my-plugin={VALUE: 'relative', ZZZ: 1}"` }); rollup-3.29.4/test/cli/samples/plugin/relative/_expected.js000066400000000000000000000000311450520414700237230ustar00rootroot00000000000000console.log("relative"); rollup-3.29.4/test/cli/samples/property-read-side-effects/000077500000000000000000000000001450520414700234565ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/property-read-side-effects/_config.js000066400000000000000000000002711450520414700254200ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows disabling side-effects when accessing properties', command: 'rollup main.js --format es --no-treeshake.propertyReadSideEffects' }); rollup-3.29.4/test/cli/samples/property-read-side-effects/_expected.js000066400000000000000000000000231450520414700257470ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/cli/samples/property-read-side-effects/main.js000066400000000000000000000001411450520414700247340ustar00rootroot00000000000000function deepAccess ( foo ) { const x = foo.bar.baz; } deepAccess( null ); console.log( 42 ); rollup-3.29.4/test/cli/samples/propertyReadSideEffects-always/000077500000000000000000000000001450520414700244055ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/propertyReadSideEffects-always/_config.js000066400000000000000000000003101450520414700263410ustar00rootroot00000000000000module.exports = defineTest({ description: 'verify property accesses are retained for getters with side effects', command: `rollup main.js --validate --treeshake.propertyReadSideEffects=always` }); rollup-3.29.4/test/cli/samples/propertyReadSideEffects-always/_expected.js000066400000000000000000000003551450520414700267060ustar00rootroot00000000000000class C { get x() { console.log(`side effect ${++count}`); return 42 } } let count = 0; const obj = new C; console.log(obj.x); // these statements should be retained if (obj.x) { obj["x"]; const {x} = obj; } let x; ({x} = obj); rollup-3.29.4/test/cli/samples/propertyReadSideEffects-always/main.js000066400000000000000000000004651450520414700256740ustar00rootroot00000000000000class C { get x() { console.log(`side effect ${++count}`) return 42 } } let count = 0 const obj = new C console.log(obj.x) // these statements should be retained if (obj.x) { obj["x"] const {x} = obj } let x ({x} = obj) // demonstrate that tree shaking still works const unused = x => x unused(123) rollup-3.29.4/test/cli/samples/silent-onwarn/000077500000000000000000000000001450520414700211225ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/silent-onwarn/_config.js000066400000000000000000000003341450520414700230640ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'triggers onwarn with --silent', command: 'rollup -c --silent', stderr: stderr => { assert.equal(stderr, ''); return true; } }); rollup-3.29.4/test/cli/samples/silent-onwarn/_expected.js000066400000000000000000000001141450520414700234140ustar00rootroot00000000000000var doIt = () => console.log('main'); doIt(); export { doIt as default }; rollup-3.29.4/test/cli/samples/silent-onwarn/main.js000066400000000000000000000001221450520414700223770ustar00rootroot00000000000000import doIt from './main.js'; export default () => console.log('main'); doIt(); rollup-3.29.4/test/cli/samples/silent-onwarn/rollup.config.mjs000066400000000000000000000005031450520414700244140ustar00rootroot00000000000000import assert from 'assert'; const warnings = []; export default { input: 'main.js', output: { format: 'es' }, onwarn(warning) { warnings.push(warning); }, plugins: { generateBundle(bundle) { assert.strictEqual(warnings.length, 1); assert.strictEqual(warnings[0].code, 'CIRCULAR_DEPENDENCY'); } } }; rollup-3.29.4/test/cli/samples/silent/000077500000000000000000000000001450520414700176205ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/silent/_config.js000066400000000000000000000003461450520414700215650ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not print logs with --silent', command: 'rollup --config --silent', stderr: stderr => { assert.equal(stderr, ''); return true; } }); rollup-3.29.4/test/cli/samples/silent/_expected.js000066400000000000000000000000671450520414700221210ustar00rootroot00000000000000'use strict'; var foo = 42; assert.equal( foo, 42 ); rollup-3.29.4/test/cli/samples/silent/foo.js000066400000000000000000000000251450520414700207360ustar00rootroot00000000000000export var foo = 42; rollup-3.29.4/test/cli/samples/silent/main.js000066400000000000000000000000771450520414700211060ustar00rootroot00000000000000import { foo, bar } from './foo.js'; assert.equal( foo, 42 ); rollup-3.29.4/test/cli/samples/silent/rollup.config.mjs000066400000000000000000000004141450520414700231130ustar00rootroot00000000000000export default { input: 'main.js', logLevel: 'debug', plugins: [ { name: 'test', buildStart() { this.debug('debug-log'); this.info('info-log'); this.warn('warn-log'); } } ], output: { format: 'cjs' } } rollup-3.29.4/test/cli/samples/sourcemap-hidden/000077500000000000000000000000001450520414700215515ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/sourcemap-hidden/_config.js000066400000000000000000000011501450520414700235100ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync, unlinkSync } = require('node:fs'); module.exports = defineTest({ description: 'omits sourcemap comments', command: 'rollup -i main.js -f es -m hidden -o output.js', test() { assert.equal(readFileSync('output.js', 'utf8').trim(), 'console.log( 42 );'); unlinkSync('output.js'); assert.equal( readFileSync('output.js.map', 'utf8').trim(), '{"version":3,"file":"output.js","sources":["main.js"],"sourcesContent":["console.log( 42 );\\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE"}' ); unlinkSync('output.js.map'); } }); rollup-3.29.4/test/cli/samples/sourcemap-hidden/main.js000066400000000000000000000000231450520414700230260ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/cli/samples/sourcemap-newline/000077500000000000000000000000001450520414700217575ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/sourcemap-newline/_config.js000066400000000000000000000003771450520414700237300ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'adds a newline after the sourceMappingURL comment (#756)', command: 'rollup -i main.js -f es -m inline', result: code => { assert.equal(code.slice(-1), '\n'); } }); rollup-3.29.4/test/cli/samples/sourcemap-newline/main.js000066400000000000000000000000231450520414700232340ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/cli/samples/stdin/000077500000000000000000000000001450520414700174435ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/commonjs/000077500000000000000000000000001450520414700212705ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/commonjs/_config.js000066400000000000000000000003331450520414700232310ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses stdin to inline a require()', skipIfWindows: true, command: `echo 'console.log(require("./add.js")(2, 1));' | rollup --stdin=js -p commonjs -f cjs --exports=auto` }); rollup-3.29.4/test/cli/samples/stdin/commonjs/_expected.js000066400000000000000000000000671450520414700235710ustar00rootroot00000000000000'use strict'; console.log(require("./add.js")(2, 1)); rollup-3.29.4/test/cli/samples/stdin/commonjs/add.js000066400000000000000000000000421450520414700223520ustar00rootroot00000000000000module.exports = (x, y) => x + y; rollup-3.29.4/test/cli/samples/stdin/config-file/000077500000000000000000000000001450520414700216255ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/config-file/_config.js000066400000000000000000000004521450520414700235700ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not replace input with stdin but allows referencing it when using a config file', skipIfWindows: true, command: `echo "import {PRINT as p} from './a'; import C from './b'; 0 && fail() || p(C); export {C as value, p as print}" | rollup -c` }); rollup-3.29.4/test/cli/samples/stdin/config-file/_expected/000077500000000000000000000000001450520414700235655ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/config-file/_expected/cjs.js000066400000000000000000000001661450520414700247050ustar00rootroot00000000000000'use strict'; const PRINT = x => console.log(x); var C = 123; PRINT(C); exports.print = PRINT; exports.value = C; rollup-3.29.4/test/cli/samples/stdin/config-file/_expected/es.js000066400000000000000000000001441450520414700245310ustar00rootroot00000000000000const PRINT = x => console.log(x); var C = 123; PRINT(C); export { PRINT as print, C as value }; rollup-3.29.4/test/cli/samples/stdin/config-file/_expected/no-stdin.js000066400000000000000000000000661450520414700256600ustar00rootroot00000000000000const PRINT = x => console.log(x); export { PRINT }; rollup-3.29.4/test/cli/samples/stdin/config-file/a.mjs000066400000000000000000000000521450520414700225550ustar00rootroot00000000000000export const PRINT = x => console.log(x); rollup-3.29.4/test/cli/samples/stdin/config-file/b.mjs000066400000000000000000000000241450520414700225550ustar00rootroot00000000000000export default 123; rollup-3.29.4/test/cli/samples/stdin/config-file/rollup.config.mjs000066400000000000000000000004141450520414700251200ustar00rootroot00000000000000export default [ { input: '-', output: { file: '_actual/cjs.js', format: 'cjs' } }, { input: '-', output: { file: '_actual/es.js', format: 'es' } }, { input: 'a.mjs', output: { file: '_actual/no-stdin.js', format: 'es' } } ]; rollup-3.29.4/test/cli/samples/stdin/force-stdin-tty/000077500000000000000000000000001450520414700224765ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/force-stdin-tty/_config.js000066400000000000000000000003061450520414700244370ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows forcing stdin input on TTY interfaces via option', skipIfWindows: true, command: `echo "console.log('PASS');" | ./wrapper.js -f es --stdin` }); rollup-3.29.4/test/cli/samples/stdin/force-stdin-tty/_expected.js000077500000000000000000000000251450520414700247740ustar00rootroot00000000000000console.log('PASS'); rollup-3.29.4/test/cli/samples/stdin/force-stdin-tty/wrapper.js000077500000000000000000000001341450520414700245150ustar00rootroot00000000000000#!/usr/bin/env node process.stdin.isTTY = true; require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/stdin/json/000077500000000000000000000000001450520414700204145ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/json/_config.js000066400000000000000000000002731450520414700223600ustar00rootroot00000000000000module.exports = defineTest({ description: 'pipe JSON over stdin to create a module', skipIfWindows: true, command: `echo '{"foo": 42, "bar": "ok"}' | rollup --stdin=json -p json` }); rollup-3.29.4/test/cli/samples/stdin/json/_expected.js000066400000000000000000000001441450520414700227110ustar00rootroot00000000000000var foo = 42; var bar = "ok"; var _ = { foo: foo, bar: bar }; export { bar, _ as default, foo }; rollup-3.29.4/test/cli/samples/stdin/no-dash/000077500000000000000000000000001450520414700207745ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/no-dash/_config.js000066400000000000000000000003031450520414700227320ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses stdin input when piping into Rollup without an input', skipIfWindows: true, command: `echo "0 && fail() || console.log('PASS');" | rollup` }); rollup-3.29.4/test/cli/samples/stdin/no-dash/_expected.js000066400000000000000000000000251450520414700232670ustar00rootroot00000000000000console.log('PASS'); rollup-3.29.4/test/cli/samples/stdin/no-stdin-config-file/000077500000000000000000000000001450520414700233565ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/no-stdin-config-file/-.mjs000066400000000000000000000000521450520414700242220ustar00rootroot00000000000000export const PRINT = x => console.log(x); rollup-3.29.4/test/cli/samples/stdin/no-stdin-config-file/_config.js000066400000000000000000000002741450520414700253230ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows using "-" as a regular file name via flag', skipIfWindows: true, command: `echo "console.log('IGNORED');" | rollup -c --no-stdin` }); rollup-3.29.4/test/cli/samples/stdin/no-stdin-config-file/_expected/000077500000000000000000000000001450520414700253165ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/no-stdin-config-file/_expected/cjs.js000066400000000000000000000001121450520414700264250ustar00rootroot00000000000000'use strict'; const PRINT = x => console.log(x); exports.PRINT = PRINT; rollup-3.29.4/test/cli/samples/stdin/no-stdin-config-file/_expected/es.js000066400000000000000000000000601450520414700262570ustar00rootroot00000000000000const PRINT = x => console.log(x); PRINT('a'); rollup-3.29.4/test/cli/samples/stdin/no-stdin-config-file/a.mjs000066400000000000000000000000561450520414700243120ustar00rootroot00000000000000import { PRINT } from './-.mjs'; PRINT('a'); rollup-3.29.4/test/cli/samples/stdin/no-stdin-config-file/rollup.config.mjs000066400000000000000000000002671450520414700266570ustar00rootroot00000000000000export default [ { input: '-', output: { file: '_actual/cjs.js', format: 'cjs' } }, { input: 'a.mjs', output: { file: '_actual/es.js', format: 'es' } } ]; rollup-3.29.4/test/cli/samples/stdin/no-stdin-tty/000077500000000000000000000000001450520414700220145ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/no-stdin-tty/_config.js000066400000000000000000000005211450520414700237540ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'does not use input as stdin on TTY interfaces', skipIfWindows: true, command: `echo "console.log('PASS');" | ./wrapper.js -f es`, error(error) { assertIncludes(error.message, 'You must supply options.input to rollup'); } }); rollup-3.29.4/test/cli/samples/stdin/no-stdin-tty/wrapper.js000077500000000000000000000001341450520414700240330ustar00rootroot00000000000000#!/usr/bin/env node process.stdin.isTTY = true; require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/stdin/self-import/000077500000000000000000000000001450520414700217045ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/self-import/_config.js000066400000000000000000000002561450520414700236510ustar00rootroot00000000000000module.exports = defineTest({ description: 'stdin input of code that imports a copy of itself', skipIfWindows: true, command: `cat input.txt | rollup -f cjs --silent` }); rollup-3.29.4/test/cli/samples/stdin/self-import/_expected.js000066400000000000000000000002361450520414700242030ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); let b = 2; var a = 4; console.log(a, b); exports.b = b; exports.default = a; rollup-3.29.4/test/cli/samples/stdin/self-import/input.txt000066400000000000000000000002151450520414700236020ustar00rootroot00000000000000import a from "-"; import { b as c } from "-"; export let b = 2; export default 4; if (a > c) console.log(a, c); else console.log(c, a); rollup-3.29.4/test/cli/samples/stdin/stdin-error/000077500000000000000000000000001450520414700217135ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/stdin-error/_config.js000066400000000000000000000003751450520414700236620ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'handles stdin errors', command: `node wrapper.js`, error(error) { assertIncludes(error.message, 'Could not load -: Stream is broken.'); } }); rollup-3.29.4/test/cli/samples/stdin/stdin-error/wrapper.js000077500000000000000000000004731450520414700237400ustar00rootroot00000000000000#!/usr/bin/env node const { Readable } = require('stream'); delete process.stdin; process.stdin = new Readable({ encoding: 'utf8', read() { const error = new Error('Stream is broken.'); return this.destroy ? this.destroy(error) : this.emit('error', error); } }); require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/stdin/with-dash/000077500000000000000000000000001450520414700213335ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdin/with-dash/_config.js000066400000000000000000000002501450520414700232720ustar00rootroot00000000000000module.exports = defineTest({ description: 'stdin input with dash on CLI', skipIfWindows: true, command: `echo "0 && fail() || console.log('PASS');" | rollup -` }); rollup-3.29.4/test/cli/samples/stdin/with-dash/_expected.js000066400000000000000000000000251450520414700236260ustar00rootroot00000000000000console.log('PASS'); rollup-3.29.4/test/cli/samples/stdout-code-splitting/000077500000000000000000000000001450520414700225675ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdout-code-splitting/_config.js000066400000000000000000000013341450520414700245320ustar00rootroot00000000000000const assert = require('node:assert'); const COLOR = '\u001B[36m\u001B[1m'; const STANDARD = '\u001B[22m\u001B[39m'; module.exports = defineTest({ description: 'bundles multiple files to stdout while adding file names', skipIfWindows: true, command: 'node wrapper.js -i main1.js -i main2.js -f es ' + `-p '{buildStart(){this.emitFile({type: "asset",source:"Hello"})}}'`, env: { FORCE_COLOR: '1', TERM: 'xterm' }, result(code) { assert.equal( code, '\n' + `${COLOR}//→ main1.js:${STANDARD}\n` + "console.log('main1');\n" + '\n' + `${COLOR}//→ main2.js:${STANDARD}\n` + "console.log('main2');\n" + '\n' + `${COLOR}//→ assets/asset-185f8db3:${STANDARD}\n` + 'Hello' ); } }); rollup-3.29.4/test/cli/samples/stdout-code-splitting/main1.js000066400000000000000000000000261450520414700241300ustar00rootroot00000000000000console.log('main1'); rollup-3.29.4/test/cli/samples/stdout-code-splitting/main2.js000066400000000000000000000000261450520414700241310ustar00rootroot00000000000000console.log('main2'); rollup-3.29.4/test/cli/samples/stdout-code-splitting/wrapper.js000077500000000000000000000001321450520414700246040ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; require('../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/stdout-only-inline-sourcemaps/000077500000000000000000000000001450520414700242565ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdout-only-inline-sourcemaps/_config.js000066400000000000000000000005411450520414700262200ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'fails when using non-inline sourcemaps when bundling to stdout', command: 'rollup -i main.js -f es -m', error: () => true, stderr: stderr => { assertIncludes(stderr, '[!] Only inline sourcemaps are supported when bundling to stdout.\n'); } }); rollup-3.29.4/test/cli/samples/stdout-only-inline-sourcemaps/main.js000066400000000000000000000000231450520414700255330ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/cli/samples/stdout-single-input/000077500000000000000000000000001450520414700222605ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/stdout-single-input/_config.js000066400000000000000000000002301450520414700242150ustar00rootroot00000000000000module.exports = defineTest({ description: 'bundles a single input to stdout without modifications', command: 'rollup -i main.js -f es -m inline' }); rollup-3.29.4/test/cli/samples/stdout-single-input/_expected.js000066400000000000000000000004401450520414700245540ustar00rootroot00000000000000console.log( 42 ); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibWFpbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zb2xlLmxvZyggNDIgKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSJ9 rollup-3.29.4/test/cli/samples/stdout-single-input/main.js000066400000000000000000000000231450520414700235350ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/cli/samples/symlinked-config/000077500000000000000000000000001450520414700215645ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/symlinked-config/_config.js000066400000000000000000000002131450520414700235220ustar00rootroot00000000000000module.exports = defineTest({ description: 'loads a symlinked config file', command: 'rollup -c --bundleConfigAsCjs', execute: true }); rollup-3.29.4/test/cli/samples/symlinked-config/main.js000066400000000000000000000000321450520414700230410ustar00rootroot00000000000000assert.equal(ANSWER, 42); rollup-3.29.4/test/cli/samples/symlinked-config/rollup.config.js000077700000000000000000000000001450520414700314002rollup.config.symlinkedustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/symlinked-config/rollup.config.symlinked000066400000000000000000000002621450520414700262660ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }; rollup-3.29.4/test/cli/samples/symlinked-named-config/000077500000000000000000000000001450520414700226465ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/symlinked-named-config/_config.js000066400000000000000000000002711450520414700246100ustar00rootroot00000000000000module.exports = defineTest({ description: 'loads a symlinked config file with the given name', command: 'rollup --config my.rollup.config.js --bundleConfigAsCjs', execute: true }); rollup-3.29.4/test/cli/samples/symlinked-named-config/main.js000066400000000000000000000000321450520414700241230ustar00rootroot00000000000000assert.equal(ANSWER, 42); rollup-3.29.4/test/cli/samples/symlinked-named-config/my.rollup.config.js000077700000000000000000000000001450520414700331062rollup.config.symlinkedustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/symlinked-named-config/rollup.config.symlinked000066400000000000000000000002711450520414700273500ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace({ preventAssignment: true, 'ANSWER': 42 }) ] }; rollup-3.29.4/test/cli/samples/treeshake-preset-override/000077500000000000000000000000001450520414700234125ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/treeshake-preset-override/_config.js000066400000000000000000000003411450520414700253520ustar00rootroot00000000000000module.exports = defineTest({ description: 'overrides the treeshake option when using presets', command: 'rollup --config --treeshake recommended --treeshake.unknownGlobalSideEffects --no-treeshake.moduleSideEffects' }); rollup-3.29.4/test/cli/samples/treeshake-preset-override/_expected.js000066400000000000000000000004171450520414700257120ustar00rootroot00000000000000console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/cli/samples/treeshake-preset-override/dep.js000066400000000000000000000000241450520414700245140ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/cli/samples/treeshake-preset-override/main.js000066400000000000000000000004421450520414700246740ustar00rootroot00000000000000import './dep.js'; console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test();rollup-3.29.4/test/cli/samples/treeshake-preset-override/rollup.config.mjs000066400000000000000000000002311450520414700267020ustar00rootroot00000000000000export default { input: 'main.js', treeshake: { unknownGlobalSideEffects: false, tryCatchDeoptimization: false }, output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/treeshake-unknown-preset/000077500000000000000000000000001450520414700232725ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/treeshake-unknown-preset/_config.js000066400000000000000000000010631450520414700252340ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'overrides the treeshake option when using presets', command: 'rollup main.js --format es --treeshake unknown', error: () => true, stderr: stderr => { assertIncludes( stderr, '[!] RollupError: Invalid value "unknown" for option "treeshake" - valid values are false, true, "recommended", "safest" and "smallest". You can also supply an object for more fine-grained control.\n' + 'https://rollupjs.org/configuration-options/#treeshake' ); } }); rollup-3.29.4/test/cli/samples/treeshake-unknown-preset/main.js000066400000000000000000000000251450520414700245510ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-error/000077500000000000000000000000001450520414700243565ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-error/_config.js000066400000000000000000000010061450520414700263150ustar00rootroot00000000000000const assert = require('node:assert'); const { assertIncludes, assertDoesNotInclude } = require('../../../utils.js'); module.exports = defineTest({ description: 'does not show unfulfilled hook actions if there are errors', command: 'node build.mjs', after(error) { // exit code check has to be here as error(err) is only called upon failure assert.strictEqual(error, null); }, stderr(stderr) { assertIncludes(stderr, 'Error: Error must be displayed.'); assertDoesNotInclude(stderr, 'Unfinished'); } }); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-error/_expected.js000066400000000000000000000000001450520414700266420ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-error/a.js000066400000000000000000000000221450520414700251260ustar00rootroot00000000000000console.log('a'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-error/b.js000066400000000000000000000000221450520414700251270ustar00rootroot00000000000000console.log('b'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-error/build.mjs000066400000000000000000000010621450520414700261670ustar00rootroot00000000000000import { rollup } from 'rollup'; let resolveA; const waitForA = new Promise(resolve => (resolveA = resolve)); try { // The error must not be swallowed when using top-level-await await rollup({ input: './index.js', plugins: [ { name: 'test', transform(code, id) { if (id.endsWith('a.js')) { resolveA(); return new Promise(() => {}); } if (id.endsWith('b.js')) { return waitForA.then(() => Promise.reject(new Error('Error must be displayed.'))); } } } ] }); } catch (err) { console.error(err); } rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-error/c.js000066400000000000000000000000221450520414700251300ustar00rootroot00000000000000console.log('c'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-error/index.js000066400000000000000000000000631450520414700260220ustar00rootroot00000000000000import './a.js'; import './b.js'; import './c.js'; rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-manual-exit/000077500000000000000000000000001450520414700254515ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-manual-exit/_config.js000066400000000000000000000010671450520414700274170ustar00rootroot00000000000000const assert = require('node:assert'); const { assertDoesNotInclude } = require('../../../utils'); const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'does not show unfulfilled hook actions when exiting manually with a non-zero exit code', command: 'rollup -c --silent', after(error) { assert.strictEqual(error && error.code, 1); }, error() { // do not abort test upon error return true; }, stderr(stderr) { assertDoesNotInclude(stderr, 'Unfinished'); assertIncludes(stderr, 'Manual exit'); } }); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-manual-exit/_expected.js000066400000000000000000000000001450520414700277350ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-manual-exit/a.js000066400000000000000000000000221450520414700262210ustar00rootroot00000000000000console.log('a'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-manual-exit/b.js000066400000000000000000000000221450520414700262220ustar00rootroot00000000000000console.log('b'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-manual-exit/c.js000066400000000000000000000000221450520414700262230ustar00rootroot00000000000000console.log('c'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-manual-exit/index.js000066400000000000000000000000631450520414700271150ustar00rootroot00000000000000import './a.js'; import './b.js'; import './c.js'; rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions-manual-exit/rollup.config.js000066400000000000000000000007461450520414700305770ustar00rootroot00000000000000let resolveA; const waitForA = new Promise(resolve => (resolveA = resolve)); module.exports = { input: './index.js', plugins: [ { name: 'test', transform(code, id) { if (id.endsWith('a.js')) { resolveA(); return new Promise(() => {}); } if (id.endsWith('b.js')) { return waitForA.then(() => { console.error('Manual exit'); process.exit(1); return new Promise(() => {}); }); } } } ], output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/000077500000000000000000000000001450520414700232275ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/_config.js000066400000000000000000000021041450520414700251660ustar00rootroot00000000000000const assert = require('node:assert'); const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'show errors with non-zero exit code for unfulfilled async plugin actions on exit', command: 'rollup -c --silent', after(error) { // exit code check has to be here as error(err) is only called upon failure assert.strictEqual(error && error.code, 1); }, error() { // do not abort test upon error return true; }, stderr(stderr) { console.error(stderr); assertIncludes( stderr, 'Error: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:' ); // these unfulfilled async hook actions may occur in random order assertIncludes(stderr, '(buggy-plugin) resolveId "./c.js" "main.js"'); assertIncludes(stderr, '(buggy-plugin) load "./b.js"'); assertIncludes(stderr, '(buggy-plugin) transform "./a.js"'); assertIncludes(stderr, '(buggy-plugin) moduleParsed "./d.js"'); assertIncludes(stderr, '(buggy-plugin) shouldTransformCachedModule "./e.js"'); } }); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/_expected.js000066400000000000000000000000001450520414700255130ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/a.js000066400000000000000000000000221450520414700237770ustar00rootroot00000000000000console.log('a'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/b.js000066400000000000000000000000221450520414700240000ustar00rootroot00000000000000console.log('b'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/c.js000066400000000000000000000000221450520414700240010ustar00rootroot00000000000000console.log('c'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/d.js000066400000000000000000000000221450520414700240020ustar00rootroot00000000000000console.log('d'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/e.js000066400000000000000000000000221450520414700240030ustar00rootroot00000000000000console.log('e'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/main.js000066400000000000000000000001521450520414700245070ustar00rootroot00000000000000import './a.js'; import './b.js'; import './c.js'; import './d.js'; import './e.js'; console.log('main'); rollup-3.29.4/test/cli/samples/unfulfilled-hook-actions/rollup.config.js000066400000000000000000000027141450520414700263520ustar00rootroot00000000000000const path = require('node:path'); const acorn = require('acorn'); function relative(id) { if (id[0] !== '/') return id; if (id[0] !== '\\') return id; return './' + path.relative(process.cwd(), id); } const moduleECode = "console.log('e');\n"; module.exports = { input: 'main.js', cache: { modules: [ { id: './e.js', ast: acorn.parse(moduleECode, { ecmaVersion: 6, sourceType: 'module' }), code: moduleECode, dependencies: [], customTransformCache: false, originalCode: moduleECode, originalSourcemap: null, resolvedIds: {}, sourcemapChain: [], transformDependencies: [] } ] }, plugins: [ { name: 'buggy-plugin', resolveId(id) { if (id.includes('\0')) return; // this action will never resolve or reject if (id.endsWith('c.js')) return new Promise(() => {}); return relative(id); }, load(id) { // this action will never resolve or reject if (id.endsWith('b.js')) return new Promise(() => {}); }, transform(code, id) { // this action will never resolve or reject if (id.endsWith('a.js')) return new Promise(() => {}); }, moduleParsed({ id }) { // this action will never resolve or reject if (id.endsWith('d.js')) return new Promise(() => {}); }, shouldTransformCachedModule({ id }) { // this action will never resolve or reject if (id.endsWith('e.js')) return new Promise(() => {}); } } ], output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/validate/000077500000000000000000000000001450520414700201135ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/validate/_config.js000066400000000000000000000010051450520414700220510ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'use CLI --validate to test whether output is well formed', skipIfWindows: true, command: `rollup main.js --outro 'console.log("end"); /*' -o _actual/out.js --validate`, error: () => true, stderr: stderr => assertIncludes( stderr, `(!) Chunk "out.js" is not valid JavaScript: Unterminated comment (3:20). out.js (3:20) 1: console.log(2 ); 2: 3: console.log("end"); /* ^` ) }); rollup-3.29.4/test/cli/samples/validate/main.js000066400000000000000000000000301450520414700213660ustar00rootroot00000000000000console.log(1 ? 2 : 3); rollup-3.29.4/test/cli/samples/wait-for-bundle-input-object/000077500000000000000000000000001450520414700237225ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/wait-for-bundle-input-object/_config.js000066400000000000000000000013201450520414700256600ustar00rootroot00000000000000const { unlinkSync } = require('node:fs'); const path = require('node:path'); const { atomicWriteFileSync } = require('../../../utils'); let second; let third; module.exports = defineTest({ description: 'waits for multiple named bundle inputs', command: 'rollup -c --waitForBundleInput', before() { second = path.resolve(__dirname, 'second.js'); third = path.resolve(__dirname, 'third.js'); }, after() { unlinkSync(second); unlinkSync(third); }, abortOnStderr(data) { if (data.includes('waiting for input second')) { atomicWriteFileSync(second, "export default 'second'"); } else if (data.includes('waiting for input third')) { atomicWriteFileSync(third, "export default 'third'"); } } }); rollup-3.29.4/test/cli/samples/wait-for-bundle-input-object/_expected/000077500000000000000000000000001450520414700256625ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/wait-for-bundle-input-object/_expected/first.js000066400000000000000000000000631450520414700273460ustar00rootroot00000000000000var first = 'first'; export { first as default }; rollup-3.29.4/test/cli/samples/wait-for-bundle-input-object/_expected/second.js000066400000000000000000000000661450520414700274750ustar00rootroot00000000000000var second = 'second'; export { second as default }; rollup-3.29.4/test/cli/samples/wait-for-bundle-input-object/_expected/third.js000066400000000000000000000000631450520414700273310ustar00rootroot00000000000000var third = 'third'; export { third as default }; rollup-3.29.4/test/cli/samples/wait-for-bundle-input-object/first.js000066400000000000000000000000301450520414700254000ustar00rootroot00000000000000export default 'first'; rollup-3.29.4/test/cli/samples/wait-for-bundle-input-object/rollup.config.js000066400000000000000000000002121450520414700270340ustar00rootroot00000000000000module.exports = { input: { first: 'first', second: 'second', third: 'third' }, output: { format: 'es', dir: '_actual' } }; rollup-3.29.4/test/cli/samples/wait-for-bundle-input/000077500000000000000000000000001450520414700224565ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/wait-for-bundle-input/_config.js000066400000000000000000000012101450520414700244120ustar00rootroot00000000000000const { unlinkSync } = require('node:fs'); const path = require('node:path'); const { atomicWriteFileSync } = require('../../../utils'); let mainFile; module.exports = defineTest({ description: 'waits for bundle input', command: 'rollup -c --waitForBundleInput', before() { mainFile = path.resolve(__dirname, 'main.js'); }, after() { unlinkSync(mainFile); }, abortOnStderr(data) { if (data.includes('waiting for input main.js')) { // wait longer than one polling interval setTimeout(() => atomicWriteFileSync(mainFile, 'export default 42;'), 600); } // We wait for a regular abort as we do not watch return false; } }); rollup-3.29.4/test/cli/samples/wait-for-bundle-input/_expected.js000066400000000000000000000000541450520414700247530ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/cli/samples/wait-for-bundle-input/rollup.config.js000066400000000000000000000001061450520414700255720ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/warn-broken-sourcemap/000077500000000000000000000000001450520414700225435ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-broken-sourcemap/_config.js000066400000000000000000000011721450520414700245060ustar00rootroot00000000000000const { unlinkSync } = require('node:fs'); const path = require('node:path'); const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'displays warnings for broken sourcemaps', command: 'rollup -c', stderr: stderr => { unlinkSync(path.resolve(__dirname, 'bundle')); unlinkSync(path.resolve(__dirname, 'bundle.map')); assertIncludes( stderr, '(!) Broken sourcemap\n' + 'https://rollupjs.org/troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect\n' + 'Plugins that transform code (such as "test-plugin1") should generate accompanying sourcemaps.\n' ); } }); rollup-3.29.4/test/cli/samples/warn-broken-sourcemap/main.js000066400000000000000000000000251450520414700240220ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/cli/samples/warn-broken-sourcemap/rollup.config.js000066400000000000000000000003211450520414700256560ustar00rootroot00000000000000module.exports = { input: 'main.js', plugins: [ { name: 'test-plugin1', transform(code) { return code + '/*1*/'; } } ], output: { format: 'es', file: 'bundle', sourcemap: true } }; rollup-3.29.4/test/cli/samples/warn-broken-sourcemaps/000077500000000000000000000000001450520414700227265ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-broken-sourcemaps/_config.js000066400000000000000000000012321450520414700246660ustar00rootroot00000000000000const { unlinkSync } = require('node:fs'); const path = require('node:path'); const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'displays warnings for broken sourcemaps', command: 'rollup -c', stderr: stderr => { unlinkSync(path.resolve(__dirname, 'bundle')); unlinkSync(path.resolve(__dirname, 'bundle.map')); assertIncludes( stderr, '(!) Broken sourcemap\n' + 'https://rollupjs.org/troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect\n' + 'Plugins that transform code (such as "test-plugin1", "test-plugin2" and "test-plugin3") should generate accompanying sourcemaps' ); } }); rollup-3.29.4/test/cli/samples/warn-broken-sourcemaps/main.js000066400000000000000000000000251450520414700242050ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/cli/samples/warn-broken-sourcemaps/rollup.config.js000066400000000000000000000005771450520414700260560ustar00rootroot00000000000000module.exports = { input: 'main.js', plugins: [ { name: 'test-plugin1', transform(code) { return code + '/*1*/'; } }, { name: 'test-plugin2', transform(code) { return code + '/*2*/'; } }, { name: 'test-plugin3', transform(code) { return code + '/*3*/'; } } ], output: { format: 'es', file: 'bundle', sourcemap: true } }; rollup-3.29.4/test/cli/samples/warn-circular-multiple/000077500000000000000000000000001450520414700227245ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-circular-multiple/_config.js000066400000000000000000000006331450520414700246700ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns for multiple circular dependencies', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, '(!) Circular dependencies\n' + 'main.js -> dep1.js -> main.js\n' + 'main.js -> dep2.js -> main.js\n' + 'main.js -> dep3.js -> main.js\n' + '...and 3 more\n' + '' ) }); rollup-3.29.4/test/cli/samples/warn-circular-multiple/dep1.js000066400000000000000000000000511450520414700241070ustar00rootroot00000000000000import './main.js'; console.log('dep1'); rollup-3.29.4/test/cli/samples/warn-circular-multiple/dep2.js000066400000000000000000000000511450520414700241100ustar00rootroot00000000000000import './main.js'; console.log('dep2'); rollup-3.29.4/test/cli/samples/warn-circular-multiple/dep3.js000066400000000000000000000000511450520414700241110ustar00rootroot00000000000000import './main.js'; console.log('dep3'); rollup-3.29.4/test/cli/samples/warn-circular-multiple/dep4.js000066400000000000000000000000511450520414700241120ustar00rootroot00000000000000import './main.js'; console.log('dep5'); rollup-3.29.4/test/cli/samples/warn-circular-multiple/dep5.js000066400000000000000000000000511450520414700241130ustar00rootroot00000000000000import './main.js'; console.log('dep5'); rollup-3.29.4/test/cli/samples/warn-circular-multiple/dep6.js000066400000000000000000000000511450520414700241140ustar00rootroot00000000000000import './main.js'; console.log('dep6'); rollup-3.29.4/test/cli/samples/warn-circular-multiple/main.js000066400000000000000000000002151450520414700242040ustar00rootroot00000000000000import './dep1.js'; import './dep2.js'; import './dep3.js'; import './dep4.js'; import './dep5.js'; import './dep6.js'; console.log('main'); rollup-3.29.4/test/cli/samples/warn-circular-multiple/rollup.config.js000066400000000000000000000001061450520414700260400ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/warn-circular/000077500000000000000000000000001450520414700210735ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-circular/_config.js000066400000000000000000000004161450520414700230360ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns for circular dependencies', command: 'rollup -c', stderr(stderr) { assertIncludes(stderr, '(!) Circular dependency\nmain.js -> dep.js -> main.js\n'); } }); rollup-3.29.4/test/cli/samples/warn-circular/dep.js000066400000000000000000000000501450520414700221740ustar00rootroot00000000000000import './main.js'; console.log('dep'); rollup-3.29.4/test/cli/samples/warn-circular/main.js000066400000000000000000000000501450520414700223500ustar00rootroot00000000000000import './dep.js'; console.log('main'); rollup-3.29.4/test/cli/samples/warn-circular/rollup.config.js000066400000000000000000000001061450520414700242070ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/warn-eval-multiple/000077500000000000000000000000001450520414700220475ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-eval-multiple/_config.js000066400000000000000000000015201450520414700240070ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns when eval is used multiple times', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, '(!) Use of eval is strongly discouraged\n' + 'https://rollupjs.org/troubleshooting/#avoiding-eval\n' + 'dep1.js\n' + '1: eval(\'console.log("Hello");\');\n' + ' ^\n' + 'dep2.js\n' + '1: eval(\'console.log("Hello");\');\n' + ' ^\n' + '2: eval(\'console.log("Hello again");\');\n' + '...and 1 other occurrence\n' + 'dep3.js\n' + '1: eval(\'console.log("Hello");\');\n' + ' ^\n' + '2: eval(\'console.log("Hello again");\');\n' + '3: eval(\'console.log("Hello again and again");\');\n' + '...and 2 other occurrences\n' + '\n' + '...and 3 other files' ) }); rollup-3.29.4/test/cli/samples/warn-eval-multiple/dep1.js000066400000000000000000000000371450520414700232360ustar00rootroot00000000000000eval('console.log("Hello");'); rollup-3.29.4/test/cli/samples/warn-eval-multiple/dep2.js000066400000000000000000000001041450520414700232320ustar00rootroot00000000000000eval('console.log("Hello");'); eval('console.log("Hello again");'); rollup-3.29.4/test/cli/samples/warn-eval-multiple/dep3.js000066400000000000000000000001631450520414700232400ustar00rootroot00000000000000eval('console.log("Hello");'); eval('console.log("Hello again");'); eval('console.log("Hello again and again");'); rollup-3.29.4/test/cli/samples/warn-eval-multiple/dep4.js000066400000000000000000000000371450520414700232410ustar00rootroot00000000000000eval('console.log("Hello");'); rollup-3.29.4/test/cli/samples/warn-eval-multiple/dep5.js000066400000000000000000000000371450520414700232420ustar00rootroot00000000000000eval('console.log("Hello");'); rollup-3.29.4/test/cli/samples/warn-eval-multiple/main.js000066400000000000000000000001621450520414700233300ustar00rootroot00000000000000import './dep1.js'; import './dep2.js'; import './dep3.js'; import './dep4.js'; import './dep5.js'; eval('foo'); rollup-3.29.4/test/cli/samples/warn-eval-multiple/rollup.config.js000066400000000000000000000001061450520414700251630ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/warn-eval/000077500000000000000000000000001450520414700202165ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-eval/_config.js000066400000000000000000000005661450520414700221670ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns when eval is used', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, '(!) Use of eval is strongly discouraged\n' + 'https://rollupjs.org/troubleshooting/#avoiding-eval\n' + 'main.js\n' + "1: eval('foo');\n" + ' ^' ) }); rollup-3.29.4/test/cli/samples/warn-eval/main.js000066400000000000000000000000151450520414700214740ustar00rootroot00000000000000eval('foo'); rollup-3.29.4/test/cli/samples/warn-eval/rollup.config.js000066400000000000000000000001061450520414700233320ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/warn-import-export/000077500000000000000000000000001450520414700221205ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-import-export/_config.js000066400000000000000000000037031450520414700240650ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns about import and export related issues', command: 'rollup -c', stderr: stderr => { assertIncludes( stderr, '(!) Mixing named and default exports\n' + 'https://rollupjs.org/configuration-options/#output-exports\n' + 'The following entry modules are using named and default exports together:\n' + 'main.js\n' + '\n' + 'Consumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.\n' ); assertIncludes( stderr, '(!) Unused external imports\n' + `default imported from external module "external" but never used in "main.js".\n` ); assertIncludes( stderr, '(!) Missing exports\n' + 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module\n' + 'main.js\n' + 'missing is not exported by dep.js\n' + "4: import 'unresolvedExternal';\n" + '5: \n' + '6: export const missing = dep.missing;\n' + ' ^\n' + '7: export default 42;\n' + 'main.js\n' + 'default is not exported by dep.js\n' + "1: import unused from 'external';\n" + "2: import * as dep from './dep.js';\n" + "3: import alsoUnused from './dep.js';\n" + ' ^\n' + "4: import 'unresolvedExternal';\n" ); assertIncludes( stderr, '(!) Conflicting re-exports\n' + '"main.js" re-exports "foo" from both "dep.js" and "dep2.js" (will be ignored).\n' + '"main.js" re-exports "bar" from both "dep.js" and "dep2.js" (will be ignored).\n' ); assertIncludes( stderr, '(!) Unresolved dependencies\n' + 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency\n' + 'unresolvedExternal (imported by "main.js" and "dep.js")\n' + 'otherUnresolvedExternal (imported by "dep.js")\n' ); } }); rollup-3.29.4/test/cli/samples/warn-import-export/dep.js000066400000000000000000000002021450520414700232200ustar00rootroot00000000000000import 'unresolvedExternal'; import 'otherUnresolvedExternal'; export const foo = 1; export const bar = 2; export const baz = 3; rollup-3.29.4/test/cli/samples/warn-import-export/dep2.js000066400000000000000000000001031450520414700233020ustar00rootroot00000000000000export const foo = 4; export const bar = 5; export const quux = 6; rollup-3.29.4/test/cli/samples/warn-import-export/main.js000066400000000000000000000003561450520414700234060ustar00rootroot00000000000000import unused from 'external'; import * as dep from './dep.js'; import alsoUnused from './dep.js'; import 'unresolvedExternal'; export const missing = dep.missing; export default 42; export * from './dep.js'; export * from './dep2.js'; rollup-3.29.4/test/cli/samples/warn-import-export/rollup.config.js000066400000000000000000000001401450520414700252320ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['external'], output: { format: 'cjs' } }; rollup-3.29.4/test/cli/samples/warn-missing-global-multiple/000077500000000000000000000000001450520414700240275ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-missing-global-multiple/_config.js000066400000000000000000000010571450520414700257740ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns when there are multiple missing globals', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, '(!) Missing global variable names\n' + 'https://rollupjs.org/configuration-options/#output-globals\n' + 'Use "output.globals" to specify browser global variable names corresponding to external modules:\n' + 'external1 (guessing "foo1")\n' + 'external2 (guessing "foo2")\n' + 'external3 (guessing "foo3")' ) }); rollup-3.29.4/test/cli/samples/warn-missing-global-multiple/main.js000066400000000000000000000001721450520414700253110ustar00rootroot00000000000000import foo1 from 'external1'; import foo2 from 'external2'; import foo3 from 'external3'; console.log(foo1, foo2, foo3); rollup-3.29.4/test/cli/samples/warn-missing-global-multiple/rollup.config.js000066400000000000000000000002161450520414700271450ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['external1', 'external2', 'external3'], output: { format: 'iife', name: 'bundle' } }; rollup-3.29.4/test/cli/samples/warn-missing-global/000077500000000000000000000000001450520414700221765ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-missing-global/_config.js000066400000000000000000000007451450520414700241460ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns when there is a missing global variable name', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, '(!) Missing global variable name\n' + 'https://rollupjs.org/configuration-options/#output-globals\n' + 'Use "output.globals" to specify browser global variable names corresponding to external modules:\n' + 'external (guessing "foo")' ) }); rollup-3.29.4/test/cli/samples/warn-missing-global/main.js000066400000000000000000000000561450520414700234610ustar00rootroot00000000000000import foo from 'external'; console.log(foo); rollup-3.29.4/test/cli/samples/warn-missing-global/rollup.config.js000066400000000000000000000001631450520414700253150ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['external'], output: { format: 'iife', name: 'bundle' } }; rollup-3.29.4/test/cli/samples/warn-mixed-exports-multiple/000077500000000000000000000000001450520414700237305ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-mixed-exports-multiple/_config.js000066400000000000000000000013061450520414700256720ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns when mixed exports are used', command: 'rollup -c', stderr: stderr => { assertIncludes( stderr, '(!) Mixing named and default exports\n' + 'https://rollupjs.org/configuration-options/#output-exports\n' + 'The following entry modules are using named and default exports together:\n' + 'lib1.js\n' + 'lib2.js\n' + 'lib3.js\n' + '...and 3 other entry modules\n' + '\n' + 'Consumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.\n' ); } }); rollup-3.29.4/test/cli/samples/warn-mixed-exports-multiple/lib1.js000066400000000000000000000000551450520414700251150ustar00rootroot00000000000000export const value1 = 42; export default 42; rollup-3.29.4/test/cli/samples/warn-mixed-exports-multiple/lib2.js000066400000000000000000000000551450520414700251160ustar00rootroot00000000000000export const value2 = 42; export default 42; rollup-3.29.4/test/cli/samples/warn-mixed-exports-multiple/lib3.js000066400000000000000000000000551450520414700251170ustar00rootroot00000000000000export const value3 = 42; export default 42; rollup-3.29.4/test/cli/samples/warn-mixed-exports-multiple/lib4.js000066400000000000000000000000551450520414700251200ustar00rootroot00000000000000export const value4 = 42; export default 42; rollup-3.29.4/test/cli/samples/warn-mixed-exports-multiple/lib5.js000066400000000000000000000000551450520414700251210ustar00rootroot00000000000000export const value5 = 42; export default 42; rollup-3.29.4/test/cli/samples/warn-mixed-exports-multiple/main.js000066400000000000000000000006001450520414700252060ustar00rootroot00000000000000import lib1, {value1} from './lib1.js'; console.log(lib1, value1); import lib2, {value2} from './lib2.js'; console.log(lib2, value2); import lib3, {value3} from './lib3.js'; console.log(lib3, value3); import lib4, {value4} from './lib4.js'; console.log(lib4, value4); import lib5, {value5} from './lib5.js'; console.log(lib5, value5); export const value = 42; export default 42; rollup-3.29.4/test/cli/samples/warn-mixed-exports-multiple/rollup.config.js000066400000000000000000000001371450520414700270500ustar00rootroot00000000000000module.exports = { input: 'main.js', preserveModules: true, output: { format: 'amd' } }; rollup-3.29.4/test/cli/samples/warn-multiple/000077500000000000000000000000001450520414700211225ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-multiple/_config.js000066400000000000000000000026461450520414700230740ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'aggregates warnings of different types', command: 'rollup -c', stderr: stderr => { assertIncludes( stderr, '(!) Missing shims for Node.js built-ins\n' + 'Creating a browser bundle that depends on "url", "assert" and "node:path". You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node\n' ); assertIncludes( stderr, '(!) Missing exports\n' + 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module\n' + 'main.js\n' + 'doesNotExist is not exported by dep.js\n' + "4: import assert from 'assert';\n" + "5: import path from 'node:path';\n" + "6: import {doesNotExist, alsoNotFound} from './dep.js';\n" + ' ^\n' + '7: \n' + '8: export {url, assert, path};\n' + 'main.js\n' + 'alsoNotFound is not exported by dep.js\n' + "4: import assert from 'assert';\n" + "5: import path from 'node:path';\n" + "6: import {doesNotExist, alsoNotFound} from './dep.js';\n" + ' ^\n' + '7: \n' + '8: export {url, assert, path};' ); assertIncludes( stderr, '(!) Module level directives cause errors when bundled, "use stuff" in "main.js" was ignored.\n' + 'main.js (1:0)\n' + "1: 'use stuff';\n" + ' ^\n' + '2: \n' + "3: import url from 'url';\n" ); } }); rollup-3.29.4/test/cli/samples/warn-multiple/dep.js000066400000000000000000000000001450520414700222160ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-multiple/main.js000066400000000000000000000002621450520414700224040ustar00rootroot00000000000000'use stuff'; import url from 'url'; import assert from 'assert'; import path from 'node:path'; import {doesNotExist, alsoNotFound} from './dep.js'; export {url, assert, path}; rollup-3.29.4/test/cli/samples/warn-multiple/rollup.config.js000066400000000000000000000001771450520414700242460ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['url', 'assert', 'path'], output: { name: 'bundle', format: 'amd' } }; rollup-3.29.4/test/cli/samples/warn-plugin-loc/000077500000000000000000000000001450520414700213405ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-plugin-loc/_config.js000066400000000000000000000006731450520414700233100ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'correctly adds locations to plugin warnings', command: 'rollup -c', stderr: stderr => { assertIncludes( stderr, '(!) Plugin test: Warning with file and id\n' + 'file1: (1:2)\n' + '(!) Plugin test: Warning with file\n' + 'file2: (2:3)\n' + '(!) Plugin test: Warning with id\n' + 'file-id3: (3:4)\n' ); } }); rollup-3.29.4/test/cli/samples/warn-plugin-loc/main.js000066400000000000000000000000461450520414700226220ustar00rootroot00000000000000console.log("everyday I'm throwing"); rollup-3.29.4/test/cli/samples/warn-plugin-loc/rollup.config.js000066400000000000000000000011461450520414700244610ustar00rootroot00000000000000const path = require('node:path'); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ { name: 'test', buildStart() { this.warn({ message: 'Warning with file and id', file: path.join(__dirname, 'file-id1'), loc: { file: path.join(__dirname, 'file1'), line: 1, column: 2 } }); this.warn({ message: 'Warning with file', loc: { file: path.join(__dirname, 'file2'), line: 2, column: 3 } }); this.warn({ message: 'Warning with id', id: path.join(__dirname, 'file-id3'), loc: { line: 3, column: 4 } }); } } ] }; rollup-3.29.4/test/cli/samples/warn-plugin/000077500000000000000000000000001450520414700205655ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-plugin/_config.js000066400000000000000000000011011450520414700225200ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'displays warnings from plugins', command: 'rollup -c', env: { FORCE_COLOR: undefined, NO_COLOR: true }, stderr: stderr => { assertIncludes(stderr, 'Fifth\nother.js\n'); assertIncludes( stderr, '(!) Plugin test-plugin: First\n' + '(!) Plugin test-plugin: Second\n' + 'https://information\n' + '(!) Plugin second-plugin: Third\n' + 'other.js\n' + '(!) Plugin second-plugin: Fourth\n' + 'other.js: (1:2)\n' + 'custom frame' ); } }); rollup-3.29.4/test/cli/samples/warn-plugin/main.js000066400000000000000000000000251450520414700220440ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/cli/samples/warn-plugin/rollup.config.js000066400000000000000000000013351450520414700237060ustar00rootroot00000000000000const path = require('node:path'); module.exports = { input: 'main.js', plugins: [ { name: 'test-plugin', buildStart() { this.warn('First'); this.warn({ message: 'Second', url: 'https://information' }); this.warn({ message: 'Second', url: 'https://information' }); } } ], output: { format: 'es', plugins: [ { name: 'second-plugin', renderStart() { this.warn({ message: 'Third', id: path.resolve(__dirname, 'other.js') }); this.warn({ message: 'Fourth', id: path.resolve(__dirname, 'other.js'), loc: { line: 1, column: 2 }, frame: 'custom frame' }); this.info({ message: 'Fifth', id: path.resolve(__dirname, 'other.js') }); } } ] } }; rollup-3.29.4/test/cli/samples/warn-this/000077500000000000000000000000001450520414700202365ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-this/_config.js000066400000000000000000000006451450520414700222050ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns "this" is used on the top level', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, '(!) "this" has been rewritten to "undefined"\n' + 'https://rollupjs.org/troubleshooting/#error-this-is-undefined\n' + 'main.js\n' + '1: console.log(this);\n' + ' ^' ) }); rollup-3.29.4/test/cli/samples/warn-this/main.js000066400000000000000000000000231450520414700215130ustar00rootroot00000000000000console.log(this); rollup-3.29.4/test/cli/samples/warn-this/rollup.config.js000066400000000000000000000001631450520414700233550ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['external'], output: { format: 'iife', name: 'bundle' } }; rollup-3.29.4/test/cli/samples/warn-unknown-options/000077500000000000000000000000001450520414700224575ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/warn-unknown-options/_config.js000066400000000000000000000002561450520414700244240ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns about unknown CLI options', command: 'rollup --config rollup.config.js --format es --configAnswer 42 --unknownOption' }); rollup-3.29.4/test/cli/samples/warn-unknown-options/_expected.js000066400000000000000000000000301450520414700247460ustar00rootroot00000000000000assert.equal( 42, 42 ); rollup-3.29.4/test/cli/samples/warn-unknown-options/main.js000066400000000000000000000000341450520414700237360ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-3.29.4/test/cli/samples/warn-unknown-options/rollup.config.js000066400000000000000000000010531450520414700255750ustar00rootroot00000000000000var assert = require('node:assert'); var replace = require('@rollup/plugin-replace'); let warnings = 0; module.exports = commands => ({ input: 'main.js', plugins: [ { generateBundle() { assert.strictEqual(warnings, 1); } }, replace({ preventAssignment: true, ANSWER: commands.configAnswer }) ], onwarn(warning) { warnings++; assert.equal(warning.code, 'UNKNOWN_OPTION'); assert.equal( warning.message, `Unknown CLI flags: unknownOption. Allowed options: ${ require('../../../misc/optionList').flags }` ); } }); rollup-3.29.4/test/cli/samples/watch/000077500000000000000000000000001450520414700174305ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/bundle-error/000077500000000000000000000000001450520414700220305ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/bundle-error/_config.js000066400000000000000000000014611450520414700237740ustar00rootroot00000000000000const { unlinkSync, writeFileSync } = require('node:fs'); const path = require('node:path'); const { atomicWriteFileSync } = require('../../../../utils'); let mainFile; module.exports = defineTest({ description: 'recovers from errors during bundling', command: 'rollup -cw --bundleConfigAsCjs', before() { mainFile = path.resolve(__dirname, 'main.js'); writeFileSync(mainFile, '<=>'); }, after() { // synchronous sometimes does not seem to work, probably because the watch is not yet removed properly setTimeout(() => unlinkSync(mainFile), 300); }, abortOnStderr(data) { if (data.includes('[!] RollupError: Unexpected token')) { setTimeout(() => atomicWriteFileSync(mainFile, 'export default 42;'), 500); return false; } if (data.includes('created _actual')) { return true; } } }); rollup-3.29.4/test/cli/samples/watch/bundle-error/_expected/000077500000000000000000000000001450520414700237705ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/bundle-error/_expected/main.js000066400000000000000000000000541450520414700252510ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/cli/samples/watch/bundle-error/rollup.config.js000066400000000000000000000001261450520414700251460ustar00rootroot00000000000000export default { input: 'main.js', output: { dir: '_actual', format: 'es' } }; rollup-3.29.4/test/cli/samples/watch/clearScreen/000077500000000000000000000000001450520414700216565ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/clearScreen/_config.js000066400000000000000000000007131450520414700236210ustar00rootroot00000000000000const assert = require('node:assert'); const CLEAR_SCREEN = '\u001Bc'; const UNDERLINE = '\u001B[4m'; module.exports = defineTest({ description: 'clears the screen before bundling', command: 'node wrapper.js -cw', env: { FORCE_COLOR: '1', TERM: 'xterm' }, abortOnStderr(data) { if (data.includes('waiting for changes')) { return true; } }, stderr(stderr) { assert.strictEqual(stderr.slice(0, 12), `${CLEAR_SCREEN}${UNDERLINE}rollup`); } }); rollup-3.29.4/test/cli/samples/watch/clearScreen/main.js000066400000000000000000000000231450520414700231330ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/watch/clearScreen/rollup.config.mjs000066400000000000000000000001321450520414700251460ustar00rootroot00000000000000export default { input: 'main.js', output: { file: '_actual.js', format: 'es' } }; rollup-3.29.4/test/cli/samples/watch/clearScreen/wrapper.js000077500000000000000000000002411450520414700236740ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; process.stderr.isTTY = true; process.stderr.hasColors = () => true; require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/watch/close-error/000077500000000000000000000000001450520414700216645ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/close-error/_config.js000066400000000000000000000003611450520414700236260ustar00rootroot00000000000000module.exports = defineTest({ description: 'displays errors when closing the watcher', command: 'rollup -cw', abortOnStderr(data) { if (data.includes('[!] (plugin faulty-close) Error: Close bundle failed')) { return true; } } }); rollup-3.29.4/test/cli/samples/watch/close-error/_expected/000077500000000000000000000000001450520414700236245ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/close-error/_expected/main.js000066400000000000000000000000541450520414700251050ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/cli/samples/watch/close-error/main.js000066400000000000000000000000231450520414700231410ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/watch/close-error/rollup.config.mjs000066400000000000000000000003131450520414700251550ustar00rootroot00000000000000export default { input: 'main.js', plugins: [ { name: 'faulty-close', closeBundle() { throw new Error('Close bundle failed'); } } ], output: { dir: '_actual', format: 'es' } }; rollup-3.29.4/test/cli/samples/watch/close-on-generate-error/000077500000000000000000000000001450520414700240665ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/close-on-generate-error/_config.js000066400000000000000000000007121450520414700260300ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'closes the bundle on generate errors', command: 'rollup -cw', abortOnStderr(data) { if (data.includes('Bundle closed')) { return true; } }, stderr(stderr) { assertIncludes( stderr, '[!] RollupError: You must specify "output.file" or "output.dir" for the build.' ); assertIncludes(stderr, 'Bundle closed'); return false; } }); rollup-3.29.4/test/cli/samples/watch/close-on-generate-error/main.js000066400000000000000000000000231450520414700253430ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/watch/close-on-generate-error/rollup.config.mjs000066400000000000000000000002611450520414700273610ustar00rootroot00000000000000export default { input: 'main.js', plugins: [ { name: 'faulty-close', closeBundle() { console.error('Bundle closed'); } } ], output: { format: 'es' } }; rollup-3.29.4/test/cli/samples/watch/close-stdin/000077500000000000000000000000001450520414700216545ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/close-stdin/_config.js000066400000000000000000000002641450520414700236200ustar00rootroot00000000000000module.exports = defineTest({ description: 'closes the watcher when stdin closes', retry: true, command: 'node wrapper.js main.js --watch --format es --file _actual/out.js' }); rollup-3.29.4/test/cli/samples/watch/close-stdin/_expected/000077500000000000000000000000001450520414700236145ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/close-stdin/_expected/out.js000066400000000000000000000000541450520414700247600ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/cli/samples/watch/close-stdin/main.js000066400000000000000000000000231450520414700231310ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/watch/close-stdin/wrapper.js000077500000000000000000000014251450520414700236770ustar00rootroot00000000000000#!/usr/bin/env node const { mkdirSync, readFileSync, writeFileSync } = require('node:fs'); const { resolve } = require('node:path'); const { Readable } = require('node:stream'); const chokidar = require('chokidar'); delete process.stdin; process.stdin = new Readable({ encoding: 'utf8', read() { return null; } }); const outputDir = resolve(__dirname, '_actual'); mkdirSync(outputDir, {recursive: true}); const outputFile = resolve(outputDir, 'out.js'); const INITIAL_OUTPUT = 'NOT WRITTEN'; writeFileSync(outputFile, INITIAL_OUTPUT); const watcher = chokidar.watch(outputFile).on('change', () => { if (readFileSync(outputFile, 'utf8') !== INITIAL_OUTPUT) { watcher.close(); // This closes stdin process.stdin.push(null); } }); require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/watch/filter-logs/000077500000000000000000000000001450520414700216575ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/filter-logs/_config.js000066400000000000000000000011551450520414700236230ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'filters logs via CLI in watch mode', command: 'rollup --config --watch --filterLogs="pluginCode:FIRST,pluginCode:SECOND" --filterLogs=pluginCode:THIRD', env: { FORCE_COLOR: undefined, NO_COLOR: true, ROLLUP_FILTER_LOGS: 'pluginCode:FOURTH,pluginCode:FIFTH' }, abortOnStderr(data) { if (data.startsWith('created _actual.js')) { return true; } }, stderr(stderr) { assertIncludes( stderr, ` bundles main.js → _actual.js... first second third fourth fifth created _actual.js` ); } }); rollup-3.29.4/test/cli/samples/watch/filter-logs/main.js000066400000000000000000000000231450520414700231340ustar00rootroot00000000000000assert.ok( true ); rollup-3.29.4/test/cli/samples/watch/filter-logs/rollup.config.mjs000066400000000000000000000011051450520414700251500ustar00rootroot00000000000000export default { input: 'main.js', logLevel: 'debug', plugins: [ { name: 'test', buildStart() { this.info({message: 'removed', pluginCode: 'REMOVED'}); this.info({message: 'first', pluginCode: 'FIRST'}); this.info({message: 'second', pluginCode: 'SECOND'}); this.info({message: 'third', pluginCode: 'THIRD'}); this.info({message: 'fourth', pluginCode: 'FOURTH'}); this.info({message: 'fifth', pluginCode: 'FIFTH'}); this.info({message: 'filtered', pluginCode: 'FILTERED'}); }, } ], output: { format: 'es', file: '_actual.js' } }; rollup-3.29.4/test/cli/samples/watch/filter-logs/wrapper.js000077500000000000000000000001321450520414700236740ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; require('../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/watch/no-clearScreen-command/000077500000000000000000000000001450520414700237045ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/no-clearScreen-command/_config.js000066400000000000000000000007661450520414700256570ustar00rootroot00000000000000const assert = require('node:assert'); const UNDERLINE = '\u001B[4m'; module.exports = defineTest({ description: 'allows disabling clearing the screen from the command line', command: 'node wrapper.js main.js --format es --file _actual.js --watch --no-watch.clearScreen', env: { FORCE_COLOR: '1', TERM: 'xterm' }, abortOnStderr(data) { if (data.includes('waiting for changes')) { return true; } }, stderr(stderr) { assert.strictEqual(stderr.slice(0, 10), `${UNDERLINE}rollup`); } }); rollup-3.29.4/test/cli/samples/watch/no-clearScreen-command/foo.js000066400000000000000000000000251450520414700250220ustar00rootroot00000000000000export var foo = 42; rollup-3.29.4/test/cli/samples/watch/no-clearScreen-command/main.js000066400000000000000000000000231450520414700251610ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/watch/no-clearScreen-command/wrapper.js000077500000000000000000000002411450520414700257220ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; process.stderr.isTTY = true; process.stderr.hasColors = () => true; require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/watch/no-clearScreen/000077500000000000000000000000001450520414700222705ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/no-clearScreen/_config.js000066400000000000000000000006371450520414700242400ustar00rootroot00000000000000const assert = require('node:assert'); const UNDERLINE = '\u001B[4m'; module.exports = defineTest({ description: 'allows disabling clearing the screen', command: 'node wrapper.js -cw', env: { FORCE_COLOR: '1', TERM: 'xterm' }, abortOnStderr(data) { if (data.includes('waiting for changes')) { return true; } }, stderr(stderr) { assert.strictEqual(stderr.slice(0, 10), `${UNDERLINE}rollup`); } }); rollup-3.29.4/test/cli/samples/watch/no-clearScreen/foo.js000066400000000000000000000000251450520414700234060ustar00rootroot00000000000000export var foo = 42; rollup-3.29.4/test/cli/samples/watch/no-clearScreen/main.js000066400000000000000000000000231450520414700235450ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/watch/no-clearScreen/rollup.config.mjs000066400000000000000000000004021450520414700255600ustar00rootroot00000000000000export default [ { input: 'main.js', output: { file: '_actual.js', format: 'es' }, watch: { clearScreen: true } }, { input: 'main.js', output: { file: '_actual.js', format: 'es' }, watch: { clearScreen: false } } ]; rollup-3.29.4/test/cli/samples/watch/no-clearScreen/wrapper.js000077500000000000000000000002411450520414700243060ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; process.stderr.isTTY = true; process.stderr.hasColors = () => true; require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/watch/no-config-file/000077500000000000000000000000001450520414700222245ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/no-config-file/_config.js000066400000000000000000000003701450520414700241660ustar00rootroot00000000000000module.exports = defineTest({ description: 'watches without a config file', command: 'rollup main.js --watch --format es --file _actual/main.js', abortOnStderr(data) { if (data.includes(`created _actual/main.js`)) { return true; } } }); rollup-3.29.4/test/cli/samples/watch/no-config-file/_expected/000077500000000000000000000000001450520414700241645ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/no-config-file/_expected/main.js000066400000000000000000000000411450520414700254410ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-3.29.4/test/cli/samples/watch/no-config-file/main.js000066400000000000000000000000271450520414700235050ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/cli/samples/watch/no-watch-by-default/000077500000000000000000000000001450520414700232025ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/no-watch-by-default/_config.js000066400000000000000000000006331450520414700251460ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils'); module.exports = defineTest({ description: 'does not watch if --watch is missing', command: 'node wrapper.js -c --no-watch.clearScreen', stderr: stderr => assertIncludes(stderr, 'main.js → _actual.js...\ncreated _actual.js in'), abortOnStderr(data) { if (data.includes('waiting for changes')) { throw new Error('Watch initiated'); } } }); rollup-3.29.4/test/cli/samples/watch/no-watch-by-default/main.js000066400000000000000000000000231450520414700244570ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/cli/samples/watch/no-watch-by-default/rollup.config.mjs000066400000000000000000000001451450520414700264760ustar00rootroot00000000000000export default [ { input: 'main.js', output: { file: '_actual.js', format: 'es' } } ]; rollup-3.29.4/test/cli/samples/watch/no-watch-by-default/wrapper.js000077500000000000000000000002411450520414700252200ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; process.stderr.isTTY = true; process.stderr.hasColors = () => true; require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/watch/no-watched-config/000077500000000000000000000000001450520414700227245ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/no-watched-config/_config.js000066400000000000000000000005621450520414700246710ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'throws if no config is watched', command: 'rollup -cw', error: () => true, stderr(stderr) { assertIncludes( stderr, '[!] RollupError: Invalid value for option "watch" - there must be at least one config where "watch" is not set to "false".' ); } }); rollup-3.29.4/test/cli/samples/watch/no-watched-config/main.js000066400000000000000000000000321450520414700242010ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); rollup-3.29.4/test/cli/samples/watch/no-watched-config/rollup.config.mjs000066400000000000000000000003271450520414700262220ustar00rootroot00000000000000export default [ { input: 'main.js', watch: false, output: { dir: '_actual/es', format: 'es' } }, { input: 'main.js', watch: false, output: { dir: '_actual/cjs', format: 'cjs' } } ]; rollup-3.29.4/test/cli/samples/watch/node-config-file/000077500000000000000000000000001450520414700225355ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/node-config-file/_config.js000066400000000000000000000003561450520414700245030ustar00rootroot00000000000000module.exports = defineTest({ description: 'watches using a node_modules config files', command: 'rollup --watch --config node:custom', abortOnStderr(data) { if (data.includes(`created _actual/main.js`)) { return true; } } }); rollup-3.29.4/test/cli/samples/watch/node-config-file/_expected/000077500000000000000000000000001450520414700244755ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/node-config-file/_expected/main.js000066400000000000000000000000411450520414700257520ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-3.29.4/test/cli/samples/watch/node-config-file/main.js000066400000000000000000000000271450520414700240160ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/cli/samples/watch/node-config-file/node_modules/000077500000000000000000000000001450520414700252125ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/node-config-file/node_modules/rollup-config-custom/000077500000000000000000000000001450520414700313025ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/node-config-file/node_modules/rollup-config-custom/index.js000066400000000000000000000001431450520414700327450ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { file: '_actual/main.js', format: 'es', }, }; rollup-3.29.4/test/cli/samples/watch/node-config-file/node_modules/rollup-config-custom/package.json000066400000000000000000000001211450520414700335620ustar00rootroot00000000000000{ "name": "rollup-config-custom", "version": "1.0.0", "main": "index.js" } rollup-3.29.4/test/cli/samples/watch/watch-config-early-update/000077500000000000000000000000001450520414700243735ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-config-early-update/_config.js000066400000000000000000000042311450520414700263350ustar00rootroot00000000000000const { mkdirSync, unlinkSync } = require('node:fs'); const path = require('node:path'); const { wait, writeAndSync, writeAndRetry } = require('../../../../utils'); const configFile = path.join(__dirname, 'rollup.config.mjs'); let stopUpdate; module.exports = defineTest({ description: 'immediately reloads the config file if a change happens while it is parsed', command: 'rollup -cw', before() { // This test writes a config file that prints a message to stderr which signals to the test that // the config files has been parsed, at which point the test replaces the config file. The // initial file returns a Promise that only resolves once the second config file has been // parsed. To do that, the first config hooks into process.stderr and looks for a log from the // second config. // That way, we simulate a complicated config file being changed while it is parsed. mkdirSync(path.join(__dirname, '_actual')); writeAndSync( configFile, ` import { Writable } from 'stream'; process.stderr.write('initial\\n'); const processStderr = process.stderr; export default new Promise(resolve => { delete process.stderr; process.stderr = new Writable({ write(chunk, encoding, next) { processStderr.write(chunk, encoding, next); if (chunk.toString() === 'updated\\n') { process.stderr.end(); process.stderr = processStderr; resolve({ input: 'main.js', output: { file: '_actual/output1.js', format: 'es' } }) } }, }); });` ); }, after() { unlinkSync(configFile); stopUpdate(); }, abortOnStderr(data) { if (data === 'initial\n') { wait(200).then(() => { stopUpdate = writeAndRetry( configFile, ` console.error('updated'); export default { input: 'main.js', output: { file: '_actual/output2.js', format: "es" } };` ); }); return false; } if (data.includes(`created _actual/output2.js`)) { stopUpdate(); return true; } } }); rollup-3.29.4/test/cli/samples/watch/watch-config-early-update/_expected/000077500000000000000000000000001450520414700263335ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-config-early-update/_expected/output2.js000066400000000000000000000000411450520414700303060ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-3.29.4/test/cli/samples/watch/watch-config-early-update/main.js000066400000000000000000000000271450520414700256540ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/cli/samples/watch/watch-config-error/000077500000000000000000000000001450520414700231305ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-config-error/_config.js000066400000000000000000000025431450520414700250760ustar00rootroot00000000000000const { unlinkSync, writeFileSync } = require('node:fs'); const path = require('node:path'); const { atomicWriteFileSync } = require('../../../../utils'); let configFile; module.exports = defineTest({ description: 'keeps watching the config file in case the config is changed to an invalid state', command: 'rollup -cw', before() { configFile = path.resolve(__dirname, 'rollup.config.mjs'); writeFileSync( configFile, ` export default { input: "main.js", output: { file: "_actual/main1.js", format: "es" } };` ); }, after() { // synchronous sometimes does not seem to work, probably because the watch is not yet removed properly setTimeout(() => unlinkSync(configFile), 300); }, abortOnStderr(data) { if (data.includes(`created _actual/main1.js`)) { setTimeout( () => atomicWriteFileSync(configFile, 'throw new Error("Config contains errors");'), 600 ); return false; } if (data.includes('Config contains errors')) { setTimeout(() => { atomicWriteFileSync( configFile, 'export default {\n' + '\tinput: "main.js",\n' + '\toutput: {\n' + '\t\tfile: "_actual/main2.js",\n' + '\t\tformat: "es"\n' + '\t}\n' + '};' ); }, 600); return false; } if (data.includes(`created _actual/main2.js`)) { return true; } } }); rollup-3.29.4/test/cli/samples/watch/watch-config-error/_expected/000077500000000000000000000000001450520414700250705ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-config-error/_expected/main1.js000066400000000000000000000000411450520414700264260ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-3.29.4/test/cli/samples/watch/watch-config-error/_expected/main2.js000066400000000000000000000000411450520414700264270ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-3.29.4/test/cli/samples/watch/watch-config-error/main.js000066400000000000000000000000271450520414700244110ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/cli/samples/watch/watch-config-initial-error/000077500000000000000000000000001450520414700245575ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-config-initial-error/_config.js000066400000000000000000000021021450520414700265140ustar00rootroot00000000000000const { unlinkSync, writeFileSync } = require('node:fs'); const path = require('node:path'); const { atomicWriteFileSync } = require('../../../../utils'); let configFile; module.exports = defineTest({ description: 'keeps watching the config file in case the initial file contains an error', command: 'rollup -cw', before() { configFile = path.join(__dirname, 'rollup.config.mjs'); writeFileSync(configFile, 'throw new Error("Config contains initial errors");'); }, after() { // synchronous sometimes does not seem to work, probably because the watch is not yet removed properly setTimeout(() => unlinkSync(configFile), 300); }, async abortOnStderr(data) { if (data.includes('Config contains initial errors')) { await new Promise(resolve => setTimeout(resolve, 100)); atomicWriteFileSync( configFile, 'export default {\n' + '\tinput: "main.js",\n' + '\toutput: {\n' + '\t\tdir: "_actual",\n' + '\t\tformat: "es"\n' + '\t}\n' + '};' ); return false; } if (data.includes('created _actual')) { return true; } } }); rollup-3.29.4/test/cli/samples/watch/watch-config-initial-error/_expected/000077500000000000000000000000001450520414700265175ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-config-initial-error/_expected/main.js000066400000000000000000000000411450520414700277740ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-3.29.4/test/cli/samples/watch/watch-config-initial-error/main.js000066400000000000000000000000271450520414700260400ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/cli/samples/watch/watch-config-no-update/000077500000000000000000000000001450520414700236735ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-config-no-update/_config.js000066400000000000000000000022021450520414700256310ustar00rootroot00000000000000const { unlinkSync, writeFileSync } = require('node:fs'); const path = require('node:path'); const { atomicWriteFileSync } = require('../../../../utils'); let configFile; const configContent = 'export default {\n' + '\tinput: "main.js",\n' + '\toutput: {\n' + '\t\tfile: "_actual/main.js",\n' + '\t\tformat: "es"\n' + '\t}\n' + '};'; module.exports = defineTest({ description: 'does not rebuild if the config file is updated without change', command: 'rollup -cw', before() { configFile = path.resolve(__dirname, 'rollup.config.mjs'); writeFileSync(configFile, configContent); }, after() { unlinkSync(configFile); }, abortOnStderr(data) { if (data.includes(`created _actual/main.js`)) { atomicWriteFileSync(configFile, configContent); // wait some time for the watcher to trigger return new Promise(resolve => setTimeout(() => resolve(true), 600)); } }, stderr(stderr) { if ( !/^rollup v\d+\.\d+\.\d+(-\d+)?\nbundles main.js → _actual[/\\]main.js...\ncreated _actual[/\\]main.js in \d+ms\n$/.test( stderr ) ) { throw new Error(`stderr output does not match: ${JSON.stringify(stderr)}`); } } }); rollup-3.29.4/test/cli/samples/watch/watch-config-no-update/_expected/000077500000000000000000000000001450520414700256335ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-config-no-update/_expected/main.js000066400000000000000000000000411450520414700271100ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-3.29.4/test/cli/samples/watch/watch-config-no-update/main.js000066400000000000000000000000271450520414700251540ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/cli/samples/watch/watch-event-hooks-error/000077500000000000000000000000001450520414700241255ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-event-hooks-error/_config.js000066400000000000000000000006321450520414700260700ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'onError event hook shell commands write to stderr', command: 'node wrapper.js -cw --watch.onError "echo error"', abortOnStderr(data) { if (data.includes('waiting for changes')) { return true; } }, stderr(stderr) { assertIncludes( stderr, `watch.onError $ echo error error` ); } }); rollup-3.29.4/test/cli/samples/watch/watch-event-hooks-error/main.js000066400000000000000000000001151450520414700254040ustar00rootroot00000000000000// missing `=` to trigger onError var main 42; export { main as default }; rollup-3.29.4/test/cli/samples/watch/watch-event-hooks-error/rollup.config.mjs000066400000000000000000000001261450520414700274200ustar00rootroot00000000000000export default { input: 'main.js', output: { dir: '_actual', format: 'es' } }; rollup-3.29.4/test/cli/samples/watch/watch-event-hooks-error/wrapper.js000066400000000000000000000002411450520414700261400ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; process.stderr.isTTY = true; process.stderr.hasColors = () => true; require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/samples/watch/watch-event-hooks/000077500000000000000000000000001450520414700227765ustar00rootroot00000000000000rollup-3.29.4/test/cli/samples/watch/watch-event-hooks/_config.js000066400000000000000000000014721450520414700247440ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = defineTest({ description: 'event hook shell commands write to stderr', retry: true, command: 'node wrapper.js -cw --watch.onStart "echo start" --watch.onBundleStart "echo bundleStart" --watch.onBundleEnd "echo bundleEnd" --watch.onEnd "echo end"', abortOnStderr(data) { process.stderr.write(data); if (data.includes('waiting for changes')) { return true; } }, stderr(stderr) { // assert each hook individually assertIncludes( stderr, `watch.onStart $ echo start start` ); assertIncludes( stderr, `watch.onBundleStart $ echo bundleStart bundleStart` ); assertIncludes( stderr, `watch.onBundleEnd $ echo bundleEnd bundleEnd` ); assertIncludes( stderr, `watch.onEnd $ echo end end` ); } }); rollup-3.29.4/test/cli/samples/watch/watch-event-hooks/main.js000066400000000000000000000000541450520414700242570ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/cli/samples/watch/watch-event-hooks/rollup.config.mjs000066400000000000000000000001261450520414700262710ustar00rootroot00000000000000export default { input: 'main.js', output: { dir: '_actual', format: 'es' } }; rollup-3.29.4/test/cli/samples/watch/watch-event-hooks/wrapper.js000066400000000000000000000002411450520414700250110ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; process.stderr.isTTY = true; process.stderr.hasColors = () => true; require('../../../../../dist/bin/rollup'); rollup-3.29.4/test/cli/tsconfig.json000066400000000000000000000001701450520414700173630ustar00rootroot00000000000000{ "extends": "../tsconfig.base.json", "include": [ "**/_config.js", "./index.js", "./define.d.ts" ] } rollup-3.29.4/test/file-hashes/000077500000000000000000000000001450520414700162775ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/define.d.ts000066400000000000000000000002161450520414700203220ustar00rootroot00000000000000import type { TestConfigFileHash } from '../types'; declare global { function defineTest(config: TestConfigFileHash): TestConfigFileHash; } rollup-3.29.4/test/file-hashes/index.js000066400000000000000000000041151450520414700177450ustar00rootroot00000000000000const path = require('node:path'); /** * @type {import('../../src/rollup/types')} Rollup */ // @ts-expect-error not included in types const rollup = require('../../dist/rollup'); // @ts-expect-error not included in types const { runTestSuiteWithSamples } = require('../utils.js'); runTestSuiteWithSamples( 'file hashes', path.resolve(__dirname, 'samples'), /** * @param {import('../types').TestConfigFileHash} config */ (directory, config) => { (config.skip ? describe.skip : config.solo ? describe.only : describe)( path.basename(directory) + ': ' + config.description, () => { it(`generates correct hashes`, () => { process.chdir(directory); return Promise.all( [config.options1, config.options2].map(options => rollup.rollup(options).then(bundle => bundle.generate({ format: 'es', chunkFileNames: '[hash]', entryFileNames: '[hash]', ...options.output }) ) ) ).then(([generated1, generated2]) => { const fileContentsByHash = new Map(); addFileContentsByFileName(fileContentsByHash, generated1); addFileContentsByFileName(fileContentsByHash, generated2); if (config.show) { console.log(fileContentsByHash); } for (const contents of fileContentsByHash.values()) { if (contents.size > 1) { throw new Error( `Two chunks contained different code even though the hashes were the same: ${[ ...contents ] .map(error => JSON.stringify(error)) .join(' != ')}` ); } } }); }); } ); } ); function addFileContentsByFileName(fileContentsByFileName, generated) { for (const chunk of generated.output) { const fileName = chunk.fileName; if (fileContentsByFileName.has(fileName)) { fileContentsByFileName.get(fileName).add(chunk.code); } else { fileContentsByFileName.set(fileName, new Set([chunk.code])); } } } // assert.equal( // fileContentsByHash.get(hash), // chunk.code, // 'Two chunks contained different code even though the hashes were the same.' // ); rollup-3.29.4/test/file-hashes/samples/000077500000000000000000000000001450520414700177435ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/augment-chunk-hash/000077500000000000000000000000001450520414700234325ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/augment-chunk-hash/_config.js000066400000000000000000000016611450520414700254000ustar00rootroot00000000000000const augment1 = '/*foo*/'; const augment2 = '/*bar*/'; module.exports = defineTest({ description: 'augmentChunkHash updates hashes across all modules when returning something', options1: { input: 'main', output: { format: 'es', entryFileNames: '[name]-[hash].js', chunkFileNames: '[name]-[hash].js' }, plugins: [ { augmentChunkHash(chunk) { if (chunk.name === 'main') { return augment1; } }, renderChunk(code, chunk) { if (chunk.name === 'main') { return augment1 + code; } } } ] }, options2: { input: 'main', output: { format: 'es', entryFileNames: '[name]-[hash].js', chunkFileNames: '[name]-[hash].js' }, plugins: [ { augmentChunkHash(chunk) { if (chunk.name === 'main') { return augment2; } }, renderChunk(code, chunk) { if (chunk.name === 'main') { return augment2 + code; } } } ] } }); rollup-3.29.4/test/file-hashes/samples/augment-chunk-hash/main.js000066400000000000000000000000251450520414700247110ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/file-hashes/samples/banner/000077500000000000000000000000001450520414700212105ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/banner/_config.js000066400000000000000000000003771450520414700231610ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the banner differs', options1: { input: 'main', output: { banner: 'console.log(1);' } }, options2: { input: 'main', output: { banner: 'console.log(2);' } } }); rollup-3.29.4/test/file-hashes/samples/banner/main.js000066400000000000000000000000251450520414700224670ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/file-hashes/samples/chunk-name/000077500000000000000000000000001450520414700217715ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/chunk-name/_config.js000066400000000000000000000005271450520414700237370ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the name pattern differs', options1: { input: { main: 'main', foo: 'main2' }, output: { entryFileNames: '[name]-[hash].js' } }, options2: { input: { main: 'main', bar: 'main2' }, output: { entryFileNames: '[name]-[hash].js' } } }); rollup-3.29.4/test/file-hashes/samples/chunk-name/main.js000066400000000000000000000000471450520414700232540ustar00rootroot00000000000000import './main2'; console.log('main'); rollup-3.29.4/test/file-hashes/samples/chunk-name/main2.js000066400000000000000000000000261450520414700233330ustar00rootroot00000000000000console.log('main2'); rollup-3.29.4/test/file-hashes/samples/content/000077500000000000000000000000001450520414700214155ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/content/_config.js000066400000000000000000000003241450520414700233560ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the content differs', options1: { input: { main: 'main1', dep: 'dep1' } }, options2: { input: { main: 'main2', dep: 'dep2' } } }); rollup-3.29.4/test/file-hashes/samples/content/dep1.js000066400000000000000000000000241450520414700226000ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/file-hashes/samples/content/dep2.js000066400000000000000000000000241450520414700226010ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/file-hashes/samples/content/main1.js000066400000000000000000000000501450520414700227530ustar00rootroot00000000000000import './dep1'; console.log('main1'); rollup-3.29.4/test/file-hashes/samples/content/main2.js000066400000000000000000000000501450520414700227540ustar00rootroot00000000000000import './dep2'; console.log('main2'); rollup-3.29.4/test/file-hashes/samples/dependency-content/000077500000000000000000000000001450520414700235315ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/dependency-content/_config.js000066400000000000000000000003441450520414700254740ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the content of dependencies differs', options1: { input: { main: 'main1', dep: 'dep1' } }, options2: { input: { main: 'main2', dep: 'dep2' } } }); rollup-3.29.4/test/file-hashes/samples/dependency-content/dep1.js000066400000000000000000000000251450520414700247150ustar00rootroot00000000000000console.log('dep1'); rollup-3.29.4/test/file-hashes/samples/dependency-content/dep2.js000066400000000000000000000000251450520414700247160ustar00rootroot00000000000000console.log('dep2'); rollup-3.29.4/test/file-hashes/samples/dependency-content/main1.js000066400000000000000000000000471450520414700250750ustar00rootroot00000000000000import './dep1'; console.log('main'); rollup-3.29.4/test/file-hashes/samples/dependency-content/main2.js000066400000000000000000000000471450520414700250760ustar00rootroot00000000000000import './dep2'; console.log('main'); rollup-3.29.4/test/file-hashes/samples/export-order-2/000077500000000000000000000000001450520414700225345ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/export-order-2/_config.js000066400000000000000000000003311450520414700244730ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if different variables are exported under the same name', options1: { input: ['main1', 'dep'] }, options2: { input: ['main2', 'dep'] } }); rollup-3.29.4/test/file-hashes/samples/export-order-2/dep.js000066400000000000000000000000241450520414700236360ustar00rootroot00000000000000export const a = 3; rollup-3.29.4/test/file-hashes/samples/export-order-2/main1.js000066400000000000000000000001241450520414700240740ustar00rootroot00000000000000import { a as b } from './dep.js'; const a = 1; console.log(a, b); export { a }; rollup-3.29.4/test/file-hashes/samples/export-order-2/main2.js000066400000000000000000000001311450520414700240730ustar00rootroot00000000000000import { a as b } from './dep.js'; const a = 1; console.log(a, b); export { b as a }; rollup-3.29.4/test/file-hashes/samples/export-order/000077500000000000000000000000001450520414700223755ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/export-order/_config.js000066400000000000000000000003131450520414700243340ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if different variables are exported under the same name', options1: { input: ['main1'] }, options2: { input: ['main2'] } }); rollup-3.29.4/test/file-hashes/samples/export-order/main1.js000066400000000000000000000000751450520414700237420ustar00rootroot00000000000000const a = 1; const b = 2; console.log(a, b); export { a }; rollup-3.29.4/test/file-hashes/samples/export-order/main2.js000066400000000000000000000001021450520414700237320ustar00rootroot00000000000000const a = 1; const b = 2; console.log(a, b); export { b as a }; rollup-3.29.4/test/file-hashes/samples/exports/000077500000000000000000000000001450520414700214475ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/exports/_config.js000066400000000000000000000003051450520414700234070ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the generated exports differ', options1: { input: ['main1', 'other'] }, options2: { input: ['main2', 'other'] } }); rollup-3.29.4/test/file-hashes/samples/exports/dep.js000066400000000000000000000001071450520414700225530ustar00rootroot00000000000000export const mightNotBeImported = 42; console.log(mightNotBeImported); rollup-3.29.4/test/file-hashes/samples/exports/main1.js000066400000000000000000000001251450520414700230100ustar00rootroot00000000000000import {mightNotBeImported} from './dep'; console.log('main1', mightNotBeImported); rollup-3.29.4/test/file-hashes/samples/exports/main2.js000066400000000000000000000000471450520414700230140ustar00rootroot00000000000000import './dep'; console.log('main2'); rollup-3.29.4/test/file-hashes/samples/exports/other.js000066400000000000000000000000471450520414700231270ustar00rootroot00000000000000import './dep'; console.log('other'); rollup-3.29.4/test/file-hashes/samples/external-dependency-names/000077500000000000000000000000001450520414700250025ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/external-dependency-names/_config.js000066400000000000000000000005041450520414700267430ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the names of external dependencies differ', options1: { input: { mainA: 'main1a', mainB: 'main1b' }, external: ['external', 'external1'] }, options2: { input: { mainA: 'main2a', mainB: 'main2b' }, external: ['external', 'external2'] } }); rollup-3.29.4/test/file-hashes/samples/external-dependency-names/main1a.js000066400000000000000000000000511450520414700265020ustar00rootroot00000000000000import 'external'; console.log('main'); rollup-3.29.4/test/file-hashes/samples/external-dependency-names/main1b.js000066400000000000000000000000521450520414700265040ustar00rootroot00000000000000import 'external1'; console.log('main'); rollup-3.29.4/test/file-hashes/samples/external-dependency-names/main2a.js000066400000000000000000000000511450520414700265030ustar00rootroot00000000000000import 'external'; console.log('main'); rollup-3.29.4/test/file-hashes/samples/external-dependency-names/main2b.js000066400000000000000000000000521450520414700265050ustar00rootroot00000000000000import 'external2'; console.log('main'); rollup-3.29.4/test/file-hashes/samples/footer/000077500000000000000000000000001450520414700212415ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/footer/_config.js000066400000000000000000000003771450520414700232120ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the footer differs', options1: { input: 'main', output: { footer: 'console.log(1);' } }, options2: { input: 'main', output: { footer: 'console.log(2);' } } }); rollup-3.29.4/test/file-hashes/samples/footer/main.js000066400000000000000000000000251450520414700225200ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/file-hashes/samples/format/000077500000000000000000000000001450520414700212335ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/format/_config.js000066400000000000000000000003461450520414700232000ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the format differs', options1: { input: 'main', output: { format: 'es' } }, options2: { input: 'main', output: { format: 'cjs' } } }); rollup-3.29.4/test/file-hashes/samples/format/main.js000066400000000000000000000000241450520414700225110ustar00rootroot00000000000000export const x = 1; rollup-3.29.4/test/file-hashes/samples/internal-exports/000077500000000000000000000000001450520414700232615ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/internal-exports/_config.js000066400000000000000000000003121450520414700252170ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if generated internal exports differ', options1: { input: ['main1', 'other'] }, options2: { input: ['main2', 'other'] } }); rollup-3.29.4/test/file-hashes/samples/internal-exports/dep.js000066400000000000000000000000501450520414700243620ustar00rootroot00000000000000export const a = 1; export const b = 2; rollup-3.29.4/test/file-hashes/samples/internal-exports/main1.js000066400000000000000000000000571450520414700246260ustar00rootroot00000000000000import { b } from './dep.js'; console.log(b); rollup-3.29.4/test/file-hashes/samples/internal-exports/main2.js000066400000000000000000000000571450520414700246270ustar00rootroot00000000000000import { a } from './dep.js'; console.log(a); rollup-3.29.4/test/file-hashes/samples/internal-exports/other.js000066400000000000000000000000651450520414700247410ustar00rootroot00000000000000import { a, b } from './dep.js'; console.log(a, b); rollup-3.29.4/test/file-hashes/samples/intro/000077500000000000000000000000001450520414700210765ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/intro/_config.js000066400000000000000000000003741450520414700230440ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the intro differs', options1: { input: 'main', output: { intro: 'console.log(1);' } }, options2: { input: 'main', output: { intro: 'console.log(2);' } } }); rollup-3.29.4/test/file-hashes/samples/intro/main.js000066400000000000000000000000251450520414700223550ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/file-hashes/samples/name-pattern/000077500000000000000000000000001450520414700223365ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/name-pattern/_config.js000066400000000000000000000004211450520414700242750ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the name pattern differs', options1: { input: 'main', output: { chunkFileNames: '[hash]-[name]' } }, options2: { input: 'main', output: { chunkFileNames: '[name]-[hash]' } } }); rollup-3.29.4/test/file-hashes/samples/name-pattern/dep.js000066400000000000000000000000311450520414700234360ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/file-hashes/samples/name-pattern/main.js000066400000000000000000000000711450520414700236160ustar00rootroot00000000000000import('./dep').then(({ value }) => console.log(value)); rollup-3.29.4/test/file-hashes/samples/outro/000077500000000000000000000000001450520414700211135ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/outro/_config.js000066400000000000000000000003741450520414700230610ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates different hashes if the outro differs', options1: { input: 'main', output: { outro: 'console.log(1);' } }, options2: { input: 'main', output: { outro: 'console.log(2);' } } }); rollup-3.29.4/test/file-hashes/samples/outro/main.js000066400000000000000000000000251450520414700223720ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/file-hashes/samples/render-chunk-changes/000077500000000000000000000000001450520414700237365ustar00rootroot00000000000000rollup-3.29.4/test/file-hashes/samples/render-chunk-changes/_config.js000066400000000000000000000007031450520414700257000ustar00rootroot00000000000000module.exports = defineTest({ description: 'reflects changes in renderChunk', options1: { input: 'main', plugins: [ { renderChunk(code, chunk) { if (chunk.name === 'main') { return "console.log('first');" + code; } } } ] }, options2: { input: 'main', plugins: [ { renderChunk(code, chunk) { if (chunk.name === 'main') { return "console.log('second');" + code; } } } ] } }); rollup-3.29.4/test/file-hashes/samples/render-chunk-changes/main.js000066400000000000000000000000251450520414700252150ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/file-hashes/tsconfig.json000066400000000000000000000001701450520414700210040ustar00rootroot00000000000000{ "extends": "../tsconfig.base.json", "include": [ "**/_config.js", "./index.js", "./define.d.ts" ] } rollup-3.29.4/test/form/000077500000000000000000000000001450520414700150525ustar00rootroot00000000000000rollup-3.29.4/test/form/define.d.ts000066400000000000000000000002021450520414700170700ustar00rootroot00000000000000import type { TestConfigForm } from '../types'; declare global { function defineTest(config: TestConfigForm): TestConfigForm; } rollup-3.29.4/test/form/index.js000066400000000000000000000073641450520414700165310ustar00rootroot00000000000000const assert = require('node:assert'); const { existsSync, readFileSync } = require('node:fs'); const { basename, resolve } = require('node:path'); /** * @type {import('../../src/rollup/types')} Rollup */ // @ts-expect-error not included in types const { rollup } = require('../../dist/rollup'); const { compareLogs, normaliseOutput, runTestSuiteWithSamples } = require('../utils.js'); const FORMATS = ['amd', 'cjs', 'system', 'es', 'iife', 'umd']; runTestSuiteWithSamples( 'form', resolve(__dirname, 'samples'), /** * @param {import('../types').TestConfigForm} config */ (directory, config) => { const isSingleFormatTest = existsSync(directory + '/_expected.js'); const itOrDescribe = isSingleFormatTest ? it : describe; (config.skip ? itOrDescribe.skip : config.solo ? itOrDescribe.only : itOrDescribe)( basename(directory) + ': ' + config.description, () => { let bundle; const logs = []; const runRollupTest = async (inputFile, bundleFile, defaultFormat) => { const warnings = []; if (config.before) { await config.before(); } try { process.chdir(directory); bundle = bundle || (await rollup({ input: directory + '/main.js', onLog: (level, log) => { logs.push({ level, ...log }); if (level === 'warn' && !config.expectedWarnings?.includes(log.code)) { warnings.push(log); } }, strictDeprecations: true, ...config.options })); await generateAndTestBundle( bundle, { exports: 'auto', file: inputFile, format: defaultFormat, validate: true, ...(config.options || {}).output }, bundleFile, config ); } finally { if (config.after) { await config.after(); } } if (warnings.length > 0) { const codes = new Set(); for (const { code } of warnings) { codes.add(code); } throw new Error( `Unexpected warnings (${[...codes].join(', ')}): \n${warnings .map(({ message }) => `${message}\n\n`) .join('')}` + 'If you expect warnings, list their codes in config.expectedWarnings' ); } }; if (isSingleFormatTest) { return runRollupTest(directory + '/_actual.js', directory + '/_expected.js', 'es').then( () => config.logs && compareLogs(logs, config.logs) ); } for (const format of config.formats || FORMATS) { after(() => config.logs && compareLogs(logs, config.logs)); it('generates ' + format, () => runRollupTest( directory + '/_actual/' + format + '.js', directory + '/_expected/' + format + '.js', format ) ); } } ); } ); async function generateAndTestBundle(bundle, outputOptions, expectedFile, { show }) { await bundle.write(outputOptions); const actualCode = normaliseOutput(readFileSync(outputOptions.file, 'utf8')); let expectedCode; let actualMap; let expectedMap; try { expectedCode = normaliseOutput(readFileSync(expectedFile, 'utf8')); } catch { expectedCode = 'missing file'; } try { actualMap = JSON.parse(readFileSync(outputOptions.file + '.map', 'utf8')); actualMap.sourcesContent = actualMap.sourcesContent ? actualMap.sourcesContent.map(normaliseOutput) : null; } catch (error) { assert.strictEqual(error.code, 'ENOENT'); } try { expectedMap = JSON.parse(readFileSync(expectedFile + '.map', 'utf8')); expectedMap.sourcesContent = actualMap.sourcesContent ? expectedMap.sourcesContent.map(normaliseOutput) : null; } catch (error) { assert.equal(error.code, 'ENOENT'); } if (show) { console.log(actualCode + '\n\n\n'); } assert.strictEqual(actualCode, expectedCode); assert.deepStrictEqual(actualMap, expectedMap); } rollup-3.29.4/test/form/samples/000077500000000000000000000000001450520414700165165ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/absolute-path-resolver/000077500000000000000000000000001450520414700231255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/absolute-path-resolver/_config.js000066400000000000000000000005061450520414700250700ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'normalizes absolute ids', options: { plugins: [ { name: 'test', transform(code, id) { if (/main/.test(id)) { return code.replace('"./a.js"', JSON.stringify(path.resolve(__dirname, 'a.js'))); } } } ] } }); rollup-3.29.4/test/form/samples/absolute-path-resolver/_expected.js000066400000000000000000000000701450520414700254200ustar00rootroot00000000000000var a = () => { console.log('props'); }; a(); a(); rollup-3.29.4/test/form/samples/absolute-path-resolver/a.js000066400000000000000000000000631450520414700237020ustar00rootroot00000000000000export var a = () => { console.log('props'); };rollup-3.29.4/test/form/samples/absolute-path-resolver/main.js000066400000000000000000000001071450520414700244050ustar00rootroot00000000000000import { a } from "./a.js"; import { a as b } from "./a.js"; a(); b(); rollup-3.29.4/test/form/samples/acorn-external-plugins/000077500000000000000000000000001450520414700231175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/acorn-external-plugins/_config.js000066400000000000000000000003141450520414700250570ustar00rootroot00000000000000const jsx = require('acorn-jsx'); module.exports = defineTest({ description: 'supports official acorn plugins that may rely on a shared acorn instance', options: { acornInjectPlugins: [jsx()] } }); rollup-3.29.4/test/form/samples/acorn-external-plugins/_expected.js000066400000000000000000000001131450520414700254100ustar00rootroot00000000000000var main =
This is not JavaScript
; export { main as default }; rollup-3.29.4/test/form/samples/acorn-external-plugins/main.js000066400000000000000000000000621450520414700243770ustar00rootroot00000000000000export default
This is not JavaScript
; rollup-3.29.4/test/form/samples/addon-functions/000077500000000000000000000000001450520414700216115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/addon-functions/_config.js000066400000000000000000000047471450520414700235670ustar00rootroot00000000000000const assert = require('node:assert'); // @ts-expect-error not included in types const { replaceDirectoryInStringifiedObject } = require('../../../utils'); const assertChunkData = chunk => assert.strictEqual( replaceDirectoryInStringifiedObject({ ...chunk, fileName: undefined }, __dirname), '{\n' + ' "exports": [],\n' + ' "facadeModuleId": "**/main.js",\n' + ' "isDynamicEntry": false,\n' + ' "isEntry": true,\n' + ' "isImplicitEntry": false,\n' + ' "moduleIds": [\n' + ' "**/main.js"\n' + ' ],\n' + ' "name": "main",\n' + ' "type": "chunk",\n' + ' "dynamicImports": [],\n' + ' "implicitlyLoadedBefore": [],\n' + ' "importedBindings": {},\n' + ' "imports": [],\n' + ' "modules": {\n' + ' "**/main.js": {\n' + ' "code": "console.log(\'main\');",\n' + ' "originalLength": 21,\n' + ' "removedExports": [],\n' + ' "renderedExports": [],\n' + ' "renderedLength": 20\n' + ' }\n' + ' },\n' + ' "referencedFiles": []\n' + '}' ); module.exports = defineTest({ description: 'provides module information when adding addons', options: { output: { intro(chunk) { assertChunkData(chunk); return `/* intro-option ${chunk.fileName} */`; }, outro(chunk) { assertChunkData(chunk); return `/* outro-option ${chunk.fileName} */`; }, banner(chunk) { assertChunkData(chunk); return `/* banner-option ${chunk.fileName} */`; }, footer(chunk) { assertChunkData(chunk); return `/* footer-option ${chunk.fileName} */`; } }, plugins: [ { name: 'first', intro(chunk) { assertChunkData(chunk); return `/* intro-first ${chunk.fileName} */`; }, outro(chunk) { assertChunkData(chunk); return `/* outro-first ${chunk.fileName} */`; }, banner(chunk) { assertChunkData(chunk); return `/* banner-first ${chunk.fileName} */`; }, footer(chunk) { assertChunkData(chunk); return `/* footer-first ${chunk.fileName} */`; } }, { name: 'second', intro(chunk) { assertChunkData(chunk); return `/* intro-second ${chunk.fileName} */`; }, outro(chunk) { assertChunkData(chunk); return `/* outro-second ${chunk.fileName} */`; }, banner(chunk) { assertChunkData(chunk); return `/* banner-second ${chunk.fileName} */`; }, footer(chunk) { assertChunkData(chunk); return `/* footer-second ${chunk.fileName} */`; } } ] } }); rollup-3.29.4/test/form/samples/addon-functions/_expected/000077500000000000000000000000001450520414700235515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/addon-functions/_expected/amd.js000066400000000000000000000006071450520414700246530ustar00rootroot00000000000000/* banner-option amd.js */ /* banner-first amd.js */ /* banner-second amd.js */ define((function () { 'use strict'; /* intro-option amd.js */ /* intro-first amd.js */ /* intro-second amd.js */ console.log('main'); /* outro-option amd.js */ /* outro-first amd.js */ /* outro-second amd.js */ })); /* footer-option amd.js */ /* footer-first amd.js */ /* footer-second amd.js */ rollup-3.29.4/test/form/samples/addon-functions/_expected/cjs.js000066400000000000000000000005441450520414700246710ustar00rootroot00000000000000/* banner-option cjs.js */ /* banner-first cjs.js */ /* banner-second cjs.js */ 'use strict'; /* intro-option cjs.js */ /* intro-first cjs.js */ /* intro-second cjs.js */ console.log('main'); /* outro-option cjs.js */ /* outro-first cjs.js */ /* outro-second cjs.js */ /* footer-option cjs.js */ /* footer-first cjs.js */ /* footer-second cjs.js */ rollup-3.29.4/test/form/samples/addon-functions/_expected/es.js000066400000000000000000000005111450520414700245130ustar00rootroot00000000000000/* banner-option es.js */ /* banner-first es.js */ /* banner-second es.js */ /* intro-option es.js */ /* intro-first es.js */ /* intro-second es.js */ console.log('main'); /* outro-option es.js */ /* outro-first es.js */ /* outro-second es.js */ /* footer-option es.js */ /* footer-first es.js */ /* footer-second es.js */ rollup-3.29.4/test/form/samples/addon-functions/_expected/iife.js000066400000000000000000000006161450520414700250260ustar00rootroot00000000000000/* banner-option iife.js */ /* banner-first iife.js */ /* banner-second iife.js */ (function () { 'use strict'; /* intro-option iife.js */ /* intro-first iife.js */ /* intro-second iife.js */ console.log('main'); /* outro-option iife.js */ /* outro-first iife.js */ /* outro-second iife.js */ })(); /* footer-option iife.js */ /* footer-first iife.js */ /* footer-second iife.js */ rollup-3.29.4/test/form/samples/addon-functions/_expected/system.js000066400000000000000000000007641450520414700254420ustar00rootroot00000000000000/* banner-option system.js */ /* banner-first system.js */ /* banner-second system.js */ System.register([], (function () { 'use strict'; return { execute: (function () { /* intro-option system.js */ /* intro-first system.js */ /* intro-second system.js */ console.log('main'); /* outro-option system.js */ /* outro-first system.js */ /* outro-second system.js */ }) }; })); /* footer-option system.js */ /* footer-first system.js */ /* footer-second system.js */ rollup-3.29.4/test/form/samples/addon-functions/_expected/umd.js000066400000000000000000000007451450520414700247020ustar00rootroot00000000000000/* banner-option umd.js */ /* banner-first umd.js */ /* banner-second umd.js */ (function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; /* intro-option umd.js */ /* intro-first umd.js */ /* intro-second umd.js */ console.log('main'); /* outro-option umd.js */ /* outro-first umd.js */ /* outro-second umd.js */ })); /* footer-option umd.js */ /* footer-first umd.js */ /* footer-second umd.js */ rollup-3.29.4/test/form/samples/addon-functions/main.js000066400000000000000000000000251450520414700230700ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/form/samples/amd-id-auto/000077500000000000000000000000001450520414700206175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/amd-id-auto/_config.js000066400000000000000000000001741450520414700225630ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to use amd.autoId', options: { output: { amd: { autoId: true } } } }); rollup-3.29.4/test/form/samples/amd-id-auto/_expected/000077500000000000000000000000001450520414700225575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/amd-id-auto/_expected/amd.js000066400000000000000000000001041450520414700236510ustar00rootroot00000000000000define('amd', (function () { 'use strict'; console.log(42); })); rollup-3.29.4/test/form/samples/amd-id-auto/_expected/cjs.js000066400000000000000000000000401450520414700236660ustar00rootroot00000000000000'use strict'; console.log(42); rollup-3.29.4/test/form/samples/amd-id-auto/_expected/es.js000066400000000000000000000000211450520414700235150ustar00rootroot00000000000000console.log(42); rollup-3.29.4/test/form/samples/amd-id-auto/_expected/iife.js000066400000000000000000000000701450520414700240260ustar00rootroot00000000000000(function () { 'use strict'; console.log(42); })(); rollup-3.29.4/test/form/samples/amd-id-auto/_expected/system.js000066400000000000000000000001721450520414700244410ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log(42); }) }; })); rollup-3.29.4/test/form/samples/amd-id-auto/_expected/umd.js000066400000000000000000000002421450520414700237000ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define('umd', factory) : factory(); })((function () { 'use strict'; console.log(42); })); rollup-3.29.4/test/form/samples/amd-id-auto/main.js000066400000000000000000000000211450520414700220720ustar00rootroot00000000000000console.log(42); rollup-3.29.4/test/form/samples/amd-id/000077500000000000000000000000001450520414700176515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/amd-id/_config.js000066400000000000000000000001761450520414700216170ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to declare an AMD id', options: { output: { amd: { id: 'my-id' } } } }); rollup-3.29.4/test/form/samples/amd-id/_expected/000077500000000000000000000000001450520414700216115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/amd-id/_expected/amd.js000066400000000000000000000001061450520414700227050ustar00rootroot00000000000000define('my-id', (function () { 'use strict'; console.log(42); })); rollup-3.29.4/test/form/samples/amd-id/_expected/cjs.js000066400000000000000000000000401450520414700227200ustar00rootroot00000000000000'use strict'; console.log(42); rollup-3.29.4/test/form/samples/amd-id/_expected/es.js000066400000000000000000000000211450520414700225470ustar00rootroot00000000000000console.log(42); rollup-3.29.4/test/form/samples/amd-id/_expected/iife.js000066400000000000000000000000701450520414700230600ustar00rootroot00000000000000(function () { 'use strict'; console.log(42); })(); rollup-3.29.4/test/form/samples/amd-id/_expected/system.js000066400000000000000000000001721450520414700234730ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log(42); }) }; })); rollup-3.29.4/test/form/samples/amd-id/_expected/umd.js000066400000000000000000000002441450520414700227340ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define('my-id', factory) : factory(); })((function () { 'use strict'; console.log(42); })); rollup-3.29.4/test/form/samples/amd-id/main.js000066400000000000000000000000211450520414700211240ustar00rootroot00000000000000console.log(42); rollup-3.29.4/test/form/samples/amd-keep-extension/000077500000000000000000000000001450520414700222135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/amd-keep-extension/_config.js000066400000000000000000000003671450520414700241630ustar00rootroot00000000000000module.exports = defineTest({ description: 'keep extension for AMD modules', options: { external: ['./relative', 'abso/lute', './relative.js', 'abso/lute.js'], output: { amd: { forceJsExtensionForImports: true }, interop: 'default' } } }); rollup-3.29.4/test/form/samples/amd-keep-extension/_expected/000077500000000000000000000000001450520414700241535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/amd-keep-extension/_expected/amd.js000066400000000000000000000003541450520414700252540ustar00rootroot00000000000000define(['./relative.js', 'abso/lute', './relative.js', 'abso/lute.js'], (function (relative, absolute, relativeExtension, absoluteExtension) { 'use strict'; console.log(relative, absolute, relativeExtension, absoluteExtension); })); rollup-3.29.4/test/form/samples/amd-keep-extension/_expected/cjs.js000066400000000000000000000004051450520414700252670ustar00rootroot00000000000000'use strict'; var relative = require('./relative'); var absolute = require('abso/lute'); var relativeExtension = require('./relative.js'); var absoluteExtension = require('abso/lute.js'); console.log(relative, absolute, relativeExtension, absoluteExtension); rollup-3.29.4/test/form/samples/amd-keep-extension/_expected/es.js000066400000000000000000000003521450520414700251200ustar00rootroot00000000000000import relative from './relative'; import absolute from 'abso/lute'; import relativeExtension from './relative.js'; import absoluteExtension from 'abso/lute.js'; console.log(relative, absolute, relativeExtension, absoluteExtension); rollup-3.29.4/test/form/samples/amd-keep-extension/_expected/iife.js000066400000000000000000000003361450520414700254270ustar00rootroot00000000000000(function (relative, absolute, relativeExtension, absoluteExtension) { 'use strict'; console.log(relative, absolute, relativeExtension, absoluteExtension); })(relative, absolute, relativeExtension, absoluteExtension); rollup-3.29.4/test/form/samples/amd-keep-extension/_expected/system.js000066400000000000000000000010441450520414700260340ustar00rootroot00000000000000System.register(['./relative', 'abso/lute', './relative.js', 'abso/lute.js'], (function () { 'use strict'; var relative, absolute, relativeExtension, absoluteExtension; return { setters: [function (module) { relative = module.default; }, function (module) { absolute = module.default; }, function (module) { relativeExtension = module.default; }, function (module) { absoluteExtension = module.default; }], execute: (function () { console.log(relative, absolute, relativeExtension, absoluteExtension); }) }; })); rollup-3.29.4/test/form/samples/amd-keep-extension/_expected/umd.js000066400000000000000000000012421450520414700252750ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('./relative'), require('abso/lute'), require('./relative.js'), require('abso/lute.js')) : typeof define === 'function' && define.amd ? define(['./relative.js', 'abso/lute', './relative.js', 'abso/lute.js'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.relative, global.absolute, global.relativeExtension, global.absoluteExtension)); })(this, (function (relative, absolute, relativeExtension, absoluteExtension) { 'use strict'; console.log(relative, absolute, relativeExtension, absoluteExtension); })); rollup-3.29.4/test/form/samples/amd-keep-extension/main.js000066400000000000000000000003521450520414700234750ustar00rootroot00000000000000import relative from './relative'; import absolute from 'abso/lute'; import relativeExtension from './relative.js'; import absoluteExtension from 'abso/lute.js'; console.log(relative, absolute, relativeExtension, absoluteExtension); rollup-3.29.4/test/form/samples/argument-deoptimization/000077500000000000000000000000001450520414700233755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/argument-deoptimization/no-default-deoptimization/000077500000000000000000000000001450520414700304705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/argument-deoptimization/no-default-deoptimization/_config.js000066400000000000000000000001401450520414700324250ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not deoptimize call arguments by default' }); rollup-3.29.4/test/form/samples/argument-deoptimization/no-default-deoptimization/_expected.js000066400000000000000000000002431450520414700327650ustar00rootroot00000000000000const obj = { mutated: false, noEffect() {} }; function updateObj(target) { target.mutated = true; } updateObj(obj); console.log(obj.mutated ? 'OK' : 'FAIL'); rollup-3.29.4/test/form/samples/argument-deoptimization/no-default-deoptimization/main.js000066400000000000000000000002771450520414700317600ustar00rootroot00000000000000const obj = { mutated: false, noEffect() {} }; function updateObj(target) { target.mutated = true; } updateObj(obj); // removed obj.noEffect(); console.log(obj.mutated ? 'OK' : 'FAIL'); rollup-3.29.4/test/form/samples/argument-deoptimization/no-global-call-deoptimization/000077500000000000000000000000001450520414700312155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/argument-deoptimization/no-global-call-deoptimization/_config.js000066400000000000000000000001641450520414700331600ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not deoptimize call arguments of calls to globals by default' }); rollup-3.29.4/test/form/samples/argument-deoptimization/no-global-call-deoptimization/_expected.js000066400000000000000000000001221450520414700335060ustar00rootroot00000000000000const obj = { foo: true, noEffect() {} }; console.log(obj); console.log('OK' ); rollup-3.29.4/test/form/samples/argument-deoptimization/no-global-call-deoptimization/main.js000066400000000000000000000002001450520414700324670ustar00rootroot00000000000000const obj = { foo: true, noEffect() {} }; console.log(obj); // removed obj.noEffect(); console.log(obj.foo ? 'OK' : 'FAIL'); rollup-3.29.4/test/form/samples/argument-deoptimization/return-function-deoptimization/000077500000000000000000000000001450520414700315745ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/argument-deoptimization/return-function-deoptimization/_config.js000066400000000000000000000001661450520414700335410ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not deoptimize call arguments of returned functions by default' }); rollup-3.29.4/test/form/samples/argument-deoptimization/return-function-deoptimization/_expected.js000066400000000000000000000002421450520414700340700ustar00rootroot00000000000000const obj = { mutated: false, noEffect() {} }; function foo() { return x => { x.mutated = true; }; } foo()(obj); console.log(obj.mutated ? 'OK' : 'FAIL'); rollup-3.29.4/test/form/samples/argument-deoptimization/return-function-deoptimization/main.js000066400000000000000000000002761450520414700330630ustar00rootroot00000000000000const obj = { mutated: false, noEffect() {} }; function foo() { return x => { x.mutated = true; }; } foo()(obj); // removed obj.noEffect(); console.log(obj.mutated ? 'OK' : 'FAIL'); rollup-3.29.4/test/form/samples/array-element-tracking/000077500000000000000000000000001450520414700230635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/array-element-tracking/array-elements/000077500000000000000000000000001450520414700260135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/array-element-tracking/array-elements/_config.js000066400000000000000000000001141450520414700277510ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks elements of arrays' }); rollup-3.29.4/test/form/samples/array-element-tracking/array-elements/_expected.js000066400000000000000000000001441450520414700303100ustar00rootroot00000000000000console.log('retained'); console.log('retained'); console.log('retained'); console.log('retained'); rollup-3.29.4/test/form/samples/array-element-tracking/array-elements/main.js000066400000000000000000000004671450520414700273040ustar00rootroot00000000000000const array = [true, false, 3]; if (array[0]) console.log('retained'); else console.log('removed'); if (array[1]) console.log('removed'); else console.log('retained'); if (array[2] === 3) console.log('retained'); else console.log('removed'); if (array[3]) console.log('removed'); else console.log('retained'); rollup-3.29.4/test/form/samples/array-element-tracking/array-mutation/000077500000000000000000000000001450520414700260375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/array-element-tracking/array-mutation/_config.js000066400000000000000000000001251450520414700277770ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of array elements' }); rollup-3.29.4/test/form/samples/array-element-tracking/array-mutation/_expected.js000066400000000000000000000003521450520414700303350ustar00rootroot00000000000000const array = [true, true]; array[1] = false; array[2] = true; console.log('retained'); if (array[1]) console.log('unimportant'); else console.log('retained'); if (array[2]) console.log('retained'); else console.log('unimportant'); rollup-3.29.4/test/form/samples/array-element-tracking/array-mutation/main.js000066400000000000000000000004251450520414700273220ustar00rootroot00000000000000const array = [true, true]; array[1] = false; array[2] = true; if (array[0]) console.log('retained'); else console.log('removed'); if (array[1]) console.log('unimportant'); else console.log('retained'); if (array[2]) console.log('retained'); else console.log('unimportant'); rollup-3.29.4/test/form/samples/array-element-tracking/array-spread/000077500000000000000000000000001450520414700254555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/array-element-tracking/array-spread/_config.js000066400000000000000000000001411450520414700274130ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks elements of arrays with spread elements' }); rollup-3.29.4/test/form/samples/array-element-tracking/array-spread/_expected.js000066400000000000000000000004111450520414700277470ustar00rootroot00000000000000const spread = [true, false]; const array = [true, false, ...spread]; console.log('retained'); console.log('retained'); if (array[2]) console.log('retained'); else console.log('unimportant'); if (array[3]) console.log('unimportant'); else console.log('retained'); rollup-3.29.4/test/form/samples/array-element-tracking/array-spread/main.js000066400000000000000000000005371450520414700267440ustar00rootroot00000000000000const spread = [true, false]; const array = [true, false, ...spread]; if (array[0]) console.log('retained'); else console.log('removed'); if (array[1]) console.log('removed'); else console.log('retained'); if (array[2]) console.log('retained'); else console.log('unimportant'); if (array[3]) console.log('unimportant'); else console.log('retained'); rollup-3.29.4/test/form/samples/array-element-tracking/spread-element-deoptimization/000077500000000000000000000000001450520414700310255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/array-element-tracking/spread-element-deoptimization/_config.js000066400000000000000000000001241450520414700327640ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes array spread elements' }); rollup-3.29.4/test/form/samples/array-element-tracking/spread-element-deoptimization/_expected.js000066400000000000000000000001531450520414700333220ustar00rootroot00000000000000const spread = [{ effect() {} }]; [...spread][0].effect = () => console.log('effect'); spread[0].effect(); rollup-3.29.4/test/form/samples/array-element-tracking/spread-element-deoptimization/main.js000066400000000000000000000001531450520414700323060ustar00rootroot00000000000000const spread = [{ effect() {} }]; [...spread][0].effect = () => console.log('effect'); spread[0].effect(); rollup-3.29.4/test/form/samples/arrow-function-call-parameters/000077500000000000000000000000001450520414700245455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/arrow-function-call-parameters/_config.js000066400000000000000000000002221450520414700265030ustar00rootroot00000000000000module.exports = defineTest({ description: 'take actual parameters into account when determining side-effects of calls to arrow functions' }); rollup-3.29.4/test/form/samples/arrow-function-call-parameters/_expected.js000066400000000000000000000015351450520414700270470ustar00rootroot00000000000000const callArg = arg => arg(); callArg( () => console.log( 'effect' ) ); const assignArg = arg => arg.foo.bar = 1; assignArg( {} ); const returnArg = arg => arg; returnArg( () => console.log( 'effect' ) )(); const returnArg2 = arg => arg; returnArg2( {} ).foo.bar = 1; const returnArg3 = arg => arg; returnArg3( () => () => console.log( 'effect' ) )()(); const returnArgReturn = arg => arg(); returnArgReturn( () => () => console.log( 'effect' ) )(); const returnArgReturn2 = arg => arg(); returnArgReturn2( () => ({}) ).foo.bar = 1; const returnArgReturn3 = arg => arg(); returnArgReturn3( () => () => () => console.log( 'effect' ) )()(); const multiArgument = ( func, obj ) => func( obj ); multiArgument( obj => obj(), () => console.log( 'effect' ) ); const multiArgument2 = ( func, obj ) => func( obj ); multiArgument2( obj => obj.foo.bar = 1, {} ); rollup-3.29.4/test/form/samples/arrow-function-call-parameters/main.js000066400000000000000000000015351450520414700260330ustar00rootroot00000000000000const callArg = arg => arg(); callArg( () => console.log( 'effect' ) ); const assignArg = arg => arg.foo.bar = 1; assignArg( {} ); const returnArg = arg => arg; returnArg( () => console.log( 'effect' ) )(); const returnArg2 = arg => arg; returnArg2( {} ).foo.bar = 1; const returnArg3 = arg => arg; returnArg3( () => () => console.log( 'effect' ) )()(); const returnArgReturn = arg => arg(); returnArgReturn( () => () => console.log( 'effect' ) )(); const returnArgReturn2 = arg => arg(); returnArgReturn2( () => ({}) ).foo.bar = 1; const returnArgReturn3 = arg => arg(); returnArgReturn3( () => () => () => console.log( 'effect' ) )()(); const multiArgument = ( func, obj ) => func( obj ); multiArgument( obj => obj(), () => console.log( 'effect' ) ); const multiArgument2 = ( func, obj ) => func( obj ); multiArgument2( obj => obj.foo.bar = 1, {} ); rollup-3.29.4/test/form/samples/arrow-function-return-values/000077500000000000000000000000001450520414700243055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/arrow-function-return-values/_config.js000066400000000000000000000001341450520414700262450ustar00rootroot00000000000000module.exports = defineTest({ description: 'forwards return values of arrow functions' }); rollup-3.29.4/test/form/samples/arrow-function-return-values/_expected.js000066400000000000000000000005501450520414700266030ustar00rootroot00000000000000(() => () => console.log( 'effect' ))()(); (() => () => () => console.log( 'effect' ))()()(); const retained1 = () => () => console.log( 'effect' ); retained1()(); (() => { return () => console.log( 'effect' ); })()(); (() => ({ foo: () => console.log( 'effect' ) }))().foo(); (() => ({ foo: () => ({ bar: () => console.log( 'effect' ) }) }))().foo().bar(); rollup-3.29.4/test/form/samples/arrow-function-return-values/main.js000066400000000000000000000011531450520414700255670ustar00rootroot00000000000000(() => () => {})()(); (() => () => console.log( 'effect' ))()(); (() => () => () => {})()()(); (() => () => () => console.log( 'effect' ))()()(); const removed1 = () => () => {}; removed1()(); const retained1 = () => () => console.log( 'effect' ); retained1()(); (() => { return () => {}; })()(); (() => { return () => console.log( 'effect' ); })()(); (() => ({ foo: () => {} }))().foo(); (() => ({ foo: () => console.log( 'effect' ) }))().foo(); (() => ({ foo: () => ({ bar: () => ({ baz: () => {} }) }) }))().foo().bar().baz(); (() => ({ foo: () => ({ bar: () => console.log( 'effect' ) }) }))().foo().bar(); rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/000077500000000000000000000000001450520414700246415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/_config.js000066400000000000000000000002121450520414700265760ustar00rootroot00000000000000module.exports = defineTest({ description: 'assignment to views of buffers should be kept', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/_expected/000077500000000000000000000000001450520414700266015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/_expected/amd.js000066400000000000000000000003361450520414700277020ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var buffer = new ArrayBuffer( 8 ); var view8 = new Int8Array( buffer ); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; exports.view8 = view8; })); rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/_expected/cjs.js000066400000000000000000000002511450520414700277140ustar00rootroot00000000000000'use strict'; var buffer = new ArrayBuffer( 8 ); var view8 = new Int8Array( buffer ); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; exports.view8 = view8; rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/_expected/es.js000066400000000000000000000002251450520414700275450ustar00rootroot00000000000000var buffer = new ArrayBuffer( 8 ); var view8 = new Int8Array( buffer ); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; export { view8 }; rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/_expected/iife.js000066400000000000000000000003551450520414700300560ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; var buffer = new ArrayBuffer( 8 ); var view8 = new Int8Array( buffer ); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; exports.view8 = view8; return exports; })({}); rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/_expected/system.js000066400000000000000000000004271450520414700304660ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var buffer = new ArrayBuffer( 8 ); var view8 = exports('view8', new Int8Array( buffer )); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; }) }; })); rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/_expected/umd.js000066400000000000000000000007731450520414700277330ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; var buffer = new ArrayBuffer( 8 ); var view8 = new Int8Array( buffer ); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; exports.view8 = view8; })); rollup-3.29.4/test/form/samples/assignment-to-array-buffer-view/main.js000066400000000000000000000002251450520414700261220ustar00rootroot00000000000000var buffer = new ArrayBuffer( 8 ); var view8 = new Int8Array( buffer ); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; export { view8 }; rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/000077500000000000000000000000001450520414700263765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/_config.js000066400000000000000000000002041450520414700303340ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not rewrite class expression IDs', options: { output: { name: 'myModule' } } }); rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/_expected/000077500000000000000000000000001450520414700303365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/_expected/amd.js000066400000000000000000000001771450520414700314420ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; exports.Foo = class Foo {}; exports.Foo = lol( exports.Foo ); })); rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/_expected/cjs.js000066400000000000000000000001151450520414700314500ustar00rootroot00000000000000'use strict'; exports.Foo = class Foo {}; exports.Foo = lol( exports.Foo ); rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/_expected/es.js000066400000000000000000000000731450520414700313030ustar00rootroot00000000000000let Foo = class Foo {}; Foo = lol( Foo ); export { Foo }; rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/_expected/iife.js000066400000000000000000000002201450520414700316020ustar00rootroot00000000000000var myModule = (function (exports) { 'use strict'; exports.Foo = class Foo {}; exports.Foo = lol( exports.Foo ); return exports; })({}); rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/_expected/system.js000066400000000000000000000003111450520414700322130ustar00rootroot00000000000000System.register('myModule', [], (function (exports) { 'use strict'; return { execute: (function () { let Foo = exports('Foo', class Foo {}); exports('Foo', Foo = lol( Foo )); }) }; })); rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/_expected/umd.js000066400000000000000000000006361450520414700314660ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myModule = {})); })(this, (function (exports) { 'use strict'; exports.Foo = class Foo {}; exports.Foo = lol( exports.Foo ); })); rollup-3.29.4/test/form/samples/assignment-to-exports-class-declaration/main.js000066400000000000000000000000601450520414700276540ustar00rootroot00000000000000export let Foo = class Foo {} Foo = lol( Foo ); rollup-3.29.4/test/form/samples/assignment-to-exports/000077500000000000000000000000001450520414700230105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/assignment-to-exports/_config.js000066400000000000000000000002121450520414700247450ustar00rootroot00000000000000module.exports = defineTest({ description: 'declares updated variable in ES output (#755)', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/assignment-to-exports/_expected/000077500000000000000000000000001450520414700247505ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/assignment-to-exports/_expected/amd.js000066400000000000000000000010721450520414700260470ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; // Unassigned export var foo1; // Reassigned uninitialised export exports.bar1 = 1; exports.bar1 = void 0; // Reassigned initialised export exports.baz1 = 1; exports.baz1 = 2; // Unassigned export var kept1, foo2, kept2; // Reassigned uninitialised export var kept1; exports.bar2 = void 0; var kept2; exports.bar2 = 1; // Reassigned initialised export var kept1; exports.baz2 = 1; var kept2; exports.baz2 = 2; console.log( kept1, kept2 ); exports.foo1 = foo1; exports.foo2 = foo2; })); rollup-3.29.4/test/form/samples/assignment-to-exports/_expected/cjs.js000066400000000000000000000007671450520414700260770ustar00rootroot00000000000000'use strict'; // Unassigned export var foo1; // Reassigned uninitialised export exports.bar1 = 1; exports.bar1 = void 0; // Reassigned initialised export exports.baz1 = 1; exports.baz1 = 2; // Unassigned export var kept1, foo2, kept2; // Reassigned uninitialised export var kept1; exports.bar2 = void 0; var kept2; exports.bar2 = 1; // Reassigned initialised export var kept1; exports.baz2 = 1; var kept2; exports.baz2 = 2; console.log( kept1, kept2 ); exports.foo1 = foo1; exports.foo2 = foo2; rollup-3.29.4/test/form/samples/assignment-to-exports/_expected/es.js000066400000000000000000000006331450520414700257170ustar00rootroot00000000000000// Unassigned export var foo1; // Reassigned uninitialised export bar1 = 1; var bar1; // Reassigned initialised export var baz1 = 1; baz1 = 2; // Unassigned export var kept1, foo2, kept2; // Reassigned uninitialised export var kept1, bar2, kept2; bar2 = 1; // Reassigned initialised export var kept1, baz2 = 1, kept2; baz2 = 2; console.log( kept1, kept2 ); export { bar1, bar2, baz1, baz2, foo1, foo2 }; rollup-3.29.4/test/form/samples/assignment-to-exports/_expected/iife.js000066400000000000000000000011111450520414700262140ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; // Unassigned export var foo1; // Reassigned uninitialised export exports.bar1 = 1; exports.bar1 = void 0; // Reassigned initialised export exports.baz1 = 1; exports.baz1 = 2; // Unassigned export var kept1, foo2, kept2; // Reassigned uninitialised export var kept1; exports.bar2 = void 0; var kept2; exports.bar2 = 1; // Reassigned initialised export var kept1; exports.baz2 = 1; var kept2; exports.baz2 = 2; console.log( kept1, kept2 ); exports.foo1 = foo1; exports.foo2 = foo2; return exports; })({}); rollup-3.29.4/test/form/samples/assignment-to-exports/_expected/system.js000066400000000000000000000013271450520414700266350ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { // Unassigned export var foo1; exports('foo1', foo1); // Reassigned uninitialised export exports('bar1', bar1 = 1); var bar1; exports('bar1', bar1); // Reassigned initialised export var baz1 = exports('baz1', 1); exports('baz1', baz1 = 2); // Unassigned export var kept1, foo2, kept2; exports('foo2', foo2); // Reassigned uninitialised export var kept1, bar2, kept2; exports('bar2', bar2); exports('bar2', bar2 = 1); // Reassigned initialised export var kept1, baz2 = exports('baz2', 1), kept2; exports('baz2', baz2 = 2); console.log( kept1, kept2 ); }) }; })); rollup-3.29.4/test/form/samples/assignment-to-exports/_expected/umd.js000066400000000000000000000015271450520414700261000ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; // Unassigned export var foo1; // Reassigned uninitialised export exports.bar1 = 1; exports.bar1 = void 0; // Reassigned initialised export exports.baz1 = 1; exports.baz1 = 2; // Unassigned export var kept1, foo2, kept2; // Reassigned uninitialised export var kept1; exports.bar2 = void 0; var kept2; exports.bar2 = 1; // Reassigned initialised export var kept1; exports.baz2 = 1; var kept2; exports.baz2 = 2; console.log( kept1, kept2 ); exports.foo1 = foo1; exports.foo2 = foo2; })); rollup-3.29.4/test/form/samples/assignment-to-exports/main.js000066400000000000000000000006361450520414700242770ustar00rootroot00000000000000// Unassigned export export var foo1; // Reassigned uninitialised export bar1 = 1; export var bar1; // Reassigned initialised export export var baz1 = 1; baz1 = 2; // Unassigned export var kept1, foo2, kept2; // Reassigned uninitialised export var kept1, bar2, kept2; bar2 = 1; // Reassigned initialised export var kept1, baz2 = 1, kept2; baz2 = 2; export { foo2, bar2, baz2 }; console.log( kept1, kept2 ); rollup-3.29.4/test/form/samples/assignment-to-global/000077500000000000000000000000001450520414700225445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/assignment-to-global/_config.js000066400000000000000000000001541450520414700245060ustar00rootroot00000000000000module.exports = defineTest({ description: 'Assignments to global variables should be effects (#1587)' }); rollup-3.29.4/test/form/samples/assignment-to-global/_expected.js000066400000000000000000000000301450520414700250330ustar00rootroot00000000000000globalThis.unknown = 1; rollup-3.29.4/test/form/samples/assignment-to-global/main.js000066400000000000000000000000301450520414700240170ustar00rootroot00000000000000globalThis.unknown = 1; rollup-3.29.4/test/form/samples/async-function-effects/000077500000000000000000000000001450520414700230735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/async-function-effects/_config.js000066400000000000000000000001311450520414700250300ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks effects when awaiting thenables' }); rollup-3.29.4/test/form/samples/async-function-effects/_expected.js000066400000000000000000000024501450520414700253720ustar00rootroot00000000000000(async function () { return { then() { console.log(1); } }; })(); (async function () { return { get then() { console.log(2); return () => {}; } }; })(); (async function () { return { get then() { return () => console.log(3); } }; })(); (async () => ({ then() { console.log(4); } }))(); (async () => ({ get then() { console.log(5); return () => {}; } }))(); (async () => ({ get then() { return () => console.log(6); } }))(); (async function () { await { then: function () { console.log(7); } }; return { then() {} }; })(); (async function () { await { get then() { console.log(8); return () => {}; } }; return { then() {} }; })(); (async function () { await { get then() { return () => console.log(9); } }; return { then() {} }; })(); (async function () { await await { then(resolve) { resolve({ then() { console.log(10); } }); } }; return { then() {} }; })(); async function asyncIdentity(x) { return x; } asyncIdentity({}); // no side effects - may be dropped const promise = asyncIdentity(11); promise.then(x => console.log(x)); asyncIdentity({ then(success, fail) { success(console.log(12)); } }); asyncIdentity({ then(resolve) { resolve({ then() { console.log(13); } }); } }); rollup-3.29.4/test/form/samples/async-function-effects/main.js000066400000000000000000000030671450520414700243630ustar00rootroot00000000000000(async function () { return { then() { console.log(1); } }; })(); // removed (async function () { return { then() {} }; })(); (async function () { return { get then() { console.log(2); return () => {}; } }; })(); (async function () { return { get then() { return () => console.log(3); } }; })(); // removed (async function () { return { get then() { return () => {}; } }; })(); (async () => ({ then() { console.log(4); } }))(); // removed (async () => ({ then() {} }))(); (async () => ({ get then() { console.log(5); return () => {}; } }))(); (async () => ({ get then() { return () => console.log(6); } }))(); // removed (async () => ({ get then() { return () => {}; } }))(); (async function () { await { then: function () { console.log(7); } }; return { then() {} }; })(); (async function () { await { get then() { console.log(8); return () => {}; } }; return { then() {} }; })(); (async function () { await { get then() { return () => console.log(9); } }; return { then() {} }; })(); (async function () { await await { then(resolve) { resolve({ then() { console.log(10); } }); } }; return { then() {} }; })(); async function asyncIdentity(x) { return x; } asyncIdentity({}); // no side effects - may be dropped const promise = asyncIdentity(11); promise.then(x => console.log(x)); asyncIdentity({ then(success, fail) { success(console.log(12)); } }); asyncIdentity({ then(resolve) { resolve({ then() { console.log(13); } }); } }); rollup-3.29.4/test/form/samples/async-function-unused/000077500000000000000000000000001450520414700227575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/async-function-unused/_config.js000066400000000000000000000001241450520414700247160ustar00rootroot00000000000000module.exports = defineTest({ description: 'treeshakes async functions (#492)' }); rollup-3.29.4/test/form/samples/async-function-unused/_expected.js000066400000000000000000000001271450520414700252550ustar00rootroot00000000000000async function foo () { return 'foo'; } foo().then( value => console.log( value ) ); rollup-3.29.4/test/form/samples/async-function-unused/main.js000066400000000000000000000001201450520414700242320ustar00rootroot00000000000000import { foo } from './utils.js'; foo().then( value => console.log( value ) ); rollup-3.29.4/test/form/samples/async-function-unused/utils.js000066400000000000000000000001411450520414700244510ustar00rootroot00000000000000export async function foo () { return 'foo'; } export async function bar () { return 'bar'; } rollup-3.29.4/test/form/samples/automatic-semicolon-insertion-var/000077500000000000000000000000001450520414700252705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/automatic-semicolon-insertion-var/_config.js000066400000000000000000000001271450520414700272320ustar00rootroot00000000000000module.exports = defineTest({ description: 'Adds trailing semicolons for modules' }); rollup-3.29.4/test/form/samples/automatic-semicolon-insertion-var/_expected.js000066400000000000000000000000551450520414700275660ustar00rootroot00000000000000var c = 0; (()=>{ console.log(c); })(); rollup-3.29.4/test/form/samples/automatic-semicolon-insertion-var/c.js000066400000000000000000000000201450520414700260400ustar00rootroot00000000000000export default 0rollup-3.29.4/test/form/samples/automatic-semicolon-insertion-var/main.js000066400000000000000000000000661450520414700265540ustar00rootroot00000000000000import c from './c.js' ;(()=>{ console.log(c) })()rollup-3.29.4/test/form/samples/avoid-unnecessary-conditional-deopt/000077500000000000000000000000001450520414700255675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/avoid-unnecessary-conditional-deopt/_config.js000066400000000000000000000001601450520414700275260ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoids unnecessary deoptimizations of conditional expressions' }); rollup-3.29.4/test/form/samples/avoid-unnecessary-conditional-deopt/_expected.js000066400000000000000000000007411450520414700300670ustar00rootroot00000000000000console.log('not modified'); let x2 = false; modifyX2(); const obj2 = { modified: false }; (x2 ? obj2 : {}).modified = true; if (obj2.modified) console.log('modified'); else console.log('not modified'); function modifyX2() { x2 = true; } console.log('not modified'); let x4 = false; modifyX4(); const obj4 = { modified: false }; (x4 && obj4).modified = true; if (obj4.modified) console.log('modified'); else console.log('not modified'); function modifyX4() { x4 = true; } rollup-3.29.4/test/form/samples/avoid-unnecessary-conditional-deopt/main.js000066400000000000000000000014711450520414700270540ustar00rootroot00000000000000let x1 = false; modifyX1(); const obj1 = { modified: false }; x1 ? obj1 : {}; if (obj1.modified) console.log('should not happen'); else console.log('not modified'); function modifyX1() { x1 = true; } let x2 = false; modifyX2(); const obj2 = { modified: false }; (x2 ? obj2 : {}).modified = true; if (obj2.modified) console.log('modified'); else console.log('not modified'); function modifyX2() { x2 = true; } let x3 = false; modifyX3(); const obj3 = { modified: false }; x3 && obj3; if (obj3.modified) console.log('should not happen'); else console.log('not modified'); function modifyX3() { x3 = true; } let x4 = false; modifyX4(); const obj4 = { modified: false }; (x4 && obj4).modified = true; if (obj4.modified) console.log('modified'); else console.log('not modified'); function modifyX4() { x4 = true; } rollup-3.29.4/test/form/samples/banner-and-footer/000077500000000000000000000000001450520414700220175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/banner-and-footer/_config.js000066400000000000000000000011151450520414700237570ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds a banner/footer', options: { output: { banner: '/* this is a banner */', footer: () => Promise.resolve('/* this is a footer */') }, plugins: [ { name: 'first', banner: '/* first banner */', footer() { return '/* first footer */'; } }, { name: 'second', banner() { return '/* second banner */'; }, footer: '/* second footer */' }, { name: 'third', banner() { return Promise.resolve('/* 3rd banner */'); }, footer: '/* 3rd footer */' } ] } }); rollup-3.29.4/test/form/samples/banner-and-footer/_expected/000077500000000000000000000000001450520414700237575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/banner-and-footer/_expected/amd.js000066400000000000000000000003501450520414700250540ustar00rootroot00000000000000/* this is a banner */ /* first banner */ /* second banner */ /* 3rd banner */ define((function () { 'use strict'; console.log( 'hello world' ); })); /* this is a footer */ /* first footer */ /* second footer */ /* 3rd footer */ rollup-3.29.4/test/form/samples/banner-and-footer/_expected/cjs.js000066400000000000000000000003131450520414700250710ustar00rootroot00000000000000/* this is a banner */ /* first banner */ /* second banner */ /* 3rd banner */ 'use strict'; console.log( 'hello world' ); /* this is a footer */ /* first footer */ /* second footer */ /* 3rd footer */ rollup-3.29.4/test/form/samples/banner-and-footer/_expected/es.js000066400000000000000000000002741450520414700247270ustar00rootroot00000000000000/* this is a banner */ /* first banner */ /* second banner */ /* 3rd banner */ console.log( 'hello world' ); /* this is a footer */ /* first footer */ /* second footer */ /* 3rd footer */ rollup-3.29.4/test/form/samples/banner-and-footer/_expected/iife.js000066400000000000000000000003431450520414700252310ustar00rootroot00000000000000/* this is a banner */ /* first banner */ /* second banner */ /* 3rd banner */ (function () { 'use strict'; console.log( 'hello world' ); })(); /* this is a footer */ /* first footer */ /* second footer */ /* 3rd footer */ rollup-3.29.4/test/form/samples/banner-and-footer/_expected/system.js000066400000000000000000000004451450520414700256440ustar00rootroot00000000000000/* this is a banner */ /* first banner */ /* second banner */ /* 3rd banner */ System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 'hello world' ); }) }; })); /* this is a footer */ /* first footer */ /* second footer */ /* 3rd footer */ rollup-3.29.4/test/form/samples/banner-and-footer/_expected/umd.js000066400000000000000000000005061450520414700251030ustar00rootroot00000000000000/* this is a banner */ /* first banner */ /* second banner */ /* 3rd banner */ (function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 'hello world' ); })); /* this is a footer */ /* first footer */ /* second footer */ /* 3rd footer */ rollup-3.29.4/test/form/samples/banner-and-footer/main.js000066400000000000000000000000361450520414700233000ustar00rootroot00000000000000console.log( 'hello world' ); rollup-3.29.4/test/form/samples/base64-deshadow/000077500000000000000000000000001450520414700213765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/base64-deshadow/_config.js000066400000000000000000000001151450520414700233350ustar00rootroot00000000000000module.exports = defineTest({ description: 'base64 deshadowing indices' }); rollup-3.29.4/test/form/samples/base64-deshadow/_expected.js000066400000000000000000000007101450520414700236720ustar00rootroot00000000000000var name$b = 5; var name$a = 5; var name$9 = 5; var name$8 = 5; var name$7 = 5; var name$6 = 5; var name$5 = 5; var name$4 = 5; var name$3 = 5; var name$2 = 5; var name$1 = 5; console.log(name$b); console.log(name$a); console.log(name$9); console.log(name$8); console.log(name$7); console.log(name$6); console.log(name$5); console.log(name$4); console.log(name$3); console.log(name$2); console.log(name$1); var name = 'name'; export { name }; rollup-3.29.4/test/form/samples/base64-deshadow/dep1.js000066400000000000000000000000241450520414700225610ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep10.js000066400000000000000000000000241450520414700226410ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep11.js000066400000000000000000000000241450520414700226420ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep2.js000066400000000000000000000000241450520414700225620ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep3.js000066400000000000000000000000241450520414700225630ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep4.js000066400000000000000000000000241450520414700225640ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep5.js000066400000000000000000000000241450520414700225650ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep6.js000066400000000000000000000000241450520414700225660ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep7.js000066400000000000000000000000241450520414700225670ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep8.js000066400000000000000000000000241450520414700225700ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/dep9.js000066400000000000000000000000241450520414700225710ustar00rootroot00000000000000export var name = 5;rollup-3.29.4/test/form/samples/base64-deshadow/main.js000066400000000000000000000011721450520414700226610ustar00rootroot00000000000000import { name as a } from './dep1.js'; import { name as b } from './dep2.js'; import { name as c } from './dep3.js'; import { name as d } from './dep4.js'; import { name as e } from './dep5.js'; import { name as f } from './dep6.js'; import { name as g } from './dep7.js'; import { name as h } from './dep8.js'; import { name as i } from './dep9.js'; import { name as j } from './dep10.js'; import { name as k } from './dep11.js'; console.log(a); console.log(b); console.log(c); console.log(d); console.log(e); console.log(f); console.log(g); console.log(h); console.log(i); console.log(j); console.log(k); export var name = 'name';rollup-3.29.4/test/form/samples/big-int/000077500000000000000000000000001450520414700200475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/big-int/_config.js000066400000000000000000000001231450520414700220050ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports bigint via acorn plugin' }); rollup-3.29.4/test/form/samples/big-int/_expected.js000066400000000000000000000003711450520414700223460ustar00rootroot00000000000000if (1n > 0) { console.log('ok'); } if (1n + 1n > 0) { console.log('ok'); } if (1n ** 1n > 0) { console.log('ok'); } const max = 2n**64n; const min = -max; function isSafe (int) { return min<=int && int<=max; } export { isSafe as default }; rollup-3.29.4/test/form/samples/big-int/main.js000066400000000000000000000003521450520414700213310ustar00rootroot00000000000000if (1n > 0) { console.log('ok'); } if (1n + 1n > 0) { console.log('ok'); } if (1n ** 1n > 0) { console.log('ok'); } const max = 2n**64n; const min = -max; export default function isSafe (int) { return min<=int && int<=max; }; rollup-3.29.4/test/form/samples/binary-expressions/000077500000000000000000000000001450520414700223625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/binary-expressions/_config.js000066400000000000000000000001311450520414700243170ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles binary expression side-effects' }); rollup-3.29.4/test/form/samples/binary-expressions/_expected.js000066400000000000000000000012351450520414700246610ustar00rootroot00000000000000if ((1 + 1).unknown) { console.log('retained'); } else { console.log('retained'); } console.log('retained 1'); console.log('retained 2'); console.log('retained 3'); console.log('retained 4'); console.log('retained 5'); console.log('retained 6'); console.log('retained 7'); console.log('retained 8'); console.log('retained 9'); console.log('retained 10'); console.log('retained 11'); console.log('retained 12'); console.log('retained 13'); console.log('retained 14'); console.log('retained 15'); console.log('retained 16'); console.log('retained 17'); if (1 in 2) console.log('retained 18'); if (1 instanceof 2) console.log('retained 19'); console.log('retained 20'); rollup-3.29.4/test/form/samples/binary-expressions/main.js000066400000000000000000000020111450520414700236360ustar00rootroot00000000000000if ((1 + 1).unknown) { console.log('retained'); } else { console.log('retained'); } if (1 != '1') console.log('removed'); if (1 !== 1) console.log('removed'); if (4 % 2 === 0) console.log('retained 1'); if ((6 & 3) === 2) console.log('retained 2'); if (2 * 3 === 6) console.log('retained 3'); if (2 ** 3 === 8) console.log('retained 4'); if (2 + 3 === 5) console.log('retained 5'); if (3 - 2 === 1) console.log('retained 6'); if (6 / 3 === 2) console.log('retained 7'); if (1 < 2 ) console.log('retained 8'); if (3 << 1 === 6) console.log('retained 9'); if (3 <= 4) console.log('retained 10'); if (1 == '1') console.log('retained 11'); if (1 === 1) console.log('retained 12'); if (3 > 2) console.log('retained 13'); if (3 >= 2) console.log('retained 14'); if (6 >> 1 === 3) console.log('retained 15'); if (-1 >>> 28 === 15) console.log('retained 16'); if (3 ^ 5 === 6) console.log('retained 17'); if (1 in 2) console.log('retained 18'); if (1 instanceof 2) console.log('retained 19'); if (2 | 4 === 6) console.log('retained 20'); rollup-3.29.4/test/form/samples/block-comments/000077500000000000000000000000001450520414700214335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/block-comments/_config.js000066400000000000000000000001271450520414700233750ustar00rootroot00000000000000module.exports = defineTest({ description: 'block comments are printed correctly' }); rollup-3.29.4/test/form/samples/block-comments/_expected.js000066400000000000000000000004301450520414700237260ustar00rootroot00000000000000function foo () { return embiggen( 6, 7 ); } /** * Embiggens a number * @param {number} num - the number to embiggen * @param {number} factor - the factor to embiggen it by * @returns {number} */ function embiggen ( num, factor ) { return num * factor; } alert( foo() ); rollup-3.29.4/test/form/samples/block-comments/foo.js000066400000000000000000000004261450520414700225560ustar00rootroot00000000000000export default function foo () { return embiggen( 6, 7 ); } /** * Embiggens a number * @param {number} num - the number to embiggen * @param {number} factor - the factor to embiggen it by * @returns {number} */ function embiggen ( num, factor ) { return num * factor; } rollup-3.29.4/test/form/samples/block-comments/main.js000066400000000000000000000000521450520414700227120ustar00rootroot00000000000000import foo from './foo'; alert( foo() ); rollup-3.29.4/test/form/samples/body-less-for-loops/000077500000000000000000000000001450520414700223355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/body-less-for-loops/_config.js000066400000000000000000000001171450520414700242760ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports body-less for loops' }); rollup-3.29.4/test/form/samples/body-less-for-loops/_expected.js000066400000000000000000000005111450520414700246300ustar00rootroot00000000000000for ( let i = 0; i < 10; i += 1 ) console.log( i ); for ( const letter of array ) console.log( letter ); for ( const index in array ) console.log( index ); let i; for ( i = 0; i < 10; i += 1 ) console.log( i ); let letter; for ( letter of array ) console.log( letter ); let index; for ( index in array ) console.log( index ); rollup-3.29.4/test/form/samples/body-less-for-loops/main.js000066400000000000000000000005111450520414700236140ustar00rootroot00000000000000for ( let i = 0; i < 10; i += 1 ) console.log( i ); for ( const letter of array ) console.log( letter ); for ( const index in array ) console.log( index ); let i; for ( i = 0; i < 10; i += 1 ) console.log( i ); let letter; for ( letter of array ) console.log( letter ); let index; for ( index in array ) console.log( index ); rollup-3.29.4/test/form/samples/break-control-flow/000077500000000000000000000000001450520414700222255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels-in-loops/000077500000000000000000000000001450520414700303115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels-in-loops/_config.js000066400000000000000000000001461450520414700322540ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles breaking to loops inside labeled statements' }); rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels-in-loops/_expected.js000066400000000000000000000005461450520414700326140ustar00rootroot00000000000000while (globalThis.unknown) { console.log('retained'); { break; } } { console.log('retained'); } while (globalThis.unknown) { console.log('retained'); } label: { while (globalThis.unknown) { console.log('retained'); break label; } console.log('retained'); } while (globalThis.unknown) { console.log('retained'); console.log('retained'); } rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels-in-loops/main.js000066400000000000000000000013011450520414700315660ustar00rootroot00000000000000while (globalThis.unknown) { console.log('retained'); label: { break; console.log('removed'); } console.log('removed'); } { while (globalThis.unknown) { label: { break; console.log('removed'); } console.log('removed'); } console.log('retained'); } while (globalThis.unknown) { label: { break label; console.log('removed'); } console.log('retained'); } label: { while (globalThis.unknown) { console.log('retained'); break label; console.log('removed'); } console.log('retained'); } while (globalThis.unknown) { console.log('retained'); outer: { label: { break outer; console.log('removed'); } console.log('removed'); } console.log('retained'); } rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels-switch/000077500000000000000000000000001450520414700300525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels-switch/_config.js000066400000000000000000000001651450520414700320160ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports labels when breaking control flow from a switch statement' }); rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels-switch/_expected.js000066400000000000000000000017331450520414700323540ustar00rootroot00000000000000function returnAll() { switch (globalThis.unknown) { case 1: console.log('retained'); return; case 2: console.log('retained'); return; default: console.log('retained'); return; } } returnAll(); { console.log('retained'); } function returnNoDefault() { switch (globalThis.unknown) { case 1: return; case 2: return; } console.log('retained'); } returnNoDefault(); function returnSomeBreak() { switch (globalThis.unknown) { case 1: return; case 2: break; default: return; } console.log('retained'); } returnSomeBreak(); function allBreak() { console.log('retained'); } allBreak(); function returnBreakDifferentLabels() { outer: { inner: { switch (globalThis.unknown) { case 1: break outer; case 2: break inner; default: break outer; } } console.log('retained'); } console.log('retained'); } returnBreakDifferentLabels(); function empty() { console.log('retained'); } empty(); rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels-switch/main.js000066400000000000000000000034631450520414700313420ustar00rootroot00000000000000function returnAll() { switch (globalThis.unknown) { case 1: console.log('retained'); return; console.log('removed'); case 2: console.log('retained'); return; console.log('removed'); default: console.log('retained'); return; console.log('removed'); } console.log('removed'); } returnAll(); { function returnAllRemoved() { switch (globalThis.unknown) { case 1: return; console.log('removed'); case 2: return; console.log('removed'); default: return; console.log('removed'); } console.log('removed'); } console.log('retained'); returnAllRemoved(); } function returnNoDefault() { switch (globalThis.unknown) { case 1: return; console.log('removed'); case 2: return; console.log('removed'); } console.log('retained'); } returnNoDefault(); function returnSomeBreak() { switch (globalThis.unknown) { case 1: return; console.log('removed'); case 2: break; console.log('removed'); default: return; console.log('removed'); } console.log('retained'); } returnSomeBreak(); function allBreak() { label: switch (globalThis.unknown) { case 1: break label; console.log('removed'); case 2: break; console.log('removed'); default: break label; console.log('removed'); } console.log('retained'); } allBreak(); function returnBreakDifferentLabels() { outer: { inner: { switch (globalThis.unknown) { case 1: break outer; console.log('removed'); case 2: break inner; console.log('removed'); default: break outer; console.log('removed'); } console.log('removed'); } console.log('retained'); } console.log('retained'); } returnBreakDifferentLabels(); function empty() { switch (globalThis.unknown) { } console.log('retained'); } empty(); rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels/000077500000000000000000000000001450520414700265535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels/_config.js000066400000000000000000000001351450520414700305140ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports labels when breaking control flow' }); rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels/_expected.js000066400000000000000000000013341450520414700310520ustar00rootroot00000000000000outer: { inner: { console.log('retained'); break inner; } console.log('retained'); break outer; } outer: { console.log('retained'); break outer; } outer: { /* retained comment */ { console.log('retained'); break outer; } } { console.log('retained'); } outer: { inner: { if (globalThis.unknown) break inner; break outer; } console.log('retained'); } function withConsequentReturn() { { inner: { if (globalThis.unknown) return; else break inner; } console.log('retained'); } { { return; } } } withConsequentReturn(); function withAlternateReturn() { { inner: { if (globalThis.unknown) break inner; else return; } console.log('retained'); } } withAlternateReturn(); rollup-3.29.4/test/form/samples/break-control-flow/break-statement-labels/main.js000066400000000000000000000022511450520414700300350ustar00rootroot00000000000000outer: { inner: { console.log('retained'); break inner; console.log('removed'); } console.log('retained'); break outer; console.log('removed'); } outer: { inner: { break inner; console.log('removed'); } console.log('retained'); break outer; console.log('removed'); } outer: { inner:/* retained comment */ { console.log('retained'); break outer; console.log('removed'); } console.log('removed'); } { outer: { inner: { break outer; console.log('removed'); } console.log('removed'); } console.log('retained'); } outer: { inner: { if (globalThis.unknown) break inner; break outer; console.log('removed'); } console.log('retained'); } function withConsequentReturn() { outer: { inner: { if (globalThis.unknown) return; else break inner; console.log('removed'); } console.log('retained'); } outer: { inner: { return; break inner; console.log('removed'); } console.log('removed'); } } withConsequentReturn(); function withAlternateReturn() { outer: { inner: { if (globalThis.unknown) break inner; else return; console.log('removed'); } console.log('retained'); } } withAlternateReturn(); rollup-3.29.4/test/form/samples/break-control-flow/break-statement-loops/000077500000000000000000000000001450520414700264455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/break-statement-loops/_config.js000066400000000000000000000001721450520414700304070ustar00rootroot00000000000000module.exports = defineTest({ description: 'breaks control flow when a break statement is encountered inside a loop' }); rollup-3.29.4/test/form/samples/break-control-flow/break-statement-loops/_expected.js000066400000000000000000000012511450520414700307420ustar00rootroot00000000000000while (globalThis.unknown) { console.log('retained'); break; } { console.log('retained'); } while (globalThis.unknown) { console.log('retained'); continue; } { console.log('retained'); } do { console.log('retained'); break; } while (globalThis.unknown); { console.log('retained'); } for (let i = 0; i < globalThis.unknown; i++) { console.log('retained'); break; } { console.log('retained'); } for (const foo of globalThis.unknown) { console.log('retained'); break; } { for (const foo of globalThis.unknown) { break; } console.log('retained'); } for (const foo in globalThis.unknown) { console.log('retained'); break; } { console.log('retained'); } rollup-3.29.4/test/form/samples/break-control-flow/break-statement-loops/main.js000066400000000000000000000023711450520414700277320ustar00rootroot00000000000000while (globalThis.unknown) { console.log('retained'); break; continue; console.log('removed'); } { while (globalThis.unknown) { break; continue; console.log('removed'); } console.log('retained'); } while (globalThis.unknown) { console.log('retained'); continue; break; console.log('removed'); } { while (globalThis.unknown) { continue; break; console.log('removed'); } console.log('retained'); } do { console.log('retained'); break; console.log('removed'); } while (globalThis.unknown); { do { break; console.log('removed'); } while (globalThis.unknown); console.log('retained'); } for (let i = 0; i < globalThis.unknown; i++) { console.log('retained'); break; console.log('removed'); } { for (let i = 0; i < globalThis.unknown; i++) { break; console.log('removed'); } console.log('retained'); } for (const foo of globalThis.unknown) { console.log('retained'); break; console.log('removed'); } { for (const foo of globalThis.unknown) { break; console.log('removed'); } console.log('retained'); } for (const foo in globalThis.unknown) { console.log('retained'); break; console.log('removed'); } { for (const foo in globalThis.unknown) { break; console.log('removed'); } console.log('retained'); } rollup-3.29.4/test/form/samples/break-control-flow/caught-errors/000077500000000000000000000000001450520414700250125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/caught-errors/_config.js000066400000000000000000000002621450520414700267540ustar00rootroot00000000000000module.exports = defineTest({ description: 'breaks control flow when an error is thrown inside a catch block', options: { treeshake: { tryCatchDeoptimization: false } } }); rollup-3.29.4/test/form/samples/break-control-flow/caught-errors/_expected.js000066400000000000000000000017101450520414700273070ustar00rootroot00000000000000function errorTry() { try { throw new Error('Break'); } catch { console.log('retained'); } finally { console.log('retained'); } console.log('retained'); } try { errorTry(); } catch {} function errorCatch() { try { console.log('retained'); } catch { throw new Error('Break'); } finally { console.log('retained'); } console.log('retained'); } try { errorCatch(); } catch {} function errorFinally() { try { console.log('retained'); } catch { console.log('retained'); } finally { throw new Error('Break'); } } try { errorFinally(); } catch {} function tryAfterError() { console.log(hoisted1, hoisted2, hoisted3); throw new Error(); try { var hoisted1; } catch { var hoisted2; } finally { var hoisted3; } } try { tryAfterError(); } catch {} function errorTryNoCatch() { try { throw new Error('Break'); } finally { console.log('retained'); } console.log('retained'); } try { errorTryNoCatch(); } catch {} rollup-3.29.4/test/form/samples/break-control-flow/caught-errors/main.js000066400000000000000000000022611450520414700262750ustar00rootroot00000000000000function errorTry() { try { throw new Error('Break'); console.log('removed'); } catch { console.log('retained'); } finally { console.log('retained'); } console.log('retained'); } try { errorTry(); } catch {} function errorCatch() { try { console.log('retained'); } catch { throw new Error('Break'); console.log('removed'); } finally { console.log('retained'); } console.log('retained'); } try { errorCatch(); } catch {} function errorFinally() { try { console.log('retained'); } catch { console.log('retained'); } finally { throw new Error('Break'); console.log('removed'); } console.log('removed'); } try { errorFinally(); } catch {} function tryAfterError() { console.log(hoisted1, hoisted2, hoisted3); throw new Error(); try { console.log('removed'); var hoisted1; } catch { console.log('removed'); var hoisted2; } finally { console.log('removed'); var hoisted3; } console.log('removed'); } try { tryAfterError(); } catch {} function errorTryNoCatch() { try { throw new Error('Break'); console.log('removed'); } finally { console.log('retained'); } console.log('retained'); } try { errorTryNoCatch(); } catch {} rollup-3.29.4/test/form/samples/break-control-flow/hoisted-declarations/000077500000000000000000000000001450520414700263325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/hoisted-declarations/_config.js000066400000000000000000000001541450520414700302740ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes hoisted declarations when control flow is broken' }); rollup-3.29.4/test/form/samples/break-control-flow/hoisted-declarations/_expected.js000066400000000000000000000003331450520414700306270ustar00rootroot00000000000000try { nested(); } catch {} function nested() { hoisted(); throw new Error(); function hoisted() { console.log('included'); } } hoisted(); throw new Error(); function hoisted() { console.log('included'); } rollup-3.29.4/test/form/samples/break-control-flow/hoisted-declarations/main.js000066400000000000000000000005011450520414700276100ustar00rootroot00000000000000try { nested(); } catch {} function nested() { hoisted(); throw new Error(); console.log('removed'); function hoisted() { console.log('included'); } console.log('removed'); } hoisted(); throw new Error(); console.log('removed'); function hoisted() { console.log('included'); } console.log('removed'); rollup-3.29.4/test/form/samples/break-control-flow/if-statement-breaks/000077500000000000000000000000001450520414700260725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/if-statement-breaks/_config.js000066400000000000000000000001311450520414700300270ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles conditionally broken execution' }); rollup-3.29.4/test/form/samples/break-control-flow/if-statement-breaks/_expected.js000066400000000000000000000026431450520414700303750ustar00rootroot00000000000000function unknownValueConsequent() { if (globalThis.unknownValue) { throw new Error(); } else { console.log('retained'); } console.log('retained'); } try { unknownValueConsequent(); } catch {} function unknownValueOnlyConsequent() { if (globalThis.unknownValue) { throw new Error(); } console.log('retained'); } try { unknownValueOnlyConsequent(); } catch {} function unknownValueAlternate() { if (globalThis.unknownValue) { console.log('retained'); } else { throw new Error(); } console.log('retained'); } try { unknownValueAlternate(); } catch {} function unknownValueBoth() { if (globalThis.unknownValue) { throw new Error(); } else { throw new Error(); } } try { unknownValueBoth(); } catch {} function unknownValueAfterError() { console.log(hoisted1, hoisted2); throw new Error(); if (globalThis.unknownValue) { var hoisted1; } else { var hoisted2; } } try { unknownValueAfterError(); } catch {} function truthyValueConsequent() { { throw new Error(); } } try { truthyValueConsequent(); } catch {} function truthyValueAlternate() { { console.log('retained'); } console.log('retained'); } try { truthyValueAlternate(); } catch {} function falsyValueConsequent() { { console.log('retained'); } console.log('retained'); } try { falsyValueConsequent(); } catch {} function falsyValueAlternate() { { throw new Error(); } } try { falsyValueAlternate(); } catch {} rollup-3.29.4/test/form/samples/break-control-flow/if-statement-breaks/main.js000066400000000000000000000036411450520414700273600ustar00rootroot00000000000000function unknownValueConsequent() { if (globalThis.unknownValue) { throw new Error(); console.log('removed'); } else { console.log('retained'); } console.log('retained'); } try { unknownValueConsequent(); } catch {} function unknownValueOnlyConsequent() { if (globalThis.unknownValue) { throw new Error(); console.log('removed'); } console.log('retained'); } try { unknownValueOnlyConsequent(); } catch {} function unknownValueAlternate() { if (globalThis.unknownValue) { console.log('retained'); } else { throw new Error(); console.log('removed'); } console.log('retained'); } try { unknownValueAlternate(); } catch {} function unknownValueBoth() { if (globalThis.unknownValue) { throw new Error(); console.log('removed'); } else { throw new Error(); console.log('removed'); } console.log('removed'); } try { unknownValueBoth(); } catch {} function unknownValueAfterError() { console.log(hoisted1, hoisted2); throw new Error(); if (globalThis.unknownValue) { console.log('removed'); var hoisted1; } else { console.log('removed'); var hoisted2; } console.log('removed'); } try { unknownValueAfterError(); } catch {} function truthyValueConsequent() { if (true) { throw new Error(); console.log('removed'); } else { console.log('removed'); } console.log('removed'); } try { truthyValueConsequent(); } catch {} function truthyValueAlternate() { if (true) { console.log('retained'); } else { throw new Error(); } console.log('retained'); } try { truthyValueAlternate(); } catch {} function falsyValueConsequent() { if (false) { throw new Error(); } else { console.log('retained'); } console.log('retained'); } try { falsyValueConsequent(); } catch {} function falsyValueAlternate() { if (false) { console.log('removed'); } else { throw new Error(); console.log('removed'); } console.log('removed'); } try { falsyValueAlternate(); } catch {} rollup-3.29.4/test/form/samples/break-control-flow/if-statement-errors/000077500000000000000000000000001450520414700261375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/if-statement-errors/_config.js000066400000000000000000000001261450520414700301000ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles conditionally thrown errors' }); rollup-3.29.4/test/form/samples/break-control-flow/if-statement-errors/_expected.js000066400000000000000000000002451450520414700304360ustar00rootroot00000000000000while (true) { if (globalThis.unknown) break; console.log('retained'); } while (true) { if (globalThis.unknown) ; else { break; } console.log('retained'); } rollup-3.29.4/test/form/samples/break-control-flow/if-statement-errors/main.js000066400000000000000000000003331450520414700274200ustar00rootroot00000000000000while (true) { if (globalThis.unknown) break; else { const unused = 1; } console.log('retained'); } while (true) { if (globalThis.unknown) { const unused = 1; } else { break; } console.log('retained'); } rollup-3.29.4/test/form/samples/break-control-flow/loop-errors/000077500000000000000000000000001450520414700245105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/loop-errors/_config.js000066400000000000000000000001631450520414700264520ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not break flow from inside loops that may not have executed' }); rollup-3.29.4/test/form/samples/break-control-flow/loop-errors/_expected.js000066400000000000000000000023721450520414700270120ustar00rootroot00000000000000function whileLoop() { console.log(hoisted); while (globalThis.unknown) { throw new Error(); } console.log('retained'); throw new Error(); while (globalThis.unknown) { var hoisted; } } try { whileLoop(); } catch {} function doWhileLoop() { console.log(hoisted); do { if (globalThis.unknown) { break; } throw new Error(); } while (globalThis.unknown); console.log('retained'); throw new Error(); do { var hoisted; } while (globalThis.unknown); } try { doWhileLoop(); } catch {} function forLoop() { console.log(hoisted); for (let i = 0; i < globalThis.unknown; i++) { throw new Error(); } console.log('retained'); throw new Error(); for (let i = 0; i < globalThis.unknown; i++) { var hoisted; } } try { forLoop(); } catch {} function forOfLoop() { console.log(hoisted); for (const foo of globalThis.unknown) { throw new Error(); } console.log('retained'); throw new Error(); for (const foo of globalThis.unknown) { var hoisted; } } try { forOfLoop(); } catch {} function forInLoop() { console.log(hoisted); for (const foo in globalThis.unknown) { throw new Error(); } console.log('retained'); throw new Error(); for (const foo in globalThis.unknown) { var hoisted; } } try { forInLoop(); } catch {} rollup-3.29.4/test/form/samples/break-control-flow/loop-errors/main.js000066400000000000000000000031731450520414700257760ustar00rootroot00000000000000function whileLoop() { console.log(hoisted); while (globalThis.unknown) { throw new Error(); console.log('removed'); } console.log('retained'); throw new Error(); while (globalThis.unknown) { var hoisted; console.log('removed'); } console.log('removed'); } try { whileLoop(); } catch {} function doWhileLoop() { console.log(hoisted); do { if (globalThis.unknown) { break; } throw new Error(); console.log('removed'); } while (globalThis.unknown); console.log('retained'); throw new Error(); do { var hoisted; console.log('removed'); } while (globalThis.unknown); console.log('removed'); } try { doWhileLoop(); } catch {} function forLoop() { console.log(hoisted); for (let i = 0; i < globalThis.unknown; i++) { throw new Error(); console.log('removed'); } console.log('retained'); throw new Error(); for (let i = 0; i < globalThis.unknown; i++) { var hoisted; console.log('removed'); } console.log('removed'); } try { forLoop(); } catch {} function forOfLoop() { console.log(hoisted); for (const foo of globalThis.unknown) { throw new Error(); console.log('removed'); } console.log('retained'); throw new Error(); for (const foo of globalThis.unknown) { var hoisted; console.log('removed'); } console.log('removed'); } try { forOfLoop(); } catch {} function forInLoop() { console.log(hoisted); for (const foo in globalThis.unknown) { throw new Error(); console.log('removed'); } console.log('retained'); throw new Error(); for (const foo in globalThis.unknown) { var hoisted; console.log('removed'); } console.log('removed'); } try { forInLoop(); } catch {} rollup-3.29.4/test/form/samples/break-control-flow/return-statements/000077500000000000000000000000001450520414700257315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/return-statements/_config.js000066400000000000000000000001551450520414700276740ustar00rootroot00000000000000module.exports = defineTest({ description: 'breaks control flow when a return statement is encountered' }); rollup-3.29.4/test/form/samples/break-control-flow/return-statements/_expected.js000066400000000000000000000005441450520414700302320ustar00rootroot00000000000000function brokenFunction() { console.log('retained'); return; } brokenFunction(); const brokenFunctionExpression = function() { console.log('retained'); return; }; brokenFunctionExpression(); const brokenArrow = () => { console.log('retained'); return; }; brokenArrow(); console.log('retained'); console.log('retained'); console.log('retained'); rollup-3.29.4/test/form/samples/break-control-flow/return-statements/main.js000066400000000000000000000013601450520414700272130ustar00rootroot00000000000000function brokenFunction() { console.log('retained'); return; console.log('removed'); } brokenFunction(); const brokenFunctionExpression = function() { console.log('retained'); return; console.log('removed'); }; brokenFunctionExpression(); const brokenArrow = () => { console.log('retained'); return; console.log('removed'); }; brokenArrow(); function brokenFunctionRemoved() { return; console.log('removed'); } brokenFunctionRemoved(); console.log('retained'); const brokenFunctionExpressionRemoved = function() { return; console.log('removed'); }; brokenFunctionExpressionRemoved(); console.log('retained'); const brokenArrowRemoved = () => { return; console.log('removed'); }; brokenArrowRemoved(); console.log('retained'); rollup-3.29.4/test/form/samples/break-control-flow/switch-errors/000077500000000000000000000000001450520414700250405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/switch-errors/_config.js000066400000000000000000000001261450520414700270010ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles errors in switch statements' }); rollup-3.29.4/test/form/samples/break-control-flow/switch-errors/_expected.js000066400000000000000000000005621450520414700273410ustar00rootroot00000000000000switch (globalThis.unknown) { case 1: throw new Error(); case 2: throw new Error(); case 3: console.log('retained'); default: console.log('retained'); } console.log('retained'); console.log(hoisted1, hoisted2, hoisted3); throw new Error(); switch (globalThis.unknown) { case 1: var hoisted1; case 2: var hoisted2; case 3: var hoisted3; default: } rollup-3.29.4/test/form/samples/break-control-flow/switch-errors/main.js000066400000000000000000000010461450520414700263230ustar00rootroot00000000000000switch (globalThis.unknown) { case 1: throw new Error(); console.log('removed'); case 2: throw new Error(); console.log('removed'); case 3: console.log('retained'); default: console.log('retained'); } console.log('retained'); console.log(hoisted1, hoisted2, hoisted3); throw new Error(); switch (globalThis.unknown) { case 1: console.log('removed'); var hoisted1; case 2: console.log('removed'); var hoisted2; case 3: console.log('removed'); var hoisted3; default: console.log('removed'); } console.log('removed'); rollup-3.29.4/test/form/samples/break-control-flow/thrown-errors/000077500000000000000000000000001450520414700250605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/break-control-flow/thrown-errors/_config.js000066400000000000000000000001361450520414700270220ustar00rootroot00000000000000module.exports = defineTest({ description: 'breaks control flow when an error is thrown' }); rollup-3.29.4/test/form/samples/break-control-flow/thrown-errors/_expected.js000066400000000000000000000007541450520414700273640ustar00rootroot00000000000000function brokenFunction() { console.log('start'); throw new Error(); } try { brokenFunction(); } catch {} const brokenFunctionExpression = function() { console.log('start'); throw new Error(); }; try { brokenFunctionExpression(); } catch {} const brokenArrow = () => { console.log('start'); throw new Error(); }; try { brokenArrow(); } catch {} function brokenFunction2() { console.log('start'); throw new Error(); } try { brokenFunction2(); } catch {} throw new Error(); rollup-3.29.4/test/form/samples/break-control-flow/thrown-errors/main.js000066400000000000000000000013701450520414700263430ustar00rootroot00000000000000function brokenFunction() { console.log('start'); throw new Error(); console.log('removed'); throw new Error('removed'); } try { brokenFunction(); } catch {} const brokenFunctionExpression = function() { console.log('start'); throw new Error(); console.log('removed'); throw new Error('removed'); }; try { brokenFunctionExpression(); } catch {} const brokenArrow = () => { console.log('start'); throw new Error(); console.log('removed'); throw new Error('removed'); }; try { brokenArrow(); } catch {} function brokenFunction2() { console.log('start'); throw new Error(); console.log('removed'); throw new Error('removed'); } try { brokenFunction2(); } catch {} throw new Error(); console.log('removed'); throw new Error('removed'); rollup-3.29.4/test/form/samples/builtin-prototypes/000077500000000000000000000000001450520414700224125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/builtin-prototypes/array-expression/000077500000000000000000000000001450520414700257255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/builtin-prototypes/array-expression/_config.js000066400000000000000000000001351450520414700276660ustar00rootroot00000000000000module.exports = defineTest({ description: 'Tree-shake known array prototype functions' }); rollup-3.29.4/test/form/samples/builtin-prototypes/array-expression/_expected.js000066400000000000000000000062421450520414700302270ustar00rootroot00000000000000[1].map(x => console.log(1)); [1].map(x => x).map(x => console.log(1)); [1].map(x => console.log(1)).map(x => x); [1] .map(x => x) .map(x => x) .map(x => console.log(1)); [1] .map(x => x) .map(x => console.log(1)) .map(x => x); [](); const _atArray = [{ effect() {} }]; _atArray.at(0).effect = () => console.log(1); _atArray[0].effect(); const _entriesArray = [{ effect() {} }]; [..._entriesArray.entries()][0][1].effect = () => console.log(1); _entriesArray[0].effect(); const _sliceArray = [{ effect() {} }]; _sliceArray.slice()[0].effect = () => console.log(1); _sliceArray[0].effect(); const _valuesArray = [{ effect() {} }]; [..._valuesArray.values()][0].effect = () => console.log(1); _valuesArray[0].effect(); [1].every(() => console.log(1) || true); const _everyArray = [{ effect() {} }]; _everyArray.every(element => (element.effect = () => console.log(1))); _everyArray[0].effect(); [1].filter(() => console.log(1) || true); const _filterArray = [{ effect() {} }]; _filterArray.filter(element => (element.effect = () => console.log(1))); _filterArray[0].effect(); [1].find(() => console.log(1) || true); const _findArray = [{ effect() {} }]; _findArray.find(element => (element.effect = () => console.log(1))); _findArray[0].effect(); [1].findLast(() => console.log(1) || true); const _findLastArray = [{ effect() {} }]; _findLastArray.findLast(element => (element.effect = () => console.log(1))); _findLastArray[0].effect(); [1].findIndex(() => console.log(1) || true); const _findIndexArray = [{ effect() {} }]; _findIndexArray.findIndex(element => (element.effect = () => console.log(1))); _findIndexArray[0].effect(); [1].findLastIndex(() => console.log(1) || true); const _findLastIndexArray = [{ effect() {} }]; _findLastIndexArray.findLastIndex(element => (element.effect = () => console.log(1))); _findLastIndexArray[0].effect(); [1].flatMap(() => console.log(1) || 1); const _flatMapArray = [{ effect() {} }]; _flatMapArray.flatMap(element => (element.effect = () => console.log(1))); _flatMapArray[0].effect(); [1].forEach(() => console.log(1) || true); const _forEachArray = [{ effect() {} }]; _forEachArray.forEach(element => (element.effect = () => console.log(1))); _forEachArray[0].effect(); [1].map(() => console.log(1) || 1); const _mapArray = [{ effect() {} }]; _mapArray.map(element => (element.effect = () => console.log(1))); _mapArray[0].effect(); [1].reduce(() => console.log(1) || 1, 1); const _reduceArray = [{ effect() {} }]; _reduceArray.reduce((_, element) => (element.effect = () => console.log(1)), 1); _reduceArray[0].effect(); [1].reduceRight(() => console.log(1) || 1, 1); const _reduceRightArray = [{ effect() {} }]; _reduceRightArray.reduceRight((_, element) => (element.effect = () => console.log(1)), 1); _reduceRightArray[0].effect(); [1].some(() => console.log(1) || true); const _someArray = [{ effect() {} }]; _someArray.some(element => (element.effect = () => console.log(1))); _someArray[0].effect(); // mutator methods const exported = [1]; exported.copyWithin(0); exported.fill(0); exported.pop(); exported.push(0); exported.reverse(); exported.shift(); [1].sort(() => console.log(1) || 0); exported.sort(); exported.splice(0); exported.unshift(0); export { exported }; rollup-3.29.4/test/form/samples/builtin-prototypes/array-expression/main.js000066400000000000000000000130451450520414700272120ustar00rootroot00000000000000const array = []; const join1 = array.join(','); const join2 = [].join(','); const join3 = [].join(',').trim(); const length = [].length; const map1 = [1].map(x => x); const map2 = [1].map(x => console.log(1)); const map3 = [1].map(x => x).map(x => x); const map4 = [1].map(x => x).map(x => console.log(1)); const map5 = [1].map(x => console.log(1)).map(x => x); const map6 = [1] .map(x => x) .map(x => x) .map(x => x); const map7 = [1] .map(x => x) .map(x => x) .map(x => console.log(1)); const map8 = [1] .map(x => x) .map(x => console.log(1)) .map(x => x); [](); // accessor methods const removedTestArray = [{ noEffect() {} }]; removedTestArray[0].noEffect(); const _at = [].at(1); const _atArray = [{ effect() {} }]; _atArray.at(0).effect = () => console.log(1); _atArray[0].effect(); const _entries = [].entries(); const _entriesArray = [{ effect() {} }]; [..._entriesArray.entries()][0][1].effect = () => console.log(1); _entriesArray[0].effect(); const _flat = [].flat().join(',').trim(); const _flat2 = [].flat(1).join(',').trim(); const _includes = [].includes(1).valueOf(); const _indexOf = [].indexOf(1).toPrecision(1); const _join = [].join(',').trim(); const _keys = [].keys(); const _lastIndexOf = [].lastIndexOf(1).toPrecision(1); const _slice = [].slice(1).concat([]); const _sliceArray = [{ effect() {} }]; _sliceArray.slice()[0].effect = () => console.log(1); _sliceArray[0].effect(); const _values = [].values(); const _valuesArray = [{ effect() {} }]; [..._valuesArray.values()][0].effect = () => console.log(1); _valuesArray[0].effect(); // iteration methods const _every = [1].every(() => true).valueOf(); const _everyEffect = [1].every(() => console.log(1) || true); const _everyArray = [{ effect() {} }]; _everyArray.every(element => (element.effect = () => console.log(1))); _everyArray[0].effect(); const _filter = [1].filter(() => true).join(','); const _filterEffect = [1].filter(() => console.log(1) || true); const _filterArray = [{ effect() {} }]; _filterArray.filter(element => (element.effect = () => console.log(1))); _filterArray[0].effect(); const _find = [1].find(() => true); const _findEffect = [1].find(() => console.log(1) || true); const _findArray = [{ effect() {} }]; _findArray.find(element => (element.effect = () => console.log(1))); _findArray[0].effect(); const _findLast = [1].findLast(() => true); const _findLastEffect = [1].findLast(() => console.log(1) || true); const _findLastArray = [{ effect() {} }]; _findLastArray.findLast(element => (element.effect = () => console.log(1))); _findLastArray[0].effect(); const _findIndex = [1].findIndex(() => true).toPrecision(1); const _findIndexEffect = [1].findIndex(() => console.log(1) || true); const _findIndexArray = [{ effect() {} }]; _findIndexArray.findIndex(element => (element.effect = () => console.log(1))); _findIndexArray[0].effect(); const _findLastIndex = [1].findLastIndex(() => true).toPrecision(1); const _findLastIndexEffect = [1].findLastIndex(() => console.log(1) || true); const _findLastIndexArray = [{ effect() {} }]; _findLastIndexArray.findLastIndex(element => (element.effect = () => console.log(1))); _findLastIndexArray[0].effect(); const _flatMap = [1].flatMap(() => 1).join(','); const _flatMapEffect = [1].flatMap(() => console.log(1) || 1); const _flatMapArray = [{ effect() {} }]; _flatMapArray.flatMap(element => (element.effect = () => console.log(1))); _flatMapArray[0].effect(); const _forEach = [1].forEach(() => {}); const _forEachEffect = [1].forEach(() => console.log(1) || true); const _forEachArray = [{ effect() {} }]; _forEachArray.forEach(element => (element.effect = () => console.log(1))); _forEachArray[0].effect(); const _map = [1].map(() => 1).join(','); const _mapEffect = [1].map(() => console.log(1) || 1); const _mapArray = [{ effect() {} }]; _mapArray.map(element => (element.effect = () => console.log(1))); _mapArray[0].effect(); const _reduce = [1].reduce(() => 1, 1); const _reduceEffect = [1].reduce(() => console.log(1) || 1, 1); const _reduceArray = [{ effect() {} }]; _reduceArray.reduce((_, element) => (element.effect = () => console.log(1)), 1); _reduceArray[0].effect(); const _reduceRight = [1].reduceRight(() => 1, 1); const _reduceRightEffect = [1].reduceRight(() => console.log(1) || 1, 1); const _reduceRightArray = [{ effect() {} }]; _reduceRightArray.reduceRight((_, element) => (element.effect = () => console.log(1)), 1); _reduceRightArray[0].effect(); const _some = [1].some(() => true).valueOf(); const _someEffect = [1].some(() => console.log(1) || true); const _someArray = [{ effect() {} }]; _someArray.some(element => (element.effect = () => console.log(1))); _someArray[0].effect(); // mutator methods export const exported = [1]; const _copyWithin = [1].copyWithin(0).join(','); exported.copyWithin(0); const _fill = [1].fill(0).join(','); exported.fill(0); const _pop = [1].pop(); exported.pop(); const _push = [1].push(0).toPrecision(1); exported.push(0); const _reverse = [1].reverse().join(','); exported.reverse(); const _shift = [1].shift(); exported.shift(); const _sort = [1].sort(() => 0).join(','); const _sortEffect = [1].sort(() => console.log(1) || 0); exported.sort(); const _splice = [1].splice(0).join(','); exported.splice(0); const _unshift = [1].unshift(0).toPrecision(1); exported.unshift(0); const _toLocaleString = [1].toLocaleString().trim(); const _toString = [1].toString().trim(); // inherited const _hasOwnProperty = [1].hasOwnProperty('toString').valueOf(); const _isPrototypeOf = [1].isPrototypeOf([]).valueOf(); const _propertyIsEnumerable = [1].propertyIsEnumerable('toString').valueOf(); const _valueOf = [1].valueOf(); rollup-3.29.4/test/form/samples/builtin-prototypes/check-tree-shake-on-regexp-if-it-is-used/000077500000000000000000000000001450520414700317745ustar00rootroot00000000000000_config.js000066400000000000000000000001331450520414700336540ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/builtin-prototypes/check-tree-shake-on-regexp-if-it-is-usedmodule.exports = defineTest({ description: 'check tree-shake on RegExp if it is used' }); _expected.js000066400000000000000000000011041450520414700342070ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/builtin-prototypes/check-tree-shake-on-regexp-if-it-is-usedconst commonRegexp_1 = /1/; const commonRegexp_2 = /1/; assert.strictEqual(commonRegexp_1.test('1'), true); assert.ok(commonRegexp_2.exec('1')); const globalRegexp_1 = /1/g; const globalRegexp_2 = /1/g; globalRegexp_1.test('1'); globalRegexp_2.exec('1'); assert.strictEqual(globalRegexp_1.test('1'), null); assert.strictEqual(globalRegexp_2.exec('1'), null); const stickyRegexp_1 = /1/y; const stickyRegexp_2 = /1/y; stickyRegexp_1.test('1'); stickyRegexp_2.exec('1'); assert.strictEqual(stickyRegexp_1.test('1'), null); assert.strictEqual(stickyRegexp_2.exec('1'), null); rollup-3.29.4/test/form/samples/builtin-prototypes/check-tree-shake-on-regexp-if-it-is-used/main.js000066400000000000000000000011711450520414700332560ustar00rootroot00000000000000const commonRegexp_1 = /1/; const commonRegexp_2 = /1/; commonRegexp_1.test('1'); commonRegexp_2.exec('1'); assert.strictEqual(commonRegexp_1.test('1'), true); assert.ok(commonRegexp_2.exec('1')); const globalRegexp_1 = /1/g; const globalRegexp_2 = /1/g; globalRegexp_1.test('1'); globalRegexp_2.exec('1'); assert.strictEqual(globalRegexp_1.test('1'), null); assert.strictEqual(globalRegexp_2.exec('1'), null); const stickyRegexp_1 = /1/y; const stickyRegexp_2 = /1/y; stickyRegexp_1.test('1'); stickyRegexp_2.exec('1'); assert.strictEqual(stickyRegexp_1.test('1'), null); assert.strictEqual(stickyRegexp_2.exec('1'), null); rollup-3.29.4/test/form/samples/builtin-prototypes/literal/000077500000000000000000000000001450520414700240465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/builtin-prototypes/literal/_config.js000066400000000000000000000001371450520414700260110ustar00rootroot00000000000000module.exports = defineTest({ description: 'Tree-shake known literal prototype functions' }); rollup-3.29.4/test/form/samples/builtin-prototypes/literal/_expected.js000066400000000000000000000013521450520414700263450ustar00rootroot00000000000000// retained true.valueOf()(); true.valueOf()[globalThis.unknown](); true.valueOf().unknown(); true.valueOf().unknown.unknown(); true.valueOf().unknown.unknown().unknown; (1).valueOf()(); (1).valueOf()[globalThis.unknown](); (1).valueOf().unknown(); (1).valueOf().unknown.unknown(); (1).valueOf().unknown.unknown().unknown; 'ab'.charAt(1)(); 'ab'.charAt(1)[globalThis.unknown](); 'ab'.charAt(1).unknown(); 'ab'.charAt(1).unknown.unknown(); 'ab'.charAt(1).unknown.unknown().unknown; null.unknown; 'ab'.replace('a', () => console.log(1) || 'b'); 'ab'.replaceAll('a', () => console.log(1) || 'b'); // deep property access is forbidden true.x.y; (1).x.y; 'ab'.x.y; // due to strict mode, extension is forbidden true.x = 1; (1).x = 1; 'ab'.x = 1; rollup-3.29.4/test/form/samples/builtin-prototypes/literal/main.js000066400000000000000000000115021450520414700253270ustar00rootroot00000000000000// retained true.valueOf()(); true.valueOf()[globalThis.unknown](); true.valueOf().unknown(); true.valueOf().unknown.unknown(); true.valueOf().unknown.unknown().unknown; (1).valueOf()(); (1).valueOf()[globalThis.unknown](); (1).valueOf().unknown(); (1).valueOf().unknown.unknown(); (1).valueOf().unknown.unknown().unknown; 'ab'.charAt(1)(); 'ab'.charAt(1)[globalThis.unknown](); 'ab'.charAt(1).unknown(); 'ab'.charAt(1).unknown.unknown(); 'ab'.charAt(1).unknown.unknown().unknown; null.unknown; // boolean prototype true.valueOf(); true.valueOf().valueOf(); true.valueOf().valueOf().valueOf(); const _booleanToString = true.toString().trim(); const _booleanValueOf = true.valueOf().valueOf(); // inherited const _booleanHasOwnProperty = true.hasOwnProperty('toString').valueOf(); const _booleanIsPrototypeOf = true.isPrototypeOf(true).valueOf(); const _booleanPropertyIsEnumerable = true.propertyIsEnumerable('toString').valueOf(); const _booleanToLocaleString = true.toLocaleString().trim(); // number prototype (1).valueOf(); (1).valueOf().valueOf(); (1).valueOf().valueOf().valueOf(); const _numberToExponential = (1).toExponential(2).trim(); const _numberToFixed = (1).toFixed(2).trim(); const _numberToLocaleString = (1).toLocaleString().trim(); const _numberToPrecision = (1).toPrecision(2).trim(); const _numberToString = (1).toString().trim(); const _numberValueOf = (1).valueOf().toExponential(2); // inherited const _numberHasOwnProperty = (1).hasOwnProperty('toString').valueOf(); const _numberIsPrototypeOf = (1).isPrototypeOf(1).valueOf(); const _numberPropertyIsEnumerable = (1).propertyIsEnumerable('toString').valueOf(); // RegExp prototype /1/.test('1'); /1/.exec('1'); /1/y.test('1'); /1/y.exec('1'); /1/g.test('1'); /1/g.exec('1'); // string prototype 'ab'.valueOf(); 'ab'.valueOf().valueOf(); 'ab'.valueOf().valueOf().valueOf(); const _stringAt = 'ab'.at(1); const _stringCharAt = 'ab'.charAt(1).trim(); const _stringCharCodeAt = 'ab'.charCodeAt(1).toExponential(2); const _stringCodePointAt = 'ab'.codePointAt(1); const _stringConcat = 'ab'.concat('c').trim(); const _stringEndsWith = 'ab'.endsWith('a').valueOf(); const _stringIncludes = 'ab'.includes('a').valueOf(); const _stringIndexOf = 'ab'.indexOf('a').toExponential(2); const _stringLastIndexOf = 'ab'.lastIndexOf('a').toExponential(2); const _stringLocaleCompare = 'ab'.localeCompare('a').toExponential(2); const _stringMatch = 'ab'.match(/a/); const _stringMatchAll = 'ab'.matchAll(/a/); const _stringNormalize = 'ab'.normalize().trim(); const _stringPadEnd = 'ab'.padEnd(4, 'a').trim(); const _stringPadStart = 'ab'.padStart(4, 'a').trim(); const _stringRepeat = 'ab'.repeat(2).trim(); const _stringReplace = 'ab'.replace('a', () => 'b').trim(); const _stringReplaceEffect = 'ab'.replace('a', () => console.log(1) || 'b'); const _stringReplaceAll = 'ab'.replaceAll('a', () => 'b').trim(); const _stringReplaceAllEffect = 'ab'.replaceAll('a', () => console.log(1) || 'b'); const _stringSearch = 'ab'.search(/a/).toExponential(2); const _stringSlice = 'ab'.slice(0, 1).trim(); const _stringSplit = 'ab'.split('a'); const _stringStartsWith = 'ab'.startsWith('a').valueOf(); const _stringSubstring = 'ab'.substring(0, 1).trim(); const _stringToLocaleLowerCase = 'ab'.toLocaleLowerCase().trim(); const _stringToLocaleUpperCase = 'ab'.toLocaleUpperCase().trim(); const _stringToLowerCase = 'ab'.toLowerCase().trim(); const _stringToString = 'ab'.trim(); const _stringToUpperCase = 'ab'.toUpperCase().trim(); const _stringTrim = 'ab'.trim().trim(); const _stringTrimEnd = 'ab'.trimEnd().trim(); const _stringTrimStart = 'ab'.trimStart().trim(); const _stringValueOf = 'ab'.valueOf().trim(); // DEPRECATED prototype methods const _anchor = 'ab'.anchor().trim(); const _big = 'ab'.big().trim(); const _blink = 'ab'.blink().trim(); const _bold = 'ab'.bold().trim(); const _fixed = 'ab'.fixed().trim(); const _fontcolor = 'ab'.fontcolor().trim(); const _fontsize = 'ab'.fontsize().trim(); const _italics = 'ab'.italics().trim(); const _link = 'ab'.link().trim(); const _small = 'ab'.small().trim(); const _strike = 'ab'.strike().trim(); const _sub = 'ab'.sub().trim(); const _substr = 'ab'.substr(0, 1).trim(); const _sup = 'ab'.sup().trim(); const _trimLeft = 'ab'.trimLeft().trim(); const _trimRight = 'ab'.trimRight().trim(); // inherited const _stringHasOwnProperty = 'ab'.hasOwnProperty('toString').valueOf(); const _stringIsPrototypeOf = 'ab'.isPrototypeOf('').valueOf(); const _stringPropertyIsEnumerable = 'ab'.propertyIsEnumerable('toString').valueOf(); const _stringToLocaleString = 'ab'.toLocaleString().trim(); // property access is allowed const accessBoolean = true.x; const accessNumber = (1).x; const accessString = 'ab'.x; // deep property access is forbidden const deepBoolean = true.x.y; const deepNumber = (1).x.y; const deepString = 'ab'.x.y; // due to strict mode, extension is forbidden true.x = 1; (1).x = 1; 'ab'.x = 1; rollup-3.29.4/test/form/samples/builtin-prototypes/object-expression/000077500000000000000000000000001450520414700260555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/builtin-prototypes/object-expression/_config.js000066400000000000000000000002031450520414700300120ustar00rootroot00000000000000module.exports = defineTest({ description: 'Tree-shake known object prototype functions', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/builtin-prototypes/object-expression/_expected.js000066400000000000000000000000011450520414700303420ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/builtin-prototypes/object-expression/main.js000066400000000000000000000010671450520414700273430ustar00rootroot00000000000000const object = {}; const propertyIsEnumerable1 = object.propertyIsEnumerable( 'toString' ); const propertyIsEnumerable2 = {}.propertyIsEnumerable( 'toString' ); const propertyIsEnumerable3 = {}.propertyIsEnumerable( 'toString' ).valueOf(); const _hasOwnProperty = {}.hasOwnProperty( 'toString' ).valueOf(); const _isPrototypeOf = {}.isPrototypeOf( {} ).valueOf(); const _propertyIsEnumerable = {}.propertyIsEnumerable( 'toString' ).valueOf(); const _toLocaleString = {}.toLocaleString().trim(); const _toString = {}.toString().trim(); const _valueOf = {}.valueOf(); rollup-3.29.4/test/form/samples/builtin-prototypes/side-effect-free-array-expression/000077500000000000000000000000001450520414700310205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/builtin-prototypes/side-effect-free-array-expression/_config.js000066400000000000000000000002041450520414700327560ustar00rootroot00000000000000module.exports = defineTest({ description: 'Tree-shakes side-effect-free array functions if only their return value is unused' }); rollup-3.29.4/test/form/samples/builtin-prototypes/side-effect-free-array-expression/_expected.js000066400000000000000000000012331450520414700333150ustar00rootroot00000000000000const foo1 = [1, 2, 3]; console.log(foo1[0]); const foo2 = [1, 2, 3]; console.log(foo2[0]); const foo3 = [1, 2, 3]; console.log(foo3[0]); const foo4 = [1, 2, 3]; console.log(foo4[0]); const foo5 = [1, 2, 3]; console.log(foo5[0]); const foo6 = [1, 2, 3]; console.log(foo6[0]); const foo7 = [1, 2, 3]; console.log(foo7[0]); const foo8 = [1, 2, 3]; console.log(foo8[0]); const foo9 = [1, 2, 3]; console.log(foo9[0]); const foo10 = [1, 2, 3]; console.log(foo10[0]); const foo11 = [1, 2, 3]; console.log(foo11[0]); const foo12 = [1, 2, 3]; console.log(foo12[0]); const foo13 = [1, 2, 3]; console.log(foo13[0]); const foo14 = [1, 2, 3]; console.log(foo14[0]); rollup-3.29.4/test/form/samples/builtin-prototypes/side-effect-free-array-expression/main.js000066400000000000000000000017161450520414700323070ustar00rootroot00000000000000const foo1 = [1, 2, 3]; foo1.at(0); console.log(foo1[0]); const foo2 = [1, 2, 3]; foo2.concat([0]); console.log(foo2[0]); const foo3 = [1, 2, 3]; foo3.entries(); console.log(foo3[0]); const foo4 = [1, 2, 3]; foo4.every(v => v); console.log(foo4[0]); const foo5 = [1, 2, 3]; foo5.filter(v => v % 1 === 0); console.log(foo5[0]); const foo6 = [1, 2, 3]; foo6.find(v => v); console.log(foo6[0]); const foo7 = [1, 2, 3]; foo7.findIndex(v => v); console.log(foo7[0]); const foo8 = [1, 2, 3]; foo8.forEach(() => {}); console.log(foo8[0]); const foo9 = [1, 2, 3]; foo9.map(v => v); console.log(foo9[0]); const foo10 = [1, 2, 3]; foo10.reduce((a, v) => a + v, 0); console.log(foo10[0]); const foo11 = [1, 2, 3]; foo11.reduceRight((a, v) => a + v, 0); console.log(foo11[0]); const foo12 = [1, 2, 3]; foo12.slice(1); console.log(foo12[0]); const foo13 = [1, 2, 3]; foo13.some(v => v); console.log(foo13[0]); const foo14 = [1, 2, 3]; foo14.values(); console.log(foo14[0]); rollup-3.29.4/test/form/samples/builtin-prototypes/template-literal/000077500000000000000000000000001450520414700256575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/builtin-prototypes/template-literal/_config.js000066400000000000000000000001571450520414700276240ustar00rootroot00000000000000module.exports = defineTest({ description: 'Tree-shake known string template literal prototype functions' }); rollup-3.29.4/test/form/samples/builtin-prototypes/template-literal/_expected.js000066400000000000000000000003261450520414700301560ustar00rootroot00000000000000// retained `ab`(); `ab`.unknown.unknown(); `ab`.unknown.unknown().unknown; // deep property access is forbidden `ab`.x.y; // due to strict mode, extension is forbidden `ab`.x = 1; // throws when called `ab`(); rollup-3.29.4/test/form/samples/builtin-prototypes/template-literal/main.js000066400000000000000000000005521450520414700271430ustar00rootroot00000000000000// retained `ab`(); `ab`.unknown.unknown(); `ab`.unknown.unknown().unknown; // removed `ab`.trim(); `ab`.trim().trim(); `ab`.toString().trim(); // property access is allowed const accessString = `ab`.x; // deep property access is forbidden const deepString = `ab`.x.y; // due to strict mode, extension is forbidden `ab`.x = 1; // throws when called `ab`(); rollup-3.29.4/test/form/samples/catch-parameter-shadowing/000077500000000000000000000000001450520414700235375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/catch-parameter-shadowing/_config.js000066400000000000000000000002451450520414700255020ustar00rootroot00000000000000module.exports = defineTest({ description: 'the parameter of a catch block should correctly shadow an import (#1391)', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/catch-parameter-shadowing/_expected.js000066400000000000000000000002721450520414700260360ustar00rootroot00000000000000const e = 2.7182818284; function something () { try { console.log( e ); } catch ( e ) { // the catch identifier shadows the import console.error( e ); } } export { something }; rollup-3.29.4/test/form/samples/catch-parameter-shadowing/e.js000066400000000000000000000000371450520414700243210ustar00rootroot00000000000000export const e = 2.7182818284; rollup-3.29.4/test/form/samples/catch-parameter-shadowing/main.js000066400000000000000000000002531450520414700250210ustar00rootroot00000000000000import { e } from './e'; export function something () { try { console.log( e ); } catch ( e ) { // the catch identifier shadows the import console.error( e ); } } rollup-3.29.4/test/form/samples/chained-assignments/000077500000000000000000000000001450520414700224425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/chained-assignments/_config.js000066400000000000000000000001211450520414700243760ustar00rootroot00000000000000module.exports = defineTest({ description: 'treeshakes chained assignments' }); rollup-3.29.4/test/form/samples/chained-assignments/_expected.js000066400000000000000000000001561450520414700247420ustar00rootroot00000000000000let a, d; a = 1; d = 2; console.log(a, d); let e = 'first', f = 'second'; e += f += 'third'; console.log(e); rollup-3.29.4/test/form/samples/chained-assignments/main.js000066400000000000000000000001741450520414700237260ustar00rootroot00000000000000let a, b, c, d; a = b = 1; c = d = 2; console.log(a, d); let e = 'first', f = 'second'; e += f += 'third'; console.log(e); rollup-3.29.4/test/form/samples/circular-member-expression/000077500000000000000000000000001450520414700237645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/circular-member-expression/_config.js000066400000000000000000000001151450520414700257230ustar00rootroot00000000000000module.exports = defineTest({ description: 'circular member expression' }); rollup-3.29.4/test/form/samples/circular-member-expression/_expected/000077500000000000000000000000001450520414700257245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/circular-member-expression/_expected/amd.js000066400000000000000000000002021450520414700270150ustar00rootroot00000000000000define((function () { 'use strict'; var foo = function() { foo.toString = null; }.toString(); console.log(foo); })); rollup-3.29.4/test/form/samples/circular-member-expression/_expected/cjs.js000066400000000000000000000001361450520414700270410ustar00rootroot00000000000000'use strict'; var foo = function() { foo.toString = null; }.toString(); console.log(foo); rollup-3.29.4/test/form/samples/circular-member-expression/_expected/es.js000066400000000000000000000001171450520414700266700ustar00rootroot00000000000000var foo = function() { foo.toString = null; }.toString(); console.log(foo); rollup-3.29.4/test/form/samples/circular-member-expression/_expected/iife.js000066400000000000000000000001761450520414700272020ustar00rootroot00000000000000(function () { 'use strict'; var foo = function() { foo.toString = null; }.toString(); console.log(foo); })(); rollup-3.29.4/test/form/samples/circular-member-expression/_expected/system.js000066400000000000000000000003241450520414700276050ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = function() { foo.toString = null; }.toString(); console.log(foo); }) }; })); rollup-3.29.4/test/form/samples/circular-member-expression/_expected/umd.js000066400000000000000000000003421450520414700270460ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = function() { foo.toString = null; }.toString(); console.log(foo); })); rollup-3.29.4/test/form/samples/circular-member-expression/main.js000066400000000000000000000001161450520414700252440ustar00rootroot00000000000000var foo = function() { foo.toString = null; }.toString(); console.log(foo);rollup-3.29.4/test/form/samples/class-constructor-side-effect/000077500000000000000000000000001450520414700243625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/class-constructor-side-effect/_config.js000066400000000000000000000001501450520414700263200ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves side-effects in a class constructor (#1233)' }); rollup-3.29.4/test/form/samples/class-constructor-side-effect/_expected.js000066400000000000000000000001701450520414700266560ustar00rootroot00000000000000class Effect { constructor () { console.log( 'Foo' ); } } new Effect(); class Empty {} new Empty.doesNotExist(); rollup-3.29.4/test/form/samples/class-constructor-side-effect/main.js000066400000000000000000000002621450520414700256440ustar00rootroot00000000000000class Effect { constructor () { console.log( 'Foo' ); } } new Effect(); class NoEffect { constructor () { } } new NoEffect(); class Empty {} new Empty.doesNotExist(); rollup-3.29.4/test/form/samples/class-fields/000077500000000000000000000000001450520414700210675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/class-fields/_config.js000066400000000000000000000001101450520414700230210ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports class fields' }); rollup-3.29.4/test/form/samples/class-fields/_expected.js000066400000000000000000000011341450520414700233640ustar00rootroot00000000000000class Example extends SomeClass { firstPublicField = 1; secondPublicField = this.firstPublicField + super.someField; publicField = () => { }; #privateField = () => {}; #uninitializedPrivateField; get #getter() { return this.#uninitializedPrivateField; } set #setter(value) { this.#uninitializedPrivateField = value; } #privateMethod() { } static firstPublicStaticField = 2; static secondPublicStaticField = this.firstPublicStaticField + super.someStaticField; static publicStaticField = () => { }; static #privateStaticField = () => {}; static #privateStaticMethod() {} } rollup-3.29.4/test/form/samples/class-fields/main.js000066400000000000000000000012631450520414700223530ustar00rootroot00000000000000class Example extends SomeClass { firstPublicField = 1; secondPublicField = this.firstPublicField + super.someField; publicField = () => { const foo = 'tree-shaken'; }; #privateField = () => {}; #uninitializedPrivateField; get #getter() { return this.#uninitializedPrivateField; } set #setter(value) { this.#uninitializedPrivateField = value; } #privateMethod() { const foo = 'tree-shaken'; } static firstPublicStaticField = 2; static secondPublicStaticField = this.firstPublicStaticField + super.someStaticField; static publicStaticField = () => { const foo = 'tree-shaken'; }; static #privateStaticField = () => {}; static #privateStaticMethod() {} } rollup-3.29.4/test/form/samples/class-method-access/000077500000000000000000000000001450520414700223405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/class-method-access/_config.js000066400000000000000000000001431450520414700243000ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks side-effects when accessing class methods' }); rollup-3.29.4/test/form/samples/class-method-access/_expected.js000066400000000000000000000005311450520414700246350ustar00rootroot00000000000000console.log('retained'); class Used { static method() {} static get getter() { return { foo: { throws: null }, throws: null }; } } Used.method.doesNotExist.throws; Used.getter.doesNotExist.throws; Used.getter.foo.doesNotExist.throws; Used.getter.throws(); Used.getter.foo.throws(); Used.method.reassigned = 1; Used.getter.reassigned = 2; rollup-3.29.4/test/form/samples/class-method-access/main.js000066400000000000000000000012301450520414700236160ustar00rootroot00000000000000class Removed { static get isTrue() { return true; } } if (Removed.isTrue) console.log('retained'); else console.log('removed'); class Used { static method() {} static get getter() { return { foo: { throws: null }, throws: null }; } } Used.method.doesNotExist; Used.method.doesNotExist.throws; Used.getter.doesNotExist; Used.getter.doesNotExist.throws; Used.getter.foo; Used.getter.foo.doesNotExist; Used.getter.foo.doesNotExist.throws; Used.getter.hasOwnProperty('foo'); Used.getter.foo.hasOwnProperty('bar'); Used.getter.throws(); Used.getter.foo.throws(); Used.method.reassigned = 1; Used.getter.reassigned = 2; class ValueEffect { static foo; } rollup-3.29.4/test/form/samples/class-static-initialization-block/000077500000000000000000000000001450520414700252255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/class-static-initialization-block/_config.js000066400000000000000000000001361450520414700271670ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports class static initialization blocks' }); rollup-3.29.4/test/form/samples/class-static-initialization-block/_expected.js000066400000000000000000000010431450520414700275210ustar00rootroot00000000000000class Example { static #foo; static foo; static { this.#foo = 'static-initialization-block'; } static { this.foo = 'another-static-initialization-block'; } // We can not yet remove unused class body elements static { } static {} } class WithAssignment { static foo = 'bar'; static someStatic() { return 'foo'; } static { WithAssignment.foo = WithAssignment.someStatic(); } } console.log(WithAssignment.foo); class UnusedWithError { static { throw new Error('no code after this point'); } } export { Example }; rollup-3.29.4/test/form/samples/class-static-initialization-block/main.js000066400000000000000000000015631450520414700265140ustar00rootroot00000000000000export class Example { static #foo; static foo; static { const foo = 'tree-shaken'; this.#foo = 'static-initialization-block'; } static { const foo = 'tree-shaken'; this.foo = 'another-static-initialization-block'; } // We can not yet remove unused class body elements static { const foo = 'tree-shaken'; } static {} } class WithAssignment { static foo = 'bar'; static someStatic() { return 'foo'; } static { WithAssignment.foo = WithAssignment.someStatic(); } } console.log(WithAssignment.foo); class UnusedNoEffect { static { const foo = 'unused'; } } class UnusedWithError { static { throw new Error('no code after this point'); console.log('removed'); } } console.log(UsedAfterError); throw new Error('No side-effects after this point'); console.log('removed'); class UsedAfterError { static { console.log('removed'); } } rollup-3.29.4/test/form/samples/class-without-new/000077500000000000000000000000001450520414700221135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/class-without-new/_config.js000066400000000000000000000001471450520414700240570ustar00rootroot00000000000000module.exports = defineTest({ description: 'instantiating a class without "new" is a side-effect' }); rollup-3.29.4/test/form/samples/class-without-new/_expected.js000066400000000000000000000000251450520414700244060ustar00rootroot00000000000000class foo {} foo(); rollup-3.29.4/test/form/samples/class-without-new/main.js000066400000000000000000000000251450520414700233720ustar00rootroot00000000000000class foo {} foo(); rollup-3.29.4/test/form/samples/comment-before-import/000077500000000000000000000000001450520414700227305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/comment-before-import/_config.js000066400000000000000000000001241450520414700246670ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves comments before imports' }); rollup-3.29.4/test/form/samples/comment-before-import/_expected/000077500000000000000000000000001450520414700246705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/comment-before-import/_expected/amd.js000066400000000000000000000002111450520414700257610ustar00rootroot00000000000000define((function () { 'use strict'; // bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); })); rollup-3.29.4/test/form/samples/comment-before-import/_expected/cjs.js000066400000000000000000000001471450520414700260070ustar00rootroot00000000000000'use strict'; // bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); rollup-3.29.4/test/form/samples/comment-before-import/_expected/es.js000066400000000000000000000001301450520414700256270ustar00rootroot00000000000000// bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); rollup-3.29.4/test/form/samples/comment-before-import/_expected/iife.js000066400000000000000000000002041450520414700261360ustar00rootroot00000000000000(function () { 'use strict'; // bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); })(); rollup-3.29.4/test/form/samples/comment-before-import/_expected/system.js000066400000000000000000000003201450520414700265450ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { // bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); }) }; })); rollup-3.29.4/test/form/samples/comment-before-import/_expected/umd.js000066400000000000000000000003471450520414700260170ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; // bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); })); rollup-3.29.4/test/form/samples/comment-before-import/bar.js000066400000000000000000000000351450520414700240300ustar00rootroot00000000000000// bar.js export default 21; rollup-3.29.4/test/form/samples/comment-before-import/foo.js000066400000000000000000000000771450520414700240550ustar00rootroot00000000000000// foo.js import bar from './bar.js'; export default bar * 2; rollup-3.29.4/test/form/samples/comment-before-import/main.js000066400000000000000000000000741450520414700242130ustar00rootroot00000000000000// main.js import foo from './foo.js'; console.log( foo ); rollup-3.29.4/test/form/samples/comment-start-inside-comment/000077500000000000000000000000001450520414700242245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/comment-start-inside-comment/_config.js000066400000000000000000000001421450520414700261630ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly remove coments above import statements' }); rollup-3.29.4/test/form/samples/comment-start-inside-comment/_expected/000077500000000000000000000000001450520414700261645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/comment-start-inside-comment/_expected/amd.js000066400000000000000000000001401450520414700272560ustar00rootroot00000000000000define((function () { 'use strict'; var foo = () => 'foo'; // /* console.log(foo()); })); rollup-3.29.4/test/form/samples/comment-start-inside-comment/_expected/cjs.js000066400000000000000000000001011450520414700272710ustar00rootroot00000000000000'use strict'; var foo = () => 'foo'; // /* console.log(foo()); rollup-3.29.4/test/form/samples/comment-start-inside-comment/_expected/es.js000066400000000000000000000000621450520414700271270ustar00rootroot00000000000000var foo = () => 'foo'; // /* console.log(foo()); rollup-3.29.4/test/form/samples/comment-start-inside-comment/_expected/iife.js000066400000000000000000000001331450520414700274330ustar00rootroot00000000000000(function () { 'use strict'; var foo = () => 'foo'; // /* console.log(foo()); })(); rollup-3.29.4/test/form/samples/comment-start-inside-comment/_expected/system.js000066400000000000000000000002411450520414700300430ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = () => 'foo'; // /* console.log(foo()); }) }; })); rollup-3.29.4/test/form/samples/comment-start-inside-comment/_expected/umd.js000066400000000000000000000002761450520414700273140ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = () => 'foo'; // /* console.log(foo()); })); rollup-3.29.4/test/form/samples/comment-start-inside-comment/foo.js000066400000000000000000000000341450520414700253420ustar00rootroot00000000000000export default () => 'foo'; rollup-3.29.4/test/form/samples/comment-start-inside-comment/main.js000066400000000000000000000001631450520414700255060ustar00rootroot00000000000000// /* import foo from './foo.js'; const bar = 'unused'; /*/ this comment is not closed yet */ console.log(foo()); rollup-3.29.4/test/form/samples/compact-empty-external/000077500000000000000000000000001450520414700231205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/compact-empty-external/_config.js000066400000000000000000000002661450520414700250660ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly handles empty external imports in compact mode', options: { external: ['external'], output: { compact: true } } }); rollup-3.29.4/test/form/samples/compact-empty-external/_expected/000077500000000000000000000000001450520414700250605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/compact-empty-external/_expected/amd.js000066400000000000000000000000711450520414700261550ustar00rootroot00000000000000define(['external'],(function(external){'use strict';}));rollup-3.29.4/test/form/samples/compact-empty-external/_expected/cjs.js000066400000000000000000000000411450520414700261700ustar00rootroot00000000000000'use strict';require('external');rollup-3.29.4/test/form/samples/compact-empty-external/_expected/es.js000066400000000000000000000000211450520414700260160ustar00rootroot00000000000000import'external';rollup-3.29.4/test/form/samples/compact-empty-external/_expected/iife.js000066400000000000000000000000361450520414700263310ustar00rootroot00000000000000(function(){'use strict';})();rollup-3.29.4/test/form/samples/compact-empty-external/_expected/system.js000066400000000000000000000001471450520414700267440ustar00rootroot00000000000000System.register(['external'],(function(){'use strict';return{setters:[null],execute:(function(){})}}));rollup-3.29.4/test/form/samples/compact-empty-external/_expected/umd.js000066400000000000000000000001571450520414700262060ustar00rootroot00000000000000(function(f){typeof define==='function'&&define.amd?define(['external'],f):f();})((function(){'use strict';}));rollup-3.29.4/test/form/samples/compact-empty-external/main.js000066400000000000000000000000231450520414700243750ustar00rootroot00000000000000import 'external'; rollup-3.29.4/test/form/samples/compact-multiple-imports/000077500000000000000000000000001450520414700234705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/compact-multiple-imports/_config.js000066400000000000000000000004501450520414700254310ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly handles empty external imports in compact mode', options: { external(id) { return id.startsWith('external'); }, output: { globals: { 'external-3': 'external3', 'external-4': 'external4' }, compact: true } } }); rollup-3.29.4/test/form/samples/compact-multiple-imports/_expected/000077500000000000000000000000001450520414700254305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/compact-multiple-imports/_expected/amd.js000066400000000000000000000003371450520414700265320ustar00rootroot00000000000000define(['external-1','external-2','external-3','external-4','external-5'],(function(external1,external2,external3,external4,external5){'use strict';assert.equal(external3.value, '3'); assert.equal(external4.value, '4');}));rollup-3.29.4/test/form/samples/compact-multiple-imports/_expected/cjs.js000066400000000000000000000003321450520414700265430ustar00rootroot00000000000000'use strict';require('external-1'),require('external-2');var external3=require('external-3'),external4=require('external-4');require('external-5');assert.equal(external3.value, '3'); assert.equal(external4.value, '4');rollup-3.29.4/test/form/samples/compact-multiple-imports/_expected/es.js000066400000000000000000000002671450520414700264020ustar00rootroot00000000000000import'external-1';import'external-2';import {value}from'external-3';import {value as value$1}from'external-4';import'external-5';assert.equal(value, '3'); assert.equal(value$1, '4');rollup-3.29.4/test/form/samples/compact-multiple-imports/_expected/iife.js000066400000000000000000000002511450520414700267000ustar00rootroot00000000000000(function(external1,external2,external3,external4){'use strict';assert.equal(external3.value, '3'); assert.equal(external4.value, '4');})(null,null,external3,external4);rollup-3.29.4/test/form/samples/compact-multiple-imports/_expected/system.js000066400000000000000000000004741450520414700273170ustar00rootroot00000000000000System.register(['external-1','external-2','external-3','external-4','external-5'],(function(){'use strict';var value,value$1;return{setters:[null,null,function(module){value=module.value;},function(module){value$1=module.value;},null],execute:(function(){assert.equal(value, '3'); assert.equal(value$1, '4');})}}));rollup-3.29.4/test/form/samples/compact-multiple-imports/_expected/umd.js000066400000000000000000000010321450520414700265470ustar00rootroot00000000000000(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(require('external-1'),require('external-2'),require('external-3'),require('external-4'),require('external-5')):typeof define==='function'&&define.amd?define(['external-1','external-2','external-3','external-4','external-5'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(null,null,g.external3,g.external4));})(this,(function(external1,external2,external3,external4){'use strict';assert.equal(external3.value, '3'); assert.equal(external4.value, '4');}));rollup-3.29.4/test/form/samples/compact-multiple-imports/main.js000066400000000000000000000002721450520414700247530ustar00rootroot00000000000000import 'external-1'; import 'external-2'; import {value as a} from 'external-3'; import {value as b} from 'external-4'; import 'external-5'; assert.equal(a, '3'); assert.equal(b, '4'); rollup-3.29.4/test/form/samples/compact-named-export/000077500000000000000000000000001450520414700225455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/compact-named-export/_config.js000066400000000000000000000002571450520414700245130ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly handles named export live bindings in compact mode', options: { output: { name: 'foo', compact: true } } }); rollup-3.29.4/test/form/samples/compact-named-export/_expected/000077500000000000000000000000001450520414700245055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/compact-named-export/_expected/amd.js000066400000000000000000000002051450520414700256010ustar00rootroot00000000000000define(['exports'],(function(exports){'use strict';exports.x = 42; exports.x+=1; exports.x=exports.x+1; exports.x++; ++exports.x;}));rollup-3.29.4/test/form/samples/compact-named-export/_expected/cjs.js000066400000000000000000000001331450520414700256170ustar00rootroot00000000000000'use strict';exports.x = 42; exports.x+=1; exports.x=exports.x+1; exports.x++; ++exports.x;rollup-3.29.4/test/form/samples/compact-named-export/_expected/es.js000066400000000000000000000000541450520414700254510ustar00rootroot00000000000000let x = 42; x+=1; x=x+1; x++; ++x;export{x};rollup-3.29.4/test/form/samples/compact-named-export/_expected/iife.js000066400000000000000000000002141450520414700257540ustar00rootroot00000000000000var foo=(function(exports){'use strict';exports.x = 42; exports.x+=1; exports.x=exports.x+1; exports.x++; ++exports.x;return exports;})({});rollup-3.29.4/test/form/samples/compact-named-export/_expected/system.js000066400000000000000000000003021450520414700263620ustar00rootroot00000000000000System.register('foo',[],(function(exports){'use strict';return{execute:(function(){let x = exports('x',42); exports('x',x+=1); exports('x',x=x+1); exports('x',x+1),x++; exports('x',++x);})}}));rollup-3.29.4/test/form/samples/compact-named-export/_expected/umd.js000066400000000000000000000005131450520414700256270ustar00rootroot00000000000000(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.foo={}));})(this,(function(exports){'use strict';exports.x = 42; exports.x+=1; exports.x=exports.x+1; exports.x++; ++exports.x;}));rollup-3.29.4/test/form/samples/compact-named-export/main.js000066400000000000000000000000521450520414700240240ustar00rootroot00000000000000export let x = 42; x+=1; x=x+1; x++; ++x; rollup-3.29.4/test/form/samples/compact/000077500000000000000000000000001450520414700201445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/compact/_config.js000066400000000000000000000004571450520414700221140ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports compact output with compact: true', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { external: ['external'], output: { name: 'foo', compact: true, generatedCode: { symbols: true }, globals: { external: 'x' } } } }); rollup-3.29.4/test/form/samples/compact/_expected/000077500000000000000000000000001450520414700221045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/compact/_expected/amd.js000066400000000000000000000004431450520414700232040ustar00rootroot00000000000000define(['external'],(function(x){'use strict';var self=/*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({__proto__:null,get default(){return foo}},Symbol.toStringTag,{value:'Module'}));console.log(self); function foo () { console.log( x ); } // trailing comment return foo;}));rollup-3.29.4/test/form/samples/compact/_expected/cjs.js000066400000000000000000000004401450520414700232170ustar00rootroot00000000000000'use strict';var x=require('external');var self=/*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({__proto__:null,get default(){return foo}},Symbol.toStringTag,{value:'Module'}));console.log(self); function foo () { console.log( x ); } // trailing comment module.exports=foo;rollup-3.29.4/test/form/samples/compact/_expected/es.js000066400000000000000000000004251450520414700230520ustar00rootroot00000000000000import x from'external';var self=/*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({__proto__:null,get default(){return foo}},Symbol.toStringTag,{value:'Module'}));console.log(self); function foo () { console.log( x ); } // trailing comment export{foo as default};rollup-3.29.4/test/form/samples/compact/_expected/iife.js000066400000000000000000000004311450520414700233540ustar00rootroot00000000000000var foo=(function(x){'use strict';var self=/*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({__proto__:null,get default(){return foo}},Symbol.toStringTag,{value:'Module'}));console.log(self); function foo () { console.log( x ); } // trailing comment return foo;})(x);rollup-3.29.4/test/form/samples/compact/_expected/system.js000066400000000000000000000006261450520414700237720ustar00rootroot00000000000000System.register('foo',['external'],(function(exports){'use strict';var x;return{setters:[function(module){x=module.default;}],execute:(function(){exports('default',foo);var self=/*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({__proto__:null,get default(){return foo}},Symbol.toStringTag,{value:'Module'}));console.log(self); function foo () { console.log( x ); } // trailing comment })}}));rollup-3.29.4/test/form/samples/compact/_expected/umd.js000066400000000000000000000010051450520414700232230ustar00rootroot00000000000000(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?module.exports=f(require('external')):typeof define==='function'&&define.amd?define(['external'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,g.foo=f(g.x));})(this,(function(x){'use strict';var self=/*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({__proto__:null,get default(){return foo}},Symbol.toStringTag,{value:'Module'}));console.log(self); function foo () { console.log( x ); } // trailing comment return foo;}));rollup-3.29.4/test/form/samples/compact/main.js000066400000000000000000000002321450520414700214230ustar00rootroot00000000000000import x from 'external'; import * as self from './main.js'; console.log(self); export default function foo () { console.log( x ); } // trailing comment rollup-3.29.4/test/form/samples/computed-member-expression-assignments/000077500000000000000000000000001450520414700263315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/computed-member-expression-assignments/_config.js000066400000000000000000000001601450520414700302700ustar00rootroot00000000000000module.exports = defineTest({ description: 'detect side-effects in assignments involving computed members' }); rollup-3.29.4/test/form/samples/computed-member-expression-assignments/_expected.js000066400000000000000000000006531450520414700306330ustar00rootroot00000000000000const retained1 = { foo: {} }; retained1[ 'f' + 'oo' ] = globalThis.unknown; retained1.foo.bar = 1; const retained2 = {}; retained2[ 'f' + 'oo' ].bar = 1; const retained3 = { foo: globalThis.unknown }; retained3.foo[ 'b' + 'ar' ] = 1; const retained4 = { foo: () => {} }; retained4[ 'f' + 'oo' ] = function () {this.x = 1;}; retained4.foo(); const retained5 = { foo: function () {this.x = 1;} }; retained5[ 'f' + 'oo' ](); rollup-3.29.4/test/form/samples/computed-member-expression-assignments/main.js000066400000000000000000000007521450520414700276170ustar00rootroot00000000000000const retained1 = { foo: {} }; retained1[ 'f' + 'oo' ] = globalThis.unknown; retained1.foo.bar = 1; const retained2 = {}; retained2[ 'f' + 'oo' ].bar = 1; const retained3 = { foo: globalThis.unknown }; retained3.foo[ 'b' + 'ar' ] = 1; const retained4 = { foo: () => {} }; retained4[ 'f' + 'oo' ] = function () {this.x = 1;}; retained4.foo(); const retained5 = { foo: function () {this.x = 1;} }; retained5[ 'f' + 'oo' ](); const removed1 = { foo: {} }; removed1.foo[ 'b' + 'ar' ] = 1; rollup-3.29.4/test/form/samples/computed-properties/000077500000000000000000000000001450520414700225305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/computed-properties/_config.js000066400000000000000000000002561450520414700244750ustar00rootroot00000000000000module.exports = defineTest({ description: 'computed property keys include declarations of referenced identifiers', options: { output: { name: 'computedProperties' } } }); rollup-3.29.4/test/form/samples/computed-properties/_expected/000077500000000000000000000000001450520414700244705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/computed-properties/_expected/amd.js000066400000000000000000000004141450520414700255660ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var foo = 'foo'; var bar = 'bar'; var baz = 'baz'; var bam = 'bam'; var x = { [foo]: 'bar' }; class X { [bar] () {} get [baz] () {} set [bam] ( value ) {} } exports.X = X; exports.x = x; })); rollup-3.29.4/test/form/samples/computed-properties/_expected/cjs.js000066400000000000000000000003201450520414700256000ustar00rootroot00000000000000'use strict'; var foo = 'foo'; var bar = 'bar'; var baz = 'baz'; var bam = 'bam'; var x = { [foo]: 'bar' }; class X { [bar] () {} get [baz] () {} set [bam] ( value ) {} } exports.X = X; exports.x = x; rollup-3.29.4/test/form/samples/computed-properties/_expected/es.js000066400000000000000000000002641450520414700254370ustar00rootroot00000000000000var foo = 'foo'; var bar = 'bar'; var baz = 'baz'; var bam = 'bam'; var x = { [foo]: 'bar' }; class X { [bar] () {} get [baz] () {} set [bam] ( value ) {} } export { X, x }; rollup-3.29.4/test/form/samples/computed-properties/_expected/iife.js000066400000000000000000000004471450520414700257470ustar00rootroot00000000000000var computedProperties = (function (exports) { 'use strict'; var foo = 'foo'; var bar = 'bar'; var baz = 'baz'; var bam = 'bam'; var x = { [foo]: 'bar' }; class X { [bar] () {} get [baz] () {} set [bam] ( value ) {} } exports.X = X; exports.x = x; return exports; })({}); rollup-3.29.4/test/form/samples/computed-properties/_expected/system.js000066400000000000000000000005421450520414700263530ustar00rootroot00000000000000System.register('computedProperties', [], (function (exports) { 'use strict'; return { execute: (function () { var foo = 'foo'; var bar = 'bar'; var baz = 'baz'; var bam = 'bam'; var x = exports('x', { [foo]: 'bar' }); class X { [bar] () {} get [baz] () {} set [bam] ( value ) {} } exports('X', X); }) }; })); rollup-3.29.4/test/form/samples/computed-properties/_expected/umd.js000066400000000000000000000010651450520414700256150ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.computedProperties = {})); })(this, (function (exports) { 'use strict'; var foo = 'foo'; var bar = 'bar'; var baz = 'baz'; var bam = 'bam'; var x = { [foo]: 'bar' }; class X { [bar] () {} get [baz] () {} set [bam] ( value ) {} } exports.X = X; exports.x = x; })); rollup-3.29.4/test/form/samples/computed-properties/main.js000066400000000000000000000002601450520414700240100ustar00rootroot00000000000000var foo = 'foo'; var bar = 'bar'; var baz = 'baz'; var bam = 'bam'; export var x = { [foo]: 'bar' }; export class X { [bar] () {} get [baz] () {} set [bam] ( value ) {} } rollup-3.29.4/test/form/samples/conditional-expression-deopzimize-while-included/000077500000000000000000000000001450520414700302665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/conditional-expression-deopzimize-while-included/_config.js000066400000000000000000000002001450520414700322200ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles deoptimizations of logical expression while they are inlcuded (#3324)' }); rollup-3.29.4/test/form/samples/conditional-expression-deopzimize-while-included/_expected.js000066400000000000000000000002561450520414700325670ustar00rootroot00000000000000let isReassigned = false; const result = (foo(), reassign() ? first() : second()); console.log(result); function reassign() { isReassigned = true; return isReassigned; } rollup-3.29.4/test/form/samples/conditional-expression-deopzimize-while-included/main.js000066400000000000000000000002561450520414700315530ustar00rootroot00000000000000let isReassigned = false; const result = (foo(), reassign() ? first() : second()); console.log(result); function reassign() { isReassigned = true; return isReassigned; } rollup-3.29.4/test/form/samples/conditional-expression-paths/000077500000000000000000000000001450520414700243335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/conditional-expression-paths/_config.js000066400000000000000000000001311450520414700262700ustar00rootroot00000000000000module.exports = defineTest({ description: 'only retain branches with side-effects' }); rollup-3.29.4/test/form/samples/conditional-expression-paths/_expected.js000066400000000000000000000005351450520414700266340ustar00rootroot00000000000000var unknownValue = globalThis.unknown(); var foo = { x: () => {}, y: {} }; var baz = { x: () => console.log('effect') }; // unknown branch with side-effect (unknownValue ? foo : baz).y.z; (unknownValue ? foo : baz).x(); // known branch with side-effect (baz ).y.z; (baz).y.z; (baz ).x(); (baz).x(); var baz3 = {}; (baz3 ).y.z = 1; (baz3).y.z = 1; rollup-3.29.4/test/form/samples/conditional-expression-paths/main.js000066400000000000000000000016451450520414700256230ustar00rootroot00000000000000var unknownValue = globalThis.unknown(); var foo = { x: () => {}, y: {} }; var bar = { x: () => {}, y: {} }; var baz = { x: () => console.log('effect') }; // unknown branch without side-effects var a1 = (unknownValue ? foo : bar).y.z; var b1 = (unknownValue ? foo : bar).x(); // unknown branch with side-effect var a2 = (unknownValue ? foo : baz).y.z; var b2 = (unknownValue ? foo : baz).x(); // known branch without side-effects var a3 = (true ? foo : baz).y.z; var b3 = (false ? baz : foo).y.z; var c3 = (true ? foo : baz).x(); var d3 = (false ? baz : foo).x(); var foo2 = { y: {} }; var baz2 = {}; (true ? foo2 : baz2).y.z = 1; (false ? baz2 : foo2).y.z = 1; // known branch with side-effect var a4 = (true ? baz : foo).y.z; var b4 = (false ? foo : baz).y.z; var c4 = (true ? baz : foo).x(); var d4 = (false ? foo : baz).x(); var foo3 = { y: {} }; var baz3 = {}; (true ? baz3 : foo3).y.z = 1; (false ? foo3 : baz3).y.z = 1; rollup-3.29.4/test/form/samples/conditional-expression/000077500000000000000000000000001450520414700232165ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/conditional-expression/_config.js000066400000000000000000000001311450520414700251530ustar00rootroot00000000000000module.exports = defineTest({ description: 'only retain branches with side-effects' }); rollup-3.29.4/test/form/samples/conditional-expression/_expected.js000066400000000000000000000006341450520414700255170ustar00rootroot00000000000000// side-effect in condition foo() ? 1 : 2; var unknownValue = bar(); // unknown branch with side-effect unknownValue ? foo() : 2; unknownValue ? 1 : foo(); (unknownValue ? function () {} : function () {this.x = 1;})(); // known side-effect foo() ; ((function () {this.x = 1;}) )(); (() => () => console.log( 'effect' ) )()(); foo(); ((function () {this.x = 1;}))(); (() => () => console.log( 'effect' ))()(); rollup-3.29.4/test/form/samples/conditional-expression/main.js000066400000000000000000000022011450520414700244730ustar00rootroot00000000000000// side-effect in condition var a = foo() ? 1 : 2; var unknownValue = bar(); // unknown branch without side-effects var b = unknownValue ? 1 : 2; new (unknownValue ? function () {} : function () {this.x = 1;})(); // unknown branch with side-effect var c = unknownValue ? foo() : 2; var d = unknownValue ? 1 : foo(); (unknownValue ? function () {} : function () {this.x = 1;})(); // no side-effects var e1 = true ? 1 : foo(); var e2 = (true ? function () {} : function () {this.x = 1;})(); var e3 = (true ? () => () => {} : () => () => console.log( 'effect' ))()(); var f1 = false ? foo() : 2; var f2 = (false ? function () {this.x = 1;} : function () {})(); var f3 = (false ? () => () => console.log( 'effect' ) : () => () => {})()(); var g1 = true ? 1 : 2; var g2 = true || foo() ? 1 : 2; // known side-effect var h1 = true ? foo() : 2; var h2 = (true ? function () {this.x = 1;} : function () {})(); var h3 = (true ? () => () => console.log( 'effect' ) : () => () => {})()(); var i1 = false ? 1 : foo(); var i2 = (false ? function () {} : function () {this.x = 1;})(); var i3 = (false ? () => () => {} : () => () => console.log( 'effect' ))()(); rollup-3.29.4/test/form/samples/conditional-put-parens-around-sequence/000077500000000000000000000000001450520414700262115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/conditional-put-parens-around-sequence/_config.js000066400000000000000000000001601450520414700301500ustar00rootroot00000000000000module.exports = defineTest({ description: 'put parens around sequences if conditional simplified (#1311)' }); rollup-3.29.4/test/form/samples/conditional-put-parens-around-sequence/_expected.js000066400000000000000000000001701450520414700305050ustar00rootroot00000000000000var a = ( foo(), 3 ) ; var b = ( bar(), 6 ); foo( a, b ); // verify works with no whitespace bar((foo(),2),(bar(),8)); rollup-3.29.4/test/form/samples/conditional-put-parens-around-sequence/main.js000066400000000000000000000003201450520414700274660ustar00rootroot00000000000000var a = true ? ( 1, foo(), 3 ) : ( 4, bar(), 6 ); var b = false ? ( 1, foo(), 3 ) : ( 4, bar(), 6 ); foo( a, b ); // verify works with no whitespace bar(true?(foo(),2):(bar(),4),false?(foo(),6):(bar(),8)); rollup-3.29.4/test/form/samples/configure-file-url/000077500000000000000000000000001450520414700222145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/configure-file-url/_config.js000066400000000000000000000020601450520414700241540ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to configure file urls', options: { plugins: [ { name: 'first', resolveId(id) { if (id.endsWith('solved')) { return id; } }, load(id) { if (id.endsWith('solved')) { const assetId = this.emitFile({ type: 'asset', name: `asset-${id}.txt`, source: `Asset for: ${id}` }); return `export default import.meta.ROLLUP_FILE_URL_${assetId};`; } }, resolveFileUrl({ chunkId, fileName, format, moduleId, referenceId, relativePath }) { if (!moduleId.endsWith('resolved')) { return `'chunkId=${chunkId}:moduleId=${moduleId .replace(/\\/g, '/') .split('/') .slice(-2) .join( '/' )}:fileName=${fileName}:format=${format}:relativePath=${relativePath}:referenceId=${referenceId}'`; } return null; } }, { name: 'second', resolveFileUrl({ moduleId }) { if (moduleId === 'resolved') { return `'resolved'`; } return null; } } ] } }); rollup-3.29.4/test/form/samples/configure-file-url/_expected/000077500000000000000000000000001450520414700241545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/configure-file-url/_expected/amd.js000066400000000000000000000006211450520414700252520ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; var asset1 = 'chunkId=amd.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=amd:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = new URL(require.toUrl('./assets/asset-unresolved-f4c1e86c.txt'), document.baseURI).href; console.log(asset1, asset2, asset3); })); rollup-3.29.4/test/form/samples/configure-file-url/_expected/assets/000077500000000000000000000000001450520414700254565ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/configure-file-url/_expected/assets/asset-resolved-9e0f7ca5.txt000066400000000000000000000000231450520414700323730ustar00rootroot00000000000000Asset for: resolvedrollup-3.29.4/test/form/samples/configure-file-url/_expected/assets/asset-solved-230ecafd.txt000066400000000000000000000000211450520414700321060ustar00rootroot00000000000000Asset for: solvedrollup-3.29.4/test/form/samples/configure-file-url/_expected/assets/asset-unresolved-f4c1e86c.txt000066400000000000000000000000251450520414700327400ustar00rootroot00000000000000Asset for: unresolvedrollup-3.29.4/test/form/samples/configure-file-url/_expected/cjs.js000066400000000000000000000010061450520414700252660ustar00rootroot00000000000000'use strict'; var asset1 = 'chunkId=cjs.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=cjs:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-unresolved-f4c1e86c.txt').href : new URL('assets/asset-unresolved-f4c1e86c.txt', document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset3); rollup-3.29.4/test/form/samples/configure-file-url/_expected/es.js000066400000000000000000000004721450520414700251240ustar00rootroot00000000000000var asset1 = 'chunkId=es.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=es:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = new URL('assets/asset-unresolved-f4c1e86c.txt', import.meta.url).href; console.log(asset1, asset2, asset3); rollup-3.29.4/test/form/samples/configure-file-url/_expected/iife.js000066400000000000000000000006411450520414700254270ustar00rootroot00000000000000(function () { 'use strict'; var asset1 = 'chunkId=iife.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=iife:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = new URL('assets/asset-unresolved-f4c1e86c.txt', document.currentScript && document.currentScript.src || document.baseURI).href; console.log(asset1, asset2, asset3); })(); rollup-3.29.4/test/form/samples/configure-file-url/_expected/system.js000066400000000000000000000007031450520414700260360ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var asset1 = 'chunkId=system.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=system:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = new URL('assets/asset-unresolved-f4c1e86c.txt', module.meta.url).href; console.log(asset1, asset2, asset3); }) }; })); rollup-3.29.4/test/form/samples/configure-file-url/_expected/umd.js000066400000000000000000000013311450520414700252750ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var asset1 = 'chunkId=umd.js:moduleId=solved:fileName=assets/asset-solved-230ecafd.txt:format=umd:relativePath=assets/asset-solved-230ecafd.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-unresolved-f4c1e86c.txt').href : new URL('assets/asset-unresolved-f4c1e86c.txt', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset3); })); rollup-3.29.4/test/form/samples/configure-file-url/main.js000066400000000000000000000002031450520414700234710ustar00rootroot00000000000000import asset1 from 'solved'; import asset2 from 'resolved'; import asset3 from 'unresolved'; console.log(asset1, asset2, asset3); rollup-3.29.4/test/form/samples/conflicting-imports/000077500000000000000000000000001450520414700225105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/conflicting-imports/_config.js000066400000000000000000000003171450520414700244530ustar00rootroot00000000000000module.exports = defineTest({ description: 'ensures bundle imports are deconflicted (#659)', options: { external: ['foo', 'bar'], output: { globals: { bar: 'bar', foo: 'foo' } } } }); rollup-3.29.4/test/form/samples/conflicting-imports/_expected/000077500000000000000000000000001450520414700244505ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/conflicting-imports/_expected/amd.js000066400000000000000000000001621450520414700255460ustar00rootroot00000000000000define(['foo', 'bar'], (function (foo, bar) { 'use strict'; console.log( bar.a ); console.log( foo.a ); })); rollup-3.29.4/test/form/samples/conflicting-imports/_expected/cjs.js000066400000000000000000000001611450520414700255630ustar00rootroot00000000000000'use strict'; var foo = require('foo'); var bar = require('bar'); console.log( bar.a ); console.log( foo.a ); rollup-3.29.4/test/form/samples/conflicting-imports/_expected/es.js000066400000000000000000000001411450520414700254110ustar00rootroot00000000000000import { a as a$1 } from 'foo'; import { a } from 'bar'; console.log( a ); console.log( a$1 ); rollup-3.29.4/test/form/samples/conflicting-imports/_expected/iife.js000066400000000000000000000001451450520414700257220ustar00rootroot00000000000000(function (foo, bar) { 'use strict'; console.log( bar.a ); console.log( foo.a ); })(foo, bar); rollup-3.29.4/test/form/samples/conflicting-imports/_expected/system.js000066400000000000000000000004171450520414700263340ustar00rootroot00000000000000System.register(['foo', 'bar'], (function () { 'use strict'; var a$1, a; return { setters: [function (module) { a$1 = module.a; }, function (module) { a = module.a; }], execute: (function () { console.log( a ); console.log( a$1 ); }) }; })); rollup-3.29.4/test/form/samples/conflicting-imports/_expected/umd.js000066400000000000000000000006521450520414700255760ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('foo'), require('bar')) : typeof define === 'function' && define.amd ? define(['foo', 'bar'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foo, global.bar)); })(this, (function (foo, bar) { 'use strict'; console.log( bar.a ); console.log( foo.a ); })); rollup-3.29.4/test/form/samples/conflicting-imports/main.js000066400000000000000000000001011450520414700237620ustar00rootroot00000000000000import { a } from 'foo'; import './other.js'; console.log( a ); rollup-3.29.4/test/form/samples/conflicting-imports/other.js000066400000000000000000000000541450520414700241660ustar00rootroot00000000000000import { a } from 'bar'; console.log( a ); rollup-3.29.4/test/form/samples/curried-function/000077500000000000000000000000001450520414700217765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/curried-function/T.js000066400000000000000000000001101450520414700225270ustar00rootroot00000000000000import always from './always'; var T = always(true); export default T; rollup-3.29.4/test/form/samples/curried-function/_config.js000066400000000000000000000001261450520414700237370ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly handles a curried function' }); rollup-3.29.4/test/form/samples/curried-function/_expected.js000066400000000000000000000003151450520414700242730ustar00rootroot00000000000000function curry1 ( fn ) { return function f1 ( a ) { return fn.apply( this, arguments ); }; } var always = curry1( function always ( val ) { return function () { return val; }; } ); always(true); rollup-3.29.4/test/form/samples/curried-function/always.js000066400000000000000000000002231450520414700236310ustar00rootroot00000000000000import curry1 from './curry1'; var always = curry1( function always ( val ) { return function () { return val; }; } ); export default always; rollup-3.29.4/test/form/samples/curried-function/curry1.js000066400000000000000000000001601450520414700235560ustar00rootroot00000000000000export default function curry1 ( fn ) { return function f1 ( a ) { return fn.apply( this, arguments ); }; } rollup-3.29.4/test/form/samples/curried-function/main.js000066400000000000000000000000211450520414700232510ustar00rootroot00000000000000import './T.js'; rollup-3.29.4/test/form/samples/custom-context/000077500000000000000000000000001450520414700215125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/custom-context/_config.js000066400000000000000000000001541450520414700234540ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows custom context', options: { context: `lolwut` } }); rollup-3.29.4/test/form/samples/custom-context/_expected/000077500000000000000000000000001450520414700234525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/custom-context/_expected/amd.js000066400000000000000000000001011450520414700245410ustar00rootroot00000000000000define((function () { 'use strict'; lolwut.prop = '???'; })); rollup-3.29.4/test/form/samples/custom-context/_expected/cjs.js000066400000000000000000000000441450520414700245650ustar00rootroot00000000000000'use strict'; lolwut.prop = '???'; rollup-3.29.4/test/form/samples/custom-context/_expected/es.js000066400000000000000000000000251450520414700244140ustar00rootroot00000000000000lolwut.prop = '???'; rollup-3.29.4/test/form/samples/custom-context/_expected/iife.js000066400000000000000000000000741450520414700247250ustar00rootroot00000000000000(function () { 'use strict'; lolwut.prop = '???'; })(); rollup-3.29.4/test/form/samples/custom-context/_expected/system.js000066400000000000000000000001761450520414700253400ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { lolwut.prop = '???'; }) }; })); rollup-3.29.4/test/form/samples/custom-context/_expected/umd.js000066400000000000000000000002371450520414700245770ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; lolwut.prop = '???'; })); rollup-3.29.4/test/form/samples/custom-context/main.js000066400000000000000000000000231450520414700227670ustar00rootroot00000000000000this.prop = '???'; rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/000077500000000000000000000000001450520414700250525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/_config.js000066400000000000000000000004571450520414700270220ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not add any interop when using a custom dynamic import handler', options: { external: 'external', output: { interop: 'auto' }, plugins: { name: 'test', renderDynamicImport() { return { left: 'getIt(', right: ')' }; } } } }); rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/_expected/000077500000000000000000000000001450520414700270125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/_expected/amd.js000066400000000000000000000001451450520414700301110ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; getIt('external').then(console.log); })); rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/_expected/cjs.js000066400000000000000000000000641450520414700301270ustar00rootroot00000000000000'use strict'; getIt('external').then(console.log); rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/_expected/es.js000066400000000000000000000000451450520414700277560ustar00rootroot00000000000000getIt('external').then(console.log); rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/_expected/iife.js000066400000000000000000000001141450520414700302600ustar00rootroot00000000000000(function () { 'use strict'; getIt('external').then(console.log); })(); rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/_expected/system.js000066400000000000000000000002351450520414700306740ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { getIt('external').then(console.log); }) }; })); rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/_expected/umd.js000066400000000000000000000002571450520414700301410ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; getIt('external').then(console.log); })); rollup-3.29.4/test/form/samples/custom-dynamic-import-no-interop/main.js000066400000000000000000000000461450520414700263340ustar00rootroot00000000000000import('external').then(console.log); rollup-3.29.4/test/form/samples/custom-event-detail/000077500000000000000000000000001450520414700224075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/custom-event-detail/_config.js000066400000000000000000000001421450520414700243460ustar00rootroot00000000000000module.exports = defineTest({ description: 'observes side effects for custom event payloads' }); rollup-3.29.4/test/form/samples/custom-event-detail/_expected.js000066400000000000000000000002571450520414700247110ustar00rootroot00000000000000const detail = { value: null }; const event = new CustomEvent('test', { detail }); event.detail.value = true; if (detail.value) console.log('ok'); else console.log('failed'); rollup-3.29.4/test/form/samples/custom-event-detail/main.js000066400000000000000000000002571450520414700236750ustar00rootroot00000000000000const detail = { value: null }; const event = new CustomEvent('test', { detail }); event.detail.value = true; if (detail.value) console.log('ok'); else console.log('failed'); rollup-3.29.4/test/form/samples/custom-module-context-function/000077500000000000000000000000001450520414700246205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/custom-module-context-function/_config.js000066400000000000000000000004701450520414700265630ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows custom module-specific context with a function option', expectedWarnings: ['THIS_IS_UNDEFINED'], options: { moduleContext(id) { if (id.endsWith('main.js')) { return 'window'; } if (id.endsWith('foo.js')) { return 'global'; } } } }); rollup-3.29.4/test/form/samples/custom-module-context-function/_expected.js000066400000000000000000000001051450520414700271120ustar00rootroot00000000000000global.prop = 'foo'; undefined.prop = 'bar'; window.prop = 'main'; rollup-3.29.4/test/form/samples/custom-module-context-function/bar.js000066400000000000000000000000231450520414700257150ustar00rootroot00000000000000this.prop = 'bar'; rollup-3.29.4/test/form/samples/custom-module-context-function/foo.js000066400000000000000000000000231450520414700257340ustar00rootroot00000000000000this.prop = 'foo'; rollup-3.29.4/test/form/samples/custom-module-context-function/main.js000066400000000000000000000000721450520414700261010ustar00rootroot00000000000000import './foo.js'; import './bar.js'; this.prop = 'main'; rollup-3.29.4/test/form/samples/custom-module-context/000077500000000000000000000000001450520414700227755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/custom-module-context/_config.js000066400000000000000000000003001450520414700247300ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows custom module-specific context', expectedWarnings: ['THIS_IS_UNDEFINED'], options: { moduleContext: { 'main.js': 'lolwut' } } }); rollup-3.29.4/test/form/samples/custom-module-context/_expected/000077500000000000000000000000001450520414700247355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/custom-module-context/_expected/amd.js000066400000000000000000000001341450520414700260320ustar00rootroot00000000000000define((function () { 'use strict'; undefined.prop = 'nope'; lolwut.prop = '???'; })); rollup-3.29.4/test/form/samples/custom-module-context/_expected/cjs.js000066400000000000000000000000761450520414700260550ustar00rootroot00000000000000'use strict'; undefined.prop = 'nope'; lolwut.prop = '???'; rollup-3.29.4/test/form/samples/custom-module-context/_expected/es.js000066400000000000000000000000571450520414700257040ustar00rootroot00000000000000undefined.prop = 'nope'; lolwut.prop = '???'; rollup-3.29.4/test/form/samples/custom-module-context/_expected/iife.js000066400000000000000000000001271450520414700262070ustar00rootroot00000000000000(function () { 'use strict'; undefined.prop = 'nope'; lolwut.prop = '???'; })(); rollup-3.29.4/test/form/samples/custom-module-context/_expected/system.js000066400000000000000000000002331450520414700266150ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { undefined.prop = 'nope'; lolwut.prop = '???'; }) }; })); rollup-3.29.4/test/form/samples/custom-module-context/_expected/umd.js000066400000000000000000000002721450520414700260610ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; undefined.prop = 'nope'; lolwut.prop = '???'; })); rollup-3.29.4/test/form/samples/custom-module-context/foo.js000066400000000000000000000000241450520414700241120ustar00rootroot00000000000000this.prop = 'nope'; rollup-3.29.4/test/form/samples/custom-module-context/main.js000066400000000000000000000000461450520414700242570ustar00rootroot00000000000000import './foo.js'; this.prop = '???'; rollup-3.29.4/test/form/samples/declarations-with-side-effects/000077500000000000000000000000001450520414700244765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/declarations-with-side-effects/_config.js000066400000000000000000000001771450520414700264450ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains side-effects in declarations will tree-shaking the declared variable' }); rollup-3.29.4/test/form/samples/declarations-with-side-effects/_expected.js000066400000000000000000000002271450520414700267750ustar00rootroot00000000000000let foo1 = true; globalFunction(); console.log(foo1); ({[globalFunction()]: globalFunction()}); const baz2 = 3; console.log(baz2); globalFunction(); rollup-3.29.4/test/form/samples/declarations-with-side-effects/main.js000066400000000000000000000003371450520414700257630ustar00rootroot00000000000000let foo1 = true, bar1 = globalFunction(), baz1 = true; bar1 = 'somethingElse'; console.log(foo1); const foo2 = 1, bar2 = {[globalFunction()]: globalFunction()}, baz2 = 3; console.log(baz2); const foo3 = globalFunction(); rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/000077500000000000000000000000001450520414700254035ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/_config.js000066400000000000000000000002301450520414700273400ustar00rootroot00000000000000module.exports = defineTest({ description: 'only deconflict "exports" for formats where it is necessary', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/_expected/000077500000000000000000000000001450520414700273435ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/_expected/amd.js000066400000000000000000000005761450520414700304520ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const exports$1 = { x: 42 }; console.log(exports$1); function nestedConflict() { const exports$1 = { x: 42 }; console.log(exports$1); exports.x++; } function nestedNoConflict() { const exports = { x: 42 }; console.log(exports); } exports.x = 43; nestedConflict(); nestedNoConflict(); })); rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/_expected/cjs.js000066400000000000000000000004721450520414700304630ustar00rootroot00000000000000'use strict'; const exports$1 = { x: 42 }; console.log(exports$1); function nestedConflict() { const exports$1 = { x: 42 }; console.log(exports$1); exports.x++; } function nestedNoConflict() { const exports = { x: 42 }; console.log(exports); } exports.x = 43; nestedConflict(); nestedNoConflict(); rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/_expected/es.js000066400000000000000000000004461450520414700303140ustar00rootroot00000000000000const exports = { x: 42 }; console.log(exports); function nestedConflict() { const exports = { x: 42 }; console.log(exports); x++; } function nestedNoConflict() { const exports = { x: 42 }; console.log(exports); } var x = 43; nestedConflict(); nestedNoConflict(); export { x }; rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/_expected/iife.js000066400000000000000000000006151450520414700306170ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const exports$1 = { x: 42 }; console.log(exports$1); function nestedConflict() { const exports$1 = { x: 42 }; console.log(exports$1); exports.x++; } function nestedNoConflict() { const exports = { x: 42 }; console.log(exports); } exports.x = 43; nestedConflict(); nestedNoConflict(); return exports; })({}); rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/_expected/system.js000066400000000000000000000007651450520414700312350ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const exports$1 = { x: 42 }; console.log(exports$1); function nestedConflict() { const exports$1 = { x: 42 }; console.log(exports$1); exports('x', x + 1), x++; } function nestedNoConflict() { const exports = { x: 42 }; console.log(exports); } var x = exports('x', 43); nestedConflict(); nestedNoConflict(); }) }; })); rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/_expected/umd.js000066400000000000000000000012331450520414700304650ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; const exports$1 = { x: 42 }; console.log(exports$1); function nestedConflict() { const exports$1 = { x: 42 }; console.log(exports$1); exports.x++; } function nestedNoConflict() { const exports = { x: 42 }; console.log(exports); } exports.x = 43; nestedConflict(); nestedNoConflict(); })); rollup-3.29.4/test/form/samples/deconflict-format-specific-exports/main.js000066400000000000000000000004361450520414700266700ustar00rootroot00000000000000const exports = { x: 42 }; console.log(exports); function nestedConflict() { const exports = { x: 42 }; console.log(exports); x++; } function nestedNoConflict() { const exports = { x: 42 }; console.log(exports); } export var x = 43; nestedConflict(); nestedNoConflict(); rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/000077500000000000000000000000001450520414700253225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/_config.js000066400000000000000000000003701450520414700272640ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts format specific globals', options: { external: 'external', output: { globals: { external: 'external' }, name: 'bundle', interop: 'auto', dynamicImportInCjs: false } } }); rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/_expected/000077500000000000000000000000001450520414700272625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/_expected/amd.js000066400000000000000000000040561450520414700303660ustar00rootroot00000000000000define(['module', 'require', 'external'], (function (module, require, external) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__default = /*#__PURE__*/_interopDefault(external); console.log(external__default.default); const _interopDefault$1 = 1; const _interopNamespace$1 = 1; const module$1 = 1; const require$1 = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault$1, _interopNamespace$1, module$1, require$1, exports$1, document$1, URL$1); new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }).then(console.log); exports.default = 0; console.log(new URL(module.uri, document.baseURI).href); function nested1() { const _interopDefault = 1; const _interopNamespace$1 = 1; const module$1 = 1; const require$1 = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault, _interopNamespace$1, module$1, require$1, exports$1, document$1, URL$1); new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }).then(console.log); exports.default = 1; console.log(new URL(module.uri, document.baseURI).href); } nested1(); function nested2() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); } nested2(); return exports.default; })); rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/_expected/cjs.js000066400000000000000000000043761450520414700304110ustar00rootroot00000000000000'use strict'; var external = require('external'); var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__default = /*#__PURE__*/_interopDefault(external); console.log(external__default.default); const _interopDefault$1 = 1; const _interopNamespace$1 = 1; const module$1 = 1; const require$1 = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault$1, _interopNamespace$1, module$1, require$1, exports$1, document$1, URL$1); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('external')); }).then(console.log); exports.default = 0; console.log((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cjs.js', document.baseURI).href))); function nested1() { const _interopDefault = 1; const _interopNamespace$1 = 1; const module = 1; const require$1 = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault, _interopNamespace$1, module, require$1, exports$1, document$1, URL$1); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('external')); }).then(console.log); exports.default = 1; console.log((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cjs.js', document.baseURI).href))); } nested1(); function nested2() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); } nested2(); module.exports = exports.default; rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/_expected/es.js000066400000000000000000000020361450520414700302300ustar00rootroot00000000000000import external from 'external'; console.log(external); const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); import('external').then(console.log); let value = 0; console.log(import.meta.url); function nested1() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); import('external').then(console.log); value = 1; console.log(import.meta.url); } nested1(); function nested2() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); } nested2(); export { value as default }; rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/_expected/iife.js000066400000000000000000000030741450520414700305400ustar00rootroot00000000000000var bundle = (function (external) { 'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var external__default = /*#__PURE__*/_interopDefault(external); console.log(external__default.default); const _interopDefault$1 = 1; const _interopNamespace$1 = 1; const module = 1; const require = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault$1, _interopNamespace$1, module, require, exports$1, document$1, URL$1); import('external').then(console.log); exports.default = 0; console.log((_documentCurrentScript && _documentCurrentScript.src || new URL('iife.js', document.baseURI).href)); function nested1() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault, _interopNamespace, module, require, exports$1, document$1, URL$1); import('external').then(console.log); exports.default = 1; console.log((_documentCurrentScript && _documentCurrentScript.src || new URL('iife.js', document.baseURI).href)); } nested1(); function nested2() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); } nested2(); return exports.default; })(external); rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/_expected/system.js000066400000000000000000000025571450520414700311550ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports, module) { 'use strict'; var external; return { setters: [function (module) { external = module.default; }], execute: (function () { console.log(external); const _interopDefault = 1; const _interopNamespace = 1; const module$1 = 1; const require = 1; const exports$1 = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module$1, require, exports$1, document, URL); module.import('external').then(console.log); let value = exports('default', 0); console.log(module.meta.url); function nested1() { const _interopDefault = 1; const _interopNamespace = 1; const module$1 = 1; const require = 1; const exports$1 = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module$1, require, exports$1, document, URL); module.import('external').then(console.log); exports('default', value = 1); console.log(module.meta.url); } nested1(); function nested2() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); } nested2(); }) }; })); rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/_expected/umd.js000066400000000000000000000043431450520414700304110ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('external')) : typeof define === 'function' && define.amd ? define(['external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory(global.external)); })(this, (function (external) { 'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var external__default = /*#__PURE__*/_interopDefault(external); console.log(external__default.default); const _interopDefault$1 = 1; const _interopNamespace$1 = 1; const module = 1; const require$1 = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault$1, _interopNamespace$1, module, require$1, exports$1, document$1, URL$1); import('external').then(console.log); exports.default = 0; console.log((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('umd.js', document.baseURI).href))); function nested1() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require$1 = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault, _interopNamespace, module, require$1, exports$1, document$1, URL$1); import('external').then(console.log); exports.default = 1; console.log((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('umd.js', document.baseURI).href))); } nested1(); function nested2() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); } nested2(); return exports.default; })); rollup-3.29.4/test/form/samples/deconflict-format-specific-globals/main.js000066400000000000000000000020351450520414700266040ustar00rootroot00000000000000import external from 'external'; console.log(external); const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); import('external').then(console.log); let value = 0; export { value as default }; console.log(import.meta.url); function nested1() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); import('external').then(console.log); value = 1; console.log(import.meta.url); } nested1(); function nested2() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); } nested2(); rollup-3.29.4/test/form/samples/deconflict-module-priority/000077500000000000000000000000001450520414700237725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deconflict-module-priority/_config.js000066400000000000000000000001611450520414700257320ustar00rootroot00000000000000module.exports = defineTest({ description: 'prioritizes entry modules over dependencies when deconflicting' }); rollup-3.29.4/test/form/samples/deconflict-module-priority/_expected.js000066400000000000000000000002051450520414700262650ustar00rootroot00000000000000const foo$1 = 'dep'; console.log(foo$1); const bar$1 = 'dep'; const foo = 'main'; const bar = 'main'; console.log(foo, bar, bar$1); rollup-3.29.4/test/form/samples/deconflict-module-priority/dep.js000066400000000000000000000000771450520414700251040ustar00rootroot00000000000000const foo = 'dep'; console.log(foo); export const bar = 'dep'; rollup-3.29.4/test/form/samples/deconflict-module-priority/main.js000066400000000000000000000001531450520414700252530ustar00rootroot00000000000000import { bar as baz } from './dep.js'; const foo = 'main'; const bar = 'main'; console.log(foo, bar, baz); rollup-3.29.4/test/form/samples/deconflict-nested-tree-shaking/000077500000000000000000000000001450520414700244675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deconflict-nested-tree-shaking/_config.js000066400000000000000000000001641450520414700264320ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not consider nested tree-shaken variables when deconflicting' }); rollup-3.29.4/test/form/samples/deconflict-nested-tree-shaking/_expected.js000066400000000000000000000003041450520414700267620ustar00rootroot00000000000000const conflict = 'dep'; function getValue() { function nestedGetValue() { const conflict$1 = 'nested'; return conflict$1; } return conflict + nestedGetValue(); } console.log(getValue()); rollup-3.29.4/test/form/samples/deconflict-nested-tree-shaking/dep.js000066400000000000000000000000371450520414700255750ustar00rootroot00000000000000export const conflict = 'dep'; rollup-3.29.4/test/form/samples/deconflict-nested-tree-shaking/main.js000066400000000000000000000004311450520414700257470ustar00rootroot00000000000000import * as dep from './dep.js'; function getValue() { function nestedGetValue() { const conflict$1 = 'nested'; if (false) { console.log(conflict); } return conflict$1; } const conflict = 'main'; return dep.conflict + nestedGetValue(); } console.log(getValue()); rollup-3.29.4/test/form/samples/deconflict-tree-shaken-globals/000077500000000000000000000000001450520414700244555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deconflict-tree-shaken-globals/_config.js000066400000000000000000000001521450520414700264150ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not deconflict due to tree-shaken global variables' }); rollup-3.29.4/test/form/samples/deconflict-tree-shaken-globals/_expected.js000066400000000000000000000000621450520414700267510ustar00rootroot00000000000000const globalName = 42; console.log( globalName ); rollup-3.29.4/test/form/samples/deconflict-tree-shaken-globals/main.js000066400000000000000000000001101450520414700257270ustar00rootroot00000000000000import './other.js'; const globalName = 42; console.log( globalName ); rollup-3.29.4/test/form/samples/deconflict-tree-shaken-globals/other.js000066400000000000000000000000541450520414700261330ustar00rootroot00000000000000if (false) { console.log( globalName ); } rollup-3.29.4/test/form/samples/deconflict-tree-shaken/000077500000000000000000000000001450520414700230345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deconflict-tree-shaken/_config.js000066400000000000000000000001551450520414700247770ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not consider tree-shaken variables when deconflicting' }); rollup-3.29.4/test/form/samples/deconflict-tree-shaken/_expected.js000066400000000000000000000000771450520414700253360ustar00rootroot00000000000000const x$1 = 1; console.log(x$1); const x = 0; console.log(x); rollup-3.29.4/test/form/samples/deconflict-tree-shaken/dep1.js000066400000000000000000000000351450520414700242210ustar00rootroot00000000000000const x = 1; console.log(x); rollup-3.29.4/test/form/samples/deconflict-tree-shaken/dep2.js000066400000000000000000000000151450520414700242200ustar00rootroot00000000000000const x = 2; rollup-3.29.4/test/form/samples/deconflict-tree-shaken/dep3.js000066400000000000000000000000151450520414700242210ustar00rootroot00000000000000const x = 3; rollup-3.29.4/test/form/samples/deconflict-tree-shaken/main.js000066400000000000000000000001321450520414700243120ustar00rootroot00000000000000import './dep1.js'; import './dep2.js'; import './dep3.js'; const x = 0; console.log(x); rollup-3.29.4/test/form/samples/dedupes-external-imports/000077500000000000000000000000001450520414700234625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dedupes-external-imports/_config.js000066400000000000000000000002771450520414700254320ustar00rootroot00000000000000module.exports = defineTest({ description: 'dedupes external imports', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/dedupes-external-imports/_expected/000077500000000000000000000000001450520414700254225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dedupes-external-imports/_expected/amd.js000066400000000000000000000010111450520414700265120ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; class Foo extends external.Component { constructor () { super(); this.isFoo = true; } } class Bar extends external.Component { constructor () { super(); this.isBar = true; } } class Baz extends external.Component { constructor () { super(); this.isBaz = true; } } const foo = new Foo(); const bar = new Bar(); const baz = new Baz(); exports.bar = bar; exports.baz = baz; exports.foo = foo; })); rollup-3.29.4/test/form/samples/dedupes-external-imports/_expected/cjs.js000066400000000000000000000007201450520414700265360ustar00rootroot00000000000000'use strict'; var external = require('external'); class Foo extends external.Component { constructor () { super(); this.isFoo = true; } } class Bar extends external.Component { constructor () { super(); this.isBar = true; } } class Baz extends external.Component { constructor () { super(); this.isBaz = true; } } const foo = new Foo(); const bar = new Bar(); const baz = new Baz(); exports.bar = bar; exports.baz = baz; exports.foo = foo; rollup-3.29.4/test/form/samples/dedupes-external-imports/_expected/es.js000066400000000000000000000006111450520414700263650ustar00rootroot00000000000000import { Component } from 'external'; class Foo extends Component { constructor () { super(); this.isFoo = true; } } class Bar extends Component { constructor () { super(); this.isBar = true; } } class Baz extends Component { constructor () { super(); this.isBaz = true; } } const foo = new Foo(); const bar = new Bar(); const baz = new Baz(); export { bar, baz, foo }; rollup-3.29.4/test/form/samples/dedupes-external-imports/_expected/iife.js000066400000000000000000000010301450520414700266660ustar00rootroot00000000000000var myBundle = (function (exports, external) { 'use strict'; class Foo extends external.Component { constructor () { super(); this.isFoo = true; } } class Bar extends external.Component { constructor () { super(); this.isBar = true; } } class Baz extends external.Component { constructor () { super(); this.isBaz = true; } } const foo = new Foo(); const bar = new Bar(); const baz = new Baz(); exports.bar = bar; exports.baz = baz; exports.foo = foo; return exports; })({}, external); rollup-3.29.4/test/form/samples/dedupes-external-imports/_expected/system.js000066400000000000000000000012201450520414700272770ustar00rootroot00000000000000System.register('myBundle', ['external'], (function (exports) { 'use strict'; var Component; return { setters: [function (module) { Component = module.Component; }], execute: (function () { class Foo extends Component { constructor () { super(); this.isFoo = true; } } class Bar extends Component { constructor () { super(); this.isBar = true; } } class Baz extends Component { constructor () { super(); this.isBaz = true; } } const foo = exports('foo', new Foo()); const bar = exports('bar', new Bar()); const baz = exports('baz', new Baz()); }) }; })); rollup-3.29.4/test/form/samples/dedupes-external-imports/_expected/umd.js000066400000000000000000000015161450520414700265500ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; class Foo extends external.Component { constructor () { super(); this.isFoo = true; } } class Bar extends external.Component { constructor () { super(); this.isBar = true; } } class Baz extends external.Component { constructor () { super(); this.isBaz = true; } } const foo = new Foo(); const bar = new Bar(); const baz = new Baz(); exports.bar = bar; exports.baz = baz; exports.foo = foo; })); rollup-3.29.4/test/form/samples/dedupes-external-imports/bar.js000066400000000000000000000002131450520414700245600ustar00rootroot00000000000000import { Component } from 'external'; export default class Bar extends Component { constructor () { super(); this.isBar = true; } } rollup-3.29.4/test/form/samples/dedupes-external-imports/baz.js000066400000000000000000000002161450520414700245730ustar00rootroot00000000000000import { Component as Comp } from 'external'; export default class Baz extends Comp { constructor () { super(); this.isBaz = true; } } rollup-3.29.4/test/form/samples/dedupes-external-imports/foo.js000066400000000000000000000002131450520414700245770ustar00rootroot00000000000000import { Component } from 'external'; export default class Foo extends Component { constructor () { super(); this.isFoo = true; } } rollup-3.29.4/test/form/samples/dedupes-external-imports/main.js000066400000000000000000000002461450520414700247460ustar00rootroot00000000000000import Foo from './foo'; import Bar from './bar'; import Baz from './baz'; export const foo = new Foo(); export const bar = new Bar(); export const baz = new Baz(); rollup-3.29.4/test/form/samples/deep-properties-access/000077500000000000000000000000001450520414700230645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deep-properties-access/_config.js000066400000000000000000000001321450520414700250220ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles deeply nested property accesses' }); rollup-3.29.4/test/form/samples/deep-properties-access/_expected.js000066400000000000000000000002131450520414700253560ustar00rootroot00000000000000var obj = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; console.log(obj.obj.obj.obj.obj.obj.obj.obj.obj.foo); rollup-3.29.4/test/form/samples/deep-properties-access/main.js000066400000000000000000000002131450520414700243420ustar00rootroot00000000000000var obj = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; console.log(obj.obj.obj.obj.obj.obj.obj.obj.obj.foo); rollup-3.29.4/test/form/samples/deep-properties/000077500000000000000000000000001450520414700216255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deep-properties/_config.js000066400000000000000000000002231450520414700235640ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles deeply nested properties', options: { treeshake: { propertyReadSideEffects: false } } }); rollup-3.29.4/test/form/samples/deep-properties/_expected.js000066400000000000000000000007151450520414700241260ustar00rootroot00000000000000var obj1 = obj1; console.log(obj1.foo()); var obj2 = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; obj2.obj.obj.obj.obj.obj.obj.obj.foo(); var obj3 = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; if (obj3.obj.obj.obj.obj.obj.obj.obj.obj.foo) console.log('nested'); var obj4 = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; obj4.obj.obj.obj.obj.obj.obj.obj.foo = 'nested'; rollup-3.29.4/test/form/samples/deep-properties/main.js000066400000000000000000000007151450520414700231120ustar00rootroot00000000000000var obj1 = obj1; console.log(obj1.foo()); var obj2 = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; obj2.obj.obj.obj.obj.obj.obj.obj.foo(); var obj3 = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; if (obj3.obj.obj.obj.obj.obj.obj.obj.obj.foo) console.log('nested'); var obj4 = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; obj4.obj.obj.obj.obj.obj.obj.obj.foo = 'nested'; rollup-3.29.4/test/form/samples/deep-switch-declarations/000077500000000000000000000000001450520414700234005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deep-switch-declarations/_config.js000066400000000000000000000001621450520414700253410ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles hoisted declarations in deeply nested switch statements' }); rollup-3.29.4/test/form/samples/deep-switch-declarations/_expected.js000066400000000000000000000025721450520414700257040ustar00rootroot00000000000000switch(x){ default: var x=1; switch(x){ default: var x=2; switch(x){ default: var x=3; switch(x){ default: var x=4; switch(x){ default: var x=5; switch(x){ default: var x=6; switch(x){ default: var x=7; switch(x){ default: var x=8; switch(x){ default: var x=9; switch(x){ default: var x=10; switch(x){ default: var x=11; switch(x){ default: var x=12; switch(x){ default: var x=13; switch(x){ default: var x=14; switch(x){ default: var x=15; switch(x){ default: var x=16; switch(x){ default: var x=17; switch(x){ default: var x=18; switch(x){ default: var x=19; switch(x){ default: var x=20; switch(x){ default: var x=21; switch(x){ default: var x=22; switch(x){ default: var x=23; switch(x){ default: var x=24; switch(x){ default: var x=25; switch(x){ default: var x=26; switch(x){ default: var x=27; switch(x){ default: var x=28; switch(x){ default: var x=29; switch(x){ default: var x=30; }}}}}}}}}}}}}}}}}}}}}}}}}}}}}} console.log(x); rollup-3.29.4/test/form/samples/deep-switch-declarations/main.js000066400000000000000000000025711450520414700246670ustar00rootroot00000000000000switch(x){ default: var x=1; switch(x){ default: var x=2; switch(x){ default: var x=3; switch(x){ default: var x=4; switch(x){ default: var x=5; switch(x){ default: var x=6; switch(x){ default: var x=7; switch(x){ default: var x=8; switch(x){ default: var x=9; switch(x){ default: var x=10; switch(x){ default: var x=11; switch(x){ default: var x=12; switch(x){ default: var x=13; switch(x){ default: var x=14; switch(x){ default: var x=15; switch(x){ default: var x=16; switch(x){ default: var x=17; switch(x){ default: var x=18; switch(x){ default: var x=19; switch(x){ default: var x=20; switch(x){ default: var x=21; switch(x){ default: var x=22; switch(x){ default: var x=23; switch(x){ default: var x=24; switch(x){ default: var x=25; switch(x){ default: var x=26; switch(x){ default: var x=27; switch(x){ default: var x=28; switch(x){ default: var x=29; switch(x){ default: var x=30; }}}}}}}}}}}}}}}}}}}}}}}}}}}}}} console.log(x);rollup-3.29.4/test/form/samples/default-export-anonymous-class-extends/000077500000000000000000000000001450520414700262625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/default-export-anonymous-class-extends/_config.js000066400000000000000000000002031450520414700302170ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles default exported classes extending a regular expression argument (#4783)' }); rollup-3.29.4/test/form/samples/default-export-anonymous-class-extends/_expected.js000066400000000000000000000001401450520414700305530ustar00rootroot00000000000000function foo(val) { return val; } class main extends foo(/1/) {} export { main as default }; rollup-3.29.4/test/form/samples/default-export-anonymous-class-extends/main.js000066400000000000000000000001151450520414700275410ustar00rootroot00000000000000function foo(val) { return val; } export default class extends foo(/1/) {} rollup-3.29.4/test/form/samples/default-export-class/000077500000000000000000000000001450520414700225645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/default-export-class/_config.js000066400000000000000000000002631450520414700245270ustar00rootroot00000000000000module.exports = defineTest({ description: 'puts the export after the declaration for default exported classes in SystemJS', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/default-export-class/_expected/000077500000000000000000000000001450520414700245245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/default-export-class/_expected/amd.js000066400000000000000000000001721450520414700256230ustar00rootroot00000000000000define((function () { 'use strict'; class main { constructor() { console.log('class'); } } return main; })); rollup-3.29.4/test/form/samples/default-export-class/_expected/cjs.js000066400000000000000000000001421450520414700256360ustar00rootroot00000000000000'use strict'; class main { constructor() { console.log('class'); } } module.exports = main; rollup-3.29.4/test/form/samples/default-export-class/_expected/es.js000066400000000000000000000001301450520414700254630ustar00rootroot00000000000000class main { constructor() { console.log('class'); } } export { main as default }; rollup-3.29.4/test/form/samples/default-export-class/_expected/iife.js000066400000000000000000000002021450520414700257700ustar00rootroot00000000000000var bundle = (function () { 'use strict'; class main { constructor() { console.log('class'); } } return main; })(); rollup-3.29.4/test/form/samples/default-export-class/_expected/system.js000066400000000000000000000003331450520414700264050ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { class main { constructor() { console.log('class'); } } exports('default', main); }) }; })); rollup-3.29.4/test/form/samples/default-export-class/_expected/umd.js000066400000000000000000000006371450520414700256550ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory()); })(this, (function () { 'use strict'; class main { constructor() { console.log('class'); } } return main; })); rollup-3.29.4/test/form/samples/default-export-class/main.js000066400000000000000000000001051450520414700240420ustar00rootroot00000000000000export default class { constructor() { console.log('class'); } } rollup-3.29.4/test/form/samples/default-export-live-binding/000077500000000000000000000000001450520414700240265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/default-export-live-binding/_config.js000066400000000000000000000002321450520414700257650ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows live bindings for default exports', options: { output: { exports: 'named', name: 'bundle' } } }); rollup-3.29.4/test/form/samples/default-export-live-binding/_expected/000077500000000000000000000000001450520414700257665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/default-export-live-binding/_expected/amd.js000066400000000000000000000003501450520414700270630ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; exports.default = null; const setFoo = value => (exports.default = value); exports.setFoo = setFoo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/default-export-live-binding/_expected/cjs.js000066400000000000000000000002641450520414700271050ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports.default = null; const setFoo = value => (exports.default = value); exports.setFoo = setFoo; rollup-3.29.4/test/form/samples/default-export-live-binding/_expected/es.js000066400000000000000000000001331450520414700267300ustar00rootroot00000000000000let foo = null; const setFoo = value => (foo = value); export { foo as default, setFoo }; rollup-3.29.4/test/form/samples/default-export-live-binding/_expected/iife.js000066400000000000000000000003671450520414700272460ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; exports.default = null; const setFoo = value => (exports.default = value); exports.setFoo = setFoo; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-3.29.4/test/form/samples/default-export-live-binding/_expected/system.js000066400000000000000000000003571450520414700276550ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('default', null); const setFoo = exports('setFoo', value => (exports('default', foo = value))); }) }; })); rollup-3.29.4/test/form/samples/default-export-live-binding/_expected/umd.js000066400000000000000000000010051450520414700271050ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; exports.default = null; const setFoo = value => (exports.default = value); exports.setFoo = setFoo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/default-export-live-binding/main.js000066400000000000000000000001321450520414700253040ustar00rootroot00000000000000let foo = null; const setFoo = value => (foo = value); export { foo as default, setFoo }; rollup-3.29.4/test/form/samples/default-export-mode/000077500000000000000000000000001450520414700224035ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/default-export-mode/_config.js000066400000000000000000000002551450520414700243470ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows specifying the export mode to be "default"', options: { output: { exports: 'default', name: 'bundle' } } }); rollup-3.29.4/test/form/samples/default-export-mode/_expected/000077500000000000000000000000001450520414700243435ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/default-export-mode/_expected/amd.js000066400000000000000000000001121450520414700254340ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/default-export-mode/_expected/cjs.js000066400000000000000000000000661450520414700254620ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/default-export-mode/_expected/es.js000066400000000000000000000000541450520414700253070ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/default-export-mode/_expected/iife.js000066400000000000000000000001221450520414700256100ustar00rootroot00000000000000var bundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-3.29.4/test/form/samples/default-export-mode/_expected/system.js000066400000000000000000000002351450520414700262250ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/default-export-mode/_expected/umd.js000066400000000000000000000005571450520414700254750ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory()); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/default-export-mode/main.js000066400000000000000000000000231450520414700236600ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/form/samples/default-identifier-deshadowing/000077500000000000000000000000001450520414700245545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/default-identifier-deshadowing/_config.js000066400000000000000000000001551450520414700265170ustar00rootroot00000000000000module.exports = defineTest({ description: 'Handles export default identifier reassignment deshadowing' }); rollup-3.29.4/test/form/samples/default-identifier-deshadowing/_expected/000077500000000000000000000000001450520414700265145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/default-identifier-deshadowing/_expected/amd.js000066400000000000000000000001541450520414700276130ustar00rootroot00000000000000define((function () { 'use strict'; function a() { a = someGlobal; return a(); } a(); })); rollup-3.29.4/test/form/samples/default-identifier-deshadowing/_expected/cjs.js000066400000000000000000000001061450520414700276260ustar00rootroot00000000000000'use strict'; function a() { a = someGlobal; return a(); } a(); rollup-3.29.4/test/form/samples/default-identifier-deshadowing/_expected/es.js000066400000000000000000000000671450520414700274640ustar00rootroot00000000000000function a() { a = someGlobal; return a(); } a(); rollup-3.29.4/test/form/samples/default-identifier-deshadowing/_expected/iife.js000066400000000000000000000001501450520414700277620ustar00rootroot00000000000000(function () { 'use strict'; function a() { a = someGlobal; return a(); } a(); })(); rollup-3.29.4/test/form/samples/default-identifier-deshadowing/_expected/system.js000066400000000000000000000003021450520414700303710ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function a() { a = someGlobal; return a(); } a(); }) }; })); rollup-3.29.4/test/form/samples/default-identifier-deshadowing/_expected/umd.js000066400000000000000000000003141450520414700276350ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function a() { a = someGlobal; return a(); } a(); })); rollup-3.29.4/test/form/samples/default-identifier-deshadowing/dep.js000066400000000000000000000001001450520414700256510ustar00rootroot00000000000000export default function a() { a = someGlobal; return a(); } rollup-3.29.4/test/form/samples/default-identifier-deshadowing/main.js000066400000000000000000000000421450520414700260320ustar00rootroot00000000000000import dep from './dep.js'; dep();rollup-3.29.4/test/form/samples/define-es-modules-false/000077500000000000000000000000001450520414700231135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/define-es-modules-false/_config.js000066400000000000000000000002511450520414700250530ustar00rootroot00000000000000module.exports = defineTest({ description: 'Not add __esModule property to exports with esModule: false', options: { output: { name: 'foo', esModule: false } } }); rollup-3.29.4/test/form/samples/define-es-modules-false/_expected/000077500000000000000000000000001450520414700250535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/define-es-modules-false/_expected/amd.js000066400000000000000000000002431450520414700261510ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const make1 = () => {}; const make2 = () => {}; exports.make1 = make1; exports.make2 = make2; })); rollup-3.29.4/test/form/samples/define-es-modules-false/_expected/cjs.js000066400000000000000000000001571450520414700261730ustar00rootroot00000000000000'use strict'; const make1 = () => {}; const make2 = () => {}; exports.make1 = make1; exports.make2 = make2; rollup-3.29.4/test/form/samples/define-es-modules-false/_expected/es.js000066400000000000000000000001131450520414700260130ustar00rootroot00000000000000const make1 = () => {}; const make2 = () => {}; export { make1, make2 }; rollup-3.29.4/test/form/samples/define-es-modules-false/_expected/iife.js000066400000000000000000000002571450520414700263310ustar00rootroot00000000000000var foo = (function (exports) { 'use strict'; const make1 = () => {}; const make2 = () => {}; exports.make1 = make1; exports.make2 = make2; return exports; })({}); rollup-3.29.4/test/form/samples/define-es-modules-false/_expected/system.js000066400000000000000000000003171450520414700267360ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { const make1 = exports('make1', () => {}); const make2 = exports('make2', () => {}); }) }; })); rollup-3.29.4/test/form/samples/define-es-modules-false/_expected/umd.js000066400000000000000000000006751450520414700262060ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foo = {})); })(this, (function (exports) { 'use strict'; const make1 = () => {}; const make2 = () => {}; exports.make1 = make1; exports.make2 = make2; })); rollup-3.29.4/test/form/samples/define-es-modules-false/main.js000066400000000000000000000000771450520414700244010ustar00rootroot00000000000000export const make1 = () => {}; export const make2 = () => {}; rollup-3.29.4/test/form/samples/define-replacement/000077500000000000000000000000001450520414700222455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/define-replacement/_config.js000066400000000000000000000001721450520414700242070ustar00rootroot00000000000000module.exports = defineTest({ description: 'amd.define', options: { output: { amd: { define: 'enifed' } } } }); rollup-3.29.4/test/form/samples/define-replacement/_expected/000077500000000000000000000000001450520414700242055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/define-replacement/_expected/amd.js000066400000000000000000000001671450520414700253100ustar00rootroot00000000000000enifed((function () { 'use strict'; var a = () => { console.log('props'); }; a(); a(); })); rollup-3.29.4/test/form/samples/define-replacement/_expected/cjs.js000066400000000000000000000001071450520414700253200ustar00rootroot00000000000000'use strict'; var a = () => { console.log('props'); }; a(); a(); rollup-3.29.4/test/form/samples/define-replacement/_expected/es.js000066400000000000000000000000701450520414700251470ustar00rootroot00000000000000var a = () => { console.log('props'); }; a(); a(); rollup-3.29.4/test/form/samples/define-replacement/_expected/iife.js000066400000000000000000000001651450520414700254610ustar00rootroot00000000000000(function () { 'use strict'; var a = () => { console.log('props'); }; a(); a(); })(); rollup-3.29.4/test/form/samples/define-replacement/_expected/system.js000066400000000000000000000003571450520414700260740ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var a = () => { console.log('props'); }; a(); a(); }) }; })); rollup-3.29.4/test/form/samples/define-replacement/_expected/umd.js000066400000000000000000000003331450520414700253270ustar00rootroot00000000000000(function (factory) { typeof enifed === 'function' && enifed.amd ? enifed(factory) : factory(); })((function () { 'use strict'; var a = () => { console.log('props'); }; a(); a(); })); rollup-3.29.4/test/form/samples/define-replacement/a.js000066400000000000000000000000631450520414700230220ustar00rootroot00000000000000export var a = () => { console.log('props'); };rollup-3.29.4/test/form/samples/define-replacement/main.js000066400000000000000000000001061450520414700235240ustar00rootroot00000000000000import { a } from "./a.js"; import { a as b } from "./a.js"; a(); b();rollup-3.29.4/test/form/samples/deopt-regexp-type/000077500000000000000000000000001450520414700221005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deopt-regexp-type/_config.js000066400000000000000000000001671450520414700240460ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes typeof for regular expressions to better support es6-sim' }); rollup-3.29.4/test/form/samples/deopt-regexp-type/_expected.js000066400000000000000000000004161450520414700243770ustar00rootroot00000000000000const isCallable = typeof /abc/ === 'function' ? function IsCallableSlow(x) { return typeof x === 'function' && _toString(x) === '[object Function]'; } : function IsCallableFast(x) { return typeof x === 'function'; }; console.log(isCallable(/x/)); rollup-3.29.4/test/form/samples/deopt-regexp-type/main.js000066400000000000000000000004161450520414700233630ustar00rootroot00000000000000const isCallable = typeof /abc/ === 'function' ? function IsCallableSlow(x) { return typeof x === 'function' && _toString(x) === '[object Function]'; } : function IsCallableFast(x) { return typeof x === 'function'; }; console.log(isCallable(/x/)); rollup-3.29.4/test/form/samples/deopt-string-concatenation/000077500000000000000000000000001450520414700237605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deopt-string-concatenation/_config.js000066400000000000000000000002151450520414700257200ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimize concatenation when used as an expression statement to better support es5-shim' }); rollup-3.29.4/test/form/samples/deopt-string-concatenation/_expected.js000066400000000000000000000004111450520414700262520ustar00rootroot00000000000000function parseInt(str, radix) { if (typeof str === 'symbol') { '' + str; } var string = trim(String(str)); var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10); return origParseInt(string, defaultedRadix); } console.log(parseInt('1')); rollup-3.29.4/test/form/samples/deopt-string-concatenation/main.js000066400000000000000000000004111450520414700252360ustar00rootroot00000000000000function parseInt(str, radix) { if (typeof str === 'symbol') { '' + str; } var string = trim(String(str)); var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10); return origParseInt(string, defaultedRadix); } console.log(parseInt('1')); rollup-3.29.4/test/form/samples/deoptimize-superclass/000077500000000000000000000000001450520414700230515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deoptimize-superclass/_config.js000066400000000000000000000001701450520414700250110ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not deoptimize the entire superclass when reassigning a property' }); rollup-3.29.4/test/form/samples/deoptimize-superclass/_expected.js000066400000000000000000000000761450520414700253520ustar00rootroot00000000000000// Everything else should be removed console.log('retained'); rollup-3.29.4/test/form/samples/deoptimize-superclass/main.js000066400000000000000000000002161450520414700243320ustar00rootroot00000000000000class Foo {} Foo.prototype.bar = {}; class Bar extends Foo {} Bar.baz = {}; // Everything else should be removed console.log('retained'); rollup-3.29.4/test/form/samples/deoptimize-var-in-hoisted-scopes/000077500000000000000000000000001450520414700250105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deoptimize-var-in-hoisted-scopes/_config.js000066400000000000000000000001361450520414700267520ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes var variables in hoisted scopes' }); rollup-3.29.4/test/form/samples/deoptimize-var-in-hoisted-scopes/_expected.js000066400000000000000000000003751450520414700273130ustar00rootroot00000000000000const obj1 = { flag: false }; { var foo = obj1; foo.flag = true; } if (obj1.flag) console.log('retained'); const obj2 = { flag: false }; try { throw new Error(); } catch { var foo = obj2; foo.flag = true; } if (obj2.flag) console.log('retained'); rollup-3.29.4/test/form/samples/deoptimize-var-in-hoisted-scopes/main.js000066400000000000000000000003751450520414700262770ustar00rootroot00000000000000const obj1 = { flag: false }; { var foo = obj1; foo.flag = true; } if (obj1.flag) console.log('retained'); const obj2 = { flag: false }; try { throw new Error(); } catch { var foo = obj2; foo.flag = true; } if (obj2.flag) console.log('retained'); rollup-3.29.4/test/form/samples/deprecated/000077500000000000000000000000001450520414700206165ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining-array/000077500000000000000000000000001450520414700264735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining-array/_config.js000066400000000000000000000003761450520414700304430ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports an array with a single entry when inlining dynamic imports', options: { strictDeprecations: false, inlineDynamicImports: true, input: ['main'] }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining-array/_expected.js000066400000000000000000000002221450520414700307650ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); export { bar }; rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining-array/foo.js000066400000000000000000000000251450520414700276110ustar00rootroot00000000000000export const foo = 1;rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining-array/main.js000066400000000000000000000000521450520414700277520ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining/000077500000000000000000000000001450520414700253575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining/_config.js000066400000000000000000000002771450520414700273270ustar00rootroot00000000000000module.exports = defineTest({ description: 'dynamic import inlining', options: { strictDeprecations: false, inlineDynamicImports: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining/_expected.js000066400000000000000000000002221450520414700276510ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); export { bar }; rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining/foo.js000066400000000000000000000000251450520414700264750ustar00rootroot00000000000000export const foo = 1;rollup-3.29.4/test/form/samples/deprecated/dynamic-import-inlining/main.js000066400000000000000000000000521450520414700266360ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/000077500000000000000000000000001450520414700273215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js000066400000000000000000000003271450520414700312650ustar00rootroot00000000000000module.exports = defineTest({ description: 'completely removes tree-shaken dynamic imports ', options: { strictDeprecations: false, inlineDynamicImports: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/000077500000000000000000000000001450520414700312615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/amd.js000066400000000000000000000001011450520414700323500ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/cjs.js000066400000000000000000000000441450520414700323740ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/es.js000066400000000000000000000000251450520414700322230ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/iife.js000066400000000000000000000000741450520414700325340ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/system.js000066400000000000000000000001761450520414700331470ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/umd.js000066400000000000000000000002371450520414700324060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/dynamic.js000066400000000000000000000000611450520414700313000ustar00rootroot00000000000000console.log('dynamic'); export var dynamic = 42; rollup-3.29.4/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/main.js000066400000000000000000000001021450520414700305740ustar00rootroot00000000000000console.log('main'); const getFoo = () => import('./dynamic.js'); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/000077500000000000000000000000001450520414700244215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/000077500000000000000000000000001450520414700272045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/_config.js000066400000000000000000000004641450520414700311520ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not add Symbol.toStringTag property to entry chunks with default export mode', options: { strictDeprecations: false, output: { namespaceToStringTag: true, exports: 'default', name: 'bundle' } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/000077500000000000000000000000001450520414700311445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/amd.js000066400000000000000000000001231450520414700322370ustar00rootroot00000000000000define((function () { 'use strict'; var main = { foo: 42 }; return main; })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/cjs.js000066400000000000000000000000771450520414700322650ustar00rootroot00000000000000'use strict'; var main = { foo: 42 }; module.exports = main; rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/es.js000066400000000000000000000000651450520414700321120ustar00rootroot00000000000000var main = { foo: 42 }; export { main as default }; rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/iife.js000066400000000000000000000001331450520414700324130ustar00rootroot00000000000000var bundle = (function () { 'use strict'; var main = { foo: 42 }; return main; })(); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/system.js000066400000000000000000000002461450520414700330300ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', { foo: 42 }); }) }; })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/_expected/umd.js000066400000000000000000000005701450520414700322710ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory()); })(this, (function () { 'use strict'; var main = { foo: 42 }; return main; })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-default/main.js000066400000000000000000000000341450520414700304630ustar00rootroot00000000000000export default { foo: 42 }; rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/000077500000000000000000000000001450520414700266445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/_config.js000066400000000000000000000004441450520414700306100ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to entry chunks with named exports', options: { strictDeprecations: false, output: { namespaceToStringTag: true, exports: 'named', name: 'bundle' } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/000077500000000000000000000000001450520414700306045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/amd.js000066400000000000000000000002601450520414700317010ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 42; exports.foo = foo; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/cjs.js000066400000000000000000000001751450520414700317240ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const foo = 42; exports.foo = foo; rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/es.js000066400000000000000000000000411450520414700315440ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/iife.js000066400000000000000000000002771450520414700320640ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const foo = 42; exports.foo = foo; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); return exports; })({}); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/system.js000066400000000000000000000002321450520414700324630ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 42); }) }; })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/_expected/umd.js000066400000000000000000000007151450520414700317320ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; const foo = 42; exports.foo = foo; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/entry-named/main.js000066400000000000000000000000271450520414700301250ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/000077500000000000000000000000001450520414700303605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/_config.js000066400000000000000000000013731450520414700323260ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to external namespaces', options: { strictDeprecations: false, external(id) { return id.startsWith('external'); }, output: { namespaceToStringTag: true, globals: { 'external-auto': 'externalAuto', 'external-default': 'externalDefault', 'external-defaultOnly': 'externalDefaultOnly' }, interop(id) { switch (id) { case 'external-auto': { return 'auto'; } case 'external-default': { return 'default'; } case 'external-defaultOnly': { return 'defaultOnly'; } default: { throw new Error(`Unexpected require "${id}"`); } } } } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/000077500000000000000000000000001450520414700323205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/amd.js000066400000000000000000000034761450520414700334310ustar00rootroot00000000000000define(['external-auto', 'external-default', 'external-defaultOnly'], (function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } function _interopNamespaceDefault(e) { var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); assert.strictEqual(externalAuto__namespace.foo, 42); assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); assert.strictEqual(externalDefault__namespace.foo, 42); assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/cjs.js000066400000000000000000000034571450520414700334460ustar00rootroot00000000000000'use strict'; var externalAuto = require('external-auto'); var externalDefault = require('external-default'); var externalDefaultOnly = require('external-defaultOnly'); function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } function _interopNamespaceDefault(e) { var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); assert.strictEqual(externalAuto__namespace.foo, 42); assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); assert.strictEqual(externalDefault__namespace.foo, 42); assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/es.js000066400000000000000000000014201450520414700332620ustar00rootroot00000000000000import * as externalAuto from 'external-auto'; import * as externalDefault from 'external-default'; import * as externalDefaultOnly from 'external-defaultOnly'; assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); assert.strictEqual(externalAuto.foo, 42); assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); assert.strictEqual(externalDefault.foo, 42); assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/iife.js000066400000000000000000000034541450520414700336000ustar00rootroot00000000000000(function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } function _interopNamespaceDefault(e) { var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); assert.strictEqual(externalAuto__namespace.foo, 42); assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); assert.strictEqual(externalDefault__namespace.foo, 42); assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); })(externalAuto, externalDefault, externalDefaultOnly); system.js000066400000000000000000000020231450520414700341200ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expectedSystem.register(['external-auto', 'external-default', 'external-defaultOnly'], (function () { 'use strict'; var externalAuto, externalDefault, externalDefaultOnly; return { setters: [function (module) { externalAuto = module; }, function (module) { externalDefault = module; }, function (module) { externalDefaultOnly = module; }], execute: (function () { assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); assert.strictEqual(externalAuto.foo, 42); assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); assert.strictEqual(externalDefault.foo, 42); assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); }) }; })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/_expected/umd.js000066400000000000000000000043371450520414700334520ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external-auto'), require('external-default'), require('external-defaultOnly')) : typeof define === 'function' && define.amd ? define(['external-auto', 'external-default', 'external-defaultOnly'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.externalAuto, global.externalDefault, global.externalDefaultOnly)); })(this, (function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } function _interopNamespaceDefault(e) { var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); assert.strictEqual(externalAuto__namespace.foo, 42); assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); assert.strictEqual(externalDefault__namespace.foo, 42); assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/external-namespaces/main.js000066400000000000000000000014201450520414700316370ustar00rootroot00000000000000import * as externalAuto from 'external-auto'; import * as externalDefault from 'external-default'; import * as externalDefaultOnly from 'external-defaultOnly'; assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); assert.strictEqual(externalAuto.foo, 42); assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); assert.strictEqual(externalDefault.foo, 42); assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/000077500000000000000000000000001450520414700277755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_config.js000066400000000000000000000003571450520414700317440ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to inlined namespaces', options: { strictDeprecations: false, output: { namespaceToStringTag: true } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/000077500000000000000000000000001450520414700317355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/amd.js000066400000000000000000000005711450520414700330370ustar00rootroot00000000000000define((function () { 'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/cjs.js000066400000000000000000000005251450520414700330540ustar00rootroot00000000000000'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/es.js000066400000000000000000000005061450520414700327030ustar00rootroot00000000000000const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/iife.js000066400000000000000000000005641450520414700332140ustar00rootroot00000000000000(function () { 'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); })(); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/system.js000066400000000000000000000007041450520414700336200ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); }) }; })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_expected/umd.js000066400000000000000000000007271450520414700330660ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); })); rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/foo.js000066400000000000000000000000271450520414700311150ustar00rootroot00000000000000export const bar = 42; rollup-3.29.4/test/form/samples/deprecated/namespace-tostring/inlined-namespace/main.js000066400000000000000000000003031450520414700312530ustar00rootroot00000000000000import * as foo from './foo'; assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(foo.bar, 42); rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/000077500000000000000000000000001450520414700264525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js000066400000000000000000000003451450520414700304160ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts variables when nested dynamic imports are inlined', options: { strictDeprecations: false, inlineDynamicImports: true }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/000077500000000000000000000000001450520414700304125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/amd.js000066400000000000000000000004611450520414700315120ustar00rootroot00000000000000define((function () { 'use strict'; async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); })); rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/cjs.js000066400000000000000000000004121450520414700315240ustar00rootroot00000000000000'use strict'; async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/es.js000066400000000000000000000003731450520414700313620ustar00rootroot00000000000000async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/iife.js000066400000000000000000000004541450520414700316670ustar00rootroot00000000000000(function () { 'use strict'; async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); })(); rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/system.js000066400000000000000000000006021450520414700322720ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); }) }; })); rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/umd.js000066400000000000000000000006171450520414700315410ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); })); rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/foo.js000066400000000000000000000000311450520414700275650ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/form/samples/deprecated/nested-inlined-dynamic-import/main.js000066400000000000000000000001671450520414700277400ustar00rootroot00000000000000async function main() { const foo = 1; const ns = await import('./foo.js'); console.log(ns.value + foo); } main(); rollup-3.29.4/test/form/samples/deprecated/prefer-const/000077500000000000000000000000001450520414700232255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/prefer-const/_config.js000066400000000000000000000004511450520414700251670ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses const instead of var if specified (#653)', options: { strictDeprecations: false, external: ['other'], output: { globals: { other: 'other' }, name: 'myBundle', preferConst: true } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/deprecated/prefer-const/_expected/000077500000000000000000000000001450520414700251655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/deprecated/prefer-const/_expected/amd.js000066400000000000000000000004301450520414700262610ustar00rootroot00000000000000define(['other'], (function (other) { 'use strict'; const a = 1; const b = 2; const namespace = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); console.log( Object.keys( namespace ) ); console.log( other.name ); const main = 42; return main; })); rollup-3.29.4/test/form/samples/deprecated/prefer-const/_expected/cjs.js000066400000000000000000000004141450520414700263010ustar00rootroot00000000000000'use strict'; const other = require('other'); const a = 1; const b = 2; const namespace = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); console.log( Object.keys( namespace ) ); console.log( other.name ); const main = 42; module.exports = main; rollup-3.29.4/test/form/samples/deprecated/prefer-const/_expected/es.js000066400000000000000000000003721450520414700261340ustar00rootroot00000000000000import { name } from 'other'; const a = 1; const b = 2; const namespace = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); console.log( Object.keys( namespace ) ); console.log( name ); const main = 42; export { main as default }; rollup-3.29.4/test/form/samples/deprecated/prefer-const/_expected/iife.js000066400000000000000000000004341450520414700264400ustar00rootroot00000000000000var myBundle = (function (other) { 'use strict'; const a = 1; const b = 2; const namespace = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); console.log( Object.keys( namespace ) ); console.log( other.name ); const main = 42; return main; })(other); rollup-3.29.4/test/form/samples/deprecated/prefer-const/_expected/system.js000066400000000000000000000006701450520414700270520ustar00rootroot00000000000000System.register('myBundle', ['other'], (function (exports) { 'use strict'; var name; return { setters: [function (module) { name = module.name; }], execute: (function () { const a = 1; const b = 2; const namespace = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); console.log( Object.keys( namespace ) ); console.log( name ); const main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/deprecated/prefer-const/_expected/umd.js000066400000000000000000000011331450520414700263060ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('other')) : typeof define === 'function' && define.amd ? define(['other'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory(global.other)); })(this, (function (other) { 'use strict'; const a = 1; const b = 2; const namespace = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); console.log( Object.keys( namespace ) ); console.log( other.name ); const main = 42; return main; })); rollup-3.29.4/test/form/samples/deprecated/prefer-const/main.js000066400000000000000000000002361450520414700245100ustar00rootroot00000000000000import { name } from 'other'; import * as namespace from './namespace.js'; console.log( Object.keys( namespace ) ); console.log( name ); export default 42; rollup-3.29.4/test/form/samples/deprecated/prefer-const/namespace.js000066400000000000000000000000501450520414700255120ustar00rootroot00000000000000export const a = 1; export const b = 2; rollup-3.29.4/test/form/samples/duplicated-var-declarations/000077500000000000000000000000001450520414700240705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/duplicated-var-declarations/_config.js000066400000000000000000000001451450520414700260320ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not remove duplicated var declarations (#716)' }); rollup-3.29.4/test/form/samples/duplicated-var-declarations/_expected/000077500000000000000000000000001450520414700260305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/duplicated-var-declarations/_expected/amd.js000066400000000000000000000003161450520414700271270ustar00rootroot00000000000000define((function () { 'use strict'; var a = 1, b = 2; assert.equal( a, 1 ); assert.equal( b, 2 ); var a = 3, b = 4, c = 5; assert.equal( a, 3 ); assert.equal( b, 4 ); assert.equal( c, 5 ); })); rollup-3.29.4/test/form/samples/duplicated-var-declarations/_expected/cjs.js000066400000000000000000000002531450520414700271450ustar00rootroot00000000000000'use strict'; var a = 1, b = 2; assert.equal( a, 1 ); assert.equal( b, 2 ); var a = 3, b = 4, c = 5; assert.equal( a, 3 ); assert.equal( b, 4 ); assert.equal( c, 5 ); rollup-3.29.4/test/form/samples/duplicated-var-declarations/_expected/es.js000066400000000000000000000002341450520414700267740ustar00rootroot00000000000000var a = 1, b = 2; assert.equal( a, 1 ); assert.equal( b, 2 ); var a = 3, b = 4, c = 5; assert.equal( a, 3 ); assert.equal( b, 4 ); assert.equal( c, 5 ); rollup-3.29.4/test/form/samples/duplicated-var-declarations/_expected/iife.js000066400000000000000000000003111450520414700272750ustar00rootroot00000000000000(function () { 'use strict'; var a = 1, b = 2; assert.equal( a, 1 ); assert.equal( b, 2 ); var a = 3, b = 4, c = 5; assert.equal( a, 3 ); assert.equal( b, 4 ); assert.equal( c, 5 ); })(); rollup-3.29.4/test/form/samples/duplicated-var-declarations/_expected/system.js000066400000000000000000000004271450520414700277150ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var a = 1, b = 2; assert.equal( a, 1 ); assert.equal( b, 2 ); var a = 3, b = 4, c = 5; assert.equal( a, 3 ); assert.equal( b, 4 ); assert.equal( c, 5 ); }) }; })); rollup-3.29.4/test/form/samples/duplicated-var-declarations/_expected/umd.js000066400000000000000000000004541450520414700271560ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var a = 1, b = 2; assert.equal( a, 1 ); assert.equal( b, 2 ); var a = 3, b = 4, c = 5; assert.equal( a, 3 ); assert.equal( b, 4 ); assert.equal( c, 5 ); })); rollup-3.29.4/test/form/samples/duplicated-var-declarations/main.js000066400000000000000000000002341450520414700253510ustar00rootroot00000000000000var a = 1, b = 2; assert.equal( a, 1 ); assert.equal( b, 2 ); var a = 3, b = 4, c = 5; assert.equal( a, 3 ); assert.equal( b, 4 ); assert.equal( c, 5 ); rollup-3.29.4/test/form/samples/dynamic-import-inlining-array/000077500000000000000000000000001450520414700243735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dynamic-import-inlining-array/_config.js000066400000000000000000000003021450520414700263300ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports an array with a single entry when inlining dynamic imports', options: { output: { inlineDynamicImports: true }, input: ['main'] } }); rollup-3.29.4/test/form/samples/dynamic-import-inlining-array/_expected.js000066400000000000000000000002221450520414700266650ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); export { bar }; rollup-3.29.4/test/form/samples/dynamic-import-inlining-array/foo.js000066400000000000000000000000251450520414700255110ustar00rootroot00000000000000export const foo = 1;rollup-3.29.4/test/form/samples/dynamic-import-inlining-array/main.js000066400000000000000000000000521450520414700256520ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-3.29.4/test/form/samples/dynamic-import-inlining/000077500000000000000000000000001450520414700232575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dynamic-import-inlining/_config.js000066400000000000000000000002031450520414700252140ustar00rootroot00000000000000module.exports = defineTest({ description: 'dynamic import inlining', options: { output: { inlineDynamicImports: true } } }); rollup-3.29.4/test/form/samples/dynamic-import-inlining/_expected.js000066400000000000000000000002221450520414700255510ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo; }); var foo = /*#__PURE__*/Object.freeze({ __proto__: null }); export { bar }; rollup-3.29.4/test/form/samples/dynamic-import-inlining/foo.js000066400000000000000000000000251450520414700243750ustar00rootroot00000000000000export const foo = 1;rollup-3.29.4/test/form/samples/dynamic-import-inlining/main.js000066400000000000000000000000521450520414700245360ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/000077500000000000000000000000001450520414700235475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/_config.js000066400000000000000000000004211450520414700255060ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses correct "this" in dynamic imports when using arrow functions', options: { external: ['input', 'output'], output: { generatedCode: { arrowFunctions: true }, name: 'bundle', dynamicImportInCjs: false } } }); rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/_expected/000077500000000000000000000000001450520414700255075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/_expected/amd.js000066400000000000000000000014061450520414700266070ustar00rootroot00000000000000define(['require', 'exports', 'input'], (function (require, exports, input) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return new Promise((resolve, reject) => require([this.outputPath], m => resolve(/*#__PURE__*/_interopNamespaceDefault(m)), reject)); } } const promise = new Importer().getImport(); exports.promise = promise; })); rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/_expected/cjs.js000066400000000000000000000012301450520414700266200ustar00rootroot00000000000000'use strict'; var input = require('input'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return Promise.resolve().then(() => /*#__PURE__*/_interopNamespaceDefault(require(this.outputPath))); } } const promise = new Importer().getImport(); exports.promise = promise; rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/_expected/es.js000066400000000000000000000003431450520414700264540ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } const promise = new Importer().getImport(); export { promise }; rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/_expected/iife.js000066400000000000000000000004611450520414700267620ustar00rootroot00000000000000var bundle = (function (exports, input) { 'use strict'; class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return import(this.outputPath); } } const promise = new Importer().getImport(); exports.promise = promise; return exports; })({}, input); rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/_expected/system.js000066400000000000000000000006671450520414700274020ustar00rootroot00000000000000System.register('bundle', ['input'], (function (exports, module) { 'use strict'; var outputPath; return { setters: [module => { outputPath = module.outputPath; }], execute: (function () { class Importer { constructor() { this.outputPath = outputPath; } getImport() { return module.import(this.outputPath); } } const promise = exports('promise', new Importer().getImport()); }) }; })); rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/_expected/umd.js000066400000000000000000000011411450520414700266270ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('input')) : typeof define === 'function' && define.amd ? define(['exports', 'input'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.input)); })(this, (function (exports, input) { 'use strict'; class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return import(this.outputPath); } } const promise = new Importer().getImport(); exports.promise = promise; })); rollup-3.29.4/test/form/samples/dynamic-import-this-arrow/main.js000066400000000000000000000003251450520414700250310ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } export const promise = new Importer().getImport(); rollup-3.29.4/test/form/samples/dynamic-import-this-function/000077500000000000000000000000001450520414700242425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dynamic-import-this-function/_config.js000066400000000000000000000004261450520414700262060ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses correct "this" in dynamic imports when not using arrow functions', options: { external: ['input', 'output'], output: { generatedCode: { arrowFunctions: false }, name: 'bundle', dynamicImportInCjs: false } } }); rollup-3.29.4/test/form/samples/dynamic-import-this-function/_expected/000077500000000000000000000000001450520414700262025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dynamic-import-this-function/_expected/amd.js000066400000000000000000000015261450520414700273050ustar00rootroot00000000000000define(['require', 'exports', 'input'], (function (require, exports, input) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })(this.outputPath); } } const promise = new Importer().getImport(); exports.promise = promise; })); rollup-3.29.4/test/form/samples/dynamic-import-this-function/_expected/cjs.js000066400000000000000000000013421450520414700273170ustar00rootroot00000000000000'use strict'; var input = require('input'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefault(require(t)); }); })(this.outputPath); } } const promise = new Importer().getImport(); exports.promise = promise; rollup-3.29.4/test/form/samples/dynamic-import-this-function/_expected/es.js000066400000000000000000000003431450520414700271470ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } const promise = new Importer().getImport(); export { promise }; rollup-3.29.4/test/form/samples/dynamic-import-this-function/_expected/iife.js000066400000000000000000000004611450520414700274550ustar00rootroot00000000000000var bundle = (function (exports, input) { 'use strict'; class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return import(this.outputPath); } } const promise = new Importer().getImport(); exports.promise = promise; return exports; })({}, input); rollup-3.29.4/test/form/samples/dynamic-import-this-function/_expected/system.js000066400000000000000000000006771450520414700300760ustar00rootroot00000000000000System.register('bundle', ['input'], (function (exports, module) { 'use strict'; var outputPath; return { setters: [function (module) { outputPath = module.outputPath; }], execute: (function () { class Importer { constructor() { this.outputPath = outputPath; } getImport() { return module.import(this.outputPath); } } const promise = exports('promise', new Importer().getImport()); }) }; })); rollup-3.29.4/test/form/samples/dynamic-import-this-function/_expected/umd.js000066400000000000000000000011411450520414700273220ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('input')) : typeof define === 'function' && define.amd ? define(['exports', 'input'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.input)); })(this, (function (exports, input) { 'use strict'; class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return import(this.outputPath); } } const promise = new Importer().getImport(); exports.promise = promise; })); rollup-3.29.4/test/form/samples/dynamic-import-this-function/main.js000066400000000000000000000003251450520414700255240ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } export const promise = new Importer().getImport(); rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/000077500000000000000000000000001450520414700241515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/_config.js000066400000000000000000000012701450520414700261130ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Returns the raw AST nodes for unresolvable dynamic imports', options: { plugins: [ { name: 'test', resolveDynamicImport(specifier) { if (specifier === './seven.js') { return false; } assert.ok(specifier); if (typeof specifier !== 'object') { throw new TypeError(`Unexpected specifier type ${typeof specifier}.`); } if (specifier.type === 'Literal') { return "'./seven.js'"; } if (specifier.type !== 'TemplateLiteral') { throw new Error(`Unexpected specifier type ${specifier.type}.`); } return false; } } ] } }); rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/_expected/000077500000000000000000000000001450520414700261115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/_expected/amd.js000066400000000000000000000022021450520414700272040ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })(`${globalThis.unknown}`); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })(`My ${globalThis.unknown}`); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })('./seven.js'); new Promise(function (resolve, reject) { require(['./seven'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })); rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/_expected/cjs.js000066400000000000000000000002001450520414700272160ustar00rootroot00000000000000'use strict'; import(`${globalThis.unknown}`); import(`My ${globalThis.unknown}`); import('./seven.js'); import('./seven.js'); rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/_expected/es.js000066400000000000000000000001611450520414700270540ustar00rootroot00000000000000import(`${globalThis.unknown}`); import(`My ${globalThis.unknown}`); import('./seven.js'); import('./seven.js'); rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/_expected/iife.js000066400000000000000000000002331450520414700273610ustar00rootroot00000000000000(function () { 'use strict'; import(`${globalThis.unknown}`); import(`My ${globalThis.unknown}`); import('./seven.js'); import('./seven.js'); })(); rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/_expected/system.js000066400000000000000000000004161450520414700277740ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import(`${globalThis.unknown}`); module.import(`My ${globalThis.unknown}`); module.import('./seven.js'); module.import('./seven.js'); }) }; })); rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/_expected/umd.js000066400000000000000000000003761450520414700272420ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; import(`${globalThis.unknown}`); import(`My ${globalThis.unknown}`); import('./seven.js'); import('./seven.js'); })); rollup-3.29.4/test/form/samples/dynamic-import-unresolvable/main.js000066400000000000000000000001461450520414700254340ustar00rootroot00000000000000import(`${globalThis.unknown}`); import(`My ${globalThis.unknown}`); import(7); import('./seven.js'); rollup-3.29.4/test/form/samples/dynamic-resolvable-if-statements/000077500000000000000000000000001450520414700250575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/dynamic-resolvable-if-statements/_config.js000066400000000000000000000001411450520414700270150ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows using variables to resolve conditionals' }); rollup-3.29.4/test/form/samples/dynamic-resolvable-if-statements/_expected.js000066400000000000000000000003301450520414700273510ustar00rootroot00000000000000{ console.log('retained'); } { console.log('retained'); } { console.log('retained'); } { console.log('retained'); } { console.log('retained'); } { console.log('retained'); } { console.log('retained'); } rollup-3.29.4/test/form/samples/dynamic-resolvable-if-statements/main.js000066400000000000000000000015021450520414700263370ustar00rootroot00000000000000const value = 1; if (value > 0) { console.log('retained'); } else { console.log('removed'); } const USE_FOURTH = 'use-fourth'; const values = { useFirst: true, useSecond: false, "use-third": true, [USE_FOURTH]: true }; if (values.useFirst) { console.log('retained'); } else { console.log('removed'); } if (values['use-third']) { console.log('retained'); } else { console.log('removed'); } if (values[USE_FOURTH]) { console.log('retained'); } else { console.log('removed'); } if ((values.useSecond || values).useFirst) { console.log('retained'); } else { console.log('removed'); } if ((values.useSecond ? {useFirst: false} : values).useFirst) { console.log('retained'); } else { console.log('removed'); } if (({useFirst: false}, values).useFirst) { console.log('retained'); } else { console.log('removed'); } rollup-3.29.4/test/form/samples/early-bind-member-expressions/000077500000000000000000000000001450520414700243715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/early-bind-member-expressions/_config.js000066400000000000000000000002271450520414700263340ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly resolves namespace members when accessed early (#2895)', options: { external: 'external' } }); rollup-3.29.4/test/form/samples/early-bind-member-expressions/_expected.js000066400000000000000000000000571450520414700266710ustar00rootroot00000000000000import * as stuff from 'external'; stuff.y(); rollup-3.29.4/test/form/samples/early-bind-member-expressions/main.js000066400000000000000000000000721450520414700256520ustar00rootroot00000000000000import * as stuff from 'external' const {x} = stuff.y(); rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/000077500000000000000000000000001450520414700251255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/_config.js000066400000000000000000000001311450520414700270620ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes effects in for-of loop (#870)' }); rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/_expected/000077500000000000000000000000001450520414700270655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/_expected/amd.js000066400000000000000000000006061450520414700301660ustar00rootroot00000000000000define((function () { 'use strict'; const items = { children: [ {}, {}, {} ] }; function a () { for ( const item of items.children ) { item.foo = 'a'; } } a(); function c () { let item; for ( item of items.children ) { item.bar = 'c'; } } c(); assert.deepEqual( items, [ { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' } ] ); })); rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/_expected/cjs.js000066400000000000000000000005271450520414700302060ustar00rootroot00000000000000'use strict'; const items = { children: [ {}, {}, {} ] }; function a () { for ( const item of items.children ) { item.foo = 'a'; } } a(); function c () { let item; for ( item of items.children ) { item.bar = 'c'; } } c(); assert.deepEqual( items, [ { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' } ] ); rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/_expected/es.js000066400000000000000000000005101450520414700300260ustar00rootroot00000000000000const items = { children: [ {}, {}, {} ] }; function a () { for ( const item of items.children ) { item.foo = 'a'; } } a(); function c () { let item; for ( item of items.children ) { item.bar = 'c'; } } c(); assert.deepEqual( items, [ { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' } ] ); rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/_expected/iife.js000066400000000000000000000006011450520414700303340ustar00rootroot00000000000000(function () { 'use strict'; const items = { children: [ {}, {}, {} ] }; function a () { for ( const item of items.children ) { item.foo = 'a'; } } a(); function c () { let item; for ( item of items.children ) { item.bar = 'c'; } } c(); assert.deepEqual( items, [ { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' } ] ); })(); rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/_expected/system.js000066400000000000000000000007471450520414700307570ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const items = { children: [ {}, {}, {} ] }; function a () { for ( const item of items.children ) { item.foo = 'a'; } } a(); function c () { let item; for ( item of items.children ) { item.bar = 'c'; } } c(); assert.deepEqual( items, [ { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' } ] ); }) }; })); rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/_expected/umd.js000066400000000000000000000007441450520414700302150ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const items = { children: [ {}, {}, {} ] }; function a () { for ( const item of items.children ) { item.foo = 'a'; } } a(); function c () { let item; for ( item of items.children ) { item.bar = 'c'; } } c(); assert.deepEqual( items, [ { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' } ] ); })); rollup-3.29.4/test/form/samples/effect-in-for-of-loop-in-functions/main.js000066400000000000000000000005101450520414700264030ustar00rootroot00000000000000const items = { children: [ {}, {}, {} ] }; function a () { for ( const item of items.children ) { item.foo = 'a'; } } a(); function c () { let item; for ( item of items.children ) { item.bar = 'c'; } } c(); assert.deepEqual( items, [ { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' }, { foo: 'a', bar: 'c' } ] ); rollup-3.29.4/test/form/samples/effect-in-for-of-loop/000077500000000000000000000000001450520414700225135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/effect-in-for-of-loop/_config.js000066400000000000000000000001311450520414700244500ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes effects in for-of loop (#870)' }); rollup-3.29.4/test/form/samples/effect-in-for-of-loop/_expected/000077500000000000000000000000001450520414700244535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/effect-in-for-of-loop/_expected/amd.js000066400000000000000000000005461450520414700255570ustar00rootroot00000000000000define((function () { 'use strict'; const items = [{}, {}, {}]; for ( const a of items ) { a.foo = 'a'; } let c; for ( c of items ) { c.bar = 'c'; } for ( e of items ) { e.baz = 'e'; } var e; assert.deepEqual( items, [ { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' } ]); })); rollup-3.29.4/test/form/samples/effect-in-for-of-loop/_expected/cjs.js000066400000000000000000000004711450520414700255720ustar00rootroot00000000000000'use strict'; const items = [{}, {}, {}]; for ( const a of items ) { a.foo = 'a'; } let c; for ( c of items ) { c.bar = 'c'; } for ( e of items ) { e.baz = 'e'; } var e; assert.deepEqual( items, [ { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' } ]); rollup-3.29.4/test/form/samples/effect-in-for-of-loop/_expected/es.js000066400000000000000000000004521450520414700254210ustar00rootroot00000000000000const items = [{}, {}, {}]; for ( const a of items ) { a.foo = 'a'; } let c; for ( c of items ) { c.bar = 'c'; } for ( e of items ) { e.baz = 'e'; } var e; assert.deepEqual( items, [ { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' } ]); rollup-3.29.4/test/form/samples/effect-in-for-of-loop/_expected/iife.js000066400000000000000000000005411450520414700257250ustar00rootroot00000000000000(function () { 'use strict'; const items = [{}, {}, {}]; for ( const a of items ) { a.foo = 'a'; } let c; for ( c of items ) { c.bar = 'c'; } for ( e of items ) { e.baz = 'e'; } var e; assert.deepEqual( items, [ { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' } ]); })(); rollup-3.29.4/test/form/samples/effect-in-for-of-loop/_expected/system.js000066400000000000000000000007031450520414700263350ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const items = [{}, {}, {}]; for ( const a of items ) { a.foo = 'a'; } let c; for ( c of items ) { c.bar = 'c'; } for ( e of items ) { e.baz = 'e'; } var e; assert.deepEqual( items, [ { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' } ]); }) }; })); rollup-3.29.4/test/form/samples/effect-in-for-of-loop/_expected/umd.js000066400000000000000000000007041450520414700255770ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const items = [{}, {}, {}]; for ( const a of items ) { a.foo = 'a'; } let c; for ( c of items ) { c.bar = 'c'; } for ( e of items ) { e.baz = 'e'; } var e; assert.deepEqual( items, [ { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' } ]); })); rollup-3.29.4/test/form/samples/effect-in-for-of-loop/main.js000066400000000000000000000004521450520414700237760ustar00rootroot00000000000000const items = [{}, {}, {}]; for ( const a of items ) { a.foo = 'a'; } let c; for ( c of items ) { c.bar = 'c'; } for ( e of items ) { e.baz = 'e'; } var e; assert.deepEqual( items, [ { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' }, { foo: 'a', bar: 'c', baz: 'e' } ]); rollup-3.29.4/test/form/samples/emit-asset-file/000077500000000000000000000000001450520414700215065ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/emit-asset-file/_config.js000066400000000000000000000023661450520414700234570ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync } = require('node:fs'); const path = require('node:path'); module.exports = defineTest({ description: 'supports emitting assets from plugin hooks', options: { plugins: { name: 'test', resolveId(id, importee) { if (id.endsWith('.svg')) { return path.resolve(path.dirname(importee), id); } }, load(id) { if (id.endsWith('.svg')) { return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'asset', name: path.basename(id), source: readFileSync(id) })};`; } }, generateBundle(options, outputBundle) { const keys = Object.keys(outputBundle); assert.strictEqual(keys.length, 2); assert.strictEqual(keys[0], 'assets/logo-a2a2cdc4.svg'); const asset = outputBundle[keys[0]]; assert.strictEqual(asset.fileName, 'assets/logo-a2a2cdc4.svg'); if (asset.type !== 'asset') { throw new Error(`Unexpected asset type ${asset.type}.`); } /** @type {any} */ const source = asset.source; assert.ok( source.equals(readFileSync(path.resolve(__dirname, 'logo.svg'))), 'asset has correct source' ); assert.ok(keys[1].endsWith('.js'), `${keys[1]} ends with ".js"`); } } } }); rollup-3.29.4/test/form/samples/emit-asset-file/_expected/000077500000000000000000000000001450520414700234465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/emit-asset-file/_expected/amd.js000066400000000000000000000005641450520414700245520ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; var logo = new URL(require.toUrl('./assets/logo-a2a2cdc4.svg'), document.baseURI).href; function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); })); rollup-3.29.4/test/form/samples/emit-asset-file/_expected/assets/000077500000000000000000000000001450520414700247505ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/emit-asset-file/_expected/assets/logo-a2a2cdc4.svg000066400000000000000000000064331450520414700277200ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/emit-asset-file/_expected/cjs.js000066400000000000000000000007271450520414700245710ustar00rootroot00000000000000'use strict'; var logo = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/logo-a2a2cdc4.svg').href : new URL('assets/logo-a2a2cdc4.svg', document.currentScript && document.currentScript.src || document.baseURI).href); function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); rollup-3.29.4/test/form/samples/emit-asset-file/_expected/es.js000066400000000000000000000004311450520414700244110ustar00rootroot00000000000000var logo = new URL('assets/logo-a2a2cdc4.svg', import.meta.url).href; function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); rollup-3.29.4/test/form/samples/emit-asset-file/_expected/iife.js000066400000000000000000000006021450520414700247160ustar00rootroot00000000000000(function () { 'use strict'; var logo = new URL('assets/logo-a2a2cdc4.svg', document.currentScript && document.currentScript.src || document.baseURI).href; function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); })(); rollup-3.29.4/test/form/samples/emit-asset-file/_expected/system.js000066400000000000000000000006541450520414700253350ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var logo = new URL('assets/logo-a2a2cdc4.svg', module.meta.url).href; function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); }) }; })); rollup-3.29.4/test/form/samples/emit-asset-file/_expected/umd.js000066400000000000000000000012601450520414700245700ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var logo = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/logo-a2a2cdc4.svg').href : new URL('assets/logo-a2a2cdc4.svg', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); })); rollup-3.29.4/test/form/samples/emit-asset-file/index-amd.html000066400000000000000000000003361450520414700242440ustar00rootroot00000000000000 AMD rollup-3.29.4/test/form/samples/emit-asset-file/index-cjs.html000066400000000000000000000002511450520414700242560ustar00rootroot00000000000000 CommonJS rollup-3.29.4/test/form/samples/emit-asset-file/index-es.html000066400000000000000000000002671450520414700241150ustar00rootroot00000000000000 ES Module rollup-3.29.4/test/form/samples/emit-asset-file/index-iife.html000066400000000000000000000002461450520414700244170ustar00rootroot00000000000000 IIFE rollup-3.29.4/test/form/samples/emit-asset-file/index-system.html000066400000000000000000000004011450520414700250200ustar00rootroot00000000000000 SystemJS rollup-3.29.4/test/form/samples/emit-asset-file/index-umd-amd.html000066400000000000000000000003441450520414700250260ustar00rootroot00000000000000 UMD (AMD) rollup-3.29.4/test/form/samples/emit-asset-file/index-umd-iife-queryparam.html000066400000000000000000000003041450520414700273610ustar00rootroot00000000000000 UMD (IIFE) + query parameter rollup-3.29.4/test/form/samples/emit-asset-file/index-umd-iife.html000066400000000000000000000002531450520414700252000ustar00rootroot00000000000000 UMD (IIFE) rollup-3.29.4/test/form/samples/emit-asset-file/logo.svg000066400000000000000000000064331450520414700231750ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/emit-asset-file/main.js000066400000000000000000000003621450520414700227710ustar00rootroot00000000000000import logo from './logo.svg'; function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } showImage(logo); rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/000077500000000000000000000000001450520414700240345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_config.js000066400000000000000000000011261450520414700257760ustar00rootroot00000000000000const { readFileSync } = require('node:fs'); const path = require('node:path'); module.exports = defineTest({ description: 'does not include format globals when tree-shaking an asset access', options: { plugins: { name: 'test', resolveId(id, importee) { if (id.endsWith('.svg')) { return path.resolve(path.dirname(importee), id); } }, load(id) { if (id.endsWith('.svg')) { return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'asset', name: path.basename(id), source: readFileSync(id) })};`; } } } } }); rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_expected/000077500000000000000000000000001450520414700257745ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_expected/amd.js000066400000000000000000000001011450520414700270630ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_expected/assets/000077500000000000000000000000001450520414700272765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_expected/assets/logo-a2a2cdc4.svg000066400000000000000000000064331450520414700322460ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_expected/cjs.js000066400000000000000000000000441450520414700271070ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_expected/es.js000066400000000000000000000000251450520414700267360ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_expected/iife.js000066400000000000000000000000741450520414700272470ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_expected/system.js000066400000000000000000000001761450520414700276620ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/_expected/umd.js000066400000000000000000000002371450520414700271210ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/logo.svg000066400000000000000000000064331450520414700255230ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/emit-file-tree-shaken-access/main.js000066400000000000000000000001301450520414700253100ustar00rootroot00000000000000import logo from './logo.svg'; if (false) { console.log(logo); } console.log('main'); rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/000077500000000000000000000000001450520414700234415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_config.js000066400000000000000000000011271450520414700254040ustar00rootroot00000000000000const Buffer = global.Buffer; module.exports = defineTest({ description: 'supports emitting assets as Uint8Arrays when Buffer is not available', before() { delete global.Buffer; }, after() { global.Buffer = Buffer; }, options: { plugins: { name: 'test', resolveId(id) { if (id.startsWith('asset')) { return id; } }, load(id) { if (id.startsWith('asset')) { return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'asset', source: Uint8Array.from([...id].map(char => char.charCodeAt(0))) })};`; } } } } }); rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/000077500000000000000000000000001450520414700254015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/amd.js000066400000000000000000000005621450520414700265030ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; var asset1 = new URL(require.toUrl('./assets/asset-8e3dd2ea'), document.baseURI).href; var asset2 = new URL(require.toUrl('./assets/asset-75590fc1'), document.baseURI).href; var asset99 = new URL(require.toUrl('./assets/asset-60cc5dc9'), document.baseURI).href; console.log(asset1, asset2, asset99); })); rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/assets/000077500000000000000000000000001450520414700267035ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-60cc5dc9000066400000000000000000000000071450520414700311600ustar00rootroot00000000000000asset99rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-75590fc1000066400000000000000000000000061450520414700310220ustar00rootroot00000000000000asset2rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-8e3dd2ea000066400000000000000000000000061450520414700312360ustar00rootroot00000000000000asset1rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/cjs.js000066400000000000000000000014141450520414700265160ustar00rootroot00000000000000'use strict'; var asset1 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-8e3dd2ea').href : new URL('assets/asset-8e3dd2ea', document.currentScript && document.currentScript.src || document.baseURI).href); var asset2 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-75590fc1').href : new URL('assets/asset-75590fc1', document.currentScript && document.currentScript.src || document.baseURI).href); var asset99 = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-60cc5dc9').href : new URL('assets/asset-60cc5dc9', document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset99); rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/es.js000066400000000000000000000003711450520414700263470ustar00rootroot00000000000000var asset1 = new URL('assets/asset-8e3dd2ea', import.meta.url).href; var asset2 = new URL('assets/asset-75590fc1', import.meta.url).href; var asset99 = new URL('assets/asset-60cc5dc9', import.meta.url).href; console.log(asset1, asset2, asset99); rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/iife.js000066400000000000000000000007161450520414700266570ustar00rootroot00000000000000(function () { 'use strict'; var asset1 = new URL('assets/asset-8e3dd2ea', document.currentScript && document.currentScript.src || document.baseURI).href; var asset2 = new URL('assets/asset-75590fc1', document.currentScript && document.currentScript.src || document.baseURI).href; var asset99 = new URL('assets/asset-60cc5dc9', document.currentScript && document.currentScript.src || document.baseURI).href; console.log(asset1, asset2, asset99); })(); rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/system.js000066400000000000000000000005721450520414700272670ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var asset1 = new URL('assets/asset-8e3dd2ea', module.meta.url).href; var asset2 = new URL('assets/asset-75590fc1', module.meta.url).href; var asset99 = new URL('assets/asset-60cc5dc9', module.meta.url).href; console.log(asset1, asset2, asset99); }) }; })); rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/_expected/umd.js000066400000000000000000000022111450520414700265200ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var asset1 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-8e3dd2ea').href : new URL('assets/asset-8e3dd2ea', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); var asset2 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-75590fc1').href : new URL('assets/asset-75590fc1', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); var asset99 = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__dirname + '/assets/asset-60cc5dc9').href : new URL('assets/asset-60cc5dc9', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset99); })); rollup-3.29.4/test/form/samples/emit-uint8array-no-buffer/main.js000066400000000000000000000002001450520414700247130ustar00rootroot00000000000000import asset1 from 'asset1'; import asset2 from 'asset2'; import asset99 from 'asset99'; console.log(asset1, asset2, asset99); rollup-3.29.4/test/form/samples/empty-block-statement/000077500000000000000000000000001450520414700227465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-block-statement/_config.js000066400000000000000000000001231450520414700247040ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes an empty block statement' }); rollup-3.29.4/test/form/samples/empty-block-statement/_expected/000077500000000000000000000000001450520414700247065ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-block-statement/_expected/amd.js000066400000000000000000000001211450520414700257770ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-block-statement/_expected/cjs.js000066400000000000000000000000631450520414700260220ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-block-statement/_expected/es.js000066400000000000000000000000441450520414700256510ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-block-statement/_expected/iife.js000066400000000000000000000001141450520414700261540ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-3.29.4/test/form/samples/empty-block-statement/_expected/system.js000066400000000000000000000002201450520414700265620ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-3.29.4/test/form/samples/empty-block-statement/_expected/umd.js000066400000000000000000000002571450520414700260350ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-block-statement/main.js000066400000000000000000000000621450520414700242260ustar00rootroot00000000000000console.log( 1 ); { // empty } console.log( 2 ); rollup-3.29.4/test/form/samples/empty-do-while-statement/000077500000000000000000000000001450520414700233645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-do-while-statement/_config.js000066400000000000000000000001261450520414700253250ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes an empty do-while statement' }); rollup-3.29.4/test/form/samples/empty-do-while-statement/_expected/000077500000000000000000000000001450520414700253245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-do-while-statement/_expected/amd.js000066400000000000000000000001211450520414700264150ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-do-while-statement/_expected/cjs.js000066400000000000000000000000631450520414700264400ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-do-while-statement/_expected/es.js000066400000000000000000000000441450520414700262670ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-do-while-statement/_expected/iife.js000066400000000000000000000001141450520414700265720ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-3.29.4/test/form/samples/empty-do-while-statement/_expected/system.js000066400000000000000000000002201450520414700272000ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-3.29.4/test/form/samples/empty-do-while-statement/_expected/umd.js000066400000000000000000000002571450520414700264530ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-do-while-statement/main.js000066400000000000000000000001521450520414700246440ustar00rootroot00000000000000console.log( 1 ); var condition = true; do { condition = false; } while ( condition ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-for-in-statement/000077500000000000000000000000001450520414700230465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-for-in-statement/_config.js000066400000000000000000000001241450520414700250050ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes an empty for-in statement' }); rollup-3.29.4/test/form/samples/empty-for-in-statement/_expected.js000066400000000000000000000000441450520414700253420ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-for-in-statement/main.js000066400000000000000000000001351450520414700243270ustar00rootroot00000000000000console.log( 1 ); for ( const i in globalThis.unknown ) { // do nothing } console.log( 2 ); rollup-3.29.4/test/form/samples/empty-for-statement/000077500000000000000000000000001450520414700224425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-for-statement/_config.js000066400000000000000000000001211450520414700243760ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes an empty for statement' }); rollup-3.29.4/test/form/samples/empty-for-statement/_expected/000077500000000000000000000000001450520414700244025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-for-statement/_expected/amd.js000066400000000000000000000001211450520414700254730ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-for-statement/_expected/cjs.js000066400000000000000000000000631450520414700255160ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-for-statement/_expected/es.js000066400000000000000000000000441450520414700253450ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-for-statement/_expected/iife.js000066400000000000000000000001141450520414700256500ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-3.29.4/test/form/samples/empty-for-statement/_expected/system.js000066400000000000000000000002201450520414700262560ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-3.29.4/test/form/samples/empty-for-statement/_expected/umd.js000066400000000000000000000002571450520414700255310ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-for-statement/main.js000066400000000000000000000001311450520414700237170ustar00rootroot00000000000000console.log( 1 ); for ( let i = 0; i < 10; i += 1 ) { // do nothing } console.log( 2 ); rollup-3.29.4/test/form/samples/empty-if-statement/000077500000000000000000000000001450520414700222525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-if-statement/_config.js000066400000000000000000000001201450520414700242050ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes an empty if statement' }); rollup-3.29.4/test/form/samples/empty-if-statement/_expected.js000066400000000000000000000000441450520414700245460ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-if-statement/main.js000066400000000000000000000001141450520414700235300ustar00rootroot00000000000000console.log( 1 ); if ( globalThis.unknown ) { // empty } console.log( 2 ); rollup-3.29.4/test/form/samples/empty-statement-consequent/000077500000000000000000000000001450520414700240405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-statement-consequent/_config.js000066400000000000000000000001641450520414700260030ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves empty statements used as the consequent of conditionals' }); rollup-3.29.4/test/form/samples/empty-statement-consequent/_expected/000077500000000000000000000000001450520414700260005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-statement-consequent/_expected/amd.js000066400000000000000000000001071450520414700270750ustar00rootroot00000000000000define((function () { 'use strict'; if ( a === 0 ); else a++; })); rollup-3.29.4/test/form/samples/empty-statement-consequent/_expected/cjs.js000066400000000000000000000000511450520414700271110ustar00rootroot00000000000000'use strict'; if ( a === 0 ); else a++; rollup-3.29.4/test/form/samples/empty-statement-consequent/_expected/es.js000066400000000000000000000000321450520414700267400ustar00rootroot00000000000000if ( a === 0 ); else a++; rollup-3.29.4/test/form/samples/empty-statement-consequent/_expected/iife.js000066400000000000000000000001021450520414700272430ustar00rootroot00000000000000(function () { 'use strict'; if ( a === 0 ); else a++; })(); rollup-3.29.4/test/form/samples/empty-statement-consequent/_expected/system.js000066400000000000000000000002061450520414700276600ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { if ( a === 0 ); else a++; }) }; })); rollup-3.29.4/test/form/samples/empty-statement-consequent/_expected/umd.js000066400000000000000000000002451450520414700271240ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; if ( a === 0 ); else a++; })); rollup-3.29.4/test/form/samples/empty-statement-consequent/main.js000066400000000000000000000000321450520414700253150ustar00rootroot00000000000000if ( a === 0 ); else a++; rollup-3.29.4/test/form/samples/empty-statement/000077500000000000000000000000001450520414700216565ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-statement/_config.js000066400000000000000000000001151450520414700236150ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes an empty statement' }); rollup-3.29.4/test/form/samples/empty-statement/_expected/000077500000000000000000000000001450520414700236165ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-statement/_expected/amd.js000066400000000000000000000001171450520414700247140ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 );console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-statement/_expected/cjs.js000066400000000000000000000000621450520414700247310ustar00rootroot00000000000000'use strict'; console.log( 1 );console.log( 2 ); rollup-3.29.4/test/form/samples/empty-statement/_expected/es.js000066400000000000000000000000431450520414700245600ustar00rootroot00000000000000console.log( 1 );console.log( 2 ); rollup-3.29.4/test/form/samples/empty-statement/_expected/iife.js000066400000000000000000000001121450520414700250620ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 );console.log( 2 ); })(); rollup-3.29.4/test/form/samples/empty-statement/_expected/system.js000066400000000000000000000002141450520414700254750ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 );console.log( 2 ); }) }; })); rollup-3.29.4/test/form/samples/empty-statement/_expected/umd.js000066400000000000000000000002551450520414700247430ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 );console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-statement/main.js000066400000000000000000000000521450520414700231350ustar00rootroot00000000000000; console.log( 1 );; ; console.log( 2 );; rollup-3.29.4/test/form/samples/empty-switch-statement/000077500000000000000000000000001450520414700231555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-switch-statement/_config.js000066400000000000000000000001241450520414700251140ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes an empty switch statement' }); rollup-3.29.4/test/form/samples/empty-switch-statement/_expected.js000066400000000000000000000000441450520414700254510ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-switch-statement/main.js000066400000000000000000000002331450520414700244350ustar00rootroot00000000000000console.log( 1 ); var result; switch ( globalThis.unknown ) { case 'foo': result = 'foo'; break; default: result = 'default'; } console.log( 2 ); rollup-3.29.4/test/form/samples/empty-try-catch-statement/000077500000000000000000000000001450520414700235525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-try-catch-statement/_config.js000066400000000000000000000001371450520414700255150ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes an empty try-catch-finally statement' }); rollup-3.29.4/test/form/samples/empty-try-catch-statement/_expected/000077500000000000000000000000001450520414700255125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-try-catch-statement/_expected/amd.js000066400000000000000000000001211450520414700266030ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-try-catch-statement/_expected/cjs.js000066400000000000000000000000631450520414700266260ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-try-catch-statement/_expected/es.js000066400000000000000000000000441450520414700264550ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-try-catch-statement/_expected/iife.js000066400000000000000000000001141450520414700267600ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-3.29.4/test/form/samples/empty-try-catch-statement/_expected/system.js000066400000000000000000000002201450520414700273660ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-3.29.4/test/form/samples/empty-try-catch-statement/_expected/umd.js000066400000000000000000000002571450520414700266410ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-try-catch-statement/main.js000066400000000000000000000001671450520414700250400ustar00rootroot00000000000000console.log( 1 ); try { // do nothing } catch ( err ) { // do nothing } finally { // do nothing } console.log( 2 ); rollup-3.29.4/test/form/samples/empty-while-statement/000077500000000000000000000000001450520414700227645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-while-statement/_config.js000066400000000000000000000001231450520414700247220ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes an empty while statement' }); rollup-3.29.4/test/form/samples/empty-while-statement/_expected/000077500000000000000000000000001450520414700247245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/empty-while-statement/_expected/amd.js000066400000000000000000000001211450520414700260150ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-while-statement/_expected/cjs.js000066400000000000000000000000631450520414700260400ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-while-statement/_expected/es.js000066400000000000000000000000441450520414700256670ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-3.29.4/test/form/samples/empty-while-statement/_expected/iife.js000066400000000000000000000001141450520414700261720ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-3.29.4/test/form/samples/empty-while-statement/_expected/system.js000066400000000000000000000002201450520414700266000ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-3.29.4/test/form/samples/empty-while-statement/_expected/umd.js000066400000000000000000000002571450520414700260530ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-3.29.4/test/form/samples/empty-while-statement/main.js000066400000000000000000000001461450520414700242470ustar00rootroot00000000000000console.log( 1 ); var condition = true; while ( condition ) { condition = false; } console.log( 2 ); rollup-3.29.4/test/form/samples/enforce-addon-order/000077500000000000000000000000001450520414700223335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/enforce-addon-order/_config.js000066400000000000000000000012351450520414700242760ustar00rootroot00000000000000const hooks = ['banner', 'footer', 'intro', 'outro']; const plugins = []; addPlugin(null); addPlugin('pre'); addPlugin('post'); addPlugin('post'); addPlugin('pre'); addPlugin(); function addPlugin(order) { const name = `${order}-${(plugins.length >> 1) + 1}`; const plugin = { name }; const stringPlugin = { name: `string-${name}` }; for (const hook of hooks) { plugin[hook] = { order, handler: () => `// ${hook}-${name}` }; stringPlugin[hook] = { order, handler: `// ${hook}-string-${name}` }; } plugins.push(plugin, stringPlugin); } module.exports = defineTest({ description: 'allows to enforce addon order', options: { plugins } }); rollup-3.29.4/test/form/samples/enforce-addon-order/_expected.js000066400000000000000000000020111450520414700246230ustar00rootroot00000000000000 // banner-pre-2 // banner-string-pre-2 // banner-pre-5 // banner-string-pre-5 // banner-null-1 // banner-string-null-1 // banner-undefined-6 // banner-string-undefined-6 // banner-post-3 // banner-string-post-3 // banner-post-4 // banner-string-post-4 // intro-pre-2 // intro-string-pre-2 // intro-pre-5 // intro-string-pre-5 // intro-null-1 // intro-string-null-1 // intro-undefined-6 // intro-string-undefined-6 // intro-post-3 // intro-string-post-3 // intro-post-4 // intro-string-post-4 console.log('main'); // outro-pre-2 // outro-string-pre-2 // outro-pre-5 // outro-string-pre-5 // outro-null-1 // outro-string-null-1 // outro-undefined-6 // outro-string-undefined-6 // outro-post-3 // outro-string-post-3 // outro-post-4 // outro-string-post-4 // footer-pre-2 // footer-string-pre-2 // footer-pre-5 // footer-string-pre-5 // footer-null-1 // footer-string-null-1 // footer-undefined-6 // footer-string-undefined-6 // footer-post-3 // footer-string-post-3 // footer-post-4 // footer-string-post-4 rollup-3.29.4/test/form/samples/enforce-addon-order/main.js000066400000000000000000000000251450520414700236120ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/000077500000000000000000000000001450520414700256435ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/_config.js000066400000000000000000000004071450520414700276060ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not include unused synthetic namespace object in entry points', options: { plugins: { name: 'test-plugin', transform(code) { return { code, syntheticNamedExports: '__moduleExports' }; } } } }); rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/_expected/000077500000000000000000000000001450520414700276035ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/_expected/amd.js000066400000000000000000000001011450520414700306720ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/_expected/cjs.js000066400000000000000000000000441450520414700307160ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/_expected/es.js000066400000000000000000000000251450520414700305450ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/_expected/iife.js000066400000000000000000000000741450520414700310560ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/_expected/system.js000066400000000000000000000001761450520414700314710ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/_expected/umd.js000066400000000000000000000002371450520414700307300ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/entry-with-unused-synthetic-exports/main.js000066400000000000000000000001111450520414700271160ustar00rootroot00000000000000console.log('main'); export const __moduleExports = { not: 'included' }; rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/000077500000000000000000000000001450520414700254615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/_config.js000066400000000000000000000001551450520414700274240ustar00rootroot00000000000000module.exports = defineTest({ description: 'erroneous nested member expression does not mess up naming' }); rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/_expected/000077500000000000000000000000001450520414700274215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/_expected/amd.js000066400000000000000000000002061450520414700305160ustar00rootroot00000000000000define((function () { 'use strict'; function yar() { return { har() { console.log('har?'); } }; } yar.har(); })); rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/_expected/cjs.js000066400000000000000000000001421450520414700305330ustar00rootroot00000000000000'use strict'; function yar() { return { har() { console.log('har?'); } }; } yar.har(); rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/_expected/es.js000066400000000000000000000001231450520414700303620ustar00rootroot00000000000000function yar() { return { har() { console.log('har?'); } }; } yar.har(); rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/_expected/iife.js000066400000000000000000000002011450520414700306640ustar00rootroot00000000000000(function () { 'use strict'; function yar() { return { har() { console.log('har?'); } }; } yar.har(); })(); rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/_expected/system.js000066400000000000000000000003211450520414700312770ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function yar() { return { har() { console.log('har?'); } }; } yar.har(); }) }; })); rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/_expected/umd.js000066400000000000000000000003441450520414700305450ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function yar() { return { har() { console.log('har?'); } }; } yar.har(); })); rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/foo.js000066400000000000000000000001171450520414700266010ustar00rootroot00000000000000export function yar() { return { har() { console.log('har?'); } }; }; rollup-3.29.4/test/form/samples/erroneous-nested-member-expression/main.js000066400000000000000000000000601450520414700267370ustar00rootroot00000000000000import * as foo from './foo.js'; foo.yar.har(); rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/000077500000000000000000000000001450520414700253325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/_config.js000066400000000000000000000001721450520414700272740ustar00rootroot00000000000000module.exports = defineTest({ description: 'statements that modify definitions within unused functions are excluded' }); rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/_expected/000077500000000000000000000000001450520414700272725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/_expected/amd.js000066400000000000000000000006011450520414700303660ustar00rootroot00000000000000define((function () { 'use strict'; var foo = {}; mutate1(); // should be included [ 'a', 'b', 'c' ].forEach( function ( letter, i ) { foo[ letter ] = i; }); [ 'd', 'e', 'f' ].forEach( ( letter, i ) => { foo[ letter ] = i; }); function mutate1 () { foo.mutated = 1; } ({ mutate2: function () { foo.mutated = 2; } }).mutate2(); console.log( foo ); })); rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/_expected/cjs.js000066400000000000000000000005231450520414700304070ustar00rootroot00000000000000'use strict'; var foo = {}; mutate1(); // should be included [ 'a', 'b', 'c' ].forEach( function ( letter, i ) { foo[ letter ] = i; }); [ 'd', 'e', 'f' ].forEach( ( letter, i ) => { foo[ letter ] = i; }); function mutate1 () { foo.mutated = 1; } ({ mutate2: function () { foo.mutated = 2; } }).mutate2(); console.log( foo ); rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/_expected/es.js000066400000000000000000000005041450520414700302360ustar00rootroot00000000000000var foo = {}; mutate1(); // should be included [ 'a', 'b', 'c' ].forEach( function ( letter, i ) { foo[ letter ] = i; }); [ 'd', 'e', 'f' ].forEach( ( letter, i ) => { foo[ letter ] = i; }); function mutate1 () { foo.mutated = 1; } ({ mutate2: function () { foo.mutated = 2; } }).mutate2(); console.log( foo ); rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/_expected/iife.js000066400000000000000000000005741450520414700305520ustar00rootroot00000000000000(function () { 'use strict'; var foo = {}; mutate1(); // should be included [ 'a', 'b', 'c' ].forEach( function ( letter, i ) { foo[ letter ] = i; }); [ 'd', 'e', 'f' ].forEach( ( letter, i ) => { foo[ letter ] = i; }); function mutate1 () { foo.mutated = 1; } ({ mutate2: function () { foo.mutated = 2; } }).mutate2(); console.log( foo ); })(); rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/_expected/system.js000066400000000000000000000007401450520414700311550ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = {}; mutate1(); // should be included [ 'a', 'b', 'c' ].forEach( function ( letter, i ) { foo[ letter ] = i; }); [ 'd', 'e', 'f' ].forEach( ( letter, i ) => { foo[ letter ] = i; }); function mutate1 () { foo.mutated = 1; } ({ mutate2: function () { foo.mutated = 2; } }).mutate2(); console.log( foo ); }) }; })); rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/_expected/umd.js000066400000000000000000000007371450520414700304240ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = {}; mutate1(); // should be included [ 'a', 'b', 'c' ].forEach( function ( letter, i ) { foo[ letter ] = i; }); [ 'd', 'e', 'f' ].forEach( ( letter, i ) => { foo[ letter ] = i; }); function mutate1 () { foo.mutated = 1; } ({ mutate2: function () { foo.mutated = 2; } }).mutate2(); console.log( foo ); })); rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/foo.js000066400000000000000000000007461450520414700264620ustar00rootroot00000000000000var foo = {}; mutate1( foo ); // should be included [ 'a', 'b', 'c' ].forEach( function ( letter, i ) { foo[ letter ] = i; }); [ 'd', 'e', 'f' ].forEach( ( letter, i ) => { foo[ letter ] = i; }); function mutate1 () { foo.mutated = 1; } ({ mutate2: function () { foo.mutated = 2; } }).mutate2(); // should be excluded var mutate2 = function () { foo.mutated = 2; } function unused1 () { foo.wat = 'nope'; } function unused2 () { mutate1( foo ); } export default foo; rollup-3.29.4/test/form/samples/exclude-unnecessary-modifications/main.js000066400000000000000000000000551450520414700266140ustar00rootroot00000000000000import foo from './foo'; console.log( foo ); rollup-3.29.4/test/form/samples/exponentiation-operator/000077500000000000000000000000001450520414700234135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/exponentiation-operator/_config.js000066400000000000000000000001531450520414700253540ustar00rootroot00000000000000module.exports = defineTest({ description: 'folds exponentiation operator when considering dead code' }); rollup-3.29.4/test/form/samples/exponentiation-operator/_expected/000077500000000000000000000000001450520414700253535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/exponentiation-operator/_expected/amd.js000066400000000000000000000001261450520414700264510ustar00rootroot00000000000000define((function () { 'use strict'; { console.log('8 is larger than 7'); } })); rollup-3.29.4/test/form/samples/exponentiation-operator/_expected/cjs.js000066400000000000000000000000671450520414700264730ustar00rootroot00000000000000'use strict'; { console.log('8 is larger than 7'); } rollup-3.29.4/test/form/samples/exponentiation-operator/_expected/es.js000066400000000000000000000000501450520414700263130ustar00rootroot00000000000000{ console.log('8 is larger than 7'); } rollup-3.29.4/test/form/samples/exponentiation-operator/_expected/iife.js000066400000000000000000000001211450520414700266170ustar00rootroot00000000000000(function () { 'use strict'; { console.log('8 is larger than 7'); } })(); rollup-3.29.4/test/form/samples/exponentiation-operator/_expected/system.js000066400000000000000000000002271450520414700272360ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { { console.log('8 is larger than 7'); } }) }; })); rollup-3.29.4/test/form/samples/exponentiation-operator/_expected/umd.js000066400000000000000000000002641450520414700265000ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; { console.log('8 is larger than 7'); } })); rollup-3.29.4/test/form/samples/exponentiation-operator/main.js000066400000000000000000000001541450520414700246750ustar00rootroot00000000000000if (2 ** 3 > 7) { console.log('8 is larger than 7'); } else { console.log('8 is... not larger than 7?'); }rollup-3.29.4/test/form/samples/export-all-before-named/000077500000000000000000000000001450520414700231275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-all-before-named/_config.js000066400000000000000000000003531450520414700250720ustar00rootroot00000000000000module.exports = defineTest({ description: 'external `export *` must not interfere with internal exports', options: { output: { globals: { external: 'external' }, name: 'exposedInternals' }, external: ['external'] } }); rollup-3.29.4/test/form/samples/export-all-before-named/_expected/000077500000000000000000000000001450520414700250675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-all-before-named/_expected/amd.js000066400000000000000000000006341450520414700261710ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; function internalFn(path) { return path[0] === '.'; } exports.internalFn = internalFn; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); })); rollup-3.29.4/test/form/samples/export-all-before-named/_expected/cjs.js000066400000000000000000000005611450520414700262060ustar00rootroot00000000000000'use strict'; var external = require('external'); function internalFn(path) { return path[0] === '.'; } exports.internalFn = internalFn; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-3.29.4/test/form/samples/export-all-before-named/_expected/es.js000066400000000000000000000001521450520414700260320ustar00rootroot00000000000000export * from 'external'; function internalFn(path) { return path[0] === '.'; } export { internalFn }; rollup-3.29.4/test/form/samples/export-all-before-named/_expected/iife.js000066400000000000000000000006631450520414700263460ustar00rootroot00000000000000var exposedInternals = (function (exports, external) { 'use strict'; function internalFn(path) { return path[0] === '.'; } exports.internalFn = internalFn; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); return exports; })({}, external); rollup-3.29.4/test/form/samples/export-all-before-named/_expected/system.js000066400000000000000000000007271450520414700267570ustar00rootroot00000000000000System.register('exposedInternals', ['external'], (function (exports) { 'use strict'; var _starExcludes = { internalFn: 1, default: 1 }; return { setters: [function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { exports('internalFn', internalFn); function internalFn(path) { return path[0] === '.'; } }) }; })); rollup-3.29.4/test/form/samples/export-all-before-named/_expected/umd.js000066400000000000000000000013511450520414700262120ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.exposedInternals = {}, global.external)); })(this, (function (exports, external) { 'use strict'; function internalFn(path) { return path[0] === '.'; } exports.internalFn = internalFn; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); })); rollup-3.29.4/test/form/samples/export-all-before-named/internal.js000066400000000000000000000000761450520414700253040ustar00rootroot00000000000000export function internalFn(path) { return path[0] === '.'; } rollup-3.29.4/test/form/samples/export-all-before-named/main.js000066400000000000000000000000711450520414700244070ustar00rootroot00000000000000export * from 'external'; export * from './internal.js'; rollup-3.29.4/test/form/samples/export-all-from-internal/000077500000000000000000000000001450520414700233605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-all-from-internal/_config.js000066400000000000000000000002211450520414700253150ustar00rootroot00000000000000module.exports = defineTest({ description: 'should be able to export * from the bundle', options: { output: { name: 'exposedInternals' } } }); rollup-3.29.4/test/form/samples/export-all-from-internal/_expected/000077500000000000000000000000001450520414700253205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-all-from-internal/_expected/amd.js000066400000000000000000000001741450520414700264210ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const a = 1; const b = 2; exports.a = a; exports.b = b; })); rollup-3.29.4/test/form/samples/export-all-from-internal/_expected/cjs.js000066400000000000000000000001101450520414700264250ustar00rootroot00000000000000'use strict'; const a = 1; const b = 2; exports.a = a; exports.b = b; rollup-3.29.4/test/form/samples/export-all-from-internal/_expected/es.js000066400000000000000000000000541450520414700262640ustar00rootroot00000000000000const a = 1; const b = 2; export { a, b }; rollup-3.29.4/test/form/samples/export-all-from-internal/_expected/iife.js000066400000000000000000000002251450520414700265710ustar00rootroot00000000000000var exposedInternals = (function (exports) { 'use strict'; const a = 1; const b = 2; exports.a = a; exports.b = b; return exports; })({}); rollup-3.29.4/test/form/samples/export-all-from-internal/_expected/system.js000066400000000000000000000002751450520414700272060ustar00rootroot00000000000000System.register('exposedInternals', [], (function (exports) { 'use strict'; return { execute: (function () { const a = exports('a', 1); const b = exports('b', 2); }) }; })); rollup-3.29.4/test/form/samples/export-all-from-internal/_expected/umd.js000066400000000000000000000006431450520414700264460ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.exposedInternals = {})); })(this, (function (exports) { 'use strict'; const a = 1; const b = 2; exports.a = a; exports.b = b; })); rollup-3.29.4/test/form/samples/export-all-from-internal/internal.js000066400000000000000000000000731450520414700255320ustar00rootroot00000000000000export const a = 1; export const b = 2; export default 42; rollup-3.29.4/test/form/samples/export-all-from-internal/main.js000066400000000000000000000000371450520414700246420ustar00rootroot00000000000000export * from './internal.js'; rollup-3.29.4/test/form/samples/export-all-multiple/000077500000000000000000000000001450520414700224365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-all-multiple/_config.js000066400000000000000000000003661450520414700244050ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly handles multiple export * declarations (#1252)', options: { external: ['foo', 'bar', 'baz'], output: { globals: { foo: 'foo', bar: 'bar', baz: 'baz' }, name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/export-all-multiple/_expected/000077500000000000000000000000001450520414700243765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-all-multiple/_expected/amd.js000066400000000000000000000014051450520414700254750ustar00rootroot00000000000000define(['exports', 'foo', 'bar', 'baz'], (function (exports, foo, bar, baz) { 'use strict'; Object.keys(foo).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return foo[k]; } }); }); Object.keys(bar).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return bar[k]; } }); }); Object.keys(baz).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return baz[k]; } }); }); })); rollup-3.29.4/test/form/samples/export-all-multiple/_expected/cjs.js000066400000000000000000000013561450520414700255200ustar00rootroot00000000000000'use strict'; var foo = require('foo'); var bar = require('bar'); var baz = require('baz'); Object.keys(foo).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return foo[k]; } }); }); Object.keys(bar).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return bar[k]; } }); }); Object.keys(baz).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return baz[k]; } }); }); rollup-3.29.4/test/form/samples/export-all-multiple/_expected/es.js000066400000000000000000000000771450520414700253470ustar00rootroot00000000000000export * from 'foo'; export * from 'bar'; export * from 'baz'; rollup-3.29.4/test/form/samples/export-all-multiple/_expected/iife.js000066400000000000000000000014201450520414700256450ustar00rootroot00000000000000var myBundle = (function (exports, foo, bar, baz) { 'use strict'; Object.keys(foo).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return foo[k]; } }); }); Object.keys(bar).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return bar[k]; } }); }); Object.keys(baz).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return baz[k]; } }); }); return exports; })({}, foo, bar, baz); rollup-3.29.4/test/form/samples/export-all-multiple/_expected/system.js000066400000000000000000000012371450520414700262630ustar00rootroot00000000000000System.register('myBundle', ['foo', 'bar', 'baz'], (function (exports) { 'use strict'; var _starExcludes = { default: 1 }; return { setters: [function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }, function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }, function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/export-all-multiple/_expected/umd.js000066400000000000000000000021661450520414700255260ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('foo'), require('bar'), require('baz')) : typeof define === 'function' && define.amd ? define(['exports', 'foo', 'bar', 'baz'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {}, global.foo, global.bar, global.baz)); })(this, (function (exports, foo, bar, baz) { 'use strict'; Object.keys(foo).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return foo[k]; } }); }); Object.keys(bar).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return bar[k]; } }); }); Object.keys(baz).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return baz[k]; } }); }); })); rollup-3.29.4/test/form/samples/export-all-multiple/main.js000066400000000000000000000000771450520414700237240ustar00rootroot00000000000000export * from 'foo'; export * from 'bar'; export * from 'baz'; rollup-3.29.4/test/form/samples/export-default-2/000077500000000000000000000000001450520414700216205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-2/_config.js000066400000000000000000000001741450520414700235640ustar00rootroot00000000000000module.exports = defineTest({ description: 're-exporting a default export', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/export-default-2/_expected/000077500000000000000000000000001450520414700235605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-2/_expected/amd.js000066400000000000000000000001071450520414700246550ustar00rootroot00000000000000define((function () { 'use strict'; var bar = 1; return bar; })); rollup-3.29.4/test/form/samples/export-default-2/_expected/cjs.js000066400000000000000000000000631450520414700246740ustar00rootroot00000000000000'use strict'; var bar = 1; module.exports = bar; rollup-3.29.4/test/form/samples/export-default-2/_expected/es.js000066400000000000000000000000511450520414700245210ustar00rootroot00000000000000var bar = 1; export { bar as default }; rollup-3.29.4/test/form/samples/export-default-2/_expected/iife.js000066400000000000000000000001211450520414700250240ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var bar = 1; return bar; })(); rollup-3.29.4/test/form/samples/export-default-2/_expected/system.js000066400000000000000000000002351450520414700254420ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var bar = exports('default', 1); }) }; })); rollup-3.29.4/test/form/samples/export-default-2/_expected/umd.js000066400000000000000000000005561450520414700247110ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var bar = 1; return bar; })); rollup-3.29.4/test/form/samples/export-default-2/bar.js000066400000000000000000000000421450520414700227160ustar00rootroot00000000000000var bar = 1; export default bar; rollup-3.29.4/test/form/samples/export-default-2/main.js000066400000000000000000000000571450520414700231040ustar00rootroot00000000000000export { default as default } from './bar.js'; rollup-3.29.4/test/form/samples/export-default-3/000077500000000000000000000000001450520414700216215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-3/_config.js000066400000000000000000000001741450520414700235650ustar00rootroot00000000000000module.exports = defineTest({ description: 're-exporting a default export', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/export-default-3/_expected/000077500000000000000000000000001450520414700235615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-3/_expected/amd.js000066400000000000000000000001071450520414700246560ustar00rootroot00000000000000define((function () { 'use strict'; var bar = 1; return bar; })); rollup-3.29.4/test/form/samples/export-default-3/_expected/cjs.js000066400000000000000000000000631450520414700246750ustar00rootroot00000000000000'use strict'; var bar = 1; module.exports = bar; rollup-3.29.4/test/form/samples/export-default-3/_expected/es.js000066400000000000000000000000511450520414700245220ustar00rootroot00000000000000var bar = 1; export { bar as default }; rollup-3.29.4/test/form/samples/export-default-3/_expected/iife.js000066400000000000000000000001211450520414700250250ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var bar = 1; return bar; })(); rollup-3.29.4/test/form/samples/export-default-3/_expected/system.js000066400000000000000000000002351450520414700254430ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var bar = exports('default', 1); }) }; })); rollup-3.29.4/test/form/samples/export-default-3/_expected/umd.js000066400000000000000000000005561450520414700247120ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var bar = 1; return bar; })); rollup-3.29.4/test/form/samples/export-default-3/bar.js000066400000000000000000000000421450520414700227170ustar00rootroot00000000000000var bar = 1; export default bar; rollup-3.29.4/test/form/samples/export-default-3/main.js000066400000000000000000000000611450520414700231000ustar00rootroot00000000000000import foo from './bar.js'; export default foo; rollup-3.29.4/test/form/samples/export-default-4/000077500000000000000000000000001450520414700216225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-4/_config.js000066400000000000000000000002211450520414700235570ustar00rootroot00000000000000module.exports = defineTest({ description: 'single default export in deep namespace', options: { output: { name: 'my.global.namespace' } } }); rollup-3.29.4/test/form/samples/export-default-4/_expected/000077500000000000000000000000001450520414700235625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-4/_expected/amd.js000066400000000000000000000001121450520414700246530ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/export-default-4/_expected/cjs.js000066400000000000000000000000661450520414700247010ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/export-default-4/_expected/es.js000066400000000000000000000000541450520414700245260ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/export-default-4/_expected/iife.js000066400000000000000000000002401450520414700250300ustar00rootroot00000000000000this.my = this.my || {}; this.my.global = this.my.global || {}; this.my.global.namespace = (function () { 'use strict'; var main = 42; return main; })(); rollup-3.29.4/test/form/samples/export-default-4/_expected/system.js000066400000000000000000000002521450520414700254430ustar00rootroot00000000000000System.register('my.global.namespace', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/export-default-4/_expected/umd.js000066400000000000000000000007061450520414700247100ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.my = global.my || {}, global.my.global = global.my.global || {}, global.my.global.namespace = factory())); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/export-default-4/main.js000066400000000000000000000000231450520414700230770ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/000077500000000000000000000000001450520414700261555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/_config.js000066400000000000000000000001501450520414700301130ustar00rootroot00000000000000module.exports = defineTest({ description: 'export default [Declaration] with spaces and comments' }); rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/_expected/000077500000000000000000000000001450520414700301155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/_expected/amd.js000066400000000000000000000021011450520414700312060ustar00rootroot00000000000000define((function () { 'use strict'; // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function Fn //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol async /* [no LineTerminator here] */ function Async //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function /* oiasnpiueno */ /// iauianpns /* aiusni */ * Generator //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol class Class /* oiasnpiueno */ /// iauianpns /* aiusni */ //iian iaouns /* aaain ob skubz */ { constructor() { console.log("Foo"); } } /* 2 */function spacelessFn/* 3 */()/* 4 */{ console.log("Foo"); } function* spacelessGenerator(){ console.log("Foo"); } Fn(); Async(); Generator(); new Class(); spacelessFn(); spacelessGenerator(); })); rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/_expected/cjs.js000066400000000000000000000016631450520414700312400ustar00rootroot00000000000000'use strict'; // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function Fn //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol async /* [no LineTerminator here] */ function Async //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function /* oiasnpiueno */ /// iauianpns /* aiusni */ * Generator //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol class Class /* oiasnpiueno */ /// iauianpns /* aiusni */ //iian iaouns /* aaain ob skubz */ { constructor() { console.log("Foo"); } } /* 2 */function spacelessFn/* 3 */()/* 4 */{ console.log("Foo"); } function* spacelessGenerator(){ console.log("Foo"); } Fn(); Async(); Generator(); new Class(); spacelessFn(); spacelessGenerator(); rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/_expected/es.js000066400000000000000000000016441450520414700310670ustar00rootroot00000000000000// jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function Fn //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol async /* [no LineTerminator here] */ function Async //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function /* oiasnpiueno */ /// iauianpns /* aiusni */ * Generator //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol class Class /* oiasnpiueno */ /// iauianpns /* aiusni */ //iian iaouns /* aaain ob skubz */ { constructor() { console.log("Foo"); } } /* 2 */function spacelessFn/* 3 */()/* 4 */{ console.log("Foo"); } function* spacelessGenerator(){ console.log("Foo"); } Fn(); Async(); Generator(); new Class(); spacelessFn(); spacelessGenerator(); rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/_expected/iife.js000066400000000000000000000020751450520414700313730ustar00rootroot00000000000000(function () { 'use strict'; // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function Fn //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol async /* [no LineTerminator here] */ function Async //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function /* oiasnpiueno */ /// iauianpns /* aiusni */ * Generator //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol class Class /* oiasnpiueno */ /// iauianpns /* aiusni */ //iian iaouns /* aaain ob skubz */ { constructor() { console.log("Foo"); } } /* 2 */function spacelessFn/* 3 */()/* 4 */{ console.log("Foo"); } function* spacelessGenerator(){ console.log("Foo"); } Fn(); Async(); Generator(); new Class(); spacelessFn(); spacelessGenerator(); })(); rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/_expected/system.js000066400000000000000000000025471450520414700320070ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function Fn //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol async /* [no LineTerminator here] */ function Async //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function /* oiasnpiueno */ /// iauianpns /* aiusni */ * Generator //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol class Class /* oiasnpiueno */ /// iauianpns /* aiusni */ //iian iaouns /* aaain ob skubz */ { constructor() { console.log("Foo"); } } /* 2 */function spacelessFn/* 3 */()/* 4 */{ console.log("Foo"); } function* spacelessGenerator(){ console.log("Foo"); } Fn(); Async(); Generator(); new Class(); spacelessFn(); spacelessGenerator(); }) }; })); rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/_expected/umd.js000066400000000000000000000022411450520414700312370ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function Fn //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol async /* [no LineTerminator here] */ function Async //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function /* oiasnpiueno */ /// iauianpns /* aiusni */ * Generator //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol class Class /* oiasnpiueno */ /// iauianpns /* aiusni */ //iian iaouns /* aaain ob skubz */ { constructor() { console.log("Foo"); } } /* 2 */function spacelessFn/* 3 */()/* 4 */{ console.log("Foo"); } function* spacelessGenerator(){ console.log("Foo"); } Fn(); Async(); Generator(); new Class(); spacelessFn(); spacelessGenerator(); })); rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/async.js000066400000000000000000000003371450520414700276330ustar00rootroot00000000000000export /* comment */ // aaaa /* foo */ default // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol async /* [no LineTerminator here] */ function //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/class.js000066400000000000000000000003731450520414700276230ustar00rootroot00000000000000export /* comment */ // aaaa /* foo */ default // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol class /* oiasnpiueno */ /// iauianpns /* aiusni */ //iian iaouns /* aaain ob skubz */ { constructor() { console.log("Foo"); } } rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/fn.js000066400000000000000000000002741450520414700271210ustar00rootroot00000000000000export /* comment */ // aaaa /* foo */ default // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/generator.js000066400000000000000000000003541450520414700305030ustar00rootroot00000000000000export /* comment */ // aaaa /* foo */ default // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function /* oiasnpiueno */ /// iauianpns /* aiusni */ * //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/main.js000066400000000000000000000004651450520414700274440ustar00rootroot00000000000000import Fn from "./fn.js" import Async from "./async.js"; import Generator from "./generator.js"; import Class from "./class.js"; import spacelessFn from "./spacelessFn.js" import spacelessGenerator from "./spacelessGenerator.js"; Fn(); Async(); Generator(); new Class(); spacelessFn(); spacelessGenerator(); rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/spacelessFn.js000066400000000000000000000001151450520414700307560ustar00rootroot00000000000000export/* 1 */default/* 2 */function/* 3 */()/* 4 */{ console.log("Foo"); } rollup-3.29.4/test/form/samples/export-default-anonymous-declarations/spacelessGenerator.js000066400000000000000000000000641450520414700323440ustar00rootroot00000000000000export default function*(){ console.log("Foo"); } rollup-3.29.4/test/form/samples/export-default-global/000077500000000000000000000000001450520414700227175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-global/_config.js000066400000000000000000000002071450520414700246600ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles default exporting global variables', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/export-default-global/_expected/000077500000000000000000000000001450520414700246575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-global/_expected/amd.js000066400000000000000000000001461450520414700257570ustar00rootroot00000000000000define((function () { 'use strict'; var value = global; console.log(value); return value; })); rollup-3.29.4/test/form/samples/export-default-global/_expected/cjs.js000066400000000000000000000001211450520414700257660ustar00rootroot00000000000000'use strict'; var value = global; console.log(value); module.exports = value; rollup-3.29.4/test/form/samples/export-default-global/_expected/es.js000066400000000000000000000001071450520414700256220ustar00rootroot00000000000000var value = global; console.log(value); export { value as default }; rollup-3.29.4/test/form/samples/export-default-global/_expected/iife.js000066400000000000000000000001561450520414700261330ustar00rootroot00000000000000var bundle = (function () { 'use strict'; var value = global; console.log(value); return value; })(); rollup-3.29.4/test/form/samples/export-default-global/_expected/system.js000066400000000000000000000002721450520414700265420ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('default', global); console.log(value); }) }; })); rollup-3.29.4/test/form/samples/export-default-global/_expected/umd.js000066400000000000000000000006131450520414700260020ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory()); })(this, (function () { 'use strict'; var value = global; console.log(value); return value; })); rollup-3.29.4/test/form/samples/export-default-global/lib.js000066400000000000000000000000261450520414700240210ustar00rootroot00000000000000export default global;rollup-3.29.4/test/form/samples/export-default-global/main.js000066400000000000000000000001111450520414700241720ustar00rootroot00000000000000import value from './lib.js'; console.log(value); export default value; rollup-3.29.4/test/form/samples/export-default-import/000077500000000000000000000000001450520414700227715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-import/_config.js000066400000000000000000000003421450520414700247320ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly exports a default import, even in ES mode (#513)', options: { external: ['x'], output: { globals: { x: 'x' }, interop: 'compat', name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/export-default-import/_expected/000077500000000000000000000000001450520414700247315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default-import/_expected/amd.js000066400000000000000000000005501450520414700260300ustar00rootroot00000000000000define(['exports', 'x'], (function (exports, x) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } var x__default = /*#__PURE__*/_interopDefaultCompat(x); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return x__default.default; } }); })); rollup-3.29.4/test/form/samples/export-default-import/_expected/cjs.js000066400000000000000000000005011450520414700260420ustar00rootroot00000000000000'use strict'; var x = require('x'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } var x__default = /*#__PURE__*/_interopDefaultCompat(x); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return x__default.default; } }); rollup-3.29.4/test/form/samples/export-default-import/_expected/es.js000066400000000000000000000000421450520414700256720ustar00rootroot00000000000000export { default as x } from 'x'; rollup-3.29.4/test/form/samples/export-default-import/_expected/iife.js000066400000000000000000000005671450520414700262130ustar00rootroot00000000000000var myBundle = (function (exports, x) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } var x__default = /*#__PURE__*/_interopDefaultCompat(x); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return x__default.default; } }); return exports; })({}, x); rollup-3.29.4/test/form/samples/export-default-import/_expected/system.js000066400000000000000000000003041450520414700266100ustar00rootroot00000000000000System.register('myBundle', ['x'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('x', module.default); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/export-default-import/_expected/umd.js000066400000000000000000000012371450520414700260570ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('x')) : typeof define === 'function' && define.amd ? define(['exports', 'x'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {}, global.x)); })(this, (function (exports, x) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; } var x__default = /*#__PURE__*/_interopDefaultCompat(x); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return x__default.default; } }); })); rollup-3.29.4/test/form/samples/export-default-import/main.js000066400000000000000000000000421450520414700242470ustar00rootroot00000000000000import x from 'x'; export { x }; rollup-3.29.4/test/form/samples/export-default/000077500000000000000000000000001450520414700214615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default/_config.js000066400000000000000000000001671450520414700234270ustar00rootroot00000000000000module.exports = defineTest({ description: 'single (default) exports', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/export-default/_expected/000077500000000000000000000000001450520414700234215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-default/_expected/amd.js000066400000000000000000000001121450520414700245120ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/export-default/_expected/cjs.js000066400000000000000000000000661450520414700245400ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/export-default/_expected/es.js000066400000000000000000000000541450520414700243650ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/export-default/_expected/iife.js000066400000000000000000000001241450520414700246700ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-3.29.4/test/form/samples/export-default/_expected/system.js000066400000000000000000000002371450520414700253050ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/export-default/_expected/umd.js000066400000000000000000000005611450520414700245460ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/export-default/main.js000066400000000000000000000000231450520414700227360ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/form/samples/export-globals/000077500000000000000000000000001450520414700214605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-globals/Number.js000066400000000000000000000003571450520414700232530ustar00rootroot00000000000000const localIsNaN = isNaN; const localIsFinite = isFinite; const localParseFloat = parseFloat; const localNumber = Number; export { localIsNaN as isNaN, localIsFinite as isFinite, localParseFloat as parseFloat, localNumber as Number }; rollup-3.29.4/test/form/samples/export-globals/_config.js000066400000000000000000000004361450520414700234250ustar00rootroot00000000000000// Changed due to https://github.com/acornjs/acorn/issues/806 // Consider reverting this change should this become an acorn option module.exports = defineTest({ description: 'Supports reexports of globals with namespace access', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/export-globals/_expected/000077500000000000000000000000001450520414700234205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-globals/_expected/amd.js000066400000000000000000000002231450520414700245140ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const localIsNaN = isNaN; const isNaN$1 = localIsNaN; exports.isNaN = isNaN$1; })); rollup-3.29.4/test/form/samples/export-globals/_expected/cjs.js000066400000000000000000000001401450520414700245300ustar00rootroot00000000000000'use strict'; const localIsNaN = isNaN; const isNaN$1 = localIsNaN; exports.isNaN = isNaN$1; rollup-3.29.4/test/form/samples/export-globals/_expected/es.js000066400000000000000000000001251450520414700243630ustar00rootroot00000000000000const localIsNaN = isNaN; const isNaN$1 = localIsNaN; export { isNaN$1 as isNaN }; rollup-3.29.4/test/form/samples/export-globals/_expected/iife.js000066400000000000000000000002441450520414700246720ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; const localIsNaN = isNaN; const isNaN$1 = localIsNaN; exports.isNaN = isNaN$1; return exports; })({}); rollup-3.29.4/test/form/samples/export-globals/_expected/system.js000066400000000000000000000003101450520414700252740ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { const localIsNaN = isNaN; const isNaN$1 = exports('isNaN', localIsNaN); }) }; })); rollup-3.29.4/test/form/samples/export-globals/_expected/umd.js000066400000000000000000000006621450520414700245470ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {})); })(this, (function (exports) { 'use strict'; const localIsNaN = isNaN; const isNaN$1 = localIsNaN; exports.isNaN = isNaN$1; })); rollup-3.29.4/test/form/samples/export-globals/main.js000066400000000000000000000001071450520414700227400ustar00rootroot00000000000000import * as Number from './Number'; export const isNaN = Number.isNaN; rollup-3.29.4/test/form/samples/export-internal-namespace-as/000077500000000000000000000000001450520414700242045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-internal-namespace-as/_config.js000066400000000000000000000001601450520414700261430ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports exporting and resolving internal namespaces as names' }); rollup-3.29.4/test/form/samples/export-internal-namespace-as/_expected.js000066400000000000000000000003431450520414700265020ustar00rootroot00000000000000const foo$1 = 'foo1'; const foo = 'foo2'; const bar = 'bar2'; var dep2 = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); console.log(foo$1); console.log(foo$1); console.log(dep2); console.log(dep2); rollup-3.29.4/test/form/samples/export-internal-namespace-as/dep1.js000066400000000000000000000000661450520414700253750ustar00rootroot00000000000000export const foo = 'foo1'; export const bar = 'bar1'; rollup-3.29.4/test/form/samples/export-internal-namespace-as/dep2.js000066400000000000000000000000661450520414700253760ustar00rootroot00000000000000export const foo = 'foo2'; export const bar = 'bar2'; rollup-3.29.4/test/form/samples/export-internal-namespace-as/main.js000066400000000000000000000004001450520414700254600ustar00rootroot00000000000000import * as dep1 from './dep1.js'; import * as dep2 from './dep2.js'; import { dep1 as reexportedDep1, dep2 as reexportedDep2 } from './reexport.js'; console.log(reexportedDep1.foo); console.log(dep1.foo); console.log(reexportedDep2); console.log(dep2); rollup-3.29.4/test/form/samples/export-internal-namespace-as/reexport.js000066400000000000000000000001061450520414700264070ustar00rootroot00000000000000export * as dep1 from './dep1.js'; export * as dep2 from './dep2.js'; rollup-3.29.4/test/form/samples/export-live-bindings/000077500000000000000000000000001450520414700225675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-live-bindings/_config.js000066400000000000000000000001711450520414700245300ustar00rootroot00000000000000module.exports = defineTest({ description: 'exported live bindings', options: { output: { name: 'iife' } } }); rollup-3.29.4/test/form/samples/export-live-bindings/_expected/000077500000000000000000000000001450520414700245275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-live-bindings/_expected/amd.js000066400000000000000000000011021450520414700256200ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function update$2 () { exports.foo += 10; } exports.foo = 10; function update$1 () { exports.bar++; } exports.bar = 10; function update () { ++exports.baz; } exports.baz = 10; console.log(exports.foo); update$2(); console.log(exports.foo); console.log(exports.bar); update$1(); console.log(exports.bar); console.log(exports.baz); update(); console.log(exports.baz); exports.updateBar = update$1; exports.updateBaz = update; exports.updateFoo = update$2; })); rollup-3.29.4/test/form/samples/export-live-bindings/_expected/cjs.js000066400000000000000000000007421450520414700256470ustar00rootroot00000000000000'use strict'; function update$2 () { exports.foo += 10; } exports.foo = 10; function update$1 () { exports.bar++; } exports.bar = 10; function update () { ++exports.baz; } exports.baz = 10; console.log(exports.foo); update$2(); console.log(exports.foo); console.log(exports.bar); update$1(); console.log(exports.bar); console.log(exports.baz); update(); console.log(exports.baz); exports.updateBar = update$1; exports.updateBaz = update; exports.updateFoo = update$2; rollup-3.29.4/test/form/samples/export-live-bindings/_expected/es.js000066400000000000000000000006041450520414700254740ustar00rootroot00000000000000function update$2 () { foo += 10; } let foo = 10; function update$1 () { bar++; } let bar = 10; function update () { ++baz; } let baz = 10; console.log(foo); update$2(); console.log(foo); console.log(bar); update$1(); console.log(bar); console.log(baz); update(); console.log(baz); export { bar, baz, foo, update$1 as updateBar, update as updateBaz, update$2 as updateFoo }; rollup-3.29.4/test/form/samples/export-live-bindings/_expected/iife.js000066400000000000000000000011211450520414700257740ustar00rootroot00000000000000var iife = (function (exports) { 'use strict'; function update$2 () { exports.foo += 10; } exports.foo = 10; function update$1 () { exports.bar++; } exports.bar = 10; function update () { ++exports.baz; } exports.baz = 10; console.log(exports.foo); update$2(); console.log(exports.foo); console.log(exports.bar); update$1(); console.log(exports.bar); console.log(exports.baz); update(); console.log(exports.baz); exports.updateBar = update$1; exports.updateBaz = update; exports.updateFoo = update$2; return exports; })({}); rollup-3.29.4/test/form/samples/export-live-bindings/_expected/system.js000066400000000000000000000013701450520414700264120ustar00rootroot00000000000000System.register('iife', [], (function (exports) { 'use strict'; return { execute: (function () { exports({ updateBar: update$1, updateBaz: update, updateFoo: update$2 }); function update$2 () { exports('foo', foo += 10); } let foo = exports('foo', 10); function update$1 () { exports('bar', bar + 1), bar++; } let bar = exports('bar', 10); function update () { exports('baz', ++baz); } let baz = exports('baz', 10); console.log(foo); update$2(); console.log(foo); console.log(bar); update$1(); console.log(bar); console.log(baz); update(); console.log(baz); }) }; })); rollup-3.29.4/test/form/samples/export-live-bindings/_expected/umd.js000066400000000000000000000015401450520414700256520ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.iife = {})); })(this, (function (exports) { 'use strict'; function update$2 () { exports.foo += 10; } exports.foo = 10; function update$1 () { exports.bar++; } exports.bar = 10; function update () { ++exports.baz; } exports.baz = 10; console.log(exports.foo); update$2(); console.log(exports.foo); console.log(exports.bar); update$1(); console.log(exports.bar); console.log(exports.baz); update(); console.log(exports.baz); exports.updateBar = update$1; exports.updateBaz = update; exports.updateFoo = update$2; })); rollup-3.29.4/test/form/samples/export-live-bindings/bar.js000066400000000000000000000000741450520414700236720ustar00rootroot00000000000000export function update () { bar++; } export let bar = 10;rollup-3.29.4/test/form/samples/export-live-bindings/baz.js000066400000000000000000000000741450520414700237020ustar00rootroot00000000000000export function update () { ++baz; } export let baz = 10;rollup-3.29.4/test/form/samples/export-live-bindings/foo.js000066400000000000000000000001001450520414700236770ustar00rootroot00000000000000export function update () { foo += 10; } export let foo = 10;rollup-3.29.4/test/form/samples/export-live-bindings/main.js000066400000000000000000000005451450520414700240550ustar00rootroot00000000000000import { update as updateFoo, foo } from './foo'; import { update as updateBar, bar } from './bar'; import { update as updateBaz, baz } from './baz'; console.log(foo); updateFoo(); console.log(foo); console.log(bar); updateBar(); console.log(bar); console.log(baz); updateBaz(); console.log(baz); export { updateFoo, updateBar, updateBaz, foo, bar, baz } rollup-3.29.4/test/form/samples/export-multiple-vars/000077500000000000000000000000001450520414700226415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-multiple-vars/_config.js000066400000000000000000000001511450520414700246000ustar00rootroot00000000000000module.exports = defineTest({ description: 'splits up multiple vars in a single export declaration' }); rollup-3.29.4/test/form/samples/export-multiple-vars/_expected/000077500000000000000000000000001450520414700246015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-multiple-vars/_expected/amd.js000066400000000000000000000002271450520414700257010ustar00rootroot00000000000000define((function () { 'use strict'; var a = 1; var e = 5; var i = 9; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); })); rollup-3.29.4/test/form/samples/export-multiple-vars/_expected/cjs.js000066400000000000000000000001651450520414700257200ustar00rootroot00000000000000'use strict'; var a = 1; var e = 5; var i = 9; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); rollup-3.29.4/test/form/samples/export-multiple-vars/_expected/es.js000066400000000000000000000001461450520414700255470ustar00rootroot00000000000000var a = 1; var e = 5; var i = 9; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); rollup-3.29.4/test/form/samples/export-multiple-vars/_expected/iife.js000066400000000000000000000002221450520414700260470ustar00rootroot00000000000000(function () { 'use strict'; var a = 1; var e = 5; var i = 9; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); })(); rollup-3.29.4/test/form/samples/export-multiple-vars/_expected/system.js000066400000000000000000000003361450520414700264650ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var a = 1; var e = 5; var i = 9; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); }) }; })); rollup-3.29.4/test/form/samples/export-multiple-vars/_expected/umd.js000066400000000000000000000003651450520414700257300ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var a = 1; var e = 5; var i = 9; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); })); rollup-3.29.4/test/form/samples/export-multiple-vars/bar.js000066400000000000000000000000401450520414700237350ustar00rootroot00000000000000export var d = 4, e = 5, f = 6; rollup-3.29.4/test/form/samples/export-multiple-vars/baz.js000066400000000000000000000000401450520414700237450ustar00rootroot00000000000000export var g = 7, h = 8, i = 9; rollup-3.29.4/test/form/samples/export-multiple-vars/foo.js000066400000000000000000000000401450520414700237540ustar00rootroot00000000000000export var a = 1, b = 2, c = 3; rollup-3.29.4/test/form/samples/export-multiple-vars/main.js000066400000000000000000000002241450520414700241210ustar00rootroot00000000000000import { a } from './foo'; import { e } from './bar'; import { i } from './baz'; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); rollup-3.29.4/test/form/samples/export-namespace-as/000077500000000000000000000000001450520414700223725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-namespace-as/_config.js000066400000000000000000000002231450520414700243310ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports exporting namespaces as names in entry points', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/export-namespace-as/_expected/000077500000000000000000000000001450520414700243325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/export-namespace-as/_expected/amd.js000066400000000000000000000003261450520414700254320ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); exports.dep = dep; })); rollup-3.29.4/test/form/samples/export-namespace-as/_expected/cjs.js000066400000000000000000000002361450520414700254500ustar00rootroot00000000000000'use strict'; const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); exports.dep = dep; rollup-3.29.4/test/form/samples/export-namespace-as/_expected/es.js000066400000000000000000000002141450520414700252740ustar00rootroot00000000000000const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); export { dep }; rollup-3.29.4/test/form/samples/export-namespace-as/_expected/iife.js000066400000000000000000000003451450520414700256060ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); exports.dep = dep; return exports; })({}); rollup-3.29.4/test/form/samples/export-namespace-as/_expected/system.js000066400000000000000000000004371450520414700262200ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); exports('dep', dep); }) }; })); rollup-3.29.4/test/form/samples/export-namespace-as/_expected/umd.js000066400000000000000000000007631450520414700254630ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); exports.dep = dep; })); rollup-3.29.4/test/form/samples/export-namespace-as/dep.js000066400000000000000000000000661450520414700235020ustar00rootroot00000000000000export const foo = 'foo1'; export const bar = 'bar1'; rollup-3.29.4/test/form/samples/export-namespace-as/main.js000066400000000000000000000000411450520414700236470ustar00rootroot00000000000000export * as dep from './dep.js'; rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/000077500000000000000000000000001450520414700255355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/_config.js000066400000000000000000000002411450520414700274740ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles exporting class declarations with name conflicts in SystemJS', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/_expected/000077500000000000000000000000001450520414700274755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/_expected/amd.js000066400000000000000000000002311450520414700305700ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let Foo$1 = class Foo {}; class Foo {} exports.First = Foo$1; exports.Second = Foo; })); rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/_expected/cjs.js000066400000000000000000000001451450520414700306120ustar00rootroot00000000000000'use strict'; let Foo$1 = class Foo {}; class Foo {} exports.First = Foo$1; exports.Second = Foo; rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/_expected/es.js000066400000000000000000000001231450520414700304360ustar00rootroot00000000000000let Foo$1 = class Foo {}; class Foo {} export { Foo$1 as First, Foo as Second }; rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/_expected/iife.js000066400000000000000000000002501450520414700307440ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; let Foo$1 = class Foo {}; class Foo {} exports.First = Foo$1; exports.Second = Foo; return exports; })({}); rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/_expected/system.js000066400000000000000000000003261450520414700313600ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { let Foo$1 = class Foo {}; exports('First', Foo$1); class Foo {} exports('Second', Foo); }) }; })); rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/_expected/umd.js000066400000000000000000000006661450520414700306300ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; let Foo$1 = class Foo {}; class Foo {} exports.First = Foo$1; exports.Second = Foo; })); rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/first.js000066400000000000000000000000351450520414700272200ustar00rootroot00000000000000class Foo {} export { Foo }; rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/main.js000066400000000000000000000001221450520414700270120ustar00rootroot00000000000000export { Foo as First } from './first'; export { Foo as Second } from './second'; rollup-3.29.4/test/form/samples/exported-class-declaration-conflict/second.js000066400000000000000000000000351450520414700273440ustar00rootroot00000000000000class Foo {} export { Foo }; rollup-3.29.4/test/form/samples/exports-at-end-if-possible/000077500000000000000000000000001450520414700236025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/exports-at-end-if-possible/_config.js000066400000000000000000000002041450520414700255400ustar00rootroot00000000000000module.exports = defineTest({ description: 'exports variables at end, if possible', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/exports-at-end-if-possible/_expected/000077500000000000000000000000001450520414700255425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/exports-at-end-if-possible/_expected/amd.js000066400000000000000000000002461450520414700266430ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); exports.FOO = FOO; })); rollup-3.29.4/test/form/samples/exports-at-end-if-possible/_expected/cjs.js000066400000000000000000000001611450520414700266550ustar00rootroot00000000000000'use strict'; var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); exports.FOO = FOO; rollup-3.29.4/test/form/samples/exports-at-end-if-possible/_expected/es.js000066400000000000000000000001371450520414700265100ustar00rootroot00000000000000var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); export { FOO }; rollup-3.29.4/test/form/samples/exports-at-end-if-possible/_expected/iife.js000066400000000000000000000002671450520414700270210ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); exports.FOO = FOO; return exports; })({}); rollup-3.29.4/test/form/samples/exports-at-end-if-possible/_expected/system.js000066400000000000000000000003431450520414700274240ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var FOO = exports('FOO', 'foo'); console.log( FOO ); console.log( FOO ); console.log( FOO ); }) }; })); rollup-3.29.4/test/form/samples/exports-at-end-if-possible/_expected/umd.js000066400000000000000000000007051450520414700266670ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {})); })(this, (function (exports) { 'use strict'; var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); exports.FOO = FOO; })); rollup-3.29.4/test/form/samples/exports-at-end-if-possible/main.js000066400000000000000000000001251450520414700250620ustar00rootroot00000000000000export var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); rollup-3.29.4/test/form/samples/extend-exports/000077500000000000000000000000001450520414700215075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/extend-exports/_config.js000066400000000000000000000002131450520414700234450ustar00rootroot00000000000000module.exports = defineTest({ description: 'extends module correctly', options: { output: { extend: true, name: 'foo' } } }); rollup-3.29.4/test/form/samples/extend-exports/_expected/000077500000000000000000000000001450520414700234475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/extend-exports/_expected/amd.js000066400000000000000000000001561450520414700245500ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const answer = 42; exports.answer = answer; })); rollup-3.29.4/test/form/samples/extend-exports/_expected/cjs.js000066400000000000000000000000741450520414700245650ustar00rootroot00000000000000'use strict'; const answer = 42; exports.answer = answer; rollup-3.29.4/test/form/samples/extend-exports/_expected/es.js000066400000000000000000000000471450520414700244150ustar00rootroot00000000000000const answer = 42; export { answer }; rollup-3.29.4/test/form/samples/extend-exports/_expected/iife.js000066400000000000000000000001651450520414700247230ustar00rootroot00000000000000(function (exports) { 'use strict'; const answer = 42; exports.answer = answer; })(this.foo = this.foo || {}); rollup-3.29.4/test/form/samples/extend-exports/_expected/system.js000066400000000000000000000002351450520414700253310ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { const answer = exports('answer', 42); }) }; })); rollup-3.29.4/test/form/samples/extend-exports/_expected/umd.js000066400000000000000000000006261450520414700245760ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foo = global.foo || {})); })(this, (function (exports) { 'use strict'; const answer = 42; exports.answer = answer; })); rollup-3.29.4/test/form/samples/extend-exports/main.js000066400000000000000000000000321450520414700227640ustar00rootroot00000000000000export const answer = 42; rollup-3.29.4/test/form/samples/extend-namespaced-exports/000077500000000000000000000000001450520414700236055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/extend-namespaced-exports/_config.js000066400000000000000000000002311450520414700255430ustar00rootroot00000000000000module.exports = defineTest({ description: 'extends namespaced module name', options: { output: { extend: true, name: 'foo.bar.baz' } } }); rollup-3.29.4/test/form/samples/extend-namespaced-exports/_expected/000077500000000000000000000000001450520414700255455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/extend-namespaced-exports/_expected/amd.js000066400000000000000000000001561450520414700266460ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const answer = 42; exports.answer = answer; })); rollup-3.29.4/test/form/samples/extend-namespaced-exports/_expected/cjs.js000066400000000000000000000000741450520414700266630ustar00rootroot00000000000000'use strict'; const answer = 42; exports.answer = answer; rollup-3.29.4/test/form/samples/extend-namespaced-exports/_expected/es.js000066400000000000000000000000471450520414700265130ustar00rootroot00000000000000const answer = 42; export { answer }; rollup-3.29.4/test/form/samples/extend-namespaced-exports/_expected/iife.js000066400000000000000000000003031450520414700270130ustar00rootroot00000000000000this.foo = this.foo || {}; this.foo.bar = this.foo.bar || {}; (function (exports) { 'use strict'; const answer = 42; exports.answer = answer; })(this.foo.bar.baz = this.foo.bar.baz || {}); rollup-3.29.4/test/form/samples/extend-namespaced-exports/_expected/system.js000066400000000000000000000002451450520414700274300ustar00rootroot00000000000000System.register('foo.bar.baz', [], (function (exports) { 'use strict'; return { execute: (function () { const answer = exports('answer', 42); }) }; })); rollup-3.29.4/test/form/samples/extend-namespaced-exports/_expected/umd.js000066400000000000000000000007561450520414700267000ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.foo = global.foo || {}, global.foo.bar = global.foo.bar || {}, global.foo.bar.baz = global.foo.bar.baz || {}))); })(this, (function (exports) { 'use strict'; const answer = 42; exports.answer = answer; })); rollup-3.29.4/test/form/samples/extend-namespaced-exports/main.js000066400000000000000000000000321450520414700250620ustar00rootroot00000000000000export const answer = 42; rollup-3.29.4/test/form/samples/external-deshadowing/000077500000000000000000000000001450520414700226325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-deshadowing/_config.js000066400000000000000000000003011450520414700245660ustar00rootroot00000000000000module.exports = defineTest({ description: 'Externals aliases with deshadowing', options: { external: ['a', 'b'], output: { globals: { a: 'a', b: 'b' }, name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/external-deshadowing/_expected/000077500000000000000000000000001450520414700245725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-deshadowing/_expected/amd.js000066400000000000000000000003611450520414700256710ustar00rootroot00000000000000define(['exports', 'a', 'b'], (function (exports, a, Test$1) { 'use strict'; const Test = () => { console.log(a.Test); }; const Test1 = () => { console.log(Test$1); }; exports.Test = Test; exports.Test1 = Test1; })); rollup-3.29.4/test/form/samples/external-deshadowing/_expected/cjs.js000066400000000000000000000003161450520414700257070ustar00rootroot00000000000000'use strict'; var a = require('a'); var Test$1 = require('b'); const Test = () => { console.log(a.Test); }; const Test1 = () => { console.log(Test$1); }; exports.Test = Test; exports.Test1 = Test1; rollup-3.29.4/test/form/samples/external-deshadowing/_expected/es.js000066400000000000000000000002661450520414700255430ustar00rootroot00000000000000import { Test as Test$1 } from 'a'; import Test$2 from 'b'; const Test = () => { console.log(Test$1); }; const Test1 = () => { console.log(Test$2); }; export { Test, Test1 }; rollup-3.29.4/test/form/samples/external-deshadowing/_expected/iife.js000066400000000000000000000004001450520414700260360ustar00rootroot00000000000000var myBundle = (function (exports, a, Test$1) { 'use strict'; const Test = () => { console.log(a.Test); }; const Test1 = () => { console.log(Test$1); }; exports.Test = Test; exports.Test1 = Test1; return exports; })({}, a, b); rollup-3.29.4/test/form/samples/external-deshadowing/_expected/system.js000066400000000000000000000007051450520414700264560ustar00rootroot00000000000000System.register('myBundle', ['a', 'b'], (function (exports) { 'use strict'; var Test$1, Test$2; return { setters: [function (module) { Test$1 = module.Test; }, function (module) { Test$2 = module.default; }], execute: (function () { const Test = exports('Test', () => { console.log(Test$1); }); const Test1 = exports('Test1', () => { console.log(Test$2); }); }) }; })); rollup-3.29.4/test/form/samples/external-deshadowing/_expected/umd.js000066400000000000000000000011031450520414700257100ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('a'), require('b')) : typeof define === 'function' && define.amd ? define(['exports', 'a', 'b'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {}, global.a, global.b)); })(this, (function (exports, a, Test$1) { 'use strict'; const Test = () => { console.log(a.Test); }; const Test1 = () => { console.log(Test$1); }; exports.Test = Test; exports.Test1 = Test1; })); rollup-3.29.4/test/form/samples/external-deshadowing/component-one.js000066400000000000000000000001301450520414700257430ustar00rootroot00000000000000import { Test as Test1 } from 'a'; export const Test = () => { console.log(Test1); };rollup-3.29.4/test/form/samples/external-deshadowing/component-two.js000066400000000000000000000001131450520414700257740ustar00rootroot00000000000000import Test from 'b'; export const Test1 = () => { console.log(Test); };rollup-3.29.4/test/form/samples/external-deshadowing/main.js000066400000000000000000000001261450520414700241130ustar00rootroot00000000000000export { Test } from './component-one.js'; export { Test1 } from './component-two.js';rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/000077500000000000000000000000001450520414700250735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/_config.js000066400000000000000000000004571450520414700270430ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not expect a global to be provided for empty imports (#1217)', options: { external: ['babel-polyfill', 'other'], onwarn(warning) { throw new Error(warning.message); }, output: { name: 'myBundle', globals: { other: 'other' } } } }); rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/_expected/000077500000000000000000000000001450520414700270335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/_expected/amd.js000066400000000000000000000002231450520414700301270ustar00rootroot00000000000000define(['babel-polyfill', 'other'], (function (babelPolyfill, other) { 'use strict'; other.x(); var main = new WeakMap(); return main; })); rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/_expected/cjs.js000066400000000000000000000002071450520414700301470ustar00rootroot00000000000000'use strict'; require('babel-polyfill'); var other = require('other'); other.x(); var main = new WeakMap(); module.exports = main; rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/_expected/es.js000066400000000000000000000001621450520414700277770ustar00rootroot00000000000000import 'babel-polyfill'; import { x } from 'other'; x(); var main = new WeakMap(); export { main as default }; rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/_expected/iife.js000066400000000000000000000002131450520414700303010ustar00rootroot00000000000000var myBundle = (function (babelPolyfill, other) { 'use strict'; other.x(); var main = new WeakMap(); return main; })(null, other); rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/_expected/system.js000066400000000000000000000004211450520414700307120ustar00rootroot00000000000000System.register('myBundle', ['babel-polyfill', 'other'], (function (exports) { 'use strict'; var x; return { setters: [null, function (module) { x = module.x; }], execute: (function () { x(); var main = exports('default', new WeakMap()); }) }; })); rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/_expected/umd.js000066400000000000000000000007671450520414700301700ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('babel-polyfill'), require('other')) : typeof define === 'function' && define.amd ? define(['babel-polyfill', 'other'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory(null, global.other)); })(this, (function (babelPolyfill, other) { 'use strict'; other.x(); var main = new WeakMap(); return main; })); rollup-3.29.4/test/form/samples/external-empty-import-no-global-b/main.js000066400000000000000000000001311450520414700263500ustar00rootroot00000000000000import 'babel-polyfill'; import { x } from 'other'; x(); export default new WeakMap(); rollup-3.29.4/test/form/samples/external-empty-import-no-global/000077500000000000000000000000001450520414700246545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-empty-import-no-global/_config.js000066400000000000000000000004061450520414700266160ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not expect a global to be provided for empty imports (#1217)', options: { external: ['babel-polyfill'], onwarn(warning) { throw new Error(warning.message); }, output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/external-empty-import-no-global/_expected/000077500000000000000000000000001450520414700266145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-empty-import-no-global/_expected/amd.js000066400000000000000000000001661450520414700277160ustar00rootroot00000000000000define(['babel-polyfill'], (function (babelPolyfill) { 'use strict'; var main = new WeakMap(); return main; })); rollup-3.29.4/test/form/samples/external-empty-import-no-global/_expected/cjs.js000066400000000000000000000001351450520414700277300ustar00rootroot00000000000000'use strict'; require('babel-polyfill'); var main = new WeakMap(); module.exports = main; rollup-3.29.4/test/form/samples/external-empty-import-no-global/_expected/es.js000066400000000000000000000001211450520414700275530ustar00rootroot00000000000000import 'babel-polyfill'; var main = new WeakMap(); export { main as default }; rollup-3.29.4/test/form/samples/external-empty-import-no-global/_expected/iife.js000066400000000000000000000001371450520414700300670ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = new WeakMap(); return main; })(); rollup-3.29.4/test/form/samples/external-empty-import-no-global/_expected/system.js000066400000000000000000000003151450520414700304750ustar00rootroot00000000000000System.register('myBundle', ['babel-polyfill'], (function (exports) { 'use strict'; return { setters: [null], execute: (function () { var main = exports('default', new WeakMap()); }) }; })); rollup-3.29.4/test/form/samples/external-empty-import-no-global/_expected/umd.js000066400000000000000000000006511450520414700277410ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('babel-polyfill')) : typeof define === 'function' && define.amd ? define(['babel-polyfill'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = new WeakMap(); return main; })); rollup-3.29.4/test/form/samples/external-empty-import-no-global/main.js000066400000000000000000000000701450520414700261330ustar00rootroot00000000000000import 'babel-polyfill'; export default new WeakMap(); rollup-3.29.4/test/form/samples/external-export-tracing/000077500000000000000000000000001450520414700233045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-export-tracing/_config.js000066400000000000000000000003121450520414700252420ustar00rootroot00000000000000module.exports = defineTest({ description: 'Support external namespace reexport', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/external-export-tracing/_expected/000077500000000000000000000000001450520414700252445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-export-tracing/_expected/amd.js000066400000000000000000000003011450520414700263350ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; Object.defineProperty(exports, 's', { enumerable: true, get: function () { return external.p; } }); })); rollup-3.29.4/test/form/samples/external-export-tracing/_expected/cjs.js000066400000000000000000000002341450520414700263600ustar00rootroot00000000000000'use strict'; var external = require('external'); Object.defineProperty(exports, 's', { enumerable: true, get: function () { return external.p; } }); rollup-3.29.4/test/form/samples/external-export-tracing/_expected/es.js000066400000000000000000000000431450520414700262060ustar00rootroot00000000000000export { p as s } from 'external'; rollup-3.29.4/test/form/samples/external-export-tracing/_expected/iife.js000066400000000000000000000003201450520414700265110ustar00rootroot00000000000000var myBundle = (function (exports, external) { 'use strict'; Object.defineProperty(exports, 's', { enumerable: true, get: function () { return external.p; } }); return exports; })({}, external); rollup-3.29.4/test/form/samples/external-export-tracing/_expected/system.js000066400000000000000000000003051450520414700271240ustar00rootroot00000000000000System.register('myBundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('s', module.p); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/external-export-tracing/_expected/umd.js000066400000000000000000000010041450520414700263620ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; Object.defineProperty(exports, 's', { enumerable: true, get: function () { return external.p; } }); })); rollup-3.29.4/test/form/samples/external-export-tracing/dep.js000066400000000000000000000000641450520414700244120ustar00rootroot00000000000000import { p as q } from 'external'; export { q as r }rollup-3.29.4/test/form/samples/external-export-tracing/main.js000066400000000000000000000000421450520414700245620ustar00rootroot00000000000000export { r as s } from './dep.js';rollup-3.29.4/test/form/samples/external-import-alias-shadow/000077500000000000000000000000001450520414700242225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-import-alias-shadow/_config.js000066400000000000000000000003101450520414700261560ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles external aliased named imports that shadow another name', options: { external: ['acorn'], output: { globals: { acorn: 'acorn' } } } }); rollup-3.29.4/test/form/samples/external-import-alias-shadow/_expected/000077500000000000000000000000001450520414700261625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-import-alias-shadow/_expected/amd.js000066400000000000000000000002471450520414700272640ustar00rootroot00000000000000define(['acorn'], (function (acorn) { 'use strict'; function parse(source) { return acorn.parse(source, { ecmaVersion: 6 }); } console.log(parse('foo')); })); rollup-3.29.4/test/form/samples/external-import-alias-shadow/_expected/cjs.js000066400000000000000000000002261450520414700272770ustar00rootroot00000000000000'use strict'; var acorn = require('acorn'); function parse(source) { return acorn.parse(source, { ecmaVersion: 6 }); } console.log(parse('foo')); rollup-3.29.4/test/form/samples/external-import-alias-shadow/_expected/es.js000066400000000000000000000002171450520414700271270ustar00rootroot00000000000000import { parse as parse$1 } from 'acorn'; function parse(source) { return parse$1(source, { ecmaVersion: 6 }); } console.log(parse('foo')); rollup-3.29.4/test/form/samples/external-import-alias-shadow/_expected/iife.js000066400000000000000000000002341450520414700274330ustar00rootroot00000000000000(function (acorn) { 'use strict'; function parse(source) { return acorn.parse(source, { ecmaVersion: 6 }); } console.log(parse('foo')); })(acorn); rollup-3.29.4/test/form/samples/external-import-alias-shadow/_expected/system.js000066400000000000000000000004541450520414700300470ustar00rootroot00000000000000System.register(['acorn'], (function () { 'use strict'; var parse$1; return { setters: [function (module) { parse$1 = module.parse; }], execute: (function () { function parse(source) { return parse$1(source, { ecmaVersion: 6 }); } console.log(parse('foo')); }) }; })); rollup-3.29.4/test/form/samples/external-import-alias-shadow/_expected/umd.js000066400000000000000000000007071450520414700273110ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('acorn')) : typeof define === 'function' && define.amd ? define(['acorn'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.acorn)); })(this, (function (acorn) { 'use strict'; function parse(source) { return acorn.parse(source, { ecmaVersion: 6 }); } console.log(parse('foo')); })); rollup-3.29.4/test/form/samples/external-import-alias-shadow/main.js000066400000000000000000000000711450520414700255020ustar00rootroot00000000000000import parse from './parse'; console.log(parse('foo')); rollup-3.29.4/test/form/samples/external-import-alias-shadow/parse.js000066400000000000000000000002101450520414700256630ustar00rootroot00000000000000import { parse as acornParse } from 'acorn'; export default function parse(source) { return acornParse(source, { ecmaVersion: 6 }); } rollup-3.29.4/test/form/samples/external-import-order/000077500000000000000000000000001450520414700227615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-import-order/_config.js000066400000000000000000000002531450520414700247230ustar00rootroot00000000000000module.exports = defineTest({ description: 'Retain the execution order of external imports', options: { external(id) { return id.startsWith('external'); } } }); rollup-3.29.4/test/form/samples/external-import-order/_expected.js000066400000000000000000000001641450520414700252600ustar00rootroot00000000000000import 'external-main1'; import 'external-dep'; import 'external-main2'; console.log('dep'); console.log('main'); rollup-3.29.4/test/form/samples/external-import-order/dep.js000066400000000000000000000000541450520414700240660ustar00rootroot00000000000000import 'external-dep'; console.log('dep'); rollup-3.29.4/test/form/samples/external-import-order/main.js000066400000000000000000000001331450520414700242400ustar00rootroot00000000000000import 'external-main1'; import './dep.js'; import 'external-main2'; console.log('main'); rollup-3.29.4/test/form/samples/external-imports-custom-names-function/000077500000000000000000000000001450520414700262675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-imports-custom-names-function/_config.js000066400000000000000000000003161450520414700302310ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows globals to be specified as a function', options: { external: ['a-b-c'], output: { globals(id) { return id.replace(/-/g, '_'); } } } }); rollup-3.29.4/test/form/samples/external-imports-custom-names-function/_expected/000077500000000000000000000000001450520414700302275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-imports-custom-names-function/_expected/amd.js000066400000000000000000000001051450520414700313220ustar00rootroot00000000000000define(['a-b-c'], (function (aBC) { 'use strict'; aBC.foo(); })); rollup-3.29.4/test/form/samples/external-imports-custom-names-function/_expected/cjs.js000066400000000000000000000000671450520414700313470ustar00rootroot00000000000000'use strict'; var aBC = require('a-b-c'); aBC.foo(); rollup-3.29.4/test/form/samples/external-imports-custom-names-function/_expected/es.js000066400000000000000000000000451450520414700311730ustar00rootroot00000000000000import { foo } from 'a-b-c'; foo(); rollup-3.29.4/test/form/samples/external-imports-custom-names-function/_expected/iife.js000066400000000000000000000000721450520414700315000ustar00rootroot00000000000000(function (aBC) { 'use strict'; aBC.foo(); })(a_b_c); rollup-3.29.4/test/form/samples/external-imports-custom-names-function/_expected/system.js000066400000000000000000000002741450520414700321140ustar00rootroot00000000000000System.register(['a-b-c'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.foo; }], execute: (function () { foo(); }) }; })); rollup-3.29.4/test/form/samples/external-imports-custom-names-function/_expected/umd.js000066400000000000000000000005451450520414700313560ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('a-b-c')) : typeof define === 'function' && define.amd ? define(['a-b-c'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.a_b_c)); })(this, (function (aBC) { 'use strict'; aBC.foo(); })); rollup-3.29.4/test/form/samples/external-imports-custom-names-function/main.js000066400000000000000000000000441450520414700275470ustar00rootroot00000000000000import { foo } from 'a-b-c'; foo(); rollup-3.29.4/test/form/samples/external-imports-custom-names/000077500000000000000000000000001450520414700244445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-imports-custom-names/_config.js000066400000000000000000000002771450520414700264140ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows global names to be specified for IIFE/UMD exports', options: { external: ['jquery'], output: { globals: { jquery: 'jQuery' } } } }); rollup-3.29.4/test/form/samples/external-imports-custom-names/_expected/000077500000000000000000000000001450520414700264045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-imports-custom-names/_expected/amd.js000066400000000000000000000001761450520414700275070ustar00rootroot00000000000000define(['jquery'], (function ($) { 'use strict'; $( function () { $( 'body' ).html( '

hello world!

' ); }); })); rollup-3.29.4/test/form/samples/external-imports-custom-names/_expected/cjs.js000066400000000000000000000001561450520414700275230ustar00rootroot00000000000000'use strict'; var $ = require('jquery'); $( function () { $( 'body' ).html( '

hello world!

' ); }); rollup-3.29.4/test/form/samples/external-imports-custom-names/_expected/es.js000066400000000000000000000001341450520414700273470ustar00rootroot00000000000000import $ from 'jquery'; $( function () { $( 'body' ).html( '

hello world!

' ); }); rollup-3.29.4/test/form/samples/external-imports-custom-names/_expected/iife.js000066400000000000000000000001631450520414700276560ustar00rootroot00000000000000(function ($) { 'use strict'; $( function () { $( 'body' ).html( '

hello world!

' ); }); })(jQuery); rollup-3.29.4/test/form/samples/external-imports-custom-names/_expected/system.js000066400000000000000000000003771450520414700302750ustar00rootroot00000000000000System.register(['jquery'], (function () { 'use strict'; var $; return { setters: [function (module) { $ = module.default; }], execute: (function () { $( function () { $( 'body' ).html( '

hello world!

' ); }); }) }; })); rollup-3.29.4/test/form/samples/external-imports-custom-names/_expected/umd.js000066400000000000000000000006401450520414700275270ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery)); })(this, (function ($) { 'use strict'; $( function () { $( 'body' ).html( '

hello world!

' ); }); })); rollup-3.29.4/test/form/samples/external-imports-custom-names/main.js000066400000000000000000000001341450520414700257240ustar00rootroot00000000000000import $ from 'jquery'; $( function () { $( 'body' ).html( '

hello world!

' ); }); rollup-3.29.4/test/form/samples/external-imports/000077500000000000000000000000001450520414700220335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-imports/_config.js000066400000000000000000000005711450520414700240000ustar00rootroot00000000000000module.exports = defineTest({ description: 'prefixes global names with `global.` when creating UMD bundle (#57)', expectedWarnings: ['UNUSED_EXTERNAL_IMPORT'], options: { external: ['factory', 'baz', 'shipping-port', 'alphabet'], output: { globals: { alphabet: 'alphabet', baz: 'baz', factory: 'factory', 'shipping-port': 'containers' } } } }); rollup-3.29.4/test/form/samples/external-imports/_expected/000077500000000000000000000000001450520414700237735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-imports/_expected/amd.js000066400000000000000000000013771450520414700251020ustar00rootroot00000000000000define(['factory', 'baz', 'shipping-port', 'alphabet'], (function (factory, baz, containers, alphabet) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var containers__namespace = /*#__PURE__*/_interopNamespaceDefault(containers); factory( null ); baz.foo( baz.bar, containers.port ); containers__namespace.forEach( console.log, console ); console.log( alphabet.a ); console.log( alphabet.length ); })); rollup-3.29.4/test/form/samples/external-imports/_expected/cjs.js000066400000000000000000000014061450520414700251110ustar00rootroot00000000000000'use strict'; var factory = require('factory'); var baz = require('baz'); var containers = require('shipping-port'); var alphabet = require('alphabet'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var containers__namespace = /*#__PURE__*/_interopNamespaceDefault(containers); factory( null ); baz.foo( baz.bar, containers.port ); containers__namespace.forEach( console.log, console ); console.log( alphabet.a ); console.log( alphabet.length ); rollup-3.29.4/test/form/samples/external-imports/_expected/es.js000066400000000000000000000004741450520414700247450ustar00rootroot00000000000000import factory from 'factory'; import { foo, bar } from 'baz'; import * as containers from 'shipping-port'; import { port } from 'shipping-port'; import alphabet, { a } from 'alphabet'; factory( null ); foo( bar, port ); containers.forEach( console.log, console ); console.log( a ); console.log( alphabet.length ); rollup-3.29.4/test/form/samples/external-imports/_expected/iife.js000066400000000000000000000013531450520414700252470ustar00rootroot00000000000000(function (factory, baz, containers, alphabet) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var containers__namespace = /*#__PURE__*/_interopNamespaceDefault(containers); factory( null ); baz.foo( baz.bar, containers.port ); containers__namespace.forEach( console.log, console ); console.log( alphabet.a ); console.log( alphabet.length ); })(factory, baz, containers, alphabet); rollup-3.29.4/test/form/samples/external-imports/_expected/system.js000066400000000000000000000011601450520414700256530ustar00rootroot00000000000000System.register(['factory', 'baz', 'shipping-port', 'alphabet'], (function () { 'use strict'; var factory, foo, bar, port, containers, a, alphabet; return { setters: [function (module) { factory = module.default; }, function (module) { foo = module.foo; bar = module.bar; }, function (module) { port = module.port; containers = module; }, function (module) { a = module.a; alphabet = module.default; }], execute: (function () { factory( null ); foo( bar, port ); containers.forEach( console.log, console ); console.log( a ); console.log( alphabet.length ); }) }; })); rollup-3.29.4/test/form/samples/external-imports/_expected/umd.js000066400000000000000000000022221450520414700251140ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('factory'), require('baz'), require('shipping-port'), require('alphabet')) : typeof define === 'function' && define.amd ? define(['factory', 'baz', 'shipping-port', 'alphabet'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.factory, global.baz, global.containers, global.alphabet)); })(this, (function (factory, baz, containers, alphabet) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var containers__namespace = /*#__PURE__*/_interopNamespaceDefault(containers); factory( null ); baz.foo( baz.bar, containers.port ); containers__namespace.forEach( console.log, console ); console.log( alphabet.a ); console.log( alphabet.length ); })); rollup-3.29.4/test/form/samples/external-imports/main.js000066400000000000000000000004771450520414700233250ustar00rootroot00000000000000import factory from 'factory'; import { foo, bar } from 'baz'; import * as containers from 'shipping-port'; import { port } from 'shipping-port'; import alphabet, { a, b } from 'alphabet'; factory( null ); foo( bar, port ); containers.forEach( console.log, console ); console.log( a ); console.log( alphabet.length ); rollup-3.29.4/test/form/samples/external-modules-could-not-be-passed-to-the-manualChunks/000077500000000000000000000000001450520414700313765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-modules-could-not-be-passed-to-the-manualChunks/_config.js000066400000000000000000000005261450520414700333430ustar00rootroot00000000000000const text = "External modules couldn't be passed to the manualChunks."; module.exports = defineTest({ description: text, options: { external: id => { if (id.endsWith('external.js')) { return true; } }, output: { manualChunks(id) { if (id.endsWith('external.js')) { throw new Error(text); } } } } }); _expected.js000066400000000000000000000000301450520414700336060ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-modules-could-not-be-passed-to-the-manualChunksimport './external.js'; rollup-3.29.4/test/form/samples/external-modules-could-not-be-passed-to-the-manualChunks/main.js000066400000000000000000000000301450520414700326510ustar00rootroot00000000000000import './external.js'; rollup-3.29.4/test/form/samples/external-namespace-and-named/000077500000000000000000000000001450520414700241145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-namespace-and-named/_config.js000066400000000000000000000003251450520414700260560ustar00rootroot00000000000000module.exports = defineTest({ description: 'Correctly handles external namespace tracing with both namespace and named exports', options: { external: ['foo'], output: { globals: { foo: 'foo' } } } }); rollup-3.29.4/test/form/samples/external-namespace-and-named/_expected/000077500000000000000000000000001450520414700260545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-namespace-and-named/_expected/amd.js000066400000000000000000000011121450520414700271460ustar00rootroot00000000000000define(['foo'], (function (foo) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); console.log(foo__namespace); console.log(foo.blah); console.log(foo.bar); })); rollup-3.29.4/test/form/samples/external-namespace-and-named/_expected/cjs.js000066400000000000000000000010511450520414700271660ustar00rootroot00000000000000'use strict'; var foo = require('foo'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); console.log(foo__namespace); console.log(foo.blah); console.log(foo.bar); rollup-3.29.4/test/form/samples/external-namespace-and-named/_expected/es.js000066400000000000000000000001651450520414700270230ustar00rootroot00000000000000import * as foo from 'foo'; import { blah, bar } from 'foo'; console.log(foo); console.log(blah); console.log(bar); rollup-3.29.4/test/form/samples/external-namespace-and-named/_expected/iife.js000066400000000000000000000010771450520414700273330ustar00rootroot00000000000000(function (foo) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); console.log(foo__namespace); console.log(foo.blah); console.log(foo.bar); })(foo); rollup-3.29.4/test/form/samples/external-namespace-and-named/_expected/system.js000066400000000000000000000004431450520414700277370ustar00rootroot00000000000000System.register(['foo'], (function () { 'use strict'; var foo, blah, bar; return { setters: [function (module) { foo = module; blah = module.blah; bar = module.bar; }], execute: (function () { console.log(foo); console.log(blah); console.log(bar); }) }; })); rollup-3.29.4/test/form/samples/external-namespace-and-named/_expected/umd.js000066400000000000000000000015461450520414700272050ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('foo')) : typeof define === 'function' && define.amd ? define(['foo'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foo)); })(this, (function (foo) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); console.log(foo__namespace); console.log(foo.blah); console.log(foo.bar); })); rollup-3.29.4/test/form/samples/external-namespace-and-named/main.js000066400000000000000000000001621450520414700253750ustar00rootroot00000000000000import * as foo from 'foo'; import {blah, bar} from 'foo'; console.log(foo) console.log(blah); console.log(bar); rollup-3.29.4/test/form/samples/external-namespace-reexport/000077500000000000000000000000001450520414700241405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-namespace-reexport/_config.js000066400000000000000000000003201450520414700260750ustar00rootroot00000000000000module.exports = defineTest({ description: 'Support external namespace reexport', options: { external: ['highcharts'], output: { globals: { highcharts: 'highcharts' }, name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/external-namespace-reexport/_expected/000077500000000000000000000000001450520414700261005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/external-namespace-reexport/_expected/amd.js000066400000000000000000000011341450520414700271760ustar00rootroot00000000000000define(['exports', 'highcharts'], (function (exports, highcharts) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var highcharts__namespace = /*#__PURE__*/_interopNamespaceDefault(highcharts); exports.Highcharts = highcharts__namespace; })); rollup-3.29.4/test/form/samples/external-namespace-reexport/_expected/cjs.js000066400000000000000000000010511450520414700272120ustar00rootroot00000000000000'use strict'; var highcharts = require('highcharts'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var highcharts__namespace = /*#__PURE__*/_interopNamespaceDefault(highcharts); exports.Highcharts = highcharts__namespace; rollup-3.29.4/test/form/samples/external-namespace-reexport/_expected/es.js000066400000000000000000000001171450520414700270440ustar00rootroot00000000000000import * as highcharts from 'highcharts'; export { highcharts as Highcharts }; rollup-3.29.4/test/form/samples/external-namespace-reexport/_expected/iife.js000066400000000000000000000011531450520414700273520ustar00rootroot00000000000000var myBundle = (function (exports, highcharts) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var highcharts__namespace = /*#__PURE__*/_interopNamespaceDefault(highcharts); exports.Highcharts = highcharts__namespace; return exports; })({}, highcharts); rollup-3.29.4/test/form/samples/external-namespace-reexport/_expected/system.js000066400000000000000000000003161450520414700277620ustar00rootroot00000000000000System.register('myBundle', ['highcharts'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('Highcharts', module); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/external-namespace-reexport/_expected/umd.js000066400000000000000000000016451450520414700272310ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('highcharts')) : typeof define === 'function' && define.amd ? define(['exports', 'highcharts'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {}, global.highcharts)); })(this, (function (exports, highcharts) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var highcharts__namespace = /*#__PURE__*/_interopNamespaceDefault(highcharts); exports.Highcharts = highcharts__namespace; })); rollup-3.29.4/test/form/samples/external-namespace-reexport/dep.js000066400000000000000000000000771450520414700252520ustar00rootroot00000000000000import * as Highcharts from 'highcharts'; export { Highcharts }rollup-3.29.4/test/form/samples/external-namespace-reexport/main.js000066400000000000000000000000461450520414700254220ustar00rootroot00000000000000export { Highcharts } from './dep.js';rollup-3.29.4/test/form/samples/for-in-scopes/000077500000000000000000000000001450520414700212025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/for-in-scopes/_config.js000066400000000000000000000001641450520414700231450ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly associate or shadow variables in and around for-in-loops' }); rollup-3.29.4/test/form/samples/for-in-scopes/_expected.js000066400000000000000000000004271450520414700235030ustar00rootroot00000000000000var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated in { x: 1 } ) { associated = effect1; } associated(); var effect3 = () => console.log( 'effect' ); for ( const foo in { x: effect3() } ) { } for ( globalThis.unknown in { x: 1 } ) {} rollup-3.29.4/test/form/samples/for-in-scopes/main.js000066400000000000000000000007241450520414700224670ustar00rootroot00000000000000var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated in { x: 1 } ) { associated = effect1; } associated(); var effect2 = () => console.log( 'effect' ); var shadowed = () => {}; for ( let shadowed in { x: 1 } ) { shadowed = effect2; } shadowed(); var effect3 = () => console.log( 'effect' ); for ( const foo in { x: effect3() } ) { let effect3 = () => {}; // This can be removed } for ( globalThis.unknown in { x: 1 } ) {} rollup-3.29.4/test/form/samples/for-loop-assignment/000077500000000000000000000000001450520414700224215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/for-loop-assignment/_config.js000066400000000000000000000002161450520414700243620ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes assignments with computed indexes in for loops', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/for-loop-assignment/_expected.js000066400000000000000000000000011450520414700247060ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/for-loop-assignment/main.js000066400000000000000000000001201450520414700236740ustar00rootroot00000000000000const lut = []; for (let i = 0; i < 256; i++) { lut[i] = i < 16 ? '0' : ''; } rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/000077500000000000000000000000001450520414700242575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/_config.js000066400000000000000000000001661450520414700262240ustar00rootroot00000000000000module.exports = defineTest({ description: 'use a newline for line wraps removing a necessary semicolon (#1275)' }); rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/_expected/000077500000000000000000000000001450520414700262175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/_expected/amd.js000066400000000000000000000001321450520414700273120ustar00rootroot00000000000000define((function () { 'use strict'; for(var x=1;x<2;x++)var d=x|0;console.log(d); })); rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/_expected/cjs.js000066400000000000000000000000751450520414700273360ustar00rootroot00000000000000'use strict'; for(var x=1;x<2;x++)var d=x|0;console.log(d); rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/_expected/es.js000066400000000000000000000000561450520414700271650ustar00rootroot00000000000000for(var x=1;x<2;x++)var d=x|0;console.log(d); rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/_expected/iife.js000066400000000000000000000001251450520414700274670ustar00rootroot00000000000000(function () { 'use strict'; for(var x=1;x<2;x++)var d=x|0;console.log(d); })(); rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/_expected/system.js000066400000000000000000000002271450520414700301020ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { for(var x=1;x<2;x++)var d=x|0;console.log(d); }) }; })); rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/_expected/umd.js000066400000000000000000000002701450520414700273410ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; for(var x=1;x<2;x++)var d=x|0;console.log(d); })); rollup-3.29.4/test/form/samples/for-loop-body-var-declaration/main.js000066400000000000000000000000561450520414700255420ustar00rootroot00000000000000for(var x=1;x<2;x++)var d=x|0;console.log(d); rollup-3.29.4/test/form/samples/for-loop-with-empty-head/000077500000000000000000000000001450520414700232575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/for-loop-with-empty-head/_config.js000066400000000000000000000001231450520414700252150ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles for loop with empty head' }); rollup-3.29.4/test/form/samples/for-loop-with-empty-head/_expected/000077500000000000000000000000001450520414700252175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/for-loop-with-empty-head/_expected/amd.js000066400000000000000000000001221450520414700263110ustar00rootroot00000000000000define((function () { 'use strict'; for ( ; ; ) { console.log( 42 ); } })); rollup-3.29.4/test/form/samples/for-loop-with-empty-head/_expected/cjs.js000066400000000000000000000000631450520414700263330ustar00rootroot00000000000000'use strict'; for ( ; ; ) { console.log( 42 ); } rollup-3.29.4/test/form/samples/for-loop-with-empty-head/_expected/es.js000066400000000000000000000000441450520414700261620ustar00rootroot00000000000000for ( ; ; ) { console.log( 42 ); } rollup-3.29.4/test/form/samples/for-loop-with-empty-head/_expected/iife.js000066400000000000000000000001151450520414700264660ustar00rootroot00000000000000(function () { 'use strict'; for ( ; ; ) { console.log( 42 ); } })(); rollup-3.29.4/test/form/samples/for-loop-with-empty-head/_expected/system.js000066400000000000000000000002231450520414700270760ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { for ( ; ; ) { console.log( 42 ); } }) }; })); rollup-3.29.4/test/form/samples/for-loop-with-empty-head/_expected/umd.js000066400000000000000000000002601450520414700263400ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; for ( ; ; ) { console.log( 42 ); } })); rollup-3.29.4/test/form/samples/for-loop-with-empty-head/main.js000066400000000000000000000000441450520414700245370ustar00rootroot00000000000000for ( ; ; ) { console.log( 42 ); } rollup-3.29.4/test/form/samples/for-of-scopes/000077500000000000000000000000001450520414700212005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/for-of-scopes/_config.js000066400000000000000000000001641450520414700231430ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly associate or shadow variables in and around for-of-loops' }); rollup-3.29.4/test/form/samples/for-of-scopes/_expected.js000066400000000000000000000006071450520414700235010ustar00rootroot00000000000000var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated of [ effect1 ] ) {} associated(); var effect2 = () => console.log( 'effect' ); for ( let shadowed of [ effect2 ] ) {} var effect3 = () => console.log( 'effect' ); // Must not be removed! for ( const foo of [ effect3 ] ) { foo(); // Must not be removed! } for ( globalThis.unknown of [ 1 ] ) {} rollup-3.29.4/test/form/samples/for-of-scopes/main.js000066400000000000000000000007341450520414700224660ustar00rootroot00000000000000var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated of [ effect1 ] ) {} associated(); var effect2 = () => console.log( 'effect' ); let shadowed = () => {}; for ( let shadowed of [ effect2 ] ) {} shadowed(); var effect3 = () => console.log( 'effect' ); // Must not be removed! for ( const foo of [ effect3 ] ) { let effect3 = () => {}; // This can be removed foo(); // Must not be removed! } for ( globalThis.unknown of [ 1 ] ) {} rollup-3.29.4/test/form/samples/for-scopes/000077500000000000000000000000001450520414700205765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/for-scopes/_config.js000066400000000000000000000001611450520414700225360ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly associate or shadow variables in and around for-loops' }); rollup-3.29.4/test/form/samples/for-scopes/_expected/000077500000000000000000000000001450520414700225365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/for-scopes/_expected/amd.js000066400000000000000000000005231450520414700236350ustar00rootroot00000000000000define((function () { 'use strict'; var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated = effect1; true; ) { break; } associated(); var effect3 = () => console.log( 'effect' ); // Must not be removed! for ( let foo = effect3; true; ) { foo(); // Must not be removed! break; } })); rollup-3.29.4/test/form/samples/for-scopes/_expected/cjs.js000066400000000000000000000004541450520414700236560ustar00rootroot00000000000000'use strict'; var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated = effect1; true; ) { break; } associated(); var effect3 = () => console.log( 'effect' ); // Must not be removed! for ( let foo = effect3; true; ) { foo(); // Must not be removed! break; } rollup-3.29.4/test/form/samples/for-scopes/_expected/es.js000066400000000000000000000004351450520414700235050ustar00rootroot00000000000000var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated = effect1; true; ) { break; } associated(); var effect3 = () => console.log( 'effect' ); // Must not be removed! for ( let foo = effect3; true; ) { foo(); // Must not be removed! break; } rollup-3.29.4/test/form/samples/for-scopes/_expected/iife.js000066400000000000000000000005161450520414700240120ustar00rootroot00000000000000(function () { 'use strict'; var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated = effect1; true; ) { break; } associated(); var effect3 = () => console.log( 'effect' ); // Must not be removed! for ( let foo = effect3; true; ) { foo(); // Must not be removed! break; } })(); rollup-3.29.4/test/form/samples/for-scopes/_expected/system.js000066400000000000000000000006441450520414700244240ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated = effect1; true; ) { break; } associated(); var effect3 = () => console.log( 'effect' ); // Must not be removed! for ( let foo = effect3; true; ) { foo(); // Must not be removed! break; } }) }; })); rollup-3.29.4/test/form/samples/for-scopes/_expected/umd.js000066400000000000000000000006611450520414700236640ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated = effect1; true; ) { break; } associated(); var effect3 = () => console.log( 'effect' ); // Must not be removed! for ( let foo = effect3; true; ) { foo(); // Must not be removed! break; } })); rollup-3.29.4/test/form/samples/for-scopes/main.js000066400000000000000000000007221450520414700220610ustar00rootroot00000000000000var effect1 = () => console.log( 'effect' ); var associated = () => {}; for ( var associated = effect1; true; ) { break; } associated(); var effect2 = () => console.log( 'effect' ); let shadowed = () => {}; for ( let shadowed = effect2; true; ) { break; } shadowed(); var effect3 = () => console.log( 'effect' ); // Must not be removed! for ( let foo = effect3; true; ) { let effect3 = () => {}; // This can be removed foo(); // Must not be removed! break; } rollup-3.29.4/test/form/samples/freeze/000077500000000000000000000000001450520414700177765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/freeze/_config.js000066400000000000000000000002371450520414700217420ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports opt-ing out of usage of Object.freeze', options: { output: { name: 'myBundle', freeze: false } } }); rollup-3.29.4/test/form/samples/freeze/_expected/000077500000000000000000000000001450520414700217365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/freeze/_expected/amd.js000066400000000000000000000004121450520414700230320ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = { __proto__: null, bar: bar, foo: foo }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; })); rollup-3.29.4/test/form/samples/freeze/_expected/cjs.js000066400000000000000000000003161450520414700230530ustar00rootroot00000000000000'use strict'; const foo = 1; const bar = 2; var namespace = { __proto__: null, bar: bar, foo: foo }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; rollup-3.29.4/test/form/samples/freeze/_expected/es.js000066400000000000000000000002621450520414700227030ustar00rootroot00000000000000const foo = 1; const bar = 2; var namespace = { __proto__: null, bar: bar, foo: foo }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; export { a, b }; rollup-3.29.4/test/form/samples/freeze/_expected/iife.js000066400000000000000000000004331450520414700232100ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = { __proto__: null, bar: bar, foo: foo }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; return exports; })({}); rollup-3.29.4/test/form/samples/freeze/_expected/system.js000066400000000000000000000005231450520414700236200ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; const bar = 2; var namespace = { __proto__: null, bar: bar, foo: foo }; console.log( Object.keys( namespace ) ); const a = exports('a', 1); const b = exports('b', 2); }) }; })); rollup-3.29.4/test/form/samples/freeze/_expected/umd.js000066400000000000000000000010511450520414700230560ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {})); })(this, (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = { __proto__: null, bar: bar, foo: foo }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; })); rollup-3.29.4/test/form/samples/freeze/main.js000066400000000000000000000002001450520414700212500ustar00rootroot00000000000000import * as namespace from './namespace.js'; console.log( Object.keys( namespace ) ); export const a = 1; export const b = 2; rollup-3.29.4/test/form/samples/freeze/namespace.js000066400000000000000000000000531450520414700222660ustar00rootroot00000000000000export const foo = 1; export const bar = 2;rollup-3.29.4/test/form/samples/function-body-return-values/000077500000000000000000000000001450520414700241105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/function-body-return-values/_config.js000066400000000000000000000001461450520414700260530ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly extract return values from function bodies' }); rollup-3.29.4/test/form/samples/function-body-return-values/_expected.js000066400000000000000000000007661450520414700264170ustar00rootroot00000000000000function retained1 () { return () => console.log( 'effect' ); } retained1()(); function retained2 () { if ( globalThis.unknown ) { return () => console.log( 'effect' ); } return () => {}; } retained2()(); function retained3 () { if ( globalThis.unknown ) { return () => {}; } } retained3()(); function retained4 () {} retained4()(); function retained5 () { return {}; } retained5().x.y = 1; function retained6 () { return { x: () => console.log( 'effect' ) }; } retained6().x(); rollup-3.29.4/test/form/samples/function-body-return-values/main.js000066400000000000000000000012671450520414700254000ustar00rootroot00000000000000function removed1 () { return () => {}; } removed1()(); function removed2 () { return { x: {} }; } removed2().x.y = 1; function removed3 () { return { x: () => {} }; } removed3().x(); function retained1 () { return () => console.log( 'effect' ); } retained1()(); function retained2 () { if ( globalThis.unknown ) { return () => console.log( 'effect' ); } return () => {}; } retained2()(); function retained3 () { if ( globalThis.unknown ) { return () => {}; } } retained3()(); function retained4 () {} retained4()(); function retained5 () { return {}; } retained5().x.y = 1; function retained6 () { return { x: () => console.log( 'effect' ) }; } retained6().x(); rollup-3.29.4/test/form/samples/function-call-parameters/000077500000000000000000000000001450520414700234155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/function-call-parameters/_config.js000066400000000000000000000002141450520414700253540ustar00rootroot00000000000000module.exports = defineTest({ description: 'take actual parameters into account when determining side-effects of calls to functions' }); rollup-3.29.4/test/form/samples/function-call-parameters/_expected.js000066400000000000000000000017011450520414700257120ustar00rootroot00000000000000// parameters are associated correctly const retained1 = function ( func, obj ) { return func( obj ); }; retained1( obj => obj(), () => () => console.log( 'effect' ) )(); const retained2 = function ( func, obj ) { return func( obj ); }; retained2( obj => ({ foo: obj }), {} ).foo.bar.baz = 1; // parameters and arguments have the same values function retained3 ( x ) { x.foo.bar = 1; } retained3( {} ); function retained4 ( x ) { arguments[ 0 ].foo.bar = 1; } retained4( {} ); // assigning to an argument will change the corresponding parameter function retained5 ( x ) { arguments[ 0 ] = {}; x.foo.bar = 1; } retained5( { foo: {} } ); // assigning to a parameter will change the corresponding argument function retained6 ( x ) { x = {}; arguments[ 0 ].foo.bar = 1; } retained6( { foo: {} } ); // the number of arguments does not depend on the number of parameters function retained7 ( x ) { arguments[ 1 ].foo.bar = 1; } retained7( {}, {} ); rollup-3.29.4/test/form/samples/function-call-parameters/main.js000066400000000000000000000017011450520414700246760ustar00rootroot00000000000000// parameters are associated correctly const retained1 = function ( func, obj ) { return func( obj ); }; retained1( obj => obj(), () => () => console.log( 'effect' ) )(); const retained2 = function ( func, obj ) { return func( obj ); }; retained2( obj => ({ foo: obj }), {} ).foo.bar.baz = 1; // parameters and arguments have the same values function retained3 ( x ) { x.foo.bar = 1; } retained3( {} ); function retained4 ( x ) { arguments[ 0 ].foo.bar = 1; } retained4( {} ); // assigning to an argument will change the corresponding parameter function retained5 ( x ) { arguments[ 0 ] = {}; x.foo.bar = 1; } retained5( { foo: {} } ); // assigning to a parameter will change the corresponding argument function retained6 ( x ) { x = {}; arguments[ 0 ].foo.bar = 1; } retained6( { foo: {} } ); // the number of arguments does not depend on the number of parameters function retained7 ( x ) { arguments[ 1 ].foo.bar = 1; } retained7( {}, {} ); rollup-3.29.4/test/form/samples/function-iterable-prototype/000077500000000000000000000000001450520414700241735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/function-iterable-prototype/_config.js000066400000000000000000000002201450520414700261270ustar00rootroot00000000000000module.exports = defineTest({ description: 'Removes unused functions where the prototype is iterable', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/function-iterable-prototype/_expected.js000066400000000000000000000000011450520414700264600ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/function-iterable-prototype/main.js000066400000000000000000000001611450520414700254530ustar00rootroot00000000000000function AsyncGenerator(gen) {} AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; }; rollup-3.29.4/test/form/samples/function-mutation/000077500000000000000000000000001450520414700222015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/function-mutation/_config.js000066400000000000000000000002031450520414700241360ustar00rootroot00000000000000module.exports = defineTest({ description: 'function-mutations do not have effects', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/function-mutation/_expected/000077500000000000000000000000001450520414700241415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/function-mutation/_expected/amd.js000066400000000000000000000011601450520414700252360ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function foo () { console.log( 'foo' ); } const bar = function () { console.log( 'bar' ); }; const baz = () => console.log( 'baz' ); function a () { console.log( 'a' ); } a.foo = foo; const c = function () { console.log( 'c' ); }; c.bar = bar; const e = () => console.log( 'e' ); e.baz = baz; class g { constructor () { console.log( 'g' ); } } g.foo = foo; const i = class { constructor () { console.log( 'i' ); } }; i.foo = foo; exports.a = a; exports.c = c; exports.e = e; exports.g = g; exports.i = i; })); rollup-3.29.4/test/form/samples/function-mutation/_expected/cjs.js000066400000000000000000000010361450520414700252560ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'foo' ); } const bar = function () { console.log( 'bar' ); }; const baz = () => console.log( 'baz' ); function a () { console.log( 'a' ); } a.foo = foo; const c = function () { console.log( 'c' ); }; c.bar = bar; const e = () => console.log( 'e' ); e.baz = baz; class g { constructor () { console.log( 'g' ); } } g.foo = foo; const i = class { constructor () { console.log( 'i' ); } }; i.foo = foo; exports.a = a; exports.c = c; exports.e = e; exports.g = g; exports.i = i; rollup-3.29.4/test/form/samples/function-mutation/_expected/es.js000066400000000000000000000007361450520414700251140ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } const bar = function () { console.log( 'bar' ); }; const baz = () => console.log( 'baz' ); function a () { console.log( 'a' ); } a.foo = foo; const c = function () { console.log( 'c' ); }; c.bar = bar; const e = () => console.log( 'e' ); e.baz = baz; class g { constructor () { console.log( 'g' ); } } g.foo = foo; const i = class { constructor () { console.log( 'i' ); } }; i.foo = foo; export { a, c, e, g, i }; rollup-3.29.4/test/form/samples/function-mutation/_expected/iife.js000066400000000000000000000011771450520414700254210ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; function foo () { console.log( 'foo' ); } const bar = function () { console.log( 'bar' ); }; const baz = () => console.log( 'baz' ); function a () { console.log( 'a' ); } a.foo = foo; const c = function () { console.log( 'c' ); }; c.bar = bar; const e = () => console.log( 'e' ); e.baz = baz; class g { constructor () { console.log( 'g' ); } } g.foo = foo; const i = class { constructor () { console.log( 'i' ); } }; i.foo = foo; exports.a = a; exports.c = c; exports.e = e; exports.g = g; exports.i = i; return exports; })({}); rollup-3.29.4/test/form/samples/function-mutation/_expected/system.js000066400000000000000000000013411450520414700260220ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { exports('a', a); function foo () { console.log( 'foo' ); } const bar = function () { console.log( 'bar' ); }; const baz = () => console.log( 'baz' ); function a () { console.log( 'a' ); } a.foo = foo; const c = exports('c', function () { console.log( 'c' ); }); c.bar = bar; const e = exports('e', () => console.log( 'e' )); e.baz = baz; class g { constructor () { console.log( 'g' ); } } exports('g', g); g.foo = foo; const i = exports('i', class { constructor () { console.log( 'i' ); } }); i.foo = foo; }) }; })); rollup-3.29.4/test/form/samples/function-mutation/_expected/umd.js000066400000000000000000000016151450520414700252670ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; function foo () { console.log( 'foo' ); } const bar = function () { console.log( 'bar' ); }; const baz = () => console.log( 'baz' ); function a () { console.log( 'a' ); } a.foo = foo; const c = function () { console.log( 'c' ); }; c.bar = bar; const e = () => console.log( 'e' ); e.baz = baz; class g { constructor () { console.log( 'g' ); } } g.foo = foo; const i = class { constructor () { console.log( 'i' ); } }; i.foo = foo; exports.a = a; exports.c = c; exports.e = e; exports.g = g; exports.i = i; })); rollup-3.29.4/test/form/samples/function-mutation/main.js000066400000000000000000000014301450520414700234610ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } const bar = function () { console.log( 'bar' ); }; const baz = () => console.log( 'baz' ); function a () { console.log( 'a' ); } a.foo = foo; function b () { console.log( 'b' ); } b.foo = foo; const c = function () { console.log( 'c' ); }; c.bar = bar; const d = function () { console.log( 'd' ); }; d.bar = bar; const e = () => console.log( 'e' ); e.baz = baz; const f = () => console.log( 'f' ); f.baz = baz; class g { constructor () { console.log( 'g' ); } } g.foo = foo; class h { constructor () { console.log( 'g' ); } } h.foo = foo; const i = class { constructor () { console.log( 'i' ); } }; i.foo = foo; const j = class { constructor () { console.log( 'j' ); } }; j.foo = foo; export { a, c, e, g, i }; rollup-3.29.4/test/form/samples/function-scopes/000077500000000000000000000000001450520414700216355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/function-scopes/_config.js000066400000000000000000000001611450520414700235750ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly associate or shadow variables in and around functions' }); rollup-3.29.4/test/form/samples/function-scopes/_expected/000077500000000000000000000000001450520414700235755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/function-scopes/_expected/amd.js000066400000000000000000000006651450520414700247030ustar00rootroot00000000000000define((function () { 'use strict'; var effect1 = () => console.log( 'effect' ); // must not be removed! function isKept1 ( x = effect1 ) { x(); } isKept1(); var effect2 = () => console.log( 'effect' ); // must not be removed! var isKept2 = function ( x = effect2 ) { x(); }; isKept2(); var effect3 = () => console.log( 'effect' ); // must not be removed! var isKept3 = ( x = effect3 ) => { x(); }; isKept3(); })); rollup-3.29.4/test/form/samples/function-scopes/_expected/cjs.js000066400000000000000000000006121450520414700247110ustar00rootroot00000000000000'use strict'; var effect1 = () => console.log( 'effect' ); // must not be removed! function isKept1 ( x = effect1 ) { x(); } isKept1(); var effect2 = () => console.log( 'effect' ); // must not be removed! var isKept2 = function ( x = effect2 ) { x(); }; isKept2(); var effect3 = () => console.log( 'effect' ); // must not be removed! var isKept3 = ( x = effect3 ) => { x(); }; isKept3(); rollup-3.29.4/test/form/samples/function-scopes/_expected/es.js000066400000000000000000000005731450520414700245470ustar00rootroot00000000000000var effect1 = () => console.log( 'effect' ); // must not be removed! function isKept1 ( x = effect1 ) { x(); } isKept1(); var effect2 = () => console.log( 'effect' ); // must not be removed! var isKept2 = function ( x = effect2 ) { x(); }; isKept2(); var effect3 = () => console.log( 'effect' ); // must not be removed! var isKept3 = ( x = effect3 ) => { x(); }; isKept3(); rollup-3.29.4/test/form/samples/function-scopes/_expected/iife.js000066400000000000000000000006601450520414700250510ustar00rootroot00000000000000(function () { 'use strict'; var effect1 = () => console.log( 'effect' ); // must not be removed! function isKept1 ( x = effect1 ) { x(); } isKept1(); var effect2 = () => console.log( 'effect' ); // must not be removed! var isKept2 = function ( x = effect2 ) { x(); }; isKept2(); var effect3 = () => console.log( 'effect' ); // must not be removed! var isKept3 = ( x = effect3 ) => { x(); }; isKept3(); })(); rollup-3.29.4/test/form/samples/function-scopes/_expected/system.js000066400000000000000000000010161450520414700254550ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var effect1 = () => console.log( 'effect' ); // must not be removed! function isKept1 ( x = effect1 ) { x(); } isKept1(); var effect2 = () => console.log( 'effect' ); // must not be removed! var isKept2 = function ( x = effect2 ) { x(); }; isKept2(); var effect3 = () => console.log( 'effect' ); // must not be removed! var isKept3 = ( x = effect3 ) => { x(); }; isKept3(); }) }; })); rollup-3.29.4/test/form/samples/function-scopes/_expected/umd.js000066400000000000000000000010231450520414700247140ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var effect1 = () => console.log( 'effect' ); // must not be removed! function isKept1 ( x = effect1 ) { x(); } isKept1(); var effect2 = () => console.log( 'effect' ); // must not be removed! var isKept2 = function ( x = effect2 ) { x(); }; isKept2(); var effect3 = () => console.log( 'effect' ); // must not be removed! var isKept3 = ( x = effect3 ) => { x(); }; isKept3(); })); rollup-3.29.4/test/form/samples/function-scopes/main.js000066400000000000000000000011271450520414700231200ustar00rootroot00000000000000var effect = () => console.log( 'effect' ); var shadowed = () => {}; function isRemoved () { var shadowed = effect; } isRemoved(); shadowed(); var effect1 = () => console.log( 'effect' ); // must not be removed! function isKept1 ( x = effect1 ) { var effect1 = () => {}; x(); } isKept1(); var effect2 = () => console.log( 'effect' ); // must not be removed! var isKept2 = function ( x = effect2 ) { var effect2 = () => {}; x(); }; isKept2(); var effect3 = () => console.log( 'effect' ); // must not be removed! var isKept3 = ( x = effect3 ) => { var effect3 = () => {}; x(); }; isKept3(); rollup-3.29.4/test/form/samples/generated-code-compact/000077500000000000000000000000001450520414700230105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/000077500000000000000000000000001450520414700272405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/_config.js000066400000000000000000000013041450520414700312000ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not use arrow functions', options: { external: [ 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly', 'externalNoImport' ], strictDeprecations: false, output: { compact: true, generatedCode: { arrowFunctions: false }, interop(id) { if (id === 'externalDefault') { return 'default'; } if (id === 'externalDefaultOnly') { return 'defaultOnly'; } if (id === 'externalAuto') { return 'auto'; } return 'compat'; }, name: 'bundle', noConflict: true, dynamicImportInCjs: false, systemNullSetters: false } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/_expected/000077500000000000000000000000001450520414700312005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/_expected/amd.js000066400000000000000000000044431450520414700323040ustar00rootroot00000000000000define(['require','exports','externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],(function(require,exports,externalNoImport,defaultCompat,externalAuto,externalDefault,externalDefaultOnly){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespaceCompat(e){return e&&typeof e==='object'&&'default'in e?e:_interopNamespaceDefault(e)}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,default:e})}function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var defaultCompat__namespace=/*#__PURE__*/_interopNamespaceCompat(defaultCompat);var externalAuto__default=/*#__PURE__*/_interopDefault(externalAuto);var externalDefault__namespace=/*#__PURE__*/_interopNamespaceDefault(externalDefault);var externalDefaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly);exports.a=void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(function(){return main}).then(console.log); new Promise(function(c,e){require(['external'],function(m){c(/*#__PURE__*/_interopNamespaceCompat(m))},e)}).then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo},[defaultCompat__namespace]);Object.defineProperty(exports,'foo',{enumerable:true,get:function(){return defaultCompat.foo}});Object.keys(defaultCompat).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return defaultCompat[k]}})});}));rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/_expected/cjs.js000066400000000000000000000044001450520414700323130ustar00rootroot00000000000000'use strict';require('externalNoImport');var defaultCompat=require('external'),externalAuto=require('externalAuto'),externalDefault=require('externalDefault'),externalDefaultOnly=require('externalDefaultOnly');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespaceCompat(e){return e&&typeof e==='object'&&'default'in e?e:_interopNamespaceDefault(e)}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,default:e})}function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var defaultCompat__namespace=/*#__PURE__*/_interopNamespaceCompat(defaultCompat);var externalAuto__default=/*#__PURE__*/_interopDefault(externalAuto);var externalDefault__namespace=/*#__PURE__*/_interopNamespaceDefault(externalDefault);var externalDefaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly);exports.a=void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(function(){return main}).then(console.log); Promise.resolve().then(function(){return /*#__PURE__*/_interopNamespaceCompat(require('external'))}).then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo},[defaultCompat__namespace]);Object.defineProperty(exports,'foo',{enumerable:true,get:function(){return defaultCompat.foo}});Object.keys(defaultCompat).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return defaultCompat[k]}})});rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/_expected/es.js000066400000000000000000000017571450520414700321570ustar00rootroot00000000000000import'externalNoImport';import*as defaultCompat from'external';import defaultCompat__default,{b}from'external';export*from'external';export{foo}from'external';import externalAuto from'externalAuto';import*as externalDefault from'externalDefault';import*as externalDefaultOnly from'externalDefaultOnly';function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}let a; ({ a } = b); console.log({ a } = b); Promise.resolve().then(function(){return main}).then(console.log); import('external').then(console.log); console.log(defaultCompat__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return a},foo:foo},[defaultCompat]);export{a};rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/_expected/iife.js000066400000000000000000000042611450520414700324550ustar00rootroot00000000000000var bundle=(function(exports,externalNoImport,defaultCompat,externalAuto,externalDefault,externalDefaultOnly){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespaceCompat(e){return e&&typeof e==='object'&&'default'in e?e:_interopNamespaceDefault(e)}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,default:e})}function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var defaultCompat__namespace=/*#__PURE__*/_interopNamespaceCompat(defaultCompat);var externalAuto__default=/*#__PURE__*/_interopDefault(externalAuto);var externalDefault__namespace=/*#__PURE__*/_interopNamespaceDefault(externalDefault);var externalDefaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly);exports.a=void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(function(){return main}).then(console.log); import('external').then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo},[defaultCompat__namespace]);Object.defineProperty(exports,'foo',{enumerable:true,get:function(){return defaultCompat.foo}});Object.keys(defaultCompat).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return defaultCompat[k]}})});return exports;})({},null,defaultCompat,externalAuto,externalDefault,externalDefaultOnly);rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/_expected/system.js000066400000000000000000000027041450520414700330650ustar00rootroot00000000000000System.register('bundle',['externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],(function(exports,module){'use strict';var _starExcludes={a:1,default:1,foo:1};var b,defaultCompat,defaultCompat__default,externalAuto,externalDefault,externalDefaultOnly;return{setters:[function(){},function(module){b=module.b;defaultCompat=module;defaultCompat__default=module.default;var setter={foo:module.foo};for(var name in module){if(!_starExcludes[name])setter[name]=module[name];}exports(setter);},function(module){externalAuto=module.default;},function(module){externalDefault=module;},function(module){externalDefaultOnly=module;}],execute:(function(){function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}let a; exports('a',a); (function(v){return exports('a',a),v})({ a } = b); console.log(function(v){return exports('a',a),v}({ a } = b)); Promise.resolve().then(function(){return main}).then(console.log); module.import('external').then(console.log); console.log(defaultCompat__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return a},foo:foo},[defaultCompat]);})}}));rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/_expected/umd.js000066400000000000000000000052601450520414700323260ustar00rootroot00000000000000(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('externalNoImport'),require('external'),require('externalAuto'),require('externalDefault'),require('externalDefaultOnly')):typeof define==='function'&&define.amd?define(['exports','externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,(function(){var current=g.bundle;var e=g.bundle={};f(e,null,g.defaultCompat,g.externalAuto,g.externalDefault,g.externalDefaultOnly);e.noConflict=function(){g.bundle=current;return e};})());})(this,(function(exports,externalNoImport,defaultCompat,externalAuto,externalDefault,externalDefaultOnly){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespaceCompat(e){return e&&typeof e==='object'&&'default'in e?e:_interopNamespaceDefault(e)}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,default:e})}function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var defaultCompat__namespace=/*#__PURE__*/_interopNamespaceCompat(defaultCompat);var externalAuto__default=/*#__PURE__*/_interopDefault(externalAuto);var externalDefault__namespace=/*#__PURE__*/_interopNamespaceDefault(externalDefault);var externalDefaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly);exports.a=void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(function(){return main}).then(console.log); import('external').then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo},[defaultCompat__namespace]);Object.defineProperty(exports,'foo',{enumerable:true,get:function(){return defaultCompat.foo}});Object.keys(defaultCompat).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return defaultCompat[k]}})});}));rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-false/main.js000077700000000000000000000000001450520414700415232../../generated-code/arrow-functions-false/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/000077500000000000000000000000001450520414700271255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/_config.js000066400000000000000000000012731450520414700310720ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses arrow functions', options: { external: [ 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly', 'externalNoImport' ], strictDeprecations: false, output: { compact: true, generatedCode: { arrowFunctions: true }, interop(id) { if (id === 'externalDefault') { return 'default'; } if (id === 'externalDefaultOnly') { return 'defaultOnly'; } if (id === 'externalAuto') { return 'auto'; } return 'compat'; }, name: 'bundle', noConflict: true, dynamicImportInCjs: false, systemNullSetters: false } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/_expected/000077500000000000000000000000001450520414700310655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/_expected/amd.js000066400000000000000000000042001450520414700321600ustar00rootroot00000000000000define(['require','exports','externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],(function(require,exports,externalNoImport,defaultCompat,externalAuto,externalDefault,externalDefaultOnly){'use strict';var _interopDefault=e=>e&&e.__esModule?e:{default:e};var _interopNamespaceCompat=e=>e&&typeof e==='object'&&'default'in e?e:_interopNamespaceDefault(e);var _interopNamespaceDefaultOnly=e=>Object.freeze({__proto__:null,default:e});function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(k=>{if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(e=>e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(k=>{if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}));return Object.freeze(n);}var defaultCompat__namespace=/*#__PURE__*/_interopNamespaceCompat(defaultCompat);var externalAuto__default=/*#__PURE__*/_interopDefault(externalAuto);var externalDefault__namespace=/*#__PURE__*/_interopNamespaceDefault(externalDefault);var externalDefaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly);exports.a=void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(()=>main).then(console.log); new Promise((c,e)=>require(['external'],m=>c(/*#__PURE__*/_interopNamespaceCompat(m)),e)).then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo},[defaultCompat__namespace]);Object.defineProperty(exports,'foo',{enumerable:true,get:()=>defaultCompat.foo});Object.keys(defaultCompat).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>defaultCompat[k]})});}));rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/_expected/cjs.js000066400000000000000000000041401450520414700322010ustar00rootroot00000000000000'use strict';require('externalNoImport');var defaultCompat=require('external'),externalAuto=require('externalAuto'),externalDefault=require('externalDefault'),externalDefaultOnly=require('externalDefaultOnly');var _interopDefault=e=>e&&e.__esModule?e:{default:e};var _interopNamespaceCompat=e=>e&&typeof e==='object'&&'default'in e?e:_interopNamespaceDefault(e);var _interopNamespaceDefaultOnly=e=>Object.freeze({__proto__:null,default:e});function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(k=>{if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(e=>e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(k=>{if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}));return Object.freeze(n);}var defaultCompat__namespace=/*#__PURE__*/_interopNamespaceCompat(defaultCompat);var externalAuto__default=/*#__PURE__*/_interopDefault(externalAuto);var externalDefault__namespace=/*#__PURE__*/_interopNamespaceDefault(externalDefault);var externalDefaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly);exports.a=void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(()=>main).then(console.log); Promise.resolve().then(()=>/*#__PURE__*/_interopNamespaceCompat(require('external'))).then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo},[defaultCompat__namespace]);Object.defineProperty(exports,'foo',{enumerable:true,get:()=>defaultCompat.foo});Object.keys(defaultCompat).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>defaultCompat[k]})});rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/_expected/es.js000066400000000000000000000016771450520414700320450ustar00rootroot00000000000000import'externalNoImport';import*as defaultCompat from'external';import defaultCompat__default,{b}from'external';export*from'external';export{foo}from'external';import externalAuto from'externalAuto';import*as externalDefault from'externalDefault';import*as externalDefaultOnly from'externalDefaultOnly';function _mergeNamespaces(n, m){m.forEach(e=>e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(k=>{if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}));return Object.freeze(n);}let a; ({ a } = b); console.log({ a } = b); Promise.resolve().then(()=>main).then(console.log); import('external').then(console.log); console.log(defaultCompat__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return a},foo:foo},[defaultCompat]);export{a};rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/_expected/iife.js000066400000000000000000000040401450520414700323350ustar00rootroot00000000000000var bundle=(function(exports,externalNoImport,defaultCompat,externalAuto,externalDefault,externalDefaultOnly){'use strict';var _interopDefault=e=>e&&e.__esModule?e:{default:e};var _interopNamespaceCompat=e=>e&&typeof e==='object'&&'default'in e?e:_interopNamespaceDefault(e);var _interopNamespaceDefaultOnly=e=>Object.freeze({__proto__:null,default:e});function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(k=>{if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(e=>e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(k=>{if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}));return Object.freeze(n);}var defaultCompat__namespace=/*#__PURE__*/_interopNamespaceCompat(defaultCompat);var externalAuto__default=/*#__PURE__*/_interopDefault(externalAuto);var externalDefault__namespace=/*#__PURE__*/_interopNamespaceDefault(externalDefault);var externalDefaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly);exports.a=void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(()=>main).then(console.log); import('external').then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo},[defaultCompat__namespace]);Object.defineProperty(exports,'foo',{enumerable:true,get:()=>defaultCompat.foo});Object.keys(defaultCompat).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>defaultCompat[k]})});return exports;})({},null,defaultCompat,externalAuto,externalDefault,externalDefaultOnly);rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/_expected/system.js000066400000000000000000000025221450520414700327500ustar00rootroot00000000000000System.register('bundle',['externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],(function(exports,module){'use strict';var _starExcludes={a:1,default:1,foo:1};var b,defaultCompat,defaultCompat__default,externalAuto,externalDefault,externalDefaultOnly;return{setters:[()=>{},module=>{b=module.b;defaultCompat=module;defaultCompat__default=module.default;var setter={foo:module.foo};for(var name in module){if(!_starExcludes[name])setter[name]=module[name];}exports(setter);},module=>{externalAuto=module.default;},module=>{externalDefault=module;},module=>{externalDefaultOnly=module;}],execute:(function(){function _mergeNamespaces(n, m){m.forEach(e=>e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(k=>{if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}));return Object.freeze(n);}let a; exports('a',a); (v=>(exports('a',a),v))({ a } = b); console.log((v=>(exports('a',a),v))({ a } = b)); Promise.resolve().then(()=>main).then(console.log); module.import('external').then(console.log); console.log(defaultCompat__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return a},foo:foo},[defaultCompat]);})}}));rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/_expected/umd.js000066400000000000000000000050231450520414700322100ustar00rootroot00000000000000(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('externalNoImport'),require('external'),require('externalAuto'),require('externalDefault'),require('externalDefaultOnly')):typeof define==='function'&&define.amd?define(['exports','externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,(()=>{var current=g.bundle;var e=g.bundle={};f(e,null,g.defaultCompat,g.externalAuto,g.externalDefault,g.externalDefaultOnly);e.noConflict=()=>{g.bundle=current;return e};})());})(this,(function(exports,externalNoImport,defaultCompat,externalAuto,externalDefault,externalDefaultOnly){'use strict';var _interopDefault=e=>e&&e.__esModule?e:{default:e};var _interopNamespaceCompat=e=>e&&typeof e==='object'&&'default'in e?e:_interopNamespaceDefault(e);var _interopNamespaceDefaultOnly=e=>Object.freeze({__proto__:null,default:e});function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(k=>{if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(e=>e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(k=>{if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}));return Object.freeze(n);}var defaultCompat__namespace=/*#__PURE__*/_interopNamespaceCompat(defaultCompat);var externalAuto__default=/*#__PURE__*/_interopDefault(externalAuto);var externalDefault__namespace=/*#__PURE__*/_interopNamespaceDefault(externalDefault);var externalDefaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly);exports.a=void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(()=>main).then(console.log); import('external').then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo},[defaultCompat__namespace]);Object.defineProperty(exports,'foo',{enumerable:true,get:()=>defaultCompat.foo});Object.keys(defaultCompat).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>defaultCompat[k]})});}));rollup-3.29.4/test/form/samples/generated-code-compact/arrow-functions-true/main.js000077700000000000000000000000001450520414700414102../../generated-code/arrow-functions-false/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/000077500000000000000000000000001450520414700270215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/_config.js000066400000000000000000000010331450520414700307600ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not use block bindings', expectedWarnings: ['SHIMMED_EXPORT'], options: { external: ['external'], shimMissingExports: true, output: { compact: true, generatedCode: { arrowFunctions: true, constBindings: true }, name: 'bundle', noConflict: true, exports: 'named', interop: 'compat' }, plugins: [ { name: 'test', transform(code, id) { if (id.endsWith('synthetic.js')) { return { syntheticNamedExports: true }; } } } ] } }); rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/_expected/000077500000000000000000000000001450520414700307615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/_expected/amd.js000066400000000000000000000017711450520414700320660ustar00rootroot00000000000000define(['exports','external'],(function(exports,foo$1){'use strict';function _interopNamespaceCompat(e){if(e&&typeof e==='object'&&'default'in e)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}n.default=e;return Object.freeze(n)}const foo__namespace=/*#__PURE__*/_interopNamespaceCompat(foo$1);const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42;exports.default=main;exports.syntheticMissing=synthetic.syntheticMissing;Object.keys(foo$1).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/_expected/cjs.js000066400000000000000000000017361450520414700321050ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});const foo$1=require('external');function _interopNamespaceCompat(e){if(e&&typeof e==='object'&&'default'in e)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}n.default=e;return Object.freeze(n)}const foo__namespace=/*#__PURE__*/_interopNamespaceCompat(foo$1);const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42;exports.default=main;exports.syntheticMissing=synthetic.syntheticMissing;Object.keys(foo$1).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})});rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/_expected/es.js000066400000000000000000000006641450520414700317340ustar00rootroot00000000000000import*as foo$1 from'external';import foo__default from'external';export*from'external';const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__default, foo$1, other, bar, _missingExportShim); const main = 42;const syntheticMissing=synthetic.syntheticMissing;export{main as default,syntheticMissing};rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/_expected/iife.js000066400000000000000000000017761450520414700322460ustar00rootroot00000000000000var bundle=(function(exports,foo$1){'use strict';function _interopNamespaceCompat(e){if(e&&typeof e==='object'&&'default'in e)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}n.default=e;return Object.freeze(n)}const foo__namespace=/*#__PURE__*/_interopNamespaceCompat(foo$1);const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42;exports.default=main;exports.syntheticMissing=synthetic.syntheticMissing;Object.keys(foo$1).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})});Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},foo$1);rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/_expected/system.js000066400000000000000000000012511450520414700326420ustar00rootroot00000000000000System.register('bundle',['external'],(function(exports){'use strict';const _starExcludes={default:1,syntheticMissing:1};var foo__default,foo$1;return{setters:[module=>{foo__default=module.default;foo$1=module;const setter={};for(const name in module){if(!_starExcludes[name])setter[name]=module[name];}exports(setter);}],execute:(function(){const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__default, foo$1, other, bar, _missingExportShim); const main = exports('default', 42);exports('syntheticMissing',synthetic.syntheticMissing);})}}));rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/_expected/umd.js000066400000000000000000000024671450520414700321150ustar00rootroot00000000000000(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('external')):typeof define==='function'&&define.amd?define(['exports','external'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,(()=>{const current=g.bundle;const e=g.bundle={};f(e,g.foo$1);e.noConflict=()=>{g.bundle=current;return e};})());})(this,(function(exports,foo$1){'use strict';function _interopNamespaceCompat(e){if(e&&typeof e==='object'&&'default'in e)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}n.default=e;return Object.freeze(n)}const foo__namespace=/*#__PURE__*/_interopNamespaceCompat(foo$1);const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42;exports.default=main;exports.syntheticMissing=synthetic.syntheticMissing;Object.keys(foo$1).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-false/main.js000077700000000000000000000000001450520414700410652../../generated-code/const-bindings-false/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/000077500000000000000000000000001450520414700267065ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/_config.js000066400000000000000000000010231450520414700306440ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses block bindings', expectedWarnings: ['SHIMMED_EXPORT'], options: { external: ['external'], shimMissingExports: true, output: { compact: true, generatedCode: { arrowFunctions: true, constBindings: true }, name: 'bundle', noConflict: true, exports: 'named', interop: 'compat' }, plugins: [ { name: 'test', transform(code, id) { if (id.endsWith('synthetic.js')) { return { syntheticNamedExports: true }; } } } ] } }); rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/_expected/000077500000000000000000000000001450520414700306465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/_expected/amd.js000066400000000000000000000017711450520414700317530ustar00rootroot00000000000000define(['exports','external'],(function(exports,foo$1){'use strict';function _interopNamespaceCompat(e){if(e&&typeof e==='object'&&'default'in e)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}n.default=e;return Object.freeze(n)}const foo__namespace=/*#__PURE__*/_interopNamespaceCompat(foo$1);const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42;exports.default=main;exports.syntheticMissing=synthetic.syntheticMissing;Object.keys(foo$1).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/_expected/cjs.js000066400000000000000000000017361450520414700317720ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});const foo$1=require('external');function _interopNamespaceCompat(e){if(e&&typeof e==='object'&&'default'in e)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}n.default=e;return Object.freeze(n)}const foo__namespace=/*#__PURE__*/_interopNamespaceCompat(foo$1);const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42;exports.default=main;exports.syntheticMissing=synthetic.syntheticMissing;Object.keys(foo$1).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})});rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/_expected/es.js000066400000000000000000000006641450520414700316210ustar00rootroot00000000000000import*as foo$1 from'external';import foo__default from'external';export*from'external';const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__default, foo$1, other, bar, _missingExportShim); const main = 42;const syntheticMissing=synthetic.syntheticMissing;export{main as default,syntheticMissing};rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/_expected/iife.js000066400000000000000000000017761450520414700321330ustar00rootroot00000000000000var bundle=(function(exports,foo$1){'use strict';function _interopNamespaceCompat(e){if(e&&typeof e==='object'&&'default'in e)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}n.default=e;return Object.freeze(n)}const foo__namespace=/*#__PURE__*/_interopNamespaceCompat(foo$1);const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42;exports.default=main;exports.syntheticMissing=synthetic.syntheticMissing;Object.keys(foo$1).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})});Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},foo$1);rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/_expected/system.js000066400000000000000000000012511450520414700325270ustar00rootroot00000000000000System.register('bundle',['external'],(function(exports){'use strict';const _starExcludes={default:1,syntheticMissing:1};var foo__default,foo$1;return{setters:[module=>{foo__default=module.default;foo$1=module;const setter={};for(const name in module){if(!_starExcludes[name])setter[name]=module[name];}exports(setter);}],execute:(function(){const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__default, foo$1, other, bar, _missingExportShim); const main = exports('default', 42);exports('syntheticMissing',synthetic.syntheticMissing);})}}));rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/_expected/umd.js000066400000000000000000000024671450520414700320020ustar00rootroot00000000000000(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('external')):typeof define==='function'&&define.amd?define(['exports','external'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,(()=>{const current=g.bundle;const e=g.bundle={};f(e,g.foo$1);e.noConflict=()=>{g.bundle=current;return e};})());})(this,(function(exports,foo$1){'use strict';function _interopNamespaceCompat(e){if(e&&typeof e==='object'&&'default'in e)return e;const n=Object.create(null);if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}n.default=e;return Object.freeze(n)}const foo__namespace=/*#__PURE__*/_interopNamespaceCompat(foo$1);const _missingExportShim=void 0;const foo = 'bar';const other=/*#__PURE__*/Object.freeze({__proto__:null,foo:foo,missing:_missingExportShim});const synthetic = { bar: 'baz' };console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42;exports.default=main;exports.syntheticMissing=synthetic.syntheticMissing;Object.keys(foo$1).forEach(k=>{if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-3.29.4/test/form/samples/generated-code-compact/const-bindings-true/main.js000077700000000000000000000000001450520414700407522../../generated-code/const-bindings-false/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/object-shorthand-false/000077500000000000000000000000001450520414700273365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/object-shorthand-false/_config.js000066400000000000000000000003631450520414700313020ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not use object shorthand syntax', options: { output: { compact: true, exports: 'named', format: 'system', generatedCode: { objectShorthand: false }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/generated-code-compact/object-shorthand-false/_expected.js000066400000000000000000000003721450520414700316360ustar00rootroot00000000000000System.register('bundle',[],(function(exports){'use strict';return{execute:(function(){const a = 'a';var ns=/*#__PURE__*/Object.freeze({__proto__:null,a:a,b:a,default:a});console.log(ns); const foo = 1; exports({foo:foo,bar:foo,default:foo});})}}));rollup-3.29.4/test/form/samples/generated-code-compact/object-shorthand-false/main.js000077700000000000000000000000001450520414700417172../../generated-code/object-shorthand-false/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/object-shorthand-true/000077500000000000000000000000001450520414700272235ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/object-shorthand-true/_config.js000066400000000000000000000003521450520414700311650ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses object shorthand syntax', options: { output: { compact: true, exports: 'named', format: 'system', generatedCode: { objectShorthand: true }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/generated-code-compact/object-shorthand-true/_expected.js000066400000000000000000000003641450520414700315240ustar00rootroot00000000000000System.register('bundle',[],(function(exports){'use strict';return{execute:(function(){const a = 'a';var ns=/*#__PURE__*/Object.freeze({__proto__:null,a,b:a,default:a});console.log(ns); const foo = 1; exports({foo,bar:foo,default:foo});})}}));rollup-3.29.4/test/form/samples/generated-code-compact/object-shorthand-true/main.js000077700000000000000000000000001450520414700416042../../generated-code/object-shorthand-false/main.jsustar00rootroot00000000000000reserved-names-as-props-false-no-external-live-bindings/000077500000000000000000000000001450520414700354655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact_config.js000066400000000000000000000005271450520414700374330ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindingsmodule.exports = defineTest({ description: 'escapes reserved names used as props when external live-bindings are off', options: { external: ['external'], output: { compact: true, exports: 'named', externalLiveBindings: false, generatedCode: { reservedNamesAsProps: false }, interop: 'compat', name: 'bundle' } } }); _expected/000077500000000000000000000000001450520414700374255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindingsamd.js000066400000000000000000000003411450520414700405220ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expecteddefine(['external'],(function(ns){'use strict';function _interopDefaultCompat(e){return e&&typeof e==='object'&&'default'in e?e["default"]:e}var ns__default=/*#__PURE__*/_interopDefaultCompat(ns);console.log(ns__default);}));cjs.js000066400000000000000000000003261450520414700405430ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expected'use strict';var ns=require('external');function _interopDefaultCompat(e){return e&&typeof e==='object'&&'default'in e?e["default"]:e}var ns__default=/*#__PURE__*/_interopDefaultCompat(ns);console.log(ns__default);es.js000066400000000000000000000000511450520414700403660ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expectedimport ns from'external';console.log(ns);iife.js000066400000000000000000000003201450520414700406720ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expected(function(ns){'use strict';function _interopDefaultCompat(e){return e&&typeof e==='object'&&'default'in e?e["default"]:e}var ns__default=/*#__PURE__*/_interopDefaultCompat(ns);console.log(ns__default);})(ns);system.js000066400000000000000000000002521450520414700413060ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expectedSystem.register('bundle',['external'],(function(){'use strict';var ns;return{setters:[function(module){ns=module["default"];}],execute:(function(){console.log(ns);})}}));umd.js000066400000000000000000000006571450520414700405600ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expected(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(require('external')):typeof define==='function'&&define.amd?define(['external'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.ns));})(this,(function(ns){'use strict';function _interopDefaultCompat(e){return e&&typeof e==='object'&&'default'in e?e["default"]:e}var ns__default=/*#__PURE__*/_interopDefaultCompat(ns);console.log(ns__default);}));main.js000077700000000000000000000000001450520414700562542../../generated-code/reserved-names-as-props-false-no-external-live-bindings/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindingsrollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/000077500000000000000000000000001450520414700305625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/_config.js000066400000000000000000000007721450520414700325320ustar00rootroot00000000000000module.exports = defineTest({ description: 'escapes reserved names used as props', options: { external: ['external', 'external2', 'externalDefaultOnly'], output: { compact: true, exports: 'named', generatedCode: { reservedNamesAsProps: false }, interop(id) { if (id === 'externalDefaultOnly') return 'defaultOnly'; return 'auto'; }, name: 'bundle' }, plugins: [ { name: 'test', transform() { return { syntheticNamedExports: true }; } } ] } }); rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/_expected/000077500000000000000000000000001450520414700325225ustar00rootroot00000000000000amd.js000066400000000000000000000033751450520414700335520ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/_expecteddefine(['module','exports','external','externalDefaultOnly','external2'],(function(module,exports,external,defaultOnly,someDefault){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{'default':e}}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,'default':e})}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n["default"]=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var external__namespace=/*#__PURE__*/_interopNamespace(external);var defaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly);var someDefault__default=/*#__PURE__*/_interopDefault(someDefault);var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,'default':other},[other]);console.log(ns, other.foo, other["function"], other["some-prop"], external["function"], someDefault__default["default"], defaultOnly__namespace); console.log(undefined, undefined); exports["function"] = 1; exports["function"]++;Object.defineProperty(exports,'bar',{enumerable:true,get:function(){return external["function"]}});exports["default"]=external__namespace;Object.defineProperty(exports,'void',{enumerable:true,get:function(){return external__namespace["default"]}});Object.defineProperty(exports,'__esModule',{value:true});}));cjs.js000066400000000000000000000033421450520414700335620ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/_expected'use strict';Object.defineProperty(exports,'__esModule',{value:true});var external=require('external'),defaultOnly=require('externalDefaultOnly'),someDefault=require('external2');function _interopDefault(e){return e&&e.__esModule?e:{'default':e}}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,'default':e})}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n["default"]=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var external__namespace=/*#__PURE__*/_interopNamespace(external);var defaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly);var someDefault__default=/*#__PURE__*/_interopDefault(someDefault);var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,'default':other},[other]);console.log(ns, other.foo, other["function"], other["some-prop"], external["function"], someDefault__default["default"], defaultOnly__namespace); console.log(undefined, undefined); exports["function"] = 1; exports["function"]++;Object.defineProperty(exports,'bar',{enumerable:true,get:function(){return external["function"]}});exports["default"]=external__namespace;Object.defineProperty(exports,'void',{enumerable:true,get:function(){return external__namespace["default"]}});rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/_expected/es.js000066400000000000000000000015541450520414700334740ustar00rootroot00000000000000import {function as function$1}from'external';import*as external from'external';export{external as default };export{function as bar,default as void}from'external';import*as defaultOnly from'externalDefaultOnly';import someDefault from'external2';function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,'default':other},[other]);console.log(ns, other.foo, other["function"], other["some-prop"], function$1, someDefault, defaultOnly); console.log(import.meta['function'], import.meta['some-prop']); let f = 1; f++;export{f as function};iife.js000066400000000000000000000033531450520414700337210ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/_expectedvar bundle=(function(exports,external,defaultOnly,someDefault){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{'default':e}}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,'default':e})}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n["default"]=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var external__namespace=/*#__PURE__*/_interopNamespace(external);var defaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly);var someDefault__default=/*#__PURE__*/_interopDefault(someDefault);var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,'default':other},[other]);console.log(ns, other.foo, other["function"], other["some-prop"], external["function"], someDefault__default["default"], defaultOnly__namespace); console.log(undefined, undefined); exports["function"] = 1; exports["function"]++;Object.defineProperty(exports,'bar',{enumerable:true,get:function(){return external["function"]}});exports["default"]=external__namespace;Object.defineProperty(exports,'void',{enumerable:true,get:function(){return external__namespace["default"]}});Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},external,defaultOnly,someDefault);system.js000066400000000000000000000020421450520414700343230ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/_expectedSystem.register('bundle',['external','externalDefaultOnly','external2'],(function(exports,module){'use strict';var function$1,defaultOnly,someDefault;return{setters:[function(module){function$1=module["function"];exports({bar:module["function"],'default':module,'void':module["default"]});},function(module){defaultOnly=module;},function(module){someDefault=module["default"];}],execute:(function(){function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,'default':other},[other]);console.log(ns, other.foo, other["function"], other["some-prop"], function$1, someDefault, defaultOnly); console.log(module.meta["function"], module.meta["some-prop"]); let f = exports('function',1); exports('function',f+1),f++;})}}));umd.js000066400000000000000000000040451450520414700335710ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/_expected(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('external'),require('externalDefaultOnly'),require('external2')):typeof define==='function'&&define.amd?define(['exports','external','externalDefaultOnly','external2'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.bundle={},g.external,g.defaultOnly,g.someDefault));})(this,(function(exports,external,defaultOnly,someDefault){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{'default':e}}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,'default':e})}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n["default"]=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var external__namespace=/*#__PURE__*/_interopNamespace(external);var defaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly);var someDefault__default=/*#__PURE__*/_interopDefault(someDefault);var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,'default':other},[other]);console.log(ns, other.foo, other["function"], other["some-prop"], external["function"], someDefault__default["default"], defaultOnly__namespace); console.log(undefined, undefined); exports["function"] = 1; exports["function"]++;Object.defineProperty(exports,'bar',{enumerable:true,get:function(){return external["function"]}});exports["default"]=external__namespace;Object.defineProperty(exports,'void',{enumerable:true,get:function(){return external__namespace["default"]}});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-false/main.js000077700000000000000000000000001450520414700443672../../generated-code/reserved-names-as-props-false/main.jsustar00rootroot00000000000000reserved-names-as-props-true-no-external-live-bindings/000077500000000000000000000000001450520414700353525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact_config.js000066400000000000000000000005261450520414700373170ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindingsmodule.exports = defineTest({ description: 'escapes reserved names used as props when external live-bindings are off', options: { external: ['external'], output: { compact: true, exports: 'named', externalLiveBindings: false, generatedCode: { reservedNamesAsProps: true }, interop: 'compat', name: 'bundle' } } }); _expected/000077500000000000000000000000001450520414700373125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindingsamd.js000066400000000000000000000003361450520414700404130ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expecteddefine(['external'],(function(ns){'use strict';function _interopDefaultCompat(e){return e&&typeof e==='object'&&'default'in e?e.default:e}var ns__default=/*#__PURE__*/_interopDefaultCompat(ns);console.log(ns__default);}));cjs.js000066400000000000000000000003231450520414700404250ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expected'use strict';var ns=require('external');function _interopDefaultCompat(e){return e&&typeof e==='object'&&'default'in e?e.default:e}var ns__default=/*#__PURE__*/_interopDefaultCompat(ns);console.log(ns__default);es.js000066400000000000000000000000511450520414700402530ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expectedimport ns from'external';console.log(ns);iife.js000066400000000000000000000003151450520414700405630ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expected(function(ns){'use strict';function _interopDefaultCompat(e){return e&&typeof e==='object'&&'default'in e?e.default:e}var ns__default=/*#__PURE__*/_interopDefaultCompat(ns);console.log(ns__default);})(ns);system.js000066400000000000000000000002471450520414700411770ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expectedSystem.register('bundle',['external'],(function(){'use strict';var ns;return{setters:[function(module){ns=module.default;}],execute:(function(){console.log(ns);})}}));umd.js000066400000000000000000000006541450520414700404420ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expected(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(require('external')):typeof define==='function'&&define.amd?define(['external'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.ns));})(this,(function(ns){'use strict';function _interopDefaultCompat(e){return e&&typeof e==='object'&&'default'in e?e.default:e}var ns__default=/*#__PURE__*/_interopDefaultCompat(ns);console.log(ns__default);}));main.js000077700000000000000000000000001450520414700561412../../generated-code/reserved-names-as-props-false-no-external-live-bindings/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindingsrollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/000077500000000000000000000000001450520414700304475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/_config.js000066400000000000000000000007711450520414700324160ustar00rootroot00000000000000module.exports = defineTest({ description: 'escapes reserved names used as props', options: { external: ['external', 'external2', 'externalDefaultOnly'], output: { compact: true, exports: 'named', generatedCode: { reservedNamesAsProps: true }, interop(id) { if (id === 'externalDefaultOnly') return 'defaultOnly'; return 'auto'; }, name: 'bundle' }, plugins: [ { name: 'test', transform() { return { syntheticNamedExports: true }; } } ] } }); rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/000077500000000000000000000000001450520414700324075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/amd.js000066400000000000000000000033341450520414700335110ustar00rootroot00000000000000define(['module','exports','external','externalDefaultOnly','external2'],(function(module,exports,external,defaultOnly,someDefault){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,default:e})}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var external__namespace=/*#__PURE__*/_interopNamespace(external);var defaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly);var someDefault__default=/*#__PURE__*/_interopDefault(someDefault);var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,default:other},[other]);console.log(ns, other.foo, other.function, other["some-prop"], external.function, someDefault__default.default, defaultOnly__namespace); console.log(undefined, undefined); exports.function = 1; exports.function++;Object.defineProperty(exports,'bar',{enumerable:true,get:function(){return external.function}});exports.default=external__namespace;Object.defineProperty(exports,'void',{enumerable:true,get:function(){return external__namespace.default}});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/cjs.js000066400000000000000000000033011450520414700335210ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});var external=require('external'),defaultOnly=require('externalDefaultOnly'),someDefault=require('external2');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,default:e})}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var external__namespace=/*#__PURE__*/_interopNamespace(external);var defaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly);var someDefault__default=/*#__PURE__*/_interopDefault(someDefault);var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,default:other},[other]);console.log(ns, other.foo, other.function, other["some-prop"], external.function, someDefault__default.default, defaultOnly__namespace); console.log(undefined, undefined); exports.function = 1; exports.function++;Object.defineProperty(exports,'bar',{enumerable:true,get:function(){return external.function}});exports.default=external__namespace;Object.defineProperty(exports,'void',{enumerable:true,get:function(){return external__namespace.default}});rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/es.js000066400000000000000000000015471450520414700333630ustar00rootroot00000000000000import {function as function$1}from'external';import*as external from'external';export{external as default };export{function as bar,default as void}from'external';import*as defaultOnly from'externalDefaultOnly';import someDefault from'external2';function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,default:other},[other]);console.log(ns, other.foo, other.function, other["some-prop"], function$1, someDefault, defaultOnly); console.log(import.meta['function'], import.meta['some-prop']); let f = 1; f++;export{f as function};iife.js000066400000000000000000000033121450520414700336010ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expectedvar bundle=(function(exports,external,defaultOnly,someDefault){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,default:e})}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var external__namespace=/*#__PURE__*/_interopNamespace(external);var defaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly);var someDefault__default=/*#__PURE__*/_interopDefault(someDefault);var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,default:other},[other]);console.log(ns, other.foo, other.function, other["some-prop"], external.function, someDefault__default.default, defaultOnly__namespace); console.log(undefined, undefined); exports.function = 1; exports.function++;Object.defineProperty(exports,'bar',{enumerable:true,get:function(){return external.function}});exports.default=external__namespace;Object.defineProperty(exports,'void',{enumerable:true,get:function(){return external__namespace.default}});Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},external,defaultOnly,someDefault);system.js000066400000000000000000000020121450520414700342050ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expectedSystem.register('bundle',['external','externalDefaultOnly','external2'],(function(exports,module){'use strict';var function$1,defaultOnly,someDefault;return{setters:[function(module){function$1=module.function;exports({bar:module.function,default:module,void:module.default});},function(module){defaultOnly=module;},function(module){someDefault=module.default;}],execute:(function(){function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,default:other},[other]);console.log(ns, other.foo, other.function, other["some-prop"], function$1, someDefault, defaultOnly); console.log(module.meta.function, module.meta["some-prop"]); let f = exports('function',1); exports('function',f+1),f++;})}}));rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/umd.js000066400000000000000000000040041450520414700335300ustar00rootroot00000000000000(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('external'),require('externalDefaultOnly'),require('external2')):typeof define==='function'&&define.amd?define(['exports','external','externalDefaultOnly','external2'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.bundle={},g.external,g.defaultOnly,g.someDefault));})(this,(function(exports,external,defaultOnly,someDefault){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespaceDefaultOnly(e){return Object.freeze({__proto__:null,default:e})}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}function _mergeNamespaces(n, m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})});return Object.freeze(n);}var external__namespace=/*#__PURE__*/_interopNamespace(external);var defaultOnly__namespace=/*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly);var someDefault__default=/*#__PURE__*/_interopDefault(someDefault);var other = { foo: 'bar' };var ns=/*#__PURE__*/_mergeNamespaces({__proto__:null,default:other},[other]);console.log(ns, other.foo, other.function, other["some-prop"], external.function, someDefault__default.default, defaultOnly__namespace); console.log(undefined, undefined); exports.function = 1; exports.function++;Object.defineProperty(exports,'bar',{enumerable:true,get:function(){return external.function}});exports.default=external__namespace;Object.defineProperty(exports,'void',{enumerable:true,get:function(){return external__namespace.default}});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-3.29.4/test/form/samples/generated-code-compact/reserved-names-as-props-true/main.js000077700000000000000000000000001450520414700442542../../generated-code/reserved-names-as-props-false/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-presets/000077500000000000000000000000001450520414700230475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-presets/es2015/000077500000000000000000000000001450520414700237665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-presets/es2015/_config.js000066400000000000000000000010351450520414700257270ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles generatedCode preset "es2015"', options: { output: { exports: 'named', format: 'system', generatedCode: 'es2015', name: 'bundle' }, plugins: [ { name: 'test', renderStart(options) { assert.strictEqual(options.generatedCode.arrowFunctions, true); assert.strictEqual(options.generatedCode.objectShorthand, true); assert.strictEqual(options.generatedCode.reservedNamesAsProps, true); } } ] } }); rollup-3.29.4/test/form/samples/generated-code-presets/es2015/_expected.js000066400000000000000000000002631450520414700262650ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; exports({ foo, bar: foo, default: foo }); }) }; })); rollup-3.29.4/test/form/samples/generated-code-presets/es2015/main.js000066400000000000000000000000731450520414700252500ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar, foo as default }; rollup-3.29.4/test/form/samples/generated-code-presets/es5/000077500000000000000000000000001450520414700235435ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-presets/es5/_config.js000066400000000000000000000010311450520414700255000ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles generatedCode preset "es5"', options: { output: { exports: 'named', format: 'system', generatedCode: 'es5', name: 'bundle' }, plugins: [ { name: 'test', renderStart(options) { assert.strictEqual(options.generatedCode.arrowFunctions, false); assert.strictEqual(options.generatedCode.objectShorthand, false); assert.strictEqual(options.generatedCode.reservedNamesAsProps, true); } } ] } }); rollup-3.29.4/test/form/samples/generated-code-presets/es5/_expected.js000066400000000000000000000002701450520414700260400ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; exports({ foo: foo, bar: foo, default: foo }); }) }; })); rollup-3.29.4/test/form/samples/generated-code-presets/es5/main.js000066400000000000000000000000731450520414700250250ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar, foo as default }; rollup-3.29.4/test/form/samples/generated-code-presets/preset-with-override/000077500000000000000000000000001450520414700271375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code-presets/preset-with-override/_config.js000066400000000000000000000011141450520414700310760ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles generatedCode preset "es2015"', options: { output: { exports: 'named', format: 'system', generatedCode: { preset: 'es2015', arrowFunctions: false }, name: 'bundle' }, plugins: [ { name: 'test', renderStart(options) { assert.strictEqual(options.generatedCode.arrowFunctions, false); assert.strictEqual(options.generatedCode.objectShorthand, true); assert.strictEqual(options.generatedCode.reservedNamesAsProps, true); } } ] } }); rollup-3.29.4/test/form/samples/generated-code-presets/preset-with-override/_expected.js000066400000000000000000000002631450520414700314360ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; exports({ foo, bar: foo, default: foo }); }) }; })); rollup-3.29.4/test/form/samples/generated-code-presets/preset-with-override/main.js000066400000000000000000000000731450520414700304210ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar, foo as default }; rollup-3.29.4/test/form/samples/generated-code/000077500000000000000000000000001450520414700213645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/000077500000000000000000000000001450520414700256145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/_config.js000066400000000000000000000012621450520414700275570ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not use arrow functions', options: { external: [ 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly', 'externalNoImport' ], strictDeprecations: false, output: { generatedCode: { arrowFunctions: false }, interop(id) { if (id === 'externalDefault') { return 'default'; } if (id === 'externalDefaultOnly') { return 'defaultOnly'; } if (id === 'externalAuto') { return 'auto'; } return 'compat'; }, name: 'bundle', noConflict: true, dynamicImportInCjs: false, systemNullSetters: false } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/_expected/000077500000000000000000000000001450520414700275545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/_expected/amd.js000066400000000000000000000053071450520414700306600ustar00rootroot00000000000000define(['require', 'exports', 'externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], (function (require, exports, externalNoImport, defaultCompat, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespaceCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : _interopNamespaceDefault(e); } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var defaultCompat__namespace = /*#__PURE__*/_interopNamespaceCompat(defaultCompat); var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); exports.a = void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(function () { return main; }).then(console.log); new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceCompat(m)); }, reject); }).then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultCompat__namespace]); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return defaultCompat.foo; } }); Object.keys(defaultCompat).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return defaultCompat[k]; } }); }); })); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/_expected/cjs.js000066400000000000000000000051211450520414700306700ustar00rootroot00000000000000'use strict'; require('externalNoImport'); var defaultCompat = require('external'); var externalAuto = require('externalAuto'); var externalDefault = require('externalDefault'); var externalDefaultOnly = require('externalDefaultOnly'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespaceCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : _interopNamespaceDefault(e); } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var defaultCompat__namespace = /*#__PURE__*/_interopNamespaceCompat(defaultCompat); var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); exports.a = void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(function () { return main; }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceCompat(require('external')); }).then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultCompat__namespace]); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return defaultCompat.foo; } }); Object.keys(defaultCompat).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return defaultCompat[k]; } }); }); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/_expected/es.js000066400000000000000000000022041450520414700305170ustar00rootroot00000000000000import 'externalNoImport'; import * as defaultCompat from 'external'; import defaultCompat__default, { b } from 'external'; export * from 'external'; export { foo } from 'external'; import externalAuto from 'externalAuto'; import * as externalDefault from 'externalDefault'; import * as externalDefaultOnly from 'externalDefaultOnly'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } let a; ({ a } = b); console.log({ a } = b); Promise.resolve().then(function () { return main; }).then(console.log); import('external').then(console.log); console.log(defaultCompat__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return a; }, foo: foo }, [defaultCompat]); export { a }; rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/_expected/iife.js000066400000000000000000000050651450520414700310340ustar00rootroot00000000000000var bundle = (function (exports, externalNoImport, defaultCompat, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespaceCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : _interopNamespaceDefault(e); } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var defaultCompat__namespace = /*#__PURE__*/_interopNamespaceCompat(defaultCompat); var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); exports.a = void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(function () { return main; }).then(console.log); import('external').then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultCompat__namespace]); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return defaultCompat.foo; } }); Object.keys(defaultCompat).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return defaultCompat[k]; } }); }); return exports; })({}, null, defaultCompat, externalAuto, externalDefault, externalDefaultOnly); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/_expected/system.js000066400000000000000000000034571450520414700314470ustar00rootroot00000000000000System.register('bundle', ['externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], (function (exports, module) { 'use strict'; var _starExcludes = { a: 1, default: 1, foo: 1 }; var b, defaultCompat, defaultCompat__default, externalAuto, externalDefault, externalDefaultOnly; return { setters: [function () {}, function (module) { b = module.b; defaultCompat = module; defaultCompat__default = module.default; var setter = { foo: module.foo }; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }, function (module) { externalAuto = module.default; }, function (module) { externalDefault = module; }, function (module) { externalDefaultOnly = module; }], execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } let a; exports('a', a); (function (v) { return exports('a', a), v; })({ a } = b); console.log(function (v) { return exports('a', a), v; }({ a } = b)); Promise.resolve().then(function () { return main; }).then(console.log); module.import('external').then(console.log); console.log(defaultCompat__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return a; }, foo: foo }, [defaultCompat]); }) }; })); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/_expected/umd.js000066400000000000000000000063411450520414700307030ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('externalNoImport'), require('external'), require('externalAuto'), require('externalDefault'), require('externalDefaultOnly')) : typeof define === 'function' && define.amd ? define(['exports', 'externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { var current = global.bundle; var exports = global.bundle = {}; factory(exports, null, global.defaultCompat, global.externalAuto, global.externalDefault, global.externalDefaultOnly); exports.noConflict = function () { global.bundle = current; return exports; }; })()); })(this, (function (exports, externalNoImport, defaultCompat, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespaceCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : _interopNamespaceDefault(e); } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var defaultCompat__namespace = /*#__PURE__*/_interopNamespaceCompat(defaultCompat); var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); exports.a = void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(function () { return main; }).then(console.log); import('external').then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultCompat__namespace]); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return defaultCompat.foo; } }); Object.keys(defaultCompat).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return defaultCompat[k]; } }); }); })); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-false/main.js000066400000000000000000000010641450520414700270770ustar00rootroot00000000000000import 'externalNoImport'; import { b } from 'external'; export let a; null, { a } = b; console.log({ a } = b); import('./main.js').then(console.log); import('external').then(console.log); export * from 'external'; export { foo } from 'external'; import defaultCompat from 'external'; console.log(defaultCompat); import externalAuto from 'externalAuto'; console.log(externalAuto); import * as externalDefault from 'externalDefault'; console.log(externalDefault); import * as externalDefaultOnly from 'externalDefaultOnly'; console.log(externalDefaultOnly); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/000077500000000000000000000000001450520414700255015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/_config.js000066400000000000000000000012511450520414700274420ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses arrow functions', options: { external: [ 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly', 'externalNoImport' ], strictDeprecations: false, output: { generatedCode: { arrowFunctions: true }, interop(id) { if (id === 'externalDefault') { return 'default'; } if (id === 'externalDefaultOnly') { return 'defaultOnly'; } if (id === 'externalAuto') { return 'auto'; } return 'compat'; }, name: 'bundle', noConflict: true, dynamicImportInCjs: false, systemNullSetters: false } }, expectedWarnings: ['DEPRECATED_FEATURE'] }); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/_expected/000077500000000000000000000000001450520414700274415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/_expected/amd.js000066400000000000000000000050131450520414700305370ustar00rootroot00000000000000define(['require', 'exports', 'externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], (function (require, exports, externalNoImport, defaultCompat, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; var _interopDefault = e => e && e.__esModule ? e : { default: e }; var _interopNamespaceCompat = e => e && typeof e === 'object' && 'default' in e ? e : _interopNamespaceDefault(e); var _interopNamespaceDefaultOnly = e => Object.freeze({ __proto__: null, default: e }); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(e => e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(k => { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }) ); return Object.freeze(n); } var defaultCompat__namespace = /*#__PURE__*/_interopNamespaceCompat(defaultCompat); var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); exports.a = void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(() => main).then(console.log); new Promise((resolve, reject) => require(['external'], m => resolve(/*#__PURE__*/_interopNamespaceCompat(m)), reject)).then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultCompat__namespace]); Object.defineProperty(exports, 'foo', { enumerable: true, get: () => defaultCompat.foo }); Object.keys(defaultCompat).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => defaultCompat[k] }); }); })); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/_expected/cjs.js000066400000000000000000000046331450520414700305640ustar00rootroot00000000000000'use strict'; require('externalNoImport'); var defaultCompat = require('external'); var externalAuto = require('externalAuto'); var externalDefault = require('externalDefault'); var externalDefaultOnly = require('externalDefaultOnly'); var _interopDefault = e => e && e.__esModule ? e : { default: e }; var _interopNamespaceCompat = e => e && typeof e === 'object' && 'default' in e ? e : _interopNamespaceDefault(e); var _interopNamespaceDefaultOnly = e => Object.freeze({ __proto__: null, default: e }); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(e => e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(k => { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }) ); return Object.freeze(n); } var defaultCompat__namespace = /*#__PURE__*/_interopNamespaceCompat(defaultCompat); var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); exports.a = void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(() => main).then(console.log); Promise.resolve().then(() => /*#__PURE__*/_interopNamespaceCompat(require('external'))).then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultCompat__namespace]); Object.defineProperty(exports, 'foo', { enumerable: true, get: () => defaultCompat.foo }); Object.keys(defaultCompat).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => defaultCompat[k] }); }); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/_expected/es.js000066400000000000000000000021151450520414700304050ustar00rootroot00000000000000import 'externalNoImport'; import * as defaultCompat from 'external'; import defaultCompat__default, { b } from 'external'; export * from 'external'; export { foo } from 'external'; import externalAuto from 'externalAuto'; import * as externalDefault from 'externalDefault'; import * as externalDefaultOnly from 'externalDefaultOnly'; function _mergeNamespaces(n, m) { m.forEach(e => e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(k => { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }) ); return Object.freeze(n); } let a; ({ a } = b); console.log({ a } = b); Promise.resolve().then(() => main).then(console.log); import('external').then(console.log); console.log(defaultCompat__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return a; }, foo: foo }, [defaultCompat]); export { a }; rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/_expected/iife.js000066400000000000000000000046211450520414700307160ustar00rootroot00000000000000var bundle = (function (exports, externalNoImport, defaultCompat, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; var _interopDefault = e => e && e.__esModule ? e : { default: e }; var _interopNamespaceCompat = e => e && typeof e === 'object' && 'default' in e ? e : _interopNamespaceDefault(e); var _interopNamespaceDefaultOnly = e => Object.freeze({ __proto__: null, default: e }); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(e => e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(k => { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }) ); return Object.freeze(n); } var defaultCompat__namespace = /*#__PURE__*/_interopNamespaceCompat(defaultCompat); var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); exports.a = void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(() => main).then(console.log); import('external').then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultCompat__namespace]); Object.defineProperty(exports, 'foo', { enumerable: true, get: () => defaultCompat.foo }); Object.keys(defaultCompat).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => defaultCompat[k] }); }); return exports; })({}, null, defaultCompat, externalAuto, externalDefault, externalDefaultOnly); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/_expected/system.js000066400000000000000000000032601450520414700313240ustar00rootroot00000000000000System.register('bundle', ['externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], (function (exports, module) { 'use strict'; var _starExcludes = { a: 1, default: 1, foo: 1 }; var b, defaultCompat, defaultCompat__default, externalAuto, externalDefault, externalDefaultOnly; return { setters: [() => {}, module => { b = module.b; defaultCompat = module; defaultCompat__default = module.default; var setter = { foo: module.foo }; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }, module => { externalAuto = module.default; }, module => { externalDefault = module; }, module => { externalDefaultOnly = module; }], execute: (function () { function _mergeNamespaces(n, m) { m.forEach(e => e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(k => { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }) ); return Object.freeze(n); } let a; exports('a', a); (v => (exports('a', a), v))({ a } = b); console.log((v => (exports('a', a), v))({ a } = b)); Promise.resolve().then(() => main).then(console.log); module.import('external').then(console.log); console.log(defaultCompat__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return a; }, foo: foo }, [defaultCompat]); }) }; })); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/_expected/umd.js000066400000000000000000000060611450520414700305670ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('externalNoImport'), require('external'), require('externalAuto'), require('externalDefault'), require('externalDefaultOnly')) : typeof define === 'function' && define.amd ? define(['exports', 'externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (() => { var current = global.bundle; var exports = global.bundle = {}; factory(exports, null, global.defaultCompat, global.externalAuto, global.externalDefault, global.externalDefaultOnly); exports.noConflict = () => { global.bundle = current; return exports; }; })()); })(this, (function (exports, externalNoImport, defaultCompat, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; var _interopDefault = e => e && e.__esModule ? e : { default: e }; var _interopNamespaceCompat = e => e && typeof e === 'object' && 'default' in e ? e : _interopNamespaceDefault(e); var _interopNamespaceDefaultOnly = e => Object.freeze({ __proto__: null, default: e }); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(e => e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(k => { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }) ); return Object.freeze(n); } var defaultCompat__namespace = /*#__PURE__*/_interopNamespaceCompat(defaultCompat); var externalAuto__default = /*#__PURE__*/_interopDefault(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); exports.a = void 0; ({ a: exports.a } = defaultCompat.b); console.log({ a: exports.a } = defaultCompat.b); Promise.resolve().then(() => main).then(console.log); import('external').then(console.log); console.log(defaultCompat__namespace.default); console.log(externalAuto__default.default); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultCompat__namespace]); Object.defineProperty(exports, 'foo', { enumerable: true, get: () => defaultCompat.foo }); Object.keys(defaultCompat).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => defaultCompat[k] }); }); })); rollup-3.29.4/test/form/samples/generated-code/arrow-functions-true/main.js000077700000000000000000000000001450520414700347032../arrow-functions-false/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/000077500000000000000000000000001450520414700253755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/_config.js000066400000000000000000000010121450520414700273310ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not use block bindings', expectedWarnings: ['SHIMMED_EXPORT'], options: { external: ['external'], shimMissingExports: true, output: { generatedCode: { arrowFunctions: true, constBindings: false }, name: 'bundle', noConflict: true, exports: 'named', interop: 'compat' }, plugins: [ { name: 'test', transform(code, id) { if (id.endsWith('synthetic.js')) { return { syntheticNamedExports: true }; } } } ] } }); rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/_expected/000077500000000000000000000000001450520414700273355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/_expected/amd.js000066400000000000000000000023061450520414700304350ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, foo$1) { 'use strict'; function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo$1); var _missingExportShim = void 0; const foo = 'bar'; var other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); var synthetic = { bar: 'baz' }; console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); var main = 42; exports.default = main; exports.syntheticMissing = synthetic.syntheticMissing; Object.keys(foo$1).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/_expected/cjs.js000066400000000000000000000022001450520414700304440ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var foo$1 = require('external'); function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo$1); var _missingExportShim = void 0; const foo = 'bar'; var other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); var synthetic = { bar: 'baz' }; console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); var main = 42; exports.default = main; exports.syntheticMissing = synthetic.syntheticMissing; Object.keys(foo$1).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/_expected/es.js000066400000000000000000000007251450520414700303060ustar00rootroot00000000000000import * as foo$1 from 'external'; import foo__default from 'external'; export * from 'external'; var _missingExportShim = void 0; const foo = 'bar'; var other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); var synthetic = { bar: 'baz' }; console.log(foo__default, foo$1, other, bar, _missingExportShim); var main = 42; var syntheticMissing = synthetic.syntheticMissing; export { main as default, syntheticMissing }; rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/_expected/iife.js000066400000000000000000000023201450520414700306040ustar00rootroot00000000000000var bundle = (function (exports, foo$1) { 'use strict'; function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo$1); var _missingExportShim = void 0; const foo = 'bar'; var other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); var synthetic = { bar: 'baz' }; console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); var main = 42; exports.default = main; exports.syntheticMissing = synthetic.syntheticMissing; Object.keys(foo$1).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, foo$1); rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/_expected/system.js000066400000000000000000000014621450520414700312220ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; var _starExcludes = { default: 1, syntheticMissing: 1 }; var foo__default, foo$1; return { setters: [module => { foo__default = module.default; foo$1 = module; var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { var _missingExportShim = void 0; const foo = 'bar'; var other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); var synthetic = { bar: 'baz' }; console.log(foo__default, foo$1, other, bar, _missingExportShim); var main = exports('default', 42); exports('syntheticMissing', synthetic.syntheticMissing); }) }; })); rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/_expected/umd.js000066400000000000000000000032331450520414700304610ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (() => { var current = global.bundle; var exports = global.bundle = {}; factory(exports, global.foo$1); exports.noConflict = () => { global.bundle = current; return exports; }; })()); })(this, (function (exports, foo$1) { 'use strict'; function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(k => { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo$1); var _missingExportShim = void 0; const foo = 'bar'; var other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); var synthetic = { bar: 'baz' }; console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); var main = 42; exports.default = main; exports.syntheticMissing = synthetic.syntheticMissing; Object.keys(foo$1).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/main.js000066400000000000000000000003621450520414700266600ustar00rootroot00000000000000import foo, * as ns from 'external'; import * as other from './other'; import { missing } from './other'; export { syntheticMissing } from './synthetic'; console.log(foo, ns, other, bar, missing); export * from 'external'; export default 42; rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/other.js000066400000000000000000000000321450520414700270470ustar00rootroot00000000000000export const foo = 'bar'; rollup-3.29.4/test/form/samples/generated-code/const-bindings-false/synthetic.js000066400000000000000000000000371450520414700277450ustar00rootroot00000000000000export default { bar: 'baz' }; rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/000077500000000000000000000000001450520414700252625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/_config.js000066400000000000000000000010011450520414700272140ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses block bindings', expectedWarnings: ['SHIMMED_EXPORT'], options: { external: ['external'], shimMissingExports: true, output: { generatedCode: { arrowFunctions: true, constBindings: true }, name: 'bundle', noConflict: true, exports: 'named', interop: 'compat' }, plugins: [ { name: 'test', transform(code, id) { if (id.endsWith('synthetic.js')) { return { syntheticNamedExports: true }; } } } ] } }); rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/_expected/000077500000000000000000000000001450520414700272225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/_expected/amd.js000066400000000000000000000023111450520414700303160ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, foo$1) { 'use strict'; function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; const n = Object.create(null); if (e) { for (const k in e) { if (k !== 'default') { const d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } } } n.default = e; return Object.freeze(n); } const foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo$1); const _missingExportShim = void 0; const foo = 'bar'; const other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); const synthetic = { bar: 'baz' }; console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42; exports.default = main; exports.syntheticMissing = synthetic.syntheticMissing; Object.keys(foo$1).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/_expected/cjs.js000066400000000000000000000022051450520414700303360ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo$1 = require('external'); function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; const n = Object.create(null); if (e) { for (const k in e) { if (k !== 'default') { const d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } } } n.default = e; return Object.freeze(n); } const foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo$1); const _missingExportShim = void 0; const foo = 'bar'; const other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); const synthetic = { bar: 'baz' }; console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42; exports.default = main; exports.syntheticMissing = synthetic.syntheticMissing; Object.keys(foo$1).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/_expected/es.js000066400000000000000000000007371450520414700301760ustar00rootroot00000000000000import * as foo$1 from 'external'; import foo__default from 'external'; export * from 'external'; const _missingExportShim = void 0; const foo = 'bar'; const other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); const synthetic = { bar: 'baz' }; console.log(foo__default, foo$1, other, bar, _missingExportShim); const main = 42; const syntheticMissing = synthetic.syntheticMissing; export { main as default, syntheticMissing }; rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/_expected/iife.js000066400000000000000000000023231450520414700304740ustar00rootroot00000000000000var bundle = (function (exports, foo$1) { 'use strict'; function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; const n = Object.create(null); if (e) { for (const k in e) { if (k !== 'default') { const d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } } } n.default = e; return Object.freeze(n); } const foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo$1); const _missingExportShim = void 0; const foo = 'bar'; const other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); const synthetic = { bar: 'baz' }; console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42; exports.default = main; exports.syntheticMissing = synthetic.syntheticMissing; Object.keys(foo$1).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, foo$1); rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/_expected/system.js000066400000000000000000000015001450520414700311000ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; const _starExcludes = { default: 1, syntheticMissing: 1 }; var foo__default, foo$1; return { setters: [module => { foo__default = module.default; foo$1 = module; const setter = {}; for (const name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { const _missingExportShim = void 0; const foo = 'bar'; const other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); const synthetic = { bar: 'baz' }; console.log(foo__default, foo$1, other, bar, _missingExportShim); const main = exports('default', 42); exports('syntheticMissing', synthetic.syntheticMissing); }) }; })); rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/_expected/umd.js000066400000000000000000000032421450520414700303460ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (() => { const current = global.bundle; const exports = global.bundle = {}; factory(exports, global.foo$1); exports.noConflict = () => { global.bundle = current; return exports; }; })()); })(this, (function (exports, foo$1) { 'use strict'; function _interopNamespaceCompat(e) { if (e && typeof e === 'object' && 'default' in e) return e; const n = Object.create(null); if (e) { for (const k in e) { if (k !== 'default') { const d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } } } n.default = e; return Object.freeze(n); } const foo__namespace = /*#__PURE__*/_interopNamespaceCompat(foo$1); const _missingExportShim = void 0; const foo = 'bar'; const other = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, missing: _missingExportShim }); const synthetic = { bar: 'baz' }; console.log(foo__namespace.default, foo__namespace, other, bar, _missingExportShim); const main = 42; exports.default = main; exports.syntheticMissing = synthetic.syntheticMissing; Object.keys(foo$1).forEach(k => { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/generated-code/const-bindings-true/main.js000077700000000000000000000000001450520414700373262../../generated-code/const-bindings-false/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/object-shorthand-false/000077500000000000000000000000001450520414700257125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/object-shorthand-false/_config.js000066400000000000000000000003411450520414700276520ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not use object shorthand syntax', options: { output: { exports: 'named', format: 'system', generatedCode: { objectShorthand: false }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/generated-code/object-shorthand-false/_expected.js000066400000000000000000000005111450520414700302050ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const a = 'a'; var ns = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: a, default: a }); console.log(ns); const foo = 1; exports({ foo: foo, bar: foo, default: foo }); }) }; })); rollup-3.29.4/test/form/samples/generated-code/object-shorthand-false/main.js000066400000000000000000000001571450520414700271770ustar00rootroot00000000000000import * as ns from './other.js'; console.log(ns); const foo = 1; export { foo, foo as bar, foo as default }; rollup-3.29.4/test/form/samples/generated-code/object-shorthand-false/other.js000066400000000000000000000000631450520414700273700ustar00rootroot00000000000000const a = 'a'; export { a, a as b, a as default }; rollup-3.29.4/test/form/samples/generated-code/object-shorthand-true/000077500000000000000000000000001450520414700255775ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/object-shorthand-true/_config.js000066400000000000000000000003301450520414700275350ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses object shorthand syntax', options: { output: { exports: 'named', format: 'system', generatedCode: { objectShorthand: true }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/generated-code/object-shorthand-true/_expected.js000066400000000000000000000005011450520414700300710ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const a = 'a'; var ns = /*#__PURE__*/Object.freeze({ __proto__: null, a, b: a, default: a }); console.log(ns); const foo = 1; exports({ foo, bar: foo, default: foo }); }) }; })); rollup-3.29.4/test/form/samples/generated-code/object-shorthand-true/main.js000077700000000000000000000000001450520414700401602../../generated-code/object-shorthand-false/main.jsustar00rootroot00000000000000reserved-names-as-props-false-no-external-live-bindings/000077500000000000000000000000001450520414700340415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code_config.js000066400000000000000000000005051450520414700360030ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindingsmodule.exports = defineTest({ description: 'escapes reserved names used as props when external live-bindings are off', options: { external: ['external'], output: { exports: 'named', externalLiveBindings: false, generatedCode: { reservedNamesAsProps: false }, interop: 'compat', name: 'bundle' } } }); _expected/000077500000000000000000000000001450520414700360015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindingsamd.js000066400000000000000000000004031450520414700370750ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expecteddefine(['external'], (function (ns) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; } var ns__default = /*#__PURE__*/_interopDefaultCompat(ns); console.log(ns__default); })); cjs.js000066400000000000000000000003631450520414700371200ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expected'use strict'; var ns = require('external'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; } var ns__default = /*#__PURE__*/_interopDefaultCompat(ns); console.log(ns__default); es.js000066400000000000000000000000551450520414700367460ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expectedimport ns from 'external'; console.log(ns); iife.js000066400000000000000000000003621450520414700372540ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expected(function (ns) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; } var ns__default = /*#__PURE__*/_interopDefaultCompat(ns); console.log(ns__default); })(ns); system.js000066400000000000000000000003301450520414700376570ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expectedSystem.register('bundle', ['external'], (function () { 'use strict'; var ns; return { setters: [function (module) { ns = module["default"]; }], execute: (function () { console.log(ns); }) }; })); umd.js000066400000000000000000000010431450520414700371220ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expected(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external')) : typeof define === 'function' && define.amd ? define(['external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ns)); })(this, (function (ns) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; } var ns__default = /*#__PURE__*/_interopDefaultCompat(ns); console.log(ns__default); })); main.js000066400000000000000000000000541450520414700353220ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindingsimport ns from 'external'; console.log(ns); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/000077500000000000000000000000001450520414700271365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/_config.js000066400000000000000000000007501450520414700311020ustar00rootroot00000000000000module.exports = defineTest({ description: 'escapes reserved names used as props', options: { external: ['external', 'external2', 'externalDefaultOnly'], output: { exports: 'named', generatedCode: { reservedNamesAsProps: false }, interop(id) { if (id === 'externalDefaultOnly') return 'defaultOnly'; return 'auto'; }, name: 'bundle' }, plugins: [ { name: 'test', transform() { return { syntheticNamedExports: true }; } } ] } }); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/_expected/000077500000000000000000000000001450520414700310765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/_expected/amd.js000066400000000000000000000041251450520414700321770ustar00rootroot00000000000000define(['module', 'exports', 'external', 'externalDefaultOnly', 'external2'], (function (module, exports, external, defaultOnly, someDefault) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, 'default': e }); } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n["default"] = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespace(external); var defaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly); var someDefault__default = /*#__PURE__*/_interopDefault(someDefault); var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': other }, [other]); console.log(ns, other.foo, other["function"], other["some-prop"], external["function"], someDefault__default["default"], defaultOnly__namespace); console.log(undefined, undefined); exports["function"] = 1; exports["function"]++; Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external["function"]; } }); exports["default"] = external__namespace; Object.defineProperty(exports, 'void', { enumerable: true, get: function () { return external__namespace["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/_expected/cjs.js000066400000000000000000000040051450520414700322120ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); var defaultOnly = require('externalDefaultOnly'); var someDefault = require('external2'); function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, 'default': e }); } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n["default"] = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespace(external); var defaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly); var someDefault__default = /*#__PURE__*/_interopDefault(someDefault); var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': other }, [other]); console.log(ns, other.foo, other["function"], other["some-prop"], external["function"], someDefault__default["default"], defaultOnly__namespace); console.log(undefined, undefined); exports["function"] = 1; exports["function"]++; Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external["function"]; } }); exports["default"] = external__namespace; Object.defineProperty(exports, 'void', { enumerable: true, get: function () { return external__namespace["default"]; } }); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/_expected/es.js000066400000000000000000000017601450520414700320470ustar00rootroot00000000000000import { function as function$1 } from 'external'; import * as external from 'external'; export { external as default }; export { function as bar, default as void } from 'external'; import * as defaultOnly from 'externalDefaultOnly'; import someDefault from 'external2'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': other }, [other]); console.log(ns, other.foo, other["function"], other["some-prop"], function$1, someDefault, defaultOnly); console.log(import.meta['function'], import.meta['some-prop']); let f = 1; f++; export { f as function }; rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/_expected/iife.js000066400000000000000000000041061450520414700323510ustar00rootroot00000000000000var bundle = (function (exports, external, defaultOnly, someDefault) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, 'default': e }); } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n["default"] = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespace(external); var defaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly); var someDefault__default = /*#__PURE__*/_interopDefault(someDefault); var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': other }, [other]); console.log(ns, other.foo, other["function"], other["some-prop"], external["function"], someDefault__default["default"], defaultOnly__namespace); console.log(undefined, undefined); exports["function"] = 1; exports["function"]++; Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external["function"]; } }); exports["default"] = external__namespace; Object.defineProperty(exports, 'void', { enumerable: true, get: function () { return external__namespace["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external, defaultOnly, someDefault); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/_expected/system.js000066400000000000000000000024511450520414700327620ustar00rootroot00000000000000System.register('bundle', ['external', 'externalDefaultOnly', 'external2'], (function (exports, module) { 'use strict'; var function$1, defaultOnly, someDefault; return { setters: [function (module) { function$1 = module["function"]; exports({ bar: module["function"], 'default': module, 'void': module["default"] }); }, function (module) { defaultOnly = module; }, function (module) { someDefault = module["default"]; }], execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': other }, [other]); console.log(ns, other.foo, other["function"], other["some-prop"], function$1, someDefault, defaultOnly); console.log(module.meta["function"], module.meta["some-prop"]); let f = exports('function', 1); exports('function', f + 1), f++; }) }; })); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/_expected/umd.js000066400000000000000000000047441450520414700322320ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external'), require('externalDefaultOnly'), require('external2')) : typeof define === 'function' && define.amd ? define(['exports', 'external', 'externalDefaultOnly', 'external2'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external, global.defaultOnly, global.someDefault)); })(this, (function (exports, external, defaultOnly, someDefault) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, 'default': e }); } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n["default"] = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespace(external); var defaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly); var someDefault__default = /*#__PURE__*/_interopDefault(someDefault); var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': other }, [other]); console.log(ns, other.foo, other["function"], other["some-prop"], external["function"], someDefault__default["default"], defaultOnly__namespace); console.log(undefined, undefined); exports["function"] = 1; exports["function"]++; Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external["function"]; } }); exports["default"] = external__namespace; Object.defineProperty(exports, 'void', { enumerable: true, get: function () { return external__namespace["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/main.js000066400000000000000000000007111450520414700304170ustar00rootroot00000000000000import * as ns from './other.js'; import { function as g } from 'external'; import * as defaultOnly from 'externalDefaultOnly' import someDefault from 'external2' console.log(ns, ns.foo, ns['function'], ns['some-prop'], g, someDefault, defaultOnly); console.log(import.meta['function'], import.meta['some-prop']); let f = 1; f++; export { f as function }; export * as default from 'external'; export { default as void, function as bar } from 'external'; rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-false/other.js000066400000000000000000000000401450520414700306070ustar00rootroot00000000000000export default { foo: 'bar' }; reserved-names-as-props-true-no-external-live-bindings/000077500000000000000000000000001450520414700337265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code_config.js000066400000000000000000000005041450520414700356670ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindingsmodule.exports = defineTest({ description: 'escapes reserved names used as props when external live-bindings are off', options: { external: ['external'], output: { exports: 'named', externalLiveBindings: false, generatedCode: { reservedNamesAsProps: true }, interop: 'compat', name: 'bundle' } } }); _expected/000077500000000000000000000000001450520414700356665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindingsamd.js000066400000000000000000000004001450520414700367570ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expecteddefine(['external'], (function (ns) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } var ns__default = /*#__PURE__*/_interopDefaultCompat(ns); console.log(ns__default); })); cjs.js000066400000000000000000000003601450520414700370020ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expected'use strict'; var ns = require('external'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } var ns__default = /*#__PURE__*/_interopDefaultCompat(ns); console.log(ns__default); es.js000066400000000000000000000000551450520414700366330ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expectedimport ns from 'external'; console.log(ns); iife.js000066400000000000000000000003571450520414700371450ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expected(function (ns) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } var ns__default = /*#__PURE__*/_interopDefaultCompat(ns); console.log(ns__default); })(ns); system.js000066400000000000000000000003251450520414700375500ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expectedSystem.register('bundle', ['external'], (function () { 'use strict'; var ns; return { setters: [function (module) { ns = module.default; }], execute: (function () { console.log(ns); }) }; })); umd.js000066400000000000000000000010401450520414700370040ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expected(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external')) : typeof define === 'function' && define.amd ? define(['external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ns)); })(this, (function (ns) { 'use strict'; function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } var ns__default = /*#__PURE__*/_interopDefaultCompat(ns); console.log(ns__default); })); main.js000077700000000000000000000000001450520414700545152../../generated-code/reserved-names-as-props-false-no-external-live-bindings/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindingsrollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/000077500000000000000000000000001450520414700270235ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/_config.js000066400000000000000000000007471450520414700307750ustar00rootroot00000000000000module.exports = defineTest({ description: 'escapes reserved names used as props', options: { external: ['external', 'external2', 'externalDefaultOnly'], output: { exports: 'named', generatedCode: { reservedNamesAsProps: true }, interop(id) { if (id === 'externalDefaultOnly') return 'defaultOnly'; return 'auto'; }, name: 'bundle' }, plugins: [ { name: 'test', transform() { return { syntheticNamedExports: true }; } } ] } }); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/_expected/000077500000000000000000000000001450520414700307635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/_expected/amd.js000066400000000000000000000040641450520414700320660ustar00rootroot00000000000000define(['module', 'exports', 'external', 'externalDefaultOnly', 'external2'], (function (module, exports, external, defaultOnly, someDefault) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespace(external); var defaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly); var someDefault__default = /*#__PURE__*/_interopDefault(someDefault); var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: other }, [other]); console.log(ns, other.foo, other.function, other["some-prop"], external.function, someDefault__default.default, defaultOnly__namespace); console.log(undefined, undefined); exports.function = 1; exports.function++; Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external.function; } }); exports.default = external__namespace; Object.defineProperty(exports, 'void', { enumerable: true, get: function () { return external__namespace.default; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/_expected/cjs.js000066400000000000000000000037441450520414700321100ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); var defaultOnly = require('externalDefaultOnly'); var someDefault = require('external2'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespace(external); var defaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly); var someDefault__default = /*#__PURE__*/_interopDefault(someDefault); var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: other }, [other]); console.log(ns, other.foo, other.function, other["some-prop"], external.function, someDefault__default.default, defaultOnly__namespace); console.log(undefined, undefined); exports.function = 1; exports.function++; Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external.function; } }); exports.default = external__namespace; Object.defineProperty(exports, 'void', { enumerable: true, get: function () { return external__namespace.default; } }); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/_expected/es.js000066400000000000000000000017531450520414700317360ustar00rootroot00000000000000import { function as function$1 } from 'external'; import * as external from 'external'; export { external as default }; export { function as bar, default as void } from 'external'; import * as defaultOnly from 'externalDefaultOnly'; import someDefault from 'external2'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: other }, [other]); console.log(ns, other.foo, other.function, other["some-prop"], function$1, someDefault, defaultOnly); console.log(import.meta['function'], import.meta['some-prop']); let f = 1; f++; export { f as function }; rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/_expected/iife.js000066400000000000000000000040451450520414700322400ustar00rootroot00000000000000var bundle = (function (exports, external, defaultOnly, someDefault) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespace(external); var defaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly); var someDefault__default = /*#__PURE__*/_interopDefault(someDefault); var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: other }, [other]); console.log(ns, other.foo, other.function, other["some-prop"], external.function, someDefault__default.default, defaultOnly__namespace); console.log(undefined, undefined); exports.function = 1; exports.function++; Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external.function; } }); exports.default = external__namespace; Object.defineProperty(exports, 'void', { enumerable: true, get: function () { return external__namespace.default; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external, defaultOnly, someDefault); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/_expected/system.js000066400000000000000000000024211450520414700326440ustar00rootroot00000000000000System.register('bundle', ['external', 'externalDefaultOnly', 'external2'], (function (exports, module) { 'use strict'; var function$1, defaultOnly, someDefault; return { setters: [function (module) { function$1 = module.function; exports({ bar: module.function, default: module, void: module.default }); }, function (module) { defaultOnly = module; }, function (module) { someDefault = module.default; }], execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: other }, [other]); console.log(ns, other.foo, other.function, other["some-prop"], function$1, someDefault, defaultOnly); console.log(module.meta.function, module.meta["some-prop"]); let f = exports('function', 1); exports('function', f + 1), f++; }) }; })); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/_expected/umd.js000066400000000000000000000047031450520414700321120ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external'), require('externalDefaultOnly'), require('external2')) : typeof define === 'function' && define.amd ? define(['exports', 'external', 'externalDefaultOnly', 'external2'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external, global.defaultOnly, global.someDefault)); })(this, (function (exports, external, defaultOnly, someDefault) { 'use strict'; function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespace(external); var defaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(defaultOnly); var someDefault__default = /*#__PURE__*/_interopDefault(someDefault); var other = { foo: 'bar' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: other }, [other]); console.log(ns, other.foo, other.function, other["some-prop"], external.function, someDefault__default.default, defaultOnly__namespace); console.log(undefined, undefined); exports.function = 1; exports.function++; Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external.function; } }); exports.default = external__namespace; Object.defineProperty(exports, 'void', { enumerable: true, get: function () { return external__namespace.default; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/generated-code/reserved-names-as-props-true/main.js000077700000000000000000000000001450520414700426302../../generated-code/reserved-names-as-props-false/main.jsustar00rootroot00000000000000rollup-3.29.4/test/form/samples/getter-return-values/000077500000000000000000000000001450520414700226225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/getter-return-values/_config.js000066400000000000000000000001241450520414700245610ustar00rootroot00000000000000module.exports = defineTest({ description: 'forwards return values of getters' }); rollup-3.29.4/test/form/samples/getter-return-values/_expected.js000066400000000000000000000006551450520414700251260ustar00rootroot00000000000000({ get foo () { console.log( 'effect' ); return {}; } }).foo.bar; ({ get foo () { return {}; } }).foo.bar.baz; ({ get foo () { console.log( 'effect' ); return () => {}; } }).foo(); ({ get foo () { return () => console.log( 'effect' ); } }).foo(); ({ get foo () { console.log( 'effect' ); return () => () => {}; } }).foo()(); ({ get foo () { return () => () => console.log( 'effect' ); } }).foo()(); rollup-3.29.4/test/form/samples/getter-return-values/main.js000066400000000000000000000011061450520414700241020ustar00rootroot00000000000000({ get foo () { return {}; } }).foo.bar; ({ get foo () { console.log( 'effect' ); return {}; } }).foo.bar; ({ get foo () { return {}; } }).foo.bar.baz; ({ get foo () { return () => {}; } }).foo(); ({ get foo () { console.log( 'effect' ); return () => {}; } }).foo(); ({ get foo () { return () => console.log( 'effect' ); } }).foo(); ({ get foo () { return () => () => {}; } }).foo()(); ({ get foo () { console.log( 'effect' ); return () => () => {}; } }).foo()(); ({ get foo () { return () => () => console.log( 'effect' ); } }).foo()(); rollup-3.29.4/test/form/samples/globals-function/000077500000000000000000000000001450520414700217645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/globals-function/_config.js000066400000000000000000000003201450520414700237210ustar00rootroot00000000000000module.exports = defineTest({ description: 'Externals aliases with deshadowing', options: { external: ['a', 'b'], output: { globals: id => `thisIs${id.toUpperCase()}`, name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/globals-function/_expected/000077500000000000000000000000001450520414700237245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/globals-function/_expected/amd.js000066400000000000000000000001171450520414700250220ustar00rootroot00000000000000define(['a', 'b'], (function (a, b) { 'use strict'; console.log(a, b); })); rollup-3.29.4/test/form/samples/globals-function/_expected/cjs.js000066400000000000000000000001171450520414700250400ustar00rootroot00000000000000'use strict'; var a = require('a'); var b = require('b'); console.log(a, b); rollup-3.29.4/test/form/samples/globals-function/_expected/es.js000066400000000000000000000000721450520414700246700ustar00rootroot00000000000000import a from 'a'; import b from 'b'; console.log(a, b); rollup-3.29.4/test/form/samples/globals-function/_expected/iife.js000066400000000000000000000001161450520414700251740ustar00rootroot00000000000000(function (a, b) { 'use strict'; console.log(a, b); })(thisIsA, thisIsB); rollup-3.29.4/test/form/samples/globals-function/_expected/system.js000066400000000000000000000004101450520414700256010ustar00rootroot00000000000000System.register('myBundle', ['a', 'b'], (function () { 'use strict'; var a, b; return { setters: [function (module) { a = module.default; }, function (module) { b = module.default; }], execute: (function () { console.log(a, b); }) }; })); rollup-3.29.4/test/form/samples/globals-function/_expected/umd.js000066400000000000000000000006131450520414700250470ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('a'), require('b')) : typeof define === 'function' && define.amd ? define(['a', 'b'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.thisIsA, global.thisIsB)); })(this, (function (a, b) { 'use strict'; console.log(a, b); })); rollup-3.29.4/test/form/samples/globals-function/main.js000066400000000000000000000000721450520414700232450ustar00rootroot00000000000000import a from 'a'; import b from 'b'; console.log(a, b); rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/000077500000000000000000000000001450520414700277225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/_config.js000066400000000000000000000002001450520414700316540ustar00rootroot00000000000000module.exports = defineTest({ description: 'accessing members of pure functions and their prototypes is not a side-effect' }); rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/_expected/000077500000000000000000000000001450520414700316625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/_expected/amd.js000066400000000000000000000001351450520414700327600ustar00rootroot00000000000000define((function () { 'use strict'; Unknown.staticMember; Unknown.prototype.method; })); rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/_expected/cjs.js000066400000000000000000000000771450520414700330030ustar00rootroot00000000000000'use strict'; Unknown.staticMember; Unknown.prototype.method; rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/_expected/es.js000066400000000000000000000000601450520414700326230ustar00rootroot00000000000000Unknown.staticMember; Unknown.prototype.method; rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/_expected/iife.js000066400000000000000000000001301450520414700331260ustar00rootroot00000000000000(function () { 'use strict'; Unknown.staticMember; Unknown.prototype.method; })(); rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/_expected/system.js000066400000000000000000000002341450520414700335430ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { Unknown.staticMember; Unknown.prototype.method; }) }; })); rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/_expected/umd.js000066400000000000000000000002731450520414700330070ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; Unknown.staticMember; Unknown.prototype.method; })); rollup-3.29.4/test/form/samples/globals-removes-access-to-pure-function-members/main.js000066400000000000000000000001741450520414700312060ustar00rootroot00000000000000Symbol.iterator; Array.prototype.reverse; Object.prototype.hasOwnProperty; Unknown.staticMember; Unknown.prototype.method; rollup-3.29.4/test/form/samples/guessed-global-names/000077500000000000000000000000001450520414700225145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/guessed-global-names/_config.js000066400000000000000000000004711450520414700244600ustar00rootroot00000000000000const { resolve } = require('node:path'); module.exports = defineTest({ description: 'guesses global names if necessary', expectedWarnings: ['MISSING_GLOBAL_NAME'], options: { external: [ 'unchanged', 'changed', 'special-character', 'with/slash', resolve(__dirname, 'relative.js') ] } }); rollup-3.29.4/test/form/samples/guessed-global-names/_expected/000077500000000000000000000000001450520414700244545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/guessed-global-names/_expected/amd.js000066400000000000000000000004171450520414700255550ustar00rootroot00000000000000define(['unchanged', 'changed', 'special-character', 'with/slash', './relative'], (function (unchanged, changedName, specialCharacter, slash, relative_js) { 'use strict'; console.log(unchanged.foo, changedName, specialCharacter.bar, slash.baz, relative_js.quux); })); rollup-3.29.4/test/form/samples/guessed-global-names/_expected/cjs.js000066400000000000000000000004741450520414700255760ustar00rootroot00000000000000'use strict'; var unchanged = require('unchanged'); var changedName = require('changed'); var specialCharacter = require('special-character'); var slash = require('with/slash'); var relative_js = require('./relative.js'); console.log(unchanged.foo, changedName, specialCharacter.bar, slash.baz, relative_js.quux); rollup-3.29.4/test/form/samples/guessed-global-names/_expected/es.js000066400000000000000000000003451450520414700254230ustar00rootroot00000000000000import { foo } from 'unchanged'; import changedName from 'changed'; import { bar } from 'special-character'; import { baz } from 'with/slash'; import { quux } from './relative.js'; console.log(foo, changedName, bar, baz, quux); rollup-3.29.4/test/form/samples/guessed-global-names/_expected/iife.js000066400000000000000000000003731450520414700257310ustar00rootroot00000000000000(function (unchanged, changedName, specialCharacter, slash, relative_js) { 'use strict'; console.log(unchanged.foo, changedName, specialCharacter.bar, slash.baz, relative_js.quux); })(unchanged, changedName, specialCharacter, slash, relative_js); rollup-3.29.4/test/form/samples/guessed-global-names/_expected/system.js000066400000000000000000000010121450520414700263300ustar00rootroot00000000000000System.register(['unchanged', 'changed', 'special-character', 'with/slash', './relative.js'], (function () { 'use strict'; var foo, changedName, bar, baz, quux; return { setters: [function (module) { foo = module.foo; }, function (module) { changedName = module.default; }, function (module) { bar = module.bar; }, function (module) { baz = module.baz; }, function (module) { quux = module.quux; }], execute: (function () { console.log(foo, changedName, bar, baz, quux); }) }; })); rollup-3.29.4/test/form/samples/guessed-global-names/_expected/umd.js000066400000000000000000000013511450520414700255770ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('unchanged'), require('changed'), require('special-character'), require('with/slash'), require('./relative.js')) : typeof define === 'function' && define.amd ? define(['unchanged', 'changed', 'special-character', 'with/slash', './relative'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.unchanged, global.changedName, global.specialCharacter, global.slash, global.relative_js)); })(this, (function (unchanged, changedName, specialCharacter, slash, relative_js) { 'use strict'; console.log(unchanged.foo, changedName, specialCharacter.bar, slash.baz, relative_js.quux); })); rollup-3.29.4/test/form/samples/guessed-global-names/main.js000066400000000000000000000003451450520414700240000ustar00rootroot00000000000000import { foo } from 'unchanged'; import changedName from 'changed'; import { bar } from 'special-character'; import { baz } from 'with/slash'; import { quux } from './relative.js'; console.log(foo, changedName, bar, baz, quux); rollup-3.29.4/test/form/samples/handles-async-await/000077500000000000000000000000001450520414700223525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/handles-async-await/_config.js000066400000000000000000000001351450520414700243130ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly handles exporting async functions' }); rollup-3.29.4/test/form/samples/handles-async-await/_expected.js000066400000000000000000000001671450520414700246540ustar00rootroot00000000000000async function callback() { const response = await Promise.resolve(43); return response - 1; } export { callback }; rollup-3.29.4/test/form/samples/handles-async-await/main.js000066400000000000000000000001501450520414700236300ustar00rootroot00000000000000export async function callback() { const response = await Promise.resolve(43); return response - 1; } rollup-3.29.4/test/form/samples/handles-empty-imports-iife/000077500000000000000000000000001450520414700236755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/handles-empty-imports-iife/_config.js000066400000000000000000000004341450520414700256400ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles empty imports when generating IIFE output', expectedWarnings: ['MISSING_NODE_BUILTINS', 'UNRESOLVED_IMPORT'], options: { output: { format: 'iife', globals: { dns: 'dns', util: 'util', fs: 'fs' } } } }); rollup-3.29.4/test/form/samples/handles-empty-imports-iife/_expected.js000066400000000000000000000001671450520414700261770ustar00rootroot00000000000000(function (dns, util, fs) { 'use strict'; dns.resolve('name'); fs.writeFileSync('foo', 'bar'); })(dns, util, fs); rollup-3.29.4/test/form/samples/handles-empty-imports-iife/main.js000066400000000000000000000002011450520414700251500ustar00rootroot00000000000000import { resolve } from 'dns'; import 'util'; import { writeFileSync } from 'fs'; resolve('name'); writeFileSync('foo', 'bar'); rollup-3.29.4/test/form/samples/handles-empty-imports-umd/000077500000000000000000000000001450520414700235465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/handles-empty-imports-umd/_config.js000066400000000000000000000004331450520414700255100ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles empty imports when generating IIFE output', expectedWarnings: ['MISSING_NODE_BUILTINS', 'UNRESOLVED_IMPORT'], options: { output: { format: 'umd', globals: { dns: 'dns', util: 'util', fs: 'fs' } } } }); rollup-3.29.4/test/form/samples/handles-empty-imports-umd/_expected.js000066400000000000000000000007321450520414700260460ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('dns'), require('util'), require('fs')) : typeof define === 'function' && define.amd ? define(['dns', 'util', 'fs'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.dns, global.util, global.fs)); })(this, (function (dns, util, fs) { 'use strict'; dns.resolve('name'); fs.writeFileSync('foo', 'bar'); })); rollup-3.29.4/test/form/samples/handles-empty-imports-umd/main.js000066400000000000000000000002011450520414700250210ustar00rootroot00000000000000import { resolve } from 'dns'; import 'util'; import { writeFileSync } from 'fs'; resolve('name'); writeFileSync('foo', 'bar'); rollup-3.29.4/test/form/samples/hashbang/000077500000000000000000000000001450520414700202715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/hashbang/_config.js000066400000000000000000000001451450520414700222330ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports input files with leading hashbang comment' }); rollup-3.29.4/test/form/samples/hashbang/_expected.js000066400000000000000000000000541450520414700225660ustar00rootroot00000000000000console.log('other'); console.log('main'); rollup-3.29.4/test/form/samples/hashbang/main.js000066400000000000000000000000731450520414700215530ustar00rootroot00000000000000#!/usr/bin/env node import './other'; console.log('main'); rollup-3.29.4/test/form/samples/hashbang/other.js000066400000000000000000000000511450520414700217440ustar00rootroot00000000000000#!/usr/bin/env node console.log('other');rollup-3.29.4/test/form/samples/hoisted-unused-conditional/000077500000000000000000000000001450520414700237575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/hoisted-unused-conditional/_config.js000066400000000000000000000001661450520414700257240ustar00rootroot00000000000000module.exports = defineTest({ description: 'Properly renders conditionals in hoisted variables in dead branches' }); rollup-3.29.4/test/form/samples/hoisted-unused-conditional/_expected.js000066400000000000000000000001251450520414700262530ustar00rootroot00000000000000var deadVariable, otherDeadVariable; console.log(deadVariable, otherDeadVariable); rollup-3.29.4/test/form/samples/hoisted-unused-conditional/main.js000066400000000000000000000001751450520414700252440ustar00rootroot00000000000000if (false) { var deadVariable = someGlobal ? 1 : 2, otherDeadVariable = 3; } console.log(deadVariable, otherDeadVariable); rollup-3.29.4/test/form/samples/hoisted-variable-case-stmt/000077500000000000000000000000001450520414700236365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/hoisted-variable-case-stmt/_config.js000066400000000000000000000001741450520414700256020ustar00rootroot00000000000000module.exports = defineTest({ description: 'Properly handles a variable hoisted from within a fallthrough switch case' }); rollup-3.29.4/test/form/samples/hoisted-variable-case-stmt/_expected.js000066400000000000000000000002211450520414700261270ustar00rootroot00000000000000switch (globalThis.unknown) { case 1: var hoisted = true; case 2: if (hoisted) { throw "failed"; } } rollup-3.29.4/test/form/samples/hoisted-variable-case-stmt/main.js000066400000000000000000000002211450520414700251130ustar00rootroot00000000000000switch (globalThis.unknown) { case 1: var hoisted = true; case 2: if (hoisted) { throw "failed"; } } rollup-3.29.4/test/form/samples/hoisted-variable-if-stmt/000077500000000000000000000000001450520414700233215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/hoisted-variable-if-stmt/_config.js000066400000000000000000000002111450520414700252550ustar00rootroot00000000000000module.exports = defineTest({ description: 'Properly renders branches which refer to hoisted variables from other lexical scopes' }); rollup-3.29.4/test/form/samples/hoisted-variable-if-stmt/_expected.js000066400000000000000000000002041450520414700256130ustar00rootroot00000000000000var foo; if (foo) { console.log("nope"); } { var bar; { bar = true; } } if (bar) { console.log("ok"); } rollup-3.29.4/test/form/samples/hoisted-variable-if-stmt/main.js000066400000000000000000000003371450520414700246060ustar00rootroot00000000000000if (false) { var foo = true; var unused; } if (foo) { console.log("nope"); } if (true) { if (false) { var bar = false; } else { bar = true; } } if (bar) { console.log("ok"); } rollup-3.29.4/test/form/samples/hoisted-vars-in-dead-branches/000077500000000000000000000000001450520414700242105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/hoisted-vars-in-dead-branches/_config.js000066400000000000000000000001351450520414700261510ustar00rootroot00000000000000module.exports = defineTest({ description: 'renders hoisted variables in dead branches' }); rollup-3.29.4/test/form/samples/hoisted-vars-in-dead-branches/_expected.js000066400000000000000000000001571450520414700265110ustar00rootroot00000000000000var a, b; { console.log(a, b); } var c, d; if (((() => console.log('effect'))(), true)) ; console.log(c, d); rollup-3.29.4/test/form/samples/hoisted-vars-in-dead-branches/main.js000066400000000000000000000004121450520414700254670ustar00rootroot00000000000000if (false) { for (var a; unknownGlobal && true; unknownGlobal && true) var b; } else { console.log(a, b); } if (((() => console.log('effect'))(), true)) { } else { var c = 1; for (var c; unknownGlobal && true; unknownGlobal && true) var d; } console.log(c, d); rollup-3.29.4/test/form/samples/ignore-property-access-side-effects/000077500000000000000000000000001450520414700254615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/ignore-property-access-side-effects/_config.js000066400000000000000000000003721450520414700274250ustar00rootroot00000000000000module.exports = defineTest({ description: 'ignore side-effects when accessing properties if treeshake.propertyReadSideEffects is false', expectedWarnings: ['EMPTY_BUNDLE'], options: { treeshake: { propertyReadSideEffects: false } } }); rollup-3.29.4/test/form/samples/ignore-property-access-side-effects/_expected.js000066400000000000000000000000011450520414700277460ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/ignore-property-access-side-effects/main.js000066400000000000000000000010471450520414700267450ustar00rootroot00000000000000const getter = { get foo() { console.log('effect'); } }; const foo1 = getter.foo; const empty = {}; const foo2 = empty.foo.tooDeep; function accessArg(arg) { const foo3 = arg.tooDeep; } accessArg(null); const foo4 = globalThis.unknown.unknownProperty; const foo5 = { ...{ get prop() { console.log('effect'); } } }; const foo6 = (async function () { return { get then() { console.log('effect'); return () => {}; } }; })(); const foo7 = (async () => ({ get then() { console.log('effect'); return () => {}; } }))(); rollup-3.29.4/test/form/samples/ignore-unknown-global-side-effects/000077500000000000000000000000001450520414700252735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/ignore-unknown-global-side-effects/_config.js000066400000000000000000000004011450520414700272300ustar00rootroot00000000000000module.exports = defineTest({ description: 'ignore side-effects when accessing unknown globals if treeshake.unknownGlobalSideEffects is false', expectedWarnings: ['EMPTY_BUNDLE'], options: { treeshake: { unknownGlobalSideEffects: false } } }); rollup-3.29.4/test/form/samples/ignore-unknown-global-side-effects/_expected.js000066400000000000000000000000011450520414700275600ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/ignore-unknown-global-side-effects/main.js000066400000000000000000000000361450520414700265540ustar00rootroot00000000000000foo; class bar extends baz {} rollup-3.29.4/test/form/samples/implicit-undefined-assignments/000077500000000000000000000000001450520414700246205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/implicit-undefined-assignments/_config.js000066400000000000000000000001731450520414700265630ustar00rootroot00000000000000module.exports = defineTest({ description: 'Make sure implicit undefined assignments in declarations are not ignored' }); rollup-3.29.4/test/form/samples/implicit-undefined-assignments/_expected/000077500000000000000000000000001450520414700265605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/implicit-undefined-assignments/_expected/amd.js000066400000000000000000000002141450520414700276540ustar00rootroot00000000000000define((function () { 'use strict'; let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; })); rollup-3.29.4/test/form/samples/implicit-undefined-assignments/_expected/cjs.js000066400000000000000000000001501450520414700276710ustar00rootroot00000000000000'use strict'; let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; rollup-3.29.4/test/form/samples/implicit-undefined-assignments/_expected/es.js000066400000000000000000000001311450520414700275200ustar00rootroot00000000000000let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; rollup-3.29.4/test/form/samples/implicit-undefined-assignments/_expected/iife.js000066400000000000000000000002071450520414700300310ustar00rootroot00000000000000(function () { 'use strict'; let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; })(); rollup-3.29.4/test/form/samples/implicit-undefined-assignments/_expected/system.js000066400000000000000000000003271450520414700304440ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; }) }; })); rollup-3.29.4/test/form/samples/implicit-undefined-assignments/_expected/umd.js000066400000000000000000000003521450520414700277030ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; })); rollup-3.29.4/test/form/samples/implicit-undefined-assignments/main.js000066400000000000000000000001311450520414700260750ustar00rootroot00000000000000let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; rollup-3.29.4/test/form/samples/import-assertions/000077500000000000000000000000001450520414700222205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/assertion-shapes/000077500000000000000000000000001450520414700255105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/assertion-shapes/_config.js000066400000000000000000000001761450520414700274560ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles special shapes of assertions', options: { external: () => true } }); rollup-3.29.4/test/form/samples/import-assertions/assertion-shapes/_expected.js000066400000000000000000000001661450520414700300110ustar00rootroot00000000000000import('external-a', { assert: { type: 'json' } }); import('external-b'); import('external-c'); import('external-d'); rollup-3.29.4/test/form/samples/import-assertions/assertion-shapes/main.js000066400000000000000000000002501450520414700267670ustar00rootroot00000000000000import('external-a', { 'assert': { 'type': 'json', foo: 1, ...{} } }); import('external-b', { assert: {} }); import('external-c', { ...{} }); import('external-d', {}); rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/000077500000000000000000000000001450520414700267565ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/_config.js000066400000000000000000000013011450520414700307130ustar00rootroot00000000000000module.exports = defineTest({ description: 'keep import assertions for dynamic imports', expectedWarnings: ['UNRESOLVED_IMPORT'], options: { external: id => { if (id === 'unresolved') return null; return true; }, plugins: [ { name: 'test', resolveDynamicImport(specifier) { if (typeof specifier === 'object') { if (specifier.type === 'TemplateLiteral') { return "'resolvedString'"; } if (specifier.type === 'BinaryExpression') { return { id: 'resolved-id', external: true }; } } else if (specifier === 'external-resolved') { return { id: 'resolved-different', external: true }; } return null; } } ] } }); rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/000077500000000000000000000000001450520414700307165ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/amd.js000066400000000000000000000026071450520414700320220ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })(globalThis.unknown); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })('resolvedString'); new Promise(function (resolve, reject) { require(['resolved-id'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); new Promise(function (resolve, reject) { require(['resolved-different'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); new Promise(function (resolve, reject) { require(['unresolved'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })); rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/cjs.js000066400000000000000000000002441450520414700320330ustar00rootroot00000000000000'use strict'; import('external'); import(globalThis.unknown); import('resolvedString'); import('resolved-id'); import('resolved-different'); import('unresolved'); rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/es.js000066400000000000000000000005331450520414700316640ustar00rootroot00000000000000import('external', { assert: { type: 'special' } }); import(globalThis.unknown, { assert: { type: 'special' } }); import('resolvedString', { assert: { type: 'special' } }); import('resolved-id', { assert: { type: 'special' } }); import('resolved-different', { assert: { type: 'special' } }); import('unresolved', { assert: { type: 'special' } }); rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/iife.js000066400000000000000000000003011450520414700321620ustar00rootroot00000000000000(function () { 'use strict'; import('external'); import(globalThis.unknown); import('resolvedString'); import('resolved-id'); import('resolved-different'); import('unresolved'); })(); rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/system.js000066400000000000000000000005061450520414700326010ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('external'); module.import(globalThis.unknown); module.import('resolvedString'); module.import('resolved-id'); module.import('resolved-different'); module.import('unresolved'); }) }; })); rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/_expected/umd.js000066400000000000000000000004441450520414700320430ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; import('external'); import(globalThis.unknown); import('resolvedString'); import('resolved-id'); import('resolved-different'); import('unresolved'); })); rollup-3.29.4/test/form/samples/import-assertions/keep-dynamic-assertions/main.js000066400000000000000000000005741450520414700302460ustar00rootroot00000000000000import('external', { assert: { type: 'special' } }); import(globalThis.unknown, { assert: { type: 'special' } }); import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); import('external' + globalThis.unknown, { assert: { type: 'special' } }); import('external-resolved', { assert: { type: 'special' } }); import('unresolved', { assert: { type: 'special' } }); rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/000077500000000000000000000000001450520414700270045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/_config.js000066400000000000000000000004001450520414700307400ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps any import assertions on input', expectedWarnings: ['UNRESOLVED_IMPORT'], options: { external: id => { if (id === 'unresolved') return null; return true; }, output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/_expected/000077500000000000000000000000001450520414700307445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/_expected/amd.js000066400000000000000000000016451450520414700320510ustar00rootroot00000000000000define(['exports', 'a', 'b', 'c', 'd', 'unresolved'], (function (exports, a, b, c, d$1, unresolved) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var b__namespace = /*#__PURE__*/_interopNamespaceDefault(b); console.log(a.a, b__namespace, d); Object.defineProperty(exports, 'c', { enumerable: true, get: function () { return c.c; } }); Object.keys(d$1).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return d$1[k]; } }); }); })); rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/_expected/cjs.js000066400000000000000000000016171450520414700320660ustar00rootroot00000000000000'use strict'; var a = require('a'); var b = require('b'); var c = require('c'); var d$1 = require('d'); require('unresolved'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var b__namespace = /*#__PURE__*/_interopNamespaceDefault(b); console.log(a.a, b__namespace, d); Object.defineProperty(exports, 'c', { enumerable: true, get: function () { return c.c; } }); Object.keys(d$1).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return d$1[k]; } }); }); rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/_expected/es.js000066400000000000000000000003761450520414700317170ustar00rootroot00000000000000import { a } from 'a' assert { type: 'a', extra: 'extra' }; import * as b from 'b' assert { type: 'b' }; export { c } from 'c' assert { type: 'c' }; export * from 'd' assert { type: 'd' }; import 'unresolved' assert { type: 'e' }; console.log(a, b, d); rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/_expected/iife.js000066400000000000000000000016241450520414700322210ustar00rootroot00000000000000var bundle = (function (exports, a, b, c, d$1) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var b__namespace = /*#__PURE__*/_interopNamespaceDefault(b); console.log(a.a, b__namespace, d); Object.defineProperty(exports, 'c', { enumerable: true, get: function () { return c.c; } }); Object.keys(d$1).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return d$1[k]; } }); }); return exports; })({}, a, b, c, d$1); rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/_expected/system.js000066400000000000000000000010431450520414700326240ustar00rootroot00000000000000System.register('bundle', ['a', 'b', 'c', 'd', 'unresolved'], (function (exports) { 'use strict'; var _starExcludes = { default: 1, c: 1 }; var a, b; return { setters: [function (module) { a = module.a; }, function (module) { b = module; }, function (module) { exports('c', module.c); }, function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }, null], execute: (function () { console.log(a, b, d); }) }; })); rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/_expected/umd.js000066400000000000000000000024571450520414700320770ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('a'), require('b'), require('c'), require('d'), require('unresolved')) : typeof define === 'function' && define.amd ? define(['exports', 'a', 'b', 'c', 'd', 'unresolved'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.a, global.b, global.c, global.d$1)); })(this, (function (exports, a, b, c, d$1) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var b__namespace = /*#__PURE__*/_interopNamespaceDefault(b); console.log(a.a, b__namespace, d); Object.defineProperty(exports, 'c', { enumerable: true, get: function () { return c.c; } }); Object.keys(d$1).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return d$1[k]; } }); }); })); rollup-3.29.4/test/form/samples/import-assertions/keeps-static-assertions/main.js000066400000000000000000000004001450520414700302600ustar00rootroot00000000000000import { a } from 'a' assert { type: 'a', extra: 'extra' }; import * as b from 'b' assert { type: 'b' }; export { c } from 'c' assert { type: 'c' }; export * from 'd' assert { type: 'd' }; import 'unresolved' assert { type: 'e' }; console.log(a, b, d); rollup-3.29.4/test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/000077500000000000000000000000001450520414700321635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/_config.js000066400000000000000000000012551450520414700341300ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows plugins to read and write import assertions in resolveDynamicImport', options: { plugins: [ { name: 'test', resolveDynamicImport(specifier, importer, { assertions }) { const resolutionOptions = { external: true, assertions: Object.fromEntries(Object.keys(assertions).map(key => [key, 'changed'])) }; if (typeof specifier === 'object') { if (specifier.type === 'TemplateLiteral') { return { id: 'resolved-a', ...resolutionOptions }; } return { id: 'resolved-b', ...resolutionOptions }; } return { id: specifier, ...resolutionOptions }; } } ] } }); _expected.js000066400000000000000000000002321450520414700343770ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/plugin-assertions-resolvedynamicimportimport('a', { assert: { type: 'changed' } }); import('resolved-b', { assert: { type: 'changed', extra: 'changed' } }); import('b'); import('resolved-a'); rollup-3.29.4/test/form/samples/import-assertions/plugin-assertions-resolvedynamicimport/main.js000066400000000000000000000002621450520414700334450ustar00rootroot00000000000000import('a', { assert: { type: 'special' } }); import(globalThis.unknown, { assert: { type: 'special', extra: 'value' } }); import('b'); import(`external-${globalThis.unknown}`); rollup-3.29.4/test/form/samples/import-assertions/plugin-assertions-resolveid/000077500000000000000000000000001450520414700277005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/plugin-assertions-resolveid/_config.js000066400000000000000000000006531450520414700316460ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows plugins to read and write import assertions in resolveId', options: { output: { name: 'bundle' }, plugins: [ { name: 'test', resolveId(source, importer, { assertions, isEntry }) { return { id: source, external: !isEntry, assertions: Object.fromEntries(Object.keys(assertions).map(key => [key, 'changed'])) }; } } ] } }); rollup-3.29.4/test/form/samples/import-assertions/plugin-assertions-resolveid/_expected.js000066400000000000000000000004651450520414700322030ustar00rootroot00000000000000import { a } from 'a' assert { type: 'changed', extra: 'changed' }; import * as b from 'b' assert { type: 'changed' }; export { c } from 'c' assert { type: 'changed' }; export * from 'd' assert { type: 'changed' }; import 'e'; console.log(a, b, d); import('f', { assert: { type: 'changed' } }); import('g'); rollup-3.29.4/test/form/samples/import-assertions/plugin-assertions-resolveid/main.js000066400000000000000000000004251450520414700311630ustar00rootroot00000000000000import { a } from 'a' assert { type: 'a', extra: 'extra' }; import * as b from 'b' assert { type: 'b' }; export { c } from 'c' assert { type: 'c' }; export * from 'd' assert { type: 'd' }; import 'e'; console.log(a, b, d); import('f', { assert: { type: 'f' } }); import('g'); rollup-3.29.4/test/form/samples/import-assertions/removes-dynamic-assertions/000077500000000000000000000000001450520414700275125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/removes-dynamic-assertions/_config.js000066400000000000000000000013601450520414700314540ustar00rootroot00000000000000module.exports = defineTest({ description: 'keep import assertions for dynamic imports', expectedWarnings: ['UNRESOLVED_IMPORT'], options: { external: id => { if (id === 'unresolved') return null; return true; }, plugins: [ { name: 'test', resolveDynamicImport(specifier) { if (typeof specifier === 'object') { if (specifier.type === 'TemplateLiteral') { return "'resolvedString'"; } if (specifier.type === 'BinaryExpression') { return { id: 'resolved-id', external: true }; } } else if (specifier === 'external-resolved') { return { id: 'resolved-different', external: true }; } return null; } } ], output: { externalImportAssertions: false } } }); rollup-3.29.4/test/form/samples/import-assertions/removes-dynamic-assertions/_expected.js000066400000000000000000000002251450520414700320070ustar00rootroot00000000000000import('external'); import(globalThis.unknown); import('resolvedString'); import('resolved-id'); import('resolved-different'); import('unresolved'); rollup-3.29.4/test/form/samples/import-assertions/removes-dynamic-assertions/main.js000066400000000000000000000005741450520414700310020ustar00rootroot00000000000000import('external', { assert: { type: 'special' } }); import(globalThis.unknown, { assert: { type: 'special' } }); import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); import('external' + globalThis.unknown, { assert: { type: 'special' } }); import('external-resolved', { assert: { type: 'special' } }); import('unresolved', { assert: { type: 'special' } }); rollup-3.29.4/test/form/samples/import-assertions/removes-static-assertions/000077500000000000000000000000001450520414700273555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-assertions/removes-static-assertions/_config.js000066400000000000000000000004411450520414700313160ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps any import assertions on input', expectedWarnings: ['UNRESOLVED_IMPORT'], options: { external: id => { if (id === 'unresolved') return null; return true; }, output: { name: 'bundle', externalImportAssertions: false } } }); rollup-3.29.4/test/form/samples/import-assertions/removes-static-assertions/_expected.js000066400000000000000000000002051450520414700316500ustar00rootroot00000000000000import { a } from 'a'; import * as b from 'b'; export { c } from 'c'; export * from 'd'; import 'unresolved'; console.log(a, b, d); rollup-3.29.4/test/form/samples/import-assertions/removes-static-assertions/main.js000066400000000000000000000004001450520414700306310ustar00rootroot00000000000000import { a } from 'a' assert { type: 'a', extra: 'extra' }; import * as b from 'b' assert { type: 'b' }; export { c } from 'c' assert { type: 'c' }; export * from 'd' assert { type: 'd' }; import 'unresolved' assert { type: 'e' }; console.log(a, b, d); rollup-3.29.4/test/form/samples/import-expression/000077500000000000000000000000001450520414700222255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-expression/_config.js000066400000000000000000000003061450520414700241660ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly transforms variables in imported expressions', options: { external: 'external', output: { globals: { external: 'external' } } } }); rollup-3.29.4/test/form/samples/import-expression/_expected/000077500000000000000000000000001450520414700241655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-expression/_expected/amd.js000066400000000000000000000012621450520414700252650ustar00rootroot00000000000000define(['require', 'external'], (function (require, external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })(external.join('a', 'b')); console.log(external.join); })); rollup-3.29.4/test/form/samples/import-expression/_expected/cjs.js000066400000000000000000000001611450520414700253000ustar00rootroot00000000000000'use strict'; var external = require('external'); import(external.join('a', 'b')); console.log(external.join); rollup-3.29.4/test/form/samples/import-expression/_expected/es.js000066400000000000000000000001151450520414700251270ustar00rootroot00000000000000import { join } from 'external'; import(join('a', 'b')); console.log(join); rollup-3.29.4/test/form/samples/import-expression/_expected/iife.js000066400000000000000000000001651450520414700254410ustar00rootroot00000000000000(function (external) { 'use strict'; import(external.join('a', 'b')); console.log(external.join); })(external); rollup-3.29.4/test/form/samples/import-expression/_expected/system.js000066400000000000000000000003771450520414700260560ustar00rootroot00000000000000System.register(['external'], (function (exports, module) { 'use strict'; var join; return { setters: [function (module) { join = module.join; }], execute: (function () { module.import(join('a', 'b')); console.log(join); }) }; })); rollup-3.29.4/test/form/samples/import-expression/_expected/umd.js000066400000000000000000000006461450520414700253160ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external')) : typeof define === 'function' && define.amd ? define(['external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.external)); })(this, (function (external) { 'use strict'; import(external.join('a', 'b')); console.log(external.join); })); rollup-3.29.4/test/form/samples/import-expression/main.js000066400000000000000000000001411450520414700235030ustar00rootroot00000000000000import { join as pathJoin } from 'external'; import(pathJoin('a', 'b')); console.log(pathJoin); rollup-3.29.4/test/form/samples/import-external-namespace-and-default/000077500000000000000000000000001450520414700257645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-external-namespace-and-default/_config.js000066400000000000000000000002751450520414700277320ustar00rootroot00000000000000module.exports = defineTest({ description: 'disinguishes between external default and namespace (#637)', options: { external: ['foo'], output: { globals: { foo: 'foo' } } } }); rollup-3.29.4/test/form/samples/import-external-namespace-and-default/_expected/000077500000000000000000000000001450520414700277245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-external-namespace-and-default/_expected/amd.js000066400000000000000000000010671450520414700310270ustar00rootroot00000000000000define(['foo'], (function (foo) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); console.log( foo__namespace.bar ); console.log( foo ); })); rollup-3.29.4/test/form/samples/import-external-namespace-and-default/_expected/cjs.js000066400000000000000000000010271450520414700310410ustar00rootroot00000000000000'use strict'; var foo = require('foo'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); console.log( foo__namespace.bar ); console.log( foo ); rollup-3.29.4/test/form/samples/import-external-namespace-and-default/_expected/es.js000066400000000000000000000001631450520414700306710ustar00rootroot00000000000000import * as foo from 'foo'; import foo__default from 'foo'; console.log( foo.bar ); console.log( foo__default ); rollup-3.29.4/test/form/samples/import-external-namespace-and-default/_expected/iife.js000066400000000000000000000010541450520414700311760ustar00rootroot00000000000000(function (foo) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); console.log( foo__namespace.bar ); console.log( foo ); })(foo); rollup-3.29.4/test/form/samples/import-external-namespace-and-default/_expected/system.js000066400000000000000000000004301450520414700316030ustar00rootroot00000000000000System.register(['foo'], (function () { 'use strict'; var foo, foo__default; return { setters: [function (module) { foo = module; foo__default = module.default; }], execute: (function () { console.log( foo.bar ); console.log( foo__default ); }) }; })); rollup-3.29.4/test/form/samples/import-external-namespace-and-default/_expected/umd.js000066400000000000000000000015231450520414700310500ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('foo')) : typeof define === 'function' && define.amd ? define(['foo'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foo)); })(this, (function (foo) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); console.log( foo__namespace.bar ); console.log( foo ); })); rollup-3.29.4/test/form/samples/import-external-namespace-and-default/main.js000066400000000000000000000001011450520414700272360ustar00rootroot00000000000000import foo from 'foo'; import './other.js'; console.log( foo ); rollup-3.29.4/test/form/samples/import-external-namespace-and-default/other.js000066400000000000000000000000651450520414700274440ustar00rootroot00000000000000import * as foo from 'foo'; console.log( foo.bar ); rollup-3.29.4/test/form/samples/import-meta-resolve/000077500000000000000000000000001450520414700224315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-meta-resolve/_config.js000066400000000000000000000001171450520414700243720ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports import.meta.resolve' }); rollup-3.29.4/test/form/samples/import-meta-resolve/_expected/000077500000000000000000000000001450520414700243715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-meta-resolve/_expected/amd.js000066400000000000000000000001251450520414700254660ustar00rootroot00000000000000define(['module'], (function (module) { 'use strict'; undefined('./foo.js'); })); rollup-3.29.4/test/form/samples/import-meta-resolve/_expected/cjs.js000066400000000000000000000000461450520414700255060ustar00rootroot00000000000000'use strict'; undefined('./foo.js'); rollup-3.29.4/test/form/samples/import-meta-resolve/_expected/es.js000066400000000000000000000000411450520414700253310ustar00rootroot00000000000000import.meta.resolve('./foo.js'); rollup-3.29.4/test/form/samples/import-meta-resolve/_expected/iife.js000066400000000000000000000000761450520414700256460ustar00rootroot00000000000000(function () { 'use strict'; undefined('./foo.js'); })(); rollup-3.29.4/test/form/samples/import-meta-resolve/_expected/system.js000066400000000000000000000002311450520414700262470ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.meta.resolve('./foo.js'); }) }; })); rollup-3.29.4/test/form/samples/import-meta-resolve/_expected/umd.js000066400000000000000000000002411450520414700255110ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; undefined('./foo.js'); })); rollup-3.29.4/test/form/samples/import-meta-resolve/main.js000066400000000000000000000000411450520414700237060ustar00rootroot00000000000000import.meta.resolve('./foo.js'); rollup-3.29.4/test/form/samples/import-meta-url/000077500000000000000000000000001450520414700215545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-meta-url/_config.js000066400000000000000000000001131450520414700235110ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports import.meta.url' }); rollup-3.29.4/test/form/samples/import-meta-url/_expected/000077500000000000000000000000001450520414700235145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-meta-url/_expected/amd.js000066400000000000000000000003671450520414700246210ustar00rootroot00000000000000define(['module'], (function (module) { 'use strict'; function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log(new URL(module.uri, document.baseURI).href); })); rollup-3.29.4/test/form/samples/import-meta-url/_expected/cjs.js000066400000000000000000000006601450520414700246330ustar00rootroot00000000000000'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cjs.js', document.baseURI).href))); rollup-3.29.4/test/form/samples/import-meta-url/_expected/es.js000066400000000000000000000002271450520414700244620ustar00rootroot00000000000000function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log(import.meta.url); rollup-3.29.4/test/form/samples/import-meta-url/_expected/iife.js000066400000000000000000000005701450520414700247700ustar00rootroot00000000000000(function () { 'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log((_documentCurrentScript && _documentCurrentScript.src || new URL('iife.js', document.baseURI).href)); })(); rollup-3.29.4/test/form/samples/import-meta-url/_expected/system.js000066400000000000000000000004441450520414700254000ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log(module.meta.url); }) }; })); rollup-3.29.4/test/form/samples/import-meta-url/_expected/umd.js000066400000000000000000000012101450520414700246310ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('umd.js', document.baseURI).href))); })); rollup-3.29.4/test/form/samples/import-meta-url/index-amd.html000066400000000000000000000003361450520414700243120ustar00rootroot00000000000000 AMD rollup-3.29.4/test/form/samples/import-meta-url/index-cjs.html000066400000000000000000000002511450520414700243240ustar00rootroot00000000000000 CommonJS rollup-3.29.4/test/form/samples/import-meta-url/index-es.html000066400000000000000000000002671450520414700241630ustar00rootroot00000000000000 ES Module rollup-3.29.4/test/form/samples/import-meta-url/index-iife.html000066400000000000000000000002461450520414700244650ustar00rootroot00000000000000 IIFE rollup-3.29.4/test/form/samples/import-meta-url/index-system.html000066400000000000000000000004011450520414700250660ustar00rootroot00000000000000 SystemJS rollup-3.29.4/test/form/samples/import-meta-url/index-umd-amd.html000066400000000000000000000003441450520414700250740ustar00rootroot00000000000000 UMD (AMD) rollup-3.29.4/test/form/samples/import-meta-url/index-umd-iife.html000066400000000000000000000002531450520414700252460ustar00rootroot00000000000000 UMD (IIFE) rollup-3.29.4/test/form/samples/import-meta-url/main.js000066400000000000000000000002271450520414700230370ustar00rootroot00000000000000function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log(import.meta.url); rollup-3.29.4/test/form/samples/import-meta/000077500000000000000000000000001450520414700207545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-meta/_config.js000066400000000000000000000001321450520414700227120ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports directly accessing import.meta' }); rollup-3.29.4/test/form/samples/import-meta/_expected/000077500000000000000000000000001450520414700227145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-meta/_expected/amd.js000066400000000000000000000002021450520414700240050ustar00rootroot00000000000000define(['module'], (function (module) { 'use strict'; console.log(({ url: new URL(module.uri, document.baseURI).href })); })); rollup-3.29.4/test/form/samples/import-meta/_expected/cjs.js000066400000000000000000000005021450520414700240260ustar00rootroot00000000000000'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; console.log(({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cjs.js', document.baseURI).href)) })); rollup-3.29.4/test/form/samples/import-meta/_expected/es.js000066400000000000000000000000321450520414700236540ustar00rootroot00000000000000console.log(import.meta); rollup-3.29.4/test/form/samples/import-meta/_expected/iife.js000066400000000000000000000004031450520414700241630ustar00rootroot00000000000000(function () { 'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; console.log(({ url: (_documentCurrentScript && _documentCurrentScript.src || new URL('iife.js', document.baseURI).href) })); })(); rollup-3.29.4/test/form/samples/import-meta/_expected/system.js000066400000000000000000000002221450520414700245720ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log(module.meta); }) }; })); rollup-3.29.4/test/form/samples/import-meta/_expected/umd.js000066400000000000000000000010231450520414700240330ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; console.log(({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('umd.js', document.baseURI).href)) })); })); rollup-3.29.4/test/form/samples/import-meta/main.js000066400000000000000000000000321450520414700222310ustar00rootroot00000000000000console.log(import.meta); rollup-3.29.4/test/form/samples/import-named-exported-global-with-alias/000077500000000000000000000000001450520414700262405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-named-exported-global-with-alias/_config.js000066400000000000000000000004541450520414700302050ustar00rootroot00000000000000// Changed due to https://github.com/acornjs/acorn/issues/806 // Consider reverting this change should this become an acorn option module.exports = defineTest({ description: 'allow globals to be exported and imported', expectedWarnings: ['EMPTY_BUNDLE'], options: { output: { name: 'doc' } } }); rollup-3.29.4/test/form/samples/import-named-exported-global-with-alias/_expected.js000066400000000000000000000000011450520414700305250ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/import-named-exported-global-with-alias/browser.js000066400000000000000000000001151450520414700302560ustar00rootroot00000000000000const localDocument = window.document; export { localDocument as document }; rollup-3.29.4/test/form/samples/import-named-exported-global-with-alias/main.js000066400000000000000000000000731450520414700275220ustar00rootroot00000000000000import { document } from './browser.js'; var d = document; rollup-3.29.4/test/form/samples/import-namespace-systemjs/000077500000000000000000000000001450520414700236415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-namespace-systemjs/_config.js000066400000000000000000000002441450520414700256030ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports namespace (systemjs only)', options: { external: ['dependency'], output: { format: 'system' } } }); rollup-3.29.4/test/form/samples/import-namespace-systemjs/_expected.js000066400000000000000000000003351450520414700261400ustar00rootroot00000000000000System.register(['dependency'], (function () { 'use strict'; var dependency; return { setters: [function (module) { dependency = module; }], execute: (function () { console.log(dependency); }) }; })); rollup-3.29.4/test/form/samples/import-namespace-systemjs/main.js000066400000000000000000000001021450520414700251140ustar00rootroot00000000000000import * as dependency from 'dependency'; console.log(dependency);rollup-3.29.4/test/form/samples/import-namespace/000077500000000000000000000000001450520414700217625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-namespace/_config.js000066400000000000000000000002611450520414700237230ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports external namespaces', options: { external: ['foo', 'bar'], output: { globals: { foo: 'foo', bar: 'bar' } } } }); rollup-3.29.4/test/form/samples/import-namespace/_expected/000077500000000000000000000000001450520414700237225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-namespace/_expected/amd.js000066400000000000000000000011761450520414700250260ustar00rootroot00000000000000define(['foo', 'bar'], (function (foo, bar) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); var bar__namespace = /*#__PURE__*/_interopNamespaceDefault(bar); foo__namespace.x(); console.log(bar__namespace); })); rollup-3.29.4/test/form/samples/import-namespace/_expected/cjs.js000066400000000000000000000011531450520414700250370ustar00rootroot00000000000000'use strict'; var foo = require('foo'); var bar = require('bar'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); var bar__namespace = /*#__PURE__*/_interopNamespaceDefault(bar); foo__namespace.x(); console.log(bar__namespace); rollup-3.29.4/test/form/samples/import-namespace/_expected/es.js000066400000000000000000000001241450520414700246640ustar00rootroot00000000000000import * as foo from 'foo'; import * as bar from 'bar'; foo.x(); console.log(bar); rollup-3.29.4/test/form/samples/import-namespace/_expected/iife.js000066400000000000000000000011611450520414700251730ustar00rootroot00000000000000(function (foo, bar) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); var bar__namespace = /*#__PURE__*/_interopNamespaceDefault(bar); foo__namespace.x(); console.log(bar__namespace); })(foo, bar); rollup-3.29.4/test/form/samples/import-namespace/_expected/system.js000066400000000000000000000004031450520414700256010ustar00rootroot00000000000000System.register(['foo', 'bar'], (function () { 'use strict'; var foo, bar; return { setters: [function (module) { foo = module; }, function (module) { bar = module; }], execute: (function () { foo.x(); console.log(bar); }) }; })); rollup-3.29.4/test/form/samples/import-namespace/_expected/umd.js000066400000000000000000000016661450520414700250560ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('foo'), require('bar')) : typeof define === 'function' && define.amd ? define(['foo', 'bar'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foo, global.bar)); })(this, (function (foo, bar) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var foo__namespace = /*#__PURE__*/_interopNamespaceDefault(foo); var bar__namespace = /*#__PURE__*/_interopNamespaceDefault(bar); foo__namespace.x(); console.log(bar__namespace); })); rollup-3.29.4/test/form/samples/import-namespace/main.js000066400000000000000000000001231450520414700232400ustar00rootroot00000000000000import * as foo from 'foo'; import * as bar from 'bar'; foo.x(); console.log(bar);rollup-3.29.4/test/form/samples/import-specifier-deshadowing/000077500000000000000000000000001450520414700242715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-specifier-deshadowing/_config.js000066400000000000000000000003231450520414700262310ustar00rootroot00000000000000module.exports = defineTest({ description: 'deshadows aliased import bindings', options: { external: ['react-sticky'], output: { globals: { 'react-sticky': 'reactSticky' }, name: 'Sticky' } } }); rollup-3.29.4/test/form/samples/import-specifier-deshadowing/_expected/000077500000000000000000000000001450520414700262315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/import-specifier-deshadowing/_expected/amd.js000066400000000000000000000003101450520414700273220ustar00rootroot00000000000000define(['react-sticky'], (function (reactSticky) { 'use strict'; var Sticky = function () { function Sticky() {} Sticky.foo = reactSticky.Sticky; return Sticky; }(); return Sticky; })); rollup-3.29.4/test/form/samples/import-specifier-deshadowing/_expected/cjs.js000066400000000000000000000002771450520414700273540ustar00rootroot00000000000000'use strict'; var reactSticky = require('react-sticky'); var Sticky = function () { function Sticky() {} Sticky.foo = reactSticky.Sticky; return Sticky; }(); module.exports = Sticky; rollup-3.29.4/test/form/samples/import-specifier-deshadowing/_expected/es.js000066400000000000000000000002631450520414700271770ustar00rootroot00000000000000import { Sticky as Sticky$1 } from 'react-sticky'; var Sticky = function () { function Sticky() {} Sticky.foo = Sticky$1; return Sticky; }(); export { Sticky as default }; rollup-3.29.4/test/form/samples/import-specifier-deshadowing/_expected/iife.js000066400000000000000000000003111450520414700274760ustar00rootroot00000000000000var Sticky = (function (reactSticky) { 'use strict'; var Sticky = function () { function Sticky() {} Sticky.foo = reactSticky.Sticky; return Sticky; }(); return Sticky; })(reactSticky); rollup-3.29.4/test/form/samples/import-specifier-deshadowing/_expected/system.js000066400000000000000000000005321450520414700301130ustar00rootroot00000000000000System.register('Sticky', ['react-sticky'], (function (exports) { 'use strict'; var Sticky$1; return { setters: [function (module) { Sticky$1 = module.Sticky; }], execute: (function () { var Sticky = exports('default', function () { function Sticky() {} Sticky.foo = Sticky$1; return Sticky; }()); }) }; })); rollup-3.29.4/test/form/samples/import-specifier-deshadowing/_expected/umd.js000066400000000000000000000010261450520414700273530ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react-sticky')) : typeof define === 'function' && define.amd ? define(['react-sticky'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Sticky = factory(global.reactSticky)); })(this, (function (reactSticky) { 'use strict'; var Sticky = function () { function Sticky() {} Sticky.foo = reactSticky.Sticky; return Sticky; }(); return Sticky; })); rollup-3.29.4/test/form/samples/import-specifier-deshadowing/main.js000066400000000000000000000002701450520414700255520ustar00rootroot00000000000000import { Sticky as ReactSticky } from 'react-sticky'; var Sticky = function () { function Sticky() {} Sticky.foo = ReactSticky; return Sticky; }(); export { Sticky as default };rollup-3.29.4/test/form/samples/include-recursive-call-arguments/000077500000000000000000000000001450520414700250625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/include-recursive-call-arguments/_config.js000066400000000000000000000001211450520414700270160ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles recursive declarations' }); rollup-3.29.4/test/form/samples/include-recursive-call-arguments/_expected.js000066400000000000000000000001541450520414700273600ustar00rootroot00000000000000var isFinite = isFinite; function test(value) { return isFinite(value.length); } console.log(test('X')); rollup-3.29.4/test/form/samples/include-recursive-call-arguments/main.js000066400000000000000000000001541450520414700263440ustar00rootroot00000000000000var isFinite = isFinite; function test(value) { return isFinite(value.length); } console.log(test('X')); rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/000077500000000000000000000000001450520414700254725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/_config.js000066400000000000000000000002221450520414700274300ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes all declarations referenced by reified namespaces', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/_expected/000077500000000000000000000000001450520414700274325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/_expected/amd.js000066400000000000000000000000541450520414700305300ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/_expected/cjs.js000066400000000000000000000000171450520414700305450ustar00rootroot00000000000000'use strict'; rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/_expected/es.js000066400000000000000000000000011450520414700303660ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/_expected/iife.js000066400000000000000000000000471450520414700307050ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/_expected/system.js000066400000000000000000000001471450520414700313160ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/_expected/umd.js000066400000000000000000000002121450520414700305500ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/indirection.js000066400000000000000000000001501450520414700303330ustar00rootroot00000000000000import * as unused from './unused.js'; var indirection = { unused: unused }; export { indirection }; rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/main.js000066400000000000000000000000601450520414700267500ustar00rootroot00000000000000import { indirection } from './indirection.js'; rollup-3.29.4/test/form/samples/includes-all-namespace-declarations/unused.js000066400000000000000000000000441450520414700273310ustar00rootroot00000000000000function foo () {} export { foo }; rollup-3.29.4/test/form/samples/indent-false/000077500000000000000000000000001450520414700210675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/indent-false/_config.js000066400000000000000000000002261450520414700230310ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not indent with indent: false', options: { output: { name: 'foo', indent: false } } }); rollup-3.29.4/test/form/samples/indent-false/_expected/000077500000000000000000000000001450520414700230275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/indent-false/_expected/amd.js000066400000000000000000000001541450520414700241260ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'not indented' ); } return foo; })); rollup-3.29.4/test/form/samples/indent-false/_expected/cjs.js000066400000000000000000000001321450520414700241400ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'not indented' ); } module.exports = foo; rollup-3.29.4/test/form/samples/indent-false/_expected/es.js000066400000000000000000000001201450520414700237650ustar00rootroot00000000000000function foo () { console.log( 'not indented' ); } export { foo as default }; rollup-3.29.4/test/form/samples/indent-false/_expected/iife.js000066400000000000000000000001601450520414700242760ustar00rootroot00000000000000var foo = (function () { 'use strict'; function foo () { console.log( 'not indented' ); } return foo; })(); rollup-3.29.4/test/form/samples/indent-false/_expected/system.js000066400000000000000000000002731450520414700247130ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo () { console.log( 'not indented' ); } }) }; })); rollup-3.29.4/test/form/samples/indent-false/_expected/umd.js000066400000000000000000000006131450520414700241520ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.foo = factory()); })(this, (function () { 'use strict'; function foo () { console.log( 'not indented' ); } return foo; })); rollup-3.29.4/test/form/samples/indent-false/main.js000066400000000000000000000001031450520414700223430ustar00rootroot00000000000000export default function foo () { console.log( 'not indented' ); } rollup-3.29.4/test/form/samples/indent-spaces/000077500000000000000000000000001450520414700212535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/indent-spaces/_config.js000066400000000000000000000002211450520414700232100ustar00rootroot00000000000000module.exports = defineTest({ description: 'auto-indents with indent: true', options: { output: { name: 'foo', indent: ' ' } } }); rollup-3.29.4/test/form/samples/indent-spaces/_expected/000077500000000000000000000000001450520414700232135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/indent-spaces/_expected/amd.js000066400000000000000000000001721450520414700243120ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })); rollup-3.29.4/test/form/samples/indent-spaces/_expected/cjs.js000066400000000000000000000001401450520414700243230ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'indented with tabs' ); } module.exports = foo; rollup-3.29.4/test/form/samples/indent-spaces/_expected/es.js000066400000000000000000000001261450520414700241570ustar00rootroot00000000000000function foo () { console.log( 'indented with tabs' ); } export { foo as default }; rollup-3.29.4/test/form/samples/indent-spaces/_expected/iife.js000066400000000000000000000002001450520414700244550ustar00rootroot00000000000000var foo = (function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })(); rollup-3.29.4/test/form/samples/indent-spaces/_expected/system.js000066400000000000000000000003471450520414700251010ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo () { console.log( 'indented with tabs' ); } }) }; })); rollup-3.29.4/test/form/samples/indent-spaces/_expected/umd.js000066400000000000000000000006371450520414700243440ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.foo = factory()); })(this, (function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })); rollup-3.29.4/test/form/samples/indent-spaces/main.js000066400000000000000000000001111450520414700225260ustar00rootroot00000000000000export default function foo () { console.log( 'indented with tabs' ); } rollup-3.29.4/test/form/samples/indent-true-spaces/000077500000000000000000000000001450520414700222305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/indent-true-spaces/_config.js000066400000000000000000000002341450520414700241710ustar00rootroot00000000000000module.exports = defineTest({ description: 'auto-indents with spaces and indent: true', options: { output: { name: 'foo', indent: true } } }); rollup-3.29.4/test/form/samples/indent-true-spaces/_expected/000077500000000000000000000000001450520414700241705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/indent-true-spaces/_expected/amd.js000066400000000000000000000001751450520414700252720ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'indented with spaces' ); } return foo; })); rollup-3.29.4/test/form/samples/indent-true-spaces/_expected/cjs.js000066400000000000000000000001431450520414700253030ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'indented with spaces' ); } module.exports = foo; rollup-3.29.4/test/form/samples/indent-true-spaces/_expected/es.js000066400000000000000000000001311450520414700251300ustar00rootroot00000000000000function foo () { console.log( 'indented with spaces' ); } export { foo as default }; rollup-3.29.4/test/form/samples/indent-true-spaces/_expected/iife.js000066400000000000000000000002031450520414700254350ustar00rootroot00000000000000var foo = (function () { 'use strict'; function foo () { console.log( 'indented with spaces' ); } return foo; })(); rollup-3.29.4/test/form/samples/indent-true-spaces/_expected/system.js000066400000000000000000000003521450520414700260520ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo () { console.log( 'indented with spaces' ); } }) }; })); rollup-3.29.4/test/form/samples/indent-true-spaces/_expected/umd.js000066400000000000000000000006421450520414700253150ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.foo = factory()); })(this, (function () { 'use strict'; function foo () { console.log( 'indented with spaces' ); } return foo; })); rollup-3.29.4/test/form/samples/indent-true-spaces/main.js000066400000000000000000000001141450520414700235060ustar00rootroot00000000000000export default function foo () { console.log( 'indented with spaces' ); } rollup-3.29.4/test/form/samples/indent-true/000077500000000000000000000000001450520414700207545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/indent-true/_config.js000066400000000000000000000002211450520414700227110ustar00rootroot00000000000000module.exports = defineTest({ description: 'auto-indents with indent: true', options: { output: { name: 'foo', indent: true } } }); rollup-3.29.4/test/form/samples/indent-true/_expected/000077500000000000000000000000001450520414700227145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/indent-true/_expected/amd.js000066400000000000000000000001661450520414700240160ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })); rollup-3.29.4/test/form/samples/indent-true/_expected/cjs.js000066400000000000000000000001401450520414700240240ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'indented with tabs' ); } module.exports = foo; rollup-3.29.4/test/form/samples/indent-true/_expected/es.js000066400000000000000000000001261450520414700236600ustar00rootroot00000000000000function foo () { console.log( 'indented with tabs' ); } export { foo as default }; rollup-3.29.4/test/form/samples/indent-true/_expected/iife.js000066400000000000000000000001731450520414700241670ustar00rootroot00000000000000var foo = (function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })(); rollup-3.29.4/test/form/samples/indent-true/_expected/system.js000066400000000000000000000003241450520414700245750ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo () { console.log( 'indented with tabs' ); } }) }; })); rollup-3.29.4/test/form/samples/indent-true/_expected/umd.js000066400000000000000000000006301450520414700240360ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.foo = factory()); })(this, (function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })); rollup-3.29.4/test/form/samples/indent-true/main.js000066400000000000000000000001111450520414700222270ustar00rootroot00000000000000export default function foo () { console.log( 'indented with tabs' ); } rollup-3.29.4/test/form/samples/inline-with-reexport/000077500000000000000000000000001450520414700226135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/inline-with-reexport/_config.js000066400000000000000000000002751450520414700245610ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles inlining dynamic imports when the imported module contains reexports', options: { output: { inlineDynamicImports: true } } }); rollup-3.29.4/test/form/samples/inline-with-reexport/_expected.js000066400000000000000000000001561450520414700251130ustar00rootroot00000000000000Promise.resolve().then(function () { return a; }); var a = /*#__PURE__*/Object.freeze({ __proto__: null }); rollup-3.29.4/test/form/samples/inline-with-reexport/a.js000066400000000000000000000000341450520414700233660ustar00rootroot00000000000000export { b } from './b.js'; rollup-3.29.4/test/form/samples/inline-with-reexport/b.js000066400000000000000000000000251450520414700233670ustar00rootroot00000000000000export const b = 42; rollup-3.29.4/test/form/samples/inline-with-reexport/main.js000066400000000000000000000000221450520414700240670ustar00rootroot00000000000000import('./a.js'); rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/000077500000000000000000000000001450520414700252215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/_config.js000066400000000000000000000002331450520414700271610ustar00rootroot00000000000000module.exports = defineTest({ description: 'completely removes tree-shaken dynamic imports ', options: { output: { inlineDynamicImports: true } } }); rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/_expected/000077500000000000000000000000001450520414700271615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/_expected/amd.js000066400000000000000000000001011450520414700302500ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/_expected/cjs.js000066400000000000000000000000441450520414700302740ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/_expected/es.js000066400000000000000000000000251450520414700301230ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/_expected/iife.js000066400000000000000000000000741450520414700304340ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/_expected/system.js000066400000000000000000000001761450520414700310470ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/_expected/umd.js000066400000000000000000000002371450520414700303060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/dynamic.js000066400000000000000000000000611450520414700272000ustar00rootroot00000000000000console.log('dynamic'); export var dynamic = 42; rollup-3.29.4/test/form/samples/inlined-treeshaken-dynamic-import/main.js000066400000000000000000000001021450520414700264740ustar00rootroot00000000000000console.log('main'); const getFoo = () => import('./dynamic.js'); rollup-3.29.4/test/form/samples/internal-conflict-resolution/000077500000000000000000000000001450520414700243325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/internal-conflict-resolution/_config.js000066400000000000000000000001361450520414700262740ustar00rootroot00000000000000module.exports = defineTest({ description: 'internal name conflicts are resolved sanely' }); rollup-3.29.4/test/form/samples/internal-conflict-resolution/_expected/000077500000000000000000000000001450520414700262725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/internal-conflict-resolution/_expected/amd.js000066400000000000000000000002251450520414700273700ustar00rootroot00000000000000define((function () { 'use strict'; var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); })); rollup-3.29.4/test/form/samples/internal-conflict-resolution/_expected/cjs.js000066400000000000000000000001611450520414700274050ustar00rootroot00000000000000'use strict'; var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); rollup-3.29.4/test/form/samples/internal-conflict-resolution/_expected/es.js000066400000000000000000000001421450520414700272340ustar00rootroot00000000000000var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); rollup-3.29.4/test/form/samples/internal-conflict-resolution/_expected/iife.js000066400000000000000000000002201450520414700275360ustar00rootroot00000000000000(function () { 'use strict'; var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); })(); rollup-3.29.4/test/form/samples/internal-conflict-resolution/_expected/system.js000066400000000000000000000003401450520414700301510ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); }) }; })); rollup-3.29.4/test/form/samples/internal-conflict-resolution/_expected/umd.js000066400000000000000000000003631450520414700274170ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); })); rollup-3.29.4/test/form/samples/internal-conflict-resolution/bar.js000066400000000000000000000000421450520414700254300ustar00rootroot00000000000000var bar = 42; export default bar; rollup-3.29.4/test/form/samples/internal-conflict-resolution/foo.js000066400000000000000000000001201450520414700254440ustar00rootroot00000000000000import bar from './bar'; function foo () { return bar; } export default foo; rollup-3.29.4/test/form/samples/internal-conflict-resolution/main.js000066400000000000000000000001071450520414700256120ustar00rootroot00000000000000import foo from './foo'; function bar () { alert( foo() ); } bar(); rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/000077500000000000000000000000001450520414700247665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/_config.js000066400000000000000000000005101450520414700267240ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects the freeze option', options: { external: id => id.startsWith('external'), output: { freeze: false, /** @type any */ interop(id) { return id.split('-')[1]; }, globals(id) { return id.replace('-', ''); }, dynamicImportInCjs: false } } }); rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/_expected/000077500000000000000000000000001450520414700267265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/_expected/amd.js000066400000000000000000000035551450520414700300350ustar00rootroot00000000000000define(['require', 'external-auto', 'external-default', 'external-defaultOnly', 'external-esModule'], (function (require, fooAuto, fooDefault, fooDefaultOnly, fooEsModule) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return { __proto__: null, default: e }; } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return n; } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var fooAuto__namespace = /*#__PURE__*/_interopNamespace(fooAuto); var fooDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(fooDefault); var fooDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(fooDefaultOnly); console.log(fooAuto__namespace.default, fooAuto.barAuto, fooAuto__namespace); console.log(fooDefault, fooDefault.barDefault, fooDefault__namespace); console.log(fooDefaultOnly, fooDefaultOnly__namespace); console.log(fooEsModule.default, fooEsModule.barEsModule, fooEsModule); new Promise(function (resolve, reject) { require(['external-auto'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }).then(console.log); new Promise(function (resolve, reject) { require(['external-default'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }).then(console.log); new Promise(function (resolve, reject) { require(['external-defaultOnly'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(console.log); new Promise(function (resolve, reject) { require(['external-esModule'], resolve, reject); }).then(console.log); })); rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/_expected/cjs.js000066400000000000000000000033321450520414700300440ustar00rootroot00000000000000'use strict'; var fooAuto = require('external-auto'); var fooDefault = require('external-default'); var fooDefaultOnly = require('external-defaultOnly'); var fooEsModule = require('external-esModule'); function _interopNamespaceDefaultOnly (e) { return { __proto__: null, default: e }; } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return n; } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var fooAuto__namespace = /*#__PURE__*/_interopNamespace(fooAuto); var fooDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(fooDefault); var fooDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(fooDefaultOnly); console.log(fooAuto__namespace.default, fooAuto.barAuto, fooAuto__namespace); console.log(fooDefault, fooDefault.barDefault, fooDefault__namespace); console.log(fooDefaultOnly, fooDefaultOnly__namespace); console.log(fooEsModule.default, fooEsModule.barEsModule, fooEsModule); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('external-auto')); }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefault(require('external-default')); }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('external-defaultOnly')); }).then(console.log); Promise.resolve().then(function () { return require('external-esModule'); }).then(console.log); rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/_expected/es.js000066400000000000000000000015401450520414700276730ustar00rootroot00000000000000import * as fooAuto from 'external-auto'; import fooAuto__default, { barAuto } from 'external-auto'; import * as fooDefault from 'external-default'; import fooDefault__default, { barDefault } from 'external-default'; import * as fooDefaultOnly from 'external-defaultOnly'; import fooDefaultOnly__default from 'external-defaultOnly'; import * as fooEsModule from 'external-esModule'; import fooEsModule__default, { barEsModule } from 'external-esModule'; console.log(fooAuto__default, barAuto, fooAuto); console.log(fooDefault__default, barDefault, fooDefault); console.log(fooDefaultOnly__default, fooDefaultOnly); console.log(fooEsModule__default, barEsModule, fooEsModule); import('external-auto').then(console.log); import('external-default').then(console.log); import('external-defaultOnly').then(console.log); import('external-esModule').then(console.log); rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/_expected/iife.js000066400000000000000000000026171450520414700302060ustar00rootroot00000000000000(function (fooAuto, fooDefault, fooDefaultOnly, fooEsModule) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return { __proto__: null, default: e }; } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return n; } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var fooAuto__namespace = /*#__PURE__*/_interopNamespace(fooAuto); var fooDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(fooDefault); var fooDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(fooDefaultOnly); console.log(fooAuto__namespace.default, fooAuto.barAuto, fooAuto__namespace); console.log(fooDefault, fooDefault.barDefault, fooDefault__namespace); console.log(fooDefaultOnly, fooDefaultOnly__namespace); console.log(fooEsModule.default, fooEsModule.barEsModule, fooEsModule); import('external-auto').then(console.log); import('external-default').then(console.log); import('external-defaultOnly').then(console.log); import('external-esModule').then(console.log); })(externalauto, externaldefault, externaldefaultOnly, externalesModule); rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/_expected/system.js000066400000000000000000000024371450520414700306160ustar00rootroot00000000000000System.register(['external-auto', 'external-default', 'external-defaultOnly', 'external-esModule'], (function (exports, module) { 'use strict'; var fooAuto__default, barAuto, fooAuto, fooDefault__default, barDefault, fooDefault, fooDefaultOnly__default, fooDefaultOnly, fooEsModule__default, barEsModule, fooEsModule; return { setters: [function (module) { fooAuto__default = module.default; barAuto = module.barAuto; fooAuto = module; }, function (module) { fooDefault__default = module.default; barDefault = module.barDefault; fooDefault = module; }, function (module) { fooDefaultOnly__default = module.default; fooDefaultOnly = module; }, function (module) { fooEsModule__default = module.default; barEsModule = module.barEsModule; fooEsModule = module; }], execute: (function () { console.log(fooAuto__default, barAuto, fooAuto); console.log(fooDefault__default, barDefault, fooDefault); console.log(fooDefaultOnly__default, fooDefaultOnly); console.log(fooEsModule__default, barEsModule, fooEsModule); module.import('external-auto').then(console.log); module.import('external-default').then(console.log); module.import('external-defaultOnly').then(console.log); module.import('external-esModule').then(console.log); }) }; })); rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/_expected/umd.js000066400000000000000000000035741450520414700300620ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external-auto'), require('external-default'), require('external-defaultOnly'), require('external-esModule')) : typeof define === 'function' && define.amd ? define(['external-auto', 'external-default', 'external-defaultOnly', 'external-esModule'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.externalauto, global.externaldefault, global.externaldefaultOnly, global.externalesModule)); })(this, (function (fooAuto, fooDefault, fooDefaultOnly, fooEsModule) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return { __proto__: null, default: e }; } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return n; } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var fooAuto__namespace = /*#__PURE__*/_interopNamespace(fooAuto); var fooDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(fooDefault); var fooDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(fooDefaultOnly); console.log(fooAuto__namespace.default, fooAuto.barAuto, fooAuto__namespace); console.log(fooDefault, fooDefault.barDefault, fooDefault__namespace); console.log(fooDefaultOnly, fooDefaultOnly__namespace); console.log(fooEsModule.default, fooEsModule.barEsModule, fooEsModule); import('external-auto').then(console.log); import('external-default').then(console.log); import('external-defaultOnly').then(console.log); import('external-esModule').then(console.log); })); rollup-3.29.4/test/form/samples/interop-per-dependency-no-freeze/main.js000066400000000000000000000015001450520414700262440ustar00rootroot00000000000000import fooAuto, { barAuto } from 'external-auto'; import fooDefault, { barDefault } from 'external-default'; import fooDefaultOnly from 'external-defaultOnly'; import fooEsModule, { barEsModule } from 'external-esModule'; import * as externalAuto from 'external-auto'; import * as externalDefault from 'external-default'; import * as externalDefaultOnly from 'external-defaultOnly'; import * as externalEsModule from 'external-esModule'; console.log(fooAuto, barAuto, externalAuto); console.log(fooDefault, barDefault, externalDefault); console.log(fooDefaultOnly, externalDefaultOnly); console.log(fooEsModule, barEsModule, externalEsModule); import('external-auto').then(console.log); import('external-default').then(console.log); import('external-defaultOnly').then(console.log); import('external-esModule').then(console.log); rollup-3.29.4/test/form/samples/interop-per-dependency-no-live-binding/000077500000000000000000000000001450520414700260555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/interop-per-dependency-no-live-binding/_config.js000066400000000000000000000007661450520414700300300ustar00rootroot00000000000000const checkedIds = new Set(); module.exports = defineTest({ description: 'allows to configure the interop type per external dependency', options: { external: id => id.startsWith('external'), output: { externalLiveBindings: false, /** @type any */ interop(id) { if (checkedIds.has(id)) { throw new Error(`Interop for id ${id} has been requested twice.`); } checkedIds.add(id); return id.split('-')[1]; }, format: 'cjs', dynamicImportInCjs: false } } }); rollup-3.29.4/test/form/samples/interop-per-dependency-no-live-binding/_expected.js000066400000000000000000000032551450520414700303600ustar00rootroot00000000000000'use strict'; var fooAuto = require('external-auto'); var fooDefault = require('external-default'); var fooDefaultOnly = require('external-defaultOnly'); var fooEsModule = require('external-esModule'); function _interopDefault (e) { return e && e.__esModule ? e.default : e; } function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { for (var k in e) { n[k] = e[k]; } } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var fooAuto__default = /*#__PURE__*/_interopDefault(fooAuto); var fooAuto__namespace = /*#__PURE__*/_interopNamespace(fooAuto); var fooDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(fooDefault); var fooDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(fooDefaultOnly); console.log(fooAuto__default, fooAuto.barAuto, fooAuto__namespace); console.log(fooDefault, fooDefault.barDefault, fooDefault__namespace); console.log(fooDefaultOnly, fooDefaultOnly__namespace); console.log(fooEsModule.default, fooEsModule.barEsModule, fooEsModule); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('external-auto')); }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefault(require('external-default')); }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('external-defaultOnly')); }).then(console.log); Promise.resolve().then(function () { return require('external-esModule'); }).then(console.log); rollup-3.29.4/test/form/samples/interop-per-dependency-no-live-binding/main.js000066400000000000000000000015001450520414700273330ustar00rootroot00000000000000import fooAuto, { barAuto } from 'external-auto'; import fooDefault, { barDefault } from 'external-default'; import fooDefaultOnly from 'external-defaultOnly'; import fooEsModule, { barEsModule } from 'external-esModule'; import * as externalAuto from 'external-auto'; import * as externalDefault from 'external-default'; import * as externalDefaultOnly from 'external-defaultOnly'; import * as externalEsModule from 'external-esModule'; console.log(fooAuto, barAuto, externalAuto); console.log(fooDefault, barDefault, externalDefault); console.log(fooDefaultOnly, externalDefaultOnly); console.log(fooEsModule, barEsModule, externalEsModule); import('external-auto').then(console.log); import('external-default').then(console.log); import('external-defaultOnly').then(console.log); import('external-esModule').then(console.log); rollup-3.29.4/test/form/samples/interop-per-dependency/000077500000000000000000000000001450520414700230765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/interop-per-dependency/_config.js000066400000000000000000000006101450520414700250350ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to configure the interop type per external dependency', options: { external: id => id.startsWith('external'), output: { /** @type any*/ interop(id) { if (id === null) { return 'auto'; } return id.split('-')[1]; }, globals(id) { return id.replace('-', ''); }, dynamicImportInCjs: false } } }); rollup-3.29.4/test/form/samples/interop-per-dependency/_expected/000077500000000000000000000000001450520414700250365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/interop-per-dependency/_expected/amd.js000066400000000000000000000044251450520414700261420ustar00rootroot00000000000000define(['require', 'external-auto', 'external-default', 'external-defaultOnly', 'external-esModule'], (function (require, fooAuto, fooDefault, fooDefaultOnly, fooEsModule) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var fooAuto__namespace = /*#__PURE__*/_interopNamespace(fooAuto); var fooDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(fooDefault); var fooDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(fooDefaultOnly); console.log(fooAuto__namespace.default, fooAuto.barAuto, fooAuto__namespace); console.log(fooDefault, fooDefault.barDefault, fooDefault__namespace); console.log(fooDefaultOnly, fooDefaultOnly__namespace); console.log(fooEsModule.default, fooEsModule.barEsModule, fooEsModule); new Promise(function (resolve, reject) { require(['external-auto'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }).then(console.log); new Promise(function (resolve, reject) { require(['external-default'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }).then(console.log); new Promise(function (resolve, reject) { require(['external-defaultOnly'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(console.log); new Promise(function (resolve, reject) { require(['external-esModule'], resolve, reject); }).then(console.log); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })(globalThis.external1).then(console.log); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })(globalThis.external2).then(console.log); })); rollup-3.29.4/test/form/samples/interop-per-dependency/_expected/cjs.js000066400000000000000000000040661450520414700261610ustar00rootroot00000000000000'use strict'; var fooAuto = require('external-auto'); var fooDefault = require('external-default'); var fooDefaultOnly = require('external-defaultOnly'); var fooEsModule = require('external-esModule'); function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var fooAuto__namespace = /*#__PURE__*/_interopNamespace(fooAuto); var fooDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(fooDefault); var fooDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(fooDefaultOnly); console.log(fooAuto__namespace.default, fooAuto.barAuto, fooAuto__namespace); console.log(fooDefault, fooDefault.barDefault, fooDefault__namespace); console.log(fooDefaultOnly, fooDefaultOnly__namespace); console.log(fooEsModule.default, fooEsModule.barEsModule, fooEsModule); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('external-auto')); }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefault(require('external-default')); }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('external-defaultOnly')); }).then(console.log); Promise.resolve().then(function () { return require('external-esModule'); }).then(console.log); (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(globalThis.external1).then(console.log); (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(globalThis.external2).then(console.log); rollup-3.29.4/test/form/samples/interop-per-dependency/_expected/es.js000066400000000000000000000017001450520414700260010ustar00rootroot00000000000000import * as fooAuto from 'external-auto'; import fooAuto__default, { barAuto } from 'external-auto'; import * as fooDefault from 'external-default'; import fooDefault__default, { barDefault } from 'external-default'; import * as fooDefaultOnly from 'external-defaultOnly'; import fooDefaultOnly__default from 'external-defaultOnly'; import * as fooEsModule from 'external-esModule'; import fooEsModule__default, { barEsModule } from 'external-esModule'; console.log(fooAuto__default, barAuto, fooAuto); console.log(fooDefault__default, barDefault, fooDefault); console.log(fooDefaultOnly__default, fooDefaultOnly); console.log(fooEsModule__default, barEsModule, fooEsModule); import('external-auto').then(console.log); import('external-default').then(console.log); import('external-defaultOnly').then(console.log); import('external-esModule').then(console.log); import(globalThis.external1).then(console.log); import(globalThis.external2).then(console.log); rollup-3.29.4/test/form/samples/interop-per-dependency/_expected/iife.js000066400000000000000000000030171450520414700263110ustar00rootroot00000000000000(function (fooAuto, fooDefault, fooDefaultOnly, fooEsModule) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var fooAuto__namespace = /*#__PURE__*/_interopNamespace(fooAuto); var fooDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(fooDefault); var fooDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(fooDefaultOnly); console.log(fooAuto__namespace.default, fooAuto.barAuto, fooAuto__namespace); console.log(fooDefault, fooDefault.barDefault, fooDefault__namespace); console.log(fooDefaultOnly, fooDefaultOnly__namespace); console.log(fooEsModule.default, fooEsModule.barEsModule, fooEsModule); import('external-auto').then(console.log); import('external-default').then(console.log); import('external-defaultOnly').then(console.log); import('external-esModule').then(console.log); import(globalThis.external1).then(console.log); import(globalThis.external2).then(console.log); })(externalauto, externaldefault, externaldefaultOnly, externalesModule); rollup-3.29.4/test/form/samples/interop-per-dependency/_expected/system.js000066400000000000000000000026231450520414700267230ustar00rootroot00000000000000System.register(['external-auto', 'external-default', 'external-defaultOnly', 'external-esModule'], (function (exports, module) { 'use strict'; var fooAuto__default, barAuto, fooAuto, fooDefault__default, barDefault, fooDefault, fooDefaultOnly__default, fooDefaultOnly, fooEsModule__default, barEsModule, fooEsModule; return { setters: [function (module) { fooAuto__default = module.default; barAuto = module.barAuto; fooAuto = module; }, function (module) { fooDefault__default = module.default; barDefault = module.barDefault; fooDefault = module; }, function (module) { fooDefaultOnly__default = module.default; fooDefaultOnly = module; }, function (module) { fooEsModule__default = module.default; barEsModule = module.barEsModule; fooEsModule = module; }], execute: (function () { console.log(fooAuto__default, barAuto, fooAuto); console.log(fooDefault__default, barDefault, fooDefault); console.log(fooDefaultOnly__default, fooDefaultOnly); console.log(fooEsModule__default, barEsModule, fooEsModule); module.import('external-auto').then(console.log); module.import('external-default').then(console.log); module.import('external-defaultOnly').then(console.log); module.import('external-esModule').then(console.log); module.import(globalThis.external1).then(console.log); module.import(globalThis.external2).then(console.log); }) }; })); rollup-3.29.4/test/form/samples/interop-per-dependency/_expected/umd.js000066400000000000000000000037741450520414700261740ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external-auto'), require('external-default'), require('external-defaultOnly'), require('external-esModule')) : typeof define === 'function' && define.amd ? define(['external-auto', 'external-default', 'external-defaultOnly', 'external-esModule'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.externalauto, global.externaldefault, global.externaldefaultOnly, global.externalesModule)); })(this, (function (fooAuto, fooDefault, fooDefaultOnly, fooEsModule) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); } function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var fooAuto__namespace = /*#__PURE__*/_interopNamespace(fooAuto); var fooDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(fooDefault); var fooDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(fooDefaultOnly); console.log(fooAuto__namespace.default, fooAuto.barAuto, fooAuto__namespace); console.log(fooDefault, fooDefault.barDefault, fooDefault__namespace); console.log(fooDefaultOnly, fooDefaultOnly__namespace); console.log(fooEsModule.default, fooEsModule.barEsModule, fooEsModule); import('external-auto').then(console.log); import('external-default').then(console.log); import('external-defaultOnly').then(console.log); import('external-esModule').then(console.log); import(globalThis.external1).then(console.log); import(globalThis.external2).then(console.log); })); rollup-3.29.4/test/form/samples/interop-per-dependency/main.js000066400000000000000000000016401450520414700243610ustar00rootroot00000000000000import fooAuto, { barAuto } from 'external-auto'; import fooDefault, { barDefault } from 'external-default'; import fooDefaultOnly from 'external-defaultOnly'; import fooEsModule, { barEsModule } from 'external-esModule'; import * as externalAuto from 'external-auto'; import * as externalDefault from 'external-default'; import * as externalDefaultOnly from 'external-defaultOnly'; import * as externalEsModule from 'external-esModule'; console.log(fooAuto, barAuto, externalAuto); console.log(fooDefault, barDefault, externalDefault); console.log(fooDefaultOnly, externalDefaultOnly); console.log(fooEsModule, barEsModule, externalEsModule); import('external-auto').then(console.log); import('external-default').then(console.log); import('external-defaultOnly').then(console.log); import('external-esModule').then(console.log); import(globalThis.external1).then(console.log); import(globalThis.external2).then(console.log); rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/000077500000000000000000000000001450520414700252555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/_config.js000066400000000000000000000005301450520414700272150ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to configure the interop type per reexported external dependency', options: { external: id => id.startsWith('external'), output: { /** @type any */ interop(id) { return id.split('-')[1]; }, globals(id) { return id.replace('-', ''); }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/_expected/000077500000000000000000000000001450520414700272155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/_expected/amd.js000066400000000000000000000033331450520414700303160ustar00rootroot00000000000000define(['exports', 'external-auto', 'external-default', 'external-defaultOnly', 'external-esModule'], (function (exports, externalAuto, externalDefault, externalDefaultOnly, externalEsModule) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); Object.defineProperty(exports, 'barAuto', { enumerable: true, get: function () { return externalAuto.barAuto; } }); exports.externalAuto = externalAuto__namespace; Object.defineProperty(exports, 'fooAuto', { enumerable: true, get: function () { return externalAuto__namespace.default; } }); Object.defineProperty(exports, 'barDefault', { enumerable: true, get: function () { return externalDefault.barDefault; } }); exports.externalDefault = externalDefault__namespace; exports.fooDefault = externalDefault; exports.fooDefaultOnly = externalDefaultOnly; Object.defineProperty(exports, 'barEsModule', { enumerable: true, get: function () { return externalEsModule.barEsModule; } }); exports.externalEsModule = externalEsModule; Object.defineProperty(exports, 'fooEsModule', { enumerable: true, get: function () { return externalEsModule.default; } }); })); rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/_expected/cjs.js000066400000000000000000000032701450520414700303340ustar00rootroot00000000000000'use strict'; var externalAuto = require('external-auto'); var externalDefault = require('external-default'); var externalDefaultOnly = require('external-defaultOnly'); var externalEsModule = require('external-esModule'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); Object.defineProperty(exports, 'barAuto', { enumerable: true, get: function () { return externalAuto.barAuto; } }); exports.externalAuto = externalAuto__namespace; Object.defineProperty(exports, 'fooAuto', { enumerable: true, get: function () { return externalAuto__namespace.default; } }); Object.defineProperty(exports, 'barDefault', { enumerable: true, get: function () { return externalDefault.barDefault; } }); exports.externalDefault = externalDefault__namespace; exports.fooDefault = externalDefault; exports.fooDefaultOnly = externalDefaultOnly; Object.defineProperty(exports, 'barEsModule', { enumerable: true, get: function () { return externalEsModule.barEsModule; } }); exports.externalEsModule = externalEsModule; Object.defineProperty(exports, 'fooEsModule', { enumerable: true, get: function () { return externalEsModule.default; } }); rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/_expected/es.js000066400000000000000000000007731450520414700301710ustar00rootroot00000000000000import * as externalAuto from 'external-auto'; export { externalAuto }; export { barAuto, default as fooAuto } from 'external-auto'; import * as externalDefault from 'external-default'; export { externalDefault }; export { barDefault, default as fooDefault } from 'external-default'; export { default as fooDefaultOnly } from 'external-defaultOnly'; import * as externalEsModule from 'external-esModule'; export { externalEsModule }; export { barEsModule, default as fooEsModule } from 'external-esModule'; rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/_expected/iife.js000066400000000000000000000033361450520414700304740ustar00rootroot00000000000000var bundle = (function (exports, externalAuto, externalDefault, externalDefaultOnly, externalEsModule) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); Object.defineProperty(exports, 'barAuto', { enumerable: true, get: function () { return externalAuto.barAuto; } }); exports.externalAuto = externalAuto__namespace; Object.defineProperty(exports, 'fooAuto', { enumerable: true, get: function () { return externalAuto__namespace.default; } }); Object.defineProperty(exports, 'barDefault', { enumerable: true, get: function () { return externalDefault.barDefault; } }); exports.externalDefault = externalDefault__namespace; exports.fooDefault = externalDefault; exports.fooDefaultOnly = externalDefaultOnly; Object.defineProperty(exports, 'barEsModule', { enumerable: true, get: function () { return externalEsModule.barEsModule; } }); exports.externalEsModule = externalEsModule; Object.defineProperty(exports, 'fooEsModule', { enumerable: true, get: function () { return externalEsModule.default; } }); return exports; })({}, externalauto, externaldefault, externaldefaultOnly, externalesModule); rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/_expected/system.js000066400000000000000000000012131450520414700310740ustar00rootroot00000000000000System.register('bundle', ['external-auto', 'external-default', 'external-defaultOnly', 'external-esModule'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ barAuto: module.barAuto, externalAuto: module, fooAuto: module.default }); }, function (module) { exports({ barDefault: module.barDefault, externalDefault: module, fooDefault: module.default }); }, function (module) { exports('fooDefaultOnly', module.default); }, function (module) { exports({ barEsModule: module.barEsModule, externalEsModule: module, fooEsModule: module.default }); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/_expected/umd.js000066400000000000000000000043201450520414700303370ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external-auto'), require('external-default'), require('external-defaultOnly'), require('external-esModule')) : typeof define === 'function' && define.amd ? define(['exports', 'external-auto', 'external-default', 'external-defaultOnly', 'external-esModule'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.externalauto, global.externaldefault, global.externaldefaultOnly, global.externalesModule)); })(this, (function (exports, externalAuto, externalDefault, externalDefaultOnly, externalEsModule) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); Object.defineProperty(exports, 'barAuto', { enumerable: true, get: function () { return externalAuto.barAuto; } }); exports.externalAuto = externalAuto__namespace; Object.defineProperty(exports, 'fooAuto', { enumerable: true, get: function () { return externalAuto__namespace.default; } }); Object.defineProperty(exports, 'barDefault', { enumerable: true, get: function () { return externalDefault.barDefault; } }); exports.externalDefault = externalDefault__namespace; exports.fooDefault = externalDefault; exports.fooDefaultOnly = externalDefaultOnly; Object.defineProperty(exports, 'barEsModule', { enumerable: true, get: function () { return externalEsModule.barEsModule; } }); exports.externalEsModule = externalEsModule; Object.defineProperty(exports, 'fooEsModule', { enumerable: true, get: function () { return externalEsModule.default; } }); })); rollup-3.29.4/test/form/samples/interop-per-reexported-dependency/main.js000066400000000000000000000006511450520414700265410ustar00rootroot00000000000000export { default as fooAuto, barAuto } from 'external-auto'; export { default as fooDefault, barDefault } from 'external-default'; export { default as fooDefaultOnly } from 'external-defaultOnly'; export { default as fooEsModule, barEsModule } from 'external-esModule'; export * as externalAuto from 'external-auto'; export * as externalDefault from 'external-default'; export * as externalEsModule from 'external-esModule'; rollup-3.29.4/test/form/samples/intro-and-outro/000077500000000000000000000000001450520414700215575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/intro-and-outro/_config.js000066400000000000000000000013531450520414700235230ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds an intro/outro', options: { output: { globals: { external: 'a' }, intro: '/* this is an intro */', outro: '/* this is an outro */', name: 'foo' }, external: ['external'], plugins: [ { name: 'first', intro() { return '// intro 1'; }, outro() { return '// outro 1'; } }, { name: 'second', intro() { return '// intro 2'; }, outro() { return Promise.resolve('// outro 2'); } }, { name: 'third', intro() { return Promise.resolve('// intro 3'); }, outro() { return '// outro 3'; } }, { name: 'fourth', intro: '// intro 4', outro: '// outro 4' } ] } }); rollup-3.29.4/test/form/samples/intro-and-outro/_expected/000077500000000000000000000000001450520414700235175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/intro-and-outro/_expected/amd.js000066400000000000000000000004341450520414700246170ustar00rootroot00000000000000define(['external'], (function (a) { 'use strict'; /* this is an intro */ // intro 1 // intro 2 // intro 3 // intro 4 console.log( a ); console.log( a.b ); var main = 42; return main; /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 })); rollup-3.29.4/test/form/samples/intro-and-outro/_expected/cjs.js000066400000000000000000000004131450520414700246320ustar00rootroot00000000000000'use strict'; /* this is an intro */ // intro 1 // intro 2 // intro 3 // intro 4 var a = require('external'); console.log( a ); console.log( a.b ); var main = 42; module.exports = main; /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 rollup-3.29.4/test/form/samples/intro-and-outro/_expected/es.js000066400000000000000000000004031450520414700244610ustar00rootroot00000000000000/* this is an intro */ // intro 1 // intro 2 // intro 3 // intro 4 import a, { b } from 'external'; console.log( a ); console.log( b ); var main = 42; export { main as default }; /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 rollup-3.29.4/test/form/samples/intro-and-outro/_expected/iife.js000066400000000000000000000004241450520414700247710ustar00rootroot00000000000000var foo = (function (a) { 'use strict'; /* this is an intro */ // intro 1 // intro 2 // intro 3 // intro 4 console.log( a ); console.log( a.b ); var main = 42; return main; /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 })(a); rollup-3.29.4/test/form/samples/intro-and-outro/_expected/system.js000066400000000000000000000007261450520414700254060ustar00rootroot00000000000000System.register('foo', ['external'], (function (exports) { 'use strict'; var a, b; return { setters: [function (module) { a = module.default; b = module.b; }], execute: (function () { /* this is an intro */ // intro 1 // intro 2 // intro 3 // intro 4 console.log( a ); console.log( b ); var main = exports('default', 42); /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 }) }; })); rollup-3.29.4/test/form/samples/intro-and-outro/_expected/umd.js000066400000000000000000000011311450520414700246360ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('external')) : typeof define === 'function' && define.amd ? define(['external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.foo = factory(global.a)); })(this, (function (a) { 'use strict'; /* this is an intro */ // intro 1 // intro 2 // intro 3 // intro 4 console.log( a ); console.log( a.b ); var main = 42; return main; /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 })); rollup-3.29.4/test/form/samples/intro-and-outro/main.js000066400000000000000000000001311450520414700230340ustar00rootroot00000000000000import a, { b } from 'external' console.log( a ); console.log( b ); export default 42; rollup-3.29.4/test/form/samples/invalid-binary-expressions/000077500000000000000000000000001450520414700240065ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/invalid-binary-expressions/_config.js000066400000000000000000000002161450520414700257470ustar00rootroot00000000000000module.exports = defineTest({ description: 'Does not fail when bundling code where the `in`-operator is used with invalid right sides' }); rollup-3.29.4/test/form/samples/invalid-binary-expressions/_expected.js000066400000000000000000000011051450520414700263010ustar00rootroot00000000000000if ('x' in null) { console.log('retained'); } if ('x' in undefined) { console.log('retained'); } if ('x' in 1) { console.log('retained'); } if ('x' in true) { console.log('retained'); } if ('x' in 'y') { console.log('retained'); } if (null instanceof null) { console.log('retained'); } if (null instanceof undefined) { console.log('retained'); } if (null instanceof 1) { console.log('retained'); } if (null instanceof true) { console.log('retained'); } if (null instanceof 'y') { console.log('retained'); } if (null instanceof {}) { console.log('retained'); } rollup-3.29.4/test/form/samples/invalid-binary-expressions/main.js000066400000000000000000000011051450520414700252650ustar00rootroot00000000000000if ('x' in null) { console.log('retained'); } if ('x' in undefined) { console.log('retained'); } if ('x' in 1) { console.log('retained'); } if ('x' in true) { console.log('retained'); } if ('x' in 'y') { console.log('retained'); } if (null instanceof null) { console.log('retained'); } if (null instanceof undefined) { console.log('retained'); } if (null instanceof 1) { console.log('retained'); } if (null instanceof true) { console.log('retained'); } if (null instanceof 'y') { console.log('retained'); } if (null instanceof {}) { console.log('retained'); } rollup-3.29.4/test/form/samples/json-parse-is-not-pure/000077500000000000000000000000001450520414700227575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/json-parse-is-not-pure/_config.js000066400000000000000000000002351450520414700247210ustar00rootroot00000000000000module.exports = defineTest({ description: 'JSON.parse is not pure as it can throw on invalid json strings', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/json-parse-is-not-pure/_expected/000077500000000000000000000000001450520414700247175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/json-parse-is-not-pure/_expected/amd.js000066400000000000000000000002521450520414700260150ustar00rootroot00000000000000define((function () { 'use strict'; var main = (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; return main; })); rollup-3.29.4/test/form/samples/json-parse-is-not-pure/_expected/cjs.js000066400000000000000000000002171450520414700260340ustar00rootroot00000000000000'use strict'; var main = (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; module.exports = main; rollup-3.29.4/test/form/samples/json-parse-is-not-pure/_expected/es.js000066400000000000000000000002051450520414700256610ustar00rootroot00000000000000var main = (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; export { main as default }; rollup-3.29.4/test/form/samples/json-parse-is-not-pure/_expected/iife.js000066400000000000000000000002641450520414700261730ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; return main; })(); rollup-3.29.4/test/form/samples/json-parse-is-not-pure/_expected/system.js000066400000000000000000000004151450520414700266010ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }); }) }; })); rollup-3.29.4/test/form/samples/json-parse-is-not-pure/_expected/umd.js000066400000000000000000000007211450520414700260420ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; return main; })); rollup-3.29.4/test/form/samples/json-parse-is-not-pure/main.js000066400000000000000000000001541450520414700242410ustar00rootroot00000000000000export default (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/000077500000000000000000000000001450520414700236635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/_config.js000066400000000000000000000002401450520414700256210ustar00rootroot00000000000000module.exports = defineTest({ description: 'JSON.stringify is not pure as it can throw on circular structures', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/_expected/000077500000000000000000000000001450520414700256235ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/_expected/amd.js000066400000000000000000000002561450520414700267250ustar00rootroot00000000000000define((function () { 'use strict'; var main = (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; return main; })); rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/_expected/cjs.js000066400000000000000000000002231450520414700267350ustar00rootroot00000000000000'use strict'; var main = (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; module.exports = main; rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/_expected/es.js000066400000000000000000000002111450520414700265620ustar00rootroot00000000000000var main = (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; export { main as default }; rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/_expected/iife.js000066400000000000000000000002701450520414700270740ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; return main; })(); rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/_expected/system.js000066400000000000000000000004211450520414700275020ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }); }) }; })); rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/_expected/umd.js000066400000000000000000000007251450520414700267520ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; return main; })); rollup-3.29.4/test/form/samples/json-stringify-is-not-pure/main.js000066400000000000000000000001601450520414700251420ustar00rootroot00000000000000export default (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; rollup-3.29.4/test/form/samples/keep-property-access-side-effects/000077500000000000000000000000001450520414700251225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/keep-property-access-side-effects/_config.js000066400000000000000000000003211450520414700270600ustar00rootroot00000000000000module.exports = defineTest({ description: 'keep side-effects when accessing properties if treeshake.propertyReadSideEffects is true', options: { treeshake: { propertyReadSideEffects: true } } }); rollup-3.29.4/test/form/samples/keep-property-access-side-effects/_expected.js000066400000000000000000000011231450520414700274150ustar00rootroot00000000000000const getter = { get foo() { console.log('effect'); } }; getter.foo; const empty = {}; empty.foo.tooDeep; function accessArg(arg) { arg.tooDeep; } accessArg(null); globalThis.unknown.unknownProperty; ({ ...{ get prop() { console.log('effect'); } } }); ((async function () { return { get then() { console.log('effect'); return () => {}; } }; }))(); (async () => ({ get then() { console.log('effect'); return () => {}; } }))(); ((async function () { await { get then() { console.log('effect'); return () => {}; } }; return { then() {} }; }))(); rollup-3.29.4/test/form/samples/keep-property-access-side-effects/main.js000066400000000000000000000012651450520414700264100ustar00rootroot00000000000000const getter = { get foo() { console.log('effect'); } }; const foo1 = getter.foo; const empty = {}; const foo2 = empty.foo.tooDeep; function accessArg(arg) { const foo3 = arg.tooDeep; } accessArg(null); const foo4 = globalThis.unknown.unknownProperty; const foo5 = { ...{ get prop() { console.log('effect'); } } }; const foo6 = (async function () { return { get then() { console.log('effect'); return () => {}; } }; })(); const foo7 = (async () => ({ get then() { console.log('effect'); return () => {}; } }))(); const foo8 = (async function () { await { get then() { console.log('effect'); return () => {}; } }; return { then() {} }; })(); rollup-3.29.4/test/form/samples/keep-tree-shaking-comments-no-asi/000077500000000000000000000000001450520414700250305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/keep-tree-shaking-comments-no-asi/_config.js000066400000000000000000000002141450520414700267670ustar00rootroot00000000000000module.exports = defineTest({ description: 'always keep leading comments when tree-shaking and no automatic semicolons are inserted' }); rollup-3.29.4/test/form/samples/keep-tree-shaking-comments-no-asi/_expected.js000066400000000000000000000002461450520414700273300ustar00rootroot00000000000000console.log(/* keep me */ 'expected'); console.log(/* keep me */ 'expected' ); console.log(/* keep me */ 'expected'); console.log((/* keep me */ 'expected')); rollup-3.29.4/test/form/samples/keep-tree-shaking-comments-no-asi/main.js000066400000000000000000000003461450520414700263150ustar00rootroot00000000000000console.log(false ? 'unexpected' : /* keep me */ 'expected'); console.log(true ? /* keep me */ 'expected' : 'unexpected'); console.log(true && /* keep me */ 'expected'); console.log((true, /* keep me */ 'expected')); rollup-3.29.4/test/form/samples/known-globals/000077500000000000000000000000001450520414700212735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/known-globals/_config.js000066400000000000000000000001741450520414700232370ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not consider it a side-effect if a known global variable is accessed' }); rollup-3.29.4/test/form/samples/known-globals/_expected.js000066400000000000000000000000521450520414700235660ustar00rootroot00000000000000// retained Math[globalThis.unknown].foo; rollup-3.29.4/test/form/samples/known-globals/main.js000066400000000000000000000002541450520414700225560ustar00rootroot00000000000000// retained Math[globalThis.unknown].foo; // removed const a = setTimeout; const b = globalThis.setTimeout; const c = Math.max(1, 2); const d = globalThis.Math.max(1, 2); rollup-3.29.4/test/form/samples/labeled-break-statements/000077500000000000000000000000001450520414700233555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/labeled-break-statements/_config.js000066400000000000000000000001431450520414700253150ustar00rootroot00000000000000module.exports = defineTest({ description: 'keep break statements if their label is included' }); rollup-3.29.4/test/form/samples/labeled-break-statements/_expected.js000066400000000000000000000005521450520414700256550ustar00rootroot00000000000000const condition = Math.random() > 0.5; label1: { if ( condition ) { break label1; } console.log( 'effect' ); } label2: { while ( condition ) { if ( condition ) { break label2; } } console.log( 'effect' ); } label3: while ( condition ) { while ( condition ) { if ( condition ) { continue label3; } } console.log( 'effect' ); } rollup-3.29.4/test/form/samples/labeled-break-statements/main.js000066400000000000000000000010201450520414700246300ustar00rootroot00000000000000const condition = Math.random() > 0.5; label1: { if ( condition ) { break label1; } console.log( 'effect' ); } label1NoEffect: { if ( condition ) { break label1NoEffect; } } label2: { while ( condition ) { if ( condition ) { break label2; } } console.log( 'effect' ); } label2NoEffect: { while ( condition ) { if ( condition ) { break label2NoEffect; } } } label3: while ( condition ) { while ( condition ) { if ( condition ) { continue label3; } } console.log( 'effect' ); } rollup-3.29.4/test/form/samples/labeled-continue-statements/000077500000000000000000000000001450520414700241155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/labeled-continue-statements/_config.js000066400000000000000000000001461450520414700260600ustar00rootroot00000000000000module.exports = defineTest({ description: 'keep continue statements if their label is included' }); rollup-3.29.4/test/form/samples/labeled-continue-statements/_expected.js000066400000000000000000000003771450520414700264220ustar00rootroot00000000000000const condition = globalThis.unknown; label1: while (condition) { if (condition) { continue label1; } console.log('effect'); } label2: while (condition) { while (condition) { if (condition) { continue label2; } } console.log('effect'); } rollup-3.29.4/test/form/samples/labeled-continue-statements/main.js000066400000000000000000000005261450520414700254020ustar00rootroot00000000000000const condition = globalThis.unknown; label1: while (condition) { if (condition) { continue label1; } console.log('effect'); } label1NoEffect: while (condition) { if (condition) { continue label1NoEffect; } } label2: while (condition) { while (condition) { if (condition) { continue label2; } } console.log('effect'); } rollup-3.29.4/test/form/samples/large-var-cnt-deduping/000077500000000000000000000000001450520414700227555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/large-var-cnt-deduping/1.js000066400000000000000000000000551450520414700234530ustar00rootroot00000000000000var x = "a"; export var result = `1 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/10.js000066400000000000000000000000561450520414700235340ustar00rootroot00000000000000var x = "j"; export var result = `10 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/11.js000066400000000000000000000000561450520414700235350ustar00rootroot00000000000000var x = "k"; export var result = `11 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/12.js000066400000000000000000000000561450520414700235360ustar00rootroot00000000000000var x = "l"; export var result = `12 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/13.js000066400000000000000000000000561450520414700235370ustar00rootroot00000000000000var x = "m"; export var result = `13 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/14.js000066400000000000000000000000561450520414700235400ustar00rootroot00000000000000var x = "n"; export var result = `14 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/15.js000066400000000000000000000000561450520414700235410ustar00rootroot00000000000000var x = "o"; export var result = `15 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/16.js000066400000000000000000000000561450520414700235420ustar00rootroot00000000000000var x = "p"; export var result = `16 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/17.js000066400000000000000000000000561450520414700235430ustar00rootroot00000000000000var x = "q"; export var result = `17 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/18.js000066400000000000000000000000561450520414700235440ustar00rootroot00000000000000var x = "r"; export var result = `18 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/19.js000066400000000000000000000000561450520414700235450ustar00rootroot00000000000000var x = "s"; export var result = `19 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/2.js000066400000000000000000000000551450520414700234540ustar00rootroot00000000000000var x = "b"; export var result = `2 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/20.js000066400000000000000000000000561450520414700235350ustar00rootroot00000000000000var x = "t"; export var result = `20 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/21.js000066400000000000000000000000561450520414700235360ustar00rootroot00000000000000var x = "u"; export var result = `21 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/22.js000066400000000000000000000000561450520414700235370ustar00rootroot00000000000000var x = "v"; export var result = `22 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/23.js000066400000000000000000000000561450520414700235400ustar00rootroot00000000000000var x = "w"; export var result = `23 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/24.js000066400000000000000000000000561450520414700235410ustar00rootroot00000000000000var x = "x"; export var result = `24 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/25.js000066400000000000000000000000561450520414700235420ustar00rootroot00000000000000var x = "y"; export var result = `25 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/26.js000066400000000000000000000000561450520414700235430ustar00rootroot00000000000000var x = "z"; export var result = `26 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/27.js000066400000000000000000000000561450520414700235440ustar00rootroot00000000000000var x = "A"; export var result = `27 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/28.js000066400000000000000000000000561450520414700235450ustar00rootroot00000000000000var x = "B"; export var result = `28 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/29.js000066400000000000000000000000561450520414700235460ustar00rootroot00000000000000var x = "C"; export var result = `29 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/3.js000066400000000000000000000000551450520414700234550ustar00rootroot00000000000000var x = "c"; export var result = `3 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/30.js000066400000000000000000000000561450520414700235360ustar00rootroot00000000000000var x = "D"; export var result = `30 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/31.js000066400000000000000000000000561450520414700235370ustar00rootroot00000000000000var x = "E"; export var result = `31 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/32.js000066400000000000000000000000561450520414700235400ustar00rootroot00000000000000var x = "F"; export var result = `32 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/33.js000066400000000000000000000000561450520414700235410ustar00rootroot00000000000000var x = "G"; export var result = `33 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/34.js000066400000000000000000000000561450520414700235420ustar00rootroot00000000000000var x = "H"; export var result = `34 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/35.js000066400000000000000000000000561450520414700235430ustar00rootroot00000000000000var x = "I"; export var result = `35 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/36.js000066400000000000000000000000561450520414700235440ustar00rootroot00000000000000var x = "J"; export var result = `36 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/37.js000066400000000000000000000000561450520414700235450ustar00rootroot00000000000000var x = "K"; export var result = `37 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/38.js000066400000000000000000000000561450520414700235460ustar00rootroot00000000000000var x = "L"; export var result = `38 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/39.js000066400000000000000000000000561450520414700235470ustar00rootroot00000000000000var x = "M"; export var result = `39 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/4.js000066400000000000000000000000551450520414700234560ustar00rootroot00000000000000var x = "d"; export var result = `4 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/40.js000066400000000000000000000000561450520414700235370ustar00rootroot00000000000000var x = "N"; export var result = `40 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/41.js000066400000000000000000000000561450520414700235400ustar00rootroot00000000000000var x = "O"; export var result = `41 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/42.js000066400000000000000000000000561450520414700235410ustar00rootroot00000000000000var x = "P"; export var result = `42 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/43.js000066400000000000000000000000561450520414700235420ustar00rootroot00000000000000var x = "Q"; export var result = `43 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/44.js000066400000000000000000000000561450520414700235430ustar00rootroot00000000000000var x = "R"; export var result = `44 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/45.js000066400000000000000000000000561450520414700235440ustar00rootroot00000000000000var x = "S"; export var result = `45 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/46.js000066400000000000000000000000561450520414700235450ustar00rootroot00000000000000var x = "T"; export var result = `46 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/47.js000066400000000000000000000000561450520414700235460ustar00rootroot00000000000000var x = "U"; export var result = `47 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/48.js000066400000000000000000000000561450520414700235470ustar00rootroot00000000000000var x = "V"; export var result = `48 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/49.js000066400000000000000000000000561450520414700235500ustar00rootroot00000000000000var x = "W"; export var result = `49 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/5.js000066400000000000000000000000551450520414700234570ustar00rootroot00000000000000var x = "e"; export var result = `5 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/50.js000066400000000000000000000000561450520414700235400ustar00rootroot00000000000000var x = "X"; export var result = `50 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/51.js000066400000000000000000000000561450520414700235410ustar00rootroot00000000000000var x = "Y"; export var result = `51 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/52.js000066400000000000000000000000561450520414700235420ustar00rootroot00000000000000var x = "Z"; export var result = `52 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/53.js000066400000000000000000000000561450520414700235430ustar00rootroot00000000000000var x = "1"; export var result = `53 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/54.js000066400000000000000000000000561450520414700235440ustar00rootroot00000000000000var x = "2"; export var result = `54 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/55.js000066400000000000000000000000561450520414700235450ustar00rootroot00000000000000var x = "3"; export var result = `55 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/56.js000066400000000000000000000000561450520414700235460ustar00rootroot00000000000000var x = "4"; export var result = `56 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/57.js000066400000000000000000000000561450520414700235470ustar00rootroot00000000000000var x = "5"; export var result = `57 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/58.js000066400000000000000000000000561450520414700235500ustar00rootroot00000000000000var x = "6"; export var result = `58 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/59.js000066400000000000000000000000561450520414700235510ustar00rootroot00000000000000var x = "7"; export var result = `59 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/6.js000066400000000000000000000000551450520414700234600ustar00rootroot00000000000000var x = "f"; export var result = `6 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/60.js000066400000000000000000000000561450520414700235410ustar00rootroot00000000000000var x = "8"; export var result = `60 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/61.js000066400000000000000000000000561450520414700235420ustar00rootroot00000000000000var x = "9"; export var result = `61 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/62.js000066400000000000000000000000561450520414700235430ustar00rootroot00000000000000var x = "0"; export var result = `62 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/63.js000066400000000000000000000000561450520414700235440ustar00rootroot00000000000000var x = "_"; export var result = `63 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/64.js000066400000000000000000000000571450520414700235460ustar00rootroot00000000000000var x = "$"; export var result = `64 = ${x}`; rollup-3.29.4/test/form/samples/large-var-cnt-deduping/65.js000066400000000000000000000000571450520414700235470ustar00rootroot00000000000000var x = "0"; export var result = `65 = ${x}`; rollup-3.29.4/test/form/samples/large-var-cnt-deduping/7.js000066400000000000000000000000551450520414700234610ustar00rootroot00000000000000var x = "g"; export var result = `7 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/8.js000066400000000000000000000000551450520414700234620ustar00rootroot00000000000000var x = "h"; export var result = `8 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/9.js000066400000000000000000000000551450520414700234630ustar00rootroot00000000000000var x = "i"; export var result = `9 = ${x}`;rollup-3.29.4/test/form/samples/large-var-cnt-deduping/_config.js000066400000000000000000000001201450520414700247100ustar00rootroot00000000000000module.exports = defineTest({ description: 'large variable count deduping' }); rollup-3.29.4/test/form/samples/large-var-cnt-deduping/_expected.js000066400000000000000000000072241450520414700252600ustar00rootroot00000000000000var x$10 = "a"; var result$10 = `1 = ${x$10}`; var x$$ = "b"; var result$$ = `2 = ${x$$}`; var x$_ = "c"; var result$_ = `3 = ${x$_}`; var x$Z = "d"; var result$Z = `4 = ${x$Z}`; var x$Y = "e"; var result$Y = `5 = ${x$Y}`; var x$X = "f"; var result$X = `6 = ${x$X}`; var x$W = "g"; var result$W = `7 = ${x$W}`; var x$V = "h"; var result$V = `8 = ${x$V}`; var x$U = "i"; var result$U = `9 = ${x$U}`; var x$T = "j"; var result$T = `10 = ${x$T}`; var x$S = "k"; var result$S = `11 = ${x$S}`; var x$R = "l"; var result$R = `12 = ${x$R}`; var x$Q = "m"; var result$Q = `13 = ${x$Q}`; var x$P = "n"; var result$P = `14 = ${x$P}`; var x$O = "o"; var result$O = `15 = ${x$O}`; var x$N = "p"; var result$N = `16 = ${x$N}`; var x$M = "q"; var result$M = `17 = ${x$M}`; var x$L = "r"; var result$L = `18 = ${x$L}`; var x$K = "s"; var result$K = `19 = ${x$K}`; var x$J = "t"; var result$J = `20 = ${x$J}`; var x$I = "u"; var result$I = `21 = ${x$I}`; var x$H = "v"; var result$H = `22 = ${x$H}`; var x$G = "w"; var result$G = `23 = ${x$G}`; var x$F = "x"; var result$F = `24 = ${x$F}`; var x$E = "y"; var result$E = `25 = ${x$E}`; var x$D = "z"; var result$D = `26 = ${x$D}`; var x$C = "A"; var result$C = `27 = ${x$C}`; var x$B = "B"; var result$B = `28 = ${x$B}`; var x$A = "C"; var result$A = `29 = ${x$A}`; var x$z = "D"; var result$z = `30 = ${x$z}`; var x$y = "E"; var result$y = `31 = ${x$y}`; var x$x = "F"; var result$x = `32 = ${x$x}`; var x$w = "G"; var result$w = `33 = ${x$w}`; var x$v = "H"; var result$v = `34 = ${x$v}`; var x$u = "I"; var result$u = `35 = ${x$u}`; var x$t = "J"; var result$t = `36 = ${x$t}`; var x$s = "K"; var result$s = `37 = ${x$s}`; var x$r = "L"; var result$r = `38 = ${x$r}`; var x$q = "M"; var result$q = `39 = ${x$q}`; var x$p = "N"; var result$p = `40 = ${x$p}`; var x$o = "O"; var result$o = `41 = ${x$o}`; var x$n = "P"; var result$n = `42 = ${x$n}`; var x$m = "Q"; var result$m = `43 = ${x$m}`; var x$l = "R"; var result$l = `44 = ${x$l}`; var x$k = "S"; var result$k = `45 = ${x$k}`; var x$j = "T"; var result$j = `46 = ${x$j}`; var x$i = "U"; var result$i = `47 = ${x$i}`; var x$h = "V"; var result$h = `48 = ${x$h}`; var x$g = "W"; var result$g = `49 = ${x$g}`; var x$f = "X"; var result$f = `50 = ${x$f}`; var x$e = "Y"; var result$e = `51 = ${x$e}`; var x$d = "Z"; var result$d = `52 = ${x$d}`; var x$c = "1"; var result$c = `53 = ${x$c}`; var x$b = "2"; var result$b = `54 = ${x$b}`; var x$a = "3"; var result$a = `55 = ${x$a}`; var x$9 = "4"; var result$9 = `56 = ${x$9}`; var x$8 = "5"; var result$8 = `57 = ${x$8}`; var x$7 = "6"; var result$7 = `58 = ${x$7}`; var x$6 = "7"; var result$6 = `59 = ${x$6}`; var x$5 = "8"; var result$5 = `60 = ${x$5}`; var x$4 = "9"; var result$4 = `61 = ${x$4}`; var x$3 = "0"; var result$3 = `62 = ${x$3}`; var x$2 = "_"; var result$2 = `63 = ${x$2}`; var x$1 = "$"; var result$1 = `64 = ${x$1}`; var x = "0"; var result = `65 = ${x}`; var results = [result$10, result$$, result$_, result$Z, result$Y, result$X, result$W, result$V, result$U, result$T, result$S, result$R, result$Q, result$P, result$O, result$N, result$M, result$L, result$K, result$J, result$I, result$H, result$G, result$F, result$E, result$D, result$C, result$B, result$A, result$z, result$y, result$x, result$w, result$v, result$u, result$t, result$s, result$r, result$q, result$p, result$o, result$n, result$m, result$l, result$k, result$j, result$i, result$h, result$g, result$f, result$e, result$d, result$c, result$b, result$a, result$9, result$8, result$7, result$6, result$5, result$4, result$3, result$2, result$1, result ]; console.log(results); rollup-3.29.4/test/form/samples/large-var-cnt-deduping/main.js000066400000000000000000000071061450520414700242430ustar00rootroot00000000000000import { result as result1 } from './1.js'; import { result as result2 } from './2.js'; import { result as result3 } from './3.js'; import { result as result4 } from './4.js'; import { result as result5 } from './5.js'; import { result as result6 } from './6.js'; import { result as result7 } from './7.js'; import { result as result8 } from './8.js'; import { result as result9 } from './9.js'; import { result as result10 } from './10.js'; import { result as result11 } from './11.js'; import { result as result12 } from './12.js'; import { result as result13 } from './13.js'; import { result as result14 } from './14.js'; import { result as result15 } from './15.js'; import { result as result16 } from './16.js'; import { result as result17 } from './17.js'; import { result as result18 } from './18.js'; import { result as result19 } from './19.js'; import { result as result20 } from './20.js'; import { result as result21 } from './21.js'; import { result as result22 } from './22.js'; import { result as result23 } from './23.js'; import { result as result24 } from './24.js'; import { result as result25 } from './25.js'; import { result as result26 } from './26.js'; import { result as result27 } from './27.js'; import { result as result28 } from './28.js'; import { result as result29 } from './29.js'; import { result as result30 } from './30.js'; import { result as result31 } from './31.js'; import { result as result32 } from './32.js'; import { result as result33 } from './33.js'; import { result as result34 } from './34.js'; import { result as result35 } from './35.js'; import { result as result36 } from './36.js'; import { result as result37 } from './37.js'; import { result as result38 } from './38.js'; import { result as result39 } from './39.js'; import { result as result40 } from './40.js'; import { result as result41 } from './41.js'; import { result as result42 } from './42.js'; import { result as result43 } from './43.js'; import { result as result44 } from './44.js'; import { result as result45 } from './45.js'; import { result as result46 } from './46.js'; import { result as result47 } from './47.js'; import { result as result48 } from './48.js'; import { result as result49 } from './49.js'; import { result as result50 } from './50.js'; import { result as result51 } from './51.js'; import { result as result52 } from './52.js'; import { result as result53 } from './53.js'; import { result as result54 } from './54.js'; import { result as result55 } from './55.js'; import { result as result56 } from './56.js'; import { result as result57 } from './57.js'; import { result as result58 } from './58.js'; import { result as result59 } from './59.js'; import { result as result60 } from './60.js'; import { result as result61 } from './61.js'; import { result as result62 } from './62.js'; import { result as result63 } from './63.js'; import { result as result64 } from './64.js'; import { result as result65 } from './65.js'; var results = [result1, result2, result3, result4, result5, result6, result7, result8, result9, result10, result11, result12, result13, result14, result15, result16, result17, result18, result19, result20, result21, result22, result23, result24, result25, result26, result27, result28, result29, result30, result31, result32, result33, result34, result35, result36, result37, result38, result39, result40, result41, result42, result43, result44, result45, result46, result47, result48, result49, result50, result51, result52, result53, result54, result55, result56, result57, result58, result59, result60, result61, result62, result63, result64, result65 ]; console.log(results); rollup-3.29.4/test/form/samples/lazy-assignment-deoptimization/000077500000000000000000000000001450520414700247005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/lazy-assignment-deoptimization/_config.js000066400000000000000000000001661450520414700266450ustar00rootroot00000000000000module.exports = defineTest({ description: 'only deoptimizes assigned variables when the assignment is included' }); rollup-3.29.4/test/form/samples/lazy-assignment-deoptimization/_expected.js000066400000000000000000000000631450520414700271750ustar00rootroot00000000000000console.log('retained'); console.log('retained'); rollup-3.29.4/test/form/samples/lazy-assignment-deoptimization/main.js000066400000000000000000000004301450520414700261570ustar00rootroot00000000000000const foo = { toggled: false }; const bar = { toggled: false }; if (foo.toggled) { foo.toggled = bar; } if (foo.toggled) console.log('this should be removed'); else console.log('retained'); if (bar.toggled) console.log('this should be removed'); else console.log('retained'); rollup-3.29.4/test/form/samples/leading-comments/000077500000000000000000000000001450520414700217445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/leading-comments/_config.js000066400000000000000000000002071450520414700237050ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps leading comments on consecutive lines', options: { external: ['external'] } }); rollup-3.29.4/test/form/samples/leading-comments/_expected.js000066400000000000000000000002571450520414700242460ustar00rootroot00000000000000import 'external'; // comment dep 1/3 /* comment */ // comment dep 2/3 // comment dep 3/3 console.log('dep'); // comment main 1/2 // comment main 2/2 console.log('main'); rollup-3.29.4/test/form/samples/leading-comments/dep.js000066400000000000000000000002041450520414700230460ustar00rootroot00000000000000// comment dep 1/3 /* comment */ // comment dep 2/3 // comment dep 3/3 /* import comment */ import 'external'; console.log('dep'); rollup-3.29.4/test/form/samples/leading-comments/main.js000066400000000000000000000001461450520414700232270ustar00rootroot00000000000000#! /usr/bin/env node // comment main 1/2 // comment main 2/2 import './dep.js'; console.log('main'); rollup-3.29.4/test/form/samples/literals-from-class-statics/000077500000000000000000000000001450520414700240515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/literals-from-class-statics/_config.js000066400000000000000000000001371450520414700260140ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks literal values in class static fields' }); rollup-3.29.4/test/form/samples/literals-from-class-statics/_expected.js000066400000000000000000000002261450520414700263470ustar00rootroot00000000000000log("t"); log("x"); class Undef { static 'y'; } if (Undef.y) log("y"); class Deopt { static z = false; } unknown(Deopt); if (Deopt.z) log("z"); rollup-3.29.4/test/form/samples/literals-from-class-statics/main.js000066400000000000000000000005121450520414700253310ustar00rootroot00000000000000class Static { static t() { return true; } static f() { return false; } static x = 10; } if (Static.t()) log("t"); if (Static.f()) log("f"); if (!Static.t()) log("!t"); if (Static.x) log("x"); class Undef { static 'y'; } if (Undef.y) log("y"); class Deopt { static z = false; } unknown(Deopt); if (Deopt.z) log("z"); rollup-3.29.4/test/form/samples/literals-from-return-expressions/000077500000000000000000000000001450520414700251735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/literals-from-return-expressions/_config.js000066400000000000000000000001421450520414700271320ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks literal values across return expressions' }); rollup-3.29.4/test/form/samples/literals-from-return-expressions/_expected.js000066400000000000000000000004211450520414700274660ustar00rootroot00000000000000function returnTrueWithEffect() { console.log('effect'); return true; } function returnFalseWithEffect() { console.log('effect'); return false; } { console.log('retained'); } if (returnTrueWithEffect()) { console.log('retained'); } if (returnFalseWithEffect()) ; rollup-3.29.4/test/form/samples/literals-from-return-expressions/main.js000066400000000000000000000007411450520414700264570ustar00rootroot00000000000000const foo = true, bar = false; function returnTrue() { return foo; } function returnFalse() { return bar; } function returnTrueWithEffect() { console.log('effect'); return true; } function returnFalseWithEffect() { console.log('effect'); return false; } if (returnTrue()) { console.log('retained'); } if (returnFalse()) { console.log('removed'); } if (returnTrueWithEffect()) { console.log('retained'); } if (returnFalseWithEffect()) { console.log('removed'); } rollup-3.29.4/test/form/samples/log-side-effects/000077500000000000000000000000001450520414700216365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/log-side-effects/_config.js000066400000000000000000000027331450520414700236050ustar00rootroot00000000000000const path = require('node:path'); const MagicString = require('magic-string'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_MAPPED = path.join(__dirname, 'dep-mapped.js'); module.exports = defineTest({ description: 'logs side effects', options: { experimentalLogSideEffects: true, plugins: [ { name: 'insert-lines', transform(code, id) { if (id.endsWith('mapped.js')) { const magicString = new MagicString(code); magicString.prepend('const removed = true;\nconst alsoRemoved = true; '); return { code: magicString.toString(), map: magicString.generateMap({ hires: true }) }; } } } ] }, logs: [ { level: 'info', code: 'FIRST_SIDE_EFFECT', message: `First side effect in dep-mapped.js is at (2:26) 1: const removed = true; 2: const alsoRemoved = true; console.log('mapped effect'); ^`, id: ID_MAPPED, pos: 48, loc: { column: 0, file: ID_MAPPED, line: 1 }, frame: ` 1: console.log('mapped effect'); ^` }, { level: 'info', code: 'FIRST_SIDE_EFFECT', message: `First side effect in main.js is at (2:0) 1: import './dep-mapped'; 2: console.log('main effect'); ^ 3: console.log('other effect');`, id: ID_MAIN, pos: 23, loc: { column: 0, file: ID_MAIN, line: 2 }, frame: ` 1: import './dep-mapped'; 2: console.log('main effect'); ^ 3: console.log('other effect');` } ] }); rollup-3.29.4/test/form/samples/log-side-effects/_expected.js000066400000000000000000000001301450520414700241260ustar00rootroot00000000000000console.log('mapped effect'); console.log('main effect'); console.log('other effect'); rollup-3.29.4/test/form/samples/log-side-effects/dep-mapped.js000066400000000000000000000000361450520414700242070ustar00rootroot00000000000000console.log('mapped effect'); rollup-3.29.4/test/form/samples/log-side-effects/main.js000066400000000000000000000001201450520414700231110ustar00rootroot00000000000000import './dep-mapped'; console.log('main effect'); console.log('other effect'); rollup-3.29.4/test/form/samples/logical-expression/000077500000000000000000000000001450520414700223255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/logical-expression/deopzimize-while-included/000077500000000000000000000000001450520414700273775ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/logical-expression/deopzimize-while-included/_config.js000066400000000000000000000002001450520414700313310ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles deoptimizations of logical expression while they are inlcuded (#3324)' }); rollup-3.29.4/test/form/samples/logical-expression/deopzimize-while-included/_expected.js000066400000000000000000000004521450520414700316760ustar00rootroot00000000000000let isFirstReassigned = false; const result1 = (foo(), isFirstReassigned ); console.log(result1); let isSecondReassigned = false; (foo(), reassign2() || foo()); console.log(result1); function reassign2() { // this needs to be included isSecondReassigned = true; return isSecondReassigned; } rollup-3.29.4/test/form/samples/logical-expression/deopzimize-while-included/main.js000066400000000000000000000006401450520414700306610ustar00rootroot00000000000000let isFirstReassigned = false; const result1 = (foo(), isFirstReassigned && reassign1()); console.log(result1); function reassign1() { // this should never be triggered isFirstReassigned = true; } let isSecondReassigned = false; const result2 = (foo(), reassign2() || foo()); console.log(result1); function reassign2() { // this needs to be included isSecondReassigned = true; return isSecondReassigned; } rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/000077500000000000000000000000001450520414700274315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/_config.js000066400000000000000000000002301450520414700313660ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly handle the results of mutating logical expressions', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/_expected/000077500000000000000000000000001450520414700313715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/_expected/amd.js000066400000000000000000000005071450520414700324720ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var aExp = {}; var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; var logicalBExp = bExp; logicalBExp.bar = 1; var cExp = {}; var logicalCExp = cExp; logicalCExp.bar = 1; exports.aExp = aExp; exports.bExp = bExp; exports.cExp = cExp; })); rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/_expected/cjs.js000066400000000000000000000004131450520414700325040ustar00rootroot00000000000000'use strict'; var aExp = {}; var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; var logicalBExp = bExp; logicalBExp.bar = 1; var cExp = {}; var logicalCExp = cExp; logicalCExp.bar = 1; exports.aExp = aExp; exports.bExp = bExp; exports.cExp = cExp; rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/_expected/es.js000066400000000000000000000003321450520414700323340ustar00rootroot00000000000000var aExp = {}; var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; var logicalBExp = bExp; logicalBExp.bar = 1; var cExp = {}; var logicalCExp = cExp; logicalCExp.bar = 1; export { aExp, bExp, cExp }; rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/_expected/iife.js000066400000000000000000000005261450520414700326460ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; var aExp = {}; var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; var logicalBExp = bExp; logicalBExp.bar = 1; var cExp = {}; var logicalCExp = cExp; logicalCExp.bar = 1; exports.aExp = aExp; exports.bExp = bExp; exports.cExp = cExp; return exports; })({}); rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/_expected/system.js000066400000000000000000000006011450520414700332500ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var aExp = exports('aExp', {}); var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = exports('bExp', {}); var logicalBExp = bExp; logicalBExp.bar = 1; var cExp = exports('cExp', {}); var logicalCExp = cExp; logicalCExp.bar = 1; }) }; })); rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/_expected/umd.js000066400000000000000000000011441450520414700325140ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; var aExp = {}; var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; var logicalBExp = bExp; logicalBExp.bar = 1; var cExp = {}; var logicalCExp = cExp; logicalCExp.bar = 1; exports.aExp = aExp; exports.bExp = bExp; exports.cExp = cExp; })); rollup-3.29.4/test/form/samples/logical-expression/mutate-logical-expression/main.js000066400000000000000000000006441450520414700307170ustar00rootroot00000000000000var a = {}; var logicalA = a || {}; logicalA.bar = 1; var aExp = {}; var logicalAExp = aExp || {}; logicalAExp.bar = 1; export {aExp} var b = {}; var logicalB = false || b; logicalB.bar = 1; var bExp = {}; var logicalBExp = false || bExp; logicalBExp.bar = 1; export {bExp} var c = {}; var logicalC = true && c; logicalC.bar = 1; var cExp = {}; var logicalCExp = true && cExp; logicalCExp.bar = 1; export {cExp} rollup-3.29.4/test/form/samples/logical-expression/simplify-non-boolean/000077500000000000000000000000001450520414700263665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/logical-expression/simplify-non-boolean/_config.js000066400000000000000000000001771450520414700303350ustar00rootroot00000000000000module.exports = defineTest({ description: 'simplifies logical expressions that resolve statically to non-boolean values' }); rollup-3.29.4/test/form/samples/logical-expression/simplify-non-boolean/_expected.js000066400000000000000000000001371450520414700306650ustar00rootroot00000000000000console.log('keep' ); console.log('keep'); const x = 'keep'; console.log(x ); console.log(x); rollup-3.29.4/test/form/samples/logical-expression/simplify-non-boolean/main.js000066400000000000000000000002231450520414700276450ustar00rootroot00000000000000console.log('keep' || 'remove'); console.log('remove' && 'keep'); const x = 'keep'; const y = 'remove'; console.log(x || y); console.log(y && x); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/000077500000000000000000000000001450520414700250635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-false/000077500000000000000000000000001450520414700307015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js000066400000000000000000000032241450520414700326440ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'does not normalize external paths when set to false', options: { makeAbsoluteExternalsRelative: false, external(id) { if ( [ './relativeUnresolved.js', '../relativeUnresolved.js', '/absolute.js', '/pluginAbsolute.js' ].includes(id) ) return true; }, plugins: { name: 'test', async buildStart() { // eslint-disable-next-line unicorn/consistent-function-scoping const testExternal = async (source, expected) => assert.deepStrictEqual((await this.resolve(source, ID_MAIN)).external, expected, source); await testExternal('./relativeUnresolved.js', true); await testExternal('/absolute.js', 'absolute'); await testExternal('./pluginDirect.js', true); await testExternal('/pluginDifferentAbsolute.js', 'absolute'); await testExternal('./pluginTrue.js', 'absolute'); await testExternal('./pluginForceAbsolute.js', 'absolute'); await testExternal('./pluginForceRelative.js', true); }, resolveId(source) { if (source.endsWith('/pluginDirect.js')) return false; if (source.endsWith('/pluginDifferentAbsolute.js')) return '/pluginAbsolute.js'; if (source.endsWith('/pluginTrue.js')) return { id: '/pluginTrue.js', external: true }; if (source.endsWith('/pluginForceAbsolute.js')) return { id: '/pluginForceAbsolute.js', external: 'absolute' }; if (source.endsWith('/pluginForceRelative.js')) return { id: path.join(__dirname, 'pluginForceRelative.js'), external: 'relative' }; } } } }); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-false/_expected.js000066400000000000000000000016451450520414700332050ustar00rootroot00000000000000import { relativeUnresolved as relativeUnresolved$1 } from './relativeUnresolved.js'; import { absolute } from '/absolute.js'; import { pluginDirect as pluginDirect$1 } from './pluginDirect.js'; import { pluginDifferentAbsolute } from '/pluginAbsolute.js'; import { pluginTrue } from '/pluginTrue.js'; import { pluginForceAbsolute } from '/pluginForceAbsolute.js'; import { pluginForceRelative } from './pluginForceRelative.js'; import { relativeUnresolved } from '../relativeUnresolved.js'; import { pluginDirect } from '../pluginDirect.js'; console.log( 'nested', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); console.log( 'main', relativeUnresolved$1, relativeMissing, relativeExisting, absolute, pluginDirect$1, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-false/main.js000066400000000000000000000011531450520414700321630ustar00rootroot00000000000000import { relativeUnresolved } from './relativeUnresolved.js'; import { absolute } from '/absolute.js'; import { pluginDirect } from './pluginDirect.js'; import { pluginDifferentAbsolute } from '/pluginDifferentAbsolute.js'; import { pluginTrue } from './pluginTrue.js'; import { pluginForceAbsolute } from './pluginForceAbsolute.js'; import { pluginForceRelative } from './pluginForceRelative.js'; import './nested/nested.js'; console.log( 'main', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-false/nested/000077500000000000000000000000001450520414700321635ustar00rootroot00000000000000nested.js000066400000000000000000000011251450520414700337230ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-false/nestedimport { relativeUnresolved } from '../relativeUnresolved.js'; import { absolute } from '/absolute.js'; import { pluginDirect } from '../pluginDirect.js'; import { pluginDifferentAbsolute } from '/pluginDifferentAbsolute.js'; import { pluginTrue } from '../pluginTrue.js'; import { pluginForceAbsolute } from '../pluginForceAbsolute.js'; import { pluginForceRelative } from '../pluginForceRelative.js'; console.log( 'nested', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-relative/000077500000000000000000000000001450520414700314225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js000066400000000000000000000036571450520414700333770ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'only normalizes external paths that were originally relative when set to "ifRelativeSource"', options: { makeAbsoluteExternalsRelative: 'ifRelativeSource', external(id) { if ( [ './relativeUnresolved.js', '../relativeUnresolved.js', path.join(__dirname, 'relativeMissing.js'), path.join(__dirname, 'relativeExisting.js'), '/absolute.js', '/pluginAbsolute.js' ].includes(id) ) return true; }, plugins: { name: 'test', async buildStart() { // eslint-disable-next-line unicorn/consistent-function-scoping const testExternal = async (source, expected) => assert.deepStrictEqual((await this.resolve(source, ID_MAIN)).external, expected, source); await testExternal('./relativeUnresolved.js', true); await testExternal('./relativeMissing.js', true); await testExternal('./relativeExisting.js', true); await testExternal('/absolute.js', 'absolute'); await testExternal('./pluginDirect.js', true); await testExternal('/pluginDifferentAbsolute.js', 'absolute'); await testExternal('./pluginTrue.js', true); await testExternal('./pluginForceAbsolute.js', 'absolute'); await testExternal('./pluginForceRelative.js', true); }, resolveId(source) { if (source.endsWith('/pluginDirect.js')) return false; if (source.endsWith('/pluginDifferentAbsolute.js')) return '/pluginAbsolute.js'; if (source.endsWith('/pluginTrue.js')) return { id: path.join(__dirname, 'pluginTrue.js'), external: true }; if (source.endsWith('/pluginForceAbsolute.js')) return { id: '/pluginForceAbsolute.js', external: 'absolute' }; if (source.endsWith('/pluginForceRelative.js')) return { id: path.join(__dirname, 'pluginForceRelative.js'), external: 'relative' }; } } } }); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-relative/_expected.js000066400000000000000000000015701450520414700337230ustar00rootroot00000000000000import { relativeUnresolved } from './relativeUnresolved.js'; import { relativeMissing } from './relativeMissing.js'; import { relativeExisting } from './relativeExisting.js'; import { absolute } from '/absolute.js'; import { pluginDirect } from './pluginDirect.js'; import { pluginDifferentAbsolute } from '/pluginAbsolute.js'; import { pluginTrue } from './pluginTrue.js'; import { pluginForceAbsolute } from '/pluginForceAbsolute.js'; import { pluginForceRelative } from './pluginForceRelative.js'; console.log( 'nested', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); console.log( 'main', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-relative/main.js000066400000000000000000000013351450520414700327060ustar00rootroot00000000000000import { relativeUnresolved } from './relativeUnresolved.js'; import { relativeMissing } from './relativeMissing.js'; import { relativeExisting } from './relativeExisting.js'; import { absolute } from '/absolute.js'; import { pluginDirect } from './pluginDirect.js'; import { pluginDifferentAbsolute } from '/pluginDifferentAbsolute.js'; import { pluginTrue } from './pluginTrue.js'; import { pluginForceAbsolute } from './pluginForceAbsolute.js'; import { pluginForceRelative } from './pluginForceRelative.js'; import './nested/nested.js'; console.log( 'main', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-relative/nested/000077500000000000000000000000001450520414700327045ustar00rootroot00000000000000nested.js000066400000000000000000000013111450520414700344410ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-relative/nestedimport { relativeUnresolved } from '../relativeUnresolved.js'; import { relativeMissing } from '../relativeMissing.js'; import { relativeExisting } from '../relativeExisting.js'; import { absolute } from '/absolute.js'; import { pluginDirect } from '../pluginDirect.js'; import { pluginDifferentAbsolute } from '/pluginDifferentAbsolute.js'; import { pluginTrue } from '../pluginTrue.js'; import { pluginForceAbsolute } from '../pluginForceAbsolute.js'; import { pluginForceRelative } from '../pluginForceRelative.js'; console.log( 'nested', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); relativeExisting.js000066400000000000000000000000001450520414700352150ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-relativerollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-true/000077500000000000000000000000001450520414700305665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js000066400000000000000000000040201450520414700325240ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'normalizes both relative and absolute external paths when set to true', options: { makeAbsoluteExternalsRelative: true, external(id) { if ( [ './relativeUnresolved.js', '../relativeUnresolved.js', path.join(__dirname, 'relativeMissing.js'), path.join(__dirname, 'relativeExisting.js'), path.join(__dirname, 'absolute.js'), path.join(__dirname, 'pluginAbsolute.js') ].includes(id) ) return true; }, plugins: { name: 'test', async buildStart() { // eslint-disable-next-line unicorn/consistent-function-scoping const testExternal = async (source, expected) => assert.deepStrictEqual((await this.resolve(source, ID_MAIN)).external, expected, source); await testExternal('./relativeUnresolved.js', true); await testExternal('./relativeMissing.js', true); await testExternal('./relativeExisting.js', true); await testExternal('/absolute.js', true); await testExternal('./pluginDirect.js', true); await testExternal('/pluginDifferentAbsolute.js', true); await testExternal('./pluginTrue.js', true); await testExternal('./pluginForceAbsolute.js', 'absolute'); await testExternal('./pluginForceRelative.js', true); }, resolveId(source) { if (source.endsWith('/pluginDirect.js')) return false; if (source.endsWith('/pluginDifferentAbsolute.js')) return path.join(__dirname, 'pluginAbsolute.js'); if (source.endsWith('/pluginTrue.js')) return { id: path.join(__dirname, 'pluginTrue.js'), external: true }; if (source.endsWith('/pluginForceAbsolute.js')) return { id: '/pluginForceAbsolute.js', external: 'absolute' }; if (source.endsWith('/pluginForceRelative.js')) return { id: path.join(__dirname, 'pluginForceRelative.js'), external: 'relative' }; if (source === '/absolute.js') return path.join(__dirname, 'absolute.js'); } } } }); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-true/_expected.js000066400000000000000000000015721450520414700330710ustar00rootroot00000000000000import { relativeUnresolved } from './relativeUnresolved.js'; import { relativeMissing } from './relativeMissing.js'; import { relativeExisting } from './relativeExisting.js'; import { absolute } from './absolute.js'; import { pluginDirect } from './pluginDirect.js'; import { pluginDifferentAbsolute } from './pluginAbsolute.js'; import { pluginTrue } from './pluginTrue.js'; import { pluginForceAbsolute } from '/pluginForceAbsolute.js'; import { pluginForceRelative } from './pluginForceRelative.js'; console.log( 'nested', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); console.log( 'main', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-true/main.js000066400000000000000000000013351450520414700320520ustar00rootroot00000000000000import { relativeUnresolved } from './relativeUnresolved.js'; import { relativeMissing } from './relativeMissing.js'; import { relativeExisting } from './relativeExisting.js'; import { absolute } from '/absolute.js'; import { pluginDirect } from './pluginDirect.js'; import { pluginDifferentAbsolute } from '/pluginDifferentAbsolute.js'; import { pluginTrue } from './pluginTrue.js'; import { pluginForceAbsolute } from './pluginForceAbsolute.js'; import { pluginForceRelative } from './pluginForceRelative.js'; import './nested/nested.js'; console.log( 'main', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-true/nested/000077500000000000000000000000001450520414700320505ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-true/nested/nested.js000066400000000000000000000013111450520414700336640ustar00rootroot00000000000000import { relativeUnresolved } from '../relativeUnresolved.js'; import { relativeMissing } from '../relativeMissing.js'; import { relativeExisting } from '../relativeExisting.js'; import { absolute } from '/absolute.js'; import { pluginDirect } from '../pluginDirect.js'; import { pluginDifferentAbsolute } from '/pluginDifferentAbsolute.js'; import { pluginTrue } from '../pluginTrue.js'; import { pluginForceAbsolute } from '../pluginForceAbsolute.js'; import { pluginForceRelative } from '../pluginForceRelative.js'; console.log( 'nested', relativeUnresolved, relativeMissing, relativeExisting, absolute, pluginDirect, pluginDifferentAbsolute, pluginTrue, pluginForceAbsolute, pluginForceRelative ); relativeExisting.js000066400000000000000000000000001450520414700343610ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/make-absolute-externals-relative/make-relative-truerollup-3.29.4/test/form/samples/manual-pure-functions/000077500000000000000000000000001450520414700227525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/manual-pure-functions/_config.js000066400000000000000000000002561450520414700247170ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to manually declare functions as pure by name', options: { treeshake: { manualPureFunctions: ['foo', 'bar.a'] } } }); rollup-3.29.4/test/form/samples/manual-pure-functions/_expected.js000066400000000000000000000003111450520414700252430ustar00rootroot00000000000000const lib = { a: () => { console.log(); return () => { console.log(); return () => { console.log(); return console.log; } } } }; lib(); // not removed lib.b(); // not removed rollup-3.29.4/test/form/samples/manual-pure-functions/main.js000066400000000000000000000010171450520414700242330ustar00rootroot00000000000000import { lib as bar } from './other'; foo; // removed foo(); // removed foo.a; // removed foo.a(); // removed foo.a()(); // removed foo.a().a; // removed foo.a().a(); // removed foo.a().a()(); // removed foo.a().a().a; // removed foo.a().a().a(); // removed bar(); // not removed bar.b(); // not removed bar.a(); // removed bar?.a(); // removed bar.a.a; // removed bar.a.a(); // removed bar.a()(); //removed bar.a().a; //removed bar.a().a(); //removed bar.a()()(); //removed bar.a()().a; //removed bar.a()().a(); //removed rollup-3.29.4/test/form/samples/manual-pure-functions/other.js000066400000000000000000000002411450520414700244260ustar00rootroot00000000000000export const lib = { a: () => { console.log(); return () => { console.log(); return () => { console.log(); return console.log; } } } }; rollup-3.29.4/test/form/samples/merge-namespaces-non-live/000077500000000000000000000000001450520414700234575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/merge-namespaces-non-live/_config.js000066400000000000000000000004461450520414700254250ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges namespaces without live-bindings', options: { external: ['external1', 'external2'], output: { externalLiveBindings: false }, plugins: [ { transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }); rollup-3.29.4/test/form/samples/merge-namespaces-non-live/_expected.js000066400000000000000000000010641450520414700257560ustar00rootroot00000000000000import * as external1 from 'external1'; import * as external2 from 'external2'; function _mergeNamespaces(n, m) { for (var i = 0; i < m.length; i++) { var e = m[i]; if (typeof e !== 'string' && !Array.isArray(e)) { for (var k in e) { if (k !== 'default' && !(k in n)) { n[k] = e[k]; } } } } return Object.freeze(n); } const __synthetic$1 = { module: 'synthetic' }; const __synthetic = { module: 'reexport' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null }, [__synthetic, __synthetic$1, external1, external2]); console.log(ns); rollup-3.29.4/test/form/samples/merge-namespaces-non-live/main.js000066400000000000000000000000631450520414700247400ustar00rootroot00000000000000import * as ns from './reexport'; console.log(ns); rollup-3.29.4/test/form/samples/merge-namespaces-non-live/reexport.js000066400000000000000000000002061450520414700256630ustar00rootroot00000000000000export * from 'external1'; export * from './synthetic'; export * from 'external2'; export const __synthetic = { module: 'reexport' }; rollup-3.29.4/test/form/samples/merge-namespaces-non-live/synthetic.js000066400000000000000000000000641450520414700260270ustar00rootroot00000000000000export const __synthetic = { module: 'synthetic' }; rollup-3.29.4/test/form/samples/merge-namespaces/000077500000000000000000000000001450520414700217325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/merge-namespaces/_config.js000066400000000000000000000004121450520414700236710ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges namespaces with live-bindings', options: { external: ['external1', 'external2'], plugins: [ { name: 'test', transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }); rollup-3.29.4/test/form/samples/merge-namespaces/_expected.js000066400000000000000000000013041450520414700242260ustar00rootroot00000000000000import * as external1 from 'external1'; import * as external2 from 'external2'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } const __synthetic$1 = { module: 'synthetic' }; const __synthetic = { module: 'reexport' }; var ns = /*#__PURE__*/_mergeNamespaces({ __proto__: null }, [__synthetic, __synthetic$1, external1, external2]); console.log(ns); rollup-3.29.4/test/form/samples/merge-namespaces/main.js000066400000000000000000000000631450520414700232130ustar00rootroot00000000000000import * as ns from './reexport'; console.log(ns); rollup-3.29.4/test/form/samples/merge-namespaces/reexport.js000066400000000000000000000002061450520414700241360ustar00rootroot00000000000000export * from 'external1'; export * from './synthetic'; export * from 'external2'; export const __synthetic = { module: 'reexport' }; rollup-3.29.4/test/form/samples/merge-namespaces/synthetic.js000066400000000000000000000000641450520414700243020ustar00rootroot00000000000000export const __synthetic = { module: 'synthetic' }; rollup-3.29.4/test/form/samples/minimal-this-mutation/000077500000000000000000000000001450520414700227475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/minimal-this-mutation/_config.js000066400000000000000000000001451450520414700247110ustar00rootroot00000000000000module.exports = defineTest({ description: 'mutates "this" only if necessary on function calls' }); rollup-3.29.4/test/form/samples/minimal-this-mutation/_expected.js000066400000000000000000000013141450520414700252440ustar00rootroot00000000000000console.log('retained'); const obj2 = { noMutationEffect() { console.log('effect'); }, prop: true }; obj2.noMutationEffect(); console.log('retained'); const obj3 = { mutateProp() { this.prop = false; }, prop: true }; obj3.mutateProp(); if (obj3.prop) console.log('unimportant'); else console.log('retained'); const obj4 = { mutateUnknownProp() { this[globalThis.unknown] = false; }, prop: true }; obj4.mutateUnknownProp(); if (obj4.prop) console.log('retained'); else console.log('retained'); const obj5 = { mutateNestedProp() { this.nested.prop = false; }, nested: { prop: true } }; obj5.mutateNestedProp(); if (obj5.nested.prop) console.log('unimportant'); else console.log('retained'); rollup-3.29.4/test/form/samples/minimal-this-mutation/main.js000066400000000000000000000015471450520414700242400ustar00rootroot00000000000000const obj1 = { noMutation() {}, prop: true }; obj1.noMutation(); if (obj1.prop) console.log('retained'); else console.log('removed'); const obj2 = { noMutationEffect() { console.log('effect'); }, prop: true }; obj2.noMutationEffect(); if (obj2.prop) console.log('retained'); else console.log('removed'); const obj3 = { mutateProp() { this.prop = false; }, prop: true }; obj3.mutateProp(); if (obj3.prop) console.log('unimportant'); else console.log('retained'); const obj4 = { mutateUnknownProp() { this[globalThis.unknown] = false; }, prop: true }; obj4.mutateUnknownProp(); if (obj4.prop) console.log('retained'); else console.log('retained'); const obj5 = { mutateNestedProp() { this.nested.prop = false; }, nested: { prop: true } }; obj5.mutateNestedProp(); if (obj5.nested.prop) console.log('unimportant'); else console.log('retained'); rollup-3.29.4/test/form/samples/mjs/000077500000000000000000000000001450520414700173075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/mjs/_config.js000066400000000000000000000002061450520414700212470ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports loading mjs with precedence', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/mjs/_expected/000077500000000000000000000000001450520414700212475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/mjs/_expected/amd.js000066400000000000000000000002251450520414700223450ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var dep$1 = 'js'; var dep = 'mjs'; exports.depJs = dep$1; exports.depMjs = dep; })); rollup-3.29.4/test/form/samples/mjs/_expected/cjs.js000066400000000000000000000001411450520414700223600ustar00rootroot00000000000000'use strict'; var dep$1 = 'js'; var dep = 'mjs'; exports.depJs = dep$1; exports.depMjs = dep; rollup-3.29.4/test/form/samples/mjs/_expected/es.js000066400000000000000000000001171450520414700222130ustar00rootroot00000000000000var dep$1 = 'js'; var dep = 'mjs'; export { dep$1 as depJs, dep as depMjs }; rollup-3.29.4/test/form/samples/mjs/_expected/iife.js000066400000000000000000000002461450520414700225230ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; var dep$1 = 'js'; var dep = 'mjs'; exports.depJs = dep$1; exports.depMjs = dep; return exports; })({}); rollup-3.29.4/test/form/samples/mjs/_expected/system.js000066400000000000000000000003101450520414700231230ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var dep$1 = exports('depJs', 'js'); var dep = exports('depMjs', 'mjs'); }) }; })); rollup-3.29.4/test/form/samples/mjs/_expected/umd.js000066400000000000000000000006641450520414700224000ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {})); })(this, (function (exports) { 'use strict'; var dep$1 = 'js'; var dep = 'mjs'; exports.depJs = dep$1; exports.depMjs = dep; })); rollup-3.29.4/test/form/samples/mjs/dep.js000066400000000000000000000000241450520414700204110ustar00rootroot00000000000000export default 'js';rollup-3.29.4/test/form/samples/mjs/dep.mjs000066400000000000000000000000251450520414700205670ustar00rootroot00000000000000export default 'mjs';rollup-3.29.4/test/form/samples/mjs/main.js000066400000000000000000000001271450520414700205710ustar00rootroot00000000000000export { default as depJs } from './dep.js'; export { default as depMjs } from './dep';rollup-3.29.4/test/form/samples/modify-class-prototype/000077500000000000000000000000001450520414700231535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/modify-class-prototype/_config.js000066400000000000000000000001411450520414700251110ustar00rootroot00000000000000module.exports = defineTest({ description: 'tree-shakes prototype modifications of classes' }); rollup-3.29.4/test/form/samples/modify-class-prototype/_expected.js000066400000000000000000000004551450520414700254550ustar00rootroot00000000000000class Retained {} Retained.prop = 42; Retained.prototype.prop = 43; Retained.prototype.prop2 = Retained.prototype.prop; class RetainedSuper { set prop(v) { console.log('effect', v); } } class RetainedWithSuper extends RetainedSuper {} RetainedWithSuper.prototype.prop = 42; export { Retained }; rollup-3.29.4/test/form/samples/modify-class-prototype/main.js000066400000000000000000000010611450520414700244330ustar00rootroot00000000000000class Removed {} Removed.prop = 42; Removed.prototype.prop = 43; Removed.prototype.prop2 = Removed.prototype.prop; export class Retained {} Retained.prop = 42; Retained.prototype.prop = 43; Retained.prototype.prop2 = Retained.prototype.prop; class RemovedSuper { prop() {} } class RemovedWithSuper extends RemovedSuper {} RemovedWithSuper.prototype.prop = 42; RemovedWithSuper.prototype.prop2 = 43; class RetainedSuper { set prop(v) { console.log('effect', v); } } class RetainedWithSuper extends RetainedSuper {} RetainedWithSuper.prototype.prop = 42; rollup-3.29.4/test/form/samples/modify-export-semi/000077500000000000000000000000001450520414700222575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/modify-export-semi/_config.js000066400000000000000000000002051450520414700242160ustar00rootroot00000000000000module.exports = defineTest({ description: 'inserts semicolons correctly when modifying SystemJS exports', formats: ['system'] }); rollup-3.29.4/test/form/samples/modify-export-semi/_expected/000077500000000000000000000000001450520414700242175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/modify-export-semi/_expected/system.js000066400000000000000000000002621450520414700261010ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('foo', 'foo'); exports('foo', foo = 'bar'); }) }; })); rollup-3.29.4/test/form/samples/modify-export-semi/main.js000066400000000000000000000000431450520414700235360ustar00rootroot00000000000000export let foo = 'foo' foo = 'bar'rollup-3.29.4/test/form/samples/module-name-scoped-package/000077500000000000000000000000001450520414700235655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/module-name-scoped-package/_config.js000066400000000000000000000003021450520414700255220ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows module name with dashes to be added to the global object', options: { output: { extend: true, name: '@scoped/npm-package' } } }); rollup-3.29.4/test/form/samples/module-name-scoped-package/_expected/000077500000000000000000000000001450520414700255255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/module-name-scoped-package/_expected/amd.js000066400000000000000000000001461450520414700266250ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; })); rollup-3.29.4/test/form/samples/module-name-scoped-package/_expected/cjs.js000066400000000000000000000000641450520414700266420ustar00rootroot00000000000000'use strict'; let foo = 'foo'; exports.foo = foo; rollup-3.29.4/test/form/samples/module-name-scoped-package/_expected/es.js000066400000000000000000000000421450520414700264660ustar00rootroot00000000000000let foo = 'foo'; export { foo }; rollup-3.29.4/test/form/samples/module-name-scoped-package/_expected/iife.js000066400000000000000000000002231450520414700267740ustar00rootroot00000000000000(function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; })(this["@scoped/npm-package"] = this["@scoped/npm-package"] || {}); rollup-3.29.4/test/form/samples/module-name-scoped-package/_expected/system.js000066400000000000000000000002501450520414700274040ustar00rootroot00000000000000System.register('@scoped/npm-package', [], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('foo', 'foo'); }) }; })); rollup-3.29.4/test/form/samples/module-name-scoped-package/_expected/umd.js000066400000000000000000000006641450520414700266560ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@scoped/npm-package"] = global["@scoped/npm-package"] || {})); })(this, (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; })); rollup-3.29.4/test/form/samples/module-name-scoped-package/main.js000066400000000000000000000000301450520414700250400ustar00rootroot00000000000000export let foo = 'foo'; rollup-3.29.4/test/form/samples/module-name-wat/000077500000000000000000000000001450520414700215125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/module-name-wat/_config.js000066400000000000000000000003261450520414700234550ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly dereferences properties on the global object regardless of nesting', options: { output: { name: 'foo.@scoped/npm-package.bar.why-would-you-do-this' } } }); rollup-3.29.4/test/form/samples/module-name-wat/_expected/000077500000000000000000000000001450520414700234525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/module-name-wat/_expected/amd.js000066400000000000000000000001461450520414700245520ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; })); rollup-3.29.4/test/form/samples/module-name-wat/_expected/cjs.js000066400000000000000000000000641450520414700245670ustar00rootroot00000000000000'use strict'; let foo = 'foo'; exports.foo = foo; rollup-3.29.4/test/form/samples/module-name-wat/_expected/es.js000066400000000000000000000000421450520414700244130ustar00rootroot00000000000000let foo = 'foo'; export { foo }; rollup-3.29.4/test/form/samples/module-name-wat/_expected/iife.js000066400000000000000000000005341450520414700247260ustar00rootroot00000000000000this.foo = this.foo || {}; this.foo["@scoped/npm-package"] = this.foo["@scoped/npm-package"] || {}; this.foo["@scoped/npm-package"].bar = this.foo["@scoped/npm-package"].bar || {}; this.foo["@scoped/npm-package"].bar["why-would-you-do-this"] = (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; return exports; })({}); rollup-3.29.4/test/form/samples/module-name-wat/_expected/system.js000066400000000000000000000003061450520414700253330ustar00rootroot00000000000000System.register('foo.@scoped/npm-package.bar.why-would-you-do-this', [], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('foo', 'foo'); }) }; })); rollup-3.29.4/test/form/samples/module-name-wat/_expected/umd.js000066400000000000000000000011671450520414700246020ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.foo = global.foo || {}, global.foo["@scoped/npm-package"] = global.foo["@scoped/npm-package"] || {}, global.foo["@scoped/npm-package"].bar = global.foo["@scoped/npm-package"].bar || {}, global.foo["@scoped/npm-package"].bar["why-would-you-do-this"] = {}))); })(this, (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; })); rollup-3.29.4/test/form/samples/module-name-wat/main.js000066400000000000000000000000301450520414700227650ustar00rootroot00000000000000export let foo = 'foo'; rollup-3.29.4/test/form/samples/module-name-with-dashes/000077500000000000000000000000001450520414700231375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/module-name-with-dashes/_config.js000066400000000000000000000003061450520414700251000ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows module name with dashes to be added to the global object', options: { output: { extend: true, name: 'module-name-with-dashes' } } }); rollup-3.29.4/test/form/samples/module-name-with-dashes/_expected/000077500000000000000000000000001450520414700250775ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/module-name-with-dashes/_expected/amd.js000066400000000000000000000001461450520414700261770ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; })); rollup-3.29.4/test/form/samples/module-name-with-dashes/_expected/cjs.js000066400000000000000000000000641450520414700262140ustar00rootroot00000000000000'use strict'; let foo = 'foo'; exports.foo = foo; rollup-3.29.4/test/form/samples/module-name-with-dashes/_expected/es.js000066400000000000000000000000421450520414700260400ustar00rootroot00000000000000let foo = 'foo'; export { foo }; rollup-3.29.4/test/form/samples/module-name-with-dashes/_expected/iife.js000066400000000000000000000002331450520414700263470ustar00rootroot00000000000000(function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; })(this["module-name-with-dashes"] = this["module-name-with-dashes"] || {}); rollup-3.29.4/test/form/samples/module-name-with-dashes/_expected/system.js000066400000000000000000000002541450520414700267620ustar00rootroot00000000000000System.register('module-name-with-dashes', [], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('foo', 'foo'); }) }; })); rollup-3.29.4/test/form/samples/module-name-with-dashes/_expected/umd.js000066400000000000000000000006741450520414700262310ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["module-name-with-dashes"] = global["module-name-with-dashes"] || {})); })(this, (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; })); rollup-3.29.4/test/form/samples/module-name-with-dashes/main.js000066400000000000000000000000301450520414700244120ustar00rootroot00000000000000export let foo = 'foo'; rollup-3.29.4/test/form/samples/module-no-treeshake/000077500000000000000000000000001450520414700223665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/module-no-treeshake/_config.js000066400000000000000000000013711450520414700243320ustar00rootroot00000000000000function getCode(id) { return `const unused = 'unused in ${id}';`; } module.exports = defineTest({ description: 'allows disabling tree-shaking for modules', options: { plugins: { resolveId(id) { if (id.startsWith('dep')) { if (id === 'depResolved') { return { id, moduleSideEffects: 'no-treeshake' }; } return id; } }, load(id) { if (id.startsWith('dep')) { if (id === 'depLoaded') { return { code: getCode(id), moduleSideEffects: 'no-treeshake' }; } return getCode(id); } }, transform(code, id) { if (id === 'depTransformed') { return { code: getCode(id), moduleSideEffects: 'no-treeshake' }; } } } } }); rollup-3.29.4/test/form/samples/module-no-treeshake/_expected.js000066400000000000000000000001771450520414700246710ustar00rootroot00000000000000const unused$2 = 'unused in depResolved'; const unused$1 = 'unused in depLoaded'; const unused = 'unused in depTransformed'; rollup-3.29.4/test/form/samples/module-no-treeshake/main.js000066400000000000000000000001651450520414700236520ustar00rootroot00000000000000import 'dep'; import 'depResolved'; import 'depLoaded'; import 'depTransformed'; const unused = "unused in 'main'"; rollup-3.29.4/test/form/samples/multi-expression-calls/000077500000000000000000000000001450520414700231415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/multi-expression-calls/_config.js000066400000000000000000000001351450520414700251020ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles side-effect-free multi-expressions' }); rollup-3.29.4/test/form/samples/multi-expression-calls/_expected.js000066400000000000000000000000311450520414700254310ustar00rootroot00000000000000console.log('retained'); rollup-3.29.4/test/form/samples/multi-expression-calls/main.js000066400000000000000000000002461450520414700244250ustar00rootroot00000000000000function noEffect1(x, y) { return () => x; } function noEffect2() { return () => {}; } (globalThis.unknown ? noEffect1 : noEffect2)()(); console.log('retained'); rollup-3.29.4/test/form/samples/multiple-exports/000077500000000000000000000000001450520414700220535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/multiple-exports/_config.js000066400000000000000000000001651450520414700240170ustar00rootroot00000000000000module.exports = defineTest({ description: 'multiple named exports', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/multiple-exports/_expected/000077500000000000000000000000001450520414700240135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/multiple-exports/_expected/amd.js000066400000000000000000000002041450520414700251060ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var foo = 1; var bar = 2; exports.bar = bar; exports.foo = foo; })); rollup-3.29.4/test/form/samples/multiple-exports/_expected/cjs.js000066400000000000000000000001201450520414700251210ustar00rootroot00000000000000'use strict'; var foo = 1; var bar = 2; exports.bar = bar; exports.foo = foo; rollup-3.29.4/test/form/samples/multiple-exports/_expected/es.js000066400000000000000000000000601450520414700247540ustar00rootroot00000000000000var foo = 1; var bar = 2; export { bar, foo }; rollup-3.29.4/test/form/samples/multiple-exports/_expected/iife.js000066400000000000000000000002251450520414700252640ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; var foo = 1; var bar = 2; exports.bar = bar; exports.foo = foo; return exports; })({}); rollup-3.29.4/test/form/samples/multiple-exports/_expected/system.js000066400000000000000000000002711450520414700256750ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('foo', 1); var bar = exports('bar', 2); }) }; })); rollup-3.29.4/test/form/samples/multiple-exports/_expected/umd.js000066400000000000000000000006431450520414700251410ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {})); })(this, (function (exports) { 'use strict'; var foo = 1; var bar = 2; exports.bar = bar; exports.foo = foo; })); rollup-3.29.4/test/form/samples/multiple-exports/main.js000066400000000000000000000000501450520414700233300ustar00rootroot00000000000000export var foo = 1; export var bar = 2; rollup-3.29.4/test/form/samples/mutations-in-imports/000077500000000000000000000000001450520414700226405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/mutations-in-imports/_config.js000066400000000000000000000001151450520414700245770ustar00rootroot00000000000000module.exports = defineTest({ description: 'track mutations of imports' }); rollup-3.29.4/test/form/samples/mutations-in-imports/_expected.js000066400000000000000000000005211450520414700251340ustar00rootroot00000000000000const x$2 = { a: { b: () => {} } }; const y$2 = { a: x$2.a }; const x$1 = { a: { b: () => {} } }; const y$1 = { a: x$1.a }; const x = { a: { b: () => {} } }; const y = { a: x.a }; y$2.a.b = () => console.log( 'effect' ); x$2.a.b(); y$1.a.b = () => console.log( 'effect' ); x$1.a.b(); y.a.b = () => console.log( 'effect' ); x.a.b(); rollup-3.29.4/test/form/samples/mutations-in-imports/lib1.js000066400000000000000000000001571450520414700240300ustar00rootroot00000000000000export const x = { a: { b: () => {} } }; export const y = { a: x.a }; export const z = { a: { b: () => {} } }; rollup-3.29.4/test/form/samples/mutations-in-imports/lib2.js000066400000000000000000000001571450520414700240310ustar00rootroot00000000000000export const x = { a: { b: () => {} } }; export const y = { a: x.a }; export const z = { a: { b: () => {} } }; rollup-3.29.4/test/form/samples/mutations-in-imports/lib3.js000066400000000000000000000001571450520414700240320ustar00rootroot00000000000000export const x = { a: { b: () => {} } }; export const y = { a: x.a }; export const z = { a: { b: () => {} } }; rollup-3.29.4/test/form/samples/mutations-in-imports/lib3a.js000066400000000000000000000000571450520414700241720ustar00rootroot00000000000000import { x } from './lib3'; export default x; rollup-3.29.4/test/form/samples/mutations-in-imports/lib3b.js000066400000000000000000000000571450520414700241730ustar00rootroot00000000000000import { y } from './lib3'; export default y; rollup-3.29.4/test/form/samples/mutations-in-imports/lib3c.js000066400000000000000000000000571450520414700241740ustar00rootroot00000000000000import { z } from './lib3'; export default z; rollup-3.29.4/test/form/samples/mutations-in-imports/main.js000066400000000000000000000005531450520414700241250ustar00rootroot00000000000000import * as lib1 from './lib1'; import { x, y, z } from './lib2'; import x3 from './lib3a'; import y3 from './lib3b'; import z3 from './lib3c'; lib1.y.a.b = () => console.log( 'effect' ); lib1.x.a.b(); lib1.z.a.b = () => {}; y.a.b = () => console.log( 'effect' ); x.a.b(); z.a.b = () => {}; y3.a.b = () => console.log( 'effect' ); x3.a.b(); z3.a.b = () => {}; rollup-3.29.4/test/form/samples/namespace-conflict/000077500000000000000000000000001450520414700222515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-conflict/_config.js000066400000000000000000000002501450520414700242100ustar00rootroot00000000000000module.exports = defineTest({ description: 'replaces conflicting namespace properties with undefined', expectedWarnings: ['NAMESPACE_CONFLICT', 'MISSING_EXPORT'] }); rollup-3.29.4/test/form/samples/namespace-conflict/_expected.js000066400000000000000000000000301450520414700245400ustar00rootroot00000000000000console.log(undefined); rollup-3.29.4/test/form/samples/namespace-conflict/first.js000066400000000000000000000000261450520414700237340ustar00rootroot00000000000000export const foo = 1; rollup-3.29.4/test/form/samples/namespace-conflict/main.js000066400000000000000000000000701450520414700235300ustar00rootroot00000000000000import * as ns from './reexport'; console.log(ns.foo); rollup-3.29.4/test/form/samples/namespace-conflict/reexport.js000066400000000000000000000000631450520414700244560ustar00rootroot00000000000000export * from './first'; export * from './second'; rollup-3.29.4/test/form/samples/namespace-conflict/second.js000066400000000000000000000000261450520414700240600ustar00rootroot00000000000000export const foo = 2; rollup-3.29.4/test/form/samples/namespace-import-reexport-2/000077500000000000000000000000001450520414700237675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-import-reexport-2/_config.js000066400000000000000000000004111450520414700257250ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly associate or shadow variables in and around functions', options: { external: ['external1', 'external2'], output: { globals: { external1: 'external1', external2: 'external2' }, name: 'iife' } } }); rollup-3.29.4/test/form/samples/namespace-import-reexport-2/_expected/000077500000000000000000000000001450520414700257275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-import-reexport-2/_expected/amd.js000066400000000000000000000013231450520414700270250ustar00rootroot00000000000000define(['exports', 'external1', 'external2'], (function (exports, external1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return external1.x; } }); exports.ext = external2__namespace; })); rollup-3.29.4/test/form/samples/namespace-import-reexport-2/_expected/cjs.js000066400000000000000000000012521450520414700270440ustar00rootroot00000000000000'use strict'; var external1 = require('external1'); var external2 = require('external2'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return external1.x; } }); exports.ext = external2__namespace; rollup-3.29.4/test/form/samples/namespace-import-reexport-2/_expected/es.js000066400000000000000000000001441450520414700266730ustar00rootroot00000000000000export { x } from 'external1'; import * as external2 from 'external2'; export { external2 as ext }; rollup-3.29.4/test/form/samples/namespace-import-reexport-2/_expected/iife.js000066400000000000000000000013341450520414700272020ustar00rootroot00000000000000var iife = (function (exports, external1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return external1.x; } }); exports.ext = external2__namespace; return exports; })({}, external1, external2); rollup-3.29.4/test/form/samples/namespace-import-reexport-2/_expected/system.js000066400000000000000000000004031450520414700276060ustar00rootroot00000000000000System.register('iife', ['external1', 'external2'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('x', module.x); }, function (module) { exports('ext', module); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/namespace-import-reexport-2/_expected/umd.js000066400000000000000000000020761450520414700270570ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external1'), require('external2')) : typeof define === 'function' && define.amd ? define(['exports', 'external1', 'external2'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.iife = {}, global.external1, global.external2)); })(this, (function (exports, external1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return external1.x; } }); exports.ext = external2__namespace; })); rollup-3.29.4/test/form/samples/namespace-import-reexport-2/main.js000066400000000000000000000001211450520414700252430ustar00rootroot00000000000000export { x } from 'external1'; import * as ext from 'external2'; export { ext }; rollup-3.29.4/test/form/samples/namespace-import-reexport/000077500000000000000000000000001450520414700236305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-import-reexport/_config.js000066400000000000000000000003721450520414700255740ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly associate or shadow variables in and around functions', options: { external: ['external-package'], output: { globals: { 'external-package': 'externalPackage' }, name: 'iife' } } }); rollup-3.29.4/test/form/samples/namespace-import-reexport/_expected/000077500000000000000000000000001450520414700255705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-import-reexport/_expected/amd.js000066400000000000000000000011571450520414700266730ustar00rootroot00000000000000define(['exports', 'external-package'], (function (exports, externalPackage) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var externalPackage__namespace = /*#__PURE__*/_interopNamespaceDefault(externalPackage); exports.ext = externalPackage__namespace; })); rollup-3.29.4/test/form/samples/namespace-import-reexport/_expected/cjs.js000066400000000000000000000010741450520414700267070ustar00rootroot00000000000000'use strict'; var externalPackage = require('external-package'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var externalPackage__namespace = /*#__PURE__*/_interopNamespaceDefault(externalPackage); exports.ext = externalPackage__namespace; rollup-3.29.4/test/form/samples/namespace-import-reexport/_expected/es.js000066400000000000000000000001301450520414700265270ustar00rootroot00000000000000import * as externalPackage from 'external-package'; export { externalPackage as ext }; rollup-3.29.4/test/form/samples/namespace-import-reexport/_expected/iife.js000066400000000000000000000011711450520414700270420ustar00rootroot00000000000000var iife = (function (exports, externalPackage) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var externalPackage__namespace = /*#__PURE__*/_interopNamespaceDefault(externalPackage); exports.ext = externalPackage__namespace; return exports; })({}, externalPackage); rollup-3.29.4/test/form/samples/namespace-import-reexport/_expected/system.js000066400000000000000000000003111450520414700274450ustar00rootroot00000000000000System.register('iife', ['external-package'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('ext', module); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/namespace-import-reexport/_expected/umd.js000066400000000000000000000016771450520414700267260ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external-package')) : typeof define === 'function' && define.amd ? define(['exports', 'external-package'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.iife = {}, global.externalPackage)); })(this, (function (exports, externalPackage) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var externalPackage__namespace = /*#__PURE__*/_interopNamespaceDefault(externalPackage); exports.ext = externalPackage__namespace; })); rollup-3.29.4/test/form/samples/namespace-import-reexport/main.js000066400000000000000000000000701450520414700251070ustar00rootroot00000000000000import * as ext from 'external-package'; export { ext };rollup-3.29.4/test/form/samples/namespace-missing-export-effects/000077500000000000000000000000001450520414700250555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-missing-export-effects/_config.js000066400000000000000000000002141450520414700270140ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles interacting with missing namespace members', expectedWarnings: ['MISSING_EXPORT'] }); rollup-3.29.4/test/form/samples/namespace-missing-export-effects/_expected.js000066400000000000000000000001251450520414700273510ustar00rootroot00000000000000console.log(1); if (undefined()) ; const foo = undefined; foo.bar; (0, undefined)(); rollup-3.29.4/test/form/samples/namespace-missing-export-effects/main.js000066400000000000000000000002171450520414700263370ustar00rootroot00000000000000import * as ns from './other.js'; if (!ns.foo) console.log(1); if (ns.foo()) console.log(2); const foo = ns.foo; foo.bar; (true && ns.foo)(); rollup-3.29.4/test/form/samples/namespace-missing-export-effects/other.js000066400000000000000000000000001450520414700265220ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-object-import/000077500000000000000000000000001450520414700232265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-object-import/_config.js000066400000000000000000000002231450520414700251650ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly encodes reserved names if namespace import is used', options: { input: ['main.js'] } }); rollup-3.29.4/test/form/samples/namespace-object-import/_expected/000077500000000000000000000000001450520414700251665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-object-import/_expected/amd.js000066400000000000000000000002511450520414700262630ustar00rootroot00000000000000define((function () { 'use strict'; var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: dep }); console.log(dep$1); })); rollup-3.29.4/test/form/samples/namespace-object-import/_expected/cjs.js000066400000000000000000000002071450520414700263020ustar00rootroot00000000000000'use strict'; var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: dep }); console.log(dep$1); rollup-3.29.4/test/form/samples/namespace-object-import/_expected/es.js000066400000000000000000000001701450520414700261310ustar00rootroot00000000000000var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: dep }); console.log(dep$1); rollup-3.29.4/test/form/samples/namespace-object-import/_expected/iife.js000066400000000000000000000002441450520414700264400ustar00rootroot00000000000000(function () { 'use strict'; var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: dep }); console.log(dep$1); })(); rollup-3.29.4/test/form/samples/namespace-object-import/_expected/system.js000066400000000000000000000003601450520414700270470ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: dep }); console.log(dep$1); }) }; })); rollup-3.29.4/test/form/samples/namespace-object-import/_expected/umd.js000066400000000000000000000004071450520414700263120ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: dep }); console.log(dep$1); })); rollup-3.29.4/test/form/samples/namespace-object-import/dep.js000066400000000000000000000000311450520414700243260ustar00rootroot00000000000000export default "default" rollup-3.29.4/test/form/samples/namespace-object-import/main.js000066400000000000000000000000631450520414700245070ustar00rootroot00000000000000import * as dep from './dep.js'; console.log(dep);rollup-3.29.4/test/form/samples/namespace-optimization-b/000077500000000000000000000000001450520414700234155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-optimization-b/_config.js000066400000000000000000000002371450520414700253610ustar00rootroot00000000000000module.exports = defineTest({ description: 'it does static lookup optimization of internal namespaces, coping with multiple namespaces in one function' }); rollup-3.29.4/test/form/samples/namespace-optimization-b/_expected/000077500000000000000000000000001450520414700253555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-optimization-b/_expected/amd.js000066400000000000000000000002401450520414700264500ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); })); rollup-3.29.4/test/form/samples/namespace-optimization-b/_expected/cjs.js000066400000000000000000000001721450520414700264720ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); rollup-3.29.4/test/form/samples/namespace-optimization-b/_expected/es.js000066400000000000000000000001531450520414700263210ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); rollup-3.29.4/test/form/samples/namespace-optimization-b/_expected/iife.js000066400000000000000000000002331450520414700266250ustar00rootroot00000000000000(function () { 'use strict'; function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); })(); rollup-3.29.4/test/form/samples/namespace-optimization-b/_expected/system.js000066400000000000000000000003571450520414700272440ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); }) }; })); rollup-3.29.4/test/form/samples/namespace-optimization-b/_expected/umd.js000066400000000000000000000003761450520414700265060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); })); rollup-3.29.4/test/form/samples/namespace-optimization-b/foo.js000066400000000000000000000000621450520414700245340ustar00rootroot00000000000000export function foo () { console.log( 'foo' ); } rollup-3.29.4/test/form/samples/namespace-optimization-b/main.js000066400000000000000000000001641450520414700247000ustar00rootroot00000000000000import * as foo from './foo'; function a () { foo.foo(); foo.foo(); var a; if ( a.b ) { // empty } } a(); rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/000077500000000000000000000000001450520414700263205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/_config.js000066400000000000000000000002051450520414700302570ustar00rootroot00000000000000module.exports = defineTest({ description: 'it does dynamic lookup optimization of internal namespaces for string-literal keys' }); rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/_expected/000077500000000000000000000000001450520414700302605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/_expected/amd.js000066400000000000000000000001371450520414700313600ustar00rootroot00000000000000define((function () { 'use strict'; function a () { console.log('effect'); } a(); })); rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/_expected/cjs.js000066400000000000000000000000771450520414700314010ustar00rootroot00000000000000'use strict'; function a () { console.log('effect'); } a(); rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/_expected/es.js000066400000000000000000000000601450520414700312210ustar00rootroot00000000000000function a () { console.log('effect'); } a(); rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/_expected/iife.js000066400000000000000000000001321450520414700315260ustar00rootroot00000000000000(function () { 'use strict'; function a () { console.log('effect'); } a(); })(); rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/_expected/system.js000066400000000000000000000002421450520414700321400ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function a () { console.log('effect'); } a(); }) }; })); rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/_expected/umd.js000066400000000000000000000002751450520414700314070ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function a () { console.log('effect'); } a(); })); rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/bar.js000066400000000000000000000000661450520414700274240ustar00rootroot00000000000000import * as quux from './quux.js'; export { quux }; rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/foo.js000066400000000000000000000000631450520414700274400ustar00rootroot00000000000000import * as bar from './bar.js'; export { bar }; rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/main.js000066400000000000000000000001301450520414700275740ustar00rootroot00000000000000import * as foo from './foo.js'; foo['bar']['quux']['a'](); foo['bar']['quux']['b'](); rollup-3.29.4/test/form/samples/namespace-optimization-computed-string/quux.js000066400000000000000000000001121450520414700276520ustar00rootroot00000000000000export function a () { console.log('effect'); } export function b () {} rollup-3.29.4/test/form/samples/namespace-optimization/000077500000000000000000000000001450520414700231765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-optimization/_config.js000066400000000000000000000001541450520414700251400ustar00rootroot00000000000000module.exports = defineTest({ description: 'it does static lookup optimization of internal namespaces' }); rollup-3.29.4/test/form/samples/namespace-optimization/_expected.js000066400000000000000000000000461450520414700254740ustar00rootroot00000000000000function a () {} console.log( a() ); rollup-3.29.4/test/form/samples/namespace-optimization/bar.js000066400000000000000000000000621450520414700242760ustar00rootroot00000000000000import * as quux from './quux'; export { quux }; rollup-3.29.4/test/form/samples/namespace-optimization/foo.js000066400000000000000000000000571450520414700243210ustar00rootroot00000000000000import * as bar from './bar'; export { bar }; rollup-3.29.4/test/form/samples/namespace-optimization/main.js000066400000000000000000000001001450520414700244470ustar00rootroot00000000000000import * as foo from './foo'; console.log( foo.bar.quux.a() ); rollup-3.29.4/test/form/samples/namespace-optimization/quux.js000066400000000000000000000000301450520414700245270ustar00rootroot00000000000000export function a () {} rollup-3.29.4/test/form/samples/namespace-reexport-name/000077500000000000000000000000001450520414700232365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-reexport-name/_config.js000066400000000000000000000002671450520414700252050ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses correct names when reexporting from namespace reexports (#4049)', options: { external: 'external', output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/namespace-reexport-name/_expected/000077500000000000000000000000001450520414700251765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-reexport-name/_expected/amd.js000066400000000000000000000011031450520414700262700ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); })); rollup-3.29.4/test/form/samples/namespace-reexport-name/_expected/cjs.js000066400000000000000000000010261450520414700263120ustar00rootroot00000000000000'use strict'; var external = require('external'); const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-3.29.4/test/form/samples/namespace-reexport-name/_expected/es.js000066400000000000000000000003431450520414700261430ustar00rootroot00000000000000import { indirectOverride } from 'external'; export * from 'external'; export { directOverride as renamedDirectOverride } from 'external'; const renamedIndirectOverride = indirectOverride; export { renamedIndirectOverride }; rollup-3.29.4/test/form/samples/namespace-reexport-name/_expected/iife.js000066400000000000000000000011201450520414700264420ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); return exports; })({}, external); rollup-3.29.4/test/form/samples/namespace-reexport-name/_expected/system.js000066400000000000000000000011341450520414700270570ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; var _starExcludes = { renamedIndirectOverride: 1, default: 1, renamedDirectOverride: 1 }; var indirectOverride; return { setters: [function (module) { indirectOverride = module.indirectOverride; var setter = { renamedDirectOverride: module.directOverride }; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { const renamedIndirectOverride = exports('renamedIndirectOverride', indirectOverride); }) }; })); rollup-3.29.4/test/form/samples/namespace-reexport-name/_expected/umd.js000066400000000000000000000016061450520414700263240ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); })); rollup-3.29.4/test/form/samples/namespace-reexport-name/external-reexport.js000066400000000000000000000000321450520414700272570ustar00rootroot00000000000000export * from 'external'; rollup-3.29.4/test/form/samples/namespace-reexport-name/main.js000066400000000000000000000001021450520414700245110ustar00rootroot00000000000000export * from './external-reexport'; export * from './overrides'; rollup-3.29.4/test/form/samples/namespace-reexport-name/overrides.js000066400000000000000000000003011450520414700255700ustar00rootroot00000000000000import { indirectOverride } from './external-reexport'; export { directOverride as renamedDirectOverride } from './external-reexport'; export const renamedIndirectOverride = indirectOverride; rollup-3.29.4/test/form/samples/namespace-self-import/000077500000000000000000000000001450520414700227115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-self-import/_config.js000066400000000000000000000002561450520414700246560ustar00rootroot00000000000000module.exports = defineTest({ description: 'namespace early import hoisting', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { output: { name: 'iife' } } }); rollup-3.29.4/test/form/samples/namespace-self-import/_expected/000077500000000000000000000000001450520414700246515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-self-import/_expected/amd.js000066400000000000000000000003311450520414700257450ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var self = /*#__PURE__*/Object.freeze({ __proto__: null, get p () { return p; } }); console.log(Object.keys(self)); var p = 5; exports.p = p; })); rollup-3.29.4/test/form/samples/namespace-self-import/_expected/cjs.js000066400000000000000000000002421450520414700257640ustar00rootroot00000000000000'use strict'; var self = /*#__PURE__*/Object.freeze({ __proto__: null, get p () { return p; } }); console.log(Object.keys(self)); var p = 5; exports.p = p; rollup-3.29.4/test/form/samples/namespace-self-import/_expected/es.js000066400000000000000000000002221450520414700256120ustar00rootroot00000000000000var self = /*#__PURE__*/Object.freeze({ __proto__: null, get p () { return p; } }); console.log(Object.keys(self)); var p = 5; export { p }; rollup-3.29.4/test/form/samples/namespace-self-import/_expected/iife.js000066400000000000000000000003461450520414700261260ustar00rootroot00000000000000var iife = (function (exports) { 'use strict'; var self = /*#__PURE__*/Object.freeze({ __proto__: null, get p () { return p; } }); console.log(Object.keys(self)); var p = 5; exports.p = p; return exports; })({}); rollup-3.29.4/test/form/samples/namespace-self-import/_expected/system.js000066400000000000000000000004301450520414700265300ustar00rootroot00000000000000System.register('iife', [], (function (exports) { 'use strict'; return { execute: (function () { var self = /*#__PURE__*/Object.freeze({ __proto__: null, get p () { return p; } }); console.log(Object.keys(self)); var p = exports('p', 5); }) }; })); rollup-3.29.4/test/form/samples/namespace-self-import/_expected/umd.js000066400000000000000000000007641450520414700260030ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.iife = {})); })(this, (function (exports) { 'use strict'; var self = /*#__PURE__*/Object.freeze({ __proto__: null, get p () { return p; } }); console.log(Object.keys(self)); var p = 5; exports.p = p; })); rollup-3.29.4/test/form/samples/namespace-self-import/main.js000066400000000000000000000001261450520414700241720ustar00rootroot00000000000000import * as self from './main.js'; console.log(Object.keys(self)); export var p = 5;rollup-3.29.4/test/form/samples/namespace-tostring/000077500000000000000000000000001450520414700223215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/000077500000000000000000000000001450520414700251045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/_config.js000066400000000000000000000003621450520414700270470ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not add Symbol.toStringTag property to entry chunks with default export mode', options: { output: { generatedCode: { symbols: true }, exports: 'default', name: 'bundle' } } }); rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/_expected/000077500000000000000000000000001450520414700270445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/_expected/amd.js000066400000000000000000000001231450520414700301370ustar00rootroot00000000000000define((function () { 'use strict'; var main = { foo: 42 }; return main; })); rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/_expected/cjs.js000066400000000000000000000000771450520414700301650ustar00rootroot00000000000000'use strict'; var main = { foo: 42 }; module.exports = main; rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/_expected/es.js000066400000000000000000000000651450520414700300120ustar00rootroot00000000000000var main = { foo: 42 }; export { main as default }; rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/_expected/iife.js000066400000000000000000000001331450520414700303130ustar00rootroot00000000000000var bundle = (function () { 'use strict'; var main = { foo: 42 }; return main; })(); rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/_expected/system.js000066400000000000000000000002461450520414700307300ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', { foo: 42 }); }) }; })); rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/_expected/umd.js000066400000000000000000000005701450520414700301710ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory()); })(this, (function () { 'use strict'; var main = { foo: 42 }; return main; })); rollup-3.29.4/test/form/samples/namespace-tostring/entry-default/main.js000066400000000000000000000000341450520414700263630ustar00rootroot00000000000000export default { foo: 42 }; rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/000077500000000000000000000000001450520414700245445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/_config.js000066400000000000000000000003421450520414700265050ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to entry chunks with named exports', options: { output: { generatedCode: { symbols: true }, exports: 'named', name: 'bundle' } } }); rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/_expected/000077500000000000000000000000001450520414700265045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/_expected/amd.js000066400000000000000000000003761450520414700276110ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 42; var main = 43; exports.default = main; exports.foo = foo; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); })); rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/_expected/cjs.js000066400000000000000000000003111450520414700276140ustar00rootroot00000000000000'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const foo = 42; var main = 43; exports.default = main; exports.foo = foo; rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/_expected/es.js000066400000000000000000000001011450520414700274410ustar00rootroot00000000000000const foo = 42; var main = 43; export { main as default, foo }; rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/_expected/iife.js000066400000000000000000000004151450520414700277560ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const foo = 42; var main = 43; exports.default = main; exports.foo = foo; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); return exports; })({}); rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/_expected/system.js000066400000000000000000000003001450520414700303570ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 42); var main = exports('default', 43); }) }; })); rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/_expected/umd.js000066400000000000000000000010331450520414700276240ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; const foo = 42; var main = 43; exports.default = main; exports.foo = foo; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); })); rollup-3.29.4/test/form/samples/namespace-tostring/entry-named/main.js000066400000000000000000000000521450520414700260230ustar00rootroot00000000000000export const foo = 42; export default 43; rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/000077500000000000000000000000001450520414700262605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/_config.js000066400000000000000000000012711450520414700302230ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to external namespaces', options: { external(id) { return id.startsWith('external'); }, output: { generatedCode: { symbols: true }, globals: { 'external-auto': 'externalAuto', 'external-default': 'externalDefault', 'external-defaultOnly': 'externalDefaultOnly' }, interop(id) { switch (id) { case 'external-auto': { return 'auto'; } case 'external-default': { return 'default'; } case 'external-defaultOnly': { return 'defaultOnly'; } default: { throw new Error(`Unexpected require "${id}"`); } } } } } }); rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/_expected/000077500000000000000000000000001450520414700302205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/_expected/amd.js000066400000000000000000000034761450520414700313310ustar00rootroot00000000000000define(['external-auto', 'external-default', 'external-defaultOnly'], (function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } function _interopNamespaceDefault(e) { var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); assert.strictEqual(externalAuto__namespace.foo, 42); assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); assert.strictEqual(externalDefault__namespace.foo, 42); assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); })); rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/_expected/cjs.js000066400000000000000000000034571450520414700313460ustar00rootroot00000000000000'use strict'; var externalAuto = require('external-auto'); var externalDefault = require('external-default'); var externalDefaultOnly = require('external-defaultOnly'); function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } function _interopNamespaceDefault(e) { var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); assert.strictEqual(externalAuto__namespace.foo, 42); assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); assert.strictEqual(externalDefault__namespace.foo, 42); assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/_expected/es.js000066400000000000000000000014201450520414700311620ustar00rootroot00000000000000import * as externalAuto from 'external-auto'; import * as externalDefault from 'external-default'; import * as externalDefaultOnly from 'external-defaultOnly'; assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); assert.strictEqual(externalAuto.foo, 42); assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); assert.strictEqual(externalDefault.foo, 42); assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/_expected/iife.js000066400000000000000000000034541450520414700315000ustar00rootroot00000000000000(function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } function _interopNamespaceDefault(e) { var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); assert.strictEqual(externalAuto__namespace.foo, 42); assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); assert.strictEqual(externalDefault__namespace.foo, 42); assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); })(externalAuto, externalDefault, externalDefaultOnly); rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/_expected/system.js000066400000000000000000000020231450520414700320770ustar00rootroot00000000000000System.register(['external-auto', 'external-default', 'external-defaultOnly'], (function () { 'use strict'; var externalAuto, externalDefault, externalDefaultOnly; return { setters: [function (module) { externalAuto = module; }, function (module) { externalDefault = module; }, function (module) { externalDefaultOnly = module; }], execute: (function () { assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); assert.strictEqual(externalAuto.foo, 42); assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); assert.strictEqual(externalDefault.foo, 42); assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); }) }; })); rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/_expected/umd.js000066400000000000000000000043371450520414700313520ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external-auto'), require('external-default'), require('external-defaultOnly')) : typeof define === 'function' && define.amd ? define(['external-auto', 'external-default', 'external-defaultOnly'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.externalAuto, global.externalDefault, global.externalDefaultOnly)); })(this, (function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: 'Module' })); } function _interopNamespaceDefault(e) { var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _interopNamespace (e) { return e && e.__esModule ? e : _interopNamespaceDefault(e); } var externalAuto__namespace = /*#__PURE__*/_interopNamespace(externalAuto); var externalDefault__namespace = /*#__PURE__*/_interopNamespaceDefault(externalDefault); var externalDefaultOnly__namespace = /*#__PURE__*/_interopNamespaceDefaultOnly(externalDefaultOnly); assert.strictEqual(externalAuto__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto__namespace), '[object Module]'); assert.strictEqual(externalAuto__namespace.foo, 42); assert.strictEqual(externalDefault__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault__namespace), '[object Module]'); assert.strictEqual(externalDefault__namespace.foo, 42); assert.strictEqual(externalDefaultOnly__namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly__namespace), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly__namespace.default, { foo: 42 }); })); rollup-3.29.4/test/form/samples/namespace-tostring/external-namespaces/main.js000066400000000000000000000014201450520414700275370ustar00rootroot00000000000000import * as externalAuto from 'external-auto'; import * as externalDefault from 'external-default'; import * as externalDefaultOnly from 'external-defaultOnly'; assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); assert.strictEqual(externalAuto.foo, 42); assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); assert.strictEqual(externalDefault.foo, 42); assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace-static-resolution/000077500000000000000000000000001450520414700313635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace-static-resolution/_config.js000066400000000000000000000003331450520414700333240ustar00rootroot00000000000000module.exports = defineTest({ description: 'statically resolves Symbol.toStringTag for inlined namespaces', expectedWarnings: ['MISSING_EXPORT'], options: { output: { generatedCode: { symbols: true } } } }); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace-static-resolution/_expected.js000066400000000000000000000000731450520414700336610ustar00rootroot00000000000000console.log('OK'); console.log('OK'); console.log('OK'); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace-static-resolution/foo.js000066400000000000000000000000271450520414700325030ustar00rootroot00000000000000export const bar = 42; rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace-static-resolution/main.js000066400000000000000000000003371450520414700326500ustar00rootroot00000000000000import * as foo from './foo'; if (foo[Symbol.toStringTag]) console.log('OK'); else console.log('FAIL'); if (foo.bar) console.log('OK'); else console.log('FAIL'); if (foo.foo) console.log('FAIL'); else console.log('OK'); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/000077500000000000000000000000001450520414700256755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/_config.js000066400000000000000000000002551450520414700276410ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to inlined namespaces', options: { output: { generatedCode: { symbols: true } } } }); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/_expected/000077500000000000000000000000001450520414700276355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/_expected/amd.js000066400000000000000000000005711450520414700307370ustar00rootroot00000000000000define((function () { 'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); })); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/_expected/cjs.js000066400000000000000000000005251450520414700307540ustar00rootroot00000000000000'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/_expected/es.js000066400000000000000000000005061450520414700306030ustar00rootroot00000000000000const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/_expected/iife.js000066400000000000000000000005641450520414700311140ustar00rootroot00000000000000(function () { 'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); })(); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/_expected/system.js000066400000000000000000000007041450520414700315200ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); }) }; })); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/_expected/umd.js000066400000000000000000000007271450520414700307660ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, bar: bar }, Symbol.toStringTag, { value: 'Module' })); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); })); rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/foo.js000066400000000000000000000000271450520414700270150ustar00rootroot00000000000000export const bar = 42; rollup-3.29.4/test/form/samples/namespace-tostring/inlined-namespace/main.js000066400000000000000000000003031450520414700271530ustar00rootroot00000000000000import * as foo from './foo'; assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(foo.bar, 42); rollup-3.29.4/test/form/samples/namespaced-default-exports/000077500000000000000000000000001450520414700237425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespaced-default-exports/_config.js000066400000000000000000000002011450520414700256750ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates namespaced module names', options: { output: { name: 'foo.bar.baz' } } }); rollup-3.29.4/test/form/samples/namespaced-default-exports/_expected/000077500000000000000000000000001450520414700257025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespaced-default-exports/_expected/amd.js000066400000000000000000000001121450520414700267730ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/namespaced-default-exports/_expected/cjs.js000066400000000000000000000000661450520414700270210ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/namespaced-default-exports/_expected/es.js000066400000000000000000000000541450520414700266460ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/namespaced-default-exports/_expected/iife.js000066400000000000000000000002261450520414700271540ustar00rootroot00000000000000this.foo = this.foo || {}; this.foo.bar = this.foo.bar || {}; this.foo.bar.baz = (function () { 'use strict'; var main = 42; return main; })(); rollup-3.29.4/test/form/samples/namespaced-default-exports/_expected/system.js000066400000000000000000000002421450520414700275620ustar00rootroot00000000000000System.register('foo.bar.baz', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/namespaced-default-exports/_expected/umd.js000066400000000000000000000006741450520414700270340ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.foo = global.foo || {}, global.foo.bar = global.foo.bar || {}, global.foo.bar.baz = factory())); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/namespaced-default-exports/main.js000066400000000000000000000000231450520414700252170ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/form/samples/namespaced-named-exports/000077500000000000000000000000001450520414700234025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespaced-named-exports/_config.js000066400000000000000000000002011450520414700253350ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates namespaced module names', options: { output: { name: 'foo.bar.baz' } } }); rollup-3.29.4/test/form/samples/namespaced-named-exports/_expected/000077500000000000000000000000001450520414700253425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespaced-named-exports/_expected/amd.js000066400000000000000000000001541450520414700264410ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var answer = 42; exports.answer = answer; })); rollup-3.29.4/test/form/samples/namespaced-named-exports/_expected/cjs.js000066400000000000000000000000721450520414700264560ustar00rootroot00000000000000'use strict'; var answer = 42; exports.answer = answer; rollup-3.29.4/test/form/samples/namespaced-named-exports/_expected/es.js000066400000000000000000000000451450520414700263060ustar00rootroot00000000000000var answer = 42; export { answer }; rollup-3.29.4/test/form/samples/namespaced-named-exports/_expected/iife.js000066400000000000000000000002771450520414700266220ustar00rootroot00000000000000this.foo = this.foo || {}; this.foo.bar = this.foo.bar || {}; this.foo.bar.baz = (function (exports) { 'use strict'; var answer = 42; exports.answer = answer; return exports; })({}); rollup-3.29.4/test/form/samples/namespaced-named-exports/_expected/system.js000066400000000000000000000002431450520414700272230ustar00rootroot00000000000000System.register('foo.bar.baz', [], (function (exports) { 'use strict'; return { execute: (function () { var answer = exports('answer', 42); }) }; })); rollup-3.29.4/test/form/samples/namespaced-named-exports/_expected/umd.js000066400000000000000000000007261450520414700264720ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.foo = global.foo || {}, global.foo.bar = global.foo.bar || {}, global.foo.bar.baz = {}))); })(this, (function (exports) { 'use strict'; var answer = 42; exports.answer = answer; })); rollup-3.29.4/test/form/samples/namespaced-named-exports/main.js000066400000000000000000000000301450520414700246550ustar00rootroot00000000000000export var answer = 42; rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/000077500000000000000000000000001450520414700245715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/_config.js000066400000000000000000000002111450520414700265250ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates namespaces with null prototypes', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/_expected/000077500000000000000000000000001450520414700265315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/_expected/amd.js000066400000000000000000000004461450520414700276340ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; })); rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/_expected/cjs.js000066400000000000000000000003521450520414700276460ustar00rootroot00000000000000'use strict'; const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/_expected/es.js000066400000000000000000000003161450520414700274760ustar00rootroot00000000000000const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; export { a, b }; rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/_expected/iife.js000066400000000000000000000004671450520414700300120ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; return exports; })({}); rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/_expected/system.js000066400000000000000000000005571450520414700304220ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); console.log( Object.keys( namespace ) ); const a = exports('a', 1); const b = exports('b', 2); }) }; })); rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/_expected/umd.js000066400000000000000000000011051450520414700276510ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {})); })(this, (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, bar: bar, foo: foo }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; })); rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/main.js000066400000000000000000000002001450520414700260430ustar00rootroot00000000000000import * as namespace from './namespace.js'; console.log( Object.keys( namespace ) ); export const a = 1; export const b = 2; rollup-3.29.4/test/form/samples/namespaces-have-null-prototype/namespace.js000066400000000000000000000000531450520414700270610ustar00rootroot00000000000000export const foo = 1; export const bar = 2;rollup-3.29.4/test/form/samples/nested-deoptimization/000077500000000000000000000000001450520414700230355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/nested-deoptimization/_config.js000066400000000000000000000001361450520414700247770ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles deoptimization of nested properties' }); rollup-3.29.4/test/form/samples/nested-deoptimization/_expected.js000066400000000000000000000003651450520414700253370ustar00rootroot00000000000000const obj = { foo: { prop: true }, bar: { otherProp: true }, prop: true }; obj[globalThis.unknown].prop = false; if (obj.foo.prop) console.log('retained'); else console.log('also retained'); console.log('retained'); console.log('retained'); rollup-3.29.4/test/form/samples/nested-deoptimization/main.js000066400000000000000000000005241450520414700243200ustar00rootroot00000000000000const obj = { foo: { prop: true }, bar: { otherProp: true }, prop: true }; obj[globalThis.unknown].prop = false; if (obj.foo.prop) console.log('retained'); else console.log('also retained'); if (obj.bar.otherProp) console.log('retained'); else console.log('removed'); if (obj.prop) console.log('retained'); else console.log('removed'); rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/000077500000000000000000000000001450520414700243525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/_config.js000066400000000000000000000002511450520414700263120ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts variables when nested dynamic imports are inlined', options: { output: { inlineDynamicImports: true } } }); rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/_expected/000077500000000000000000000000001450520414700263125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/_expected/amd.js000066400000000000000000000004611450520414700274120ustar00rootroot00000000000000define((function () { 'use strict'; async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); })); rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/_expected/cjs.js000066400000000000000000000004121450520414700274240ustar00rootroot00000000000000'use strict'; async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/_expected/es.js000066400000000000000000000003731450520414700272620ustar00rootroot00000000000000async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/_expected/iife.js000066400000000000000000000004541450520414700275670ustar00rootroot00000000000000(function () { 'use strict'; async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); })(); rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/_expected/system.js000066400000000000000000000006021450520414700301720ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); }) }; })); rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/_expected/umd.js000066400000000000000000000006171450520414700274410ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; async function main() { const foo$1 = 1; const ns = await Promise.resolve().then(function () { return foo; }); console.log(ns.value + foo$1); } main(); const value = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); })); rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/foo.js000066400000000000000000000000311450520414700254650ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/form/samples/nested-inlined-dynamic-import/main.js000066400000000000000000000001671450520414700256400ustar00rootroot00000000000000async function main() { const foo = 1; const ns = await import('./foo.js'); console.log(ns.value + foo); } main(); rollup-3.29.4/test/form/samples/nested-member-access/000077500000000000000000000000001450520414700225045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/nested-member-access/_config.js000066400000000000000000000001551450520414700244470ustar00rootroot00000000000000module.exports = defineTest({ description: 'throw an error when accessing members of null or undefined' }); rollup-3.29.4/test/form/samples/nested-member-access/_expected.js000066400000000000000000000005361450520414700250060ustar00rootroot00000000000000const retained1 = {}; retained1.foo.bar; const retained2 = new function () {}(); retained2.foo.bar; const retained3 = void {}; retained3.foo; const retained4b = undefined; retained4b.foo; const retained5 = 1 + 2; retained5.foo.bar; const retained6 = class {}; retained6.foo.bar; let retained7 = 3; (retained7++).foo.bar; globalThis.unknown .x; rollup-3.29.4/test/form/samples/nested-member-access/main.js000066400000000000000000000016561450520414700237760ustar00rootroot00000000000000const removed1 = {}; const removedResult1 = removed1.foo; const removed2 = { foo: {} }; const removedResult2 = removed2.foo.bar; const removed4 = !{}; const removedResult4 = removed4.foo; const removed6 = 1 + 2; const removedResult6 = removed6.foo; const removed7 = class {}; const removedResult7 = removed7.foo; let removed8 = 3; const removedResult8 = (removed8++).foo; const retained1 = {}; const retainedResult1 = retained1.foo.bar; const retained2 = new function () {}(); const retainedResult2 = retained2.foo.bar; const retained3 = void {}; const retainedResult3 = retained3.foo; let removed4a; const retained4b = removed4a = undefined; const retainedResult4 = retained4b.foo; const retained5 = 1 + 2; const retainedResult5 = retained5.foo.bar; const retained6 = class {}; const retainedResult6 = retained6.foo.bar; let retained7 = 3; const retainedResult7 = (retained7++).foo.bar; const retained8 = globalThis.unknown .x; rollup-3.29.4/test/form/samples/nested-pure-comments/000077500000000000000000000000001450520414700225745ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/nested-pure-comments/_config.js000066400000000000000000000001661450520414700245410ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly associates pure comments before sequence expressions etc.' }); rollup-3.29.4/test/form/samples/nested-pure-comments/_expected.js000066400000000000000000000003611450520414700250720ustar00rootroot00000000000000// Sequence expression (keep()); keep(); const foo = (/*@__PURE__*/keep()); // Conditional expression (keep() ? 1 : 2); keep(); // Logical expression (keep() || 1); keep(); // Binary expression (keep() / 1); 1 / keep(); export { foo }; rollup-3.29.4/test/form/samples/nested-pure-comments/main.js000066400000000000000000000013571450520414700240640ustar00rootroot00000000000000// Sequence expression /*@__PURE__*/(keep(), /*@__PURE__*/remove()); /*@__PURE__*/remove(), keep(), /*@__PURE__*/remove(); /*@__PURE__*/remove(), /*@__PURE__*/remove(); export const foo = /*@__PURE__*/(/*@__PURE__*/remove(), /*@__PURE__*/keep()); // Conditional expression /*@__PURE__*/(keep() ? 1 : 2); /*@__PURE__*/remove() ? /*@__PURE__*/remove() : /*@__PURE__*/remove(); false ? 1 /*@__PURE__*/ : keep(); // Logical expression /*@__PURE__*/(keep() || 1); /*@__PURE__*/remove() || /*@__PURE__*/remove(); false /*@__PURE__*/ || keep(); // Binary expression /* @__PURE__ */(keep() / 1); /* @__PURE__ */remove() / /* @__PURE__ */remove(); 1 /* @__PURE__ */ / keep(); // Calls with parentheses /*@__PURE__*/(remove()); /*@__PURE__*/(new Remove()); rollup-3.29.4/test/form/samples/nested-this-expressions/000077500000000000000000000000001450520414700233255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/nested-this-expressions/_config.js000066400000000000000000000001441450520414700252660ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly keep or ignore nested "this"-expressions' }); rollup-3.29.4/test/form/samples/nested-this-expressions/_expected.js000066400000000000000000000006451450520414700256300ustar00rootroot00000000000000function mutateThis () { this.x = 1; } mutateThis(); function mutateNestedThis () { const mutateNested = () => this.bar = 1; mutateNested(); } mutateNestedThis(); function mutateThisConditionally () { if ( globalThis.condition ) { this.baz = 1; } } mutateThisConditionally(); function CallSelfWithoutNew () { this.quux = 1; if ( globalThis.condition ) { CallSelfWithoutNew(); } } new CallSelfWithoutNew(); rollup-3.29.4/test/form/samples/nested-this-expressions/main.js000066400000000000000000000015121450520414700246060ustar00rootroot00000000000000function NoEffectsDeclaration () { this.foo = 1; const mutateNested = () => this.bar = 1; mutateNested(); if ( globalThis.condition ) { this.baz = 1; } } const a = new NoEffectsDeclaration(); const NoEffectsExpression = function () { this.foo = 1; const mutateNested = () => this.bar = 1; mutateNested(); if ( globalThis.condition ) { this.baz = 1; } }; const b = new NoEffectsExpression(); function mutateThis () { this.x = 1; } mutateThis(); function mutateNestedThis () { const mutateNested = () => this.bar = 1; mutateNested(); } mutateNestedThis(); function mutateThisConditionally () { if ( globalThis.condition ) { this.baz = 1; } } mutateThisConditionally(); function CallSelfWithoutNew () { this.quux = 1; if ( globalThis.condition ) { CallSelfWithoutNew(); } } const c = new CallSelfWithoutNew(); rollup-3.29.4/test/form/samples/nested-tree-shaking/000077500000000000000000000000001450520414700223575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/nested-tree-shaking/_config.js000066400000000000000000000001231450520414700243150ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes unused nested statements' }); rollup-3.29.4/test/form/samples/nested-tree-shaking/_expected.js000066400000000000000000000001741450520414700246570ustar00rootroot00000000000000function withEffects() { console.log('effect'); } if (globalThis.unknown > 0) { console.log('effect'); withEffects(); } rollup-3.29.4/test/form/samples/nested-tree-shaking/foo.js000066400000000000000000000002101450520414700234710ustar00rootroot00000000000000export function noEffects() { const foo = () => {}; foo(); } export function withEffects() { noEffects(); console.log('effect'); } rollup-3.29.4/test/form/samples/nested-tree-shaking/main.js000066400000000000000000000002671450520414700236460ustar00rootroot00000000000000import {noEffects, withEffects} from './foo.js'; if (globalThis.unknown > 0) { noEffects(); } if (globalThis.unknown > 0) { console.log('effect'); noEffects(); withEffects(); } rollup-3.29.4/test/form/samples/new-target-meta-property/000077500000000000000000000000001450520414700234015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/new-target-meta-property/_config.js000066400000000000000000000001301450520414700253350ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports the new.target meta property' }); rollup-3.29.4/test/form/samples/new-target-meta-property/_expected/000077500000000000000000000000001450520414700253415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/new-target-meta-property/_expected/amd.js000066400000000000000000000001771450520414700264450ustar00rootroot00000000000000define((function () { 'use strict'; class Foo { constructor() { console.log(new.target.name); } } new Foo(); })); rollup-3.29.4/test/form/samples/new-target-meta-property/_expected/cjs.js000066400000000000000000000001351450520414700264550ustar00rootroot00000000000000'use strict'; class Foo { constructor() { console.log(new.target.name); } } new Foo(); rollup-3.29.4/test/form/samples/new-target-meta-property/_expected/es.js000066400000000000000000000001161450520414700263040ustar00rootroot00000000000000class Foo { constructor() { console.log(new.target.name); } } new Foo(); rollup-3.29.4/test/form/samples/new-target-meta-property/_expected/iife.js000066400000000000000000000001721450520414700266130ustar00rootroot00000000000000(function () { 'use strict'; class Foo { constructor() { console.log(new.target.name); } } new Foo(); })(); rollup-3.29.4/test/form/samples/new-target-meta-property/_expected/system.js000066400000000000000000000003061450520414700272220ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { class Foo { constructor() { console.log(new.target.name); } } new Foo(); }) }; })); rollup-3.29.4/test/form/samples/new-target-meta-property/_expected/umd.js000066400000000000000000000003351450520414700264650ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; class Foo { constructor() { console.log(new.target.name); } } new Foo(); })); rollup-3.29.4/test/form/samples/new-target-meta-property/main.js000066400000000000000000000001721450520414700246630ustar00rootroot00000000000000class Foo { constructor() { console.log(new.target.name); const unused = new.target.name; } } const x = new Foo(); rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/000077500000000000000000000000001450520414700251265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/_config.js000066400000000000000000000005441450520414700270730ustar00rootroot00000000000000module.exports = defineTest({ description: 'Allows omitting the code that handles external live bindings in compact mode', options: { external: () => true, output: { globals: { external1: 'external1', external2: 'external2' }, compact: true, externalLiveBindings: false, name: 'bundle', dynamicImportInCjs: false } } }); rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/_expected/000077500000000000000000000000001450520414700270665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/_expected/amd.js000066400000000000000000000010761450520414700301710ustar00rootroot00000000000000define(['require','exports','external1','external2'],(function(require,exports,external1,external2){'use strict';function _interopNamespaceDefault(e){var n=Object.create(null);if(e){for(var k in e){n[k]=e[k];}}n.default=e;return Object.freeze(n)}const dynamic = new Promise(function(c,e){require(['external3'],function(m){c(/*#__PURE__*/_interopNamespaceDefault(m))},e)});exports.external1=external1.external1;exports.dynamic=dynamic;Object.keys(external2).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))exports[k]=external2[k]});}));rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/_expected/cjs.js000066400000000000000000000010211450520414700301750ustar00rootroot00000000000000'use strict';var external1=require('external1'),external2=require('external2');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){for(var k in e){n[k]=e[k];}}n.default=e;return Object.freeze(n)}const dynamic = Promise.resolve().then(function(){return /*#__PURE__*/_interopNamespaceDefault(require('external3'))});exports.external1=external1.external1;exports.dynamic=dynamic;Object.keys(external2).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))exports[k]=external2[k]});rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/_expected/es.js000066400000000000000000000001541450520414700300330ustar00rootroot00000000000000export{external1}from'external1';export*from'external2';const dynamic = import('external3');export{dynamic};rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/_expected/iife.js000066400000000000000000000005231450520414700303400ustar00rootroot00000000000000var bundle=(function(exports,external1,external2){'use strict';const dynamic = import('external3');exports.external1=external1.external1;exports.dynamic=dynamic;Object.keys(external2).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))exports[k]=external2[k]});return exports;})({},external1,external2);rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/_expected/system.js000066400000000000000000000006551450520414700307560ustar00rootroot00000000000000System.register('bundle',['external1','external2'],(function(exports,module){'use strict';var _starExcludes={dynamic:1,default:1,external1:1};return{setters:[function(module){exports('external1',module.external1);},function(module){var setter={};for(var name in module){if(!_starExcludes[name])setter[name]=module[name];}exports(setter);}],execute:(function(){const dynamic = exports('dynamic',module.import('external3'));})}}));rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/_expected/umd.js000066400000000000000000000011301450520414700302040ustar00rootroot00000000000000(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('external1'),require('external2')):typeof define==='function'&&define.amd?define(['exports','external1','external2'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.bundle={},g.external1,g.external2));})(this,(function(exports,external1,external2){'use strict';const dynamic = import('external3');exports.external1=external1.external1;exports.dynamic=dynamic;Object.keys(external2).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))exports[k]=external2[k]});}));rollup-3.29.4/test/form/samples/no-external-live-bindings-compact/main.js000066400000000000000000000001561450520414700264120ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; export const dynamic = import('external3'); rollup-3.29.4/test/form/samples/no-external-live-bindings/000077500000000000000000000000001450520414700235025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-external-live-bindings/_config.js000066400000000000000000000005021450520414700254410ustar00rootroot00000000000000module.exports = defineTest({ description: 'Allows omitting the code that handles external live bindings', options: { external: () => true, output: { globals: { external1: 'external1', external2: 'external2' }, externalLiveBindings: false, name: 'bundle', dynamicImportInCjs: false } } }); rollup-3.29.4/test/form/samples/no-external-live-bindings/_expected/000077500000000000000000000000001450520414700254425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-external-live-bindings/_expected/amd.js000066400000000000000000000012721450520414700265430ustar00rootroot00000000000000define(['require', 'exports', 'external1', 'external2'], (function (require, exports, external1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { for (var k in e) { n[k] = e[k]; } } n.default = e; return Object.freeze(n); } const dynamic = new Promise(function (resolve, reject) { require(['external3'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); exports.external1 = external1.external1; exports.dynamic = dynamic; Object.keys(external2).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = external2[k]; }); })); rollup-3.29.4/test/form/samples/no-external-live-bindings/_expected/cjs.js000066400000000000000000000011361450520414700265600ustar00rootroot00000000000000'use strict'; var external1 = require('external1'); var external2 = require('external2'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { for (var k in e) { n[k] = e[k]; } } n.default = e; return Object.freeze(n); } const dynamic = Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefault(require('external3')); }); exports.external1 = external1.external1; exports.dynamic = dynamic; Object.keys(external2).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = external2[k]; }); rollup-3.29.4/test/form/samples/no-external-live-bindings/_expected/es.js000066400000000000000000000001751450520414700264120ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; const dynamic = import('external3'); export { dynamic }; rollup-3.29.4/test/form/samples/no-external-live-bindings/_expected/iife.js000066400000000000000000000006021450520414700267120ustar00rootroot00000000000000var bundle = (function (exports, external1, external2) { 'use strict'; const dynamic = import('external3'); exports.external1 = external1.external1; exports.dynamic = dynamic; Object.keys(external2).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = external2[k]; }); return exports; })({}, external1, external2); rollup-3.29.4/test/form/samples/no-external-live-bindings/_expected/system.js000066400000000000000000000010201450520414700273150ustar00rootroot00000000000000System.register('bundle', ['external1', 'external2'], (function (exports, module) { 'use strict'; var _starExcludes = { dynamic: 1, default: 1, external1: 1 }; return { setters: [function (module) { exports('external1', module.external1); }, function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { const dynamic = exports('dynamic', module.import('external3')); }) }; })); rollup-3.29.4/test/form/samples/no-external-live-bindings/_expected/umd.js000066400000000000000000000013441450520414700265670ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external1'), require('external2')) : typeof define === 'function' && define.amd ? define(['exports', 'external1', 'external2'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external1, global.external2)); })(this, (function (exports, external1, external2) { 'use strict'; const dynamic = import('external3'); exports.external1 = external1.external1; exports.dynamic = dynamic; Object.keys(external2).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = external2[k]; }); })); rollup-3.29.4/test/form/samples/no-external-live-bindings/main.js000066400000000000000000000001561450520414700247660ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; export const dynamic = import('external3'); rollup-3.29.4/test/form/samples/no-imports-or-exports/000077500000000000000000000000001450520414700227455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-imports-or-exports/_config.js000066400000000000000000000001271450520414700247070ustar00rootroot00000000000000module.exports = defineTest({ description: 'single module, no imports or exports' }); rollup-3.29.4/test/form/samples/no-imports-or-exports/_expected/000077500000000000000000000000001450520414700247055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-imports-or-exports/_expected/amd.js000066400000000000000000000001111450520414700257750ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 'this is it' ); })); rollup-3.29.4/test/form/samples/no-imports-or-exports/_expected/cjs.js000066400000000000000000000000541450520414700260210ustar00rootroot00000000000000'use strict'; console.log( 'this is it' ); rollup-3.29.4/test/form/samples/no-imports-or-exports/_expected/es.js000066400000000000000000000000351450520414700256500ustar00rootroot00000000000000console.log( 'this is it' ); rollup-3.29.4/test/form/samples/no-imports-or-exports/_expected/iife.js000066400000000000000000000001041450520414700261520ustar00rootroot00000000000000(function () { 'use strict'; console.log( 'this is it' ); })(); rollup-3.29.4/test/form/samples/no-imports-or-exports/_expected/system.js000066400000000000000000000002061450520414700265650ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 'this is it' ); }) }; })); rollup-3.29.4/test/form/samples/no-imports-or-exports/_expected/umd.js000066400000000000000000000002471450520414700260330ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 'this is it' ); })); rollup-3.29.4/test/form/samples/no-imports-or-exports/main.js000066400000000000000000000000351450520414700242250ustar00rootroot00000000000000console.log( 'this is it' ); rollup-3.29.4/test/form/samples/no-side-effects-function-declaration-preserve/000077500000000000000000000000001450520414700274305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-side-effects-function-declaration-preserve/_config.js000066400000000000000000000003731450520414700313750ustar00rootroot00000000000000// tests compiled from https://github.com/mishoo/UglifyJS2/blob/88c8f4e363e0d585b33ea29df560243d3dc74ce1/test/compress/pure_funcs.js module.exports = defineTest({ description: 'preserve __NO_SIDE_EFFECTS__ annotations for function declarations' }); rollup-3.29.4/test/form/samples/no-side-effects-function-declaration-preserve/_expected.js000066400000000000000000000022451450520414700317310ustar00rootroot00000000000000/*#__NO_SIDE_EFFECTS__*/ function fnFromSub (args) { console.log(args); return args } function fnPure(args) { return args } function fnEffects(args) { console.log(args); return args } /*#__NO_SIDE_EFFECTS__*/ function fnA (args) { console.log(args); return args } /*#__NO_SIDE_EFFECTS__*/ function fnB (args) { console.log(args); return args } const fnC = /*#__NO_SIDE_EFFECTS__*/ (args) => { console.log(args); return args }; /*#__NO_SIDE_EFFECTS__*/ const fnD = (args) => { console.log(args); return args }; /*#__NO_SIDE_EFFECTS__*/ const fnE = (args) => { console.log(args); return args }; /** * This is a jsdoc comment, with no side effects annotation * * @param {any} args * @__NO_SIDE_EFFECTS__ */ const fnF = (args) => { console.log(args); return args }; const fnAlias = fnA; /** * Have both annotations * * @__PURE__ * @__NO_SIDE_EFFECTS__ */ const fnBothAnnotations = (args) => { console.log(args); return args }; // This annonation get ignored let fnLet = (args) => { console.log(args); return args }; export { fnA, fnAlias, fnB, fnBothAnnotations, fnC, fnD, fnE, fnEffects, fnF, fnFromSub, fnLet, fnPure }; rollup-3.29.4/test/form/samples/no-side-effects-function-declaration-preserve/functions.js000066400000000000000000000023221450520414700317750ustar00rootroot00000000000000export function fnPure(args) { return args } export function fnEffects(args) { console.log(args) return args } /*#__NO_SIDE_EFFECTS__*/ function fnA (args) { console.log(args) return args } export { fnA } /*#__NO_SIDE_EFFECTS__*/ export function fnB (args) { console.log(args) return args } export const fnC = /*#__NO_SIDE_EFFECTS__*/ (args) => { console.log(args) return args } /*#__NO_SIDE_EFFECTS__*/ const fnD = (args) => { console.log(args) return args } export { fnD } /*#__NO_SIDE_EFFECTS__*/ export const fnE = (args) => { console.log(args) return args } /** * This is a jsdoc comment, with no side effects annotation * * @param {any} args * @__NO_SIDE_EFFECTS__ */ export const fnF = (args) => { console.log(args) return args } /*#__NO_SIDE_EFFECTS__*/ export default function fnDefault(args) { console.log(args) return args } export * from './sub-functions' export const fnAlias = fnA /** * Have both annotations * * @__PURE__ * @__NO_SIDE_EFFECTS__ */ export const fnBothAnnotations = (args) => { console.log(args) return args } // This annonation get ignored /** @__NO_SIDE_EFFECTS__ */ export let fnLet = (args) => { console.log(args) return args } rollup-3.29.4/test/form/samples/no-side-effects-function-declaration-preserve/main.js000066400000000000000000000000341450520414700307070ustar00rootroot00000000000000export * from './functions' rollup-3.29.4/test/form/samples/no-side-effects-function-declaration-preserve/sub-functions.js000066400000000000000000000001401450520414700325600ustar00rootroot00000000000000/*#__NO_SIDE_EFFECTS__*/ export function fnFromSub (args) { console.log(args) return args } rollup-3.29.4/test/form/samples/no-side-effects-function-declaration/000077500000000000000000000000001450520414700255775ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-side-effects-function-declaration/_config.js000066400000000000000000000003621450520414700275420ustar00rootroot00000000000000// tests compiled from https://github.com/mishoo/UglifyJS2/blob/88c8f4e363e0d585b33ea29df560243d3dc74ce1/test/compress/pure_funcs.js module.exports = defineTest({ description: '__NO_SIDE_EFFECTS__ annotations for function declarations' }); rollup-3.29.4/test/form/samples/no-side-effects-function-declaration/_expected.js000066400000000000000000000001171450520414700300740ustar00rootroot00000000000000function fnEffects(args) { console.log(args); return args } fnEffects(2); rollup-3.29.4/test/form/samples/no-side-effects-function-declaration/functions.js000066400000000000000000000026501450520414700301500ustar00rootroot00000000000000export function fnPure(args) { return args } export function fnEffects(args) { console.log(args) return args } /*#__NO_SIDE_EFFECTS__*/ function fnA (args) { console.log(args) return args } export { fnA } /*#__NO_SIDE_EFFECTS__*/ export function fnB (args) { console.log(args) return args } export const fnC = /*#__NO_SIDE_EFFECTS__*/ (args) => { console.log(args) return args } /*#__NO_SIDE_EFFECTS__*/ const fnD = (args) => { console.log(args) return args } export { fnD } /*#__NO_SIDE_EFFECTS__*/ export const fnE = (args) => { console.log(args) return args } /** * This is a jsdoc comment, with pure annotation * * @param {any} args * @__NO_SIDE_EFFECTS__ */ export const fnF = (args) => { console.log(args) return args } // #__NO_SIDE_EFFECTS__ export async function fnG(args) { console.log(args) return args } /** * #__NO_SIDE_EFFECTS__ */ export const fnH = async (args) => { console.log(args) return args } export const fnI = /*#__NO_SIDE_EFFECTS__*/ async (args) => { console.log(args) return args } /** * #__NO_SIDE_EFFECTS__ */ export function * fnJ(args) { console.log(args) return args } /** * #__NO_SIDE_EFFECTS__ */ export async function * fnK(args) { console.log(args) return args } /*#__NO_SIDE_EFFECTS__*/ export default function fnDefault(args) { console.log(args) return args } export * from './sub-functions' export const fnAlias = fnA rollup-3.29.4/test/form/samples/no-side-effects-function-declaration/main.js000066400000000000000000000007351450520414700270660ustar00rootroot00000000000000import fnDefault, { fnPure, fnEffects, fnA, fnB, fnC, fnD, fnE, fnF, fnI, fnG, fnJ, fnK, fnAlias, fnFromSub } from './functions' const pure = fnPure(1) const effects = fnEffects(2) const a = fnA(1) const b = fnB(2) const c = fnC(3) const d = fnD(4) const e = fnE(5) const f = fnF(6) const g = fnG(7) const i = fnI(8) const j = fnJ(9) const k = fnK(10) const defaults = fnDefault(3) const alias = fnAlias(6) const fromSub = fnFromSub(7) const _ = /*#__PURE__*/ fnEffects(1) rollup-3.29.4/test/form/samples/no-side-effects-function-declaration/sub-functions.js000066400000000000000000000001401450520414700307270ustar00rootroot00000000000000/*#__NO_SIDE_EFFECTS__*/ export function fnFromSub (args) { console.log(args) return args } rollup-3.29.4/test/form/samples/no-treeshake-conflict/000077500000000000000000000000001450520414700227025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-treeshake-conflict/_config.js000066400000000000000000000003111450520414700246370ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not introduce conflicting variables with treeshake: false', options: { output: { name: /* not shaken, but */ 'stirred' }, treeshake: false } }); rollup-3.29.4/test/form/samples/no-treeshake-conflict/_expected/000077500000000000000000000000001450520414700246425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-treeshake-conflict/_expected/amd.js000066400000000000000000000002041450520414700257350ustar00rootroot00000000000000define((function () { 'use strict'; const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; })); rollup-3.29.4/test/form/samples/no-treeshake-conflict/_expected/cjs.js000066400000000000000000000001421450520414700257540ustar00rootroot00000000000000'use strict'; const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; rollup-3.29.4/test/form/samples/no-treeshake-conflict/_expected/es.js000066400000000000000000000001231450520414700256030ustar00rootroot00000000000000const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; rollup-3.29.4/test/form/samples/no-treeshake-conflict/_expected/iife.js000066400000000000000000000001771450520414700261210ustar00rootroot00000000000000(function () { 'use strict'; const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; })(); rollup-3.29.4/test/form/samples/no-treeshake-conflict/_expected/system.js000066400000000000000000000003261450520414700265250ustar00rootroot00000000000000System.register('stirred', [], (function () { 'use strict'; return { execute: (function () { const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; }) }; })); rollup-3.29.4/test/form/samples/no-treeshake-conflict/_expected/umd.js000066400000000000000000000003421450520414700257640ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; })); rollup-3.29.4/test/form/samples/no-treeshake-conflict/main.js000066400000000000000000000001201450520414700241550ustar00rootroot00000000000000import somethingElse from './other'; const other = { somethingElse: 'here' }; rollup-3.29.4/test/form/samples/no-treeshake-conflict/other.js000066400000000000000000000000741450520414700243620ustar00rootroot00000000000000const other = { something: 'here' }; export default other;rollup-3.29.4/test/form/samples/no-treeshake-default-export-conflict/000077500000000000000000000000001450520414700256435ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-treeshake-default-export-conflict/_config.js000066400000000000000000000002201450520414700275770ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly deconflicts default exports when not tree-shaking', options: { treeshake: false } }); rollup-3.29.4/test/form/samples/no-treeshake-default-export-conflict/_expected.js000066400000000000000000000001131450520414700301340ustar00rootroot00000000000000function foo() { return 'foo'; } function foo$1() { return 'default'; } rollup-3.29.4/test/form/samples/no-treeshake-default-export-conflict/foo.js000066400000000000000000000001331450520414700267610ustar00rootroot00000000000000export function foo() { return 'foo'; } export default function() { return 'default'; } rollup-3.29.4/test/form/samples/no-treeshake-default-export-conflict/main.js000066400000000000000000000000201450520414700271150ustar00rootroot00000000000000import './foo'; rollup-3.29.4/test/form/samples/no-treeshake-include-labels/000077500000000000000000000000001450520414700237645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-treeshake-include-labels/_config.js000066400000000000000000000003001450520414700257170ustar00rootroot00000000000000module.exports = defineTest({ description: 'always includes labels when tree-shaking is turned off (#3473)', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { treeshake: false } }); rollup-3.29.4/test/form/samples/no-treeshake-include-labels/_expected.js000066400000000000000000000003061450520414700262610ustar00rootroot00000000000000function foo() { loop: while (unknown) { if (unknown) { break loop; } bar(); } } function bar() { loop: while (unknown) { if (unknown) { break loop; } foo(); } } unused: { } rollup-3.29.4/test/form/samples/no-treeshake-include-labels/dep1.js000066400000000000000000000002111450520414700251450ustar00rootroot00000000000000import foo from './dep2.js'; export default function bar() { loop: while (unknown) { if (unknown) { break loop; } foo(); } } rollup-3.29.4/test/form/samples/no-treeshake-include-labels/dep2.js000066400000000000000000000002111450520414700251460ustar00rootroot00000000000000import bar from './dep1.js'; export default function foo() { loop: while (unknown) { if (unknown) { break loop; } bar(); } } rollup-3.29.4/test/form/samples/no-treeshake-include-labels/main.js000066400000000000000000000000411450520414700252410ustar00rootroot00000000000000import './dep1.js'; unused: { } rollup-3.29.4/test/form/samples/no-treeshake-namespace-object/000077500000000000000000000000001450520414700243015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-treeshake-namespace-object/_config.js000066400000000000000000000002071450520414700262420ustar00rootroot00000000000000module.exports = defineTest({ description: 'generates namespace objects when not tree-shaking', options: { treeshake: false } }); rollup-3.29.4/test/form/samples/no-treeshake-namespace-object/_expected.js000066400000000000000000000002611450520414700265760ustar00rootroot00000000000000function foo() {} var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); const a = 1; const b = 2; export { a, b, namespace as ns1, namespace as ns2 }; rollup-3.29.4/test/form/samples/no-treeshake-namespace-object/main.js000066400000000000000000000002031450520414700255560ustar00rootroot00000000000000import * as ns1 from './namespace'; export { ns1 }; export * as ns2 from './namespace'; export const a = 1; export const b = 2; rollup-3.29.4/test/form/samples/no-treeshake-namespace-object/namespace.js000066400000000000000000000000311450520414700265650ustar00rootroot00000000000000export function foo() {} rollup-3.29.4/test/form/samples/no-treeshake/000077500000000000000000000000001450520414700211035ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/no-treeshake/_config.js000066400000000000000000000004461450520414700230510ustar00rootroot00000000000000module.exports = defineTest({ description: 'all code should be included if tree-shaking is disabled', options: { external: ['external'], treeshake: false, output: { globals: { external: 'external' }, name: /* not shaken, but */ 'stirred', inlineDynamicImports: true } } }); rollup-3.29.4/test/form/samples/no-treeshake/_expected.js000066400000000000000000000020571450520414700234050ustar00rootroot00000000000000import * as external from 'external'; var foo = 13; const quux = 1; const other = () => quux; function baz() { return foo + external.value; } var create = Object.create, getPrototypeOf = Object.getPrototypeOf; function unusedButIncluded() { const unusedConst = 'unused'; if (true) { true ? 'first' : 'second'; } else { (true && 'first') || 'second'; } if (false) { 'first'; } else { 'second'; } 'sequence', 'expression'; switch ('test') { case 'test': (() => {})(); case 'other': 'no effect'; default: const ignored = 2; } } function test( unusedParam = { prop: function test() { var unused = 1; } } ) {} test({ prop: function test() { var unused = 1; } }); try { const x = 1; } catch {} const { fred: fred$1 } = await Promise.resolve().then(function () { return dynamicImported$1; }); const fred = 1; var dynamicImported = () => fred; var dynamicImported$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: dynamicImported, fred: fred }); export { create, getPrototypeOf, quux, quux as strange }; rollup-3.29.4/test/form/samples/no-treeshake/dynamic-imported.js000066400000000000000000000000631450520414700247050ustar00rootroot00000000000000export const fred = 1; export default () => fred; rollup-3.29.4/test/form/samples/no-treeshake/foo.js000066400000000000000000000000231450520414700222170ustar00rootroot00000000000000export default 13; rollup-3.29.4/test/form/samples/no-treeshake/main.js000066400000000000000000000015241450520414700223670ustar00rootroot00000000000000import * as external from 'external'; import foo from './foo.js'; export { quux as strange } from './quux.js'; export * from './quux.js'; function baz() { return foo + external.value; } export var create = Object.create, getPrototypeOf = Object.getPrototypeOf; function unusedButIncluded() { const unusedConst = 'unused'; if (true) { true ? 'first' : 'second'; } else { (true && 'first') || 'second'; } if (false) { 'first'; } else { 'second'; } 'sequence', 'expression'; switch ('test') { case 'test': (() => {})(); case 'other': 'no effect'; default: const ignored = 2; } } function test( unusedParam = { prop: function test() { var unused = 1; } } ) {} test({ prop: function test() { var unused = 1; } }); try { const x = 1; } catch {} const { fred } = await import('./dynamic-imported.js'); rollup-3.29.4/test/form/samples/no-treeshake/quux.js000066400000000000000000000000621450520414700224410ustar00rootroot00000000000000export const quux = 1; const other = () => quux; rollup-3.29.4/test/form/samples/non-empty-block-statement/000077500000000000000000000000001450520414700235365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/non-empty-block-statement/_config.js000066400000000000000000000001351450520414700254770ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not remove non an empty block statement' }); rollup-3.29.4/test/form/samples/non-empty-block-statement/_expected/000077500000000000000000000000001450520414700254765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/non-empty-block-statement/_expected/amd.js000066400000000000000000000001511450520414700265720ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); { var tmp = 10; } console.log( tmp ); })); rollup-3.29.4/test/form/samples/non-empty-block-statement/_expected/cjs.js000066400000000000000000000001101450520414700266030ustar00rootroot00000000000000'use strict'; console.log( 1 ); { var tmp = 10; } console.log( tmp ); rollup-3.29.4/test/form/samples/non-empty-block-statement/_expected/es.js000066400000000000000000000000711450520414700264410ustar00rootroot00000000000000console.log( 1 ); { var tmp = 10; } console.log( tmp ); rollup-3.29.4/test/form/samples/non-empty-block-statement/_expected/iife.js000066400000000000000000000001441450520414700267470ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); { var tmp = 10; } console.log( tmp ); })(); rollup-3.29.4/test/form/samples/non-empty-block-statement/_expected/system.js000066400000000000000000000002561450520414700273630ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); { var tmp = 10; } console.log( tmp ); }) }; })); rollup-3.29.4/test/form/samples/non-empty-block-statement/_expected/umd.js000066400000000000000000000003071450520414700266210ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); { var tmp = 10; } console.log( tmp ); })); rollup-3.29.4/test/form/samples/non-empty-block-statement/main.js000066400000000000000000000000711450520414700250160ustar00rootroot00000000000000console.log( 1 ); { var tmp = 10; } console.log( tmp ); rollup-3.29.4/test/form/samples/ns-external-star-reexport/000077500000000000000000000000001450520414700235735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/ns-external-star-reexport/_config.js000066400000000000000000000006711450520414700255410ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports namespaces with external star reexports', options: { external: ['external1', 'external2'], plugins: { transform(code, id) { if (id.endsWith('override.js')) { return { code, syntheticNamedExports: true }; } return null; } }, output: { globals: { external1: 'external1', external2: 'external2' }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/ns-external-star-reexport/_expected/000077500000000000000000000000001450520414700255335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/ns-external-star-reexport/_expected/amd.js000066400000000000000000000031571450520414700266400ustar00rootroot00000000000000define(['exports', 'external1', 'external2'], (function (exports, external1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external1__namespace = /*#__PURE__*/_interopNamespaceDefault(external1); var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); var reexportExternal = /*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1__namespace]); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: reexportExternalsWithOverride, extra: extra, override: override }, [reexportExternalsWithOverride, external1__namespace, external2__namespace]); exports.external = reexportExternal; exports.externalOverride = reexportExternalsWithOverride$1; })); rollup-3.29.4/test/form/samples/ns-external-star-reexport/_expected/cjs.js000066400000000000000000000030561450520414700266540ustar00rootroot00000000000000'use strict'; var external1 = require('external1'); var external2 = require('external2'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external1__namespace = /*#__PURE__*/_interopNamespaceDefault(external1); var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); var reexportExternal = /*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1__namespace]); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: reexportExternalsWithOverride, extra: extra, override: override }, [reexportExternalsWithOverride, external1__namespace, external2__namespace]); exports.external = reexportExternal; exports.externalOverride = reexportExternalsWithOverride$1; rollup-3.29.4/test/form/samples/ns-external-star-reexport/_expected/es.js000066400000000000000000000017611450520414700265050ustar00rootroot00000000000000import * as external1 from 'external1'; import * as external2 from 'external2'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var reexportExternal = /*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1]); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: reexportExternalsWithOverride, extra: extra, override: override }, [reexportExternalsWithOverride, external1, external2]); export { reexportExternal as external, reexportExternalsWithOverride$1 as externalOverride }; rollup-3.29.4/test/form/samples/ns-external-star-reexport/_expected/iife.js000066400000000000000000000031721450520414700270100ustar00rootroot00000000000000var bundle = (function (exports, external1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external1__namespace = /*#__PURE__*/_interopNamespaceDefault(external1); var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); var reexportExternal = /*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1__namespace]); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: reexportExternalsWithOverride, extra: extra, override: override }, [reexportExternalsWithOverride, external1__namespace, external2__namespace]); exports.external = reexportExternal; exports.externalOverride = reexportExternalsWithOverride$1; return exports; })({}, external1, external2); rollup-3.29.4/test/form/samples/ns-external-star-reexport/_expected/system.js000066400000000000000000000024211450520414700274140ustar00rootroot00000000000000System.register('bundle', ['external1', 'external2'], (function (exports) { 'use strict'; var external1, external2; return { setters: [function (module) { external1 = module; }, function (module) { external2 = module; }], execute: (function () { function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var reexportExternal = /*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1]); exports('external', reexportExternal); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: reexportExternalsWithOverride, extra: extra, override: override }, [reexportExternalsWithOverride, external1, external2]); exports('externalOverride', reexportExternalsWithOverride$1); }) }; })); rollup-3.29.4/test/form/samples/ns-external-star-reexport/_expected/umd.js000066400000000000000000000037341450520414700266650ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external1'), require('external2')) : typeof define === 'function' && define.amd ? define(['exports', 'external1', 'external2'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external1, global.external2)); })(this, (function (exports, external1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var external1__namespace = /*#__PURE__*/_interopNamespaceDefault(external1); var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); var reexportExternal = /*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1__namespace]); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, default: reexportExternalsWithOverride, extra: extra, override: override }, [reexportExternalsWithOverride, external1__namespace, external2__namespace]); exports.external = reexportExternal; exports.externalOverride = reexportExternalsWithOverride$1; })); rollup-3.29.4/test/form/samples/ns-external-star-reexport/extra.js000066400000000000000000000000361450520414700252530ustar00rootroot00000000000000export const extra = 'extra'; rollup-3.29.4/test/form/samples/ns-external-star-reexport/main.js000066400000000000000000000001771450520414700250620ustar00rootroot00000000000000export * as external from './reexport-external.js'; export * as externalOverride from './reexport-externals-with-override.js'; rollup-3.29.4/test/form/samples/ns-external-star-reexport/reexport-external.js000066400000000000000000000000331450520414700276150ustar00rootroot00000000000000export * from 'external1'; rollup-3.29.4/test/form/samples/ns-external-star-reexport/reexport-externals-with-override.js000066400000000000000000000002421450520414700325700ustar00rootroot00000000000000export * from 'external1'; export * from 'external2'; export * from './extra.js'; export const override = 'override'; export default { synthetic: 'synthetic' }; rollup-3.29.4/test/form/samples/nullish-coalescing/000077500000000000000000000000001450520414700223015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/nullish-coalescing/_config.js000066400000000000000000000001401450520414700242360ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports tree-shaking with nullish-coalescing' }); rollup-3.29.4/test/form/samples/nullish-coalescing/_expected.js000066400000000000000000000004221450520414700245750ustar00rootroot00000000000000function getNullSideEffect() { console.log('effect'); return null; } console.log('null'); console.log('undefined'); console.log(0 ); console.log('' ); console.log('Hello' ); console.log('null return'); console.log(getNullSideEffect() ?? 'null return with side-effect'); rollup-3.29.4/test/form/samples/nullish-coalescing/main.js000066400000000000000000000005731450520414700235700ustar00rootroot00000000000000function getNull() { return null; } function getNullSideEffect() { console.log('effect'); return null; } console.log(null ?? 'null'); console.log(undefined ?? 'undefined'); console.log(0 ?? 'unused'); console.log('' ?? 'unused'); console.log('Hello' ?? 'unused'); console.log(getNull() ?? 'null return'); console.log(getNullSideEffect() ?? 'null return with side-effect'); rollup-3.29.4/test/form/samples/numeric_separators/000077500000000000000000000000001450520414700224235ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/numeric_separators/_config.js000066400000000000000000000001161450520414700243630ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports numeric separators' }); rollup-3.29.4/test/form/samples/numeric_separators/_expected.js000066400000000000000000000000421450520414700247150ustar00rootroot00000000000000const x = 123_456; export { x }; rollup-3.29.4/test/form/samples/numeric_separators/main.js000066400000000000000000000000321450520414700237000ustar00rootroot00000000000000export const x = 123_456; rollup-3.29.4/test/form/samples/object-define-property/000077500000000000000000000000001450520414700230765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-define-property/_config.js000066400000000000000000000001511450520414700250350ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows globals to have parameter mutation side effects' }); rollup-3.29.4/test/form/samples/object-define-property/_expected.js000066400000000000000000000003251450520414700253740ustar00rootroot00000000000000const retained1 = {}; Object.defineProperty(retained1, 'foo', { value: true }); console.log(retained1); const retained2 = {}; Object.defineProperties(retained2, { bar: { value: true } }); console.log(retained2); rollup-3.29.4/test/form/samples/object-define-property/main.js000066400000000000000000000012371450520414700243630ustar00rootroot00000000000000const removed = {}; Object.defineProperty(removed, 'foo', { value: true }); Object.defineProperties(removed, { bar: { value: true } }); const retained1 = {}; Object.defineProperty(retained1, 'foo', { value: true }); console.log(retained1); const retained2 = {}; Object.defineProperties(retained2, { bar: { value: true } }); console.log(retained2); const removed2 = []; Object.defineProperty(removed2, 'foo', { value: true }); class removed3 {} Object.defineProperty(removed3, 'foo', { value: true }); function removed4() {} Object.defineProperty(removed4, 'foo', { value: true }); const removed5 = () => {}; Object.defineProperty(removed5, 'foo', { value: true }); rollup-3.29.4/test/form/samples/object-destructuring-default-values/000077500000000000000000000000001450520414700256035ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-destructuring-default-values/_config.js000066400000000000000000000001441450520414700275440ustar00rootroot00000000000000module.exports = defineTest({ description: 'object destructuring default values are preserved' }); rollup-3.29.4/test/form/samples/object-destructuring-default-values/_expected/000077500000000000000000000000001450520414700275435ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-destructuring-default-values/_expected/amd.js000066400000000000000000000002111450520414700306340ustar00rootroot00000000000000define((function () { 'use strict'; const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); })); rollup-3.29.4/test/form/samples/object-destructuring-default-values/_expected/cjs.js000066400000000000000000000001501450520414700306540ustar00rootroot00000000000000'use strict'; const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); rollup-3.29.4/test/form/samples/object-destructuring-default-values/_expected/es.js000066400000000000000000000001311450520414700305030ustar00rootroot00000000000000const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); rollup-3.29.4/test/form/samples/object-destructuring-default-values/_expected/iife.js000066400000000000000000000002041450520414700310110ustar00rootroot00000000000000(function () { 'use strict'; const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); })(); rollup-3.29.4/test/form/samples/object-destructuring-default-values/_expected/system.js000066400000000000000000000003161450520414700314250ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); }) }; })); rollup-3.29.4/test/form/samples/object-destructuring-default-values/_expected/umd.js000066400000000000000000000003471450520414700306720ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); })); rollup-3.29.4/test/form/samples/object-destructuring-default-values/main.js000066400000000000000000000001311450520414700270600ustar00rootroot00000000000000const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); rollup-3.29.4/test/form/samples/object-expression/000077500000000000000000000000001450520414700221615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/computed-properties/000077500000000000000000000000001450520414700261735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/computed-properties/_config.js000066400000000000000000000001361450520414700301350ustar00rootroot00000000000000module.exports = defineTest({ description: 'Associates non-string keys with string keys' }); rollup-3.29.4/test/form/samples/object-expression/computed-properties/_expected.js000066400000000000000000000001531450520414700304700ustar00rootroot00000000000000{ console.log('kept'); } { console.log('kept'); } { console.log('kept'); } { console.log('kept'); } rollup-3.29.4/test/form/samples/object-expression/computed-properties/main.js000066400000000000000000000005201450520414700274520ustar00rootroot00000000000000const x = { "1": 1, [2]: 2 }; if (x[1] < 2) { console.log('kept'); } else { console.log('removed'); } if (x["1"] < 2) { console.log('kept'); } else { console.log('removed'); } if (x[2] > 1) { console.log('kept'); } else { console.log('removed'); } if (x["2"] > 1) { console.log('kept'); } else { console.log('removed'); } rollup-3.29.4/test/form/samples/object-expression/method-side-effects/000077500000000000000000000000001450520414700260005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/method-side-effects/_config.js000066400000000000000000000001251450520414700277400ustar00rootroot00000000000000module.exports = defineTest({ description: 'Track side-effects of method calls' }); rollup-3.29.4/test/form/samples/object-expression/method-side-effects/_expected.js000066400000000000000000000002651450520414700303010ustar00rootroot00000000000000const y = { a() {}, b: () => {}, [globalThis.unknown]() { console.log('effect'); } }; y.a(); y.b(); const z = { [globalThis.unknown]() {} }; z.a(); z.hasOwnProperty('a'); rollup-3.29.4/test/form/samples/object-expression/method-side-effects/main.js000066400000000000000000000004411450520414700272610ustar00rootroot00000000000000const x = { [globalThis.unknown]() { console.log('effect'); }, a() {}, b: () => {} }; x.a(); x.b(); const y = { a() {}, b: () => {}, [globalThis.unknown]() { console.log('effect'); } }; y.a(); y.b(); const z = { [globalThis.unknown]() {} }; z.a(); z.hasOwnProperty('a'); nested-literal-assignment-without-access-side-effect/000077500000000000000000000000001450520414700343005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression_config.js000066400000000000000000000002441450520414700362420ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/nested-literal-assignment-without-access-side-effectmodule.exports = defineTest({ description: 'treats mutating nested properties as side effects', options: { treeshake: { propertyReadSideEffects: false } } }); _expected.js000066400000000000000000000000741450520414700365770ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/nested-literal-assignment-without-access-side-effectconst obj = { __proto__: null }; obj.foo.bar = 'retained'; main.js000066400000000000000000000000741450520414700355630ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/nested-literal-assignment-without-access-side-effectconst obj = { __proto__: null }; obj.foo.bar = 'retained'; rollup-3.29.4/test/form/samples/object-expression/nested-literal-value-without-access-side-effect/000077500000000000000000000000001450520414700333235ustar00rootroot00000000000000_config.js000066400000000000000000000002361450520414700352070ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/nested-literal-value-without-access-side-effectmodule.exports = defineTest({ description: 'uses an unknown value for nested properties', options: { treeshake: { propertyReadSideEffects: false } } }); _expected.js000066400000000000000000000001211450520414700355340ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/nested-literal-value-without-access-side-effectconst obj = { __proto__: null }; if (obj.foo.bar) { console.log('retained'); } main.js000066400000000000000000000001211450520414700345200ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/nested-literal-value-without-access-side-effectconst obj = { __proto__: null }; if (obj.foo.bar) { console.log('retained'); } rollup-3.29.4/test/form/samples/object-expression/proto-property/000077500000000000000000000000001450520414700252065ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/proto-property/_config.js000066400000000000000000000001241450520414700271450ustar00rootroot00000000000000module.exports = defineTest({ description: 'Deoptimize when __proto__ is used' }); rollup-3.29.4/test/form/samples/object-expression/proto-property/_expected.js000066400000000000000000000003111450520414700274770ustar00rootroot00000000000000let proto = { get a() { log(); } }; let plainProto = { __proto__: proto }; if (plainProto.a) log("plainProto"); let quotedProto = { "__proto__": proto }; if (quotedProto.a) log("quotedProto"); rollup-3.29.4/test/form/samples/object-expression/proto-property/main.js000066400000000000000000000004011450520414700264630ustar00rootroot00000000000000let basic = { a: false }; if (basic.a) log("basic"); let proto = { get a() { log(); } }; let plainProto = { __proto__: proto }; if (plainProto.a) log("plainProto"); let quotedProto = { "__proto__": proto }; if (quotedProto.a) log("quotedProto"); rollup-3.29.4/test/form/samples/object-expression/reassign-prop-without-proto/000077500000000000000000000000001450520414700276145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/reassign-prop-without-proto/_config.js000066400000000000000000000001371450520414700315570ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly deoptimizes when there is no proto' }); rollup-3.29.4/test/form/samples/object-expression/reassign-prop-without-proto/_expected.js000066400000000000000000000001371450520414700321130ustar00rootroot00000000000000const obj = { __proto__: null }; obj.flag = true; if (obj.flag) { console.log('mutated'); } rollup-3.29.4/test/form/samples/object-expression/reassign-prop-without-proto/main.js000066400000000000000000000001371450520414700310770ustar00rootroot00000000000000const obj = { __proto__: null }; obj.flag = true; if (obj.flag) { console.log('mutated'); } rollup-3.29.4/test/form/samples/object-expression/return-expressions/000077500000000000000000000000001450520414700260605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/return-expressions/_config.js000066400000000000000000000001351450520414700300210ustar00rootroot00000000000000module.exports = defineTest({ description: 'Track side-effects of method return values' }); rollup-3.29.4/test/form/samples/object-expression/return-expressions/_expected.js000066400000000000000000000005261450520414700303610ustar00rootroot00000000000000const y = { a: () => () => {}, [globalThis.unknown]: () => () => console.log('effect') }; y.a()(); const z = { [globalThis.unknown]: () => ({}) }; z.a()(); const v = {}; v.toString().doesNotExist(0); // retained const w = { toString: () => ({ charCodeAt: () => console.log('effect') }) }; w.toString().charCodeAt(0); // retained rollup-3.29.4/test/form/samples/object-expression/return-expressions/main.js000066400000000000000000000007451450520414700273500ustar00rootroot00000000000000const x = { [globalThis.unknown]: () => () => console.log('effect'), a: () => () => {} }; x.a()(); const y = { a: () => () => {}, [globalThis.unknown]: () => () => console.log('effect') }; y.a()(); const z = { [globalThis.unknown]: () => ({}) }; z.a()(); const v = {}; v.toString().charCodeAt(0); // removed v.toString().doesNotExist(0); // retained const w = { toString: () => ({ charCodeAt: () => console.log('effect') }) }; w.toString().charCodeAt(0); // retained rollup-3.29.4/test/form/samples/object-expression/unknown-getter-no-side-effect/000077500000000000000000000000001450520414700277365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/unknown-getter-no-side-effect/_config.js000066400000000000000000000002121450520414700316730ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes unknown getter access without side effect', options: { external: ['external'] } }); rollup-3.29.4/test/form/samples/object-expression/unknown-getter-no-side-effect/_expected.js000066400000000000000000000000231450520414700322270ustar00rootroot00000000000000import 'external'; rollup-3.29.4/test/form/samples/object-expression/unknown-getter-no-side-effect/main.js000066400000000000000000000001251450520414700312160ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { get [unknown]() {} }; obj.prop; rollup-3.29.4/test/form/samples/object-expression/unknown-setter-no-side-effect/000077500000000000000000000000001450520414700277525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/unknown-setter-no-side-effect/_config.js000066400000000000000000000002121450520414700317070ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes unknown setter access without side effect', options: { external: ['external'] } }); rollup-3.29.4/test/form/samples/object-expression/unknown-setter-no-side-effect/_expected.js000066400000000000000000000000231450520414700322430ustar00rootroot00000000000000import 'external'; rollup-3.29.4/test/form/samples/object-expression/unknown-setter-no-side-effect/main.js000066400000000000000000000001411450520414700312300ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { set [unknown](value) {} }; obj.prop = true; rollup-3.29.4/test/form/samples/object-expression/unknown-setter-no-side-effect2/000077500000000000000000000000001450520414700300345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-expression/unknown-setter-no-side-effect2/_config.js000066400000000000000000000002121450520414700317710ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes unknown setter access without side effect', options: { external: ['external'] } }); rollup-3.29.4/test/form/samples/object-expression/unknown-setter-no-side-effect2/_expected.js000066400000000000000000000002021450520414700323240ustar00rootroot00000000000000import { unknown } from 'external'; const obj2 = { set [unknown](value) { console.log('effect'); } }; obj2[unknown] = true; rollup-3.29.4/test/form/samples/object-expression/unknown-setter-no-side-effect2/main.js000066400000000000000000000003031450520414700313120ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { set [unknown](value) {} }; obj[unknown] = true; const obj2 = { set [unknown](value) { console.log('effect'); } }; obj2[unknown] = true; rollup-3.29.4/test/form/samples/object-freeze-effects/000077500000000000000000000000001450520414700226575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-freeze-effects/_config.js000066400000000000000000000001651450520414700246230ustar00rootroot00000000000000module.exports = defineTest({ description: 'Only treats Object.freeze as a side effect if the argument is used' }); rollup-3.29.4/test/form/samples/object-freeze-effects/_expected.js000066400000000000000000000002021450520414700251470ustar00rootroot00000000000000const b = Object.freeze({ foo: 'bar' }); console.log(b); const c = { foo: 'bar' }; Object.freeze(c); // retained console.log(c); rollup-3.29.4/test/form/samples/object-freeze-effects/main.js000066400000000000000000000003601450520414700241400ustar00rootroot00000000000000Object.freeze({ foo: 'bar' }); // removed const a = { foo: 'bar' }; // removed Object.freeze(a); // removed const b = Object.freeze({ foo: 'bar' }); console.log(b); const c = { foo: 'bar' }; Object.freeze(c); // retained console.log(c); rollup-3.29.4/test/form/samples/object-literal-property-overwrites/000077500000000000000000000000001450520414700255075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/object-literal-property-overwrites/_config.js000066400000000000000000000001631450520414700274510ustar00rootroot00000000000000module.exports = defineTest({ description: 'detect side-effects in overwritten properties of object literals' }); rollup-3.29.4/test/form/samples/object-literal-property-overwrites/_expected.js000066400000000000000000000011021450520414700277770ustar00rootroot00000000000000const retained1 = { foo: () => {}, foo: function () {this.x = 1;} }; retained1.foo(); const retained2 = { foo: () => {}, ['f' + 'oo']: function () {this.x = 1;}, ['b' + 'ar']: () => {} }; retained2.foo(); const retained3 = { ['fo' + 'o']: () => {}, ['f' + 'oo']: () => {} }; retained3.bar(); const retained4 = { foo: {}, foo: globalThis.unknown }; retained4.foo.bar = 1; const retained5 = { foo: {}, ['f' + 'oo']: globalThis.unknown, ['b' + 'ar']: {}, }; retained5.foo.bar = 1; const retained6 = { ['fo' + 'o']: {}, ['f' + 'oo']: {} }; retained6.bar.baz = 1; rollup-3.29.4/test/form/samples/object-literal-property-overwrites/main.js000066400000000000000000000023071450520414700267730ustar00rootroot00000000000000const removed1 = { foo: () => {}, foo: () => {}, ['f' + 'oo']: () => {} }; removed1.foo(); const removed2 = { foo: () => console.log( 'effect' ), foo: () => {} }; removed2.foo(); const removed3 = { ['fo' + 'o']: function () {this.x = 1;}, ['f' + 'oo']: () => console.log( 'effect' ), foo: () => {} }; removed3.foo(); const removed4 = { foo: () => {}, foo: () => {}, ['f' + 'oo']: () => {} }; removed4.foo.bar = 1; const removed5 = { foo: globalThis.unknown, foo: () => {} }; removed5.foo.bar = 1; const removed6 = { ['f' + 'oo']: globalThis.unknown, ['fo' + 'o']: globalThis.unknown, foo: () => {} }; removed6.foo.bar = 1; const retained1 = { foo: () => {}, foo: function () {this.x = 1;} }; retained1.foo(); const retained2 = { foo: () => {}, ['f' + 'oo']: function () {this.x = 1;}, ['b' + 'ar']: () => {} }; retained2.foo(); const retained3 = { ['fo' + 'o']: () => {}, ['f' + 'oo']: () => {} }; retained3.bar(); const retained4 = { foo: {}, foo: globalThis.unknown }; retained4.foo.bar = 1; const retained5 = { foo: {}, ['f' + 'oo']: globalThis.unknown, ['b' + 'ar']: {}, }; retained5.foo.bar = 1; const retained6 = { ['fo' + 'o']: {}, ['f' + 'oo']: {} }; retained6.bar.baz = 1; rollup-3.29.4/test/form/samples/optional-chaining-namespace/000077500000000000000000000000001450520414700240535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/optional-chaining-namespace/_config.js000066400000000000000000000002131450520414700260110ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports optional chaining with namespace objects', expectedWarnings: ['MISSING_EXPORT'] }); rollup-3.29.4/test/form/samples/optional-chaining-namespace/_expected.js000066400000000000000000000001201450520414700263420ustar00rootroot00000000000000const foo = { nullVal: null }; foo?.x.x; // retained undefined.x; // retained rollup-3.29.4/test/form/samples/optional-chaining-namespace/main.js000066400000000000000000000012121450520414700253310ustar00rootroot00000000000000import * as util from './util'; util.foo.x; // removed util.foo.nullVal; // removed util.foo.nullVal?.x; // removed util.foo.nullVal?.x.y; // removed util.foo.nullVal?.(); // removed util.foo.nullVal?.().x(); // removed util.foo?.x.x; // retained util.x; // removed util.x?.x; // removed util.x?.x.y; // removed util.x?.(); // removed util.x?.().x(); // removed util?.x.x; // retained if ( util.foo.nullVal || util.foo.nullVal?.x || util.foo.nullVal?.x.y || util.foo.nullVal?.() || util.foo.nullVal?.().x() ) { console.log('removed'); } if (util.x || util.x?.x || util.x?.x.y || util.x?.() || util.x?.().x()) { console.log('removed'); } rollup-3.29.4/test/form/samples/optional-chaining-namespace/util.js000066400000000000000000000000461450520414700253660ustar00rootroot00000000000000export const foo = { nullVal: null }; rollup-3.29.4/test/form/samples/optional-chaining/000077500000000000000000000000001450520414700221215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/optional-chaining/_config.js000066400000000000000000000001151450520414700240600ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports optional chaining' }); rollup-3.29.4/test/form/samples/optional-chaining/_expected.js000066400000000000000000000002141450520414700244140ustar00rootroot00000000000000Object.defineProperty(Object.prototype, 'foo', { get bar() { console.log('effect'); } }); const obj2 = {}; obj2.foo?.bar; obj2.foo?.(); rollup-3.29.4/test/form/samples/optional-chaining/main.js000066400000000000000000000003231450520414700234010ustar00rootroot00000000000000const obj = { __proto__: null }; obj?.foo; obj.foo?.bar; obj.foo?.(); Object.defineProperty(Object.prototype, 'foo', { get bar() { console.log('effect'); } }); const obj2 = {}; obj2.foo?.bar; obj2.foo?.(); rollup-3.29.4/test/form/samples/output-named-library/000077500000000000000000000000001450520414700226025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/output-named-library/_config.js000066400000000000000000000002011450520414700245350ustar00rootroot00000000000000module.exports = defineTest({ description: 'names bundles correctly', options: { output: { name: 'libraryName' } } }); rollup-3.29.4/test/form/samples/output-named-library/_expected/000077500000000000000000000000001450520414700245425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/output-named-library/_expected/amd.js000066400000000000000000000001721450520414700256410ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const valueOnLib = 42; exports.valueOnLib = valueOnLib; })); rollup-3.29.4/test/form/samples/output-named-library/_expected/cjs.js000066400000000000000000000001101450520414700256470ustar00rootroot00000000000000'use strict'; const valueOnLib = 42; exports.valueOnLib = valueOnLib; rollup-3.29.4/test/form/samples/output-named-library/_expected/es.js000066400000000000000000000000571450520414700255110ustar00rootroot00000000000000const valueOnLib = 42; export { valueOnLib }; rollup-3.29.4/test/form/samples/output-named-library/_expected/iife.js000066400000000000000000000002161450520414700260130ustar00rootroot00000000000000var libraryName = (function (exports) { 'use strict'; const valueOnLib = 42; exports.valueOnLib = valueOnLib; return exports; })({}); rollup-3.29.4/test/form/samples/output-named-library/_expected/system.js000066400000000000000000000002551450520414700264260ustar00rootroot00000000000000System.register('libraryName', [], (function (exports) { 'use strict'; return { execute: (function () { const valueOnLib = exports('valueOnLib', 42); }) }; })); rollup-3.29.4/test/form/samples/output-named-library/_expected/umd.js000066400000000000000000000006341450520414700256700ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.libraryName = {})); })(this, (function (exports) { 'use strict'; const valueOnLib = 42; exports.valueOnLib = valueOnLib; })); rollup-3.29.4/test/form/samples/output-named-library/main.js000066400000000000000000000000351450520414700240620ustar00rootroot00000000000000export const valueOnLib = 42 rollup-3.29.4/test/form/samples/override-external-namespace/000077500000000000000000000000001450520414700241075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/override-external-namespace/_config.js000066400000000000000000000003341450520414700260510ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows overriding imports of external namespace reexports', options: { external: 'external', output: { name: 'bundle', globals: { external: 'external' } } } }); rollup-3.29.4/test/form/samples/override-external-namespace/_expected/000077500000000000000000000000001450520414700260475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/override-external-namespace/_expected/amd.js000066400000000000000000000007421450520414700271510ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; const a = 'defined'; exports.b = void 0; var c; const reassign = () => (exports.b = 'defined'); exports.a = a; exports.c = c; exports.reassign = reassign; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); })); rollup-3.29.4/test/form/samples/override-external-namespace/_expected/cjs.js000066400000000000000000000006641450520414700271720ustar00rootroot00000000000000'use strict'; var external = require('external'); const a = 'defined'; exports.b = void 0; var c; const reassign = () => (exports.b = 'defined'); exports.a = a; exports.c = c; exports.reassign = reassign; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-3.29.4/test/form/samples/override-external-namespace/_expected/es.js000066400000000000000000000002051450520414700270110ustar00rootroot00000000000000export * from 'external'; const a = 'defined'; let b; var c; const reassign = () => (b = 'defined'); export { a, b, c, reassign }; rollup-3.29.4/test/form/samples/override-external-namespace/_expected/iife.js000066400000000000000000000007571450520414700273320ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; const a = 'defined'; exports.b = void 0; var c; const reassign = () => (exports.b = 'defined'); exports.a = a; exports.c = c; exports.reassign = reassign; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); return exports; })({}, external); rollup-3.29.4/test/form/samples/override-external-namespace/_expected/system.js000066400000000000000000000010461450520414700277320ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; var _starExcludes = { a: 1, b: 1, c: 1, reassign: 1, default: 1 }; return { setters: [function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { const a = exports('a', 'defined'); let b; exports('b', b); var c; exports('c', c); const reassign = exports('reassign', () => (exports('b', b = 'defined'))); }) }; })); rollup-3.29.4/test/form/samples/override-external-namespace/_expected/umd.js000066400000000000000000000014451450520414700271760ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; const a = 'defined'; exports.b = void 0; var c; const reassign = () => (exports.b = 'defined'); exports.a = a; exports.c = c; exports.reassign = reassign; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); })); rollup-3.29.4/test/form/samples/override-external-namespace/main.js000066400000000000000000000002011450520414700253620ustar00rootroot00000000000000export * from 'external'; export const a = 'defined'; export let b; export var c; export const reassign = () => (b = 'defined'); rollup-3.29.4/test/form/samples/paths-function/000077500000000000000000000000001450520414700214605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/paths-function/_config.js000066400000000000000000000003031450520414700234160ustar00rootroot00000000000000module.exports = defineTest({ description: 'external paths (#754)', options: { external: ['foo'], output: { globals: { foo: 'foo' }, paths: id => `https://unpkg.com/${id}` } } }); rollup-3.29.4/test/form/samples/paths-function/_expected/000077500000000000000000000000001450520414700234205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/paths-function/_expected/amd.js000066400000000000000000000013121450520414700245140ustar00rootroot00000000000000define(['require', 'https://unpkg.com/foo'], (function (require, foo) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } assert.equal(foo, 42); new Promise(function (resolve, reject) { require(['https://unpkg.com/foo'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }).then(({ default: foo }) => assert.equal(foo, 42)); })); rollup-3.29.4/test/form/samples/paths-function/_expected/cjs.js000066400000000000000000000002471450520414700245400ustar00rootroot00000000000000'use strict'; var foo = require('https://unpkg.com/foo'); assert.equal(foo, 42); import('https://unpkg.com/foo').then(({ default: foo }) => assert.equal(foo, 42)); rollup-3.29.4/test/form/samples/paths-function/_expected/es.js000066400000000000000000000002251450520414700243640ustar00rootroot00000000000000import foo from 'https://unpkg.com/foo'; assert.equal(foo, 42); import('https://unpkg.com/foo').then(({ default: foo }) => assert.equal(foo, 42)); rollup-3.29.4/test/form/samples/paths-function/_expected/iife.js000066400000000000000000000002311450520414700246660ustar00rootroot00000000000000(function (foo) { 'use strict'; assert.equal(foo, 42); import('https://unpkg.com/foo').then(({ default: foo }) => assert.equal(foo, 42)); })(foo); rollup-3.29.4/test/form/samples/paths-function/_expected/system.js000066400000000000000000000005151450520414700253030ustar00rootroot00000000000000System.register(['https://unpkg.com/foo'], (function (exports, module) { 'use strict'; var foo; return { setters: [function (module) { foo = module.default; }], execute: (function () { assert.equal(foo, 42); module.import('https://unpkg.com/foo').then(({ default: foo }) => assert.equal(foo, 42)); }) }; })); rollup-3.29.4/test/form/samples/paths-function/_expected/umd.js000066400000000000000000000007441450520414700245500ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('https://unpkg.com/foo')) : typeof define === 'function' && define.amd ? define(['https://unpkg.com/foo'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foo)); })(this, (function (foo) { 'use strict'; assert.equal(foo, 42); import('https://unpkg.com/foo').then(({ default: foo }) => assert.equal(foo, 42)); })); rollup-3.29.4/test/form/samples/paths-function/main.js000066400000000000000000000001611450520414700227400ustar00rootroot00000000000000import foo from 'foo'; assert.equal(foo, 42); import('foo').then(({ default: foo }) => assert.equal(foo, 42)); rollup-3.29.4/test/form/samples/paths-relative/000077500000000000000000000000001450520414700214465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/paths-relative/_config.js000066400000000000000000000004411450520414700234070ustar00rootroot00000000000000const { resolve } = require('node:path'); const resolved = resolve(__dirname, 'foo.js'); module.exports = defineTest({ description: 'external paths (#754)', options: { external: [resolved], output: { globals: { [resolved]: 'foo' }, paths: { [resolved]: '../foo' } } } }); rollup-3.29.4/test/form/samples/paths-relative/_expected/000077500000000000000000000000001450520414700234065ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/paths-relative/_expected/amd.js000066400000000000000000000001241450520414700245020ustar00rootroot00000000000000define(['../foo'], (function (foo) { 'use strict'; assert.equal( foo, 42 ); })); rollup-3.29.4/test/form/samples/paths-relative/_expected/cjs.js000066400000000000000000000001061450520414700245200ustar00rootroot00000000000000'use strict'; var foo = require('../foo'); assert.equal( foo, 42 ); rollup-3.29.4/test/form/samples/paths-relative/_expected/es.js000066400000000000000000000000641450520414700243530ustar00rootroot00000000000000import foo from '../foo'; assert.equal( foo, 42 ); rollup-3.29.4/test/form/samples/paths-relative/_expected/iife.js000066400000000000000000000001061450520414700246550ustar00rootroot00000000000000(function (foo) { 'use strict'; assert.equal( foo, 42 ); })(foo); rollup-3.29.4/test/form/samples/paths-relative/_expected/system.js000066400000000000000000000003231450520414700252660ustar00rootroot00000000000000System.register(['../foo'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.default; }], execute: (function () { assert.equal( foo, 42 ); }) }; })); rollup-3.29.4/test/form/samples/paths-relative/_expected/umd.js000066400000000000000000000005631450520414700245350ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../foo')) : typeof define === 'function' && define.amd ? define(['../foo'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foo)); })(this, (function (foo) { 'use strict'; assert.equal( foo, 42 ); })); rollup-3.29.4/test/form/samples/paths-relative/main.js000066400000000000000000000000661450520414700227320ustar00rootroot00000000000000import foo from './foo.js'; assert.equal( foo, 42 ); rollup-3.29.4/test/form/samples/paths/000077500000000000000000000000001450520414700176355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/paths/_config.js000066400000000000000000000003041450520414700215740ustar00rootroot00000000000000module.exports = defineTest({ description: 'external paths (#754)', options: { external: ['foo'], output: { globals: { foo: 'foo' }, paths: { foo: 'https://unpkg.com/foo' } } } }); rollup-3.29.4/test/form/samples/paths/_expected/000077500000000000000000000000001450520414700215755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/paths/_expected/amd.js000066400000000000000000000001431450520414700226720ustar00rootroot00000000000000define(['https://unpkg.com/foo'], (function (foo) { 'use strict'; assert.equal( foo, 42 ); })); rollup-3.29.4/test/form/samples/paths/_expected/cjs.js000066400000000000000000000001251450520414700227100ustar00rootroot00000000000000'use strict'; var foo = require('https://unpkg.com/foo'); assert.equal( foo, 42 ); rollup-3.29.4/test/form/samples/paths/_expected/es.js000066400000000000000000000001031450520414700225340ustar00rootroot00000000000000import foo from 'https://unpkg.com/foo'; assert.equal( foo, 42 ); rollup-3.29.4/test/form/samples/paths/_expected/iife.js000066400000000000000000000001061450520414700230440ustar00rootroot00000000000000(function (foo) { 'use strict'; assert.equal( foo, 42 ); })(foo); rollup-3.29.4/test/form/samples/paths/_expected/system.js000066400000000000000000000003421450520414700234560ustar00rootroot00000000000000System.register(['https://unpkg.com/foo'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.default; }], execute: (function () { assert.equal( foo, 42 ); }) }; })); rollup-3.29.4/test/form/samples/paths/_expected/umd.js000066400000000000000000000006211450520414700227170ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('https://unpkg.com/foo')) : typeof define === 'function' && define.amd ? define(['https://unpkg.com/foo'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foo)); })(this, (function (foo) { 'use strict'; assert.equal( foo, 42 ); })); rollup-3.29.4/test/form/samples/paths/main.js000066400000000000000000000000611450520414700211140ustar00rootroot00000000000000import foo from 'foo'; assert.equal( foo, 42 ); rollup-3.29.4/test/form/samples/pattern-assignments/000077500000000000000000000000001450520414700225245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/pattern-assignments/_config.js000066400000000000000000000002361450520414700244670ustar00rootroot00000000000000module.exports = defineTest({ description: 'Make sure side-effects are passed along destructuring assignments', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/pattern-assignments/_expected/000077500000000000000000000000001450520414700244645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/pattern-assignments/_expected/amd.js000066400000000000000000000010511450520414700255600ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var effect = () => console.log( 'effect' ); var { a } = { a: effect }; a(); var { x: b } = { x: effect }; b(); const s = {}; var { c } = { c: s }; c.foo = 1; const t = {}; var { x: d } = { x: t }; d.foo = 1; var e; ({ e } = { e: effect }); e(); var f; ({ x: f } = { x: effect }); f(); const u = {}; var g; ({ g } = { g: u }); g.foo = 1; const v = {}; var h; ({ x: h } = { x: v }); h.foo = 1; exports.s = s; exports.t = t; exports.u = u; exports.v = v; })); rollup-3.29.4/test/form/samples/pattern-assignments/_expected/cjs.js000066400000000000000000000007341450520414700256050ustar00rootroot00000000000000'use strict'; var effect = () => console.log( 'effect' ); var { a } = { a: effect }; a(); var { x: b } = { x: effect }; b(); const s = {}; var { c } = { c: s }; c.foo = 1; const t = {}; var { x: d } = { x: t }; d.foo = 1; var e; ({ e } = { e: effect }); e(); var f; ({ x: f } = { x: effect }); f(); const u = {}; var g; ({ g } = { g: u }); g.foo = 1; const v = {}; var h; ({ x: h } = { x: v }); h.foo = 1; exports.s = s; exports.t = t; exports.u = u; exports.v = v; rollup-3.29.4/test/form/samples/pattern-assignments/_expected/es.js000066400000000000000000000006501450520414700254320ustar00rootroot00000000000000var effect = () => console.log( 'effect' ); var { a } = { a: effect }; a(); var { x: b } = { x: effect }; b(); const s = {}; var { c } = { c: s }; c.foo = 1; const t = {}; var { x: d } = { x: t }; d.foo = 1; var e; ({ e } = { e: effect }); e(); var f; ({ x: f } = { x: effect }); f(); const u = {}; var g; ({ g } = { g: u }); g.foo = 1; const v = {}; var h; ({ x: h } = { x: v }); h.foo = 1; export { s, t, u, v }; rollup-3.29.4/test/form/samples/pattern-assignments/_expected/iife.js000066400000000000000000000010701450520414700257340ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; var effect = () => console.log( 'effect' ); var { a } = { a: effect }; a(); var { x: b } = { x: effect }; b(); const s = {}; var { c } = { c: s }; c.foo = 1; const t = {}; var { x: d } = { x: t }; d.foo = 1; var e; ({ e } = { e: effect }); e(); var f; ({ x: f } = { x: effect }); f(); const u = {}; var g; ({ g } = { g: u }); g.foo = 1; const v = {}; var h; ({ x: h } = { x: v }); h.foo = 1; exports.s = s; exports.t = t; exports.u = u; exports.v = v; return exports; })({}); rollup-3.29.4/test/form/samples/pattern-assignments/_expected/system.js000066400000000000000000000012121450520414700263420ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var effect = () => console.log( 'effect' ); var { a } = { a: effect }; a(); var { x: b } = { x: effect }; b(); const s = exports('s', {}); var { c } = { c: s }; c.foo = 1; const t = exports('t', {}); var { x: d } = { x: t }; d.foo = 1; var e; ({ e } = { e: effect }); e(); var f; ({ x: f } = { x: effect }); f(); const u = exports('u', {}); var g; ({ g } = { g: u }); g.foo = 1; const v = exports('v', {}); var h; ({ x: h } = { x: v }); h.foo = 1; }) }; })); rollup-3.29.4/test/form/samples/pattern-assignments/_expected/umd.js000066400000000000000000000015061450520414700256110ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; var effect = () => console.log( 'effect' ); var { a } = { a: effect }; a(); var { x: b } = { x: effect }; b(); const s = {}; var { c } = { c: s }; c.foo = 1; const t = {}; var { x: d } = { x: t }; d.foo = 1; var e; ({ e } = { e: effect }); e(); var f; ({ x: f } = { x: effect }); f(); const u = {}; var g; ({ g } = { g: u }); g.foo = 1; const v = {}; var h; ({ x: h } = { x: v }); h.foo = 1; exports.s = s; exports.t = t; exports.u = u; exports.v = v; })); rollup-3.29.4/test/form/samples/pattern-assignments/main.js000066400000000000000000000006541450520414700240130ustar00rootroot00000000000000var effect = () => console.log( 'effect' ); var { a } = { a: effect }; a(); var { x: b } = { x: effect }; b(); export const s = {}; var { c } = { c: s }; c.foo = 1; export const t = {}; var { x: d } = { x: t }; d.foo = 1; var e; ({ e } = { e: effect }); e(); var f; ({ x: f } = { x: effect }); f(); export const u = {}; var g; ({ g } = { g: u }); g.foo = 1; export const v = {}; var h; ({ x: h } = { x: v }); h.foo = 1; rollup-3.29.4/test/form/samples/pattern-member-expressions/000077500000000000000000000000001450520414700240205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/pattern-member-expressions/_config.js000066400000000000000000000001411450520414700257560ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles member expressions in patterns (#2750)' }); rollup-3.29.4/test/form/samples/pattern-member-expressions/_expected.js000066400000000000000000000005511450520414700263170ustar00rootroot00000000000000const array = [false]; const obj1 = {value: false}; const obj2 = {value: false}; ([array[0]] = [true]); ({a: obj1.value} = {a: true}); ({[globalThis.unknown1]: obj2[globalThis.unknown2]} = {[globalThis.unknown3]: true}); if (array[0]) { console.log('retained'); } if (obj1.value) { console.log('retained'); } if (obj2.value) { console.log('retained'); } rollup-3.29.4/test/form/samples/pattern-member-expressions/main.js000066400000000000000000000005511450520414700253030ustar00rootroot00000000000000const array = [false]; const obj1 = {value: false}; const obj2 = {value: false}; ([array[0]] = [true]); ({a: obj1.value} = {a: true}); ({[globalThis.unknown1]: obj2[globalThis.unknown2]} = {[globalThis.unknown3]: true}); if (array[0]) { console.log('retained'); } if (obj1.value) { console.log('retained'); } if (obj2.value) { console.log('retained'); } rollup-3.29.4/test/form/samples/per-output-plugins/000077500000000000000000000000001450520414700223215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/per-output-plugins/_config.js000066400000000000000000000006271450520414700242700ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows specifying per-output plugins', options: { output: { plugins: [ { name: 'test-plugin', renderChunk(code, chunkDescription, { format }) { return code.replace(42, `'${format}'`); } }, { renderChunk(code, chunkDescription, { format }) { return code.replace(43, `'!${format}!'`); } } ] } } }); rollup-3.29.4/test/form/samples/per-output-plugins/_expected/000077500000000000000000000000001450520414700242615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/per-output-plugins/_expected/amd.js000066400000000000000000000001111450520414700253510ustar00rootroot00000000000000define((function () { 'use strict'; console.log('amd', '!amd!'); })); rollup-3.29.4/test/form/samples/per-output-plugins/_expected/cjs.js000066400000000000000000000000541450520414700253750ustar00rootroot00000000000000'use strict'; console.log('cjs', '!cjs!'); rollup-3.29.4/test/form/samples/per-output-plugins/_expected/es.js000066400000000000000000000000331450520414700252220ustar00rootroot00000000000000console.log('es', '!es!'); rollup-3.29.4/test/form/samples/per-output-plugins/_expected/iife.js000066400000000000000000000001061450520414700255300ustar00rootroot00000000000000(function () { 'use strict'; console.log('iife', '!iife!'); })(); rollup-3.29.4/test/form/samples/per-output-plugins/_expected/system.js000066400000000000000000000002141450520414700261400ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('system', '!system!'); }) }; })); rollup-3.29.4/test/form/samples/per-output-plugins/_expected/umd.js000066400000000000000000000002471450520414700254070ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('umd', '!umd!'); })); rollup-3.29.4/test/form/samples/per-output-plugins/main.js000066400000000000000000000000251450520414700236000ustar00rootroot00000000000000console.log(42, 43); rollup-3.29.4/test/form/samples/preserve-asm-js/000077500000000000000000000000001450520414700215415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/preserve-asm-js/_config.js000066400000000000000000000001201450520414700234740ustar00rootroot00000000000000module.exports = defineTest({ description: 'Preserves asm.js code (#3360)' }); rollup-3.29.4/test/form/samples/preserve-asm-js/_expected.js000066400000000000000000000006651450520414700240460ustar00rootroot00000000000000function asmjs_included_1() { 'use asm'; function noop(e) { // this is crucial e = e | 0; } return { noop: noop }; } function asmjs_included_2() { 'use asm'; function noop(e) { e = e | 0; switch (e | 0) { case 10: return 10; default: return e | 0; } // this is crucial return e | 0; } return { noop: noop }; } console.log(asmjs_included_1().noop(3)); console.log(asmjs_included_2().noop(3)); rollup-3.29.4/test/form/samples/preserve-asm-js/main.js000066400000000000000000000010351450520414700230220ustar00rootroot00000000000000function asmjs_included_1() { 'use asm'; function noop(e) { // this is crucial e = e | 0; } return { noop: noop }; } function asmjs_included_2() { 'use asm'; function noop(e) { e = e | 0; switch (e | 0) { case 10: return 10; default: return e | 0; } // this is crucial return e | 0; } return { noop: noop }; } function asmjs_removed() { 'use asm'; function noop(e) { e = e | 0; } return { noop: noop }; } console.log(asmjs_included_1().noop(3)); console.log(asmjs_included_2().noop(3)); rollup-3.29.4/test/form/samples/preserve-debugger/000077500000000000000000000000001450520414700221335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/preserve-debugger/_config.js000066400000000000000000000001331450520414700240720ustar00rootroot00000000000000module.exports = defineTest({ description: 'debugger statements are preserved (#664)' }); rollup-3.29.4/test/form/samples/preserve-debugger/_expected/000077500000000000000000000000001450520414700240735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/preserve-debugger/_expected/amd.js000066400000000000000000000001131450520414700251650ustar00rootroot00000000000000define((function () { 'use strict'; before(); debugger; after(); })); rollup-3.29.4/test/form/samples/preserve-debugger/_expected/cjs.js000066400000000000000000000000541450520414700252070ustar00rootroot00000000000000'use strict'; before(); debugger; after(); rollup-3.29.4/test/form/samples/preserve-debugger/_expected/es.js000066400000000000000000000000351450520414700250360ustar00rootroot00000000000000before(); debugger; after(); rollup-3.29.4/test/form/samples/preserve-debugger/_expected/iife.js000066400000000000000000000001061450520414700253420ustar00rootroot00000000000000(function () { 'use strict'; before(); debugger; after(); })(); rollup-3.29.4/test/form/samples/preserve-debugger/_expected/system.js000066400000000000000000000002141450520414700257520ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { before(); debugger; after(); }) }; })); rollup-3.29.4/test/form/samples/preserve-debugger/_expected/umd.js000066400000000000000000000002511450520414700252140ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; before(); debugger; after(); })); rollup-3.29.4/test/form/samples/preserve-debugger/main.js000066400000000000000000000000351450520414700234130ustar00rootroot00000000000000before(); debugger; after(); rollup-3.29.4/test/form/samples/preserves-comments-after-imports/000077500000000000000000000000001450520414700251515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/preserves-comments-after-imports/_config.js000066400000000000000000000003151450520414700271120ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves comments between imports and first statement', options: { output: { name: 'myBundle' } } }); // https://github.com/esperantojs/esperanto/issues/187 rollup-3.29.4/test/form/samples/preserves-comments-after-imports/_expected/000077500000000000000000000000001450520414700271115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/preserves-comments-after-imports/_expected/amd.js000066400000000000000000000002661450520414700302140ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; /** A comment for a number */ var number = 5; /** A comment for obj */ var obj = { number }; exports.obj = obj; })); rollup-3.29.4/test/form/samples/preserves-comments-after-imports/_expected/cjs.js000066400000000000000000000002011450520414700302170ustar00rootroot00000000000000'use strict'; /** A comment for a number */ var number = 5; /** A comment for obj */ var obj = { number }; exports.obj = obj; rollup-3.29.4/test/form/samples/preserves-comments-after-imports/_expected/es.js000066400000000000000000000001571450520414700300610ustar00rootroot00000000000000/** A comment for a number */ var number = 5; /** A comment for obj */ var obj = { number }; export { obj }; rollup-3.29.4/test/form/samples/preserves-comments-after-imports/_expected/iife.js000066400000000000000000000003071450520414700303630ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; /** A comment for a number */ var number = 5; /** A comment for obj */ var obj = { number }; exports.obj = obj; return exports; })({}); rollup-3.29.4/test/form/samples/preserves-comments-after-imports/_expected/system.js000066400000000000000000000003631450520414700307750ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { /** A comment for a number */ var number = 5; /** A comment for obj */ var obj = exports('obj', { number }); }) }; })); rollup-3.29.4/test/form/samples/preserves-comments-after-imports/_expected/umd.js000066400000000000000000000007251450520414700302400ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {})); })(this, (function (exports) { 'use strict'; /** A comment for a number */ var number = 5; /** A comment for obj */ var obj = { number }; exports.obj = obj; })); rollup-3.29.4/test/form/samples/preserves-comments-after-imports/main.js000066400000000000000000000001501450520414700264270ustar00rootroot00000000000000import { number } from './number.js'; /** A comment for obj */ var obj = { number }; export { obj }; rollup-3.29.4/test/form/samples/preserves-comments-after-imports/number.js000066400000000000000000000001031450520414700267710ustar00rootroot00000000000000/** A comment for a number */ var number = 5; export { number }; rollup-3.29.4/test/form/samples/probe-external-namespace/000077500000000000000000000000001450520414700233775ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/probe-external-namespace/_config.js000066400000000000000000000002511450520414700253370ustar00rootroot00000000000000module.exports = defineTest({ description: 'allow probing external namespaces without causing errors due to missing imports', options: { external: 'external' } }); rollup-3.29.4/test/form/samples/probe-external-namespace/_expected/000077500000000000000000000000001450520414700253375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/probe-external-namespace/_expected/amd.js000066400000000000000000000011251450520414700264350ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); console.log(external__namespace.default, external__namespace.foo); })); rollup-3.29.4/test/form/samples/probe-external-namespace/_expected/cjs.js000066400000000000000000000010661450520414700264570ustar00rootroot00000000000000'use strict'; var external = require('external'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); console.log(external__namespace.default, external__namespace.foo); rollup-3.29.4/test/form/samples/probe-external-namespace/_expected/es.js000066400000000000000000000001241450520414700263010ustar00rootroot00000000000000import * as external from 'external'; console.log(external.default, external.foo); rollup-3.29.4/test/form/samples/probe-external-namespace/_expected/iife.js000066400000000000000000000011121450520414700266040ustar00rootroot00000000000000(function (external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); console.log(external__namespace.default, external__namespace.foo); })(external); rollup-3.29.4/test/form/samples/probe-external-namespace/_expected/system.js000066400000000000000000000003531450520414700272220ustar00rootroot00000000000000System.register(['external'], (function () { 'use strict'; var external; return { setters: [function (module) { external = module; }], execute: (function () { console.log(external.default, external.foo); }) }; })); rollup-3.29.4/test/form/samples/probe-external-namespace/_expected/umd.js000066400000000000000000000015731450520414700264700ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external')) : typeof define === 'function' && define.amd ? define(['external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.external)); })(this, (function (external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); console.log(external__namespace.default, external__namespace.foo); })); rollup-3.29.4/test/form/samples/probe-external-namespace/main.js000066400000000000000000000001241450520414700246560ustar00rootroot00000000000000import * as external from 'external'; console.log(external.default, external.foo); rollup-3.29.4/test/form/samples/promises/000077500000000000000000000000001450520414700203575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/promises/_config.js000066400000000000000000000001221450520414700223140ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not remove promise creations' }); rollup-3.29.4/test/form/samples/promises/_expected.js000066400000000000000000000007431450520414700226610ustar00rootroot00000000000000Promise.resolve({ then() { console.log(1); } }); Promise.resolve({ get then() { return () => console.log(2); } }); Promise.reject('should be kept for uncaught rejections'); Promise.all([ { then() { console.log(3); } }, null ]); Promise.all([ null, { get then() { return () => console.log(4); } } ]); Promise.race([ { then() { console.log(5); } }, null ]); Promise.race([ null, { get then() { return () => console.log(6); } } ]); rollup-3.29.4/test/form/samples/promises/main.js000066400000000000000000000007431450520414700216450ustar00rootroot00000000000000Promise.resolve({ then() { console.log(1); } }); Promise.resolve({ get then() { return () => console.log(2); } }); Promise.reject('should be kept for uncaught rejections'); Promise.all([ { then() { console.log(3); } }, null ]); Promise.all([ null, { get then() { return () => console.log(4); } } ]); Promise.race([ { then() { console.log(5); } }, null ]); Promise.race([ null, { get then() { return () => console.log(6); } } ]); rollup-3.29.4/test/form/samples/proper-this-context/000077500000000000000000000000001450520414700224545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/proper-this-context/_config.js000066400000000000000000000002261450520414700244160ustar00rootroot00000000000000module.exports = defineTest({ description: 'make sure "this" respects the context for arrow functions', expectedWarnings: ['THIS_IS_UNDEFINED'] }); rollup-3.29.4/test/form/samples/proper-this-context/_expected.js000066400000000000000000000001421450520414700247470ustar00rootroot00000000000000const mutateThis = () => { undefined.x = 1; }; function Test () { mutateThis(); } new Test(); rollup-3.29.4/test/form/samples/proper-this-context/main.js000066400000000000000000000001521450520414700237340ustar00rootroot00000000000000const mutateThis = () => { this.x = 1; }; function Test () { mutateThis(); } const test = new Test(); rollup-3.29.4/test/form/samples/property-setters-and-getters/000077500000000000000000000000001450520414700243045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/property-setters-and-getters/access-when-called-effect/000077500000000000000000000000001450520414700311605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/property-setters-and-getters/access-when-called-effect/_config.js000066400000000000000000000001451450520414700331220ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects access side-effects when calling a getter' }); rollup-3.29.4/test/form/samples/property-setters-and-getters/access-when-called-effect/_expected.js000066400000000000000000000007521450520414700334620ustar00rootroot00000000000000const called1 = { get value() { console.log('retained'); return function() {}; } }; called1.value(); const instantiated1 = { get value() { console.log('retained'); return class {}; } }; new instantiated1.value(); const called2 = { get value() { return function() { console.log('retained'); }; } }; called2.value(); const instantiated2 = { get value() { return class { constructor() { console.log('retained'); } }; } }; new instantiated2.value(); rollup-3.29.4/test/form/samples/property-setters-and-getters/access-when-called-effect/main.js000066400000000000000000000007521450520414700324460ustar00rootroot00000000000000const called1 = { get value() { console.log('retained'); return function() {}; } }; called1.value(); const instantiated1 = { get value() { console.log('retained'); return class {}; } }; new instantiated1.value(); const called2 = { get value() { return function() { console.log('retained'); }; } }; called2.value(); const instantiated2 = { get value() { return class { constructor() { console.log('retained'); } }; } }; new instantiated2.value(); rollup-3.29.4/test/form/samples/property-setters-and-getters/early-access-getter-return/000077500000000000000000000000001450520414700314645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/property-setters-and-getters/early-access-getter-return/_config.js000066400000000000000000000001771450520414700334330ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles accessing the return expression of a getter before it has been bound' }); rollup-3.29.4/test/form/samples/property-setters-and-getters/early-access-getter-return/_expected.js000066400000000000000000000001601450520414700337570ustar00rootroot00000000000000function getReturnExpressionBeforeInit() { { console.log('retained'); } } getReturnExpressionBeforeInit(); rollup-3.29.4/test/form/samples/property-setters-and-getters/early-access-getter-return/main.js000066400000000000000000000003401450520414700327430ustar00rootroot00000000000000function getReturnExpressionBeforeInit() { const bar = { [foo.value()]: true }; if (bar.baz) { console.log('retained'); } } const foo = { get value() { return () => 'baz'; } }; getReturnExpressionBeforeInit(); rollup-3.29.4/test/form/samples/property-setters-and-getters/early-access-getter-value/000077500000000000000000000000001450520414700312615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/property-setters-and-getters/early-access-getter-value/_config.js000066400000000000000000000001631450520414700332230ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles accessing the value of a getter before it has been bound' }); rollup-3.29.4/test/form/samples/property-setters-and-getters/early-access-getter-value/_expected.js000066400000000000000000000001501450520414700335530ustar00rootroot00000000000000function getLiteralValueBeforeInit() { { console.log('retained'); } } getLiteralValueBeforeInit(); rollup-3.29.4/test/form/samples/property-setters-and-getters/early-access-getter-value/main.js000066400000000000000000000003201450520414700325360ustar00rootroot00000000000000function getLiteralValueBeforeInit() { const bar = { [foo.value]: true }; if (bar.baz) { console.log('retained'); } } const foo = { get value() { return 'baz'; } }; getLiteralValueBeforeInit(); rollup-3.29.4/test/form/samples/property-setters-and-getters/shadowed-setters/000077500000000000000000000000001450520414700275715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/property-setters-and-getters/shadowed-setters/_config.js000066400000000000000000000001371450520414700315340ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles setters shadowed by computed setters' }); rollup-3.29.4/test/form/samples/property-setters-and-getters/shadowed-setters/_expected.js000066400000000000000000000002071450520414700320660ustar00rootroot00000000000000const objRetained = { set value(v) {}, set [globalThis.unknown](v) { console.log('effect'); } }; objRetained.value = 'retained'; rollup-3.29.4/test/form/samples/property-setters-and-getters/shadowed-setters/main.js000066400000000000000000000003771450520414700310620ustar00rootroot00000000000000const objRemoved = { set value(v) { console.log('shadowed'); }, set value(v) {} }; objRemoved.value = 'removed'; const objRetained = { set value(v) {}, set [globalThis.unknown](v) { console.log('effect'); } }; objRetained.value = 'retained'; rollup-3.29.4/test/form/samples/protect-cjs-globals/000077500000000000000000000000001450520414700223745ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/protect-cjs-globals/_config.js000066400000000000000000000002111450520414700243300ustar00rootroot00000000000000module.exports = defineTest({ description: 'prevent conflicts with cjs module globals', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/protect-cjs-globals/_expected/000077500000000000000000000000001450520414700243345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/protect-cjs-globals/_expected/amd.js000066400000000000000000000005001450520414700254260ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const exports$1 = 1; const require = 2; const module = 3; const __filename = 4; const __dirname = 5; exports.__dirname = __dirname; exports.__filename = __filename; exports.exports = exports$1; exports.module = module; exports.require = require; })); rollup-3.29.4/test/form/samples/protect-cjs-globals/_expected/cjs.js000066400000000000000000000004261450520414700254530ustar00rootroot00000000000000'use strict'; const exports$1 = 1; const require$1 = 2; const module$1 = 3; const __filename$1 = 4; const __dirname$1 = 5; exports.__dirname = __dirname$1; exports.__filename = __filename$1; exports.exports = exports$1; exports.module = module$1; exports.require = require$1; rollup-3.29.4/test/form/samples/protect-cjs-globals/_expected/es.js000066400000000000000000000002401450520414700252750ustar00rootroot00000000000000const exports = 1; const require = 2; const module = 3; const __filename = 4; const __dirname = 5; export { __dirname, __filename, exports, module, require }; rollup-3.29.4/test/form/samples/protect-cjs-globals/_expected/iife.js000066400000000000000000000005171450520414700256110ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const exports$1 = 1; const require = 2; const module = 3; const __filename = 4; const __dirname = 5; exports.__dirname = __dirname; exports.__filename = __filename; exports.exports = exports$1; exports.module = module; exports.require = require; return exports; })({}); rollup-3.29.4/test/form/samples/protect-cjs-globals/_expected/system.js000066400000000000000000000005251450520414700262200ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const exports$1 = exports('exports', 1); const require = exports('require', 2); const module$1 = exports('module', 3); const __filename = exports('__filename', 4); const __dirname = exports('__dirname', 5); }) }; })); rollup-3.29.4/test/form/samples/protect-cjs-globals/_expected/umd.js000066400000000000000000000011351450520414700254570ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; const exports$1 = 1; const require = 2; const module = 3; const __filename = 4; const __dirname = 5; exports.__dirname = __dirname; exports.__filename = __filename; exports.exports = exports$1; exports.module = module; exports.require = require; })); rollup-3.29.4/test/form/samples/protect-cjs-globals/main.js000066400000000000000000000002061450520414700236540ustar00rootroot00000000000000export const exports = 1; export const require = 2; export const module = 3; export const __filename = 4; export const __dirname = 5; rollup-3.29.4/test/form/samples/proto-null/000077500000000000000000000000001450520414700206315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/proto-null/_config.js000066400000000000000000000001461450520414700225740ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles getters and setters on __proto__ properties' }); rollup-3.29.4/test/form/samples/proto-null/_expected.js000066400000000000000000000000621450520414700231250ustar00rootroot00000000000000console.log('retained'); console.log('retained'); rollup-3.29.4/test/form/samples/proto-null/main.js000066400000000000000000000002541450520414700221140ustar00rootroot00000000000000const a = { __proto__: null }; if (a.hasOwnProperty) console.log('removed'); else console.log('retained'); if (a.foo) console.log('removed'); else console.log('retained'); rollup-3.29.4/test/form/samples/prototype-functions/000077500000000000000000000000001450520414700225715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/prototype-functions/_config.js000066400000000000000000000001301450520414700245250ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly includes prototype functions' }); rollup-3.29.4/test/form/samples/prototype-functions/_expected.js000066400000000000000000000002351450520414700250670ustar00rootroot00000000000000function Foo () { this.doIt(); } Foo.prototype.doIt = function () { this.foo.tooDeep = 1; this.foo['b' + 'ar'] = 2; this.doesNotExist(); }; new Foo(); rollup-3.29.4/test/form/samples/prototype-functions/main.js000066400000000000000000000002511450520414700240510ustar00rootroot00000000000000function Foo () { this.doIt(); } Foo.prototype.doIt = function () { this.foo.tooDeep = 1; this.foo['b' + 'ar'] = 2; this.doesNotExist(); }; const foo = new Foo(); rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/000077500000000000000000000000001450520414700245455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/_config.js000066400000000000000000000003611450520414700265070ustar00rootroot00000000000000module.exports = defineTest({ description: 'prunes pure unused external imports ([#1352])', options: { external: ['external', 'other'], treeshake: { moduleSideEffects: ['other'] }, output: { globals: { other: 'other' } } } }); rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/_expected/000077500000000000000000000000001450520414700265055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/_expected/amd.js000066400000000000000000000000741450520414700276050ustar00rootroot00000000000000define(['other'], (function (other) { 'use strict'; })); rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/_expected/cjs.js000066400000000000000000000000421450520414700276160ustar00rootroot00000000000000'use strict'; require('other'); rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/_expected/es.js000066400000000000000000000000201450520414700274420ustar00rootroot00000000000000import 'other'; rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/_expected/iife.js000066400000000000000000000000471450520414700277600ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/_expected/system.js000066400000000000000000000002011450520414700303600ustar00rootroot00000000000000System.register(['other'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/_expected/umd.js000066400000000000000000000002251450520414700276270ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['other'], factory) : factory(); })((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/prune-pure-unused-import-array/main.js000066400000000000000000000001671450520414700260330ustar00rootroot00000000000000import { unused } from 'external'; import { notused } from 'other'; function alsoUnused () { unused(); notused(); } rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/000077500000000000000000000000001450520414700252545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/_config.js000066400000000000000000000004441450520414700272200ustar00rootroot00000000000000module.exports = defineTest({ description: 'prunes pure unused external imports ([#1352])', expectedWarnings: ['EMPTY_BUNDLE'], options: { external: ['external', 'other'], treeshake: { moduleSideEffects: id => id !== 'external' }, output: { globals: { other: 'other' } } } }); rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/_expected/000077500000000000000000000000001450520414700272145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/_expected/amd.js000066400000000000000000000000741450520414700303140ustar00rootroot00000000000000define(['other'], (function (other) { 'use strict'; })); rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/_expected/cjs.js000066400000000000000000000000421450520414700303250ustar00rootroot00000000000000'use strict'; require('other'); rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/_expected/es.js000066400000000000000000000000201450520414700301510ustar00rootroot00000000000000import 'other'; rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/_expected/iife.js000066400000000000000000000000471450520414700304670ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/_expected/system.js000066400000000000000000000002011450520414700310670ustar00rootroot00000000000000System.register(['other'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/_expected/umd.js000066400000000000000000000002251450520414700303360ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['other'], factory) : factory(); })((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/prune-pure-unused-import-function/main.js000066400000000000000000000001671450520414700265420ustar00rootroot00000000000000import { unused } from 'external'; import { notused } from 'other'; function alsoUnused () { unused(); notused(); } rollup-3.29.4/test/form/samples/prune-pure-unused-import/000077500000000000000000000000001450520414700234315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/prune-pure-unused-import/_config.js000066400000000000000000000003521450520414700253730ustar00rootroot00000000000000module.exports = defineTest({ description: 'prunes pure unused external imports ([#1352])', expectedWarnings: ['EMPTY_BUNDLE'], options: { external: ['external', 'other'], treeshake: { moduleSideEffects: 'no-external' } } }); rollup-3.29.4/test/form/samples/prune-pure-unused-import/_expected/000077500000000000000000000000001450520414700253715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/prune-pure-unused-import/_expected/amd.js000066400000000000000000000000541450520414700264670ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/prune-pure-unused-import/_expected/cjs.js000066400000000000000000000000171450520414700265040ustar00rootroot00000000000000'use strict'; rollup-3.29.4/test/form/samples/prune-pure-unused-import/_expected/es.js000066400000000000000000000000011450520414700263250ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/prune-pure-unused-import/_expected/iife.js000066400000000000000000000000471450520414700266440ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-3.29.4/test/form/samples/prune-pure-unused-import/_expected/system.js000066400000000000000000000001471450520414700272550ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/prune-pure-unused-import/_expected/umd.js000066400000000000000000000002121450520414700265070ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/prune-pure-unused-import/main.js000066400000000000000000000001121450520414700247050ustar00rootroot00000000000000import { unused } from 'external'; function alsoUnused () { unused(); } rollup-3.29.4/test/form/samples/pure-class-field/000077500000000000000000000000001450520414700216555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/pure-class-field/_config.js000066400000000000000000000001331450520414700236140ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains pure annotations in class fields' }); rollup-3.29.4/test/form/samples/pure-class-field/_expected.js000066400000000000000000000001501450520414700241470ustar00rootroot00000000000000class main { static k = /*#__PURE__*/ V(); static [/*#__PURE__*/ W()]; } export { main as default }; rollup-3.29.4/test/form/samples/pure-class-field/main.js000066400000000000000000000001251450520414700231350ustar00rootroot00000000000000export default class { static k = /*#__PURE__*/ V(); static [/*#__PURE__*/ W()]; } rollup-3.29.4/test/form/samples/pure-comment-line-break/000077500000000000000000000000001450520414700231405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/pure-comment-line-break/_config.js000066400000000000000000000001601450520414700250770ustar00rootroot00000000000000module.exports = defineTest({ description: 'adjust line-break handling when dealing with pure annotations' }); rollup-3.29.4/test/form/samples/pure-comment-line-break/_expected.js000066400000000000000000000017051450520414700254410ustar00rootroot00000000000000const x = 'code'; console.log('should remain impure'); console.log('should remain impure'); console.log('code'); console.log('should remain impure'); console.log('code'); console.log('should remain impure'); console.log('should remain impure'); console.log('code'); console.log('should remain impure'); console.log('code'), console.log('should remain impure'); console.log('code'), console.log('should remain impure'); console.log('should remain impure'); console.log('code'); console.log('should remain impure'); console.log('should remain impure'); console.log('should remain impure') ; console.log('code'); console.log('should remain impure', x); { console.log('should remain impure'); } keep1() ; keep2(); keep3() ; keep4() ; /* other comment */ keep5(); keep6() ; // other comment keep7(); keep8() && keep9(); Keep1() , Keep2(), Keep3() , Keep4() , /* other comment */ Keep5(), Keep6() , // other comment Keep7(), Keep8() && Keep9(); rollup-3.29.4/test/form/samples/pure-comment-line-break/dep.js000066400000000000000000000001241450520414700242430ustar00rootroot00000000000000const x = 'code';//@__PURE__ export default x; console.log('should remain impure'); rollup-3.29.4/test/form/samples/pure-comment-line-break/main.js000066400000000000000000000031561450520414700244270ustar00rootroot00000000000000/*@__PURE__*/ (() => {})(); console.log('should remain impure'); console.log('code');//@__PURE__ (() => {})(); console.log('should remain impure'); console.log('code')/*@__PURE__*/; (() => {})(); console.log('should remain impure'); (() => {})();//@__PURE__ (() => {})(); console.log('should remain impure'); console.log('code');/*@__PURE__*///@__PURE__ /*@__PURE__*/ (() => {})(); console.log('should remain impure'); console.log('code'),//@__PURE__ (() => {})(),console.log('should remain impure'); console.log('code')/*@__PURE__*/, (() => {})(),console.log('should remain impure'); (() => {})(),//@__PURE__ (() => {})(),console.log('should remain impure'); console.log('code');//@__PURE__ ;console.log('should remain impure'); /*@__PURE__*/true && console.log('should remain impure'); /*@__PURE__*/true ? console.log('should remain impure') : console.log('code'); console.log('code');//@__PURE__ import code from './dep.js'; console.log('should remain impure', code); /*@__PURE__*/ if (true) { console.log('should remain impure'); } /*@__PURE__*/ drop1(); /*@__PURE__*/ drop2(); keep1() /*@__PURE__*/ ; keep2(); keep3() ; /*@__PURE__*/ drop3(); keep4() /*@__PURE__*/ ; /* other comment */ keep5(); keep6() /*@__PURE__*/ ; // other comment keep7(); keep8() /*@__PURE__*/ && keep9(); /*@__PURE__*/ Drop1(), /*@__PURE__*/ Drop2(), Keep1() /*@__PURE__*/ , Keep2(), Keep3() , /*@__PURE__*/ Drop3(), Keep4() /*@__PURE__*/ , /* other comment */ Keep5(), Keep6() /*@__PURE__*/ , // other comment Keep7(), Keep8() /*@__PURE__*/ && Keep9(); /*@__PURE__*/ Drop10(), /*@__PURE__*/ Drop11(), /*@__PURE__*/ Drop12(), /*@__PURE__*/ Drop13(); rollup-3.29.4/test/form/samples/pure-comment-scenarios-complex/000077500000000000000000000000001450520414700245625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/pure-comment-scenarios-complex/_config.js000066400000000000000000000003621450520414700265250ustar00rootroot00000000000000// tests compiled from https://github.com/mishoo/UglifyJS2/blob/bcebacbb9e7ddac7d9c0e4ca2c7e0faf0e0bca7c/test/compress/issue-1261.js module.exports = defineTest({ description: 'correctly handles various advanced pure comment scenarios' }); rollup-3.29.4/test/form/samples/pure-comment-scenarios-complex/_expected.js000066400000000000000000000012161450520414700270600ustar00rootroot00000000000000// pure top-level IIFE will be dropped // pure top-level IIFE assigned to unreferenced var will not be dropped global.iife1 = /*@__PURE__*/(function() { console.log("iife1"); function iife1() {} return iife1; })(); baz(), quux(); a.b(), f.g(); /* @__PURE__ */(function(){})() || true ? foo() : bar(); foo() ; /* @__PURE__ */(function(){})() && false ? foo() : bar(); bar(); /* @__PURE__ */(function(){})() + "foo" ? bar() : baz(); "foo" + /* @__PURE__ */(function(){})() ? bar() : baz(); /* @__PURE__ */(function(){})() ? foo() : foo(); [/* @__PURE__ */(function(){})()] ? foo() : bar(); !{ foo: /* @__PURE__ */(function(){})() } ? bar() : baz(); rollup-3.29.4/test/form/samples/pure-comment-scenarios-complex/main.js000066400000000000000000000026361450520414700260530ustar00rootroot00000000000000// pure top-level IIFE will be dropped // @__PURE__ - comment (function() { console.log("iife0"); })(); // pure top-level IIFE assigned to unreferenced var will not be dropped global.iife1 = /*@__PURE__*/(function() { console.log("iife1"); function iife1() {} return iife1; })(); (function(){ // pure IIFE in function scope assigned to unreferenced var will be dropped var iife2 = /*#__PURE__*/(function() { console.log("iife2"); function iife2() {} return iife2; })(); })(); // pure top-level calls will be dropped regardless of the leading comments position var MyClass = /*#__PURE__*//*@class*/(function(){ function MyClass() {} MyClass.prototype.method = function() {}; return MyClass; })(); // comment #__PURE__ comment bar(); // comment #__PURE__ comment bar(), baz(), quux(); a.b(), /* @__PURE__ */ c.d.e(), f.g(); var x, y; /* @__PURE__ */(function(){x})(), void/* @__PURE__ */(function(){y})(); /* @__PURE__ */(function(){x})() || true ? foo() : bar(); true || /* @__PURE__ */(function(){y})() ? foo() : bar(); /* @__PURE__ */(function(){x})() && false ? foo() : bar(); false && /* @__PURE__ */(function(){y})() ? foo() : bar(); /* @__PURE__ */(function(){x})() + "foo" ? bar() : baz(); "foo" + /* @__PURE__ */(function(){y})() ? bar() : baz(); /* @__PURE__ */(function(){x})() ? foo() : foo(); [/* @__PURE__ */(function(){x})()] ? foo() : bar(); !{ foo: /* @__PURE__ */(function(){x})() } ? bar() : baz(); rollup-3.29.4/test/form/samples/pure-comment-scenarios-simple/000077500000000000000000000000001450520414700244045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/pure-comment-scenarios-simple/_config.js000066400000000000000000000003511450520414700263450ustar00rootroot00000000000000// tests compiled from https://github.com/mishoo/UglifyJS2/blob/88c8f4e363e0d585b33ea29df560243d3dc74ce1/test/compress/pure_funcs.js module.exports = defineTest({ description: 'correctly handles various pure comment scenarios' }); rollup-3.29.4/test/form/samples/pure-comment-scenarios-simple/_expected.js000066400000000000000000000015661450520414700267120ustar00rootroot00000000000000// removed // can be simplified ( y()); ( y()); (w(), y()); (w(), y()); /*@__PURE__*/(g() || h())(x(), y()); /*@__PURE__*/new (g() || h())(x(), y()); (/*@__PURE__*/ (a() || b()))(c(), d()); new (/*@__PURE__*/ (a() || b()))(c(), d()); [ /*@__PURE__*/ x(), y() ]; [ /*@__PURE__*/ new x(), y() ]; [ w(), /*@__PURE__*/ x(), y() ]; [ w(), /*@__PURE__*/ new x(), y() ]; // retained ( a)(); ( b)(1)(2)(3); (/*@__PURE__*/ c(1))(2)(3); (/*@__PURE__*/ d(1)(2))(3); ( e).x(1).y(2).z(3); ( f.x)(1).y(2).z(3); (/*@__PURE__*/ g.x(1)).y(2).z(3); ( h.x(1).y)(2).z(3); (/*@__PURE__*/ i.x(1).y(2)).z(3); ( j.x(1).y(2).z)(3); new ( k)(); new ( l)(1)(2)(3); (/*@__PURE__*/ new m(1))(2)(3); (/*@__PURE__*/ new n(1)(2))(3); new ( o).x(1).y(2).z(3); /* */ new ( p.x)(1).y(2).z(3); (/*@__PURE__*/ new q.x(1)).y(2).z(3); ( new r.x(1).y)(2).z(3); (/*@__PURE__*/ new s.x(1).y(2)).z(3); ( new t.x(1).y(2).z)(3); rollup-3.29.4/test/form/samples/pure-comment-scenarios-simple/main.js000066400000000000000000000042001450520414700256620ustar00rootroot00000000000000// removed /*@__PURE__*/ a(); /*@__PURE__*/ (b()); (/*@__PURE__*/ c()); /*@__PURE__*/ d(1)(2)(3); /*@__PURE__*/ (e(1))(2)(3); /*@__PURE__*/ (f(1)(2))(3); /*@__PURE__*/ (g(1)(2)(3)); (/*@__PURE__*/ h(1)(2)(3)); /*@__PURE__*/ i.x(1).y(2).z(3); /*@__PURE__*/ (j.x)(1).y(2).z(3); /*@__PURE__*/ (k.x(1)).y(2).z(3); /*@__PURE__*/ (l.x(1).y)(2).z(3); /*@__PURE__*/ (m.x(1).y(2)).z(3); /*@__PURE__*/ (n.x(1).y(2).z)(3); /*@__PURE__*/ (o.x(1).y(2).z(3)); (/*@__PURE__*/ p.x(1).y(2).z(3)); [ /*@__PURE__*/ q() ]; /*@__PURE__*/ new r(); /*@__PURE__*/ (new s()); (/*@__PURE__*/ new t()); /*@__PURE__*/ new u(1)(2)(3); /*@__PURE__*/ new (v(1))(2)(3); /*@__PURE__*/ new (w(1)(2))(3); /*@__PURE__*/ new (x(1)(2)(3)); (/*@__PURE__*/ new y(1)(2)(3)); /*@__PURE__*/ new z.x(1).y(2).z(3); /*@__PURE__*/ new (a.x)(1).y(2).z(3); /*@__PURE__*/ new (b.x(1)).y(2).z(3); /*@__PURE__*/ new (c.x(1).y)(2).z(3); /*@__PURE__*/ new (d.x(1).y(2)).z(3); /*@__PURE__*/ new (e.x(1).y(2).z)(3); /*@__PURE__*/ new (f.x(1).y(2).z(3)); (/*@__PURE__*/ new g.x(1).y(2).z(3)); [ /*@__PURE__*/ new h() ]; // can be simplified (/*@__PURE__*/ x(), y()); (/*@__PURE__*/ new x(), y()); (w(), /*@__PURE__*/ x(), y()); (w(), /*@__PURE__*/ new x(), y()); /*@__PURE__*/(g() || h())(x(), y()); /*@__PURE__*/new (g() || h())(x(), y()); (/*@__PURE__*/ (a() || b()))(c(), d()); new (/*@__PURE__*/ (a() || b()))(c(), d()); [ /*@__PURE__*/ x(), y() ]; [ /*@__PURE__*/ new x(), y() ]; [ w(), /*@__PURE__*/ x(), y() ]; [ w(), /*@__PURE__*/ new x(), y() ]; // retained (/*@__PURE__*/ a)(); (/*@__PURE__*/ b)(1)(2)(3); (/*@__PURE__*/ c(1))(2)(3); (/*@__PURE__*/ d(1)(2))(3); (/*@__PURE__*/ e).x(1).y(2).z(3); (/*@__PURE__*/ f.x)(1).y(2).z(3); (/*@__PURE__*/ g.x(1)).y(2).z(3); (/*@__PURE__*/ h.x(1).y)(2).z(3); (/*@__PURE__*/ i.x(1).y(2)).z(3); (/*@__PURE__*/ j.x(1).y(2).z)(3); new (/*@__PURE__*/ k)(); new (/*@__PURE__*/ l)(1)(2)(3); (/*@__PURE__*/ new m(1))(2)(3); (/*@__PURE__*/ new n(1)(2))(3); new (/*@__PURE__*/ o).x(1).y(2).z(3); /* */ new (/*@__PURE__*/ p.x)(1).y(2).z(3); (/*@__PURE__*/ new q.x(1)).y(2).z(3); (/*@__PURE__*/ new r.x(1).y)(2).z(3); (/*@__PURE__*/ new s.x(1).y(2)).z(3); (/*@__PURE__*/ new t.x(1).y(2).z)(3); rollup-3.29.4/test/form/samples/pure-comments-disabled/000077500000000000000000000000001450520414700230615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/pure-comments-disabled/_config.js000066400000000000000000000002421450520414700250210ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not rely on pure annotations if they are disabled', options: { treeshake: { annotations: false } } }); rollup-3.29.4/test/form/samples/pure-comments-disabled/_expected.js000066400000000000000000000010071450520414700253550ustar00rootroot00000000000000// should be retained /*@__PURE__*/ a(); /*@__PURE__*/ new a(); console.log('code'); console.log('should remain impure'); /*@__PURE__*/ drop1(); /*@__PURE__*/ drop2(); keep1() ; keep2(); keep3() ; /*@__PURE__*/ drop3(); keep4() ; /* other comment */ keep5(); keep6() ; // other comment keep7(); keep8() && keep9(); /*@__PURE__*/ Drop1(), /*@__PURE__*/ Drop2(), Keep1() , Keep2(), Keep3() , /*@__PURE__*/ Drop3(), Keep4() , /* other comment */ Keep5(), Keep6() , // other comment Keep7(), Keep8() && Keep9(); rollup-3.29.4/test/form/samples/pure-comments-disabled/main.js000066400000000000000000000012271450520414700243450ustar00rootroot00000000000000// should be retained /*@__PURE__*/ a(); /*@__PURE__*/ new a(); console.log('code')/*@__PURE__*/; /*@__PURE__*/(() => {})(); console.log('should remain impure'); /*@__PURE__*/ drop1(); /*@__PURE__*/ drop2(); keep1() /*@__PURE__*/ ; keep2(); keep3() ; /*@__PURE__*/ drop3(); keep4() /*@__PURE__*/ ; /* other comment */ keep5(); keep6() /*@__PURE__*/ ; // other comment keep7(); keep8() /*@__PURE__*/ && keep9(); /*@__PURE__*/ Drop1(), /*@__PURE__*/ Drop2(), Keep1() /*@__PURE__*/ , Keep2(), Keep3() , /*@__PURE__*/ Drop3(), Keep4() /*@__PURE__*/ , /* other comment */ Keep5(), Keep6() /*@__PURE__*/ , // other comment Keep7(), Keep8() /*@__PURE__*/ && Keep9(); rollup-3.29.4/test/form/samples/pure-comments-multiple/000077500000000000000000000000001450520414700231455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/pure-comments-multiple/_config.js000066400000000000000000000002041450520414700251030ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not associate multiple "pure" comments before a token with subsequent tokens' }); rollup-3.29.4/test/form/samples/pure-comments-multiple/_expected.js000066400000000000000000000000141450520414700254360ustar00rootroot00000000000000retained(); rollup-3.29.4/test/form/samples/pure-comments-multiple/main.js000066400000000000000000000001311450520414700244220ustar00rootroot00000000000000/*#__PURE__*//*#__PURE__*//*#__PURE__*//*#__PURE__*//*#__PURE__*/ removed(); retained(); rollup-3.29.4/test/form/samples/quote-id/000077500000000000000000000000001450520414700202455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/quote-id/_config.js000066400000000000000000000015541450520414700222140ustar00rootroot00000000000000const path = require('node:path'); const external1 = "quoted'\r\n\u2028\u2029external1"; const external2 = path.join(__dirname, "quoted'\r\n\u2028\u2029external2"); const external3 = 'C:\\File\\Path.js'; module.exports = defineTest({ description: 'handles escaping for external ids', options: { output: { paths: id => { if (id === external3) return id; return path.relative(__dirname, id); }, name: 'Q', globals: { [external1]: 'quotedExternal1', [external2]: 'quotedExternal2', [external3]: 'quotedExternal3' } }, plugins: [ { resolveId(id) { if (id === 'external1') { return { id: external1, external: true }; } if (id === 'external2') { return { id: external2, external: true }; } if (id === 'external3') { return { id: external3, external: true }; } } } ] } }); rollup-3.29.4/test/form/samples/quote-id/_expected/000077500000000000000000000000001450520414700222055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/quote-id/_expected/amd.js000066400000000000000000000004061450520414700233040ustar00rootroot00000000000000define(['quoted\'\ \ \
\
external1', 'quoted\'\ \ \
\
external2', 'C:\\File\\Path.js'], (function (quoted_____external1, quoted_____external2, Path_js) { 'use strict'; console.log(quoted_____external1.foo, quoted_____external2.bar, Path_js.baz); })); rollup-3.29.4/test/form/samples/quote-id/_expected/cjs.js000066400000000000000000000004241450520414700233220ustar00rootroot00000000000000'use strict'; var quoted_____external1 = require('quoted\'\ \ \
\
external1'); var quoted_____external2 = require('quoted\'\ \ \
\
external2'); var Path_js = require('C:\\File\\Path.js'); console.log(quoted_____external1.foo, quoted_____external2.bar, Path_js.baz); rollup-3.29.4/test/form/samples/quote-id/_expected/es.js000066400000000000000000000002601450520414700231500ustar00rootroot00000000000000import { foo } from 'quoted\'\ \ \
\
external1'; import { bar } from 'quoted\'\ \ \
\
external2'; import { baz } from 'C:\\File\\Path.js'; console.log(foo, bar, baz); rollup-3.29.4/test/form/samples/quote-id/_expected/iife.js000066400000000000000000000003311450520414700234540ustar00rootroot00000000000000(function (quoted_____external1, quoted_____external2, Path_js) { 'use strict'; console.log(quoted_____external1.foo, quoted_____external2.bar, Path_js.baz); })(quotedExternal1, quotedExternal2, quotedExternal3); rollup-3.29.4/test/form/samples/quote-id/_expected/system.js000066400000000000000000000006121450520414700240660ustar00rootroot00000000000000System.register('Q', ['quoted\'\ \ \
\
external1', 'quoted\'\ \ \
\
external2', 'C:\\File\\Path.js'], (function () { 'use strict'; var foo, bar, baz; return { setters: [function (module) { foo = module.foo; }, function (module) { bar = module.bar; }, function (module) { baz = module.baz; }], execute: (function () { console.log(foo, bar, baz); }) }; })); rollup-3.29.4/test/form/samples/quote-id/_expected/umd.js000066400000000000000000000013001450520414700233220ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('quoted\'\ \ \
\
external1'), require('quoted\'\ \ \
\
external2'), require('C:\\File\\Path.js')) : typeof define === 'function' && define.amd ? define(['quoted\'\ \ \
\
external1', 'quoted\'\ \ \
\
external2', 'C:\\File\\Path.js'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.quotedExternal1, global.quotedExternal2, global.quotedExternal3)); })(this, (function (quoted_____external1, quoted_____external2, Path_js) { 'use strict'; console.log(quoted_____external1.foo, quoted_____external2.bar, Path_js.baz); })); rollup-3.29.4/test/form/samples/quote-id/main.js000066400000000000000000000001771450520414700215340ustar00rootroot00000000000000import { foo } from 'external1'; import { bar } from 'external2'; import { baz } from 'external3'; console.log(foo, bar, baz); rollup-3.29.4/test/form/samples/re-export-aliasing/000077500000000000000000000000001450520414700222305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/re-export-aliasing/_config.js000066400000000000000000000002771450520414700242000ustar00rootroot00000000000000module.exports = defineTest({ description: 'external re-exports aliasing', options: { output: { globals: { d: 'd' }, name: 'reexportsAliasingExternal' }, external: ['d'] } }); rollup-3.29.4/test/form/samples/re-export-aliasing/_expected/000077500000000000000000000000001450520414700241705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/re-export-aliasing/_expected/amd.js000066400000000000000000000002541450520414700252700ustar00rootroot00000000000000define(['exports', 'd'], (function (exports, d) { 'use strict'; Object.defineProperty(exports, 'b', { enumerable: true, get: function () { return d.d; } }); })); rollup-3.29.4/test/form/samples/re-export-aliasing/_expected/cjs.js000066400000000000000000000002071450520414700253040ustar00rootroot00000000000000'use strict'; var d = require('d'); Object.defineProperty(exports, 'b', { enumerable: true, get: function () { return d.d; } }); rollup-3.29.4/test/form/samples/re-export-aliasing/_expected/es.js000066400000000000000000000000341450520414700251320ustar00rootroot00000000000000export { d as b } from 'd'; rollup-3.29.4/test/form/samples/re-export-aliasing/_expected/iife.js000066400000000000000000000003141450520414700254400ustar00rootroot00000000000000var reexportsAliasingExternal = (function (exports, d) { 'use strict'; Object.defineProperty(exports, 'b', { enumerable: true, get: function () { return d.d; } }); return exports; })({}, d); rollup-3.29.4/test/form/samples/re-export-aliasing/_expected/system.js000066400000000000000000000003171450520414700260530ustar00rootroot00000000000000System.register('reexportsAliasingExternal', ['d'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('b', module.d); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/re-export-aliasing/_expected/umd.js000066400000000000000000000007621450520414700253200ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d')) : typeof define === 'function' && define.amd ? define(['exports', 'd'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.reexportsAliasingExternal = {}, global.d)); })(this, (function (exports, d) { 'use strict'; Object.defineProperty(exports, 'b', { enumerable: true, get: function () { return d.d; } }); })); rollup-3.29.4/test/form/samples/re-export-aliasing/first.js000066400000000000000000000000341450520414700237120ustar00rootroot00000000000000export { d as a } from 'd'; rollup-3.29.4/test/form/samples/re-export-aliasing/main.js000066400000000000000000000000451450520414700235110ustar00rootroot00000000000000export { a as b } from './first.js'; rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/000077500000000000000000000000001450520414700266735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/_config.js000066400000000000000000000002271450520414700306360ustar00rootroot00000000000000module.exports = defineTest({ description: 'use legal names for exported functions and classed (#1943)', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/_expected/000077500000000000000000000000001450520414700306335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/_expected/amd.js000066400000000000000000000002371450520414700317340ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function foo () {} foo = 1; class bar {} bar = 1; exports.bar = bar; exports.foo = foo; })); rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/_expected/cjs.js000066400000000000000000000001511450520414700317450ustar00rootroot00000000000000'use strict'; function foo () {} foo = 1; class bar {} bar = 1; exports.bar = bar; exports.foo = foo; rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/_expected/es.js000066400000000000000000000001111450520414700315710ustar00rootroot00000000000000function foo () {} foo = 1; class bar {} bar = 1; export { bar, foo }; rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/_expected/iife.js000066400000000000000000000002561450520414700321100ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; function foo () {} foo = 1; class bar {} bar = 1; exports.bar = bar; exports.foo = foo; return exports; })({}); rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/_expected/system.js000066400000000000000000000004041450520414700325130ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { exports('foo', foo); function foo () {} exports('foo', foo = 1); class bar {} exports('bar', bar); exports('bar', bar = 1); }) }; })); rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/_expected/umd.js000066400000000000000000000006741450520414700317650ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; function foo () {} foo = 1; class bar {} bar = 1; exports.bar = bar; exports.foo = foo; })); rollup-3.29.4/test/form/samples/reassigned-exported-functions-and-classes/main.js000066400000000000000000000001011450520414700301450ustar00rootroot00000000000000export function foo () {} foo = 1; export class bar {} bar = 1; rollup-3.29.4/test/form/samples/recursive-assignments/000077500000000000000000000000001450520414700230565ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/recursive-assignments/_config.js000066400000000000000000000001741450520414700250220ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not fail for pathological recursive algorithms and circular structures' }); rollup-3.29.4/test/form/samples/recursive-assignments/_expected.js000066400000000000000000000002111450520414700253460ustar00rootroot00000000000000let foo = () => function () {}; foo.value = foo; while ( foo.value ) { foo = foo.value; } foo(); foo()(); new (foo())(); foo.bar = 1; rollup-3.29.4/test/form/samples/recursive-assignments/main.js000066400000000000000000000002101450520414700243310ustar00rootroot00000000000000let foo = () => function () {}; foo.value = foo; while ( foo.value ) { foo = foo.value; } foo(); foo()(); new (foo())() foo.bar = 1; rollup-3.29.4/test/form/samples/recursive-calls/000077500000000000000000000000001450520414700216215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/recursive-calls/_config.js000066400000000000000000000001221450520414700235560ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not fail for recursive calls' }); rollup-3.29.4/test/form/samples/recursive-calls/_expected.js000066400000000000000000000016131450520414700241200ustar00rootroot00000000000000const retained1 = () => globalThis.unknown ? retained1() : console.log( 'effect' ); retained1(); const retained2 = () => globalThis.unknown ? () => retained2()() : () => console.log( 'effect' ); retained2()(); const retained3 = () => globalThis.unknown ? retained3() : {}; retained3().x.y = 3; const retained4 = () => globalThis.unknown ? retained4() : { x: () => console.log( 'effect' ) }; retained4().x(); const retained5 = { get x () { return globalThis.unknown ? retained5.x : console.log( 'effect' ); } }; retained5.x; const retained6 = { get x () { return globalThis.unknown ? retained6.x : () => console.log( 'effect' ); } }; retained6.x(); const retained7 = { get x () { return globalThis.unknown ? retained7.x : {}; } }; retained7.x.y.z = 7; const retained8 = { get x () { return globalThis.unknown ? retained8.x : { y: () => console.log( 'effect' ) }; } }; retained8.x.y(); rollup-3.29.4/test/form/samples/recursive-calls/main.js000066400000000000000000000030141450520414700231010ustar00rootroot00000000000000const removed1 = () => globalThis.unknown || removed1(); removed1(); const removed2 = () => globalThis.unknown ? () => removed2()() : () => {}; removed2()(); const removed3 = () => globalThis.unknown ? removed3() : {}; removed3().x = 3; const removed4 = () => globalThis.unknown ? removed4() : { x: () => {} }; removed4().x(); const removed5 = { get x () { return globalThis.unknown || removed5.x; } }; removed5.x; const removed7 = { get x () { return globalThis.unknown ? removed7.x : {}; } }; removed7.x.y = 7; const removed8 = { get x () { return globalThis.unknown ? removed8.x : { y: () => {} }; } }; removed8.x.y(); const retained1 = () => globalThis.unknown ? retained1() : console.log( 'effect' ); retained1(); const retained2 = () => globalThis.unknown ? () => retained2()() : () => console.log( 'effect' ); retained2()(); const retained3 = () => globalThis.unknown ? retained3() : {}; retained3().x.y = 3; const retained4 = () => globalThis.unknown ? retained4() : { x: () => console.log( 'effect' ) }; retained4().x(); const retained5 = { get x () { return globalThis.unknown ? retained5.x : console.log( 'effect' ); } }; retained5.x; const retained6 = { get x () { return globalThis.unknown ? retained6.x : () => console.log( 'effect' ); } }; retained6.x(); const retained7 = { get x () { return globalThis.unknown ? retained7.x : {}; } }; retained7.x.y.z = 7; const retained8 = { get x () { return globalThis.unknown ? retained8.x : { y: () => console.log( 'effect' ) }; } }; retained8.x.y(); rollup-3.29.4/test/form/samples/recursive-computed-members/000077500000000000000000000000001450520414700237735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/recursive-computed-members/_config.js000066400000000000000000000001321450520414700257310ustar00rootroot00000000000000module.exports = defineTest({ description: 'handle recursive computed member access' }); rollup-3.29.4/test/form/samples/recursive-computed-members/_expected.js000066400000000000000000000000671450520414700262740ustar00rootroot00000000000000var a = { foo: 'bar' }; var b = a[b]; console.log(b); rollup-3.29.4/test/form/samples/recursive-computed-members/main.js000066400000000000000000000000671450520414700252600ustar00rootroot00000000000000var a = { foo: 'bar' }; var b = a[b]; console.log(b); rollup-3.29.4/test/form/samples/recursive-literal-values/000077500000000000000000000000001450520414700234545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/recursive-literal-values/_config.js000066400000000000000000000001561450520414700254200ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not fail for literal values from recursive return values' }); rollup-3.29.4/test/form/samples/recursive-literal-values/_expected.js000066400000000000000000000001401450520414700257450ustar00rootroot00000000000000function foo() { return foo() } if (foo()) { console.log('A'); } else { console.log('B'); } rollup-3.29.4/test/form/samples/recursive-literal-values/main.js000066400000000000000000000001361450520414700247360ustar00rootroot00000000000000function foo() { return foo() } if (foo()) { console.log('A') } else { console.log('B') } rollup-3.29.4/test/form/samples/recursive-multi-expressions/000077500000000000000000000000001450520414700242355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/recursive-multi-expressions/_config.js000066400000000000000000000001261450520414700261760ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles recursive multi-expressions' }); rollup-3.29.4/test/form/samples/recursive-multi-expressions/_expected.js000066400000000000000000000006661450520414700265430ustar00rootroot00000000000000const unknown = globalThis.unknown; var logical1 = logical1 || (() => {}); logical1(); logical1()(); logical1.x = 1; logical1().x = 1; logical1()().x = 1; var logical2 = logical2 || console.log; logical2(); var conditional1 = unknown ? conditional1 : () => {}; conditional1(); conditional1()(); conditional1.x = 1; conditional1().x = 1; conditional1()().x = 1; var conditional2 = unknown ? conditional1 : console.log; conditional2(); rollup-3.29.4/test/form/samples/recursive-multi-expressions/main.js000066400000000000000000000006661450520414700255270ustar00rootroot00000000000000const unknown = globalThis.unknown; var logical1 = logical1 || (() => {}); logical1(); logical1()(); logical1.x = 1; logical1().x = 1; logical1()().x = 1; var logical2 = logical2 || console.log; logical2(); var conditional1 = unknown ? conditional1 : () => {}; conditional1(); conditional1()(); conditional1.x = 1; conditional1().x = 1; conditional1()().x = 1; var conditional2 = unknown ? conditional1 : console.log; conditional2(); rollup-3.29.4/test/form/samples/recursive-return-value-assignments/000077500000000000000000000000001450520414700255055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/recursive-return-value-assignments/_config.js000066400000000000000000000001421450520414700274440ustar00rootroot00000000000000module.exports = defineTest({ description: 'handle recursive reassignments of return values' }); rollup-3.29.4/test/form/samples/recursive-return-value-assignments/_expected.js000066400000000000000000000000621450520414700300010ustar00rootroot00000000000000function foo() { return foo()(); } foo().x = 1; rollup-3.29.4/test/form/samples/recursive-return-value-assignments/main.js000066400000000000000000000000621450520414700267650ustar00rootroot00000000000000function foo() { return foo()(); } foo().x = 1; rollup-3.29.4/test/form/samples/recursive-this-deoptimization/000077500000000000000000000000001450520414700245275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/recursive-this-deoptimization/_config.js000066400000000000000000000001431450520414700264670ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles recursive "this" deoptimizations (#4089)' }); rollup-3.29.4/test/form/samples/recursive-this-deoptimization/_expected.js000066400000000000000000000002331450520414700270230ustar00rootroot00000000000000getObj().getThis().method(); getObj().getThis().getThis().method(); function getObj() { return { getThis() { return this; }, method() {}, }; } rollup-3.29.4/test/form/samples/recursive-this-deoptimization/main.js000066400000000000000000000002331450520414700260070ustar00rootroot00000000000000getObj().getThis().method(); getObj().getThis().getThis().method(); function getObj() { return { getThis() { return this; }, method() {}, }; } rollup-3.29.4/test/form/samples/recursive-values/000077500000000000000000000000001450520414700220225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/recursive-values/_config.js000066400000000000000000000001741450520414700237660ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not fail for pathological recursive algorithms and circular structures' }); rollup-3.29.4/test/form/samples/recursive-values/_expected.js000066400000000000000000000001171450520414700243170ustar00rootroot00000000000000var x = x || true; x && console.log(1); var y = {y}; y.y && console.log(2); rollup-3.29.4/test/form/samples/recursive-values/main.js000066400000000000000000000001171450520414700233030ustar00rootroot00000000000000var x = x || true; x && console.log(1); var y = {y}; y.y && console.log(2); rollup-3.29.4/test/form/samples/redeclarations/000077500000000000000000000000001450520414700215155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/redeclarations/_config.js000066400000000000000000000001651450520414700234610ustar00rootroot00000000000000module.exports = defineTest({ description: 'make sure re-declarations via var and function are linked properly' }); rollup-3.29.4/test/form/samples/redeclarations/_expected.js000066400000000000000000000001421450520414700240100ustar00rootroot00000000000000var foo = () => {}; while ( true ) { var foo = () => console.log( 'effect' ); break; } foo(); rollup-3.29.4/test/form/samples/redeclarations/main.js000066400000000000000000000005371450520414700230040ustar00rootroot00000000000000var foo = () => {}; while ( true ) { var foo = () => console.log( 'effect' ); break; } foo(); let bar = () => {}; while ( true ) { let bar = () => console.log( 'effect' ); break; } bar(); function baz () {} while ( true ) { // in strict mode, this is not a redeclaration function baz () { console.log( 'effect' ); } break; } baz(); rollup-3.29.4/test/form/samples/reexport-external-default-and-name/000077500000000000000000000000001450520414700253065ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-default-and-name/_config.js000066400000000000000000000004441450520414700272520ustar00rootroot00000000000000module.exports = defineTest({ description: 'reexports a an external default as a name and imports another name from that dependency', expectedWarnings: ['MIXED_EXPORTS'], options: { external: ['external'], output: { globals: { external: 'external' }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/reexport-external-default-and-name/_expected/000077500000000000000000000000001450520414700272465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-default-and-name/_expected/amd.js000066400000000000000000000003371450520414700303500ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; const value = 42; exports.default = external; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/reexport-external-default-and-name/_expected/cjs.js000066400000000000000000000002721450520414700303640ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); const value = 42; exports.default = external; exports.value = value; rollup-3.29.4/test/form/samples/reexport-external-default-and-name/_expected/es.js000066400000000000000000000001121450520414700302050ustar00rootroot00000000000000export { default } from 'external'; const value = 42; export { value }; rollup-3.29.4/test/form/samples/reexport-external-default-and-name/_expected/iife.js000066400000000000000000000003541450520414700305220ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; const value = 42; exports.default = external; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-3.29.4/test/form/samples/reexport-external-default-and-name/_expected/system.js000066400000000000000000000003651450520414700311340ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.default); }], execute: (function () { const value = exports('value', 42); }) }; })); rollup-3.29.4/test/form/samples/reexport-external-default-and-name/_expected/umd.js000066400000000000000000000010421450520414700303660ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; const value = 42; exports.default = external; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/reexport-external-default-and-name/main.js000066400000000000000000000000751450520414700265720ustar00rootroot00000000000000export { default } from 'external'; export const value = 42; rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/000077500000000000000000000000001450520414700263225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/_config.js000066400000000000000000000004121450520414700302610ustar00rootroot00000000000000module.exports = defineTest({ description: 'reexports a default external import as default export (when using named exports)', options: { output: { globals: { external: 'external' }, name: 'bundle', exports: 'named' }, external: ['external'] } }); rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/_expected/000077500000000000000000000000001450520414700302625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/_expected/amd.js000066400000000000000000000006371450520414700313670ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; exports.default = external; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/_expected/cjs.js000066400000000000000000000005661450520414700314060ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); exports.default = external; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/_expected/es.js000066400000000000000000000000761450520414700312320ustar00rootroot00000000000000export * from 'external'; export { default } from 'external'; rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/_expected/iife.js000066400000000000000000000006541450520414700315410ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; exports.default = external; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/_expected/system.js000066400000000000000000000005571450520414700321530ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; var _starExcludes = { default: 1 }; return { setters: [function (module) { var setter = { default: module.default }; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/_expected/umd.js000066400000000000000000000013401450520414700314030ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; exports.default = external; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-3.29.4/test/form/samples/reexport-external-default-and-namespace/main.js000066400000000000000000000000761450520414700276070ustar00rootroot00000000000000export * from 'external'; export { default } from 'external'; rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/000077500000000000000000000000001450520414700266255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/_config.js000066400000000000000000000003701450520414700305670ustar00rootroot00000000000000module.exports = defineTest({ description: 're-exports a named external export as default', expectedWarnings: ['MIXED_EXPORTS'], options: { external: ['external'], output: { globals: { external: 'external' }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/_expected/000077500000000000000000000000001450520414700305655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/_expected/amd.js000066400000000000000000000002241450520414700316620ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; console.log(external.value); exports.reexported = external; })); rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/_expected/cjs.js000066400000000000000000000001611450520414700317000ustar00rootroot00000000000000'use strict'; var external = require('external'); console.log(external.value); exports.reexported = external; rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/_expected/es.js000066400000000000000000000001511450520414700315270ustar00rootroot00000000000000import { value } from 'external'; export { default as reexported } from 'external'; console.log(value); rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/_expected/iife.js000066400000000000000000000002411450520414700320340ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; console.log(external.value); exports.reexported = external; return exports; })({}, external); rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/_expected/system.js000066400000000000000000000004151450520414700324470ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; var value; return { setters: [function (module) { value = module.value; exports('reexported', module.default); }], execute: (function () { console.log(value); }) }; })); rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/_expected/umd.js000066400000000000000000000007271450520414700317160ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; console.log(external.value); exports.reexported = external; })); rollup-3.29.4/test/form/samples/reexport-external-default-as-name-and-name/main.js000066400000000000000000000001461450520414700301100ustar00rootroot00000000000000export { default as reexported } from 'external'; import {value} from 'external'; console.log(value); rollup-3.29.4/test/form/samples/reexport-external-default/000077500000000000000000000000001450520414700236305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-default/_config.js000066400000000000000000000003611450520414700255720ustar00rootroot00000000000000module.exports = defineTest({ description: 'reexports an external default export', options: { external: ['external1', 'external2'], output: { globals: { external1: 'external1', external2: 'external2' }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/reexport-external-default/_expected/000077500000000000000000000000001450520414700255705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-default/_expected/amd.js000066400000000000000000000002141450520414700266640ustar00rootroot00000000000000define(['external1', 'external2'], (function (external1, external2) { 'use strict'; console.log(external1.foo); return external2; })); rollup-3.29.4/test/form/samples/reexport-external-default/_expected/cjs.js000066400000000000000000000002251450520414700267040ustar00rootroot00000000000000'use strict'; var external1 = require('external1'); var external2 = require('external2'); console.log(external1.foo); module.exports = external2; rollup-3.29.4/test/form/samples/reexport-external-default/_expected/es.js000066400000000000000000000001311450520414700265300ustar00rootroot00000000000000import { foo } from 'external1'; export { default } from 'external2'; console.log(foo); rollup-3.29.4/test/form/samples/reexport-external-default/_expected/iife.js000066400000000000000000000002141450520414700270370ustar00rootroot00000000000000var bundle = (function (external1, external2) { 'use strict'; console.log(external1.foo); return external2; })(external1, external2); rollup-3.29.4/test/form/samples/reexport-external-default/_expected/system.js000066400000000000000000000004511450520414700274520ustar00rootroot00000000000000System.register('bundle', ['external1', 'external2'], (function (exports) { 'use strict'; var foo; return { setters: [function (module) { foo = module.foo; }, function (module) { exports('default', module.default); }], execute: (function () { console.log(foo); }) }; })); rollup-3.29.4/test/form/samples/reexport-external-default/_expected/umd.js000066400000000000000000000007751450520414700267240ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('external1'), require('external2')) : typeof define === 'function' && define.amd ? define(['external1', 'external2'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory(global.external1, global.external2)); })(this, (function (external1, external2) { 'use strict'; console.log(external1.foo); return external2; })); rollup-3.29.4/test/form/samples/reexport-external-default/main.js000066400000000000000000000001301450520414700251040ustar00rootroot00000000000000import { foo } from 'external1'; export { default } from 'external2'; console.log(foo); rollup-3.29.4/test/form/samples/reexport-external-name-as-default/000077500000000000000000000000001450520414700251475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-name-as-default/_config.js000066400000000000000000000003221450520414700271060ustar00rootroot00000000000000module.exports = defineTest({ description: 're-exports a named external export as default', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/reexport-external-name-as-default/_expected/000077500000000000000000000000001450520414700271075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-name-as-default/_expected/amd.js000066400000000000000000000001331450520414700302030ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; return external.value; })); rollup-3.29.4/test/form/samples/reexport-external-name-as-default/_expected/cjs.js000066400000000000000000000001271450520414700302240ustar00rootroot00000000000000'use strict'; var external = require('external'); module.exports = external.value; rollup-3.29.4/test/form/samples/reexport-external-name-as-default/_expected/es.js000066400000000000000000000000551450520414700300540ustar00rootroot00000000000000export { value as default } from 'external'; rollup-3.29.4/test/form/samples/reexport-external-name-as-default/_expected/iife.js000066400000000000000000000001351450520414700303600ustar00rootroot00000000000000var bundle = (function (external) { 'use strict'; return external.value; })(external); rollup-3.29.4/test/form/samples/reexport-external-name-as-default/_expected/system.js000066400000000000000000000003151450520414700307700ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.value); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/reexport-external-name-as-default/_expected/umd.js000066400000000000000000000006401450520414700302320ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('external')) : typeof define === 'function' && define.amd ? define(['external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory(global.external)); })(this, (function (external) { 'use strict'; return external.value; })); rollup-3.29.4/test/form/samples/reexport-external-name-as-default/main.js000066400000000000000000000000551450520414700264310ustar00rootroot00000000000000export { value as default } from 'external'; rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/000077500000000000000000000000001450520414700252315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/_config.js000066400000000000000000000003431450520414700271730ustar00rootroot00000000000000module.exports = defineTest({ description: 're-exports a named external export as default via another file', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/_expected/000077500000000000000000000000001450520414700271715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/_expected/amd.js000066400000000000000000000001361450520414700302700ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; return external.objAlias; })); rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/_expected/cjs.js000066400000000000000000000001321450520414700303020ustar00rootroot00000000000000'use strict'; var external = require('external'); module.exports = external.objAlias; rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/_expected/es.js000066400000000000000000000000601450520414700301320ustar00rootroot00000000000000export { objAlias as default } from 'external'; rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/_expected/iife.js000066400000000000000000000001401450520414700304360ustar00rootroot00000000000000var bundle = (function (external) { 'use strict'; return external.objAlias; })(external); rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/_expected/system.js000066400000000000000000000003201450520414700310460ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.objAlias); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/_expected/umd.js000066400000000000000000000006431450520414700303170ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('external')) : typeof define === 'function' && define.amd ? define(['external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bundle = factory(global.external)); })(this, (function (external) { 'use strict'; return external.objAlias; })); rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/first.js000066400000000000000000000000601450520414700267120ustar00rootroot00000000000000export { objAlias as default } from 'external'; rollup-3.29.4/test/form/samples/reexport-external-name-as-default2/main.js000066400000000000000000000000461450520414700265130ustar00rootroot00000000000000export { default } from './first.js'; rollup-3.29.4/test/form/samples/reexport-external-name/000077500000000000000000000000001450520414700231245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-name/_config.js000066400000000000000000000003761450520414700250740ustar00rootroot00000000000000module.exports = defineTest({ description: 're-exports a named export from an external module', options: { external: ['external1', 'external2'], output: { globals: { external1: 'external1', external2: 'external2' }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/reexport-external-name/_expected/000077500000000000000000000000001450520414700250645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-name/_expected/amd.js000066400000000000000000000005171450520414700261660ustar00rootroot00000000000000define(['exports', 'external1', 'external2'], (function (exports, external1, external2) { 'use strict'; Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external1.foo; } }); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external2.foo; } }); })); rollup-3.29.4/test/form/samples/reexport-external-name/_expected/cjs.js000066400000000000000000000004641450520414700262050ustar00rootroot00000000000000'use strict'; var external1 = require('external1'); var external2 = require('external2'); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external1.foo; } }); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external2.foo; } }); rollup-3.29.4/test/form/samples/reexport-external-name/_expected/es.js000066400000000000000000000001111450520414700260220ustar00rootroot00000000000000export { foo } from 'external1'; export { foo as bar } from 'external2'; rollup-3.29.4/test/form/samples/reexport-external-name/_expected/iife.js000066400000000000000000000005321450520414700263360ustar00rootroot00000000000000var bundle = (function (exports, external1, external2) { 'use strict'; Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external1.foo; } }); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external2.foo; } }); return exports; })({}, external1, external2); rollup-3.29.4/test/form/samples/reexport-external-name/_expected/system.js000066400000000000000000000004151450520414700267460ustar00rootroot00000000000000System.register('bundle', ['external1', 'external2'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('foo', module.foo); }, function (module) { exports('bar', module.foo); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/reexport-external-name/_expected/umd.js000066400000000000000000000012721450520414700262110ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external1'), require('external2')) : typeof define === 'function' && define.amd ? define(['exports', 'external1', 'external2'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external1, global.external2)); })(this, (function (exports, external1, external2) { 'use strict'; Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return external1.foo; } }); Object.defineProperty(exports, 'bar', { enumerable: true, get: function () { return external2.foo; } }); })); rollup-3.29.4/test/form/samples/reexport-external-name/main.js000066400000000000000000000001111450520414700243770ustar00rootroot00000000000000export { foo } from 'external1'; export { foo as bar } from 'external2'; rollup-3.29.4/test/form/samples/reexport-external-namespace-as/000077500000000000000000000000001450520414700245415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-namespace-as/_config.js000066400000000000000000000003061450520414700265020ustar00rootroot00000000000000module.exports = defineTest({ description: 'reexport external namespace as name', options: { external: 'external', output: { name: 'bundle', globals: { external: 'external' } } } }); rollup-3.29.4/test/form/samples/reexport-external-namespace-as/_expected/000077500000000000000000000000001450520414700265015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-namespace-as/_expected/amd.js000066400000000000000000000011711450520414700276000ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); exports.external = external__namespace; exports.indirect = external__namespace; })); rollup-3.29.4/test/form/samples/reexport-external-namespace-as/_expected/cjs.js000066400000000000000000000011051450520414700276130ustar00rootroot00000000000000'use strict'; var external = require('external'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); exports.external = external__namespace; exports.indirect = external__namespace; rollup-3.29.4/test/form/samples/reexport-external-namespace-as/_expected/es.js000066400000000000000000000001341450520414700274440ustar00rootroot00000000000000import * as external from 'external'; export { external }; export { external as indirect }; rollup-3.29.4/test/form/samples/reexport-external-namespace-as/_expected/iife.js000066400000000000000000000012061450520414700277520ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); exports.external = external__namespace; exports.indirect = external__namespace; return exports; })({}, external); rollup-3.29.4/test/form/samples/reexport-external-namespace-as/_expected/system.js000066400000000000000000000003341450520414700303630ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ external: module, indirect: module }); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/reexport-external-namespace-as/_expected/umd.js000066400000000000000000000016741450520414700276340ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); exports.external = external__namespace; exports.indirect = external__namespace; })); rollup-3.29.4/test/form/samples/reexport-external-namespace-as/main.js000066400000000000000000000001421450520414700260200ustar00rootroot00000000000000export * as external from 'external'; import * as indirect from 'external'; export { indirect }; rollup-3.29.4/test/form/samples/reexport-external-namespace/000077500000000000000000000000001450520414700241405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-namespace/_config.js000066400000000000000000000003151450520414700261010ustar00rootroot00000000000000module.exports = defineTest({ description: 're-exports * from external module (#791)', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'bundle' } } }); rollup-3.29.4/test/form/samples/reexport-external-namespace/_expected/000077500000000000000000000000001450520414700261005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-external-namespace/_expected/amd.js000066400000000000000000000005011450520414700271730ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); })); rollup-3.29.4/test/form/samples/reexport-external-namespace/_expected/cjs.js000066400000000000000000000004321450520414700272140ustar00rootroot00000000000000'use strict'; var external = require('external'); Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-3.29.4/test/form/samples/reexport-external-namespace/_expected/es.js000066400000000000000000000000321450520414700270400ustar00rootroot00000000000000export * from 'external'; rollup-3.29.4/test/form/samples/reexport-external-namespace/_expected/iife.js000066400000000000000000000005161450520414700273540ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); return exports; })({}, external); rollup-3.29.4/test/form/samples/reexport-external-namespace/_expected/system.js000066400000000000000000000005261450520414700277650ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; var _starExcludes = { default: 1 }; return { setters: [function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/reexport-external-namespace/_expected/umd.js000066400000000000000000000012021450520414700272160ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external)); })(this, (function (exports, external) { 'use strict'; Object.keys(external).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); })); rollup-3.29.4/test/form/samples/reexport-external-namespace/main.js000066400000000000000000000000321450520414700254150ustar00rootroot00000000000000export * from 'external'; rollup-3.29.4/test/form/samples/reexport-self/000077500000000000000000000000001450520414700213155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-self/_config.js000066400000000000000000000002331450520414700232550ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles recursions when a module reexports its own namespace', expectedWarnings: ['CIRCULAR_DEPENDENCY'] }); rollup-3.29.4/test/form/samples/reexport-self/_expected.js000066400000000000000000000000421450520414700236070ustar00rootroot00000000000000const foo = 1; console.log(foo); rollup-3.29.4/test/form/samples/reexport-self/main.js000066400000000000000000000000721450520414700225760ustar00rootroot00000000000000import { other } from './other'; console.log(other.foo); rollup-3.29.4/test/form/samples/reexport-self/other.js000066400000000000000000000001411450520414700227700ustar00rootroot00000000000000export const foo = 1; export const bar = 2; import * as other from './other'; export { other }; rollup-3.29.4/test/form/samples/reexport-star-deshadow/000077500000000000000000000000001450520414700231315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-star-deshadow/_config.js000066400000000000000000000002071450520414700250720ustar00rootroot00000000000000module.exports = defineTest({ description: 'Star reexports scope deshadowing', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/reexport-star-deshadow/_expected/000077500000000000000000000000001450520414700250715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-star-deshadow/_expected/amd.js000066400000000000000000000002251450520414700261670ustar00rootroot00000000000000define((function () { 'use strict'; function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); })); rollup-3.29.4/test/form/samples/reexport-star-deshadow/_expected/cjs.js000066400000000000000000000001641450520414700262070ustar00rootroot00000000000000'use strict'; function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); rollup-3.29.4/test/form/samples/reexport-star-deshadow/_expected/es.js000066400000000000000000000001451450520414700260360ustar00rootroot00000000000000function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); rollup-3.29.4/test/form/samples/reexport-star-deshadow/_expected/iife.js000066400000000000000000000002201450520414700263350ustar00rootroot00000000000000(function () { 'use strict'; function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); })(); rollup-3.29.4/test/form/samples/reexport-star-deshadow/_expected/system.js000066400000000000000000000003461450520414700267560ustar00rootroot00000000000000System.register('myBundle', [], (function () { 'use strict'; return { execute: (function () { function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); }) }; })); rollup-3.29.4/test/form/samples/reexport-star-deshadow/_expected/umd.js000066400000000000000000000003631450520414700262160ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); })); rollup-3.29.4/test/form/samples/reexport-star-deshadow/foo.js000066400000000000000000000000461450520414700242520ustar00rootroot00000000000000export function foo() { return true; }rollup-3.29.4/test/form/samples/reexport-star-deshadow/main.js000066400000000000000000000001531450520414700244120ustar00rootroot00000000000000import * as bar from './reexport.js'; var baz = function foo() { return bar.foo(); }; console.log(baz())rollup-3.29.4/test/form/samples/reexport-star-deshadow/reexport.js000066400000000000000000000000311450520414700253310ustar00rootroot00000000000000export * from './foo.js';rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/000077500000000000000000000000001450520414700254775ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/_config.js000066400000000000000000000004311450520414700274370ustar00rootroot00000000000000module.exports = defineTest({ description: 'reexport external namespace as name if the namespace is also used', options: { external: ['external1', 'external2'], output: { name: 'bundle', globals: { external1: 'external1', external2: 'external2' } } } }); rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/_expected/000077500000000000000000000000001450520414700274375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/_expected/amd.js000066400000000000000000000014371450520414700305430ustar00rootroot00000000000000define(['exports', 'external1', 'external2'], (function (exports, imported1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var imported1__namespace = /*#__PURE__*/_interopNamespaceDefault(imported1); var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); console.log(imported1__namespace, external2.imported2); exports.external1 = imported1__namespace; exports.external2 = external2__namespace; })); rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/_expected/cjs.js000066400000000000000000000013671450520414700305630ustar00rootroot00000000000000'use strict'; var imported1 = require('external1'); var external2 = require('external2'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var imported1__namespace = /*#__PURE__*/_interopNamespaceDefault(imported1); var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); console.log(imported1__namespace, external2.imported2); exports.external1 = imported1__namespace; exports.external2 = external2__namespace; rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/_expected/es.js000066400000000000000000000003241450520414700304030ustar00rootroot00000000000000import * as imported1 from 'external1'; export { imported1 as external1 }; import { imported2 } from 'external2'; import * as external2 from 'external2'; export { external2 }; console.log(imported1, imported2); rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/_expected/iife.js000066400000000000000000000014521450520414700307130ustar00rootroot00000000000000var bundle = (function (exports, imported1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var imported1__namespace = /*#__PURE__*/_interopNamespaceDefault(imported1); var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); console.log(imported1__namespace, external2.imported2); exports.external1 = imported1__namespace; exports.external2 = external2__namespace; return exports; })({}, external1, external2); rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/_expected/system.js000066400000000000000000000006111450520414700313170ustar00rootroot00000000000000System.register('bundle', ['external1', 'external2'], (function (exports) { 'use strict'; var imported1, imported2; return { setters: [function (module) { imported1 = module; exports('external1', module); }, function (module) { imported2 = module.imported2; exports('external2', module); }], execute: (function () { console.log(imported1, imported2); }) }; })); rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/_expected/umd.js000066400000000000000000000022141450520414700305610ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external1'), require('external2')) : typeof define === 'function' && define.amd ? define(['exports', 'external1', 'external2'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.external1, global.external2)); })(this, (function (exports, imported1, external2) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var imported1__namespace = /*#__PURE__*/_interopNamespaceDefault(imported1); var external2__namespace = /*#__PURE__*/_interopNamespaceDefault(external2); console.log(imported1__namespace, external2.imported2); exports.external1 = imported1__namespace; exports.external2 = external2__namespace; })); rollup-3.29.4/test/form/samples/reexport-used-external-namespace-as/main.js000066400000000000000000000003031450520414700267550ustar00rootroot00000000000000export * as external1 from 'external1'; import * as imported1 from 'external1'; export * as external2 from 'external2'; import { imported2 } from 'external2'; console.log(imported1, imported2); rollup-3.29.4/test/form/samples/relative-external-ids/000077500000000000000000000000001450520414700227265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/relative-external-ids/_config.js000066400000000000000000000016371450520414700246770ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'relative external ids are absolutely resolved', options: { external(id) { switch (id) { case './optionDirect.js': { return true; } case './optionDirectNested.js': { return true; } case path.resolve(__dirname, 'optionIndirect.js'): { return true; } case path.resolve(__dirname, 'nested', 'optionIndirectNested.js'): { return true; } default: { return false; } } }, plugins: { resolveId(id) { switch (id) { case './hook.js': { return false; } case './hookNested.js': { return false; } case 'resolved': { return { id: './resolved.js', external: true }; } case 'resolvedNested': { return { id: './resolvedNested.js', external: true }; } default: { return null; } } } } } }); rollup-3.29.4/test/form/samples/relative-external-ids/_expected.js000066400000000000000000000003711450520414700252250ustar00rootroot00000000000000import './optionDirect.js'; import './optionIndirect.js'; import './hook.js'; import './resolved.js'; import './nested/optionDirectNested.js'; import './nested/optionIndirectNested.js'; import './nested/hookNested.js'; import './resolvedNested.js'; rollup-3.29.4/test/form/samples/relative-external-ids/main.js000066400000000000000000000001741450520414700242120ustar00rootroot00000000000000import './optionDirect.js'; import './optionIndirect.js'; import './hook.js'; import 'resolved'; import './nested/nested'; rollup-3.29.4/test/form/samples/relative-external-ids/nested/000077500000000000000000000000001450520414700242105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/relative-external-ids/nested/nested.js000066400000000000000000000001711450520414700260270ustar00rootroot00000000000000import './optionDirectNested.js'; import './optionIndirectNested.js'; import './hookNested.js'; import 'resolvedNested'; rollup-3.29.4/test/form/samples/relative-external-with-global/000077500000000000000000000000001450520414700243605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/relative-external-with-global/_config.js000066400000000000000000000004451450520414700263250ustar00rootroot00000000000000const { resolve } = require('node:path'); const throttle = resolve(__dirname, 'lib/throttle.js'); module.exports = defineTest({ description: 'applies globals to externalised relative imports', options: { external: [throttle], output: { globals: { [throttle]: 'Lib.throttle' } } } }); rollup-3.29.4/test/form/samples/relative-external-with-global/_expected/000077500000000000000000000000001450520414700263205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/relative-external-with-global/_expected/amd.js000066400000000000000000000002571450520414700274230ustar00rootroot00000000000000define(['./lib/throttle'], (function (throttle) { 'use strict'; throttle( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle ); })); rollup-3.29.4/test/form/samples/relative-external-with-global/_expected/cjs.js000066400000000000000000000002411450520414700274320ustar00rootroot00000000000000'use strict'; var throttle = require('./lib/throttle.js'); throttle( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle ); rollup-3.29.4/test/form/samples/relative-external-with-global/_expected/es.js000066400000000000000000000002171450520414700272650ustar00rootroot00000000000000import throttle from './lib/throttle.js'; throttle( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle ); rollup-3.29.4/test/form/samples/relative-external-with-global/_expected/iife.js000066400000000000000000000002421450520414700275700ustar00rootroot00000000000000(function (throttle) { 'use strict'; throttle( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle ); })(Lib.throttle); rollup-3.29.4/test/form/samples/relative-external-with-global/_expected/system.js000066400000000000000000000004741450520414700302070ustar00rootroot00000000000000System.register(['./lib/throttle.js'], (function () { 'use strict'; var throttle; return { setters: [function (module) { throttle = module.default; }], execute: (function () { throttle( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle ); }) }; })); rollup-3.29.4/test/form/samples/relative-external-with-global/_expected/umd.js000066400000000000000000000007421450520414700274460ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('./lib/throttle.js')) : typeof define === 'function' && define.amd ? define(['./lib/throttle'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Lib.throttle)); })(this, (function (throttle) { 'use strict'; throttle( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle ); })); rollup-3.29.4/test/form/samples/relative-external-with-global/main.js000066400000000000000000000002321450520414700256370ustar00rootroot00000000000000import throttle from './lib/throttle.js'; const fn = throttle( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle ); rollup-3.29.4/test/form/samples/remove-invalid-pure-comments/000077500000000000000000000000001450520414700242335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/remove-invalid-pure-comments/_config.js000066400000000000000000000001341450520414700261730ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes invalidly placed pure annotations' }); rollup-3.29.4/test/form/samples/remove-invalid-pure-comments/_expected.js000066400000000000000000000000741450520414700265320ustar00rootroot00000000000000const a = 3; const b = 3; const c = 3; export { a, b, c }; rollup-3.29.4/test/form/samples/remove-invalid-pure-comments/main.js000066400000000000000000000001431450520414700255130ustar00rootroot00000000000000/*@__PURE__*/export const a = 3; export /*@__PURE__*/const b = 3; export const /*@__PURE__*/c = 3; rollup-3.29.4/test/form/samples/remove-tree-shaken-pure-comments/000077500000000000000000000000001450520414700250135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/remove-tree-shaken-pure-comments/_config.js000066400000000000000000000001351450520414700267540ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes pure comments of tree-shaken nodes' }); rollup-3.29.4/test/form/samples/remove-tree-shaken-pure-comments/_expected.js000066400000000000000000000000231450520414700273040ustar00rootroot00000000000000kept() ; kept() ; rollup-3.29.4/test/form/samples/remove-tree-shaken-pure-comments/main.js000066400000000000000000000002411450520414700262720ustar00rootroot00000000000000/*@__PURE__*/(() => false)() /*@__PURE__*/ ? removed() /*@__PURE__*/ : kept() /*@__PURE__*/; /*@__PURE__*/(() => true)() /*@__PURE__*/ && kept() /*@__PURE__*/; rollup-3.29.4/test/form/samples/remove-treeshaken-banners/000077500000000000000000000000001450520414700235705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/remove-treeshaken-banners/_config.js000066400000000000000000000001611450520414700255300ustar00rootroot00000000000000module.exports = defineTest({ description: 'Also remove banner comments when completely tree-shaking files' }); rollup-3.29.4/test/form/samples/remove-treeshaken-banners/_expected.js000066400000000000000000000001411450520414700260620ustar00rootroot00000000000000// dep included banner: included console.log('dep included'); // dep included footer: included rollup-3.29.4/test/form/samples/remove-treeshaken-banners/dep-included.js000066400000000000000000000001641450520414700264640ustar00rootroot00000000000000// dep included banner: included const removed = 1; console.log('dep included'); // dep included footer: included rollup-3.29.4/test/form/samples/remove-treeshaken-banners/dep-removed.js000066400000000000000000000001231450520414700263310ustar00rootroot00000000000000// dep removed banner: removed const removed = 1; // dep removed footer: removed rollup-3.29.4/test/form/samples/remove-treeshaken-banners/main.js000066400000000000000000000001431450520414700250500ustar00rootroot00000000000000// main banner: removed import './dep-removed'; import './dep-included'; // main footer: removed rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/000077500000000000000000000000001450520414700256455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/_config.js000066400000000000000000000001261450520414700276060ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes existing sourcemap comments' }); rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/_expected/000077500000000000000000000000001450520414700276055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/_expected/amd.js000066400000000000000000000002331450520414700307020ustar00rootroot00000000000000define((function () { 'use strict'; function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); })); rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/_expected/cjs.js000066400000000000000000000001721450520414700307220ustar00rootroot00000000000000'use strict'; function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/_expected/es.js000066400000000000000000000001531450520414700305510ustar00rootroot00000000000000function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/_expected/iife.js000066400000000000000000000002261450520414700310570ustar00rootroot00000000000000(function () { 'use strict'; function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); })(); rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/_expected/system.js000066400000000000000000000003401450520414700314640ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); }) }; })); rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/_expected/umd.js000066400000000000000000000003711450520414700307310ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); })); rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/foo.js000066400000000000000000000001141450520414700267620ustar00rootroot00000000000000export default function (x) { return x; } //# sourceMappingURL=foo.js.map rollup-3.29.4/test/form/samples/removes-existing-sourcemap-comments/main.js000066400000000000000000000002061450520414700271250ustar00rootroot00000000000000import foo from './foo'; var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); //# sourceMappingURL=main.js.map rollup-3.29.4/test/form/samples/removes-unused-babel-helpers/000077500000000000000000000000001450520414700242025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/removes-unused-babel-helpers/_config.js000066400000000000000000000002131450520414700261400ustar00rootroot00000000000000module.exports = defineTest({ description: 'Removes unused babel helpers from the build (#1595)', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/removes-unused-babel-helpers/_expected.js000066400000000000000000000000011450520414700264670ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/removes-unused-babel-helpers/main.js000066400000000000000000000300241450520414700254630ustar00rootroot00000000000000var babelHelpers = {}; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _sPO = Object.setPrototypeOf || function _sPO(o, p) { o.__proto__ = p; return o; }; var _construct = typeof Reflect === "object" && Reflect.construct || function _construct(Parent, args, Class) { var Constructor, a = [null]; a.push.apply(a, args); Constructor = Parent.bind.apply(Parent, a); return _sPO(new Constructor(), Class.prototype); }; var jsx = function () { var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 0xeac7; return function createRawReactElement(type, props, key, children) { var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = {}; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } return { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; }; }(); var asyncIterator = function (iterable) { if (typeof Symbol === "function") { if (Symbol.asyncIterator) { var method = iterable[Symbol.asyncIterator]; if (method != null) return method.call(iterable); } if (Symbol.iterator) { return iterable[Symbol.iterator](); } } throw new TypeError("Object is not async iterable"); }; var asyncGenerator = function () { function AwaitValue(value) { this.value = value; } function AsyncGenerator(gen) { var front, back; function send(key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; if (back) { back = back.next = request; } else { front = back = request; resume(key, arg); } }); } function resume(key, arg) { try { var result = gen[key](arg); var value = result.value; if (value instanceof AwaitValue) { Promise.resolve(value.value).then(function (arg) { resume("next", arg); }, function (arg) { resume("throw", arg); }); } else { settle(result.done ? "return" : "normal", result.value); } } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: true }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: false }); break; } front = front.next; if (front) { resume(front.key, front.arg); } else { back = null; } } this._invoke = send; if (typeof gen.return !== "function") { this.return = undefined; } } if (typeof Symbol === "function" && Symbol.asyncIterator) { AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; }; } AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }; AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); }; AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); }; return { wrap: function (fn) { return function () { return new AsyncGenerator(fn.apply(this, arguments)); }; }, await: function (value) { return new AwaitValue(value); } }; }(); var asyncGeneratorDelegate = function (inner, awaitWrap) { var iter = {}, waiting = false; function pump(key, value) { waiting = true; value = new Promise(function (resolve) { resolve(inner[key](value)); }); return { done: false, value: awaitWrap(value) }; } if (typeof Symbol === "function" && Symbol.iterator) { iter[Symbol.iterator] = function () { return this; }; } iter.next = function (value) { if (waiting) { waiting = false; return value; } return pump("next", value); }; if (typeof inner.throw === "function") { iter.throw = function (value) { if (waiting) { waiting = false; throw value; } return pump("throw", value); }; } if (typeof inner.return === "function") { iter.return = function (value) { return pump("return", value); }; } return iter; }; var asyncToGenerator = function (fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }; var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var defineEnumerableProperties = function (obj, descs) { for (var key in descs) { var desc = descs[key]; desc.configurable = desc.enumerable = true; if ("value" in desc) desc.writable = true; Object.defineProperty(obj, key, desc); } return obj; }; var defaults = function (obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }; var defineProperty = function (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; var inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; var _instanceof = function (left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }; var interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { default: obj }; }; var interopRequireWildcard = function (obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }; var newArrowCheck = function (innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } }; var objectDestructuringEmpty = function (obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }; var objectWithoutProperties = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; var possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; var selfGlobal = typeof global === "undefined" ? self : global; var set = function set(object, property, value, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent !== null) { set(parent, property, value, receiver); } } else if ("value" in desc && desc.writable) { desc.value = value; } else { var setter = desc.set; if (setter !== undefined) { setter.call(receiver, value); } } return value; }; var slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var slicedToArrayLoose = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; var taggedTemplateLiteral = function (strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }; var taggedTemplateLiteralLoose = function (strings, raw) { strings.raw = raw; return strings; }; var temporalRef = function (val, name, undef) { if (val === undef) { throw new ReferenceError(name + " is not defined - temporal dead zone"); } else { return val; } }; var temporalUndefined = {}; var toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; var toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; babelHelpers; rollup-3.29.4/test/form/samples/renamed-pattern-defaults/000077500000000000000000000000001450520414700234115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/renamed-pattern-defaults/_config.js000066400000000000000000000001721450520414700253530ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles deconflicting of variables used as defaults in patterns (#2445)' }); rollup-3.29.4/test/form/samples/renamed-pattern-defaults/_expected.js000066400000000000000000000002161450520414700257060ustar00rootroot00000000000000const EMPTY$1 = null; const {foo: foo$1 = EMPTY$1} = {}; console.log(foo$1); const EMPTY = null; const {foo = EMPTY} = {}; console.log(foo); rollup-3.29.4/test/form/samples/renamed-pattern-defaults/dep.js000066400000000000000000000001001450520414700245060ustar00rootroot00000000000000const EMPTY = null; const {foo = EMPTY} = {}; console.log(foo); rollup-3.29.4/test/form/samples/renamed-pattern-defaults/main.js000066400000000000000000000001241450520414700246700ustar00rootroot00000000000000import './dep.js'; const EMPTY = null; const {foo = EMPTY} = {}; console.log(foo); rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/000077500000000000000000000000001450520414700245565ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_config.js000066400000000000000000000006341450520414700265230ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports returning undefined source maps from render chunk hooks, when source maps are enabled', expectedWarnings: ['SOURCEMAP_BROKEN'], options: { output: { sourcemap: true }, plugins: [ { renderChunk() { return '/* first plugin */'; } }, { renderChunk(code) { return code + '\n/* second plugin */'; } } ] } }); rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/000077500000000000000000000000001450520414700265165ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/amd.js000066400000000000000000000001071450520414700276130ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=amd.js.map rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/amd.js.map000066400000000000000000000001271450520414700303710ustar00rootroot00000000000000{"version":3,"file":"amd.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/cjs.js000066400000000000000000000001071450520414700276310ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=cjs.js.map rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/cjs.js.map000066400000000000000000000001271450520414700304070ustar00rootroot00000000000000{"version":3,"file":"cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/es.js000066400000000000000000000001061450520414700274600ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=es.js.map rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/es.js.map000066400000000000000000000001261450520414700302360ustar00rootroot00000000000000{"version":3,"file":"es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/iife.js000066400000000000000000000001101450520414700277600ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=iife.js.map rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/iife.js.map000066400000000000000000000001301450520414700305360ustar00rootroot00000000000000{"version":3,"file":"iife.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/system.js000066400000000000000000000001121450520414700303720ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=system.js.map rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/system.js.map000066400000000000000000000001321450520414700311500ustar00rootroot00000000000000{"version":3,"file":"system.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/umd.js000066400000000000000000000001071450520414700276370ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=umd.js.map rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/_expected/umd.js.map000066400000000000000000000001271450520414700304150ustar00rootroot00000000000000{"version":3,"file":"umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-3.29.4/test/form/samples/render-chunk-plugin-sourcemaps/main.js000066400000000000000000000000261450520414700260360ustar00rootroot00000000000000console.log( 1 + 1 ); rollup-3.29.4/test/form/samples/render-chunk-plugin/000077500000000000000000000000001450520414700223775ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-chunk-plugin/_config.js000066400000000000000000000004221450520414700243370ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows plugins to hook render chunk', options: { plugins: [ { renderChunk() { return '/* first plugin */'; } }, { renderChunk(code) { return code + '\n/* second plugin */'; } } ] } }); rollup-3.29.4/test/form/samples/render-chunk-plugin/_expected/000077500000000000000000000000001450520414700243375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-chunk-plugin/_expected/amd.js000066400000000000000000000000471450520414700254370ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-3.29.4/test/form/samples/render-chunk-plugin/_expected/cjs.js000066400000000000000000000000471450520414700254550ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-3.29.4/test/form/samples/render-chunk-plugin/_expected/es.js000066400000000000000000000000471450520414700253050ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-3.29.4/test/form/samples/render-chunk-plugin/_expected/iife.js000066400000000000000000000000471450520414700256120ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-3.29.4/test/form/samples/render-chunk-plugin/_expected/system.js000066400000000000000000000000471450520414700262220ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-3.29.4/test/form/samples/render-chunk-plugin/_expected/umd.js000066400000000000000000000000471450520414700254630ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-3.29.4/test/form/samples/render-chunk-plugin/main.js000066400000000000000000000000261450520414700236570ustar00rootroot00000000000000console.log( 1 + 1 ); rollup-3.29.4/test/form/samples/render-declaration-semicolons/000077500000000000000000000000001450520414700244315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-declaration-semicolons/_config.js000066400000000000000000000002241450520414700263710ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly inserts semi-colons after declarations (#1993)', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/render-declaration-semicolons/_expected/000077500000000000000000000000001450520414700263715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-declaration-semicolons/_expected/amd.js000066400000000000000000000006271450520414700274750ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var a, b; console.log(a, b); var c, d; console.log(c, d); const e = 1, f = 2; console.log(e, f); const g = 3, h = 4; console.log(g, h); var i, j; var k, l; const m = 1, n = 2; const o = 3, p = 4; exports.i = i; exports.j = j; exports.k = k; exports.l = l; exports.m = m; exports.n = n; exports.o = o; exports.p = p; })); rollup-3.29.4/test/form/samples/render-declaration-semicolons/_expected/cjs.js000066400000000000000000000005231450520414700275060ustar00rootroot00000000000000'use strict'; var a, b; console.log(a, b); var c, d; console.log(c, d); const e = 1, f = 2; console.log(e, f); const g = 3, h = 4; console.log(g, h); var i, j; var k, l; const m = 1, n = 2; const o = 3, p = 4; exports.i = i; exports.j = j; exports.k = k; exports.l = l; exports.m = m; exports.n = n; exports.o = o; exports.p = p; rollup-3.29.4/test/form/samples/render-declaration-semicolons/_expected/es.js000066400000000000000000000003571450520414700273430ustar00rootroot00000000000000var a, b; console.log(a, b); var c, d; console.log(c, d); const e = 1, f = 2; console.log(e, f); const g = 3, h = 4; console.log(g, h); var i, j; var k, l; const m = 1, n = 2; const o = 3, p = 4; export { i, j, k, l, m, n, o, p }; rollup-3.29.4/test/form/samples/render-declaration-semicolons/_expected/iife.js000066400000000000000000000006461450520414700276510ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; var a, b; console.log(a, b); var c, d; console.log(c, d); const e = 1, f = 2; console.log(e, f); const g = 3, h = 4; console.log(g, h); var i, j; var k, l; const m = 1, n = 2; const o = 3, p = 4; exports.i = i; exports.j = j; exports.k = k; exports.l = l; exports.m = m; exports.n = n; exports.o = o; exports.p = p; return exports; })({}); rollup-3.29.4/test/form/samples/render-declaration-semicolons/_expected/system.js000066400000000000000000000007121450520414700302530ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var a, b; console.log(a, b); var c, d; console.log(c, d); const e = 1, f = 2; console.log(e, f); const g = 3, h = 4; console.log(g, h); var i, j; exports({ i: i, j: j }); var k, l; exports({ k: k, l: l }); const m = 1, n = 2; exports({ m: m, n: n }); const o = 3, p = 4; exports({ o: o, p: p }); }) }; })); rollup-3.29.4/test/form/samples/render-declaration-semicolons/_expected/umd.js000066400000000000000000000012641450520414700275170ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; var a, b; console.log(a, b); var c, d; console.log(c, d); const e = 1, f = 2; console.log(e, f); const g = 3, h = 4; console.log(g, h); var i, j; var k, l; const m = 1, n = 2; const o = 3, p = 4; exports.i = i; exports.j = j; exports.k = k; exports.l = l; exports.m = m; exports.n = n; exports.o = o; exports.p = p; })); rollup-3.29.4/test/form/samples/render-declaration-semicolons/main.js000066400000000000000000000003411450520414700257110ustar00rootroot00000000000000var a, b; console.log(a, b); var c, d console.log(c, d) const e = 1, f = 2; console.log(e, f); const g = 3, h = 4 console.log(g, h) export var i, j; export var k, l export const m = 1, n = 2; export const o = 3, p = 4 rollup-3.29.4/test/form/samples/render-named-export-declarations/000077500000000000000000000000001450520414700250445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-named-export-declarations/_config.js000066400000000000000000000001761450520414700270120ustar00rootroot00000000000000module.exports = defineTest({ description: 'renders named export declarations', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/render-named-export-declarations/_expected/000077500000000000000000000000001450520414700270045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-named-export-declarations/_expected/amd.js000066400000000000000000000005451450520414700301070ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var aFoo; exports.aBar = void 0; exports.aBar = 2; exports.bFoo = void 0; var bBar; exports.bFoo = 2; var cFoo; exports.cBar = 1; exports.cBar = 2; exports.dFoo = 1; var dBar; exports.dFoo = 2; exports.aFoo = aFoo; exports.bBar = bBar; exports.cFoo = cFoo; exports.dBar = dBar; })); rollup-3.29.4/test/form/samples/render-named-export-declarations/_expected/cjs.js000066400000000000000000000004511450520414700301210ustar00rootroot00000000000000'use strict'; var aFoo; exports.aBar = void 0; exports.aBar = 2; exports.bFoo = void 0; var bBar; exports.bFoo = 2; var cFoo; exports.cBar = 1; exports.cBar = 2; exports.dFoo = 1; var dBar; exports.dFoo = 2; exports.aFoo = aFoo; exports.bBar = bBar; exports.cFoo = cFoo; exports.dBar = dBar; rollup-3.29.4/test/form/samples/render-named-export-declarations/_expected/es.js000066400000000000000000000002571450520414700277550ustar00rootroot00000000000000var aFoo, aBar; aBar = 2; var bFoo, bBar; bFoo = 2; var cFoo, cBar = 1; cBar = 2; var dFoo = 1, dBar; dFoo = 2; export { aBar, aFoo, bBar, bFoo, cBar, cFoo, dBar, dFoo }; rollup-3.29.4/test/form/samples/render-named-export-declarations/_expected/iife.js000066400000000000000000000005641450520414700302630ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; var aFoo; exports.aBar = void 0; exports.aBar = 2; exports.bFoo = void 0; var bBar; exports.bFoo = 2; var cFoo; exports.cBar = 1; exports.cBar = 2; exports.dFoo = 1; var dBar; exports.dFoo = 2; exports.aFoo = aFoo; exports.bBar = bBar; exports.cFoo = cFoo; exports.dBar = dBar; return exports; })({}); rollup-3.29.4/test/form/samples/render-named-export-declarations/_expected/system.js000066400000000000000000000007321450520414700306700ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var aFoo, aBar; exports({ aFoo: aFoo, aBar: aBar }); exports('aBar', aBar = 2); var bFoo, bBar; exports({ bFoo: bFoo, bBar: bBar }); exports('bFoo', bFoo = 2); var cFoo, cBar = 1; exports({ cFoo: cFoo, cBar: cBar }); exports('cBar', cBar = 2); var dFoo = 1, dBar; exports({ dFoo: dFoo, dBar: dBar }); exports('dFoo', dFoo = 2); }) }; })); rollup-3.29.4/test/form/samples/render-named-export-declarations/_expected/umd.js000066400000000000000000000012021450520414700301220ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; var aFoo; exports.aBar = void 0; exports.aBar = 2; exports.bFoo = void 0; var bBar; exports.bFoo = 2; var cFoo; exports.cBar = 1; exports.cBar = 2; exports.dFoo = 1; var dBar; exports.dFoo = 2; exports.aFoo = aFoo; exports.bBar = bBar; exports.cFoo = cFoo; exports.dBar = dBar; })); rollup-3.29.4/test/form/samples/render-named-export-declarations/main.js000066400000000000000000000002171450520414700263260ustar00rootroot00000000000000export var aFoo, aBar; aBar = 2; export var bFoo, bBar; bFoo = 2; export var cFoo, cBar = 1; cBar = 2; export var dFoo = 1, dBar; dFoo = 2; rollup-3.29.4/test/form/samples/render-removed-declarations/000077500000000000000000000000001450520414700241025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-removed-declarations/_config.js000066400000000000000000000001341450520414700260420ustar00rootroot00000000000000module.exports = defineTest({ description: 'renders tree-shaken variable declarations' }); rollup-3.29.4/test/form/samples/render-removed-declarations/_expected.js000066400000000000000000000021761450520414700264060ustar00rootroot00000000000000// -> Middle removed var kept1 = 1, kept2 = 3; // with comments var /* retained */ kept1 = 1 /* retained */, /* retained */ kept2 = 3 /* retained */; // retained // without spaces var kept1 = 1,kept2 = 3; // with comments without spaces var /* retained */kept1 = 1/* retained */,/* retained */kept2 = 3/* retained */;// retained // with line-breaks var kept1 = 1, kept2 = 3; // with line-breaks and comments var /* retained */ kept1 = 1, // retained /* retained */ kept2 = 3; // retained // mixed var kept1 = 1, // retained kept2 = 3; // -> Start and end removed var kept1 = 2; // with comments var /* retained */ kept1 = 2 /* retained */; // retained // without spaces var kept1 = 2; // with comments without spaces var /* retained */kept1 = 2/* retained */;// retained // with line-breaks var kept1 = 2; // with line-breaks and comments var /* retained */ kept1 = 2; // retained // mixed var // retained kept1 = 2; // retained // -> Missing semicolons var kept1 = 1; // retained var kept1 = 1; // retained // -> No line-break after declaration var kept1 = 1; // retained console.log(1); console.log( kept1, kept2 ); rollup-3.29.4/test/form/samples/render-removed-declarations/main.js000066400000000000000000000033431450520414700253670ustar00rootroot00000000000000// -> Middle removed var kept1 = 1, removed1 = 2, kept2 = 3; // with comments var /* retained */ kept1 = 1 /* retained */, /* removed */ removed1 = 2 /* removed */, /* retained */ kept2 = 3 /* retained */; // retained // without spaces var kept1 = 1,removed1 = 2,kept2 = 3; // with comments without spaces var/* retained */kept1 = 1/* retained */,/* removed */removed1 = 2/* removed */,/* retained */kept2 = 3/* retained */;// retained // with line-breaks var kept1 = 1, removed1 = 2, kept2 = 3; // with line-breaks and comments var /* retained */ kept1 = 1, // retained /* removed */ removed1 = 2, // removed /* retained */ kept2 = 3; // retained // mixed var kept1 = 1, // retained removed1 = 2, kept2 = 3; // -> Start and end removed var removed1 = 1, kept1 = 2, removed2 = 3; // with comments var /* removed */ removed1 = 1 /* removed */, /* retained */ kept1 = 2 /* retained */, /* removed */ removed2 = 3 /* removed */; // retained // without spaces var removed1 = 1,kept1 = 2,removed2 = 3; // with comments without spaces var/* removed */removed1 = 1/* removed */,/* retained */kept1 = 2/* retained */,/* removed */removed2 = 3/* removed */;// retained // with line-breaks var removed1 = 1, kept1 = 2, removed2 = 3; // with line-breaks and comments var /* removed */ removed1 = 1, // removed /* retained */ kept1 = 2, // retained /* removed */ removed2 = 3; // mixed var // retained removed1 = 1, kept1 = 2, // retained removed2 = 3; // -> Missing semicolons var kept1 = 1 // retained var kept1 = 1, removed1 = 2 // retained // -> No line-break after declaration var kept1 = 1, // retained removed1 = 2;console.log(1); // -> Everything removed var removed1 = 1; console.log( kept1, kept2 ); rollup-3.29.4/test/form/samples/render-removed-statements/000077500000000000000000000000001450520414700236215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/render-removed-statements/_config.js000066400000000000000000000001601450520414700255600ustar00rootroot00000000000000module.exports = defineTest({ description: 'make sure removed statements do no leave unwanted white-space' }); rollup-3.29.4/test/form/samples/render-removed-statements/_expected.js000066400000000000000000000022511450520414700261170ustar00rootroot00000000000000/* header retained */ /* lead retained */ console.log(2); // trail retained console.log(2); // trail retained /* lead retained */ console.log(2); /* trail retained */ /* trail retained */ console.log(2); // trail retained console.log(2); if (globalThis.unknown) { // lead retained console.log(2); // trail retained } if (globalThis.unknown) { // lead retained console.log(2); // trail retained } if (globalThis.unknown) { // lead retained console.log(2); // trail retained } if (globalThis.unknown) { console.log(2); } if (globalThis.unknown) { /* retained */ console.log(2);} if (globalThis.unknown) { /* retained */ console.log(2);} if (globalThis.unknown) { /* retained */ console.log(2);} switch (globalThis.unknown) { case 1: // retained // lead retained console.log(2); // trail retained case 2: // retained // lead retained console.log(2); // trail retained case 3: // retained // lead retained console.log(2); // trail retained case 4: /* lead retained */ console.log('3'); // trail retained default: // retained /* lead retained */ console.log(2); // trail retained } // lead retained console.log(2); // trail retained /* footer retained */ rollup-3.29.4/test/form/samples/render-removed-statements/main.js000066400000000000000000000037141450520414700251100ustar00rootroot00000000000000/* header retained */ /* lead removed */ var a = 1; // trail removed /* lead removed */ var a = 1; /* lead retained */ console.log(2); // trail retained /* lead removed */ var a = 1; /* trail removed */ /* trail removed */ console.log(2); // trail retained /* lead retained */ console.log(2); /* trail retained */ /* trail retained */ console.log(2); // trail retained var a = 1; console.log(2); if (globalThis.unknown) { // lead removed var a = 1; // trail removed // lead retained console.log(2); // trail retained } if (globalThis.unknown) { // lead removed var a = 1; // trail removed // lead retained console.log(2); // trail retained // lead removed var a = 1; // trail removed } if (globalThis.unknown) { // lead retained console.log(2); // trail retained // lead removed var a = 1; // trail removed } if (globalThis.unknown) { console.log(2); var a = 1; /* trail removed */ } if (globalThis.unknown) { /* removed */ var a = 1; /* retained */ console.log(2);} if (globalThis.unknown) { /* removed */ var a = 1; /* retained */ console.log(2); /* removed */ var a = 1;} if (globalThis.unknown) { /* retained */ console.log(2); /* removed */ var a = 1;} switch (globalThis.unknown) { case 1: // retained // lead removed var a = 1; // trail removed // lead retained console.log(2); // trail retained case 2: // retained // lead removed var a = 1; // trail removed // lead retained console.log(2); // trail retained // lead removed var a = 1; case 3: // retained // lead retained console.log(2); // trail retained // lead removed var a = 1; case 4: /* lead removed */ var a = 1; /* lead retained */ console.log('3'); // trail retained default: // retained /* lead removed */ var a = 1; // trail removed /* lead retained */ console.log(2); // trail retained } // lead removed var a = 1; // trail removed // lead retained console.log(2); // trail retained // lead removed var a = 1; // trail removed /* footer retained */ rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/000077500000000000000000000000001450520414700260035ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/_config.js000066400000000000000000000003221450520414700277420ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly handles reserved keywords in exports/imports', options: { input: ['main'], output: { name: 'reservedKeywords' }, external: ['external'] } }); rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/_expected/000077500000000000000000000000001450520414700277435ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/_expected/amd.js000066400000000000000000000020271450520414700310430ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); console.log(external.finally, external.catch); // retain those local bindings const legal = 10; Object.defineProperty(exports, 'const', { enumerable: true, get: function () { return external.const; } }); Object.defineProperty(exports, 'in', { enumerable: true, get: function () { return external.for; } }); Object.defineProperty(exports, 'return', { enumerable: true, get: function () { return external.bar; } }); exports.yield = external__namespace; exports.await = legal; })); rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/_expected/cjs.js000066400000000000000000000017251450520414700310650ustar00rootroot00000000000000'use strict'; var external = require('external'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); console.log(external.finally, external.catch); // retain those local bindings const legal = 10; Object.defineProperty(exports, 'const', { enumerable: true, get: function () { return external.const; } }); Object.defineProperty(exports, 'in', { enumerable: true, get: function () { return external.for; } }); Object.defineProperty(exports, 'return', { enumerable: true, get: function () { return external.bar; } }); exports.yield = external__namespace; exports.await = legal; rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/_expected/es.js000066400000000000000000000004631450520414700307130ustar00rootroot00000000000000import { finally as finally$1, catch as catch$1 } from 'external'; import * as external from 'external'; export { external as yield }; export { const, for as in, bar as return } from 'external'; console.log(finally$1, catch$1); // retain those local bindings const legal = 10; export { legal as await }; rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/_expected/iife.js000066400000000000000000000020561450520414700312200ustar00rootroot00000000000000var reservedKeywords = (function (exports, external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); console.log(external.finally, external.catch); // retain those local bindings const legal = 10; Object.defineProperty(exports, 'const', { enumerable: true, get: function () { return external.const; } }); Object.defineProperty(exports, 'in', { enumerable: true, get: function () { return external.for; } }); Object.defineProperty(exports, 'return', { enumerable: true, get: function () { return external.bar; } }); exports.yield = external__namespace; exports.await = legal; return exports; })({}, external); rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/_expected/system.js000066400000000000000000000007071450520414700316310ustar00rootroot00000000000000System.register('reservedKeywords', ['external'], (function (exports) { 'use strict'; var finally$1, catch$1; return { setters: [function (module) { finally$1 = module.finally; catch$1 = module.catch; exports({ const: module.const, in: module.for, return: module.bar, yield: module }); }], execute: (function () { console.log(finally$1, catch$1); // retain those local bindings const legal = exports('await', 10); }) }; })); rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/_expected/umd.js000066400000000000000000000025441450520414700310730ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.reservedKeywords = {}, global.external)); })(this, (function (exports, external) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var external__namespace = /*#__PURE__*/_interopNamespaceDefault(external); console.log(external.finally, external.catch); // retain those local bindings const legal = 10; Object.defineProperty(exports, 'const', { enumerable: true, get: function () { return external.const; } }); Object.defineProperty(exports, 'in', { enumerable: true, get: function () { return external.for; } }); Object.defineProperty(exports, 'return', { enumerable: true, get: function () { return external.bar; } }); exports.yield = external__namespace; exports.await = legal; })); rollup-3.29.4/test/form/samples/reserved-keywords-in-imports-exports/main.js000066400000000000000000000004361450520414700272700ustar00rootroot00000000000000import { finally as baz, catch as bazinga } from 'external'; console.log(baz, bazinga); // retain those local bindings const legal = 10; export { legal as await }; export { bar as return, const, for as in } from 'external'; import * as lib from 'external'; export { lib as yield }; rollup-3.29.4/test/form/samples/resolution-order/000077500000000000000000000000001450520414700220325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/resolution-order/_config.js000066400000000000000000000004271450520414700237770ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not depend on the resolution order of modules for tree-shaking (#2753)', options: { plugins: { resolveId(id) { if (id === './utcWeek') { return new Promise(resolve => setTimeout(resolve, 0)); } } } } }); rollup-3.29.4/test/form/samples/resolution-order/_expected.js000066400000000000000000000000251450520414700243250ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/form/samples/resolution-order/locale.js000066400000000000000000000001661450520414700236320ustar00rootroot00000000000000import { utcSunday, utcTuesday } from './utcWeek' export default function formatLocale(locale) { utcSunday() } rollup-3.29.4/test/form/samples/resolution-order/main.js000066400000000000000000000001761450520414700233200ustar00rootroot00000000000000import { utcMonday } from './utcWeek'; import formatLocale from './locale'; utcMonday(); formatLocale(); console.log('main'); rollup-3.29.4/test/form/samples/resolution-order/utcWeek.js000066400000000000000000000013101450520414700237720ustar00rootroot00000000000000function interval() { var i = function() {}; i.range = function() {}; return i; } function utcWeekday(i) { return interval(); } export var utcSunday = utcWeekday(0); export var utcMonday = utcWeekday(1); export var utcTuesday = utcWeekday(2); export var utcWednesday = utcWeekday(3); export var utcThursday = utcWeekday(4); export var utcFriday = utcWeekday(5); export var utcSaturday = utcWeekday(6); export var utcSundays = utcSunday.range; export var utcMondays = utcMonday.range; export var utcTuesdays = utcTuesday.range; export var utcWednesdays = utcWednesday.range; export var utcThursdays = utcThursday.range; export var utcFridays = utcFriday.range; export var utcSaturdays = utcSaturday.range; rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/000077500000000000000000000000001450520414700251325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/_config.js000066400000000000000000000006111450520414700270720ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not resolve external dynamic imports via plugins (#2481)', options: { output: { globals: { external: 'myExternal' }, name: 'bundle' }, external(id) { return id.endsWith('external'); }, plugins: [ { resolveId(id) { if (id === 'external') { return '/absolute/path/to/external'; } } } ] } }); rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/_expected/000077500000000000000000000000001450520414700270725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/_expected/amd.js000066400000000000000000000014101450520414700301650ustar00rootroot00000000000000define(['require', 'exports', 'external'], (function (require, exports, myExternal) { 'use strict'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } const test = () => myExternal; const someDynamicImport = () => new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); exports.someDynamicImport = someDynamicImport; exports.test = test; })); rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/_expected/cjs.js000066400000000000000000000003171450520414700302100ustar00rootroot00000000000000'use strict'; var myExternal = require('external'); const test = () => myExternal; const someDynamicImport = () => import('external'); exports.someDynamicImport = someDynamicImport; exports.test = test; rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/_expected/es.js000066400000000000000000000002351450520414700300370ustar00rootroot00000000000000import myExternal from 'external'; const test = () => myExternal; const someDynamicImport = () => import('external'); export { someDynamicImport, test }; rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/_expected/iife.js000066400000000000000000000004031450520414700303410ustar00rootroot00000000000000var bundle = (function (exports, myExternal) { 'use strict'; const test = () => myExternal; const someDynamicImport = () => import('external'); exports.someDynamicImport = someDynamicImport; exports.test = test; return exports; })({}, myExternal); rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/_expected/system.js000066400000000000000000000005601450520414700307550ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports, module) { 'use strict'; var myExternal; return { setters: [function (module) { myExternal = module.default; }], execute: (function () { const test = exports('test', () => myExternal); const someDynamicImport = exports('someDynamicImport', () => module.import('external')); }) }; })); rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/_expected/umd.js000066400000000000000000000010711450520414700302140ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.myExternal)); })(this, (function (exports, myExternal) { 'use strict'; const test = () => myExternal; const someDynamicImport = () => import('external'); exports.someDynamicImport = someDynamicImport; exports.test = test; })); rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/main.js000066400000000000000000000001111450520414700264050ustar00rootroot00000000000000export * from './someStaticImport'; export * from './someDynamicImport'; rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/someDynamicImport.js000066400000000000000000000000731450520414700311330ustar00rootroot00000000000000export const someDynamicImport = () => import('external'); rollup-3.29.4/test/form/samples/resolve-external-dynamic-imports/someStaticImport.js000066400000000000000000000001121450520414700307700ustar00rootroot00000000000000import myExternal from 'external'; export const test = () => myExternal; rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/000077500000000000000000000000001450520414700245505ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/_config.js000066400000000000000000000003711450520414700265130ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly exports resolved import.meta.url', options: { plugins: [ { resolveImportMeta(property) { return property ? "'url'" : "'meta'"; } } ], output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/_expected/000077500000000000000000000000001450520414700265105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/_expected/amd.js000066400000000000000000000002461450520414700276110ustar00rootroot00000000000000define(['module', 'exports'], (function (module, exports) { 'use strict'; const url = 'url'; const meta = 'meta'; exports.meta = meta; exports.url = url; })); rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/_expected/cjs.js000066400000000000000000000001401450520414700276200ustar00rootroot00000000000000'use strict'; const url = 'url'; const meta = 'meta'; exports.meta = meta; exports.url = url; rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/_expected/es.js000066400000000000000000000000771450520414700274610ustar00rootroot00000000000000const url = 'url'; const meta = 'meta'; export { meta, url }; rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/_expected/iife.js000066400000000000000000000002431450520414700277610ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const url = 'url'; const meta = 'meta'; exports.meta = meta; exports.url = url; return exports; })({}); rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/_expected/system.js000066400000000000000000000003161450520414700303720ustar00rootroot00000000000000System.register('bundle', [], (function (exports, module) { 'use strict'; return { execute: (function () { const url = exports('url', 'url'); const meta = exports('meta', 'meta'); }) }; })); rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/_expected/umd.js000066400000000000000000000006611450520414700276360ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; const url = 'url'; const meta = 'meta'; exports.meta = meta; exports.url = url; })); rollup-3.29.4/test/form/samples/resolve-import-meta-url-export/main.js000066400000000000000000000001051450520414700260260ustar00rootroot00000000000000export const url = import.meta.url; export const meta = import.meta; rollup-3.29.4/test/form/samples/resolve-import-meta-url/000077500000000000000000000000001450520414700232315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/resolve-import-meta-url/_config.js000066400000000000000000000010641450520414700251740ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to configure import.meta.url', options: { plugins: [ { resolveImportMeta(property, { chunkId, moduleId }) { if (!moduleId.endsWith('resolved.js')) { return `'${property}=${chunkId}:${moduleId .replace(/\\/g, '/') .split('/') .slice(-2) .join('/')}'`; } return null; } }, { resolveImportMeta(property, { moduleId }) { if (!moduleId.endsWith('unresolved.js')) { return `'resolved'`; } return null; } } ] } }); rollup-3.29.4/test/form/samples/resolve-import-meta-url/_expected/000077500000000000000000000000001450520414700251715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/resolve-import-meta-url/_expected/amd.js000066400000000000000000000007421450520414700262730ustar00rootroot00000000000000define(['module'], (function (module) { 'use strict'; console.log('resolved'); console.log('resolved'); console.log('resolved'); console.log(new URL(module.uri, document.baseURI).href); console.log(undefined); console.log(({ url: new URL(module.uri, document.baseURI).href })); console.log('url=amd.js:resolve-import-meta-url/main.js'); console.log('privateProp=amd.js:resolve-import-meta-url/main.js'); console.log('null=amd.js:resolve-import-meta-url/main.js'); })); rollup-3.29.4/test/form/samples/resolve-import-meta-url/_expected/cjs.js000066400000000000000000000014531450520414700263110ustar00rootroot00000000000000'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; console.log('resolved'); console.log('resolved'); console.log('resolved'); console.log((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cjs.js', document.baseURI).href))); console.log(undefined); console.log(({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('cjs.js', document.baseURI).href)) })); console.log('url=cjs.js:resolve-import-meta-url/main.js'); console.log('privateProp=cjs.js:resolve-import-meta-url/main.js'); console.log('null=cjs.js:resolve-import-meta-url/main.js'); rollup-3.29.4/test/form/samples/resolve-import-meta-url/_expected/es.js000066400000000000000000000005421450520414700261370ustar00rootroot00000000000000console.log('resolved'); console.log('resolved'); console.log('resolved'); console.log(import.meta.url); console.log(import.meta.privateProp); console.log(import.meta); console.log('url=es.js:resolve-import-meta-url/main.js'); console.log('privateProp=es.js:resolve-import-meta-url/main.js'); console.log('null=es.js:resolve-import-meta-url/main.js'); rollup-3.29.4/test/form/samples/resolve-import-meta-url/_expected/iife.js000066400000000000000000000012371450520414700264460ustar00rootroot00000000000000(function () { 'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; console.log('resolved'); console.log('resolved'); console.log('resolved'); console.log((_documentCurrentScript && _documentCurrentScript.src || new URL('iife.js', document.baseURI).href)); console.log(undefined); console.log(({ url: (_documentCurrentScript && _documentCurrentScript.src || new URL('iife.js', document.baseURI).href) })); console.log('url=iife.js:resolve-import-meta-url/main.js'); console.log('privateProp=iife.js:resolve-import-meta-url/main.js'); console.log('null=iife.js:resolve-import-meta-url/main.js'); })(); rollup-3.29.4/test/form/samples/resolve-import-meta-url/_expected/system.js000066400000000000000000000007761450520414700270650ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log('resolved'); console.log('resolved'); console.log('resolved'); console.log(module.meta.url); console.log(module.meta.privateProp); console.log(module.meta); console.log('url=system.js:resolve-import-meta-url/main.js'); console.log('privateProp=system.js:resolve-import-meta-url/main.js'); console.log('null=system.js:resolve-import-meta-url/main.js'); }) }; })); rollup-3.29.4/test/form/samples/resolve-import-meta-url/_expected/umd.js000066400000000000000000000021311450520414700263110ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; console.log('resolved'); console.log('resolved'); console.log('resolved'); console.log((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('umd.js', document.baseURI).href))); console.log(undefined); console.log(({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('umd.js', document.baseURI).href)) })); console.log('url=umd.js:resolve-import-meta-url/main.js'); console.log('privateProp=umd.js:resolve-import-meta-url/main.js'); console.log('null=umd.js:resolve-import-meta-url/main.js'); })); rollup-3.29.4/test/form/samples/resolve-import-meta-url/main.js000066400000000000000000000002131450520414700245070ustar00rootroot00000000000000import './resolved'; import './unresolved'; console.log(import.meta.url); console.log(import.meta.privateProp); console.log(import.meta); rollup-3.29.4/test/form/samples/resolve-import-meta-url/resolved.js000066400000000000000000000001361450520414700254120ustar00rootroot00000000000000console.log(import.meta.url); console.log(import.meta.privateProp); console.log(import.meta); rollup-3.29.4/test/form/samples/resolve-import-meta-url/unresolved.js000066400000000000000000000001361450520414700257550ustar00rootroot00000000000000console.log(import.meta.url); console.log(import.meta.privateProp); console.log(import.meta); rollup-3.29.4/test/form/samples/return-after-error/000077500000000000000000000000001450520414700222635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/return-after-error/_config.js000066400000000000000000000001671450520414700242310ustar00rootroot00000000000000module.exports = defineTest({ description: 'tree-shakes entities referenced in a return statement after an error' }); rollup-3.29.4/test/form/samples/return-after-error/_expected.js000066400000000000000000000001541450520414700245610ustar00rootroot00000000000000function getInstance() { throw new Error('error'); } console.log(getInstance()); export { getInstance }; rollup-3.29.4/test/form/samples/return-after-error/main.js000066400000000000000000000002031450520414700235400ustar00rootroot00000000000000class Removed {} export function getInstance() { throw new Error('error'); return new Removed(); } console.log(getInstance()); rollup-3.29.4/test/form/samples/return-statement/000077500000000000000000000000001450520414700220375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/return-statement/missing-space/000077500000000000000000000000001450520414700246015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/return-statement/missing-space/_config.js000066400000000000000000000001601450520414700265400ustar00rootroot00000000000000module.exports = defineTest({ description: 'Inserts space when simplifying return statement without space' }); rollup-3.29.4/test/form/samples/return-statement/missing-space/_expected.js000066400000000000000000000000701450520414700270740ustar00rootroot00000000000000function test() { return null; } console.log(test()); rollup-3.29.4/test/form/samples/return-statement/missing-space/main.js000066400000000000000000000000731450520414700260630ustar00rootroot00000000000000function test() { return!1||null; } console.log(test()); rollup-3.29.4/test/form/samples/return-value-access-in-conditional/000077500000000000000000000000001450520414700253135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/return-value-access-in-conditional/_config.js000066400000000000000000000001671450520414700272610ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles accessing funciton return values in deoptimized conditionals' }); rollup-3.29.4/test/form/samples/return-value-access-in-conditional/_expected.js000066400000000000000000000000551450520414700276110ustar00rootroot00000000000000console.log(true); console.log('retained'); rollup-3.29.4/test/form/samples/return-value-access-in-conditional/main.js000066400000000000000000000002431450520414700265740ustar00rootroot00000000000000function foo() { const result = false; return result; } console.log(foo() || true); if (foo() || true) console.log('retained'); else console.log('removed'); rollup-3.29.4/test/form/samples/runs-output-plugins-last/000077500000000000000000000000001450520414700234635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/runs-output-plugins-last/_config.js000066400000000000000000000005611450520414700254270ustar00rootroot00000000000000module.exports = defineTest({ description: 'runs output plugins last', options: { plugins: [ { name: 'input', renderChunk(code) { return `/* input */\n${code}\n/* input */`; } } ], output: { plugins: [ { name: 'output', renderChunk(code) { return `/* output */\n${code}\n/* output */`; } } ] } } }); rollup-3.29.4/test/form/samples/runs-output-plugins-last/_expected.js000066400000000000000000000001251450520414700257570ustar00rootroot00000000000000/* output */ /* input */ let foo = 'base'; export { foo }; /* input */ /* output */ rollup-3.29.4/test/form/samples/runs-output-plugins-last/main.js000066400000000000000000000000311450520414700247370ustar00rootroot00000000000000export let foo = 'base'; rollup-3.29.4/test/form/samples/self-calling-function-with-effects/000077500000000000000000000000001450520414700252675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/self-calling-function-with-effects/_config.js000066400000000000000000000001451450520414700272310ustar00rootroot00000000000000module.exports = defineTest({ description: 'discards a self-calling function with side-effects' }); rollup-3.29.4/test/form/samples/self-calling-function-with-effects/_expected/000077500000000000000000000000001450520414700272275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/self-calling-function-with-effects/_expected/amd.js000066400000000000000000000003651450520414700303320ustar00rootroot00000000000000define((function () { 'use strict'; function foo ( x ) { effect( x ); if ( x > 0 ) foo( x - 1 ); } function bar ( x ) { effect( x ); if ( x > 0 ) baz( x ); } function baz ( x ) { bar( x - 1 ); } foo( 10 ); bar( 10 ); })); rollup-3.29.4/test/form/samples/self-calling-function-with-effects/_expected/cjs.js000066400000000000000000000003141450520414700303420ustar00rootroot00000000000000'use strict'; function foo ( x ) { effect( x ); if ( x > 0 ) foo( x - 1 ); } function bar ( x ) { effect( x ); if ( x > 0 ) baz( x ); } function baz ( x ) { bar( x - 1 ); } foo( 10 ); bar( 10 ); rollup-3.29.4/test/form/samples/self-calling-function-with-effects/_expected/es.js000066400000000000000000000002751450520414700302000ustar00rootroot00000000000000function foo ( x ) { effect( x ); if ( x > 0 ) foo( x - 1 ); } function bar ( x ) { effect( x ); if ( x > 0 ) baz( x ); } function baz ( x ) { bar( x - 1 ); } foo( 10 ); bar( 10 ); rollup-3.29.4/test/form/samples/self-calling-function-with-effects/_expected/iife.js000066400000000000000000000003601450520414700305000ustar00rootroot00000000000000(function () { 'use strict'; function foo ( x ) { effect( x ); if ( x > 0 ) foo( x - 1 ); } function bar ( x ) { effect( x ); if ( x > 0 ) baz( x ); } function baz ( x ) { bar( x - 1 ); } foo( 10 ); bar( 10 ); })(); rollup-3.29.4/test/form/samples/self-calling-function-with-effects/_expected/system.js000066400000000000000000000005121450520414700311070ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo ( x ) { effect( x ); if ( x > 0 ) foo( x - 1 ); } function bar ( x ) { effect( x ); if ( x > 0 ) baz( x ); } function baz ( x ) { bar( x - 1 ); } foo( 10 ); bar( 10 ); }) }; })); rollup-3.29.4/test/form/samples/self-calling-function-with-effects/_expected/umd.js000066400000000000000000000005231450520414700303520ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo ( x ) { effect( x ); if ( x > 0 ) foo( x - 1 ); } function bar ( x ) { effect( x ); if ( x > 0 ) baz( x ); } function baz ( x ) { bar( x - 1 ); } foo( 10 ); bar( 10 ); })); rollup-3.29.4/test/form/samples/self-calling-function-with-effects/main.js000066400000000000000000000002751450520414700265550ustar00rootroot00000000000000function foo ( x ) { effect( x ); if ( x > 0 ) foo( x - 1 ); } function bar ( x ) { effect( x ); if ( x > 0 ) baz( x ); } function baz ( x ) { bar( x - 1 ); } foo( 10 ); bar( 10 ); rollup-3.29.4/test/form/samples/self-calling-function/000077500000000000000000000000001450520414700227015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/self-calling-function/_config.js000066400000000000000000000002151450520414700246410ustar00rootroot00000000000000module.exports = defineTest({ description: 'discards a self-calling function without side-effects', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/self-calling-function/_expected/000077500000000000000000000000001450520414700246415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/self-calling-function/_expected/amd.js000066400000000000000000000000541450520414700257370ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/self-calling-function/_expected/cjs.js000066400000000000000000000000171450520414700257540ustar00rootroot00000000000000'use strict'; rollup-3.29.4/test/form/samples/self-calling-function/_expected/es.js000066400000000000000000000000011450520414700255750ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/self-calling-function/_expected/iife.js000066400000000000000000000000471450520414700261140ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-3.29.4/test/form/samples/self-calling-function/_expected/system.js000066400000000000000000000001471450520414700265250ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/self-calling-function/_expected/umd.js000066400000000000000000000002121450520414700257570ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/self-calling-function/main.js000066400000000000000000000002411450520414700241600ustar00rootroot00000000000000function foo ( x ) { if ( x > 0 ) foo( x - 1 ); } function bar ( x ) { if ( x > 0 ) baz( x ); } function baz ( x ) { bar( x - 1 ); } foo( 10 ); bar( 10 ); rollup-3.29.4/test/form/samples/self-contained-bundle/000077500000000000000000000000001450520414700226605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/self-contained-bundle/_config.js000066400000000000000000000001101450520414700246120ustar00rootroot00000000000000module.exports = defineTest({ description: 'self-contained bundle' }); rollup-3.29.4/test/form/samples/self-contained-bundle/_expected/000077500000000000000000000000001450520414700246205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/self-contained-bundle/_expected/amd.js000066400000000000000000000003541450520414700257210ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( bar() ); } function bar () { return 42; } // comment before 1 console.log( 1 ); console.log( 2 ); // comment alongside 2 foo(); console.log( 3 ); })); rollup-3.29.4/test/form/samples/self-contained-bundle/_expected/cjs.js000066400000000000000000000003051450520414700257330ustar00rootroot00000000000000'use strict'; function foo () { console.log( bar() ); } function bar () { return 42; } // comment before 1 console.log( 1 ); console.log( 2 ); // comment alongside 2 foo(); console.log( 3 ); rollup-3.29.4/test/form/samples/self-contained-bundle/_expected/es.js000066400000000000000000000002661450520414700255710ustar00rootroot00000000000000function foo () { console.log( bar() ); } function bar () { return 42; } // comment before 1 console.log( 1 ); console.log( 2 ); // comment alongside 2 foo(); console.log( 3 ); rollup-3.29.4/test/form/samples/self-contained-bundle/_expected/iife.js000066400000000000000000000003471450520414700260760ustar00rootroot00000000000000(function () { 'use strict'; function foo () { console.log( bar() ); } function bar () { return 42; } // comment before 1 console.log( 1 ); console.log( 2 ); // comment alongside 2 foo(); console.log( 3 ); })(); rollup-3.29.4/test/form/samples/self-contained-bundle/_expected/system.js000066400000000000000000000004751450520414700265100ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo () { console.log( bar() ); } function bar () { return 42; } // comment before 1 console.log( 1 ); console.log( 2 ); // comment alongside 2 foo(); console.log( 3 ); }) }; })); rollup-3.29.4/test/form/samples/self-contained-bundle/_expected/umd.js000066400000000000000000000005121450520414700257410ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo () { console.log( bar() ); } function bar () { return 42; } // comment before 1 console.log( 1 ); console.log( 2 ); // comment alongside 2 foo(); console.log( 3 ); })); rollup-3.29.4/test/form/samples/self-contained-bundle/foo.js000066400000000000000000000002231450520414700237760ustar00rootroot00000000000000export default function foo () { console.log( bar() ); } function bar () { return 42; } function baz () { return 'this should be excluded'; } rollup-3.29.4/test/form/samples/self-contained-bundle/main.js000066400000000000000000000002031450520414700241350ustar00rootroot00000000000000import foo from './foo'; // comment before 1 console.log( 1 ); console.log( 2 ); // comment alongside 2 foo(); console.log( 3 ); rollup-3.29.4/test/form/samples/self-deoptimization/000077500000000000000000000000001450520414700225045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/self-deoptimization/_config.js000066400000000000000000000002061450520414700244440ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles situations where a member expression is deoptimized while being deoptimized' }); rollup-3.29.4/test/form/samples/self-deoptimization/_expected.js000066400000000000000000000002061450520414700250000ustar00rootroot00000000000000function foo(a) { var b = bar({}, a); b && b.delete(); } function bar(a, b) { return (b = 1) ? a.a[b] || null : null; } foo({}); rollup-3.29.4/test/form/samples/self-deoptimization/main.js000066400000000000000000000002061450520414700237640ustar00rootroot00000000000000function foo(a) { var b = bar({}, a); b && b.delete(); } function bar(a, b) { return (b = 1) ? a.a[b] || null : null; } foo({}); rollup-3.29.4/test/form/samples/sequence-expression/000077500000000000000000000000001450520414700225235ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/sequence-expression/_config.js000066400000000000000000000001671450520414700244710ustar00rootroot00000000000000module.exports = defineTest({ description: 'only retain expressions with effects in sequence expressions (#1649)' }); rollup-3.29.4/test/form/samples/sequence-expression/_expected.js000066400000000000000000000007641450520414700250300ustar00rootroot00000000000000function foo$1 () { console.log( 'foo' ); } // should remove expressions without side-effect, multiple effects (foo(), foo(), 2); // without white-space, effect at the end (foo()); // should only keep final expression var d = (2); console.log(d); // should keep f import (foo$1()); // should properly render complex sub-expressions ((() => {console.log(foo$1());})(), 1); // should maintain this context var module = {}; module.bar = function () { console.log( 'bar' );}; (0, module.bar)(); rollup-3.29.4/test/form/samples/sequence-expression/foo.js000066400000000000000000000000651450520414700236450ustar00rootroot00000000000000export function foo () { console.log( 'foo' ); } rollup-3.29.4/test/form/samples/sequence-expression/main.js000066400000000000000000000012441450520414700240060ustar00rootroot00000000000000import * as f from './foo'; // should remove expressions without side-effect, multiple effects var a = (0, foo(), 1, foo(), 2); // without white-space, effect at the end var b = (0,1,foo()); // should remove variable without effect var c = (1, 2); // should only keep final expression var d = (1, 2); console.log(d); // should infer value if ((1, 2) !== 2) { console.log( 'effect' ); } // should keep f import var e = (0, f.foo()); // should properly render complex sub-expressions var g = ((() => {})(), (() => {console.log(f.foo())})(), 1); // should maintain this context var module = {}; module.bar = function () { console.log( 'bar' )}; var h = (0, module.bar)(); rollup-3.29.4/test/form/samples/shorthand-properties/000077500000000000000000000000001450520414700227025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/shorthand-properties/_config.js000066400000000000000000000001421450520414700246410ustar00rootroot00000000000000module.exports = defineTest({ description: 'expands shorthand properties as necessary (#61)' }); rollup-3.29.4/test/form/samples/shorthand-properties/_expected/000077500000000000000000000000001450520414700246425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/shorthand-properties/_expected/amd.js000066400000000000000000000005041450520414700257400ustar00rootroot00000000000000define((function () { 'use strict'; function x$2 () { return 'foo'; } var foo = { x: x$2 }; function x$1 () { return 'bar'; } var bar = { x: x$1 }; function x () { return 'baz'; } var baz = { x }; assert.equal( foo.x(), 'foo' ); assert.equal( bar.x(), 'bar' ); assert.equal( baz.x(), 'baz' ); })); rollup-3.29.4/test/form/samples/shorthand-properties/_expected/cjs.js000066400000000000000000000004311450520414700257550ustar00rootroot00000000000000'use strict'; function x$2 () { return 'foo'; } var foo = { x: x$2 }; function x$1 () { return 'bar'; } var bar = { x: x$1 }; function x () { return 'baz'; } var baz = { x }; assert.equal( foo.x(), 'foo' ); assert.equal( bar.x(), 'bar' ); assert.equal( baz.x(), 'baz' ); rollup-3.29.4/test/form/samples/shorthand-properties/_expected/es.js000066400000000000000000000004121450520414700256040ustar00rootroot00000000000000function x$2 () { return 'foo'; } var foo = { x: x$2 }; function x$1 () { return 'bar'; } var bar = { x: x$1 }; function x () { return 'baz'; } var baz = { x }; assert.equal( foo.x(), 'foo' ); assert.equal( bar.x(), 'bar' ); assert.equal( baz.x(), 'baz' ); rollup-3.29.4/test/form/samples/shorthand-properties/_expected/iife.js000066400000000000000000000004771450520414700261240ustar00rootroot00000000000000(function () { 'use strict'; function x$2 () { return 'foo'; } var foo = { x: x$2 }; function x$1 () { return 'bar'; } var bar = { x: x$1 }; function x () { return 'baz'; } var baz = { x }; assert.equal( foo.x(), 'foo' ); assert.equal( bar.x(), 'bar' ); assert.equal( baz.x(), 'baz' ); })(); rollup-3.29.4/test/form/samples/shorthand-properties/_expected/system.js000066400000000000000000000006351450520414700265300ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function x$2 () { return 'foo'; } var foo = { x: x$2 }; function x$1 () { return 'bar'; } var bar = { x: x$1 }; function x () { return 'baz'; } var baz = { x }; assert.equal( foo.x(), 'foo' ); assert.equal( bar.x(), 'bar' ); assert.equal( baz.x(), 'baz' ); }) }; })); rollup-3.29.4/test/form/samples/shorthand-properties/_expected/umd.js000066400000000000000000000006421450520414700257670ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function x$2 () { return 'foo'; } var foo = { x: x$2 }; function x$1 () { return 'bar'; } var bar = { x: x$1 }; function x () { return 'baz'; } var baz = { x }; assert.equal( foo.x(), 'foo' ); assert.equal( bar.x(), 'bar' ); assert.equal( baz.x(), 'baz' ); })); rollup-3.29.4/test/form/samples/shorthand-properties/bar.js000066400000000000000000000001041450520414700237770ustar00rootroot00000000000000function x () { return 'bar'; } var bar = { x }; export { bar }; rollup-3.29.4/test/form/samples/shorthand-properties/baz.js000066400000000000000000000001041450520414700240070ustar00rootroot00000000000000function x () { return 'baz'; } var baz = { x }; export { baz }; rollup-3.29.4/test/form/samples/shorthand-properties/foo.js000066400000000000000000000001041450520414700240160ustar00rootroot00000000000000function x () { return 'foo'; } var foo = { x }; export { foo }; rollup-3.29.4/test/form/samples/shorthand-properties/main.js000066400000000000000000000002701450520414700241630ustar00rootroot00000000000000import { foo } from './foo'; import { bar } from './bar'; import { baz } from './baz'; assert.equal( foo.x(), 'foo' ); assert.equal( bar.x(), 'bar' ); assert.equal( baz.x(), 'baz' ); rollup-3.29.4/test/form/samples/side-effect-b/000077500000000000000000000000001450520414700211135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-b/_config.js000066400000000000000000000002011450520414700230460ustar00rootroot00000000000000module.exports = defineTest({ description: 'discards IIFE with no side-effects', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-b/_expected/000077500000000000000000000000001450520414700230535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-b/_expected/amd.js000066400000000000000000000001121450520414700241440ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-b/_expected/cjs.js000066400000000000000000000000661450520414700241720ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/side-effect-b/_expected/es.js000066400000000000000000000000541450520414700240170ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/side-effect-b/_expected/iife.js000066400000000000000000000001241450520414700243220ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-3.29.4/test/form/samples/side-effect-b/_expected/system.js000066400000000000000000000002371450520414700247370ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/side-effect-b/_expected/umd.js000066400000000000000000000005611450520414700242000ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-b/main.js000066400000000000000000000001661450520414700224000ustar00rootroot00000000000000var Unused = (function () { function Unused () {} Unused.prototype = {}; return Unused; }()); export default 42; rollup-3.29.4/test/form/samples/side-effect-c/000077500000000000000000000000001450520414700211145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-c/_config.js000066400000000000000000000002051450520414700230530ustar00rootroot00000000000000module.exports = defineTest({ description: 'discards function with no side-effects', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-c/_expected/000077500000000000000000000000001450520414700230545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-c/_expected/amd.js000066400000000000000000000001121450520414700241450ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-c/_expected/cjs.js000066400000000000000000000000661450520414700241730ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/side-effect-c/_expected/es.js000066400000000000000000000000541450520414700240200ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/side-effect-c/_expected/iife.js000066400000000000000000000001241450520414700243230ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-3.29.4/test/form/samples/side-effect-c/_expected/system.js000066400000000000000000000002371450520414700247400ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/side-effect-c/_expected/umd.js000066400000000000000000000005611450520414700242010ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-c/main.js000066400000000000000000000002141450520414700223730ustar00rootroot00000000000000var factory = function () { function Unused () {} Unused.prototype = {}; return Unused; }; var Unused = factory(); export default 42; rollup-3.29.4/test/form/samples/side-effect-d/000077500000000000000000000000001450520414700211155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-d/_config.js000066400000000000000000000002131450520414700230530ustar00rootroot00000000000000module.exports = defineTest({ description: 'excludes functions that are known to be pure', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-d/_expected/000077500000000000000000000000001450520414700230555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-d/_expected/amd.js000066400000000000000000000001121450520414700241460ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-d/_expected/cjs.js000066400000000000000000000000661450520414700241740ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/side-effect-d/_expected/es.js000066400000000000000000000000541450520414700240210ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/side-effect-d/_expected/iife.js000066400000000000000000000001241450520414700243240ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-3.29.4/test/form/samples/side-effect-d/_expected/system.js000066400000000000000000000002371450520414700247410ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/side-effect-d/_expected/umd.js000066400000000000000000000005611450520414700242020ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-d/main.js000066400000000000000000000001211450520414700223710ustar00rootroot00000000000000var obj = { foo: 1, bar: 2 }; var keys = Object.keys( obj ); export default 42; rollup-3.29.4/test/form/samples/side-effect-default-reexport/000077500000000000000000000000001450520414700241645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-default-reexport/_config.js000066400000000000000000000003531450520414700261270ustar00rootroot00000000000000module.exports = defineTest({ description: 'Observes side-effects in side-effect-free modules that contain a used default export that just reexports from another module', options: { treeshake: { moduleSideEffects: false } } }); rollup-3.29.4/test/form/samples/side-effect-default-reexport/_expected.js000066400000000000000000000012161450520414700264620ustar00rootroot00000000000000var Menu$1 = { name: 'menu' }; var Item$2 = { name: 'item' }; /* default-export/index2 */ Menu$1.Item1 = Item$2; /* default-export/index */ Menu$1.Item2 = Item$2; var NamedExport = { name: 'menu' }; var Item$1 = { name: 'item' }; /* named-export/index2 */ NamedExport.Item1 = Item$1; /* named-export/index */ NamedExport.Item2 = Item$1; var Menu = { name: 'menu' }; var Item = { name: 'item' }; /* default-export2/index2 */ Menu.Item1 = Item; /* default-export2/index */ Menu.Item2 = Item; console.log('test-package-default-export', Menu$1.Item); console.log('test-package-named-export', NamedExport.Item); export { Menu as default }; rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export/000077500000000000000000000000001450520414700271275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export/index.js000066400000000000000000000001751450520414700305770ustar00rootroot00000000000000import Menu from './index2'; import Item from './item'; /* default-export/index */ Menu.Item2 = Item; export default Menu; rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export/index2.js000066400000000000000000000001741450520414700306600ustar00rootroot00000000000000import Menu from './menu'; import Item from './item'; /* default-export/index2 */ Menu.Item1 = Item; export default Menu; rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export/item.js000066400000000000000000000000421450520414700304170ustar00rootroot00000000000000export default { name: 'item' }; rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export/menu.js000066400000000000000000000000421450520414700304250ustar00rootroot00000000000000export default { name: 'menu' }; rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export/reexport.js000066400000000000000000000000531450520414700313330ustar00rootroot00000000000000export { default as Menu } from './index'; rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export2/000077500000000000000000000000001450520414700272115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export2/index.js000066400000000000000000000001761450520414700306620ustar00rootroot00000000000000import Menu from './index2'; import Item from './item'; /* default-export2/index */ Menu.Item2 = Item; export default Menu; rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export2/index2.js000066400000000000000000000001751450520414700307430ustar00rootroot00000000000000import Menu from './menu'; import Item from './item'; /* default-export2/index2 */ Menu.Item1 = Item; export default Menu; rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export2/item.js000066400000000000000000000000421450520414700305010ustar00rootroot00000000000000export default { name: 'item' }; rollup-3.29.4/test/form/samples/side-effect-default-reexport/default-export2/menu.js000066400000000000000000000000421450520414700305070ustar00rootroot00000000000000export default { name: 'menu' }; rollup-3.29.4/test/form/samples/side-effect-default-reexport/main.js000066400000000000000000000004711450520414700254500ustar00rootroot00000000000000import { Menu as DefaultExport } from './default-export/reexport.js'; console.log('test-package-default-export', DefaultExport.Item); import { Menu as NamedExport } from './named-export/index.js'; console.log('test-package-named-export', NamedExport.Item); export { default } from './default-export2/index.js'; rollup-3.29.4/test/form/samples/side-effect-default-reexport/named-export/000077500000000000000000000000001450520414700265675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-default-reexport/named-export/index.js000066400000000000000000000001731450520414700302350ustar00rootroot00000000000000import { Menu } from './index2'; import Item from './item'; /* named-export/index */ Menu.Item2 = Item; export { Menu }; rollup-3.29.4/test/form/samples/side-effect-default-reexport/named-export/index2.js000066400000000000000000000001661450520414700303210ustar00rootroot00000000000000import Menu from './menu'; import Item from './item'; /* named-export/index2 */ Menu.Item1 = Item; export { Menu }; rollup-3.29.4/test/form/samples/side-effect-default-reexport/named-export/item.js000066400000000000000000000000421450520414700300570ustar00rootroot00000000000000export default { name: 'item' }; rollup-3.29.4/test/form/samples/side-effect-default-reexport/named-export/menu.js000066400000000000000000000000421450520414700300650ustar00rootroot00000000000000export default { name: 'menu' }; rollup-3.29.4/test/form/samples/side-effect-e/000077500000000000000000000000001450520414700211165ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-e/_config.js000066400000000000000000000002241450520414700230560ustar00rootroot00000000000000module.exports = defineTest({ description: 'accounts for local scopes when tested function purity', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-e/_expected.js000066400000000000000000000002401450520414700234100ustar00rootroot00000000000000function foo () { var Object = { keys: function () { console.log( 'side-effect' ); } }; var obj = { foo: 1, bar: 2 }; Object.keys( obj ); } foo(); rollup-3.29.4/test/form/samples/side-effect-e/main.js000066400000000000000000000002531450520414700224000ustar00rootroot00000000000000function foo () { var Object = { keys: function () { console.log( 'side-effect' ); } }; var obj = { foo: 1, bar: 2 }; var keys = Object.keys( obj ); } foo(); rollup-3.29.4/test/form/samples/side-effect-es5-classes/000077500000000000000000000000001450520414700230215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-es5-classes/_config.js000066400000000000000000000002371450520414700247650ustar00rootroot00000000000000module.exports = defineTest({ description: 'omits ES5 classes which are pure (e.g. they only assign to `this`)', expectedWarnings: ['THIS_IS_UNDEFINED'] }); rollup-3.29.4/test/form/samples/side-effect-es5-classes/_expected.js000066400000000000000000000006301450520414700253160ustar00rootroot00000000000000function Bar ( x ) { console.log( 'side effect' ); this.value = x; } function Baz ( x ) { this[ console.log( 'side effect' ) ] = x; } function Qux ( x ) { this.value = console.log( 'side effect' ); } function Corge ( x ) { this.value = x; } var Arrow = ( x ) => { undefined.value = x; }; console.log( 'before' ); new Bar(5); new Baz(5); new Qux(); Corge(5); new Arrow(5); console.log( 'after' ); rollup-3.29.4/test/form/samples/side-effect-es5-classes/arrow.js000066400000000000000000000000621450520414700245070ustar00rootroot00000000000000export var Arrow = ( x ) => { this.value = x; }; rollup-3.29.4/test/form/samples/side-effect-es5-classes/bar.js000066400000000000000000000001161450520414700241210ustar00rootroot00000000000000export function Bar ( x ) { console.log( 'side effect' ); this.value = x; } rollup-3.29.4/test/form/samples/side-effect-es5-classes/baz.js000066400000000000000000000001111450520414700241240ustar00rootroot00000000000000export function Baz ( x ) { this[ console.log( 'side effect' ) ] = x; } rollup-3.29.4/test/form/samples/side-effect-es5-classes/corge.js000066400000000000000000000000611450520414700244530ustar00rootroot00000000000000export function Corge ( x ) { this.value = x; } rollup-3.29.4/test/form/samples/side-effect-es5-classes/foo.js000066400000000000000000000001161450520414700241400ustar00rootroot00000000000000export function Foo ( x ) { this.value = x; this["string property"] = 20; } rollup-3.29.4/test/form/samples/side-effect-es5-classes/main.js000066400000000000000000000005621450520414700243060ustar00rootroot00000000000000import { Foo } from './foo'; import { Bar } from './bar'; import { Baz } from './baz'; import { Qux } from './qux'; import { Corge } from './corge'; import { Arrow } from './arrow'; console.log( 'before' ); var foo = new Foo(5); var bar = new Bar(5); var baz = new Baz(5); var qux = new Qux(5); var corge = Corge(5); var arrow = new Arrow(5); console.log( 'after' ); rollup-3.29.4/test/form/samples/side-effect-es5-classes/qux.js000066400000000000000000000001121450520414700241660ustar00rootroot00000000000000export function Qux ( x ) { this.value = console.log( 'side effect' ); } rollup-3.29.4/test/form/samples/side-effect-f/000077500000000000000000000000001450520414700211175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-f/_config.js000066400000000000000000000002331450520414700230570ustar00rootroot00000000000000module.exports = defineTest({ description: 'disregards side-effects that are contained within a function', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-f/_expected/000077500000000000000000000000001450520414700230575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-f/_expected/amd.js000066400000000000000000000001121450520414700241500ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-f/_expected/cjs.js000066400000000000000000000000661450520414700241760ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/side-effect-f/_expected/es.js000066400000000000000000000000541450520414700240230ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/side-effect-f/_expected/iife.js000066400000000000000000000001241450520414700243260ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-3.29.4/test/form/samples/side-effect-f/_expected/system.js000066400000000000000000000002371450520414700247430ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/side-effect-f/_expected/umd.js000066400000000000000000000005611450520414700242040ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-f/main.js000066400000000000000000000001061450520414700223760ustar00rootroot00000000000000function foo () { var a, b, c; b = 1; } foo(); export default 42; rollup-3.29.4/test/form/samples/side-effect-g/000077500000000000000000000000001450520414700211205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-g/_config.js000066400000000000000000000002161450520414700230610ustar00rootroot00000000000000module.exports = defineTest({ description: 'excludes constructors that are known to be pure', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-g/_expected/000077500000000000000000000000001450520414700230605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-g/_expected/amd.js000066400000000000000000000001121450520414700241510ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-g/_expected/cjs.js000066400000000000000000000000661450520414700241770ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/side-effect-g/_expected/es.js000066400000000000000000000000541450520414700240240ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/side-effect-g/_expected/iife.js000066400000000000000000000001241450520414700243270ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-3.29.4/test/form/samples/side-effect-g/_expected/system.js000066400000000000000000000002371450520414700247440ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/side-effect-g/_expected/umd.js000066400000000000000000000005611450520414700242050ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-g/main.js000066400000000000000000000001031450520414700223740ustar00rootroot00000000000000var err = new Error( 'this will be ignored' ); export default 42; rollup-3.29.4/test/form/samples/side-effect-h/000077500000000000000000000000001450520414700211215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-h/_config.js000066400000000000000000000001701450520414700230610ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes throw statements', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-h/_expected/000077500000000000000000000000001450520414700230615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-h/_expected/amd.js000066400000000000000000000002571450520414700241640ustar00rootroot00000000000000define((function () { 'use strict'; function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-h/_expected/cjs.js000066400000000000000000000002251450520414700241750ustar00rootroot00000000000000'use strict'; function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/side-effect-h/_expected/es.js000066400000000000000000000002131450520414700240220ustar00rootroot00000000000000function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/side-effect-h/_expected/iife.js000066400000000000000000000002711450520414700243330ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = 42; return main; })(); rollup-3.29.4/test/form/samples/side-effect-h/_expected/system.js000066400000000000000000000004201450520414700247370ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/side-effect-h/_expected/umd.js000066400000000000000000000007261450520414700242110ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-h/main.js000066400000000000000000000001621450520414700224020ustar00rootroot00000000000000function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); export default 42; rollup-3.29.4/test/form/samples/side-effect-i/000077500000000000000000000000001450520414700211225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-i/_config.js000066400000000000000000000002021450520414700230560ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes top-level throw statements', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-i/_expected/000077500000000000000000000000001450520414700230625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-i/_expected/amd.js000066400000000000000000000002121450520414700241540ustar00rootroot00000000000000define((function () { 'use strict'; if ( !ok ) { throw new Error( 'this will be included' ); } var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-i/_expected/cjs.js000066400000000000000000000001631450520414700241770ustar00rootroot00000000000000'use strict'; if ( !ok ) { throw new Error( 'this will be included' ); } var main = 42; module.exports = main; rollup-3.29.4/test/form/samples/side-effect-i/_expected/es.js000066400000000000000000000001511450520414700240240ustar00rootroot00000000000000if ( !ok ) { throw new Error( 'this will be included' ); } var main = 42; export { main as default }; rollup-3.29.4/test/form/samples/side-effect-i/_expected/iife.js000066400000000000000000000002241450520414700243320ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; if ( !ok ) { throw new Error( 'this will be included' ); } var main = 42; return main; })(); rollup-3.29.4/test/form/samples/side-effect-i/_expected/system.js000066400000000000000000000003451450520414700247460ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { if ( !ok ) { throw new Error( 'this will be included' ); } var main = exports('default', 42); }) }; })); rollup-3.29.4/test/form/samples/side-effect-i/_expected/umd.js000066400000000000000000000006611450520414700242100ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; if ( !ok ) { throw new Error( 'this will be included' ); } var main = 42; return main; })); rollup-3.29.4/test/form/samples/side-effect-i/main.js000066400000000000000000000001201450520414700223750ustar00rootroot00000000000000if ( !ok ) { throw new Error( 'this will be included' ); } export default 42; rollup-3.29.4/test/form/samples/side-effect-j/000077500000000000000000000000001450520414700211235ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-j/_config.js000066400000000000000000000002241450520414700230630ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes late function declarations with side-effects', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-j/_expected/000077500000000000000000000000001450520414700230635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-j/_expected/amd.js000066400000000000000000000002131450520414700241560ustar00rootroot00000000000000define((function () { 'use strict'; var augment; augment = y => y.augmented = true; function x () {} augment( x ); return x; })); rollup-3.29.4/test/form/samples/side-effect-j/_expected/cjs.js000066400000000000000000000001641450520414700242010ustar00rootroot00000000000000'use strict'; var augment; augment = y => y.augmented = true; function x () {} augment( x ); module.exports = x; rollup-3.29.4/test/form/samples/side-effect-j/_expected/es.js000066400000000000000000000001521450520414700240260ustar00rootroot00000000000000var augment; augment = y => y.augmented = true; function x () {} augment( x ); export { x as default }; rollup-3.29.4/test/form/samples/side-effect-j/_expected/iife.js000066400000000000000000000002251450520414700243340ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var augment; augment = y => y.augmented = true; function x () {} augment( x ); return x; })(); rollup-3.29.4/test/form/samples/side-effect-j/_expected/system.js000066400000000000000000000003601450520414700247440ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', x); var augment; augment = y => y.augmented = true; function x () {} augment( x ); }) }; })); rollup-3.29.4/test/form/samples/side-effect-j/_expected/umd.js000066400000000000000000000006621450520414700242120ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; var augment; augment = y => y.augmented = true; function x () {} augment( x ); return x; })); rollup-3.29.4/test/form/samples/side-effect-j/foo.js000066400000000000000000000001051450520414700222400ustar00rootroot00000000000000var augment; augment = y => y.augmented = true; export { augment }; rollup-3.29.4/test/form/samples/side-effect-j/main.js000066400000000000000000000001231450520414700224010ustar00rootroot00000000000000import { augment } from './foo.js'; export default function x () {} augment( x ); rollup-3.29.4/test/form/samples/side-effect-k/000077500000000000000000000000001450520414700211245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-k/_config.js000066400000000000000000000002131450520414700230620ustar00rootroot00000000000000module.exports = defineTest({ description: 'use of arguments is treated as a side-effect', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-k/_expected/000077500000000000000000000000001450520414700230645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-k/_expected/amd.js000066400000000000000000000006451450520414700241700ustar00rootroot00000000000000define((function () { 'use strict'; function augment ( x ) { var prop, source; var i = arguments.length; var sources = Array( i - 1 ); while ( i-- ) { sources[i-1] = arguments[i]; } while (source = sources.shift()) { for (prop in source) { if (hasOwn.call(source, prop)) { x[prop] = source[prop]; } } } return x; } function x () {} augment( x.prototype ); return x; })); rollup-3.29.4/test/form/samples/side-effect-k/_expected/cjs.js000066400000000000000000000006001450520414700241750ustar00rootroot00000000000000'use strict'; function augment ( x ) { var prop, source; var i = arguments.length; var sources = Array( i - 1 ); while ( i-- ) { sources[i-1] = arguments[i]; } while (source = sources.shift()) { for (prop in source) { if (hasOwn.call(source, prop)) { x[prop] = source[prop]; } } } return x; } function x () {} augment( x.prototype ); module.exports = x; rollup-3.29.4/test/form/samples/side-effect-k/_expected/es.js000066400000000000000000000005661450520414700240400ustar00rootroot00000000000000function augment ( x ) { var prop, source; var i = arguments.length; var sources = Array( i - 1 ); while ( i-- ) { sources[i-1] = arguments[i]; } while (source = sources.shift()) { for (prop in source) { if (hasOwn.call(source, prop)) { x[prop] = source[prop]; } } } return x; } function x () {} augment( x.prototype ); export { x as default }; rollup-3.29.4/test/form/samples/side-effect-k/_expected/iife.js000066400000000000000000000006571450520414700243460ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; function augment ( x ) { var prop, source; var i = arguments.length; var sources = Array( i - 1 ); while ( i-- ) { sources[i-1] = arguments[i]; } while (source = sources.shift()) { for (prop in source) { if (hasOwn.call(source, prop)) { x[prop] = source[prop]; } } } return x; } function x () {} augment( x.prototype ); return x; })(); rollup-3.29.4/test/form/samples/side-effect-k/_expected/system.js000066400000000000000000000010461450520414700247470ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', x); function augment ( x ) { var prop, source; var i = arguments.length; var sources = Array( i - 1 ); while ( i-- ) { sources[i-1] = arguments[i]; } while (source = sources.shift()) { for (prop in source) { if (hasOwn.call(source, prop)) { x[prop] = source[prop]; } } } return x; } function x () {} augment( x.prototype ); }) }; })); rollup-3.29.4/test/form/samples/side-effect-k/_expected/umd.js000066400000000000000000000013141450520414700242060ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.myBundle = factory()); })(this, (function () { 'use strict'; function augment ( x ) { var prop, source; var i = arguments.length; var sources = Array( i - 1 ); while ( i-- ) { sources[i-1] = arguments[i]; } while (source = sources.shift()) { for (prop in source) { if (hasOwn.call(source, prop)) { x[prop] = source[prop]; } } } return x; } function x () {} augment( x.prototype ); return x; })); rollup-3.29.4/test/form/samples/side-effect-k/foo.js000066400000000000000000000004711450520414700222470ustar00rootroot00000000000000export function augment ( x ) { var prop, source; var i = arguments.length; var sources = Array( i - 1 ); while ( i-- ) { sources[i-1] = arguments[i]; } while (source = sources.shift()) { for (prop in source) { if (hasOwn.call(source, prop)) { x[prop] = source[prop]; } } } return x; } rollup-3.29.4/test/form/samples/side-effect-k/main.js000066400000000000000000000001351450520414700224050ustar00rootroot00000000000000import { augment } from './foo.js'; export default function x () {} augment( x.prototype ); rollup-3.29.4/test/form/samples/side-effect-l/000077500000000000000000000000001450520414700211255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-l/_config.js000066400000000000000000000002211450520414700230620ustar00rootroot00000000000000module.exports = defineTest({ description: 'discards function with no side-effects in imported module', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/side-effect-l/_expected/000077500000000000000000000000001450520414700230655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-l/_expected/amd.js000066400000000000000000000000541450520414700241630ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/side-effect-l/_expected/cjs.js000066400000000000000000000000171450520414700242000ustar00rootroot00000000000000'use strict'; rollup-3.29.4/test/form/samples/side-effect-l/_expected/es.js000066400000000000000000000000011450520414700240210ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/side-effect-l/_expected/iife.js000066400000000000000000000000471450520414700243400ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-3.29.4/test/form/samples/side-effect-l/_expected/system.js000066400000000000000000000001471450520414700247510ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/side-effect-l/_expected/umd.js000066400000000000000000000002121450520414700242030ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/side-effect-l/foo.js000066400000000000000000000001171450520414700222450ustar00rootroot00000000000000export default function foo () { bar(); function bar () {} } var x = foo(); rollup-3.29.4/test/form/samples/side-effect-l/main.js000066400000000000000000000000231450520414700224020ustar00rootroot00000000000000import './foo.js'; rollup-3.29.4/test/form/samples/side-effect-m/000077500000000000000000000000001450520414700211265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-m/_config.js000066400000000000000000000002161450520414700230670ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects side-effects in circular function calls', expectedWarnings: ['CIRCULAR_DEPENDENCY'] }); rollup-3.29.4/test/form/samples/side-effect-m/_expected.js000066400000000000000000000003721450520414700234260ustar00rootroot00000000000000function odd ( n ) { return n !== 0 && even( n - 1 ); } var counter = 0; // This should be in the output odd( 12 ); function even ( n ) { alert( counter++ ); return n === 0 || odd( n - 1 ); } console.log( even( 5 ) ); console.log( counter ); rollup-3.29.4/test/form/samples/side-effect-m/even.js000066400000000000000000000003121450520414700224150ustar00rootroot00000000000000import { odd } from './odd.js' export var counter = 0; // This should be in the output export var foo = odd( 12 ); export function even ( n ) { alert( counter++ ) return n === 0 || odd( n - 1 ); } rollup-3.29.4/test/form/samples/side-effect-m/main.js000066400000000000000000000001371450520414700224110ustar00rootroot00000000000000import { counter, even } from './even.js'; console.log( even( 5 ) ); console.log( counter ); rollup-3.29.4/test/form/samples/side-effect-m/odd.js000066400000000000000000000001431450520414700222300ustar00rootroot00000000000000import { even } from './even.js'; export function odd ( n ) { return n !== 0 && even( n - 1 ); } rollup-3.29.4/test/form/samples/side-effect-n/000077500000000000000000000000001450520414700211275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-n/_config.js000066400000000000000000000001431450520414700230670ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects side-effects in complex call expressions' }); rollup-3.29.4/test/form/samples/side-effect-n/_expected/000077500000000000000000000000001450520414700230675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-n/_expected/amd.js000066400000000000000000000002611450520414700241650ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); })); rollup-3.29.4/test/form/samples/side-effect-n/_expected/cjs.js000066400000000000000000000002161450520414700242030ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); rollup-3.29.4/test/form/samples/side-effect-n/_expected/es.js000066400000000000000000000001771450520414700240410ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); rollup-3.29.4/test/form/samples/side-effect-n/_expected/iife.js000066400000000000000000000002541450520414700243420ustar00rootroot00000000000000(function () { 'use strict'; function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); })(); rollup-3.29.4/test/form/samples/side-effect-n/_expected/system.js000066400000000000000000000003721450520414700247530ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); }) }; })); rollup-3.29.4/test/form/samples/side-effect-n/_expected/umd.js000066400000000000000000000004171450520414700242140ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); })); rollup-3.29.4/test/form/samples/side-effect-n/main.js000066400000000000000000000001771450520414700224160ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); rollup-3.29.4/test/form/samples/side-effect-o/000077500000000000000000000000001450520414700211305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-o/_config.js000066400000000000000000000001431450520414700230700ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects side-effects in complex call expressions' }); rollup-3.29.4/test/form/samples/side-effect-o/_expected/000077500000000000000000000000001450520414700230705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-o/_expected/amd.js000066400000000000000000000003221450520414700241640ustar00rootroot00000000000000define((function () { 'use strict'; function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); })); rollup-3.29.4/test/form/samples/side-effect-o/_expected/cjs.js000066400000000000000000000002541450520414700242060ustar00rootroot00000000000000'use strict'; function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); rollup-3.29.4/test/form/samples/side-effect-o/_expected/es.js000066400000000000000000000002351450520414700240350ustar00rootroot00000000000000function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); rollup-3.29.4/test/form/samples/side-effect-o/_expected/iife.js000066400000000000000000000003151450520414700243410ustar00rootroot00000000000000(function () { 'use strict'; function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); })(); rollup-3.29.4/test/form/samples/side-effect-o/_expected/system.js000066400000000000000000000004411450520414700247510ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); }) }; })); rollup-3.29.4/test/form/samples/side-effect-o/_expected/umd.js000066400000000000000000000004601450520414700242130ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); })); rollup-3.29.4/test/form/samples/side-effect-o/main.js000066400000000000000000000002351450520414700224120ustar00rootroot00000000000000function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); rollup-3.29.4/test/form/samples/side-effect-p/000077500000000000000000000000001450520414700211315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-p/_config.js000066400000000000000000000001161450520414700230710ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects mutation of globals' }); rollup-3.29.4/test/form/samples/side-effect-p/_expected/000077500000000000000000000000001450520414700230715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-p/_expected/amd.js000066400000000000000000000001631450520414700241700ustar00rootroot00000000000000define((function () { 'use strict'; const hs = document.documentElement.style; { hs.color = "#222"; } })); rollup-3.29.4/test/form/samples/side-effect-p/_expected/cjs.js000066400000000000000000000001231450520414700242020ustar00rootroot00000000000000'use strict'; const hs = document.documentElement.style; { hs.color = "#222"; } rollup-3.29.4/test/form/samples/side-effect-p/_expected/es.js000066400000000000000000000001041450520414700240310ustar00rootroot00000000000000const hs = document.documentElement.style; { hs.color = "#222"; } rollup-3.29.4/test/form/samples/side-effect-p/_expected/iife.js000066400000000000000000000001561450520414700243450ustar00rootroot00000000000000(function () { 'use strict'; const hs = document.documentElement.style; { hs.color = "#222"; } })(); rollup-3.29.4/test/form/samples/side-effect-p/_expected/system.js000066400000000000000000000002661450520414700247570ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const hs = document.documentElement.style; { hs.color = "#222"; } }) }; })); rollup-3.29.4/test/form/samples/side-effect-p/_expected/umd.js000066400000000000000000000003211450520414700242100ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const hs = document.documentElement.style; { hs.color = "#222"; } })); rollup-3.29.4/test/form/samples/side-effect-p/bool.js000066400000000000000000000000251450520414700224170ustar00rootroot00000000000000export default true; rollup-3.29.4/test/form/samples/side-effect-p/main.js000066400000000000000000000001531450520414700224120ustar00rootroot00000000000000import bool from './bool'; const hs = document.documentElement.style; if ( bool ) { hs.color = "#222" } rollup-3.29.4/test/form/samples/side-effect-q/000077500000000000000000000000001450520414700211325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-q/_config.js000066400000000000000000000002321450520414700230710ustar00rootroot00000000000000module.exports = defineTest({ description: 'discards effects in conditional expressions with known test values', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/side-effect-q/_expected.js000066400000000000000000000000011450520414700234170ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/side-effect-q/main.js000066400000000000000000000001441450520414700224130ustar00rootroot00000000000000var x = true ? foo() : bar(); function foo() { return 'should be removed, because x is unused'; } rollup-3.29.4/test/form/samples/side-effect-r/000077500000000000000000000000001450520414700211335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-r/_config.js000066400000000000000000000002631450520414700230760ustar00rootroot00000000000000module.exports = defineTest({ description: 'discards unused function expression assigned to a variable that calls itself and a global', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/side-effect-r/_expected.js000066400000000000000000000000011450520414700234200ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/side-effect-r/main.js000066400000000000000000000001201450520414700224060ustar00rootroot00000000000000var foo = function foo() { if ( whatever ) { foo(); } else { bar(); } }; rollup-3.29.4/test/form/samples/side-effect-s/000077500000000000000000000000001450520414700211345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-s/_config.js000066400000000000000000000002731450520414700231000ustar00rootroot00000000000000module.exports = defineTest({ description: 'discards unused function expression assigned to a variable that calls itself and has side effects', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/side-effect-s/_expected/000077500000000000000000000000001450520414700230745ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-s/_expected/amd.js000066400000000000000000000000541450520414700241720ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/side-effect-s/_expected/cjs.js000066400000000000000000000000171450520414700242070ustar00rootroot00000000000000'use strict'; rollup-3.29.4/test/form/samples/side-effect-s/_expected/es.js000066400000000000000000000000011450520414700240300ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/side-effect-s/_expected/iife.js000066400000000000000000000000471450520414700243470ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-3.29.4/test/form/samples/side-effect-s/_expected/system.js000066400000000000000000000001471450520414700247600ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/side-effect-s/_expected/umd.js000066400000000000000000000002121450520414700242120ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/side-effect-s/main.js000066400000000000000000000001421450520414700224130ustar00rootroot00000000000000var foo = function foo(param) { if ( whatever ) { foo(param); } else { param.foo = 1; } }; rollup-3.29.4/test/form/samples/side-effect-t/000077500000000000000000000000001450520414700211355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-t/_config.js000066400000000000000000000001771450520414700231040ustar00rootroot00000000000000module.exports = defineTest({ description: 'throw statement is a side effect', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effect-t/_expected/000077500000000000000000000000001450520414700230755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-t/_expected/amd.js000066400000000000000000000001641450520414700241750ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { throw new Error( 'throw side effect' ); } foo(); })); rollup-3.29.4/test/form/samples/side-effect-t/_expected/cjs.js000066400000000000000000000001241450520414700242070ustar00rootroot00000000000000'use strict'; function foo () { throw new Error( 'throw side effect' ); } foo(); rollup-3.29.4/test/form/samples/side-effect-t/_expected/es.js000066400000000000000000000001051450520414700240360ustar00rootroot00000000000000function foo () { throw new Error( 'throw side effect' ); } foo(); rollup-3.29.4/test/form/samples/side-effect-t/_expected/iife.js000066400000000000000000000001571450520414700243520ustar00rootroot00000000000000(function () { 'use strict'; function foo () { throw new Error( 'throw side effect' ); } foo(); })(); rollup-3.29.4/test/form/samples/side-effect-t/_expected/system.js000066400000000000000000000003031450520414700247530ustar00rootroot00000000000000System.register('myBundle', [], (function () { 'use strict'; return { execute: (function () { function foo () { throw new Error( 'throw side effect' ); } foo(); }) }; })); rollup-3.29.4/test/form/samples/side-effect-t/_expected/umd.js000066400000000000000000000003221450520414700242150ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo () { throw new Error( 'throw side effect' ); } foo(); })); rollup-3.29.4/test/form/samples/side-effect-t/main.js000066400000000000000000000001051450520414700224130ustar00rootroot00000000000000function foo () { throw new Error( 'throw side effect' ); } foo(); rollup-3.29.4/test/form/samples/side-effect-with-plusplus-expression/000077500000000000000000000000001450520414700257275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect-with-plusplus-expression/_config.js000066400000000000000000000002551450520414700276730ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly drop side-effect free statements in presence of update expression (#1564)', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/side-effect-with-plusplus-expression/_expected.js000066400000000000000000000000011450520414700302140ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/side-effect-with-plusplus-expression/lib.js000066400000000000000000000002171450520414700270330ustar00rootroot00000000000000function first () { for ( let i = -1; ; ++i ) {} second; } function second () {} function third () { ++i; forth; } function forth () {} rollup-3.29.4/test/form/samples/side-effect-with-plusplus-expression/main.js000066400000000000000000000000171450520414700272070ustar00rootroot00000000000000import './lib' rollup-3.29.4/test/form/samples/side-effect/000077500000000000000000000000001450520414700206745ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect/_config.js000066400000000000000000000001471450520414700226400ustar00rootroot00000000000000module.exports = defineTest({ description: 'side-effects to non-globals are not blindly included' }); rollup-3.29.4/test/form/samples/side-effect/_expected/000077500000000000000000000000001450520414700226345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effect/_expected/amd.js000066400000000000000000000001251450520414700237310ustar00rootroot00000000000000define((function () { 'use strict'; var foo = 42; assert.equal( foo, 42 ); })); rollup-3.29.4/test/form/samples/side-effect/_expected/cjs.js000066400000000000000000000000671450520414700237540ustar00rootroot00000000000000'use strict'; var foo = 42; assert.equal( foo, 42 ); rollup-3.29.4/test/form/samples/side-effect/_expected/es.js000066400000000000000000000000501450520414700235740ustar00rootroot00000000000000var foo = 42; assert.equal( foo, 42 ); rollup-3.29.4/test/form/samples/side-effect/_expected/iife.js000066400000000000000000000001201450520414700240770ustar00rootroot00000000000000(function () { 'use strict'; var foo = 42; assert.equal( foo, 42 ); })(); rollup-3.29.4/test/form/samples/side-effect/_expected/system.js000066400000000000000000000002241450520414700245140ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = 42; assert.equal( foo, 42 ); }) }; })); rollup-3.29.4/test/form/samples/side-effect/_expected/umd.js000066400000000000000000000002631450520414700237600ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = 42; assert.equal( foo, 42 ); })); rollup-3.29.4/test/form/samples/side-effect/foo.js000066400000000000000000000003241450520414700220140ustar00rootroot00000000000000var uid = 0; uid = 1; uid += 1; uid++; // ensure identifiers aren't treated as globals just because // var declaration hasn't been encountered yet... uid2 = 1; uid2 += 1; uid2++; var uid2; export var foo = 42; rollup-3.29.4/test/form/samples/side-effect/main.js000066400000000000000000000000661450520414700221600ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo, 42 ); rollup-3.29.4/test/form/samples/side-effects-await/000077500000000000000000000000001450520414700221625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-await/_config.js000066400000000000000000000002121450520414700241170ustar00rootroot00000000000000module.exports = defineTest({ description: 'await statements should never be dropped if a function has other side-effects (#1584)' }); rollup-3.29.4/test/form/samples/side-effects-await/_expected.js000066400000000000000000000002671450520414700244650ustar00rootroot00000000000000async function hasEffects1 () { await globalThis.unknown; console.log( 'effect' ); } hasEffects1(); async function hasEffects2 () { await globalThis.unknown(); } hasEffects2(); rollup-3.29.4/test/form/samples/side-effects-await/main.js000066400000000000000000000002701450520414700234430ustar00rootroot00000000000000async function hasEffects1 () { await globalThis.unknown; console.log( 'effect' ); } hasEffects1(); async function hasEffects2 () { await globalThis.unknown(); } hasEffects2(); rollup-3.29.4/test/form/samples/side-effects-break-statements/000077500000000000000000000000001450520414700243265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-break-statements/_config.js000066400000000000000000000002761450520414700262750ustar00rootroot00000000000000module.exports = defineTest({ description: 'break statements should always by included but not always cause their parents to have effects', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effects-break-statements/_expected/000077500000000000000000000000001450520414700262665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-break-statements/_expected/amd.js000066400000000000000000000006111450520414700273630ustar00rootroot00000000000000define((function () { 'use strict'; for ( let i = 0; i < 2; i++ ) { console.log( 'effect' ); break; } for ( const val in { x: 1, y: 2 } ) { console.log( 'effect' ); break; } for ( const val of { x: 1, y: 2 } ) { console.log( 'effect' ); break; } while ( true ) { console.log( 'effect' ); break; } do { console.log( 'effect' ); break; } while ( true ); })); rollup-3.29.4/test/form/samples/side-effects-break-statements/_expected/cjs.js000066400000000000000000000005311450520414700274020ustar00rootroot00000000000000'use strict'; for ( let i = 0; i < 2; i++ ) { console.log( 'effect' ); break; } for ( const val in { x: 1, y: 2 } ) { console.log( 'effect' ); break; } for ( const val of { x: 1, y: 2 } ) { console.log( 'effect' ); break; } while ( true ) { console.log( 'effect' ); break; } do { console.log( 'effect' ); break; } while ( true ); rollup-3.29.4/test/form/samples/side-effects-break-statements/_expected/es.js000066400000000000000000000005121450520414700272310ustar00rootroot00000000000000for ( let i = 0; i < 2; i++ ) { console.log( 'effect' ); break; } for ( const val in { x: 1, y: 2 } ) { console.log( 'effect' ); break; } for ( const val of { x: 1, y: 2 } ) { console.log( 'effect' ); break; } while ( true ) { console.log( 'effect' ); break; } do { console.log( 'effect' ); break; } while ( true ); rollup-3.29.4/test/form/samples/side-effects-break-statements/_expected/iife.js000066400000000000000000000006041450520414700275400ustar00rootroot00000000000000(function () { 'use strict'; for ( let i = 0; i < 2; i++ ) { console.log( 'effect' ); break; } for ( const val in { x: 1, y: 2 } ) { console.log( 'effect' ); break; } for ( const val of { x: 1, y: 2 } ) { console.log( 'effect' ); break; } while ( true ) { console.log( 'effect' ); break; } do { console.log( 'effect' ); break; } while ( true ); })(); rollup-3.29.4/test/form/samples/side-effects-break-statements/_expected/system.js000066400000000000000000000007701450520414700301540ustar00rootroot00000000000000System.register('myBundle', [], (function () { 'use strict'; return { execute: (function () { for ( let i = 0; i < 2; i++ ) { console.log( 'effect' ); break; } for ( const val in { x: 1, y: 2 } ) { console.log( 'effect' ); break; } for ( const val of { x: 1, y: 2 } ) { console.log( 'effect' ); break; } while ( true ) { console.log( 'effect' ); break; } do { console.log( 'effect' ); break; } while ( true ); }) }; })); rollup-3.29.4/test/form/samples/side-effects-break-statements/_expected/umd.js000066400000000000000000000007471450520414700274210ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; for ( let i = 0; i < 2; i++ ) { console.log( 'effect' ); break; } for ( const val in { x: 1, y: 2 } ) { console.log( 'effect' ); break; } for ( const val of { x: 1, y: 2 } ) { console.log( 'effect' ); break; } while ( true ) { console.log( 'effect' ); break; } do { console.log( 'effect' ); break; } while ( true ); })); rollup-3.29.4/test/form/samples/side-effects-break-statements/main.js000066400000000000000000000007421450520414700256130ustar00rootroot00000000000000for ( let i = 0; i < 2; i++ ) { break; } for ( let i = 0; i < 2; i++ ) { console.log( 'effect' ); break; } for ( const val in { x: 1, y: 2 } ) { break; } for ( const val in { x: 1, y: 2 } ) { console.log( 'effect' ); break; } for ( const val of { x: 1, y: 2 } ) { console.log( 'effect' ); break; } while ( true ) { break; } while ( true ) { console.log( 'effect' ); break; } do { break; } while ( true ); do { console.log( 'effect' ); break; } while ( true ); rollup-3.29.4/test/form/samples/side-effects-call-arguments/000077500000000000000000000000001450520414700237735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-call-arguments/_config.js000066400000000000000000000001441450520414700257340ustar00rootroot00000000000000module.exports = defineTest({ description: 'side-effects in call arguments should be included' }); rollup-3.29.4/test/form/samples/side-effects-call-arguments/_expected.js000066400000000000000000000001431450520414700262670ustar00rootroot00000000000000function foo () {} foo( globalThis.unknown() ); var baz = 2; foo( baz++ ); assert.equal(baz, 3); rollup-3.29.4/test/form/samples/side-effects-call-arguments/main.js000066400000000000000000000002721450520414700252560ustar00rootroot00000000000000function foo () {} foo(); foo( 1 ); foo( foo() ); foo( globalThis.unknown ); foo( globalThis.unknown() ); var bar = 1; foo( bar++ ); var baz = 2; foo( baz++ ); assert.equal(baz, 3); rollup-3.29.4/test/form/samples/side-effects-class-getters-setters/000077500000000000000000000000001450520414700253245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-class-getters-setters/_config.js000066400000000000000000000001511450520414700272630ustar00rootroot00000000000000module.exports = defineTest({ description: 'treat getters and setters on classes as function calls' }); rollup-3.29.4/test/form/samples/side-effects-class-getters-setters/_expected.js000066400000000000000000000014361450520414700276260ustar00rootroot00000000000000class RetainedByGetter { get a() { log(); } } RetainedByGetter.prototype.a; class RetainedBySetter { set a(v) { log(); } } RetainedBySetter.prototype.a = 10; class RetainedByStaticGetter { static get a() { log(); } } RetainedByStaticGetter.a; class RetainedByStaticSetter { static set a(v) { log(); } } RetainedByStaticSetter.a = 10; class RetainedSuper { static get a() { log(); } } class RetainedSub extends RetainedSuper {} RetainedSub.a; // class fields are not part of the prototype class RemovedProtoValue { a = true; } if (!RemovedProtoValue.prototype.a) log(); class DeoptProto { a = true; } globalThis.unknown(DeoptProto.prototype); if (!DeoptProto.prototype.a) log(); class DeoptComputed { static get a() {} static get [globalThis.unknown]() { log(); } } DeoptComputed.a; rollup-3.29.4/test/form/samples/side-effects-class-getters-setters/main.js000066400000000000000000000026011450520414700266050ustar00rootroot00000000000000class Removed { get a() { log(); } set a(v) { log(); } static get a() { log(); } static set a(v) { log(); } } class RemovedNoEffect { get a() {} set a(v) {} static get a() {} static set a(v) {} } RemovedNoEffect.prototype.a; RemovedNoEffect.prototype.a = 1; RemovedNoEffect.a; RemovedNoEffect.a = 1; class RetainedByGetter { get a() { log(); } } RetainedByGetter.prototype.a; class RetainedBySetter { set a(v) { log(); } } RetainedBySetter.prototype.a = 10; class RetainedByStaticGetter { static get a() { log(); } } RetainedByStaticGetter.a; class RetainedByStaticSetter { static set a(v) { log(); } } RetainedByStaticSetter.a = 10; class RemovedSetters { set a(v) { log(); } static set a(v) { log(); } } RemovedSetters.prototype.a; RemovedSetters.a; class RemovedWrongProp { get a() { log(); } static get a() { log(); } } RemovedWrongProp.prototype.b RemovedWrongProp.b class RetainedSuper { static get a() { log(); } } class RetainedSub extends RetainedSuper {} RetainedSub.a; class RemovedSub extends RetainedSuper {} RemovedSub.b; // class fields are not part of the prototype class RemovedProtoValue { a = true; } if (!RemovedProtoValue.prototype.a) log(); class DeoptProto { a = true; } globalThis.unknown(DeoptProto.prototype); if (!DeoptProto.prototype.a) log(); class DeoptComputed { static get a() {} static get [globalThis.unknown]() { log(); } } DeoptComputed.a; rollup-3.29.4/test/form/samples/side-effects-computed-pattern-keys/000077500000000000000000000000001450520414700253215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-computed-pattern-keys/_config.js000066400000000000000000000001631450520414700272630ustar00rootroot00000000000000module.exports = defineTest({ description: 'side-effects in with computed pattern keys should not be ignored' }); rollup-3.29.4/test/form/samples/side-effects-computed-pattern-keys/_expected.js000066400000000000000000000000571450520414700276210ustar00rootroot00000000000000const { [globalThis.unknown()]: isKept } = {}; rollup-3.29.4/test/form/samples/side-effects-computed-pattern-keys/main.js000066400000000000000000000001531450520414700266020ustar00rootroot00000000000000const { [globalThis.unknown]: isRemoved } = { foo: 'bar' }; const { [globalThis.unknown()]: isKept } = {}; rollup-3.29.4/test/form/samples/side-effects-delete/000077500000000000000000000000001450520414700223175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-delete/_config.js000066400000000000000000000002221450520414700242550ustar00rootroot00000000000000module.exports = defineTest({ description: 'delete is only a side-effect for included variables', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effects-delete/_expected/000077500000000000000000000000001450520414700242575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-delete/_expected/amd.js000066400000000000000000000002271450520414700253570ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var x = {foo: 'bar'}; delete x.foo; delete globalThis.unknown.foo; exports.x = x; })); rollup-3.29.4/test/form/samples/side-effects-delete/_expected/cjs.js000066400000000000000000000001431450520414700253720ustar00rootroot00000000000000'use strict'; var x = {foo: 'bar'}; delete x.foo; delete globalThis.unknown.foo; exports.x = x; rollup-3.29.4/test/form/samples/side-effects-delete/_expected/es.js000066400000000000000000000001231450520414700252200ustar00rootroot00000000000000var x = {foo: 'bar'}; delete x.foo; delete globalThis.unknown.foo; export { x }; rollup-3.29.4/test/form/samples/side-effects-delete/_expected/iife.js000066400000000000000000000002501450520414700255260ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; var x = {foo: 'bar'}; delete x.foo; delete globalThis.unknown.foo; exports.x = x; return exports; })({}); rollup-3.29.4/test/form/samples/side-effects-delete/_expected/system.js000066400000000000000000000003241450520414700261400ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var x = exports('x', {foo: 'bar'}); delete x.foo; delete globalThis.unknown.foo; }) }; })); rollup-3.29.4/test/form/samples/side-effects-delete/_expected/umd.js000066400000000000000000000006661450520414700254120ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.myBundle = {})); })(this, (function (exports) { 'use strict'; var x = {foo: 'bar'}; delete x.foo; delete globalThis.unknown.foo; exports.x = x; })); rollup-3.29.4/test/form/samples/side-effects-delete/main.js000066400000000000000000000001661450520414700236040ustar00rootroot00000000000000var x = {foo: 'bar'}; delete x.foo; var y = {foo: 'bar'}; delete y.foo; delete globalThis.unknown.foo; export {x}; rollup-3.29.4/test/form/samples/side-effects-es6-class-declarations/000077500000000000000000000000001450520414700253235ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-es6-class-declarations/_config.js000066400000000000000000000001431450520414700272630ustar00rootroot00000000000000module.exports = defineTest({ description: 'determine side effects in ES6 class declarations' }); rollup-3.29.4/test/form/samples/side-effects-es6-class-declarations/_expected.js000066400000000000000000000011021450520414700276130ustar00rootroot00000000000000class KeySideEffect { [console.log( 'effect' )] () {} } class ConstructorSideEffect { constructor () { console.log( 'effect' ); } } new ConstructorSideEffect(); class ConstructorParamSideEffect { constructor ( foo = console.log( 'effect' ) ) {} } new ConstructorParamSideEffect(); class ConstructorParamCallSideEffect { constructor ( foo = () => console.log( 'effect' ) ) { foo(); } } new ConstructorParamCallSideEffect(); class MethodCallSideEffect { constructor () { this.effect(); } effect () { console.log( 'effect' ); } } new MethodCallSideEffect(); rollup-3.29.4/test/form/samples/side-effects-es6-class-declarations/main.js000066400000000000000000000017741450520414700266160ustar00rootroot00000000000000class Empty {} const empty = new Empty(); class NoSideEffects { constructor ( foo = 1 ) { this.x = 1; const mutateThis = () => this.y = 1; mutateThis(); } method1 () { this.method2(); } [(() => 'method2')()] () { console.log( 'not called' ); } } const noSideEffects = new NoSideEffects(); class KeySideEffect { [console.log( 'effect' )] () {} } class ConstructorSideEffect { constructor () { console.log( 'effect' ); } } const constructorSideEffect = new ConstructorSideEffect(); class ConstructorParamSideEffect { constructor ( foo = console.log( 'effect' ) ) {} } const constructorParamSideEffect = new ConstructorParamSideEffect(); class ConstructorParamCallSideEffect { constructor ( foo = () => console.log( 'effect' ) ) { foo(); } } const constructorParamCallSideEffect = new ConstructorParamCallSideEffect(); class MethodCallSideEffect { constructor () { this.effect(); } effect () { console.log( 'effect' ); } } const methodCallSideEffect = new MethodCallSideEffect(); rollup-3.29.4/test/form/samples/side-effects-es6-class-expressions/000077500000000000000000000000001450520414700252355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-es6-class-expressions/_config.js000066400000000000000000000001421450520414700271740ustar00rootroot00000000000000module.exports = defineTest({ description: 'determine side effects in ES6 class expressions' }); rollup-3.29.4/test/form/samples/side-effects-es6-class-expressions/_expected.js000066400000000000000000000011351450520414700275330ustar00rootroot00000000000000class KeySideEffect { [console.log( 'effect' )] () {} } class ConstructorSideEffect { constructor () { console.log( 'effect' ); } } new ConstructorSideEffect(); const ConstructorParamSideEffect = class { constructor ( foo = console.log( 'effect' ) ) {} }; new ConstructorParamSideEffect(); const ConstructorParamCallSideEffect = class { constructor ( foo = () => console.log( 'effect' ) ) { foo(); } }; new ConstructorParamCallSideEffect(); const MethodCallSideEffect = class { constructor () { this.effect(); } effect () { console.log( 'effect' ); } }; new MethodCallSideEffect(); rollup-3.29.4/test/form/samples/side-effects-es6-class-expressions/main.js000066400000000000000000000020511450520414700265150ustar00rootroot00000000000000const Empty = class {}; const empty = new Empty(); const NoSideEffects = class { constructor ( foo = 1 ) { this.x = 1; const mutateThis = () => this.y = 1; mutateThis(); } method1 () { this.method2(); } [(() => 'method2')()] () { console.log( 'not called' ); } }; const noSideEffects = new NoSideEffects(); class KeySideEffect { [console.log( 'effect' )] () {} } class ConstructorSideEffect { constructor () { console.log( 'effect' ); } } const constructorSideEffect = new ConstructorSideEffect(); const ConstructorParamSideEffect = class { constructor ( foo = console.log( 'effect' ) ) {} }; const constructorParamSideEffect = new ConstructorParamSideEffect(); const ConstructorParamCallSideEffect = class { constructor ( foo = () => console.log( 'effect' ) ) { foo(); } }; const constructorParamCallSideEffect = new ConstructorParamCallSideEffect(); const MethodCallSideEffect = class { constructor () { this.effect(); } effect () { console.log( 'effect' ); } }; const methodCallSideEffect = new MethodCallSideEffect(); rollup-3.29.4/test/form/samples/side-effects-es6-super-classes/000077500000000000000000000000001450520414700243415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-es6-super-classes/_config.js000066400000000000000000000001361450520414700263030ustar00rootroot00000000000000module.exports = defineTest({ description: 'determine side effects in ES6 super classes' }); rollup-3.29.4/test/form/samples/side-effects-es6-super-classes/_expected.js000066400000000000000000000012761450520414700266450ustar00rootroot00000000000000class GlobalSuper extends globalThis.UnknownClass {} new GlobalSuper(); class SideEffectSuper extends (() => { console.log( 'effect' ); return class {}; })() { } class SuperConstructorEffect { constructor () { console.log( 'effect' ); } } class SideEffectsSuperConstructor1 extends SuperConstructorEffect {} new SideEffectsSuperConstructor1(); class SideEffectsSuperConstructor2 extends SuperConstructorEffect { constructor () { super(); } } new SideEffectsSuperConstructor2(); class SuperMethodEffect { effect () { console.log( 'effect' ); } } class SideEffectsSuperMethod extends SuperMethodEffect { constructor () { super(); super.effect(); } } new SideEffectsSuperMethod(); rollup-3.29.4/test/form/samples/side-effects-es6-super-classes/main.js000066400000000000000000000017151450520414700256270ustar00rootroot00000000000000class SuperNoEffects { constructor () { this.superFoo = 1; } } class NoEffects extends SuperNoEffects {} const noEffects = new NoEffects(); class GlobalSuper extends globalThis.UnknownClass {} const globalSuper = new GlobalSuper(); class SideEffectSuper extends (() => { console.log( 'effect' ); return class {}; })() { } class SuperConstructorEffect { constructor () { console.log( 'effect' ); } } class SideEffectsSuperConstructor1 extends SuperConstructorEffect {} const sideEffectsSuperConstructor1 = new SideEffectsSuperConstructor1(); class SideEffectsSuperConstructor2 extends SuperConstructorEffect { constructor () { super(); } } const sideEffectsSuperConstructor2 = new SideEffectsSuperConstructor2(); class SuperMethodEffect { effect () { console.log( 'effect' ); } } class SideEffectsSuperMethod extends SuperMethodEffect { constructor () { super(); super.effect(); } } const sideEffectsSuperMethod = new SideEffectsSuperMethod(); rollup-3.29.4/test/form/samples/side-effects-expressions-as-statements/000077500000000000000000000000001450520414700262255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-expressions-as-statements/_config.js000066400000000000000000000002021450520414700301610ustar00rootroot00000000000000module.exports = defineTest({ description: 'in order to keep certain getter calls, do not remove some expression statements' }); rollup-3.29.4/test/form/samples/side-effects-expressions-as-statements/_expected.js000066400000000000000000000004101450520414700305160ustar00rootroot00000000000000// Access getters with side-effects to e.g. force DOM repaints globalThis.unknown.getter; globalThis.unknown && globalThis.unknown.member && globalThis.unknown.member.getter; // Call pure constructors for side-effects for e.g. feature detection new Function(''); rollup-3.29.4/test/form/samples/side-effects-expressions-as-statements/main.js000066400000000000000000000004671450520414700275160ustar00rootroot00000000000000// Access getters with side-effects to e.g. force DOM repaints globalThis.unknown.getter; globalThis.unknown && globalThis.unknown.member && globalThis.unknown.member.getter; // Call pure constructors for side-effects for e.g. feature detection new Function(''); var localVarsAreRemoved; localVarsAreRemoved; rollup-3.29.4/test/form/samples/side-effects-generators/000077500000000000000000000000001450520414700232265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-generators/_config.js000066400000000000000000000001461450520414700251710ustar00rootroot00000000000000module.exports = defineTest({ description: 'Properly detect side-effects in generator functions' }); rollup-3.29.4/test/form/samples/side-effects-generators/_expected.js000066400000000000000000000007221450520414700255250ustar00rootroot00000000000000function* sideEffectYield() { yield globalThis.unknown(); yield 'no side-effect but must be included to ensure proper control flow'; } sideEffectYield(); function* effectCallYield() { const yieldedValue = yield; yieldedValue(); } const iterator3 = effectCallYield(); iterator3.next(globalThis.unknown); function* sideEffectYield2() { yield globalThis.unknown(); } function* sideEffectNestedYield() { yield* sideEffectYield2(); } sideEffectNestedYield(); rollup-3.29.4/test/form/samples/side-effects-generators/main.js000066400000000000000000000011561450520414700245130ustar00rootroot00000000000000function* noEffects() { yield 0; let index = 0; while(index < 3) yield ++index; } const iterator1 = noEffects(); function* sideEffectYield() { yield globalThis.unknown(); yield 'no side-effect but must be included to ensure proper control flow'; } const iterator2 = sideEffectYield(); function* effectCallYield() { const yieldedValue = yield; yieldedValue(); } const iterator3 = effectCallYield(); iterator3.next(globalThis.unknown); function* sideEffectYield2() { yield globalThis.unknown(); } function* sideEffectNestedYield() { yield* sideEffectYield2(); } const iterator4 = sideEffectNestedYield(); rollup-3.29.4/test/form/samples/side-effects-getters-and-setters/000077500000000000000000000000001450520414700247615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-getters-and-setters/_config.js000066400000000000000000000001361450520414700267230ustar00rootroot00000000000000module.exports = defineTest({ description: 'treat getters and setters as function calls' }); rollup-3.29.4/test/form/samples/side-effects-getters-and-setters/_expected.js000066400000000000000000000007261450520414700272640ustar00rootroot00000000000000const retained1 = { get effect() { console.log('effect'); }, get noEffect() { const x = 1; return x; } }; //retained retained1.effect; retained1['eff' + 'ect']; const retained3 = { set effect(value) { console.log(value); } }; retained3.effect = 'retained'; const retained4 = { set effect(value) { console.log(value); } }; retained4['eff' + 'ect'] = 'retained'; const retained7 = { foo: () => {}, get foo() { return 1; } }; retained7.foo(); rollup-3.29.4/test/form/samples/side-effects-getters-and-setters/main.js000066400000000000000000000014311450520414700262420ustar00rootroot00000000000000const retained1 = { get effect() { console.log('effect'); }, get noEffect() { const x = 1; return x; } }; // removed retained1.noEffect; //retained retained1.effect; retained1['eff' + 'ect']; const removed2 = { get shadowedEffect() { console.log('effect'); return 1; }, shadowedEffect: true, set shadowedEffect(value) { console.log(value); } }; removed2.shadowedEffect; const retained3 = { set effect(value) { console.log(value); } }; retained3.effect = 'retained'; const retained4 = { set effect(value) { console.log(value); } }; retained4['eff' + 'ect'] = 'retained'; const removed5 = { set noEffect(value) { const x = value; } }; removed5.noEffect = 'removed'; const retained7 = { foo: () => {}, get foo() { return 1; } }; retained7.foo(); rollup-3.29.4/test/form/samples/side-effects-in-template-literals/000077500000000000000000000000001450520414700251115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-in-template-literals/_config.js000066400000000000000000000002501450520414700270500ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects side-effects in template literals and tagged template expressions', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effects-in-template-literals/_expected.js000066400000000000000000000005641450520414700274140ustar00rootroot00000000000000let x = 0; function noEffects () {} function modifyX () { return x++; } `${globalThis.unknown()}has effects`; `${modifyX()}has effects`; noEffects`${globalThis.unknown()}has effects`; noEffects`${modifyX()}has effects`; globalThis.unknown`has effects`; (() => { console.log( 'effect' ); return () => {}; })()`has effects`; modifyX`has effects`; export { x }; rollup-3.29.4/test/form/samples/side-effects-in-template-literals/main.js000066400000000000000000000010031450520414700263650ustar00rootroot00000000000000let x = 0; function noEffects () {} function modifyX () { return x++; } const a = `${noEffects()}is removed`; const b = `${globalThis.unknown()}has effects`; const c = `${modifyX()}has effects`; const d = noEffects`is removed`; const e = noEffects`${globalThis.unknown()}has effects`; const f = noEffects`${modifyX()}has effects`; const g = globalThis.unknown`has effects`; const h = (() => { console.log( 'effect' ); return () => {}; })()`has effects`; const i = modifyX`has effects`; export { x }; rollup-3.29.4/test/form/samples/side-effects-internal-modules/000077500000000000000000000000001450520414700243375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-internal-modules/_config.js000066400000000000000000000010561450520414700263030ustar00rootroot00000000000000const assert = require('node:assert'); const VIRTUAL_ID = '\0virtual'; module.exports = defineTest({ description: 'does not pass internal modules to moduleSideEffects', expectedWarnings: ['EMPTY_BUNDLE'], options: { treeshake: { moduleSideEffects: id => { assert.notStrictEqual(id, VIRTUAL_ID); return false; } }, plugins: { name: 'test-plugin', resolveId(id) { if (id === 'virtual') { return VIRTUAL_ID; } }, load(id) { if (id === VIRTUAL_ID) { return "console.log('effect')"; } } } } }); rollup-3.29.4/test/form/samples/side-effects-internal-modules/_expected.js000066400000000000000000000000551450520414700266350ustar00rootroot00000000000000console.log('effect'); console.log('main'); rollup-3.29.4/test/form/samples/side-effects-internal-modules/main.js000066400000000000000000000000471450520414700256220ustar00rootroot00000000000000import 'virtual'; console.log('main'); rollup-3.29.4/test/form/samples/side-effects-logical-expressions/000077500000000000000000000000001450520414700250475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-logical-expressions/_config.js000066400000000000000000000001651450520414700270130ustar00rootroot00000000000000module.exports = defineTest({ description: 'only evaluate the second part of a logical expression if necessary' }); rollup-3.29.4/test/form/samples/side-effects-logical-expressions/_expected/000077500000000000000000000000001450520414700270075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-logical-expressions/_expected/amd.js000066400000000000000000000011241450520414700301040ustar00rootroot00000000000000define((function () { 'use strict'; // effect console.log( 'effect' ); console.log( 'effect' ); console.log( 'effect' ) || {}; console.log( 'effect' ) && {}; const foo = { get effect () { console.log( 'effect' ); }, get noEffect () {} }; // effect (foo).effect; (foo).effect; // effect (null).foo = 1; (null).foo = 1; // effect (true )(); (false )(); ((() => console.log( 'effect' )))(); ((() => console.log( 'effect' )))(); // effect (true )()(); (false )()(); ((() => () => console.log( 'effect' )))()(); ((() => () => console.log( 'effect' )))()(); })); rollup-3.29.4/test/form/samples/side-effects-logical-expressions/_expected/cjs.js000066400000000000000000000010351450520414700301230ustar00rootroot00000000000000'use strict'; // effect console.log( 'effect' ); console.log( 'effect' ); console.log( 'effect' ) || {}; console.log( 'effect' ) && {}; const foo = { get effect () { console.log( 'effect' ); }, get noEffect () {} }; // effect (foo).effect; (foo).effect; // effect (null).foo = 1; (null).foo = 1; // effect (true )(); (false )(); ((() => console.log( 'effect' )))(); ((() => console.log( 'effect' )))(); // effect (true )()(); (false )()(); ((() => () => console.log( 'effect' )))()(); ((() => () => console.log( 'effect' )))()(); rollup-3.29.4/test/form/samples/side-effects-logical-expressions/_expected/es.js000066400000000000000000000010161450520414700277520ustar00rootroot00000000000000// effect console.log( 'effect' ); console.log( 'effect' ); console.log( 'effect' ) || {}; console.log( 'effect' ) && {}; const foo = { get effect () { console.log( 'effect' ); }, get noEffect () {} }; // effect (foo).effect; (foo).effect; // effect (null).foo = 1; (null).foo = 1; // effect (true )(); (false )(); ((() => console.log( 'effect' )))(); ((() => console.log( 'effect' )))(); // effect (true )()(); (false )()(); ((() => () => console.log( 'effect' )))()(); ((() => () => console.log( 'effect' )))()(); rollup-3.29.4/test/form/samples/side-effects-logical-expressions/_expected/iife.js000066400000000000000000000011171450520414700302610ustar00rootroot00000000000000(function () { 'use strict'; // effect console.log( 'effect' ); console.log( 'effect' ); console.log( 'effect' ) || {}; console.log( 'effect' ) && {}; const foo = { get effect () { console.log( 'effect' ); }, get noEffect () {} }; // effect (foo).effect; (foo).effect; // effect (null).foo = 1; (null).foo = 1; // effect (true )(); (false )(); ((() => console.log( 'effect' )))(); ((() => console.log( 'effect' )))(); // effect (true )()(); (false )()(); ((() => () => console.log( 'effect' )))()(); ((() => () => console.log( 'effect' )))()(); })(); rollup-3.29.4/test/form/samples/side-effects-logical-expressions/_expected/system.js000066400000000000000000000013051450520414700306700ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { // effect console.log( 'effect' ); console.log( 'effect' ); console.log( 'effect' ) || {}; console.log( 'effect' ) && {}; const foo = { get effect () { console.log( 'effect' ); }, get noEffect () {} }; // effect (foo).effect; (foo).effect; // effect (null).foo = 1; (null).foo = 1; // effect (true )(); (false )(); ((() => console.log( 'effect' )))(); ((() => console.log( 'effect' )))(); // effect (true )()(); (false )()(); ((() => () => console.log( 'effect' )))()(); ((() => () => console.log( 'effect' )))()(); }) }; })); rollup-3.29.4/test/form/samples/side-effects-logical-expressions/_expected/umd.js000066400000000000000000000012621450520414700301330ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; // effect console.log( 'effect' ); console.log( 'effect' ); console.log( 'effect' ) || {}; console.log( 'effect' ) && {}; const foo = { get effect () { console.log( 'effect' ); }, get noEffect () {} }; // effect (foo).effect; (foo).effect; // effect (null).foo = 1; (null).foo = 1; // effect (true )(); (false )(); ((() => console.log( 'effect' )))(); ((() => console.log( 'effect' )))(); // effect (true )()(); (false )()(); ((() => () => console.log( 'effect' )))()(); ((() => () => console.log( 'effect' )))()(); })); rollup-3.29.4/test/form/samples/side-effects-logical-expressions/main.js000066400000000000000000000021501450520414700263270ustar00rootroot00000000000000false || {}; true && {}; true || console.log( 'effect' ); false && console.log( 'effect' ); // effect false || console.log( 'effect' ); true && console.log( 'effect' ); console.log( 'effect' ) || {}; console.log( 'effect' ) && {}; const foo = { get effect () { console.log( 'effect' ); }, get noEffect () {} }; // accessed - no effect (false || foo).noEffect; (true && foo).noEffect; (true || foo).effect; (false && foo).effect; // effect (false || foo).effect; (true && foo).effect; // assigned - no effect (false || {}).foo = 1; (true && {}).foo = 1; // effect (false || null).foo = 1; (true && null).foo = 1; // called - no effect (false || (() => {}))(); (true && (() => {}))(); // effect (true || (() => {}))(); (false && (() => {}))(); (false || (() => console.log( 'effect' )))(); (true && (() => console.log( 'effect' )))(); // call return value - no effect (false || (() => () => {}))()(); (true && (() => () => {}))()(); // effect (true || (() => () => {}))()(); (false && (() => () => {}))()(); (false || (() => () => console.log( 'effect' )))()(); (true && (() => () => console.log( 'effect' )))()(); rollup-3.29.4/test/form/samples/side-effects-object-literal-calls/000077500000000000000000000000001450520414700250515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-object-literal-calls/_config.js000066400000000000000000000001451450520414700270130ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects side-effects when mutating object literals' }); rollup-3.29.4/test/form/samples/side-effects-object-literal-calls/_expected.js000066400000000000000000000010211450520414700273410ustar00rootroot00000000000000const retained1 = { x: () => {} }; retained1.y(); const retained2 = { x: () => {} }; retained2.x = {}; retained2.x(); const retained3 = { x: { y: () => console.log('effect') } }; const retained4 = { x: { y: {} } }; retained4.x = retained3.x; retained4.x.y(); const retained5 = { x: () => {} }; const retained6 = retained5; retained6.x = () => console.log('effect'); retained5.x(); const retained7 = { x: { y: () => {} } }; const retained8 = { x: retained7.x }; retained8.x.y = () => console.log( 'effect' ); retained7.x.y(); rollup-3.29.4/test/form/samples/side-effects-object-literal-calls/main.js000066400000000000000000000011741450520414700263360ustar00rootroot00000000000000const removed1 = { x: () => {} }; removed1.x(); const removed2 = { x: { y: () => {} } }; removed2.x.y(); const retained1 = { x: () => {} }; retained1.y(); const retained2 = { x: () => {} }; retained2.x = {}; retained2.x(); const retained3 = { x: { y: () => console.log('effect') } }; const retained4 = { x: { y: {} } }; retained4.x = retained3.x; retained4.x.y(); const retained5 = { x: () => {} }; const retained6 = retained5; retained6.x = () => console.log('effect'); retained5.x(); const retained7 = { x: { y: () => {} } }; const retained8 = { x: retained7.x }; retained8.x.y = () => console.log( 'effect' ); retained7.x.y(); rollup-3.29.4/test/form/samples/side-effects-object-literal-mutation-misc/000077500000000000000000000000001450520414700265445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-object-literal-mutation-misc/_config.js000066400000000000000000000002531450520414700305060ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects side-effects when setting and/or calling properties on object literals', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/side-effects-object-literal-mutation-misc/_expected.js000066400000000000000000000012601450520414700310410ustar00rootroot00000000000000((function() { const obj = { modify() { this.modified = true; } }; obj.modify(); console.log(obj.modified ? "PASS1" : "FAIL1"); }))(); ((function() { const obj = {}; function modify() { this.modified = true; } modify.call(obj); console.log(obj.modified ? "PASS2" : "FAIL2"); }))(); ((function() { const obj = {}; obj.modify = modify; function modify() { this.modified = true; } obj.modify(); console.log(obj.modified ? "PASS3" : "FAIL3"); }))(); { const axis = {}; axis[getResult().axis] = 1; if (axis.x) { console.log('PASS4'); } else { console.log('FAIL4'); } function getResult() { const result = {}; result.axis = 'x'; return result; } } rollup-3.29.4/test/form/samples/side-effects-object-literal-mutation-misc/main.js000066400000000000000000000015541450520414700300330ustar00rootroot00000000000000let flag = true; // invariant object literals can still be dropped let run = { test1: flag, test2: true, test3: flag, test4: true, }; run.test1 && (function() { const obj = { modify() { this.modified = true; } }; obj.modify(); console.log(obj.modified ? "PASS1" : "FAIL1"); })(); run.test2 && (function() { const obj = {}; function modify() { this.modified = true; } modify.call(obj); console.log(obj.modified ? "PASS2" : "FAIL2"); })(); run.test3 && (function() { const obj = {}; obj.modify = modify; function modify() { this.modified = true; } obj.modify(); console.log(obj.modified ? "PASS3" : "FAIL3"); })(); if (run.test4) { const axis = {}; axis[getResult().axis] = 1; if (axis.x) { console.log('PASS4'); } else { console.log('FAIL4'); } function getResult() { const result = {}; result.axis = 'x'; return result; } } rollup-3.29.4/test/form/samples/side-effects-object-literal-mutation/000077500000000000000000000000001450520414700256135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-object-literal-mutation/_config.js000066400000000000000000000001451450520414700275550ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects side-effects when mutating object literals' }); rollup-3.29.4/test/form/samples/side-effects-object-literal-mutation/_expected.js000066400000000000000000000007651450520414700301210ustar00rootroot00000000000000const retained1 = { x: {} }; retained1.y = 1; retained1.x.y = 2; const retained2 = { x: {} }; retained2.y.z = 1; const retained3 = { x: {} }; delete retained3.x; retained3.x.y = 2; const retained4 = { x: undefined }; retained4.x.y = 2; const retained5 = { x: null }; retained5.x.y = 2; const retained6 = { x: { y: {} } }; retained6.x = {}; retained6.x.y.z = 3; const retained7 = { x: { y: globalThis.unknown } }; const retained8 = { x: retained7.x }; retained8.x.y.z = 3; export { retained1 }; rollup-3.29.4/test/form/samples/side-effects-object-literal-mutation/main.js000066400000000000000000000013171450520414700270770ustar00rootroot00000000000000const removed1 = { x: {} }; removed1.y = 1; removed1.x.y = 2; export const retained1 = { x: {} }; retained1.y = 1; retained1.x.y = 2; const retained2 = { x: {} }; retained2.y.z = 1; const retained3 = { x: {} }; delete retained3.x; retained3.x.y = 2; const retained4 = { x: undefined }; retained4.x.y = 2; const retained5 = { x: null }; retained5.x.y = 2; const removed2 = { x: { y: {} } }; removed2.x.y.z = 3; const retained6 = { x: { y: {} } }; retained6.x = {}; retained6.x.y.z = 3; const retained7 = { x: { y: globalThis.unknown } }; const retained8 = { x: retained7.x }; retained8.x.y.z = 3; const removed3 = { a: { x: { y: globalThis.unknown } } }; const removed4 = { x: removed3.a.x }; removed4.x.y = 2; rollup-3.29.4/test/form/samples/side-effects-pattern-assignment/000077500000000000000000000000001450520414700247005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-pattern-assignment/_config.js000066400000000000000000000001721450520414700266420ustar00rootroot00000000000000module.exports = defineTest({ description: 'side-effects when mutating destructured variables should not be ignored' }); rollup-3.29.4/test/form/samples/side-effects-pattern-assignment/_expected.js000066400000000000000000000005771450520414700272070ustar00rootroot00000000000000var e = {}; ({x: e} = globalThis.unknown); e.foo = 1; var f = {}; ({f} = globalThis.unknown); f.foo = 1; var {x: g} = globalThis.unknown; g.foo = 1; var {h} = globalThis.unknown; h.foo = 1; var m = {}; [m] = globalThis.unknown; m.foo = 1; var [n] = globalThis.unknown; n.foo = 1; var o = {}; [...o] = globalThis.unknown; o.foo = 1; var [...p] = globalThis.unknown; p.foo = 1; rollup-3.29.4/test/form/samples/side-effects-pattern-assignment/main.js000066400000000000000000000012511450520414700261610ustar00rootroot00000000000000var a = {}; ({x: a} = globalThis.unknown); var b = {}; ({b} = globalThis.unknown); var {x: c} = globalThis.unknown; var {d} = globalThis.unknown; var e = {}; ({x: e} = globalThis.unknown); e.foo = 1; var f = {}; ({f} = globalThis.unknown); f.foo = 1; var {x: g} = globalThis.unknown; g.foo = 1; var {h} = globalThis.unknown; h.foo = 1; var i = {}; [i] = globalThis.unknown; var [j] = globalThis.unknown; var k = {}; [,...k] = globalThis.unknown; var [,...l] = globalThis.unknown; var m = {}; [m] = globalThis.unknown; m.foo = 1; var [n] = globalThis.unknown; n.foo = 1; var o = {}; [...o] = globalThis.unknown; o.foo = 1; var [...p] = globalThis.unknown; p.foo = 1; rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/000077500000000000000000000000001450520414700243375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/_config.js000066400000000000000000000001511450520414700262760ustar00rootroot00000000000000module.exports = defineTest({ description: 'side-effects in pattern defaults should not be ignored' }); rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/_expected/000077500000000000000000000000001450520414700262775ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/_expected/amd.js000066400000000000000000000011021450520414700273700ustar00rootroot00000000000000define((function () { 'use strict'; const effect = () => console.log( 'effect' ); var { x: a2 = effect() } = {}; var { x: a3 = () => {} } = { x: effect }; a3(); var { x: a4 = effect } = {}; a4(); var b2; ({ x: b2 = effect() } = {}); var b3; ({ x: b3 = () => {} } = { x: effect }); b3(); var b4; ({ x: b4 = effect } = {}); b4(); var [ c2 = effect() ] = []; var [ c3 = () => {} ] = [ effect ]; c3(); var [ c4 = effect ] = []; c4(); var d2; [ d2 = effect() ] = []; var d3; [ d3 = () => {} ] = [ effect ]; d3(); var d4; [ d4 = effect ] = []; d4(); })); rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/_expected/cjs.js000066400000000000000000000010131450520414700274070ustar00rootroot00000000000000'use strict'; const effect = () => console.log( 'effect' ); var { x: a2 = effect() } = {}; var { x: a3 = () => {} } = { x: effect }; a3(); var { x: a4 = effect } = {}; a4(); var b2; ({ x: b2 = effect() } = {}); var b3; ({ x: b3 = () => {} } = { x: effect }); b3(); var b4; ({ x: b4 = effect } = {}); b4(); var [ c2 = effect() ] = []; var [ c3 = () => {} ] = [ effect ]; c3(); var [ c4 = effect ] = []; c4(); var d2; [ d2 = effect() ] = []; var d3; [ d3 = () => {} ] = [ effect ]; d3(); var d4; [ d4 = effect ] = []; d4(); rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/_expected/es.js000066400000000000000000000007741450520414700272540ustar00rootroot00000000000000const effect = () => console.log( 'effect' ); var { x: a2 = effect() } = {}; var { x: a3 = () => {} } = { x: effect }; a3(); var { x: a4 = effect } = {}; a4(); var b2; ({ x: b2 = effect() } = {}); var b3; ({ x: b3 = () => {} } = { x: effect }); b3(); var b4; ({ x: b4 = effect } = {}); b4(); var [ c2 = effect() ] = []; var [ c3 = () => {} ] = [ effect ]; c3(); var [ c4 = effect ] = []; c4(); var d2; [ d2 = effect() ] = []; var d3; [ d3 = () => {} ] = [ effect ]; d3(); var d4; [ d4 = effect ] = []; d4(); rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/_expected/iife.js000066400000000000000000000010751450520414700275540ustar00rootroot00000000000000(function () { 'use strict'; const effect = () => console.log( 'effect' ); var { x: a2 = effect() } = {}; var { x: a3 = () => {} } = { x: effect }; a3(); var { x: a4 = effect } = {}; a4(); var b2; ({ x: b2 = effect() } = {}); var b3; ({ x: b3 = () => {} } = { x: effect }); b3(); var b4; ({ x: b4 = effect } = {}); b4(); var [ c2 = effect() ] = []; var [ c3 = () => {} ] = [ effect ]; c3(); var [ c4 = effect ] = []; c4(); var d2; [ d2 = effect() ] = []; var d3; [ d3 = () => {} ] = [ effect ]; d3(); var d4; [ d4 = effect ] = []; d4(); })(); rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/_expected/system.js000066400000000000000000000012631450520414700301630ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const effect = () => console.log( 'effect' ); var { x: a2 = effect() } = {}; var { x: a3 = () => {} } = { x: effect }; a3(); var { x: a4 = effect } = {}; a4(); var b2; ({ x: b2 = effect() } = {}); var b3; ({ x: b3 = () => {} } = { x: effect }); b3(); var b4; ({ x: b4 = effect } = {}); b4(); var [ c2 = effect() ] = []; var [ c3 = () => {} ] = [ effect ]; c3(); var [ c4 = effect ] = []; c4(); var d2; [ d2 = effect() ] = []; var d3; [ d3 = () => {} ] = [ effect ]; d3(); var d4; [ d4 = effect ] = []; d4(); }) }; })); rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/_expected/umd.js000066400000000000000000000012401450520414700274170ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const effect = () => console.log( 'effect' ); var { x: a2 = effect() } = {}; var { x: a3 = () => {} } = { x: effect }; a3(); var { x: a4 = effect } = {}; a4(); var b2; ({ x: b2 = effect() } = {}); var b3; ({ x: b3 = () => {} } = { x: effect }); b3(); var b4; ({ x: b4 = effect } = {}); b4(); var [ c2 = effect() ] = []; var [ c3 = () => {} ] = [ effect ]; c3(); var [ c4 = effect ] = []; c4(); var d2; [ d2 = effect() ] = []; var d3; [ d3 = () => {} ] = [ effect ]; d3(); var d4; [ d4 = effect ] = []; d4(); })); rollup-3.29.4/test/form/samples/side-effects-pattern-defaults/main.js000066400000000000000000000011441450520414700256210ustar00rootroot00000000000000const effect = () => console.log( 'effect' ); var { x: a1 = 1 } = {}; var { x: a2 = effect() } = {}; var { x: a3 = () => {} } = { x: effect }; a3(); var { x: a4 = effect } = {}; a4(); var b1; ({ x: b1 = 1 } = {}); var b2; ({ x: b2 = effect() } = {}); var b3; ({ x: b3 = () => {} } = { x: effect }); b3(); var b4; ({ x: b4 = effect } = {}); b4(); var [ c1 = 1 ] = []; var [ c2 = effect() ] = []; var [ c3 = () => {} ] = [ effect ]; c3(); var [ c4 = effect ] = []; c4(); var d1; [ d1 = 1 ] = []; var d2; [ d2 = effect() ] = []; var d3; [ d3 = () => {} ] = [ effect ]; d3(); var d4; [ d4 = effect ] = []; d4(); rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/000077500000000000000000000000001450520414700254535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/_config.js000066400000000000000000000001521450520414700274130ustar00rootroot00000000000000module.exports = defineTest({ description: 'include side-effects with re-assigned prototypes (#953)' }); rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/_expected/000077500000000000000000000000001450520414700274135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/_expected/amd.js000066400000000000000000000004601450520414700305120ustar00rootroot00000000000000define((function () { 'use strict'; function V8Engine () {} V8Engine.prototype.toString = function () { return 'V8'; }; function V6Engine () {} V6Engine.prototype = V8Engine.prototype; V6Engine.prototype.toString = function () { return 'V6'; }; console.log( new V8Engine().toString() ); })); rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/_expected/cjs.js000066400000000000000000000004161450520414700305310ustar00rootroot00000000000000'use strict'; function V8Engine () {} V8Engine.prototype.toString = function () { return 'V8'; }; function V6Engine () {} V6Engine.prototype = V8Engine.prototype; V6Engine.prototype.toString = function () { return 'V6'; }; console.log( new V8Engine().toString() ); rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/_expected/es.js000066400000000000000000000003771450520414700303670ustar00rootroot00000000000000function V8Engine () {} V8Engine.prototype.toString = function () { return 'V8'; }; function V6Engine () {} V6Engine.prototype = V8Engine.prototype; V6Engine.prototype.toString = function () { return 'V6'; }; console.log( new V8Engine().toString() ); rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/_expected/iife.js000066400000000000000000000004531450520414700306670ustar00rootroot00000000000000(function () { 'use strict'; function V8Engine () {} V8Engine.prototype.toString = function () { return 'V8'; }; function V6Engine () {} V6Engine.prototype = V8Engine.prototype; V6Engine.prototype.toString = function () { return 'V6'; }; console.log( new V8Engine().toString() ); })(); rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/_expected/system.js000066400000000000000000000005671450520414700313050ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function V8Engine () {} V8Engine.prototype.toString = function () { return 'V8'; }; function V6Engine () {} V6Engine.prototype = V8Engine.prototype; V6Engine.prototype.toString = function () { return 'V6'; }; console.log( new V8Engine().toString() ); }) }; })); rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/_expected/umd.js000066400000000000000000000006161450520414700305410ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function V8Engine () {} V8Engine.prototype.toString = function () { return 'V8'; }; function V6Engine () {} V6Engine.prototype = V8Engine.prototype; V6Engine.prototype.toString = function () { return 'V6'; }; console.log( new V8Engine().toString() ); })); rollup-3.29.4/test/form/samples/side-effects-prototype-assignments/main.js000066400000000000000000000006641450520414700267430ustar00rootroot00000000000000function V8Engine () {} V8Engine.prototype.toString = function () { return 'V8'; }; function V6Engine () {} V6Engine.prototype = V8Engine.prototype; V6Engine.prototype.toString = function () { return 'V6'; }; function IgnoredEngine () {} IgnoredEngine.prototype.toString = function () { return 'IGNORED'; }; IgnoredEngine.prototype[ 'to' + 'String' ] = function () { return 'IGNORED'; }; console.log( new V8Engine().toString() ); rollup-3.29.4/test/form/samples/side-effects-reassignment/000077500000000000000000000000001450520414700235545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-reassignment/_config.js000066400000000000000000000002241450520414700255140ustar00rootroot00000000000000module.exports = defineTest({ description: 'when mutating/calling a reassigned variable, all assignments should be checked for side-effects' }); rollup-3.29.4/test/form/samples/side-effects-reassignment/_expected/000077500000000000000000000000001450520414700255145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-reassignment/_expected/amd.js000066400000000000000000000002151450520414700266110ustar00rootroot00000000000000define((function () { 'use strict'; var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); })); rollup-3.29.4/test/form/samples/side-effects-reassignment/_expected/cjs.js000066400000000000000000000001541450520414700266310ustar00rootroot00000000000000'use strict'; var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); rollup-3.29.4/test/form/samples/side-effects-reassignment/_expected/es.js000066400000000000000000000001351450520414700264600ustar00rootroot00000000000000var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); rollup-3.29.4/test/form/samples/side-effects-reassignment/_expected/iife.js000066400000000000000000000002101450520414700267570ustar00rootroot00000000000000(function () { 'use strict'; var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); })(); rollup-3.29.4/test/form/samples/side-effects-reassignment/_expected/system.js000066400000000000000000000003221450520414700273730ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); }) }; })); rollup-3.29.4/test/form/samples/side-effects-reassignment/_expected/umd.js000066400000000000000000000003531450520414700266400ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); })); rollup-3.29.4/test/form/samples/side-effects-reassignment/main.js000066400000000000000000000005051450520414700250360ustar00rootroot00000000000000var foo = () => {}; foo = 3; foo = 'foo'; foo = function () { console.log('effect'); }; foo = ['foo']; foo = undefined; var noEffect = function(a) { a = 'reassigned parameter'; }; var stillNoEffect = noEffect; stillNoEffect(); var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); rollup-3.29.4/test/form/samples/side-effects-return-statements/000077500000000000000000000000001450520414700245615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-return-statements/_config.js000066400000000000000000000002671450520414700265300ustar00rootroot00000000000000module.exports = defineTest({ description: 'return statements do not have side-effects but should be kept in certain cases (#1585)', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/side-effects-return-statements/_expected/000077500000000000000000000000001450520414700265215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-return-statements/_expected/amd.js000066400000000000000000000002261450520414700276200ustar00rootroot00000000000000define((function () { 'use strict'; function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); })); rollup-3.29.4/test/form/samples/side-effects-return-statements/_expected/cjs.js000066400000000000000000000001631450520414700276360ustar00rootroot00000000000000'use strict'; function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); rollup-3.29.4/test/form/samples/side-effects-return-statements/_expected/es.js000066400000000000000000000001441450520414700274650ustar00rootroot00000000000000function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); rollup-3.29.4/test/form/samples/side-effects-return-statements/_expected/iife.js000066400000000000000000000002211450520414700277660ustar00rootroot00000000000000(function () { 'use strict'; function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); })(); rollup-3.29.4/test/form/samples/side-effects-return-statements/_expected/system.js000066400000000000000000000003531450520414700304040ustar00rootroot00000000000000System.register('myBundle', [], (function () { 'use strict'; return { execute: (function () { function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); }) }; })); rollup-3.29.4/test/form/samples/side-effects-return-statements/_expected/umd.js000066400000000000000000000003641450520414700276470ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); })); rollup-3.29.4/test/form/samples/side-effects-return-statements/main.js000066400000000000000000000002741450520414700260460ustar00rootroot00000000000000function isRemoved ( x ) { if ( x ) { return 2; } return 1; } isRemoved( true ); function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); rollup-3.29.4/test/form/samples/side-effects-static-methods/000077500000000000000000000000001450520414700240055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-static-methods/_config.js000066400000000000000000000001471450520414700257510ustar00rootroot00000000000000module.exports = defineTest({ description: 'allow calls to pure static methods to be tree-shaken' }); rollup-3.29.4/test/form/samples/side-effects-static-methods/_expected.js000066400000000000000000000010041450520414700262760ustar00rootroot00000000000000class Effect { static a() { log(); } } Effect.a(); class DeoptComputed { static a() {} static [foo]() { log(); } } DeoptComputed.a(); class DeoptGetter { static a() {} static get a() {} } DeoptGetter.a(); class DeoptAssign { static a() {} } DeoptAssign.a = log; DeoptAssign.a(); class DeoptFully { static a() {} } unknown(DeoptFully); DeoptFully.a(); class DeepAssign { static a = {} a = {} } DeepAssign.a.b = 1; DeepAssign.prototype.a.b = 1; class DynamicAssign {} DynamicAssign[foo()] = 1; rollup-3.29.4/test/form/samples/side-effects-static-methods/main.js000066400000000000000000000010661450520414700252720ustar00rootroot00000000000000class NoEffect { static a() {} } NoEffect.a(); class Effect { static a() { log(); } } Effect.a(); class DeoptComputed { static a() {} static [foo]() { log(); } } DeoptComputed.a(); class DeoptGetter { static a() {} static get a() {} } DeoptGetter.a(); class DeoptAssign { static a() {} } DeoptAssign.a = log; DeoptAssign.a(); class DeoptFully { static a() {} } unknown(DeoptFully); DeoptFully.a(); class DeepAssign { static a = {} a = {} } DeepAssign.a.b = 1; DeepAssign.prototype.a.b = 1; class DynamicAssign {} DynamicAssign[foo()] = 1; rollup-3.29.4/test/form/samples/side-effects-switch-statements/000077500000000000000000000000001450520414700245435ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-switch-statements/_config.js000066400000000000000000000001441450520414700265040ustar00rootroot00000000000000module.exports = defineTest({ description: 'switch statements should be correctly tree-shaken' }); rollup-3.29.4/test/form/samples/side-effects-switch-statements/_expected.js000066400000000000000000000013501450520414700270400ustar00rootroot00000000000000function effect() { console.log('effect'); } switch (globalThis.unknown) { case 'foo': case 'bar': effect(); if (globalThis.unknown > 1) { break; } case 'baz': effect(); break; } switch (globalThis.unknown) { case 'foo': break; case 'bar': effect(); default: effect(); } (function nestedSwitchWithEffects() { switch (globalThis.unknown) { default: effect(); } })(); switch (globalThis.unknown) { case effect(): } switch (effect()) { } switch (globalThis.unknown) { default: case 'foo': effect(); break; case 'bar': } for (var i = 0; i < 4; i++) { switch (i) { case 0: case 1: continue; } effect(); } var included; switch (effect()) { default: included = 1; } console.log(included); rollup-3.29.4/test/form/samples/side-effects-switch-statements/main.js000066400000000000000000000020061450520414700260230ustar00rootroot00000000000000function noEffect() {} function effect() { console.log('effect'); } switch (globalThis.unknown) { case 'foo': case 'bar': effect(); noEffect(); if (globalThis.unknown > 1) { break; } case 'baz': effect(); break; case noEffect(): noEffect(); break; default: noEffect(); break; } switch (globalThis.unknown) { case 'foo': noEffect(); break; case 'bar': effect(); default: effect(); } (function nestedSwitchWithEffects() { switch (globalThis.unknown) { default: effect(); } })(); (function nestedSwitchWithoutEffects() { switch (globalThis.unknown) { case 'foo': noEffect(); break; case 'bar': default: } })(); switch (globalThis.unknown) { case effect(): } switch (effect()) { } switch (globalThis.unknown) { default: case 'foo': effect(); break; case 'bar': noEffect(); } for (var i = 0; i < 4; i++) { switch (i) { case 0: case 1: continue; } effect(); } var included; switch (effect()) { default: included = 1; } console.log(included); rollup-3.29.4/test/form/samples/side-effects-this/000077500000000000000000000000001450520414700220245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/side-effects-this/_config.js000066400000000000000000000002151450520414700237640ustar00rootroot00000000000000module.exports = defineTest({ description: 'When a constructor is called with the new keyword, changing its this has no side effects' }); rollup-3.29.4/test/form/samples/side-effects-this/_expected.js000066400000000000000000000002311450520414700243160ustar00rootroot00000000000000class Main { constructor() { this.a = 1; } } const b = new Main(); assert.ok(b); function Foo() { this.a = 1; } const d = new Foo(); assert.ok(d); rollup-3.29.4/test/form/samples/side-effects-this/main.js000066400000000000000000000003331450520414700233050ustar00rootroot00000000000000class Main { constructor() { this.a = 1; } } const a = new Main(); // removed const b = new Main(); assert.ok(b); function Foo() { this.a = 1; } const c = new Foo(); // removed const d = new Foo(); assert.ok(d); rollup-3.29.4/test/form/samples/simplified-initializer/000077500000000000000000000000001450520414700231645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/simplified-initializer/_config.js000066400000000000000000000002051450520414700251230ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles simplified variable initializers', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/simplified-initializer/_expected/000077500000000000000000000000001450520414700251245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/simplified-initializer/_expected/amd.js000066400000000000000000000002571450520414700262270ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const a = window.config ? 1 : 2; const b = 1 ; const c = 2; exports.a = a; exports.b = b; exports.c = c; })); rollup-3.29.4/test/form/samples/simplified-initializer/_expected/cjs.js000066400000000000000000000001711450520414700262400ustar00rootroot00000000000000'use strict'; const a = window.config ? 1 : 2; const b = 1 ; const c = 2; exports.a = a; exports.b = b; exports.c = c; rollup-3.29.4/test/form/samples/simplified-initializer/_expected/es.js000066400000000000000000000001211450520414700260630ustar00rootroot00000000000000const a = window.config ? 1 : 2; const b = 1 ; const c = 2; export { a, b, c }; rollup-3.29.4/test/form/samples/simplified-initializer/_expected/iife.js000066400000000000000000000002761450520414700264030ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const a = window.config ? 1 : 2; const b = 1 ; const c = 2; exports.a = a; exports.b = b; exports.c = c; return exports; })({}); rollup-3.29.4/test/form/samples/simplified-initializer/_expected/system.js000066400000000000000000000003461450520414700270110ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const a = exports('a', window.config ? 1 : 2); const b = exports('b', 1 ); const c = exports('c', 2); }) }; })); rollup-3.29.4/test/form/samples/simplified-initializer/_expected/umd.js000066400000000000000000000007141450520414700262510ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; const a = window.config ? 1 : 2; const b = 1 ; const c = 2; exports.a = a; exports.b = b; exports.c = c; })); rollup-3.29.4/test/form/samples/simplified-initializer/main.js000066400000000000000000000001441450520414700244450ustar00rootroot00000000000000export const a = window.config ? 1 : 2 export const b = true ? 1 : 2 export const c = false ? 1 : 2 rollup-3.29.4/test/form/samples/simplify-expression-annotations/000077500000000000000000000000001450520414700251025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/simplify-expression-annotations/_config.js000066400000000000000000000001511450520414700270410ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps correct annotations when simplifying expressinos' }); rollup-3.29.4/test/form/samples/simplify-expression-annotations/_expected.js000066400000000000000000000002351450520414700274000ustar00rootroot00000000000000console.log(/*@__PURE__*/ noEffect() ); console.log(/*@__PURE__*/ noEffect()); console.log(/*@__PURE__*/ noEffect()); console.log(/*@__PURE__*/ noEffect()); rollup-3.29.4/test/form/samples/simplify-expression-annotations/main.js000066400000000000000000000003121450520414700263600ustar00rootroot00000000000000console.log(true ? /*@__PURE__*/ noEffect() : null); console.log(false ? null : /*@__PURE__*/ noEffect()); console.log(true && /*@__PURE__*/ noEffect()); console.log(false || /*@__PURE__*/ noEffect()); rollup-3.29.4/test/form/samples/simplify-return-expression/000077500000000000000000000000001450520414700240645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/simplify-return-expression/_config.js000066400000000000000000000001371450520414700260270ustar00rootroot00000000000000module.exports = defineTest({ description: 'Simplifies conditionals in return expression' }); rollup-3.29.4/test/form/samples/simplify-return-expression/_expected.js000066400000000000000000000010541450520414700263620ustar00rootroot00000000000000const test = () => { console.log(foo()); console.log(bar()); }; const foo = () => { return 'A' ; }; const bar = () => { return 'A' ; }; (function() { const test = () => { console.log(foo()); console.log(bar()); }; const foo = () => { // optimized return 'A' ; }; const bar = () => { // optimized return 'A' ; }; test(); })(); const test2 = () => { console.log(foo2()); console.log(bar2()); }; const foo2 = () => { // optimized return 'A' ; }; const bar2 = () => { // optimized return 'A' ; }; export { test, test2 }; rollup-3.29.4/test/form/samples/simplify-return-expression/main.js000066400000000000000000000015531450520414700253520ustar00rootroot00000000000000export const test = () => { console.log(foo()); console.log(bar()); }; const foo = () => { return BUILD ? 'A' : 'B'; }; const bar = () => { return getBuild() ? 'A' : 'B'; }; const getBuild = () => BUILD; const BUILD = true; (function() { const test = () => { console.log(foo()); console.log(bar()); }; const foo = () => { // optimized return BUILD ? 'A' : 'B'; }; const bar = () => { // optimized return getBuild() ? 'A' : 'B'; }; // optimized away const getBuild = () => BUILD; // optimized away const BUILD = true; test(); })(); // optimized away const BUILD2 = true; // optimized away const getBuild2 = () => BUILD2; export const test2 = () => { console.log(foo2()); console.log(bar2()); }; const foo2 = () => { // optimized return BUILD2 ? 'A' : 'B'; }; const bar2 = () => { // optimized return getBuild2() ? 'A' : 'B'; }; rollup-3.29.4/test/form/samples/skips-dead-branches-b/000077500000000000000000000000001450520414700225445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-b/_config.js000066400000000000000000000001121450520414700245000ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead branch (b)' }); rollup-3.29.4/test/form/samples/skips-dead-branches-b/_expected/000077500000000000000000000000001450520414700245045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-b/_expected/amd.js000066400000000000000000000001661450520414700256060ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-b/_expected/cjs.js000066400000000000000000000001261450520414700256200ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-b/_expected/es.js000066400000000000000000000001071450520414700254470ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-b/_expected/iife.js000066400000000000000000000001611450520414700257540ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-3.29.4/test/form/samples/skips-dead-branches-b/_expected/system.js000066400000000000000000000002711450520414700263660ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-3.29.4/test/form/samples/skips-dead-branches-b/_expected/umd.js000066400000000000000000000003241450520414700256260ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-b/main.js000066400000000000000000000002671450520414700240330ustar00rootroot00000000000000var obj = {}; obj.foo = function () { console.log( 'this should be excluded' ); } function bar () { console.log( 'this should be included' ); } if ( true ) bar(); else obj.foo(); rollup-3.29.4/test/form/samples/skips-dead-branches-c/000077500000000000000000000000001450520414700225455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-c/_config.js000066400000000000000000000001121450520414700245010ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead branch (c)' }); rollup-3.29.4/test/form/samples/skips-dead-branches-c/_expected/000077500000000000000000000000001450520414700245055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-c/_expected/amd.js000066400000000000000000000001651450520414700256060ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-c/_expected/cjs.js000066400000000000000000000001251450520414700256200ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-c/_expected/es.js000066400000000000000000000001061450520414700254470ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-c/_expected/iife.js000066400000000000000000000001601450520414700257540ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-3.29.4/test/form/samples/skips-dead-branches-c/_expected/system.js000066400000000000000000000002701450520414700263660ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-3.29.4/test/form/samples/skips-dead-branches-c/_expected/umd.js000066400000000000000000000003231450520414700256260ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-c/main.js000066400000000000000000000002631450520414700240300ustar00rootroot00000000000000var obj = {}; obj.foo = function () { console.log( 'this should be excluded' ); } function bar () { console.log( 'this should be included' ); } if ( !true ) obj.foo(); bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-d/000077500000000000000000000000001450520414700225465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-d/_config.js000066400000000000000000000001121450520414700245020ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead branch (d)' }); rollup-3.29.4/test/form/samples/skips-dead-branches-d/_expected/000077500000000000000000000000001450520414700245065ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-d/_expected/amd.js000066400000000000000000000001651450520414700256070ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-d/_expected/cjs.js000066400000000000000000000001251450520414700256210ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-d/_expected/es.js000066400000000000000000000001061450520414700254500ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-d/_expected/iife.js000066400000000000000000000001601450520414700257550ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-3.29.4/test/form/samples/skips-dead-branches-d/_expected/system.js000066400000000000000000000002701450520414700263670ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-3.29.4/test/form/samples/skips-dead-branches-d/_expected/umd.js000066400000000000000000000003231450520414700256270ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-d/main.js000066400000000000000000000003141450520414700240260ustar00rootroot00000000000000var obj = {}; obj.foo = function () { console.log( 'this should be excluded' ); } function bar () { console.log( 'this should be included' ); } if ( 'development' === 'production' ) obj.foo(); bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-e/000077500000000000000000000000001450520414700225475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-e/_config.js000066400000000000000000000001121450520414700245030ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead branch (e)' }); rollup-3.29.4/test/form/samples/skips-dead-branches-e/_expected/000077500000000000000000000000001450520414700245075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-e/_expected/amd.js000066400000000000000000000001651450520414700256100ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-e/_expected/cjs.js000066400000000000000000000001251450520414700256220ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-e/_expected/es.js000066400000000000000000000001061450520414700254510ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-e/_expected/iife.js000066400000000000000000000001601450520414700257560ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-3.29.4/test/form/samples/skips-dead-branches-e/_expected/system.js000066400000000000000000000002701450520414700263700ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-3.29.4/test/form/samples/skips-dead-branches-e/_expected/umd.js000066400000000000000000000003231450520414700256300ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-e/main.js000066400000000000000000000003131450520414700240260ustar00rootroot00000000000000var obj = {}; obj.foo = function () { console.log( 'this should be excluded' ); } function bar () { console.log( 'this should be included' ); } if ( 'production' !== 'production' ) obj.foo(); bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-f/000077500000000000000000000000001450520414700225505ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-f/_config.js000066400000000000000000000001121450520414700245040ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead branch (f)' }); rollup-3.29.4/test/form/samples/skips-dead-branches-f/_expected/000077500000000000000000000000001450520414700245105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-f/_expected/amd.js000066400000000000000000000001651450520414700256110ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-f/_expected/cjs.js000066400000000000000000000001251450520414700256230ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-f/_expected/es.js000066400000000000000000000001061450520414700254520ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-f/_expected/iife.js000066400000000000000000000001601450520414700257570ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-3.29.4/test/form/samples/skips-dead-branches-f/_expected/system.js000066400000000000000000000002701450520414700263710ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-3.29.4/test/form/samples/skips-dead-branches-f/_expected/umd.js000066400000000000000000000003231450520414700256310ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-f/main.js000066400000000000000000000002701450520414700240310ustar00rootroot00000000000000var obj = {}; obj.foo = function () { console.log( 'this should be excluded' ); } function bar () { console.log( 'this should be included' ); } if ( 42 != '42' ) obj.foo(); bar(); rollup-3.29.4/test/form/samples/skips-dead-branches-g/000077500000000000000000000000001450520414700225515ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-g/_config.js000066400000000000000000000001411450520414700245070ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead conditional expression branch (g)' }); rollup-3.29.4/test/form/samples/skips-dead-branches-g/_expected/000077500000000000000000000000001450520414700245115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-g/_expected/amd.js000066400000000000000000000001651450520414700256120ustar00rootroot00000000000000define((function () { 'use strict'; var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); })); rollup-3.29.4/test/form/samples/skips-dead-branches-g/_expected/cjs.js000066400000000000000000000001241450520414700256230ustar00rootroot00000000000000'use strict'; var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); rollup-3.29.4/test/form/samples/skips-dead-branches-g/_expected/es.js000066400000000000000000000001051450520414700254520ustar00rootroot00000000000000var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); rollup-3.29.4/test/form/samples/skips-dead-branches-g/_expected/iife.js000066400000000000000000000001601450520414700257600ustar00rootroot00000000000000(function () { 'use strict'; var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); })(); rollup-3.29.4/test/form/samples/skips-dead-branches-g/_expected/system.js000066400000000000000000000002721450520414700263740ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); }) }; })); rollup-3.29.4/test/form/samples/skips-dead-branches-g/_expected/umd.js000066400000000000000000000003231450520414700256320ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); })); rollup-3.29.4/test/form/samples/skips-dead-branches-g/main.js000066400000000000000000000001461450520414700240340ustar00rootroot00000000000000var a = 0; var b = 1; var c = 2; var x = true ? a : b; var y = false ? c : b; console.log( x + y ); rollup-3.29.4/test/form/samples/skips-dead-branches-h/000077500000000000000000000000001450520414700225525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-h/_config.js000066400000000000000000000001121450520414700245060ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead branch (h)' }); rollup-3.29.4/test/form/samples/skips-dead-branches-h/_expected/000077500000000000000000000000001450520414700245125ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-h/_expected/amd.js000066400000000000000000000001361450520414700256110ustar00rootroot00000000000000define((function () { 'use strict'; function baz() { console.log("baz"); } baz(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-h/_expected/cjs.js000066400000000000000000000000761450520414700256320ustar00rootroot00000000000000'use strict'; function baz() { console.log("baz"); } baz(); rollup-3.29.4/test/form/samples/skips-dead-branches-h/_expected/es.js000066400000000000000000000000571450520414700254610ustar00rootroot00000000000000function baz() { console.log("baz"); } baz(); rollup-3.29.4/test/form/samples/skips-dead-branches-h/_expected/iife.js000066400000000000000000000001311450520414700257570ustar00rootroot00000000000000(function () { 'use strict'; function baz() { console.log("baz"); } baz(); })(); rollup-3.29.4/test/form/samples/skips-dead-branches-h/_expected/system.js000066400000000000000000000002411450520414700263710ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function baz() { console.log("baz"); } baz(); }) }; })); rollup-3.29.4/test/form/samples/skips-dead-branches-h/_expected/umd.js000066400000000000000000000002741450520414700256400ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function baz() { console.log("baz"); } baz(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-h/main.js000066400000000000000000000002111450520414700240260ustar00rootroot00000000000000function bar(umm) { umm = hmm(); console.log("bar"); } function hmm() { return true; } function baz() { console.log("baz"); } baz(); rollup-3.29.4/test/form/samples/skips-dead-branches-i/000077500000000000000000000000001450520414700225535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-i/_config.js000066400000000000000000000001121450520414700245070ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead branch (i)' }); rollup-3.29.4/test/form/samples/skips-dead-branches-i/_expected/000077500000000000000000000000001450520414700245135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-i/_expected/amd.js000066400000000000000000000001361450520414700256120ustar00rootroot00000000000000define((function () { 'use strict'; function baz() { console.log("baz"); } baz(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-i/_expected/cjs.js000066400000000000000000000000761450520414700256330ustar00rootroot00000000000000'use strict'; function baz() { console.log("baz"); } baz(); rollup-3.29.4/test/form/samples/skips-dead-branches-i/_expected/es.js000066400000000000000000000000571450520414700254620ustar00rootroot00000000000000function baz() { console.log("baz"); } baz(); rollup-3.29.4/test/form/samples/skips-dead-branches-i/_expected/iife.js000066400000000000000000000001311450520414700257600ustar00rootroot00000000000000(function () { 'use strict'; function baz() { console.log("baz"); } baz(); })(); rollup-3.29.4/test/form/samples/skips-dead-branches-i/_expected/system.js000066400000000000000000000002411450520414700263720ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function baz() { console.log("baz"); } baz(); }) }; })); rollup-3.29.4/test/form/samples/skips-dead-branches-i/_expected/umd.js000066400000000000000000000002741450520414700256410ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function baz() { console.log("baz"); } baz(); })); rollup-3.29.4/test/form/samples/skips-dead-branches-i/main.js000066400000000000000000000002141450520414700240320ustar00rootroot00000000000000function bar() { var t; t = hmm(); console.log("bar"); } function hmm() { return true; } function baz() { console.log("baz"); } baz(); rollup-3.29.4/test/form/samples/skips-dead-branches-j/000077500000000000000000000000001450520414700225545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-j/_config.js000066400000000000000000000001121450520414700245100ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead branch (j)' }); rollup-3.29.4/test/form/samples/skips-dead-branches-j/_expected/000077500000000000000000000000001450520414700245145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches-j/_expected/amd.js000066400000000000000000000001121450520414700256050ustar00rootroot00000000000000define((function () { 'use strict'; { console.log( 'true' ); } })); rollup-3.29.4/test/form/samples/skips-dead-branches-j/_expected/cjs.js000066400000000000000000000000531450520414700256270ustar00rootroot00000000000000'use strict'; { console.log( 'true' ); } rollup-3.29.4/test/form/samples/skips-dead-branches-j/_expected/es.js000066400000000000000000000000341450520414700254560ustar00rootroot00000000000000{ console.log( 'true' ); } rollup-3.29.4/test/form/samples/skips-dead-branches-j/_expected/iife.js000066400000000000000000000001051450520414700257620ustar00rootroot00000000000000(function () { 'use strict'; { console.log( 'true' ); } })(); rollup-3.29.4/test/form/samples/skips-dead-branches-j/_expected/system.js000066400000000000000000000002131450520414700263720ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { { console.log( 'true' ); } }) }; })); rollup-3.29.4/test/form/samples/skips-dead-branches-j/_expected/umd.js000066400000000000000000000002501450520414700256340ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; { console.log( 'true' ); } })); rollup-3.29.4/test/form/samples/skips-dead-branches-j/main.js000066400000000000000000000001221450520414700240310ustar00rootroot00000000000000if ( true && true ) { console.log( 'true' ); } else { console.log( 'false' ); } rollup-3.29.4/test/form/samples/skips-dead-branches/000077500000000000000000000000001450520414700223255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/skips-dead-branches/_config.js000066400000000000000000000001061450520414700242640ustar00rootroot00000000000000module.exports = defineTest({ description: 'skips a dead branch' }); rollup-3.29.4/test/form/samples/skips-dead-branches/_expected.js000066400000000000000000000001071450520414700246210ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-3.29.4/test/form/samples/skips-dead-branches/main.js000066400000000000000000000002701450520414700236060ustar00rootroot00000000000000var obj = {}; obj.foo = function () { console.log( 'this should be excluded' ); } function bar () { console.log( 'this should be included' ); } if ( false ) obj.foo(); else bar(); rollup-3.29.4/test/form/samples/slash-in-function-parameters/000077500000000000000000000000001450520414700242205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/slash-in-function-parameters/_config.js000066400000000000000000000001731450520414700261630ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles slashes in function parameters and correctly inserts missing ids' }); rollup-3.29.4/test/form/samples/slash-in-function-parameters/_expected/000077500000000000000000000000001450520414700261605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/slash-in-function-parameters/_expected/amd.js000066400000000000000000000002171450520414700272570ustar00rootroot00000000000000define((function () { 'use strict'; class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); })); rollup-3.29.4/test/form/samples/slash-in-function-parameters/_expected/cjs.js000066400000000000000000000001601450520414700272720ustar00rootroot00000000000000'use strict'; class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); rollup-3.29.4/test/form/samples/slash-in-function-parameters/_expected/es.js000066400000000000000000000001411450520414700271210ustar00rootroot00000000000000class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); rollup-3.29.4/test/form/samples/slash-in-function-parameters/_expected/iife.js000066400000000000000000000002121450520414700274250ustar00rootroot00000000000000(function () { 'use strict'; class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); })(); rollup-3.29.4/test/form/samples/slash-in-function-parameters/_expected/system.js000066400000000000000000000003201450520414700300350ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); }) }; })); rollup-3.29.4/test/form/samples/slash-in-function-parameters/_expected/umd.js000066400000000000000000000003551450520414700273060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); })); rollup-3.29.4/test/form/samples/slash-in-function-parameters/class.js000066400000000000000000000000661450520414700256650ustar00rootroot00000000000000export default class {} function* doesNotMatter() {} rollup-3.29.4/test/form/samples/slash-in-function-parameters/function.js000066400000000000000000000001061450520414700264000ustar00rootroot00000000000000export default function (text = '/') {} function* doesNotMatter() {} rollup-3.29.4/test/form/samples/slash-in-function-parameters/main.js000066400000000000000000000001621450520414700255010ustar00rootroot00000000000000import someClass from './class.js'; import someFunction from './function'; console.log(someClass, someFunction); rollup-3.29.4/test/form/samples/sourcemaps-excludesources/000077500000000000000000000000001450520414700237325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_config.js000066400000000000000000000003161450520414700256740ustar00rootroot00000000000000module.exports = defineTest({ description: 'correct sourcemaps are written (excluding sourceContent)', skipIfWindows: true, options: { output: { sourcemap: true, sourcemapExcludeSources: true } } }); rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/000077500000000000000000000000001450520414700256725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/amd.js000066400000000000000000000003741450520414700267750ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })); //# sourceMappingURL=amd.js.map rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/amd.js.map000066400000000000000000000005551450520414700275520ustar00rootroot00000000000000{"version":3,"file":"amd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":null,"names":[],"mappings":";;CAAe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCFe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;CACA,GAAG,EAAE,CAAC;CACN,GAAG,EAAE;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/cjs.js000066400000000000000000000003271450520414700270110ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); //# sourceMappingURL=cjs.js.map rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/cjs.js.map000066400000000000000000000005511450520414700275640ustar00rootroot00000000000000{"version":3,"file":"cjs.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":null,"names":[],"mappings":";;AAAe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACFe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;AACA,GAAG,EAAE,CAAC;AACN,GAAG,EAAE;;"}rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/es.js000066400000000000000000000003071450520414700266370ustar00rootroot00000000000000function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); //# sourceMappingURL=es.js.map rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/es.js.map000066400000000000000000000005441450520414700274160ustar00rootroot00000000000000{"version":3,"file":"es.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":null,"names":[],"mappings":"AAAe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACFe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;AACA,GAAG,EAAE,CAAC;AACN,GAAG,EAAE"}rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/iife.js000066400000000000000000000003701450520414700271440ustar00rootroot00000000000000(function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })(); //# sourceMappingURL=iife.js.map rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/iife.js.map000066400000000000000000000005571450520414700277270ustar00rootroot00000000000000{"version":3,"file":"iife.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":null,"names":[],"mappings":";;;CAAe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCFe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;CACA,GAAG,EAAE,CAAC;CACN,GAAG,EAAE;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/system.js000066400000000000000000000005141450520414700275540ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); }) }; })); //# sourceMappingURL=system.js.map rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/system.js.map000066400000000000000000000005651450520414700303360ustar00rootroot00000000000000{"version":3,"file":"system.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":null,"names":[],"mappings":";;;;;GAAe,SAAS,GAAG,IAAI;GAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;GACpC;;GCFe,SAAS,GAAG,IAAI;GAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;GACpC;;GCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;GACA,GAAG,EAAE,CAAC;GACN,GAAG,EAAE;;;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/umd.js000066400000000000000000000005321450520414700270150ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })); //# sourceMappingURL=umd.js.map rollup-3.29.4/test/form/samples/sourcemaps-excludesources/_expected/umd.js.map000066400000000000000000000005601450520414700275720ustar00rootroot00000000000000{"version":3,"file":"umd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":null,"names":[],"mappings":";;;;;CAAe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCFe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;CACA,GAAG,EAAE,CAAC;CACN,GAAG,EAAE;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-excludesources/bar.js000066400000000000000000000001101450520414700250240ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-3.29.4/test/form/samples/sourcemaps-excludesources/foo.js000066400000000000000000000001101450520414700250430ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-3.29.4/test/form/samples/sourcemaps-excludesources/main.js000066400000000000000000000001471450520414700252160ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-3.29.4/test/form/samples/sourcemaps-external/000077500000000000000000000000001450520414700225175ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/sourcemaps-external/_config.js000066400000000000000000000002451450520414700244620ustar00rootroot00000000000000module.exports = defineTest({ description: 'correct sourcemaps are written (separate file)', skipIfWindows: true, options: { output: { sourcemap: true } } }); rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/000077500000000000000000000000001450520414700244575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/amd.js000066400000000000000000000003741450520414700255620ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })); //# sourceMappingURL=amd.js.map rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/amd.js.map000066400000000000000000000011711450520414700263320ustar00rootroot00000000000000{"version":3,"file":"amd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;CAAe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCFe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;CACA,GAAG,EAAE,CAAC;CACN,GAAG,EAAE;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/cjs.js000066400000000000000000000003271450520414700255760ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); //# sourceMappingURL=cjs.js.map rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/cjs.js.map000066400000000000000000000011651450520414700263530ustar00rootroot00000000000000{"version":3,"file":"cjs.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;AAAe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACFe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;AACA,GAAG,EAAE,CAAC;AACN,GAAG,EAAE;;"}rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/es.js000066400000000000000000000003071450520414700254240ustar00rootroot00000000000000function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); //# sourceMappingURL=es.js.map rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/es.js.map000066400000000000000000000011601450520414700261760ustar00rootroot00000000000000{"version":3,"file":"es.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":"AAAe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACFe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;AACA,GAAG,EAAE,CAAC;AACN,GAAG,EAAE"}rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/iife.js000066400000000000000000000003701450520414700257310ustar00rootroot00000000000000(function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })(); //# sourceMappingURL=iife.js.map rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/iife.js.map000066400000000000000000000011731450520414700265070ustar00rootroot00000000000000{"version":3,"file":"iife.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;;CAAe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCFe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;CACA,GAAG,EAAE,CAAC;CACN,GAAG,EAAE;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/system.js000066400000000000000000000005141450520414700263410ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); }) }; })); //# sourceMappingURL=system.js.map rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/system.js.map000066400000000000000000000012011450520414700271070ustar00rootroot00000000000000{"version":3,"file":"system.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;;;;GAAe,SAAS,GAAG,IAAI;GAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;GACpC;;GCFe,SAAS,GAAG,IAAI;GAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;GACpC;;GCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;GACA,GAAG,EAAE,CAAC;GACN,GAAG,EAAE;;;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/umd.js000066400000000000000000000005321450520414700256020ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })); //# sourceMappingURL=umd.js.map rollup-3.29.4/test/form/samples/sourcemaps-external/_expected/umd.js.map000066400000000000000000000011741450520414700263610ustar00rootroot00000000000000{"version":3,"file":"umd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;;;;CAAe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCFe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;CACA,GAAG,EAAE,CAAC;CACN,GAAG,EAAE;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-external/bar.js000066400000000000000000000001101450520414700236110ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-3.29.4/test/form/samples/sourcemaps-external/foo.js000066400000000000000000000001101450520414700236300ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-3.29.4/test/form/samples/sourcemaps-external/main.js000066400000000000000000000001471450520414700240030ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-3.29.4/test/form/samples/sourcemaps-hidden/000077500000000000000000000000001450520414700221305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/sourcemaps-hidden/_config.js000066400000000000000000000002711450520414700240720ustar00rootroot00000000000000module.exports = defineTest({ description: 'correct sourcemaps are written (separate file) without comment', skipIfWindows: true, options: { output: { sourcemap: 'hidden' } } }); rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/000077500000000000000000000000001450520414700240705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/amd.js000066400000000000000000000003341450520414700251670ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })); rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/amd.js.map000066400000000000000000000011711450520414700257430ustar00rootroot00000000000000{"version":3,"file":"amd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;CAAe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCFe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;CACA,GAAG,EAAE,CAAC;CACN,GAAG,EAAE;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/cjs.js000066400000000000000000000002671450520414700252120ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/cjs.js.map000066400000000000000000000011651450520414700257640ustar00rootroot00000000000000{"version":3,"file":"cjs.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;AAAe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACFe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;AACA,GAAG,EAAE,CAAC;AACN,GAAG,EAAE;;"}rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/es.js000066400000000000000000000002501450520414700250320ustar00rootroot00000000000000function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/es.js.map000066400000000000000000000011601450520414700256070ustar00rootroot00000000000000{"version":3,"file":"es.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":"AAAe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACFe,SAAS,GAAG,IAAI;AAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC;;ACCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;AACA,GAAG,EAAE,CAAC;AACN,GAAG,EAAE"}rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/iife.js000066400000000000000000000003271450520414700253440ustar00rootroot00000000000000(function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })(); rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/iife.js.map000066400000000000000000000011731450520414700261200ustar00rootroot00000000000000{"version":3,"file":"iife.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;;CAAe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCFe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;CACA,GAAG,EAAE,CAAC;CACN,GAAG,EAAE;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/system.js000066400000000000000000000004511450520414700257520ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); }) }; })); rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/system.js.map000066400000000000000000000012011450520414700265200ustar00rootroot00000000000000{"version":3,"file":"system.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;;;;GAAe,SAAS,GAAG,IAAI;GAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;GACpC;;GCFe,SAAS,GAAG,IAAI;GAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;GACpC;;GCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;GACA,GAAG,EAAE,CAAC;GACN,GAAG,EAAE;;;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/umd.js000066400000000000000000000004721450520414700252160ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })); rollup-3.29.4/test/form/samples/sourcemaps-hidden/_expected/umd.js.map000066400000000000000000000011741450520414700257720ustar00rootroot00000000000000{"version":3,"file":"umd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;;;;CAAe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCFe,SAAS,GAAG,IAAI;CAC/B,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACpC;;CCCA,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;AACpC;CACA,GAAG,EAAE,CAAC;CACN,GAAG,EAAE;;;;;;"}rollup-3.29.4/test/form/samples/sourcemaps-hidden/bar.js000066400000000000000000000001101450520414700232220ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-3.29.4/test/form/samples/sourcemaps-hidden/foo.js000066400000000000000000000001101450520414700232410ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-3.29.4/test/form/samples/sourcemaps-hidden/main.js000066400000000000000000000001471450520414700234140ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-3.29.4/test/form/samples/sourcemaps-inline/000077500000000000000000000000001450520414700221535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/sourcemaps-inline/_config.js000066400000000000000000000002421450520414700241130ustar00rootroot00000000000000module.exports = defineTest({ description: 'correct sourcemaps are written (inline)', skipIfWindows: true, options: { output: { sourcemap: 'inline' } } }); rollup-3.29.4/test/form/samples/sourcemaps-inline/_expected/000077500000000000000000000000001450520414700241135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/sourcemaps-inline/_expected/amd.js000066400000000000000000000021511450520414700252110ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW1kLmpzIiwic291cmNlcyI6WyIuLi9mb28uanMiLCIuLi9iYXIuanMiLCIuLi9tYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZvbyAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBmb28uanMnICk7XG59XG4iLCJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBiYXIgKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gYmFyLmpzJyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb20gJy4vYmFyJztcblxuY29uc29sZS5sb2coICdoZWxsbyBmcm9tIG1haW4uanMnICk7XG5cbmZvbygpO1xuYmFyKCk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Q0FBZSxTQUFTLEdBQUcsSUFBSTtDQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztDQUNwQzs7Q0NGZSxTQUFTLEdBQUcsSUFBSTtDQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztDQUNwQzs7Q0NDQSxPQUFPLENBQUMsR0FBRyxFQUFFLG9CQUFvQixFQUFFLENBQUM7QUFDcEM7Q0FDQSxHQUFHLEVBQUUsQ0FBQztDQUNOLEdBQUcsRUFBRTs7Ozs7OyJ9 rollup-3.29.4/test/form/samples/sourcemaps-inline/_expected/cjs.js000066400000000000000000000021001450520414700252210ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2pzLmpzIiwic291cmNlcyI6WyIuLi9mb28uanMiLCIuLi9iYXIuanMiLCIuLi9tYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZvbyAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBmb28uanMnICk7XG59XG4iLCJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBiYXIgKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gYmFyLmpzJyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb20gJy4vYmFyJztcblxuY29uc29sZS5sb2coICdoZWxsbyBmcm9tIG1haW4uanMnICk7XG5cbmZvbygpO1xuYmFyKCk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBZSxTQUFTLEdBQUcsSUFBSTtBQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztBQUNwQzs7QUNGZSxTQUFTLEdBQUcsSUFBSTtBQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztBQUNwQzs7QUNDQSxPQUFPLENBQUMsR0FBRyxFQUFFLG9CQUFvQixFQUFFLENBQUM7QUFDcEM7QUFDQSxHQUFHLEVBQUUsQ0FBQztBQUNOLEdBQUcsRUFBRTs7In0= rollup-3.29.4/test/form/samples/sourcemaps-inline/_expected/es.js000066400000000000000000000020511450520414700250560ustar00rootroot00000000000000function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXMuanMiLCJzb3VyY2VzIjpbIi4uL2Zvby5qcyIsIi4uL2Jhci5qcyIsIi4uL21haW4uanMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gZm9vICgpIHtcblx0Y29uc29sZS5sb2coICdoZWxsbyBmcm9tIGZvby5qcycgKTtcbn1cbiIsImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGJhciAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBiYXIuanMnICk7XG59XG4iLCJpbXBvcnQgZm9vIGZyb20gJy4vZm9vJztcbmltcG9ydCBiYXIgZnJvbSAnLi9iYXInO1xuXG5jb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gbWFpbi5qcycgKTtcblxuZm9vKCk7XG5iYXIoKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBZSxTQUFTLEdBQUcsSUFBSTtBQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztBQUNwQzs7QUNGZSxTQUFTLEdBQUcsSUFBSTtBQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztBQUNwQzs7QUNDQSxPQUFPLENBQUMsR0FBRyxFQUFFLG9CQUFvQixFQUFFLENBQUM7QUFDcEM7QUFDQSxHQUFHLEVBQUUsQ0FBQztBQUNOLEdBQUcsRUFBRSJ9 rollup-3.29.4/test/form/samples/sourcemaps-inline/_expected/iife.js000066400000000000000000000021501450520414700253630ustar00rootroot00000000000000(function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })(); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWlmZS5qcyIsInNvdXJjZXMiOlsiLi4vZm9vLmpzIiwiLi4vYmFyLmpzIiwiLi4vbWFpbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBmb28gKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gZm9vLmpzJyApO1xufVxuIiwiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gYmFyICgpIHtcblx0Y29uc29sZS5sb2coICdoZWxsbyBmcm9tIGJhci5qcycgKTtcbn1cbiIsImltcG9ydCBmb28gZnJvbSAnLi9mb28nO1xuaW1wb3J0IGJhciBmcm9tICcuL2Jhcic7XG5cbmNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBtYWluLmpzJyApO1xuXG5mb28oKTtcbmJhcigpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztDQUFlLFNBQVMsR0FBRyxJQUFJO0NBQy9CLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxtQkFBbUIsRUFBRSxDQUFDO0NBQ3BDOztDQ0ZlLFNBQVMsR0FBRyxJQUFJO0NBQy9CLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxtQkFBbUIsRUFBRSxDQUFDO0NBQ3BDOztDQ0NBLE9BQU8sQ0FBQyxHQUFHLEVBQUUsb0JBQW9CLEVBQUUsQ0FBQztBQUNwQztDQUNBLEdBQUcsRUFBRSxDQUFDO0NBQ04sR0FBRyxFQUFFOzs7Ozs7In0= rollup-3.29.4/test/form/samples/sourcemaps-inline/_expected/system.js000066400000000000000000000023021450520414700257720ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); }) }; })); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3lzdGVtLmpzIiwic291cmNlcyI6WyIuLi9mb28uanMiLCIuLi9iYXIuanMiLCIuLi9tYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZvbyAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBmb28uanMnICk7XG59XG4iLCJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBiYXIgKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gYmFyLmpzJyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb20gJy4vYmFyJztcblxuY29uc29sZS5sb2coICdoZWxsbyBmcm9tIG1haW4uanMnICk7XG5cbmZvbygpO1xuYmFyKCk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7R0FBZSxTQUFTLEdBQUcsSUFBSTtHQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztHQUNwQzs7R0NGZSxTQUFTLEdBQUcsSUFBSTtHQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztHQUNwQzs7R0NDQSxPQUFPLENBQUMsR0FBRyxFQUFFLG9CQUFvQixFQUFFLENBQUM7QUFDcEM7R0FDQSxHQUFHLEVBQUUsQ0FBQztHQUNOLEdBQUcsRUFBRTs7Ozs7Ozs7In0= rollup-3.29.4/test/form/samples/sourcemaps-inline/_expected/umd.js000066400000000000000000000023131450520414700252350ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); })); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW1kLmpzIiwic291cmNlcyI6WyIuLi9mb28uanMiLCIuLi9iYXIuanMiLCIuLi9tYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZvbyAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBmb28uanMnICk7XG59XG4iLCJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBiYXIgKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gYmFyLmpzJyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb20gJy4vYmFyJztcblxuY29uc29sZS5sb2coICdoZWxsbyBmcm9tIG1haW4uanMnICk7XG5cbmZvbygpO1xuYmFyKCk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Q0FBZSxTQUFTLEdBQUcsSUFBSTtDQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztDQUNwQzs7Q0NGZSxTQUFTLEdBQUcsSUFBSTtDQUMvQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztDQUNwQzs7Q0NDQSxPQUFPLENBQUMsR0FBRyxFQUFFLG9CQUFvQixFQUFFLENBQUM7QUFDcEM7Q0FDQSxHQUFHLEVBQUUsQ0FBQztDQUNOLEdBQUcsRUFBRTs7Ozs7OyJ9 rollup-3.29.4/test/form/samples/sourcemaps-inline/bar.js000066400000000000000000000001101450520414700232450ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-3.29.4/test/form/samples/sourcemaps-inline/foo.js000066400000000000000000000001101450520414700232640ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-3.29.4/test/form/samples/sourcemaps-inline/main.js000066400000000000000000000001471450520414700234370ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/000077500000000000000000000000001450520414700260235ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/_config.js000066400000000000000000000001211450520414700277570ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles superfluous semicolons' }); rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/_expected/000077500000000000000000000000001450520414700277635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/_expected/amd.js000066400000000000000000000001441450520414700310610ustar00rootroot00000000000000define((function () { 'use strict'; function x () { return 'x' } assert.equal( x(), 'x' ); })); rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/_expected/cjs.js000066400000000000000000000001061450520414700310750ustar00rootroot00000000000000'use strict'; function x () { return 'x' } assert.equal( x(), 'x' ); rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/_expected/es.js000066400000000000000000000000671450520414700307330ustar00rootroot00000000000000function x () { return 'x' } assert.equal( x(), 'x' ); rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/_expected/iife.js000066400000000000000000000001371450520414700312360ustar00rootroot00000000000000(function () { 'use strict'; function x () { return 'x' } assert.equal( x(), 'x' ); })(); rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/_expected/system.js000066400000000000000000000002431450520414700316440ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function x () { return 'x' } assert.equal( x(), 'x' ); }) }; })); rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/_expected/umd.js000066400000000000000000000003021450520414700311010ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function x () { return 'x' } assert.equal( x(), 'x' ); })); rollup-3.29.4/test/form/samples/spacing-after-function-with-semicolon/main.js000066400000000000000000000000711450520414700273030ustar00rootroot00000000000000function x () { return 'x' }; assert.equal( x(), 'x' ); rollup-3.29.4/test/form/samples/static-block-render/000077500000000000000000000000001450520414700223525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/static-block-render/_config.js000066400000000000000000000001431450520414700243120ustar00rootroot00000000000000module.exports = defineTest({ description: 'Correctly render treeshaked inline static blocks' }); rollup-3.29.4/test/form/samples/static-block-render/_expected.js000066400000000000000000000001271450520414700246500ustar00rootroot00000000000000class Foo { static /* { */ {} } class Bar { static {} } export { Bar, Foo }; rollup-3.29.4/test/form/samples/static-block-render/main.js000066400000000000000000000001311450520414700236270ustar00rootroot00000000000000export class Foo { static /* { */ {/** 1 */1} } export class Bar { static {1} } rollup-3.29.4/test/form/samples/static-class-property-calls/000077500000000000000000000000001450520414700240665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/static-class-property-calls/_config.js000066400000000000000000000001471450520414700260320ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles effects when calling static class properties' }); rollup-3.29.4/test/form/samples/static-class-property-calls/_expected.js000066400000000000000000000005561450520414700263720ustar00rootroot00000000000000class Foo { static isTrue = () => true; static noEffect = () => {}; static effect = () => console.log('effect'); static missing; } console.log('retained'); Foo.effect(); Foo.missing(); class Bar { static flag = false static mutate = function() { this.flag = true; } } Bar.mutate(); if (Bar.flag) console.log('retained'); else console.log('unimportant'); rollup-3.29.4/test/form/samples/static-class-property-calls/main.js000066400000000000000000000006551450520414700253560ustar00rootroot00000000000000class Foo { static isTrue = () => true; static noEffect = () => {}; static effect = () => console.log('effect'); static missing; } if (Foo.isTrue()) console.log('retained'); else console.log('removed'); Foo.noEffect(); Foo.effect(); Foo.missing(); class Bar { static flag = false static mutate = function() { this.flag = true; } } Bar.mutate(); if (Bar.flag) console.log('retained'); else console.log('unimportant'); rollup-3.29.4/test/form/samples/static-method-deoptimization/000077500000000000000000000000001450520414700243205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/static-method-deoptimization/_config.js000066400000000000000000000001561450520414700262640ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoids infinite recursions when deoptimizing "this" context' }); rollup-3.29.4/test/form/samples/static-method-deoptimization/_expected.js000066400000000000000000000002641450520414700266200ustar00rootroot00000000000000class Foo { static echo(message) { this.prototype.echo(message); } echo(message) { console.log(message); } } class Bar extends Foo {} global.baz = 'PASS'; Bar.echo(baz); rollup-3.29.4/test/form/samples/static-method-deoptimization/main.js000066400000000000000000000002641450520414700256040ustar00rootroot00000000000000class Foo { static echo(message) { this.prototype.echo(message); } echo(message) { console.log(message); } } class Bar extends Foo {} global.baz = 'PASS'; Bar.echo(baz); rollup-3.29.4/test/form/samples/strict-false/000077500000000000000000000000001450520414700211165ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/strict-false/_config.js000066400000000000000000000002041450520414700230540ustar00rootroot00000000000000module.exports = defineTest({ description: 'use strict should not be present', options: { output: { strict: false } } }); rollup-3.29.4/test/form/samples/strict-false/_expected/000077500000000000000000000000001450520414700230565ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/strict-false/_expected/amd.js000066400000000000000000000004001450520414700241470ustar00rootroot00000000000000define((function () { const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } })); rollup-3.29.4/test/form/samples/strict-false/_expected/cjs.js000066400000000000000000000003071450520414700241730ustar00rootroot00000000000000const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } rollup-3.29.4/test/form/samples/strict-false/_expected/es.js000066400000000000000000000003071450520414700240230ustar00rootroot00000000000000const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } rollup-3.29.4/test/form/samples/strict-false/_expected/iife.js000066400000000000000000000003721450520414700243320ustar00rootroot00000000000000(function () { const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } })(); rollup-3.29.4/test/form/samples/strict-false/_expected/system.js000066400000000000000000000006111450520414700247360ustar00rootroot00000000000000System.register([], (function () { return { execute: (function () { const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } }) }; })); rollup-3.29.4/test/form/samples/strict-false/_expected/umd.js000066400000000000000000000005431450520414700242030ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } })); rollup-3.29.4/test/form/samples/strict-false/main.js000066400000000000000000000003051450520414700223760ustar00rootroot00000000000000const localVariable = 'local' try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); }rollup-3.29.4/test/form/samples/string-indentation-b/000077500000000000000000000000001450520414700225555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/string-indentation-b/_config.js000066400000000000000000000002311450520414700245130ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles multiple var declarations inited to strings (#166)', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/string-indentation-b/_expected/000077500000000000000000000000001450520414700245155ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/string-indentation-b/_expected/amd.js000066400000000000000000000002061450520414700256120ustar00rootroot00000000000000define((function () { 'use strict'; var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); })); rollup-3.29.4/test/form/samples/string-indentation-b/_expected/cjs.js000066400000000000000000000001321450520414700256260ustar00rootroot00000000000000'use strict'; var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); rollup-3.29.4/test/form/samples/string-indentation-b/_expected/es.js000066400000000000000000000001131450520414700254550ustar00rootroot00000000000000var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); rollup-3.29.4/test/form/samples/string-indentation-b/_expected/iife.js000066400000000000000000000002041450520414700257630ustar00rootroot00000000000000(function () { 'use strict'; var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); })(); rollup-3.29.4/test/form/samples/string-indentation-b/_expected/system.js000066400000000000000000000004021450520414700263730ustar00rootroot00000000000000System.register('myBundle', [], (function () { 'use strict'; return { execute: (function () { var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); }) }; })); rollup-3.29.4/test/form/samples/string-indentation-b/_expected/umd.js000066400000000000000000000003521450520414700256400ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); })); rollup-3.29.4/test/form/samples/string-indentation-b/main.js000066400000000000000000000001131450520414700240320ustar00rootroot00000000000000var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); rollup-3.29.4/test/form/samples/string-indentation/000077500000000000000000000000001450520414700223365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/string-indentation/_config.js000066400000000000000000000001411450520414700242740ustar00rootroot00000000000000module.exports = defineTest({ description: 'indentation is preserved in multi-line strings' }); rollup-3.29.4/test/form/samples/string-indentation/_expected/000077500000000000000000000000001450520414700242765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/string-indentation/_expected/amd.js000066400000000000000000000003571450520414700254020ustar00rootroot00000000000000define((function () { 'use strict'; var a = '1\ 2'; var b = '1\ 2'; var c = `1 2`; var d = `1 2`; assert.equal( a, '1\n 2' ); assert.equal( b, '1\n\t2' ); assert.equal( c, '1\n 2' ); assert.equal( d, '1\n\t2' ); })); rollup-3.29.4/test/form/samples/string-indentation/_expected/cjs.js000066400000000000000000000003131450520414700254100ustar00rootroot00000000000000'use strict'; var a = '1\ 2'; var b = '1\ 2'; var c = `1 2`; var d = `1 2`; assert.equal( a, '1\n 2' ); assert.equal( b, '1\n\t2' ); assert.equal( c, '1\n 2' ); assert.equal( d, '1\n\t2' ); rollup-3.29.4/test/form/samples/string-indentation/_expected/es.js000066400000000000000000000002741450520414700252460ustar00rootroot00000000000000var a = '1\ 2'; var b = '1\ 2'; var c = `1 2`; var d = `1 2`; assert.equal( a, '1\n 2' ); assert.equal( b, '1\n\t2' ); assert.equal( c, '1\n 2' ); assert.equal( d, '1\n\t2' ); rollup-3.29.4/test/form/samples/string-indentation/_expected/iife.js000066400000000000000000000003521450520414700255500ustar00rootroot00000000000000(function () { 'use strict'; var a = '1\ 2'; var b = '1\ 2'; var c = `1 2`; var d = `1 2`; assert.equal( a, '1\n 2' ); assert.equal( b, '1\n\t2' ); assert.equal( c, '1\n 2' ); assert.equal( d, '1\n\t2' ); })(); rollup-3.29.4/test/form/samples/string-indentation/_expected/system.js000066400000000000000000000004721450520414700261630ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var a = '1\ 2'; var b = '1\ 2'; var c = `1 2`; var d = `1 2`; assert.equal( a, '1\n 2' ); assert.equal( b, '1\n\t2' ); assert.equal( c, '1\n 2' ); assert.equal( d, '1\n\t2' ); }) }; })); rollup-3.29.4/test/form/samples/string-indentation/_expected/umd.js000066400000000000000000000005151450520414700254220ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var a = '1\ 2'; var b = '1\ 2'; var c = `1 2`; var d = `1 2`; assert.equal( a, '1\n 2' ); assert.equal( b, '1\n\t2' ); assert.equal( c, '1\n 2' ); assert.equal( d, '1\n\t2' ); })); rollup-3.29.4/test/form/samples/string-indentation/main.js000066400000000000000000000002741450520414700236230ustar00rootroot00000000000000var a = '1\ 2'; var b = '1\ 2'; var c = `1 2`; var d = `1 2`; assert.equal( a, '1\n 2' ); assert.equal( b, '1\n\t2' ); assert.equal( c, '1\n 2' ); assert.equal( d, '1\n\t2' ); rollup-3.29.4/test/form/samples/string-replace-side-effects/000077500000000000000000000000001450520414700237745ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/string-replace-side-effects/_config.js000066400000000000000000000002211450520414700257310ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not assume string.replace has side effects when called with a string as second argument' }); rollup-3.29.4/test/form/samples/string-replace-side-effects/_expected.js000066400000000000000000000002171450520414700262720ustar00rootroot00000000000000'foo'.replace('o', () => { console.log('retained'); return '_'; }); 'foo'.replaceAll('o', () => { console.log('retained'); return '_'; }); rollup-3.29.4/test/form/samples/string-replace-side-effects/main.js000066400000000000000000000004361450520414700252610ustar00rootroot00000000000000'foo'.replace('o', 'removed'); 'foo'.replace('o', () => 'removed'); 'foo'.replace('o', () => { console.log('retained'); return '_'; }); 'foo'.replaceAll('o', 'removed'); 'foo'.replaceAll('o', () => 'removed'); 'foo'.replaceAll('o', () => { console.log('retained'); return '_'; }); rollup-3.29.4/test/form/samples/super-class-no-side-effects/000077500000000000000000000000001450520414700237305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/super-class-no-side-effects/_config.js000066400000000000000000000003451450520414700256740ustar00rootroot00000000000000module.exports = defineTest({ description: 'Does not wrongly attribute side effects when the super class of an unused class is in a file without side effects (#4808)', options: { treeshake: { moduleSideEffects: false } } }); rollup-3.29.4/test/form/samples/super-class-no-side-effects/_expected.js000066400000000000000000000000251450520414700262230ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/form/samples/super-class-no-side-effects/main.js000066400000000000000000000002761450520414700252170ustar00rootroot00000000000000import { ExternalElement } from './other.js'; class MyClass extends ExternalElement { constructor() { super(); console.log('MyClassExtendsExternalClass'); } } console.log('main'); rollup-3.29.4/test/form/samples/super-class-no-side-effects/other.js000066400000000000000000000001651450520414700254110ustar00rootroot00000000000000const win = typeof window !== 'undefined' ? window : {}; export const ExternalElement = win.HTMLElement || class {}; rollup-3.29.4/test/form/samples/super-classes/000077500000000000000000000000001450520414700213075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-access/000077500000000000000000000000001450520414700270525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-access/_config.js000066400000000000000000000002001450520414700310040ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly resolves the prototype of the super class when accessing properties' }); rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-access/_expected.js000066400000000000000000000002261450520414700313500ustar00rootroot00000000000000class SuperAccess { prop = {}; method() {} } class Access extends SuperAccess {} Access.prototype.doesNoExist.throws; Access.prototype.prop.throws; rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-access/main.js000066400000000000000000000002651450520414700303370ustar00rootroot00000000000000class SuperAccess { prop = {}; method() {} } class Access extends SuperAccess {} Access.prototype.doesNoExist; Access.prototype.doesNoExist.throws; Access.prototype.prop.throws; rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-assignment/000077500000000000000000000000001450520414700277615ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-assignment/_config.js000066400000000000000000000002001450520414700317130ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly resolves the prototype of the super class when assigning properites' }); rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-assignment/_expected.js000066400000000000000000000012331450520414700322560ustar00rootroot00000000000000class SuperUsedAssign { method() {} } class UsedAssign extends SuperUsedAssign {} UsedAssign.prototype.doesNotExist = 1; UsedAssign.prototype.method.doesNotExist = 1; console.log(UsedAssign); class SuperAssign1 {} class Assign1 extends SuperAssign1 {} Assign1.prototype.doesNotExist.throws = 1; class SuperAssign2 { prop = {}; } class Assign2 extends SuperAssign2 {} Assign2.prototype.prop.throws = 1; class SuperAssign3 { method() {} } class Assign3 extends SuperAssign3 {} Assign3.prototype.method.doesNotExist.throws = 1; class SuperAssign4 { set prop(v) { console.log('effect', v); } } class Assign4 extends SuperAssign4 {} Assign4.prototype.prop = 1; rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-assignment/main.js000066400000000000000000000015071450520414700312460ustar00rootroot00000000000000class SuperRemovedAssign { set prop(v) {} } class RemovedAssign extends SuperRemovedAssign {} RemovedAssign.prototype.doesNotExist = 1; RemovedAssign.prototype.prop = 1; class SuperUsedAssign { method() {} } class UsedAssign extends SuperUsedAssign {} UsedAssign.prototype.doesNotExist = 1; UsedAssign.prototype.method.doesNotExist = 1; console.log(UsedAssign); class SuperAssign1 {} class Assign1 extends SuperAssign1 {} Assign1.prototype.doesNotExist.throws = 1; class SuperAssign2 { prop = {}; } class Assign2 extends SuperAssign2 {} Assign2.prototype.prop.throws = 1; class SuperAssign3 { method() {} } class Assign3 extends SuperAssign3 {} Assign3.prototype.method.doesNotExist.throws = 1; class SuperAssign4 { set prop(v) { console.log('effect', v); } } class Assign4 extends SuperAssign4 {} Assign4.prototype.prop = 1; rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-calls/000077500000000000000000000000001450520414700267075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-calls/_config.js000066400000000000000000000001761450520414700306550ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly resolves the prototype of the super class when calling properties' }); rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-calls/_expected.js000066400000000000000000000004711450520414700312070ustar00rootroot00000000000000class SuperValues { get prop() { return { effect(used) { console.log('effect', used); }, }; } effect(used) { console.log('effect', used); } isTrue() { return true; } } class Values extends SuperValues {} console.log('retained'); Values.prototype.effect(); Values.prototype.prop.effect(); rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-calls/main.js000066400000000000000000000005651450520414700301770ustar00rootroot00000000000000class SuperValues { get prop() { return { effect(used) { console.log('effect', used); }, }; } effect(used) { console.log('effect', used); } isTrue() { return true; } } class Values extends SuperValues {} if (Values.prototype.isTrue()) console.log('retained'); else console.log('removed'); Values.prototype.effect(); Values.prototype.prop.effect(); rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-values/000077500000000000000000000000001450520414700271105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-values/_config.js000066400000000000000000000002031450520414700310450ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly resolves the prototype of the super class when reading property values' }); rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-values/_expected.js000066400000000000000000000004201450520414700314020ustar00rootroot00000000000000console.log('retained'); const prop = { isTrue: true }; class SuperDeopt { get prop() { return prop; } } class Deopt extends SuperDeopt {} Deopt.prototype.prop.isTrue = false; if (Deopt.prototype.prop.isTrue) console.log('unimportant'); else console.log('retained'); rollup-3.29.4/test/form/samples/super-classes/super-class-prototype-values/main.js000066400000000000000000000007221450520414700303730ustar00rootroot00000000000000class SuperValues { get isTrue() { return true; } get prop() { return { isTrue: true }; } } class Values extends SuperValues {} if (Values.prototype.isTrue) console.log('retained'); else console.log('removed'); const prop = { isTrue: true }; class SuperDeopt { get prop() { return prop; } } class Deopt extends SuperDeopt {} Deopt.prototype.prop.isTrue = false; if (Deopt.prototype.prop.isTrue) console.log('unimportant'); else console.log('retained'); rollup-3.29.4/test/form/samples/supports-core-js/000077500000000000000000000000001450520414700217555ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/supports-core-js/_config.js000066400000000000000000000004241450520414700237170ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports core-js', options: { // check against tree-shake: false when updating the polyfill treeshake: true, plugins: [ require('@rollup/plugin-node-resolve').default(), require('@rollup/plugin-commonjs')() ] } }); rollup-3.29.4/test/form/samples/supports-core-js/_expected.js000066400000000000000000025616271450520414700242760ustar00rootroot00000000000000var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; var check = function (it) { return it && it.Math === Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global$16 = // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || commonjsGlobal || Function('return this')(); var objectGetOwnPropertyDescriptor = {}; var fails$1u = function (exec) { try { return !!exec(); } catch (error) { return true; } }; var fails$1t = fails$1u; // Detect IE8's incomplete defineProperty implementation var descriptors = !fails$1t(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); var fails$1s = fails$1u; var functionBindNative = !fails$1s(function () { // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe return typeof test != 'function' || test.hasOwnProperty('prototype'); }); var NATIVE_BIND$4 = functionBindNative; var call$1j = Function.prototype.call; var functionCall = NATIVE_BIND$4 ? call$1j.bind(call$1j) : function () { return call$1j.apply(call$1j, arguments); }; var objectPropertyIsEnumerable = {}; var $propertyIsEnumerable$2 = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$e = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor$e && !$propertyIsEnumerable$2.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor$e(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable$2; var createPropertyDescriptor$d = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var NATIVE_BIND$3 = functionBindNative; var FunctionPrototype$5 = Function.prototype; var call$1i = FunctionPrototype$5.call; var uncurryThisWithBind = NATIVE_BIND$3 && FunctionPrototype$5.bind.bind(call$1i, call$1i); var functionUncurryThis = NATIVE_BIND$3 ? uncurryThisWithBind : function (fn) { return function () { return call$1i.apply(fn, arguments); }; }; var uncurryThis$1T = functionUncurryThis; var toString$K = uncurryThis$1T({}.toString); var stringSlice$l = uncurryThis$1T(''.slice); var classofRaw$2 = function (it) { return stringSlice$l(toString$K(it), 8, -1); }; var uncurryThis$1S = functionUncurryThis; var fails$1r = fails$1u; var classof$r = classofRaw$2; var $Object$8 = Object; var split$4 = uncurryThis$1S(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails$1r(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !$Object$8('z').propertyIsEnumerable(0); }) ? function (it) { return classof$r(it) === 'String' ? split$4(it, '') : $Object$8(it); } : $Object$8; // we can't use just `it == null` since of `document.all` special case // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec var isNullOrUndefined$k = function (it) { return it === null || it === undefined; }; var isNullOrUndefined$j = isNullOrUndefined$k; var $TypeError$I = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible$p = function (it) { if (isNullOrUndefined$j(it)) throw $TypeError$I("Can't call method on " + it); return it; }; // toObject with fallback for non-array-like ES3 strings var IndexedObject$7 = indexedObject; var requireObjectCoercible$o = requireObjectCoercible$p; var toIndexedObject$k = function (it) { return IndexedObject$7(requireObjectCoercible$o(it)); }; var documentAll$2 = typeof document == 'object' && document.all; // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined; var documentAll_1 = { all: documentAll$2, IS_HTMLDDA: IS_HTMLDDA }; var $documentAll$1 = documentAll_1; var documentAll$1 = $documentAll$1.all; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable var isCallable$K = $documentAll$1.IS_HTMLDDA ? function (argument) { return typeof argument == 'function' || argument === documentAll$1; } : function (argument) { return typeof argument == 'function'; }; var isCallable$J = isCallable$K; var $documentAll = documentAll_1; var documentAll = $documentAll.all; var isObject$K = $documentAll.IS_HTMLDDA ? function (it) { return typeof it == 'object' ? it !== null : isCallable$J(it) || it === documentAll; } : function (it) { return typeof it == 'object' ? it !== null : isCallable$J(it); }; var global$15 = global$16; var isCallable$I = isCallable$K; var aFunction = function (argument) { return isCallable$I(argument) ? argument : undefined; }; var getBuiltIn$M = function (namespace, method) { return arguments.length < 2 ? aFunction(global$15[namespace]) : global$15[namespace] && global$15[namespace][method]; }; var uncurryThis$1R = functionUncurryThis; var objectIsPrototypeOf = uncurryThis$1R({}.isPrototypeOf); var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; var global$14 = global$16; var userAgent$6 = engineUserAgent; var process$4 = global$14.process; var Deno$1 = global$14.Deno; var versions = process$4 && process$4.versions || Deno$1 && Deno$1.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10 // but their correct versions are not interesting for us version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` // so check `userAgent` even if `.v8` exists, but 0 if (!version && userAgent$6) { match = userAgent$6.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent$6.match(/Chrome\/(\d+)/); if (match) version = +match[1]; } } var engineV8Version = version; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION$3 = engineV8Version; var fails$1q = fails$1u; var global$13 = global$16; var $String$9 = global$13.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$1q(function () { var symbol = Symbol('symbol detection'); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, // of course, fail. return !$String$9(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION$3 && V8_VERSION$3 < 41; }); /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL$7 = symbolConstructorDetection; var useSymbolAsUid = NATIVE_SYMBOL$7 && !Symbol.sham && typeof Symbol.iterator == 'symbol'; var getBuiltIn$L = getBuiltIn$M; var isCallable$H = isCallable$K; var isPrototypeOf$e = objectIsPrototypeOf; var USE_SYMBOL_AS_UID$1 = useSymbolAsUid; var $Object$7 = Object; var isSymbol$8 = USE_SYMBOL_AS_UID$1 ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn$L('Symbol'); return isCallable$H($Symbol) && isPrototypeOf$e($Symbol.prototype, $Object$7(it)); }; var $String$8 = String; var tryToString$7 = function (argument) { try { return $String$8(argument); } catch (error) { return 'Object'; } }; var isCallable$G = isCallable$K; var tryToString$6 = tryToString$7; var $TypeError$H = TypeError; // `Assert: IsCallable(argument) is true` var aCallable$N = function (argument) { if (isCallable$G(argument)) return argument; throw $TypeError$H(tryToString$6(argument) + ' is not a function'); }; var aCallable$M = aCallable$N; var isNullOrUndefined$i = isNullOrUndefined$k; // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod var getMethod$l = function (V, P) { var func = V[P]; return isNullOrUndefined$i(func) ? undefined : aCallable$M(func); }; var call$1h = functionCall; var isCallable$F = isCallable$K; var isObject$J = isObject$K; var $TypeError$G = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive var ordinaryToPrimitive$2 = function (input, pref) { var fn, val; if (pref === 'string' && isCallable$F(fn = input.toString) && !isObject$J(val = call$1h(fn, input))) return val; if (isCallable$F(fn = input.valueOf) && !isObject$J(val = call$1h(fn, input))) return val; if (pref !== 'string' && isCallable$F(fn = input.toString) && !isObject$J(val = call$1h(fn, input))) return val; throw $TypeError$G("Can't convert object to primitive value"); }; var shared$b = {exports: {}}; var isPure = false; var global$12 = global$16; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty$i = Object.defineProperty; var defineGlobalProperty$3 = function (key, value) { try { defineProperty$i(global$12, key, { value: value, configurable: true, writable: true }); } catch (error) { global$12[key] = value; } return value; }; var global$11 = global$16; var defineGlobalProperty$2 = defineGlobalProperty$3; var SHARED = '__core-js_shared__'; var store$5 = global$11[SHARED] || defineGlobalProperty$2(SHARED, {}); var sharedStore = store$5; var store$4 = sharedStore; (shared$b.exports = function (key, value) { return store$4[key] || (store$4[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.32.2', mode: 'global', copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE', source: 'https://github.com/zloirock/core-js' }); var sharedExports = shared$b.exports; var requireObjectCoercible$n = requireObjectCoercible$p; var $Object$6 = Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject var toObject$D = function (argument) { return $Object$6(requireObjectCoercible$n(argument)); }; var uncurryThis$1Q = functionUncurryThis; var toObject$C = toObject$D; var hasOwnProperty = uncurryThis$1Q({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty // eslint-disable-next-line es/no-object-hasown -- safe var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject$C(it), key); }; var uncurryThis$1P = functionUncurryThis; var id$2 = 0; var postfix = Math.random(); var toString$J = uncurryThis$1P(1.0.toString); var uid$7 = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$J(++id$2 + postfix, 36); }; var global$10 = global$16; var shared$a = sharedExports; var hasOwn$F = hasOwnProperty_1; var uid$6 = uid$7; var NATIVE_SYMBOL$6 = symbolConstructorDetection; var USE_SYMBOL_AS_UID = useSymbolAsUid; var Symbol$7 = global$10.Symbol; var WellKnownSymbolsStore$2 = shared$a('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$7['for'] || Symbol$7 : Symbol$7 && Symbol$7.withoutSetter || uid$6; var wellKnownSymbol$T = function (name) { if (!hasOwn$F(WellKnownSymbolsStore$2, name)) { WellKnownSymbolsStore$2[name] = NATIVE_SYMBOL$6 && hasOwn$F(Symbol$7, name) ? Symbol$7[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore$2[name]; }; var call$1g = functionCall; var isObject$I = isObject$K; var isSymbol$7 = isSymbol$8; var getMethod$k = getMethod$l; var ordinaryToPrimitive$1 = ordinaryToPrimitive$2; var wellKnownSymbol$S = wellKnownSymbol$T; var $TypeError$F = TypeError; var TO_PRIMITIVE$1 = wellKnownSymbol$S('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive var toPrimitive$4 = function (input, pref) { if (!isObject$I(input) || isSymbol$7(input)) return input; var exoticToPrim = getMethod$k(input, TO_PRIMITIVE$1); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call$1g(exoticToPrim, input, pref); if (!isObject$I(result) || isSymbol$7(result)) return result; throw $TypeError$F("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive$1(input, pref); }; var toPrimitive$3 = toPrimitive$4; var isSymbol$6 = isSymbol$8; // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey var toPropertyKey$a = function (argument) { var key = toPrimitive$3(argument, 'string'); return isSymbol$6(key) ? key : key + ''; }; var global$$ = global$16; var isObject$H = isObject$K; var document$3 = global$$.document; // typeof document.createElement is 'object' in old IE var EXISTS$1 = isObject$H(document$3) && isObject$H(document$3.createElement); var documentCreateElement$2 = function (it) { return EXISTS$1 ? document$3.createElement(it) : {}; }; var DESCRIPTORS$S = descriptors; var fails$1p = fails$1u; var createElement$1 = documentCreateElement$2; // Thanks to IE8 for its funny defineProperty var ie8DomDefine = !DESCRIPTORS$S && !fails$1p(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement$1('div'), 'a', { get: function () { return 7; } }).a !== 7; }); var DESCRIPTORS$R = descriptors; var call$1f = functionCall; var propertyIsEnumerableModule$2 = objectPropertyIsEnumerable; var createPropertyDescriptor$c = createPropertyDescriptor$d; var toIndexedObject$j = toIndexedObject$k; var toPropertyKey$9 = toPropertyKey$a; var hasOwn$E = hasOwnProperty_1; var IE8_DOM_DEFINE$1 = ie8DomDefine; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor objectGetOwnPropertyDescriptor.f = DESCRIPTORS$R ? $getOwnPropertyDescriptor$2 : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject$j(O); P = toPropertyKey$9(P); if (IE8_DOM_DEFINE$1) try { return $getOwnPropertyDescriptor$2(O, P); } catch (error) { /* empty */ } if (hasOwn$E(O, P)) return createPropertyDescriptor$c(!call$1f(propertyIsEnumerableModule$2.f, O, P), O[P]); }; var objectDefineProperty = {}; var DESCRIPTORS$Q = descriptors; var fails$1o = fails$1u; // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 var v8PrototypeDefineBug = DESCRIPTORS$Q && fails$1o(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, writable: false }).prototype !== 42; }); var isObject$G = isObject$K; var $String$7 = String; var $TypeError$E = TypeError; // `Assert: Type(argument) is Object` var anObject$1f = function (argument) { if (isObject$G(argument)) return argument; throw $TypeError$E($String$7(argument) + ' is not an object'); }; var DESCRIPTORS$P = descriptors; var IE8_DOM_DEFINE = ie8DomDefine; var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug; var anObject$1e = anObject$1f; var toPropertyKey$8 = toPropertyKey$a; var $TypeError$D = TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty$1 = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE$1 = 'configurable'; var WRITABLE = 'writable'; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty objectDefineProperty.f = DESCRIPTORS$P ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) { anObject$1e(O); P = toPropertyKey$8(P); anObject$1e(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor$1(O, P); if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1], enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], writable: false }; } } return $defineProperty$1(O, P, Attributes); } : $defineProperty$1 : function defineProperty(O, P, Attributes) { anObject$1e(O); P = toPropertyKey$8(P); anObject$1e(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty$1(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw $TypeError$D('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; var DESCRIPTORS$O = descriptors; var definePropertyModule$b = objectDefineProperty; var createPropertyDescriptor$b = createPropertyDescriptor$d; var createNonEnumerableProperty$k = DESCRIPTORS$O ? function (object, key, value) { return definePropertyModule$b.f(object, key, createPropertyDescriptor$b(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var makeBuiltIn$5 = {exports: {}}; var DESCRIPTORS$N = descriptors; var hasOwn$D = hasOwnProperty_1; var FunctionPrototype$4 = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS$N && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn$D(FunctionPrototype$4, 'name'); // additional protection from minified / mangled / dropped function names var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS$N || (DESCRIPTORS$N && getDescriptor(FunctionPrototype$4, 'name').configurable)); var functionName = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; var uncurryThis$1O = functionUncurryThis; var isCallable$E = isCallable$K; var store$3 = sharedStore; var functionToString$1 = uncurryThis$1O(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable$E(store$3.inspectSource)) { store$3.inspectSource = function (it) { return functionToString$1(it); }; } var inspectSource$4 = store$3.inspectSource; var global$_ = global$16; var isCallable$D = isCallable$K; var WeakMap$5 = global$_.WeakMap; var weakMapBasicDetection = isCallable$D(WeakMap$5) && /native code/.test(String(WeakMap$5)); var shared$9 = sharedExports; var uid$5 = uid$7; var keys$3 = shared$9('keys'); var sharedKey$4 = function (key) { return keys$3[key] || (keys$3[key] = uid$5(key)); }; var hiddenKeys$6 = {}; var NATIVE_WEAK_MAP$1 = weakMapBasicDetection; var global$Z = global$16; var isObject$F = isObject$K; var createNonEnumerableProperty$j = createNonEnumerableProperty$k; var hasOwn$C = hasOwnProperty_1; var shared$8 = sharedStore; var sharedKey$3 = sharedKey$4; var hiddenKeys$5 = hiddenKeys$6; var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError$9 = global$Z.TypeError; var WeakMap$4 = global$Z.WeakMap; var set$b, get$6, has$d; var enforce = function (it) { return has$d(it) ? get$6(it) : set$b(it, {}); }; var getterFor$2 = function (TYPE) { return function (it) { var state; if (!isObject$F(it) || (state = get$6(it)).type !== TYPE) { throw TypeError$9('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP$1 || shared$8.state) { var store$2 = shared$8.state || (shared$8.state = new WeakMap$4()); /* eslint-disable no-self-assign -- prototype methods protection */ store$2.get = store$2.get; store$2.has = store$2.has; store$2.set = store$2.set; /* eslint-enable no-self-assign -- prototype methods protection */ set$b = function (it, metadata) { if (store$2.has(it)) throw TypeError$9(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store$2.set(it, metadata); return metadata; }; get$6 = function (it) { return store$2.get(it) || {}; }; has$d = function (it) { return store$2.has(it); }; } else { var STATE = sharedKey$3('state'); hiddenKeys$5[STATE] = true; set$b = function (it, metadata) { if (hasOwn$C(it, STATE)) throw TypeError$9(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty$j(it, STATE, metadata); return metadata; }; get$6 = function (it) { return hasOwn$C(it, STATE) ? it[STATE] : {}; }; has$d = function (it) { return hasOwn$C(it, STATE); }; } var internalState = { set: set$b, get: get$6, has: has$d, enforce: enforce, getterFor: getterFor$2 }; var uncurryThis$1N = functionUncurryThis; var fails$1n = fails$1u; var isCallable$C = isCallable$K; var hasOwn$B = hasOwnProperty_1; var DESCRIPTORS$M = descriptors; var CONFIGURABLE_FUNCTION_NAME$2 = functionName.CONFIGURABLE; var inspectSource$3 = inspectSource$4; var InternalStateModule$n = internalState; var enforceInternalState$4 = InternalStateModule$n.enforce; var getInternalState$g = InternalStateModule$n.get; var $String$6 = String; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty$h = Object.defineProperty; var stringSlice$k = uncurryThis$1N(''.slice); var replace$c = uncurryThis$1N(''.replace); var join$9 = uncurryThis$1N([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS$M && !fails$1n(function () { return defineProperty$h(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); var makeBuiltIn$4 = makeBuiltIn$5.exports = function (value, name, options) { if (stringSlice$k($String$6(name), 0, 7) === 'Symbol(') { name = '[' + replace$c($String$6(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; if (!hasOwn$B(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$2 && value.name !== name)) { if (DESCRIPTORS$M) defineProperty$h(value, 'name', { value: name, configurable: true }); else value.name = name; } if (CONFIGURABLE_LENGTH && options && hasOwn$B(options, 'arity') && value.length !== options.arity) { defineProperty$h(value, 'length', { value: options.arity }); } try { if (options && hasOwn$B(options, 'constructor') && options.constructor) { if (DESCRIPTORS$M) defineProperty$h(value, 'prototype', { writable: false }); // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable } else if (value.prototype) value.prototype = undefined; } catch (error) { /* empty */ } var state = enforceInternalState$4(value); if (!hasOwn$B(state, 'source')) { state.source = join$9(TEMPLATE, typeof name == 'string' ? name : ''); } return value; }; // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative // eslint-disable-next-line no-extend-native -- required Function.prototype.toString = makeBuiltIn$4(function toString() { return isCallable$C(this) && getInternalState$g(this).source || inspectSource$3(this); }, 'toString'); var makeBuiltInExports = makeBuiltIn$5.exports; var isCallable$B = isCallable$K; var definePropertyModule$a = objectDefineProperty; var makeBuiltIn$3 = makeBuiltInExports; var defineGlobalProperty$1 = defineGlobalProperty$3; var defineBuiltIn$u = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; if (isCallable$B(value)) makeBuiltIn$3(value, name, options); if (options.global) { if (simple) O[key] = value; else defineGlobalProperty$1(key, value); } else { try { if (!options.unsafe) delete O[key]; else if (O[key]) simple = true; } catch (error) { /* empty */ } if (simple) O[key] = value; else definePropertyModule$a.f(O, key, { value: value, enumerable: false, configurable: !options.nonConfigurable, writable: !options.nonWritable }); } return O; }; var objectGetOwnPropertyNames = {}; var ceil$1 = Math.ceil; var floor$a = Math.floor; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc // eslint-disable-next-line es/no-math-trunc -- safe var mathTrunc = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor$a : ceil$1)(n); }; var trunc$2 = mathTrunc; // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity var toIntegerOrInfinity$p = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check return number !== number || number === 0 ? 0 : trunc$2(number); }; var toIntegerOrInfinity$o = toIntegerOrInfinity$p; var max$a = Math.max; var min$e = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). var toAbsoluteIndex$b = function (index, length) { var integer = toIntegerOrInfinity$o(index); return integer < 0 ? max$a(integer + length, 0) : min$e(integer, length); }; var toIntegerOrInfinity$n = toIntegerOrInfinity$p; var min$d = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength var toLength$d = function (argument) { return argument > 0 ? min$d(toIntegerOrInfinity$n(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; var toLength$c = toLength$d; // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike var lengthOfArrayLike$C = function (obj) { return toLength$c(obj.length); }; var toIndexedObject$i = toIndexedObject$k; var toAbsoluteIndex$a = toAbsoluteIndex$b; var lengthOfArrayLike$B = lengthOfArrayLike$C; // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod$8 = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject$i($this); var length = lengthOfArrayLike$B(O); var index = toAbsoluteIndex$a(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el !== el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check if (value !== value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; var arrayIncludes = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod$8(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod$8(false) }; var uncurryThis$1M = functionUncurryThis; var hasOwn$A = hasOwnProperty_1; var toIndexedObject$h = toIndexedObject$k; var indexOf$2 = arrayIncludes.indexOf; var hiddenKeys$4 = hiddenKeys$6; var push$s = uncurryThis$1M([].push); var objectKeysInternal = function (object, names) { var O = toIndexedObject$h(object); var i = 0; var result = []; var key; for (key in O) !hasOwn$A(hiddenKeys$4, key) && hasOwn$A(O, key) && push$s(result, key); // Don't enum bug & hidden keys while (names.length > i) if (hasOwn$A(O, key = names[i++])) { ~indexOf$2(result, key) || push$s(result, key); } return result; }; // IE8- don't enum bug keys var enumBugKeys$3 = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var internalObjectKeys$1 = objectKeysInternal; var enumBugKeys$2 = enumBugKeys$3; var hiddenKeys$3 = enumBugKeys$2.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames // eslint-disable-next-line es/no-object-getownpropertynames -- safe objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys$1(O, hiddenKeys$3); }; var objectGetOwnPropertySymbols = {}; // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols; var getBuiltIn$K = getBuiltIn$M; var uncurryThis$1L = functionUncurryThis; var getOwnPropertyNamesModule$2 = objectGetOwnPropertyNames; var getOwnPropertySymbolsModule$3 = objectGetOwnPropertySymbols; var anObject$1d = anObject$1f; var concat$4 = uncurryThis$1L([].concat); // all object keys, includes non-enumerable and symbols var ownKeys$3 = getBuiltIn$K('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule$2.f(anObject$1d(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule$3.f; return getOwnPropertySymbols ? concat$4(keys, getOwnPropertySymbols(it)) : keys; }; var hasOwn$z = hasOwnProperty_1; var ownKeys$2 = ownKeys$3; var getOwnPropertyDescriptorModule$6 = objectGetOwnPropertyDescriptor; var definePropertyModule$9 = objectDefineProperty; var copyConstructorProperties$6 = function (target, source, exceptions) { var keys = ownKeys$2(source); var defineProperty = definePropertyModule$9.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$6.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!hasOwn$z(target, key) && !(exceptions && hasOwn$z(exceptions, key))) { defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } }; var fails$1m = fails$1u; var isCallable$A = isCallable$K; var replacement = /#|\.prototype\./; var isForced$5 = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false : isCallable$A(detection) ? fails$1m(detection) : !!detection; }; var normalize = isForced$5.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced$5.data = {}; var NATIVE = isForced$5.NATIVE = 'N'; var POLYFILL = isForced$5.POLYFILL = 'P'; var isForced_1 = isForced$5; var global$Y = global$16; var getOwnPropertyDescriptor$d = objectGetOwnPropertyDescriptor.f; var createNonEnumerableProperty$i = createNonEnumerableProperty$k; var defineBuiltIn$t = defineBuiltIn$u; var defineGlobalProperty = defineGlobalProperty$3; var copyConstructorProperties$5 = copyConstructorProperties$6; var isForced$4 = isForced_1; /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.dontCallGetSet - prevent calling a getter on target options.name - the .name of the function if it does not match the key */ var _export = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global$Y; } else if (STATIC) { target = global$Y[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = (global$Y[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor$d(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced$4(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties$5(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty$i(sourceProperty, 'sham', true); } defineBuiltIn$t(target, key, sourceProperty, options); } }; var wellKnownSymbol$R = wellKnownSymbol$T; var TO_STRING_TAG$c = wellKnownSymbol$R('toStringTag'); var test$2 = {}; test$2[TO_STRING_TAG$c] = 'z'; var toStringTagSupport = String(test$2) === '[object z]'; var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport; var isCallable$z = isCallable$K; var classofRaw$1 = classofRaw$2; var wellKnownSymbol$Q = wellKnownSymbol$T; var TO_STRING_TAG$b = wellKnownSymbol$Q('toStringTag'); var $Object$5 = Object; // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` var classof$q = TO_STRING_TAG_SUPPORT$2 ? classofRaw$1 : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = $Object$5(it), TO_STRING_TAG$b)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw$1(O) // ES3 arguments fallback : (result = classofRaw$1(O)) === 'Object' && isCallable$z(O.callee) ? 'Arguments' : result; }; var classof$p = classof$q; var $String$5 = String; var toString$I = function (argument) { if (classof$p(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); return $String$5(argument); }; var objectDefineProperties = {}; var internalObjectKeys = objectKeysInternal; var enumBugKeys$1 = enumBugKeys$3; // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe var objectKeys$6 = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys$1); }; var DESCRIPTORS$L = descriptors; var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug; var definePropertyModule$8 = objectDefineProperty; var anObject$1c = anObject$1f; var toIndexedObject$g = toIndexedObject$k; var objectKeys$5 = objectKeys$6; // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe objectDefineProperties.f = DESCRIPTORS$L && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { anObject$1c(O); var props = toIndexedObject$g(Properties); var keys = objectKeys$5(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule$8.f(O, key = keys[index++], props[key]); return O; }; var getBuiltIn$J = getBuiltIn$M; var html$2 = getBuiltIn$J('document', 'documentElement'); /* global ActiveXObject -- old IE, WSH */ var anObject$1b = anObject$1f; var definePropertiesModule$1 = objectDefineProperties; var enumBugKeys = enumBugKeys$3; var hiddenKeys$2 = hiddenKeys$6; var html$1 = html$2; var documentCreateElement$1 = documentCreateElement$2; var sharedKey$2 = sharedKey$4; var GT = '>'; var LT = '<'; var PROTOTYPE$2 = 'prototype'; var SCRIPT = 'script'; var IE_PROTO$1 = sharedKey$2('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; // avoid memory leak return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement$1('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html$1.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE$2][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys$2[IE_PROTO$1] = true; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create // eslint-disable-next-line es/no-object-create -- safe var objectCreate$1 = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE$2] = anObject$1b(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE$2] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO$1] = O; } else result = NullProtoObject(); return Properties === undefined ? result : definePropertiesModule$1.f(result, Properties); }; var objectGetOwnPropertyNamesExternal = {}; var toPropertyKey$7 = toPropertyKey$a; var definePropertyModule$7 = objectDefineProperty; var createPropertyDescriptor$a = createPropertyDescriptor$d; var createProperty$b = function (object, key, value) { var propertyKey = toPropertyKey$7(key); if (propertyKey in object) definePropertyModule$7.f(object, propertyKey, createPropertyDescriptor$a(0, value)); else object[propertyKey] = value; }; var toAbsoluteIndex$9 = toAbsoluteIndex$b; var lengthOfArrayLike$A = lengthOfArrayLike$C; var createProperty$a = createProperty$b; var $Array$c = Array; var max$9 = Math.max; var arraySliceSimple = function (O, start, end) { var length = lengthOfArrayLike$A(O); var k = toAbsoluteIndex$9(start, length); var fin = toAbsoluteIndex$9(end === undefined ? length : end, length); var result = $Array$c(max$9(fin - k, 0)); var n = 0; for (; k < fin; k++, n++) createProperty$a(result, n, O[k]); result.length = n; return result; }; /* eslint-disable es/no-object-getownpropertynames -- safe */ var classof$o = classofRaw$2; var toIndexedObject$f = toIndexedObject$k; var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f; var arraySlice$c = arraySliceSimple; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return $getOwnPropertyNames$1(it); } catch (error) { return arraySlice$c(windowNames); } }; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames(it) { return windowNames && classof$o(it) === 'Window' ? getWindowNames(it) : $getOwnPropertyNames$1(toIndexedObject$f(it)); }; var makeBuiltIn$2 = makeBuiltInExports; var defineProperty$g = objectDefineProperty; var defineBuiltInAccessor$o = function (target, name, descriptor) { if (descriptor.get) makeBuiltIn$2(descriptor.get, name, { getter: true }); if (descriptor.set) makeBuiltIn$2(descriptor.set, name, { setter: true }); return defineProperty$g.f(target, name, descriptor); }; var wellKnownSymbolWrapped = {}; var wellKnownSymbol$P = wellKnownSymbol$T; wellKnownSymbolWrapped.f = wellKnownSymbol$P; var global$X = global$16; var path$2 = global$X; var path$1 = path$2; var hasOwn$y = hasOwnProperty_1; var wrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped; var defineProperty$f = objectDefineProperty.f; var wellKnownSymbolDefine = function (NAME) { var Symbol = path$1.Symbol || (path$1.Symbol = {}); if (!hasOwn$y(Symbol, NAME)) defineProperty$f(Symbol, NAME, { value: wrappedWellKnownSymbolModule$1.f(NAME) }); }; var call$1e = functionCall; var getBuiltIn$I = getBuiltIn$M; var wellKnownSymbol$O = wellKnownSymbol$T; var defineBuiltIn$s = defineBuiltIn$u; var symbolDefineToPrimitive = function () { var Symbol = getBuiltIn$I('Symbol'); var SymbolPrototype = Symbol && Symbol.prototype; var valueOf = SymbolPrototype && SymbolPrototype.valueOf; var TO_PRIMITIVE = wellKnownSymbol$O('toPrimitive'); if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) { // `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive // eslint-disable-next-line no-unused-vars -- required for .length defineBuiltIn$s(SymbolPrototype, TO_PRIMITIVE, function (hint) { return call$1e(valueOf, this); }, { arity: 1 }); } }; var defineProperty$e = objectDefineProperty.f; var hasOwn$x = hasOwnProperty_1; var wellKnownSymbol$N = wellKnownSymbol$T; var TO_STRING_TAG$a = wellKnownSymbol$N('toStringTag'); var setToStringTag$d = function (target, TAG, STATIC) { if (target && !STATIC) target = target.prototype; if (target && !hasOwn$x(target, TO_STRING_TAG$a)) { defineProperty$e(target, TO_STRING_TAG$a, { configurable: true, value: TAG }); } }; var classofRaw = classofRaw$2; var uncurryThis$1K = functionUncurryThis; var functionUncurryThisClause = function (fn) { // Nashorn bug: // https://github.com/zloirock/core-js/issues/1128 // https://github.com/zloirock/core-js/issues/1130 if (classofRaw(fn) === 'Function') return uncurryThis$1K(fn); }; var uncurryThis$1J = functionUncurryThisClause; var aCallable$L = aCallable$N; var NATIVE_BIND$2 = functionBindNative; var bind$v = uncurryThis$1J(uncurryThis$1J.bind); // optional / simple context binding var functionBindContext = function (fn, that) { aCallable$L(fn); return that === undefined ? fn : NATIVE_BIND$2 ? bind$v(fn, that) : function (/* ...args */) { return fn.apply(that, arguments); }; }; var classof$n = classofRaw$2; // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray // eslint-disable-next-line es/no-array-isarray -- safe var isArray$b = Array.isArray || function isArray(argument) { return classof$n(argument) === 'Array'; }; var uncurryThis$1I = functionUncurryThis; var fails$1l = fails$1u; var isCallable$y = isCallable$K; var classof$m = classof$q; var getBuiltIn$H = getBuiltIn$M; var inspectSource$2 = inspectSource$4; var noop = function () { /* empty */ }; var empty = []; var construct$1 = getBuiltIn$H('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec$g = uncurryThis$1I(constructorRegExp.exec); var INCORRECT_TO_STRING$2 = !constructorRegExp.exec(noop); var isConstructorModern = function isConstructor(argument) { if (!isCallable$y(argument)) return false; try { construct$1(noop, empty, argument); return true; } catch (error) { return false; } }; var isConstructorLegacy = function isConstructor(argument) { if (!isCallable$y(argument)) return false; switch (classof$m(argument)) { case 'AsyncFunction': case 'GeneratorFunction': case 'AsyncGeneratorFunction': return false; } try { // we can't check .prototype since constructors produced by .bind haven't it // `Function#toString` throws on some built-it function in some legacy engines // (for example, `DOMQuad` and similar in FF41-) return INCORRECT_TO_STRING$2 || !!exec$g(constructorRegExp, inspectSource$2(argument)); } catch (error) { return true; } }; isConstructorLegacy.sham = true; // `IsConstructor` abstract operation // https://tc39.es/ecma262/#sec-isconstructor var isConstructor$a = !construct$1 || fails$1l(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { called = true; }) || called; }) ? isConstructorLegacy : isConstructorModern; var isArray$a = isArray$b; var isConstructor$9 = isConstructor$a; var isObject$E = isObject$K; var wellKnownSymbol$M = wellKnownSymbol$T; var SPECIES$6 = wellKnownSymbol$M('species'); var $Array$b = Array; // a part of `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate var arraySpeciesConstructor$1 = function (originalArray) { var C; if (isArray$a(originalArray)) { C = originalArray.constructor; // cross-realm fallback if (isConstructor$9(C) && (C === $Array$b || isArray$a(C.prototype))) C = undefined; else if (isObject$E(C)) { C = C[SPECIES$6]; if (C === null) C = undefined; } } return C === undefined ? $Array$b : C; }; var arraySpeciesConstructor = arraySpeciesConstructor$1; // `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate var arraySpeciesCreate$5 = function (originalArray, length) { return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; var bind$u = functionBindContext; var uncurryThis$1H = functionUncurryThis; var IndexedObject$6 = indexedObject; var toObject$B = toObject$D; var lengthOfArrayLike$z = lengthOfArrayLike$C; var arraySpeciesCreate$4 = arraySpeciesCreate$5; var push$r = uncurryThis$1H([].push); // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation var createMethod$7 = function (TYPE) { var IS_MAP = TYPE === 1; var IS_FILTER = TYPE === 2; var IS_SOME = TYPE === 3; var IS_EVERY = TYPE === 4; var IS_FIND_INDEX = TYPE === 6; var IS_FILTER_REJECT = TYPE === 7; var NO_HOLES = TYPE === 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { var O = toObject$B($this); var self = IndexedObject$6(O); var boundFunction = bind$u(callbackfn, that); var length = lengthOfArrayLike$z(self); var index = 0; var create = specificCreate || arraySpeciesCreate$4; var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined; var value, result; for (;length > index; index++) if (NO_HOLES || index in self) { value = self[index]; result = boundFunction(value, index, O); if (TYPE) { if (IS_MAP) target[index] = result; // map else if (result) switch (TYPE) { case 3: return true; // some case 5: return value; // find case 6: return index; // findIndex case 2: push$r(target, value); // filter } else switch (TYPE) { case 4: return false; // every case 7: push$r(target, value); // filterReject } } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; var arrayIteration = { // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach forEach: createMethod$7(0), // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map map: createMethod$7(1), // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter filter: createMethod$7(2), // `Array.prototype.some` method // https://tc39.es/ecma262/#sec-array.prototype.some some: createMethod$7(3), // `Array.prototype.every` method // https://tc39.es/ecma262/#sec-array.prototype.every every: createMethod$7(4), // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find find: createMethod$7(5), // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findIndex findIndex: createMethod$7(6), // `Array.prototype.filterReject` method // https://github.com/tc39/proposal-array-filtering filterReject: createMethod$7(7) }; var $$5q = _export; var global$W = global$16; var call$1d = functionCall; var uncurryThis$1G = functionUncurryThis; var DESCRIPTORS$K = descriptors; var NATIVE_SYMBOL$5 = symbolConstructorDetection; var fails$1k = fails$1u; var hasOwn$w = hasOwnProperty_1; var isPrototypeOf$d = objectIsPrototypeOf; var anObject$1a = anObject$1f; var toIndexedObject$e = toIndexedObject$k; var toPropertyKey$6 = toPropertyKey$a; var $toString$3 = toString$I; var createPropertyDescriptor$9 = createPropertyDescriptor$d; var nativeObjectCreate = objectCreate$1; var objectKeys$4 = objectKeys$6; var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames; var getOwnPropertyNamesExternal = objectGetOwnPropertyNamesExternal; var getOwnPropertySymbolsModule$2 = objectGetOwnPropertySymbols; var getOwnPropertyDescriptorModule$5 = objectGetOwnPropertyDescriptor; var definePropertyModule$6 = objectDefineProperty; var definePropertiesModule = objectDefineProperties; var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable; var defineBuiltIn$r = defineBuiltIn$u; var defineBuiltInAccessor$n = defineBuiltInAccessor$o; var shared$7 = sharedExports; var sharedKey$1 = sharedKey$4; var hiddenKeys$1 = hiddenKeys$6; var uid$4 = uid$7; var wellKnownSymbol$L = wellKnownSymbol$T; var wrappedWellKnownSymbolModule = wellKnownSymbolWrapped; var defineWellKnownSymbol$l = wellKnownSymbolDefine; var defineSymbolToPrimitive$1 = symbolDefineToPrimitive; var setToStringTag$c = setToStringTag$d; var InternalStateModule$m = internalState; var $forEach$3 = arrayIteration.forEach; var HIDDEN = sharedKey$1('hidden'); var SYMBOL = 'Symbol'; var PROTOTYPE$1 = 'prototype'; var setInternalState$m = InternalStateModule$m.set; var getInternalState$f = InternalStateModule$m.getterFor(SYMBOL); var ObjectPrototype$5 = Object[PROTOTYPE$1]; var $Symbol = global$W.Symbol; var SymbolPrototype$1 = $Symbol && $Symbol[PROTOTYPE$1]; var TypeError$8 = global$W.TypeError; var QObject = global$W.QObject; var nativeGetOwnPropertyDescriptor$2 = getOwnPropertyDescriptorModule$5.f; var nativeDefineProperty$1 = definePropertyModule$6.f; var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; var nativePropertyIsEnumerable = propertyIsEnumerableModule$1.f; var push$q = uncurryThis$1G([].push); var AllSymbols = shared$7('symbols'); var ObjectPrototypeSymbols = shared$7('op-symbols'); var WellKnownSymbolsStore$1 = shared$7('wks'); // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDescriptor = DESCRIPTORS$K && fails$1k(function () { return nativeObjectCreate(nativeDefineProperty$1({}, 'a', { get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; } })).a !== 7; }) ? function (O, P, Attributes) { var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$2(ObjectPrototype$5, P); if (ObjectPrototypeDescriptor) delete ObjectPrototype$5[P]; nativeDefineProperty$1(O, P, Attributes); if (ObjectPrototypeDescriptor && O !== ObjectPrototype$5) { nativeDefineProperty$1(ObjectPrototype$5, P, ObjectPrototypeDescriptor); } } : nativeDefineProperty$1; var wrap = function (tag, description) { var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype$1); setInternalState$m(symbol, { type: SYMBOL, tag: tag, description: description }); if (!DESCRIPTORS$K) symbol.description = description; return symbol; }; var $defineProperty = function defineProperty(O, P, Attributes) { if (O === ObjectPrototype$5) $defineProperty(ObjectPrototypeSymbols, P, Attributes); anObject$1a(O); var key = toPropertyKey$6(P); anObject$1a(Attributes); if (hasOwn$w(AllSymbols, key)) { if (!Attributes.enumerable) { if (!hasOwn$w(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor$9(1, {})); O[HIDDEN][key] = true; } else { if (hasOwn$w(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor$9(0, false) }); } return setSymbolDescriptor(O, key, Attributes); } return nativeDefineProperty$1(O, key, Attributes); }; var $defineProperties = function defineProperties(O, Properties) { anObject$1a(O); var properties = toIndexedObject$e(Properties); var keys = objectKeys$4(properties).concat($getOwnPropertySymbols(properties)); $forEach$3(keys, function (key) { if (!DESCRIPTORS$K || call$1d($propertyIsEnumerable$1, properties, key)) $defineProperty(O, key, properties[key]); }); return O; }; var $create = function create(O, Properties) { return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); }; var $propertyIsEnumerable$1 = function propertyIsEnumerable(V) { var P = toPropertyKey$6(V); var enumerable = call$1d(nativePropertyIsEnumerable, this, P); if (this === ObjectPrototype$5 && hasOwn$w(AllSymbols, P) && !hasOwn$w(ObjectPrototypeSymbols, P)) return false; return enumerable || !hasOwn$w(this, P) || !hasOwn$w(AllSymbols, P) || hasOwn$w(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { var it = toIndexedObject$e(O); var key = toPropertyKey$6(P); if (it === ObjectPrototype$5 && hasOwn$w(AllSymbols, key) && !hasOwn$w(ObjectPrototypeSymbols, key)) return; var descriptor = nativeGetOwnPropertyDescriptor$2(it, key); if (descriptor && hasOwn$w(AllSymbols, key) && !(hasOwn$w(it, HIDDEN) && it[HIDDEN][key])) { descriptor.enumerable = true; } return descriptor; }; var $getOwnPropertyNames = function getOwnPropertyNames(O) { var names = nativeGetOwnPropertyNames(toIndexedObject$e(O)); var result = []; $forEach$3(names, function (key) { if (!hasOwn$w(AllSymbols, key) && !hasOwn$w(hiddenKeys$1, key)) push$q(result, key); }); return result; }; var $getOwnPropertySymbols = function (O) { var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$5; var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject$e(O)); var result = []; $forEach$3(names, function (key) { if (hasOwn$w(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn$w(ObjectPrototype$5, key))) { push$q(result, AllSymbols[key]); } }); return result; }; // `Symbol` constructor // https://tc39.es/ecma262/#sec-symbol-constructor if (!NATIVE_SYMBOL$5) { $Symbol = function Symbol() { if (isPrototypeOf$d(SymbolPrototype$1, this)) throw TypeError$8('Symbol is not a constructor'); var description = !arguments.length || arguments[0] === undefined ? undefined : $toString$3(arguments[0]); var tag = uid$4(description); var setter = function (value) { if (this === ObjectPrototype$5) call$1d(setter, ObjectPrototypeSymbols, value); if (hasOwn$w(this, HIDDEN) && hasOwn$w(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDescriptor(this, tag, createPropertyDescriptor$9(1, value)); }; if (DESCRIPTORS$K && USE_SETTER) setSymbolDescriptor(ObjectPrototype$5, tag, { configurable: true, set: setter }); return wrap(tag, description); }; SymbolPrototype$1 = $Symbol[PROTOTYPE$1]; defineBuiltIn$r(SymbolPrototype$1, 'toString', function toString() { return getInternalState$f(this).tag; }); defineBuiltIn$r($Symbol, 'withoutSetter', function (description) { return wrap(uid$4(description), description); }); propertyIsEnumerableModule$1.f = $propertyIsEnumerable$1; definePropertyModule$6.f = $defineProperty; definePropertiesModule.f = $defineProperties; getOwnPropertyDescriptorModule$5.f = $getOwnPropertyDescriptor; getOwnPropertyNamesModule$1.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; getOwnPropertySymbolsModule$2.f = $getOwnPropertySymbols; wrappedWellKnownSymbolModule.f = function (name) { return wrap(wellKnownSymbol$L(name), name); }; if (DESCRIPTORS$K) { // https://github.com/tc39/proposal-Symbol-description defineBuiltInAccessor$n(SymbolPrototype$1, 'description', { configurable: true, get: function description() { return getInternalState$f(this).description; } }); { defineBuiltIn$r(ObjectPrototype$5, 'propertyIsEnumerable', $propertyIsEnumerable$1, { unsafe: true }); } } } $$5q({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL$5, sham: !NATIVE_SYMBOL$5 }, { Symbol: $Symbol }); $forEach$3(objectKeys$4(WellKnownSymbolsStore$1), function (name) { defineWellKnownSymbol$l(name); }); $$5q({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL$5 }, { useSetter: function () { USE_SETTER = true; }, useSimple: function () { USE_SETTER = false; } }); $$5q({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$5, sham: !DESCRIPTORS$K }, { // `Object.create` method // https://tc39.es/ecma262/#sec-object.create create: $create, // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty defineProperty: $defineProperty, // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties defineProperties: $defineProperties, // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors getOwnPropertyDescriptor: $getOwnPropertyDescriptor }); $$5q({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$5 }, { // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames getOwnPropertyNames: $getOwnPropertyNames }); // `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive defineSymbolToPrimitive$1(); // `Symbol.prototype[@@toStringTag]` property // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag setToStringTag$c($Symbol, SYMBOL); hiddenKeys$1[HIDDEN] = true; var NATIVE_SYMBOL$4 = symbolConstructorDetection; /* eslint-disable es/no-symbol -- safe */ var symbolRegistryDetection = NATIVE_SYMBOL$4 && !!Symbol['for'] && !!Symbol.keyFor; var $$5p = _export; var getBuiltIn$G = getBuiltIn$M; var hasOwn$v = hasOwnProperty_1; var toString$H = toString$I; var shared$6 = sharedExports; var NATIVE_SYMBOL_REGISTRY$1 = symbolRegistryDetection; var StringToSymbolRegistry = shared$6('string-to-symbol-registry'); var SymbolToStringRegistry$1 = shared$6('symbol-to-string-registry'); // `Symbol.for` method // https://tc39.es/ecma262/#sec-symbol.for $$5p({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY$1 }, { 'for': function (key) { var string = toString$H(key); if (hasOwn$v(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; var symbol = getBuiltIn$G('Symbol')(string); StringToSymbolRegistry[string] = symbol; SymbolToStringRegistry$1[symbol] = string; return symbol; } }); var $$5o = _export; var hasOwn$u = hasOwnProperty_1; var isSymbol$5 = isSymbol$8; var tryToString$5 = tryToString$7; var shared$5 = sharedExports; var NATIVE_SYMBOL_REGISTRY = symbolRegistryDetection; var SymbolToStringRegistry = shared$5('symbol-to-string-registry'); // `Symbol.keyFor` method // https://tc39.es/ecma262/#sec-symbol.keyfor $$5o({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { keyFor: function keyFor(sym) { if (!isSymbol$5(sym)) throw TypeError(tryToString$5(sym) + ' is not a symbol'); if (hasOwn$u(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; } }); var NATIVE_BIND$1 = functionBindNative; var FunctionPrototype$3 = Function.prototype; var apply$e = FunctionPrototype$3.apply; var call$1c = FunctionPrototype$3.call; // eslint-disable-next-line es/no-reflect -- safe var functionApply$1 = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$1c.bind(apply$e) : function () { return call$1c.apply(apply$e, arguments); }); var uncurryThis$1F = functionUncurryThis; var arraySlice$b = uncurryThis$1F([].slice); var uncurryThis$1E = functionUncurryThis; var isArray$9 = isArray$b; var isCallable$x = isCallable$K; var classof$l = classofRaw$2; var toString$G = toString$I; var push$p = uncurryThis$1E([].push); var getJsonReplacerFunction = function (replacer) { if (isCallable$x(replacer)) return replacer; if (!isArray$9(replacer)) return; var rawLength = replacer.length; var keys = []; for (var i = 0; i < rawLength; i++) { var element = replacer[i]; if (typeof element == 'string') push$p(keys, element); else if (typeof element == 'number' || classof$l(element) === 'Number' || classof$l(element) === 'String') push$p(keys, toString$G(element)); } var keysLength = keys.length; var root = true; return function (key, value) { if (root) { root = false; return value; } if (isArray$9(this)) return value; for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value; }; }; var $$5n = _export; var getBuiltIn$F = getBuiltIn$M; var apply$d = functionApply$1; var call$1b = functionCall; var uncurryThis$1D = functionUncurryThis; var fails$1j = fails$1u; var isCallable$w = isCallable$K; var isSymbol$4 = isSymbol$8; var arraySlice$a = arraySlice$b; var getReplacerFunction$1 = getJsonReplacerFunction; var NATIVE_SYMBOL$3 = symbolConstructorDetection; var $String$4 = String; var $stringify$1 = getBuiltIn$F('JSON', 'stringify'); var exec$f = uncurryThis$1D(/./.exec); var charAt$k = uncurryThis$1D(''.charAt); var charCodeAt$8 = uncurryThis$1D(''.charCodeAt); var replace$b = uncurryThis$1D(''.replace); var numberToString$3 = uncurryThis$1D(1.0.toString); var tester = /[\uD800-\uDFFF]/g; var low = /^[\uD800-\uDBFF]$/; var hi = /^[\uDC00-\uDFFF]$/; var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL$3 || fails$1j(function () { var symbol = getBuiltIn$F('Symbol')('stringify detection'); // MS Edge converts symbol values to JSON as {} return $stringify$1([symbol]) !== '[null]' // WebKit converts symbol values to JSON as null || $stringify$1({ a: symbol }) !== '{}' // V8 throws on boxed symbols || $stringify$1(Object(symbol)) !== '{}'; }); // https://github.com/tc39/proposal-well-formed-stringify var ILL_FORMED_UNICODE = fails$1j(function () { return $stringify$1('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify$1('\uDEAD') !== '"\\udead"'; }); var stringifyWithSymbolsFix = function (it, replacer) { var args = arraySlice$a(arguments); var $replacer = getReplacerFunction$1(replacer); if (!isCallable$w($replacer) && (it === undefined || isSymbol$4(it))) return; // IE8 returns string on undefined args[1] = function (key, value) { // some old implementations (like WebKit) could pass numbers as keys if (isCallable$w($replacer)) value = call$1b($replacer, this, $String$4(key), value); if (!isSymbol$4(value)) return value; }; return apply$d($stringify$1, null, args); }; var fixIllFormed = function (match, offset, string) { var prev = charAt$k(string, offset - 1); var next = charAt$k(string, offset + 1); if ((exec$f(low, match) && !exec$f(hi, next)) || (exec$f(hi, match) && !exec$f(low, prev))) { return '\\u' + numberToString$3(charCodeAt$8(match, 0), 16); } return match; }; if ($stringify$1) { // `JSON.stringify` method // https://tc39.es/ecma262/#sec-json.stringify $$5n({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { // eslint-disable-next-line no-unused-vars -- required for `.length` stringify: function stringify(it, replacer, space) { var args = arraySlice$a(arguments); var result = apply$d(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify$1, null, args); return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$b(result, tester, fixIllFormed) : result; } }); } var $$5m = _export; var NATIVE_SYMBOL$2 = symbolConstructorDetection; var fails$1i = fails$1u; var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols; var toObject$A = toObject$D; // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 var FORCED$E = !NATIVE_SYMBOL$2 || fails$1i(function () { getOwnPropertySymbolsModule$1.f(1); }); // `Object.getOwnPropertySymbols` method // https://tc39.es/ecma262/#sec-object.getownpropertysymbols $$5m({ target: 'Object', stat: true, forced: FORCED$E }, { getOwnPropertySymbols: function getOwnPropertySymbols(it) { var $getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f; return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject$A(it)) : []; } }); var $$5l = _export; var DESCRIPTORS$J = descriptors; var global$V = global$16; var uncurryThis$1C = functionUncurryThis; var hasOwn$t = hasOwnProperty_1; var isCallable$v = isCallable$K; var isPrototypeOf$c = objectIsPrototypeOf; var toString$F = toString$I; var defineBuiltInAccessor$m = defineBuiltInAccessor$o; var copyConstructorProperties$4 = copyConstructorProperties$6; var NativeSymbol = global$V.Symbol; var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; if (DESCRIPTORS$J && isCallable$v(NativeSymbol) && (!('description' in SymbolPrototype) || // Safari 12 bug NativeSymbol().description !== undefined )) { var EmptyStringDescriptionStore = {}; // wrap Symbol constructor for correct work with undefined description var SymbolWrapper = function Symbol() { var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$F(arguments[0]); var result = isPrototypeOf$c(SymbolPrototype, this) ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' : description === undefined ? NativeSymbol() : NativeSymbol(description); if (description === '') EmptyStringDescriptionStore[result] = true; return result; }; copyConstructorProperties$4(SymbolWrapper, NativeSymbol); SymbolWrapper.prototype = SymbolPrototype; SymbolPrototype.constructor = SymbolWrapper; var NATIVE_SYMBOL$1 = String(NativeSymbol('description detection')) === 'Symbol(description detection)'; var thisSymbolValue$2 = uncurryThis$1C(SymbolPrototype.valueOf); var symbolDescriptiveString = uncurryThis$1C(SymbolPrototype.toString); var regexp = /^Symbol\((.*)\)[^)]+$/; var replace$a = uncurryThis$1C(''.replace); var stringSlice$j = uncurryThis$1C(''.slice); defineBuiltInAccessor$m(SymbolPrototype, 'description', { configurable: true, get: function description() { var symbol = thisSymbolValue$2(this); if (hasOwn$t(EmptyStringDescriptionStore, symbol)) return ''; var string = symbolDescriptiveString(symbol); var desc = NATIVE_SYMBOL$1 ? stringSlice$j(string, 7, -1) : replace$a(string, regexp, '$1'); return desc === '' ? undefined : desc; } }); $$5l({ global: true, constructor: true, forced: true }, { Symbol: SymbolWrapper }); } var defineWellKnownSymbol$k = wellKnownSymbolDefine; // `Symbol.asyncIterator` well-known symbol // https://tc39.es/ecma262/#sec-symbol.asynciterator defineWellKnownSymbol$k('asyncIterator'); var defineWellKnownSymbol$j = wellKnownSymbolDefine; // `Symbol.hasInstance` well-known symbol // https://tc39.es/ecma262/#sec-symbol.hasinstance defineWellKnownSymbol$j('hasInstance'); var defineWellKnownSymbol$i = wellKnownSymbolDefine; // `Symbol.isConcatSpreadable` well-known symbol // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable defineWellKnownSymbol$i('isConcatSpreadable'); var defineWellKnownSymbol$h = wellKnownSymbolDefine; // `Symbol.iterator` well-known symbol // https://tc39.es/ecma262/#sec-symbol.iterator defineWellKnownSymbol$h('iterator'); var defineWellKnownSymbol$g = wellKnownSymbolDefine; // `Symbol.match` well-known symbol // https://tc39.es/ecma262/#sec-symbol.match defineWellKnownSymbol$g('match'); var defineWellKnownSymbol$f = wellKnownSymbolDefine; // `Symbol.matchAll` well-known symbol // https://tc39.es/ecma262/#sec-symbol.matchall defineWellKnownSymbol$f('matchAll'); var defineWellKnownSymbol$e = wellKnownSymbolDefine; // `Symbol.replace` well-known symbol // https://tc39.es/ecma262/#sec-symbol.replace defineWellKnownSymbol$e('replace'); var defineWellKnownSymbol$d = wellKnownSymbolDefine; // `Symbol.search` well-known symbol // https://tc39.es/ecma262/#sec-symbol.search defineWellKnownSymbol$d('search'); var defineWellKnownSymbol$c = wellKnownSymbolDefine; // `Symbol.species` well-known symbol // https://tc39.es/ecma262/#sec-symbol.species defineWellKnownSymbol$c('species'); var defineWellKnownSymbol$b = wellKnownSymbolDefine; // `Symbol.split` well-known symbol // https://tc39.es/ecma262/#sec-symbol.split defineWellKnownSymbol$b('split'); var defineWellKnownSymbol$a = wellKnownSymbolDefine; var defineSymbolToPrimitive = symbolDefineToPrimitive; // `Symbol.toPrimitive` well-known symbol // https://tc39.es/ecma262/#sec-symbol.toprimitive defineWellKnownSymbol$a('toPrimitive'); // `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive defineSymbolToPrimitive(); var getBuiltIn$E = getBuiltIn$M; var defineWellKnownSymbol$9 = wellKnownSymbolDefine; var setToStringTag$b = setToStringTag$d; // `Symbol.toStringTag` well-known symbol // https://tc39.es/ecma262/#sec-symbol.tostringtag defineWellKnownSymbol$9('toStringTag'); // `Symbol.prototype[@@toStringTag]` property // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag setToStringTag$b(getBuiltIn$E('Symbol'), 'Symbol'); var defineWellKnownSymbol$8 = wellKnownSymbolDefine; // `Symbol.unscopables` well-known symbol // https://tc39.es/ecma262/#sec-symbol.unscopables defineWellKnownSymbol$8('unscopables'); var uncurryThis$1B = functionUncurryThis; var aCallable$K = aCallable$N; var functionUncurryThisAccessor = function (object, key, method) { try { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe return uncurryThis$1B(aCallable$K(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { /* empty */ } }; var isCallable$u = isCallable$K; var $String$3 = String; var $TypeError$C = TypeError; var aPossiblePrototype$2 = function (argument) { if (typeof argument == 'object' || isCallable$u(argument)) return argument; throw $TypeError$C("Can't set " + $String$3(argument) + ' as a prototype'); }; /* eslint-disable no-proto -- safe */ var uncurryThisAccessor$3 = functionUncurryThisAccessor; var anObject$19 = anObject$1f; var aPossiblePrototype$1 = aPossiblePrototype$2; // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. // eslint-disable-next-line es/no-object-setprototypeof -- safe var objectSetPrototypeOf$1 = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = uncurryThisAccessor$3(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { anObject$19(O); aPossiblePrototype$1(proto); if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); var defineProperty$d = objectDefineProperty.f; var proxyAccessor$2 = function (Target, Source, key) { key in Target || defineProperty$d(Target, key, { configurable: true, get: function () { return Source[key]; }, set: function (it) { Source[key] = it; } }); }; var isCallable$t = isCallable$K; var isObject$D = isObject$K; var setPrototypeOf$a = objectSetPrototypeOf$1; // makes subclassing work correct for wrapped built-ins var inheritIfRequired$6 = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; if ( // it can work only with native `setPrototypeOf` setPrototypeOf$a && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this isCallable$t(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject$D(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf$a($this, NewTargetPrototype); return $this; }; var toString$E = toString$I; var normalizeStringArgument$6 = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString$E(argument); }; var isObject$C = isObject$K; var createNonEnumerableProperty$h = createNonEnumerableProperty$k; // `InstallErrorCause` abstract operation // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause var installErrorCause$2 = function (O, options) { if (isObject$C(options) && 'cause' in options) { createNonEnumerableProperty$h(O, 'cause', options.cause); } }; var uncurryThis$1A = functionUncurryThis; var $Error$2 = Error; var replace$9 = uncurryThis$1A(''.replace); var TEST = (function (arg) { return String($Error$2(arg).stack); })('zxcasd'); // eslint-disable-next-line redos/no-vulnerable -- safe var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); var errorStackClear = function (stack, dropEntries) { if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error$2.prepareStackTrace) { while (dropEntries--) stack = replace$9(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); } return stack; }; var fails$1h = fails$1u; var createPropertyDescriptor$8 = createPropertyDescriptor$d; var errorStackInstallable = !fails$1h(function () { var error = Error('a'); if (!('stack' in error)) return true; // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(error, 'stack', createPropertyDescriptor$8(1, 7)); return error.stack !== 7; }); var createNonEnumerableProperty$g = createNonEnumerableProperty$k; var clearErrorStack$2 = errorStackClear; var ERROR_STACK_INSTALLABLE$1 = errorStackInstallable; // non-standard V8 var captureStackTrace = Error.captureStackTrace; var errorStackInstall = function (error, C, stack, dropEntries) { if (ERROR_STACK_INSTALLABLE$1) { if (captureStackTrace) captureStackTrace(error, C); else createNonEnumerableProperty$g(error, 'stack', clearErrorStack$2(stack, dropEntries)); } }; var getBuiltIn$D = getBuiltIn$M; var hasOwn$s = hasOwnProperty_1; var createNonEnumerableProperty$f = createNonEnumerableProperty$k; var isPrototypeOf$b = objectIsPrototypeOf; var setPrototypeOf$9 = objectSetPrototypeOf$1; var copyConstructorProperties$3 = copyConstructorProperties$6; var proxyAccessor$1 = proxyAccessor$2; var inheritIfRequired$5 = inheritIfRequired$6; var normalizeStringArgument$5 = normalizeStringArgument$6; var installErrorCause$1 = installErrorCause$2; var installErrorStack$2 = errorStackInstall; var DESCRIPTORS$I = descriptors; var wrapErrorConstructorWithCause$2 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) { var STACK_TRACE_LIMIT = 'stackTraceLimit'; var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1; var path = FULL_NAME.split('.'); var ERROR_NAME = path[path.length - 1]; var OriginalError = getBuiltIn$D.apply(null, path); if (!OriginalError) return; var OriginalErrorPrototype = OriginalError.prototype; // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006 if (hasOwn$s(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause; if (!FORCED) return OriginalError; var BaseError = getBuiltIn$D('Error'); var WrappedError = wrapper(function (a, b) { var message = normalizeStringArgument$5(IS_AGGREGATE_ERROR ? b : a, undefined); var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError(); if (message !== undefined) createNonEnumerableProperty$f(result, 'message', message); installErrorStack$2(result, WrappedError, result.stack, 2); if (this && isPrototypeOf$b(OriginalErrorPrototype, this)) inheritIfRequired$5(result, this, WrappedError); if (arguments.length > OPTIONS_POSITION) installErrorCause$1(result, arguments[OPTIONS_POSITION]); return result; }); WrappedError.prototype = OriginalErrorPrototype; if (ERROR_NAME !== 'Error') { if (setPrototypeOf$9) setPrototypeOf$9(WrappedError, BaseError); else copyConstructorProperties$3(WrappedError, BaseError, { name: true }); } else if (DESCRIPTORS$I && STACK_TRACE_LIMIT in OriginalError) { proxyAccessor$1(WrappedError, OriginalError, STACK_TRACE_LIMIT); proxyAccessor$1(WrappedError, OriginalError, 'prepareStackTrace'); } copyConstructorProperties$3(WrappedError, OriginalError); try { // Safari 13- bug: WebAssembly errors does not have a proper `.name` if (OriginalErrorPrototype.name !== ERROR_NAME) { createNonEnumerableProperty$f(OriginalErrorPrototype, 'name', ERROR_NAME); } OriginalErrorPrototype.constructor = WrappedError; } catch (error) { /* empty */ } return WrappedError; }; /* eslint-disable no-unused-vars -- required for functions `.length` */ var $$5k = _export; var global$U = global$16; var apply$c = functionApply$1; var wrapErrorConstructorWithCause$1 = wrapErrorConstructorWithCause$2; var WEB_ASSEMBLY = 'WebAssembly'; var WebAssembly$1 = global$U[WEB_ASSEMBLY]; var FORCED$D = Error('e', { cause: 7 }).cause !== 7; var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) { var O = {}; O[ERROR_NAME] = wrapErrorConstructorWithCause$1(ERROR_NAME, wrapper, FORCED$D); $$5k({ global: true, constructor: true, arity: 1, forced: FORCED$D }, O); }; var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) { if (WebAssembly$1 && WebAssembly$1[ERROR_NAME]) { var O = {}; O[ERROR_NAME] = wrapErrorConstructorWithCause$1(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$D); $$5k({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$D }, O); } }; // https://tc39.es/ecma262/#sec-nativeerror exportGlobalErrorCauseWrapper('Error', function (init) { return function Error(message) { return apply$c(init, this, arguments); }; }); exportGlobalErrorCauseWrapper('EvalError', function (init) { return function EvalError(message) { return apply$c(init, this, arguments); }; }); exportGlobalErrorCauseWrapper('RangeError', function (init) { return function RangeError(message) { return apply$c(init, this, arguments); }; }); exportGlobalErrorCauseWrapper('ReferenceError', function (init) { return function ReferenceError(message) { return apply$c(init, this, arguments); }; }); exportGlobalErrorCauseWrapper('SyntaxError', function (init) { return function SyntaxError(message) { return apply$c(init, this, arguments); }; }); exportGlobalErrorCauseWrapper('TypeError', function (init) { return function TypeError(message) { return apply$c(init, this, arguments); }; }); exportGlobalErrorCauseWrapper('URIError', function (init) { return function URIError(message) { return apply$c(init, this, arguments); }; }); exportWebAssemblyErrorCauseWrapper('CompileError', function (init) { return function CompileError(message) { return apply$c(init, this, arguments); }; }); exportWebAssemblyErrorCauseWrapper('LinkError', function (init) { return function LinkError(message) { return apply$c(init, this, arguments); }; }); exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) { return function RuntimeError(message) { return apply$c(init, this, arguments); }; }); var DESCRIPTORS$H = descriptors; var fails$1g = fails$1u; var anObject$18 = anObject$1f; var create$i = objectCreate$1; var normalizeStringArgument$4 = normalizeStringArgument$6; var nativeErrorToString = Error.prototype.toString; var INCORRECT_TO_STRING$1 = fails$1g(function () { if (DESCRIPTORS$H) { // Chrome 32- incorrectly call accessor // eslint-disable-next-line es/no-object-defineproperty -- safe var object = create$i(Object.defineProperty({}, 'name', { get: function () { return this === object; } })); if (nativeErrorToString.call(object) !== 'true') return true; } // FF10- does not properly handle non-strings return nativeErrorToString.call({ message: 1, name: 2 }) !== '2: 1' // IE8 does not properly handle defaults || nativeErrorToString.call({}) !== 'Error'; }); var errorToString$2 = INCORRECT_TO_STRING$1 ? function toString() { var O = anObject$18(this); var name = normalizeStringArgument$4(O.name, 'Error'); var message = normalizeStringArgument$4(O.message); return !name ? message : !message ? name : name + ': ' + message; } : nativeErrorToString; var defineBuiltIn$q = defineBuiltIn$u; var errorToString$1 = errorToString$2; var ErrorPrototype$1 = Error.prototype; // `Error.prototype.toString` method fix // https://tc39.es/ecma262/#sec-error.prototype.tostring if (ErrorPrototype$1.toString !== errorToString$1) { defineBuiltIn$q(ErrorPrototype$1, 'toString', errorToString$1); } var fails$1f = fails$1u; var correctPrototypeGetter = !fails$1f(function () { function F() { /* empty */ } F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype; }); var hasOwn$r = hasOwnProperty_1; var isCallable$s = isCallable$K; var toObject$z = toObject$D; var sharedKey = sharedKey$4; var CORRECT_PROTOTYPE_GETTER$2 = correctPrototypeGetter; var IE_PROTO = sharedKey('IE_PROTO'); var $Object$4 = Object; var ObjectPrototype$4 = $Object$4.prototype; // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof // eslint-disable-next-line es/no-object-getprototypeof -- safe var objectGetPrototypeOf$2 = CORRECT_PROTOTYPE_GETTER$2 ? $Object$4.getPrototypeOf : function (O) { var object = toObject$z(O); if (hasOwn$r(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable$s(constructor) && object instanceof constructor) { return constructor.prototype; } return object instanceof $Object$4 ? ObjectPrototype$4 : null; }; var iterators = {}; var wellKnownSymbol$K = wellKnownSymbol$T; var Iterators$5 = iterators; var ITERATOR$b = wellKnownSymbol$K('iterator'); var ArrayPrototype$1 = Array.prototype; // check on default Array iterator var isArrayIteratorMethod$3 = function (it) { return it !== undefined && (Iterators$5.Array === it || ArrayPrototype$1[ITERATOR$b] === it); }; var classof$k = classof$q; var getMethod$j = getMethod$l; var isNullOrUndefined$h = isNullOrUndefined$k; var Iterators$4 = iterators; var wellKnownSymbol$J = wellKnownSymbol$T; var ITERATOR$a = wellKnownSymbol$J('iterator'); var getIteratorMethod$8 = function (it) { if (!isNullOrUndefined$h(it)) return getMethod$j(it, ITERATOR$a) || getMethod$j(it, '@@iterator') || Iterators$4[classof$k(it)]; }; var call$1a = functionCall; var aCallable$J = aCallable$N; var anObject$17 = anObject$1f; var tryToString$4 = tryToString$7; var getIteratorMethod$7 = getIteratorMethod$8; var $TypeError$B = TypeError; var getIterator$7 = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod$7(argument) : usingIterator; if (aCallable$J(iteratorMethod)) return anObject$17(call$1a(iteratorMethod, argument)); throw $TypeError$B(tryToString$4(argument) + ' is not iterable'); }; var call$19 = functionCall; var anObject$16 = anObject$1f; var getMethod$i = getMethod$l; var iteratorClose$8 = function (iterator, kind, value) { var innerResult, innerError; anObject$16(iterator); try { innerResult = getMethod$i(iterator, 'return'); if (!innerResult) { if (kind === 'throw') throw value; return value; } innerResult = call$19(innerResult, iterator); } catch (error) { innerError = true; innerResult = error; } if (kind === 'throw') throw value; if (innerError) throw innerResult; anObject$16(innerResult); return value; }; var bind$t = functionBindContext; var call$18 = functionCall; var anObject$15 = anObject$1f; var tryToString$3 = tryToString$7; var isArrayIteratorMethod$2 = isArrayIteratorMethod$3; var lengthOfArrayLike$y = lengthOfArrayLike$C; var isPrototypeOf$a = objectIsPrototypeOf; var getIterator$6 = getIterator$7; var getIteratorMethod$6 = getIteratorMethod$8; var iteratorClose$7 = iteratorClose$8; var $TypeError$A = TypeError; var Result = function (stopped, result) { this.stopped = stopped; this.result = result; }; var ResultPrototype = Result.prototype; var iterate$G = function (iterable, unboundFunction, options) { var that = options && options.that; var AS_ENTRIES = !!(options && options.AS_ENTRIES); var IS_RECORD = !!(options && options.IS_RECORD); var IS_ITERATOR = !!(options && options.IS_ITERATOR); var INTERRUPTED = !!(options && options.INTERRUPTED); var fn = bind$t(unboundFunction, that); var iterator, iterFn, index, length, result, next, step; var stop = function (condition) { if (iterator) iteratorClose$7(iterator, 'normal', condition); return new Result(true, condition); }; var callFn = function (value) { if (AS_ENTRIES) { anObject$15(value); return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); } return INTERRUPTED ? fn(value, stop) : fn(value); }; if (IS_RECORD) { iterator = iterable.iterator; } else if (IS_ITERATOR) { iterator = iterable; } else { iterFn = getIteratorMethod$6(iterable); if (!iterFn) throw $TypeError$A(tryToString$3(iterable) + ' is not iterable'); // optimisation for array iterators if (isArrayIteratorMethod$2(iterFn)) { for (index = 0, length = lengthOfArrayLike$y(iterable); length > index; index++) { result = callFn(iterable[index]); if (result && isPrototypeOf$a(ResultPrototype, result)) return result; } return new Result(false); } iterator = getIterator$6(iterable, iterFn); } next = IS_RECORD ? iterable.next : iterator.next; while (!(step = call$18(next, iterator)).done) { try { result = callFn(step.value); } catch (error) { iteratorClose$7(iterator, 'throw', error); } if (typeof result == 'object' && result && isPrototypeOf$a(ResultPrototype, result)) return result; } return new Result(false); }; var $$5j = _export; var isPrototypeOf$9 = objectIsPrototypeOf; var getPrototypeOf$h = objectGetPrototypeOf$2; var setPrototypeOf$8 = objectSetPrototypeOf$1; var copyConstructorProperties$2 = copyConstructorProperties$6; var create$h = objectCreate$1; var createNonEnumerableProperty$e = createNonEnumerableProperty$k; var createPropertyDescriptor$7 = createPropertyDescriptor$d; var installErrorCause = installErrorCause$2; var installErrorStack$1 = errorStackInstall; var iterate$F = iterate$G; var normalizeStringArgument$3 = normalizeStringArgument$6; var wellKnownSymbol$I = wellKnownSymbol$T; var TO_STRING_TAG$9 = wellKnownSymbol$I('toStringTag'); var $Error$1 = Error; var push$o = [].push; var $AggregateError$1 = function AggregateError(errors, message /* , options */) { var isInstance = isPrototypeOf$9(AggregateErrorPrototype, this); var that; if (setPrototypeOf$8) { that = setPrototypeOf$8($Error$1(), isInstance ? getPrototypeOf$h(this) : AggregateErrorPrototype); } else { that = isInstance ? this : create$h(AggregateErrorPrototype); createNonEnumerableProperty$e(that, TO_STRING_TAG$9, 'Error'); } if (message !== undefined) createNonEnumerableProperty$e(that, 'message', normalizeStringArgument$3(message)); installErrorStack$1(that, $AggregateError$1, that.stack, 1); if (arguments.length > 2) installErrorCause(that, arguments[2]); var errorsArray = []; iterate$F(errors, push$o, { that: errorsArray }); createNonEnumerableProperty$e(that, 'errors', errorsArray); return that; }; if (setPrototypeOf$8) setPrototypeOf$8($AggregateError$1, $Error$1); else copyConstructorProperties$2($AggregateError$1, $Error$1, { name: true }); var AggregateErrorPrototype = $AggregateError$1.prototype = create$h($Error$1.prototype, { constructor: createPropertyDescriptor$7(1, $AggregateError$1), message: createPropertyDescriptor$7(1, ''), name: createPropertyDescriptor$7(1, 'AggregateError') }); // `AggregateError` constructor // https://tc39.es/ecma262/#sec-aggregate-error-constructor $$5j({ global: true, constructor: true, arity: 2 }, { AggregateError: $AggregateError$1 }); var $$5i = _export; var getBuiltIn$C = getBuiltIn$M; var apply$b = functionApply$1; var fails$1e = fails$1u; var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$2; var AGGREGATE_ERROR = 'AggregateError'; var $AggregateError = getBuiltIn$C(AGGREGATE_ERROR); var FORCED$C = !fails$1e(function () { return $AggregateError([1]).errors[0] !== 1; }) && fails$1e(function () { return $AggregateError([1], AGGREGATE_ERROR, { cause: 7 }).cause !== 7; }); // https://tc39.es/ecma262/#sec-aggregate-error $$5i({ global: true, constructor: true, arity: 2, forced: FORCED$C }, { AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) { // eslint-disable-next-line no-unused-vars -- required for functions `.length` return function AggregateError(errors, message) { return apply$b(init, this, arguments); }; }, FORCED$C, true) }); var wellKnownSymbol$H = wellKnownSymbol$T; var create$g = objectCreate$1; var defineProperty$c = objectDefineProperty.f; var UNSCOPABLES = wellKnownSymbol$H('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] === undefined) { defineProperty$c(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create$g(null) }); } // add a key to Array.prototype[@@unscopables] var addToUnscopables$n = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; var $$5h = _export; var toObject$y = toObject$D; var lengthOfArrayLike$x = lengthOfArrayLike$C; var toIntegerOrInfinity$m = toIntegerOrInfinity$p; var addToUnscopables$m = addToUnscopables$n; // `Array.prototype.at` method // https://tc39.es/ecma262/#sec-array.prototype.at $$5h({ target: 'Array', proto: true }, { at: function at(index) { var O = toObject$y(this); var len = lengthOfArrayLike$x(O); var relativeIndex = toIntegerOrInfinity$m(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; return (k < 0 || k >= len) ? undefined : O[k]; } }); addToUnscopables$m('at'); var $TypeError$z = TypeError; var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991 var doesNotExceedSafeInteger$7 = function (it) { if (it > MAX_SAFE_INTEGER) throw $TypeError$z('Maximum allowed index exceeded'); return it; }; var fails$1d = fails$1u; var wellKnownSymbol$G = wellKnownSymbol$T; var V8_VERSION$2 = engineV8Version; var SPECIES$5 = wellKnownSymbol$G('species'); var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) { // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/677 return V8_VERSION$2 >= 51 || !fails$1d(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES$5] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; var $$5g = _export; var fails$1c = fails$1u; var isArray$8 = isArray$b; var isObject$B = isObject$K; var toObject$x = toObject$D; var lengthOfArrayLike$w = lengthOfArrayLike$C; var doesNotExceedSafeInteger$6 = doesNotExceedSafeInteger$7; var createProperty$9 = createProperty$b; var arraySpeciesCreate$3 = arraySpeciesCreate$5; var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5; var wellKnownSymbol$F = wellKnownSymbol$T; var V8_VERSION$1 = engineV8Version; var IS_CONCAT_SPREADABLE = wellKnownSymbol$F('isConcatSpreadable'); // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/679 var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION$1 >= 51 || !fails$1c(function () { var array = []; array[IS_CONCAT_SPREADABLE] = false; return array.concat()[0] !== array; }); var isConcatSpreadable = function (O) { if (!isObject$B(O)) return false; var spreadable = O[IS_CONCAT_SPREADABLE]; return spreadable !== undefined ? !!spreadable : isArray$8(O); }; var FORCED$B = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport$4('concat'); // `Array.prototype.concat` method // https://tc39.es/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species $$5g({ target: 'Array', proto: true, arity: 1, forced: FORCED$B }, { // eslint-disable-next-line no-unused-vars -- required for `.length` concat: function concat(arg) { var O = toObject$x(this); var A = arraySpeciesCreate$3(O, 0); var n = 0; var i, k, length, len, E; for (i = -1, length = arguments.length; i < length; i++) { E = i === -1 ? O : arguments[i]; if (isConcatSpreadable(E)) { len = lengthOfArrayLike$w(E); doesNotExceedSafeInteger$6(n + len); for (k = 0; k < len; k++, n++) if (k in E) createProperty$9(A, n, E[k]); } else { doesNotExceedSafeInteger$6(n + 1); createProperty$9(A, n++, E); } } A.length = n; return A; } }); var tryToString$2 = tryToString$7; var $TypeError$y = TypeError; var deletePropertyOrThrow$4 = function (O, P) { if (!delete O[P]) throw $TypeError$y('Cannot delete property ' + tryToString$2(P) + ' of ' + tryToString$2(O)); }; var toObject$w = toObject$D; var toAbsoluteIndex$8 = toAbsoluteIndex$b; var lengthOfArrayLike$v = lengthOfArrayLike$C; var deletePropertyOrThrow$3 = deletePropertyOrThrow$4; var min$c = Math.min; // `Array.prototype.copyWithin` method implementation // https://tc39.es/ecma262/#sec-array.prototype.copywithin // eslint-disable-next-line es/no-array-prototype-copywithin -- safe var arrayCopyWithin = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { var O = toObject$w(this); var len = lengthOfArrayLike$v(O); var to = toAbsoluteIndex$8(target, len); var from = toAbsoluteIndex$8(start, len); var end = arguments.length > 2 ? arguments[2] : undefined; var count = min$c((end === undefined ? len : toAbsoluteIndex$8(end, len)) - from, len - to); var inc = 1; if (from < to && to < from + count) { inc = -1; from += count - 1; to += count - 1; } while (count-- > 0) { if (from in O) O[to] = O[from]; else deletePropertyOrThrow$3(O, to); to += inc; from += inc; } return O; }; var $$5f = _export; var copyWithin = arrayCopyWithin; var addToUnscopables$l = addToUnscopables$n; // `Array.prototype.copyWithin` method // https://tc39.es/ecma262/#sec-array.prototype.copywithin $$5f({ target: 'Array', proto: true }, { copyWithin: copyWithin }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$l('copyWithin'); var fails$1b = fails$1u; var arrayMethodIsStrict$b = function (METHOD_NAME, argument) { var method = [][METHOD_NAME]; return !!method && fails$1b(function () { // eslint-disable-next-line no-useless-call -- required for testing method.call(null, argument || function () { return 1; }, 1); }); }; var $$5e = _export; var $every$2 = arrayIteration.every; var arrayMethodIsStrict$a = arrayMethodIsStrict$b; var STRICT_METHOD$4 = arrayMethodIsStrict$a('every'); // `Array.prototype.every` method // https://tc39.es/ecma262/#sec-array.prototype.every $$5e({ target: 'Array', proto: true, forced: !STRICT_METHOD$4 }, { every: function every(callbackfn /* , thisArg */) { return $every$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); var toObject$v = toObject$D; var toAbsoluteIndex$7 = toAbsoluteIndex$b; var lengthOfArrayLike$u = lengthOfArrayLike$C; // `Array.prototype.fill` method implementation // https://tc39.es/ecma262/#sec-array.prototype.fill var arrayFill$1 = function fill(value /* , start = 0, end = @length */) { var O = toObject$v(this); var length = lengthOfArrayLike$u(O); var argumentsLength = arguments.length; var index = toAbsoluteIndex$7(argumentsLength > 1 ? arguments[1] : undefined, length); var end = argumentsLength > 2 ? arguments[2] : undefined; var endPos = end === undefined ? length : toAbsoluteIndex$7(end, length); while (endPos > index) O[index++] = value; return O; }; var $$5d = _export; var fill$1 = arrayFill$1; var addToUnscopables$k = addToUnscopables$n; // `Array.prototype.fill` method // https://tc39.es/ecma262/#sec-array.prototype.fill $$5d({ target: 'Array', proto: true }, { fill: fill$1 }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$k('fill'); var $$5c = _export; var $filter$1 = arrayIteration.filter; var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5; var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter'); // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter // with adding support of @@species $$5c({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, { filter: function filter(callbackfn /* , thisArg */) { return $filter$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); var $$5b = _export; var $find$2 = arrayIteration.find; var addToUnscopables$j = addToUnscopables$n; var FIND = 'find'; var SKIPS_HOLES$1 = true; // Shouldn't skip holes // eslint-disable-next-line es/no-array-prototype-find -- testing if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; }); // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find $$5b({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { find: function find(callbackfn /* , that = undefined */) { return $find$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$j(FIND); var $$5a = _export; var $findIndex$1 = arrayIteration.findIndex; var addToUnscopables$i = addToUnscopables$n; var FIND_INDEX = 'findIndex'; var SKIPS_HOLES = true; // Shouldn't skip holes // eslint-disable-next-line es/no-array-prototype-findindex -- testing if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; }); // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findindex $$5a({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { findIndex: function findIndex(callbackfn /* , that = undefined */) { return $findIndex$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$i(FIND_INDEX); var bind$s = functionBindContext; var IndexedObject$5 = indexedObject; var toObject$u = toObject$D; var lengthOfArrayLike$t = lengthOfArrayLike$C; // `Array.prototype.{ findLast, findLastIndex }` methods implementation var createMethod$6 = function (TYPE) { var IS_FIND_LAST_INDEX = TYPE === 1; return function ($this, callbackfn, that) { var O = toObject$u($this); var self = IndexedObject$5(O); var boundFunction = bind$s(callbackfn, that); var index = lengthOfArrayLike$t(self); var value, result; while (index-- > 0) { value = self[index]; result = boundFunction(value, index, O); if (result) switch (TYPE) { case 0: return value; // findLast case 1: return index; // findLastIndex } } return IS_FIND_LAST_INDEX ? -1 : undefined; }; }; var arrayIterationFromLast = { // `Array.prototype.findLast` method // https://github.com/tc39/proposal-array-find-from-last findLast: createMethod$6(0), // `Array.prototype.findLastIndex` method // https://github.com/tc39/proposal-array-find-from-last findLastIndex: createMethod$6(1) }; var $$59 = _export; var $findLast$1 = arrayIterationFromLast.findLast; var addToUnscopables$h = addToUnscopables$n; // `Array.prototype.findLast` method // https://tc39.es/ecma262/#sec-array.prototype.findlast $$59({ target: 'Array', proto: true }, { findLast: function findLast(callbackfn /* , that = undefined */) { return $findLast$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables$h('findLast'); var $$58 = _export; var $findLastIndex$1 = arrayIterationFromLast.findLastIndex; var addToUnscopables$g = addToUnscopables$n; // `Array.prototype.findLastIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findlastindex $$58({ target: 'Array', proto: true }, { findLastIndex: function findLastIndex(callbackfn /* , that = undefined */) { return $findLastIndex$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables$g('findLastIndex'); var isArray$7 = isArray$b; var lengthOfArrayLike$s = lengthOfArrayLike$C; var doesNotExceedSafeInteger$5 = doesNotExceedSafeInteger$7; var bind$r = functionBindContext; // `FlattenIntoArray` abstract operation // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray var flattenIntoArray$2 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) { var targetIndex = start; var sourceIndex = 0; var mapFn = mapper ? bind$r(mapper, thisArg) : false; var element, elementLen; while (sourceIndex < sourceLen) { if (sourceIndex in source) { element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; if (depth > 0 && isArray$7(element)) { elementLen = lengthOfArrayLike$s(element); targetIndex = flattenIntoArray$2(target, original, element, elementLen, targetIndex, depth - 1) - 1; } else { doesNotExceedSafeInteger$5(targetIndex + 1); target[targetIndex] = element; } targetIndex++; } sourceIndex++; } return targetIndex; }; var flattenIntoArray_1 = flattenIntoArray$2; var $$57 = _export; var flattenIntoArray$1 = flattenIntoArray_1; var toObject$t = toObject$D; var lengthOfArrayLike$r = lengthOfArrayLike$C; var toIntegerOrInfinity$l = toIntegerOrInfinity$p; var arraySpeciesCreate$2 = arraySpeciesCreate$5; // `Array.prototype.flat` method // https://tc39.es/ecma262/#sec-array.prototype.flat $$57({ target: 'Array', proto: true }, { flat: function flat(/* depthArg = 1 */) { var depthArg = arguments.length ? arguments[0] : undefined; var O = toObject$t(this); var sourceLen = lengthOfArrayLike$r(O); var A = arraySpeciesCreate$2(O, 0); A.length = flattenIntoArray$1(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity$l(depthArg)); return A; } }); var $$56 = _export; var flattenIntoArray = flattenIntoArray_1; var aCallable$I = aCallable$N; var toObject$s = toObject$D; var lengthOfArrayLike$q = lengthOfArrayLike$C; var arraySpeciesCreate$1 = arraySpeciesCreate$5; // `Array.prototype.flatMap` method // https://tc39.es/ecma262/#sec-array.prototype.flatmap $$56({ target: 'Array', proto: true }, { flatMap: function flatMap(callbackfn /* , thisArg */) { var O = toObject$s(this); var sourceLen = lengthOfArrayLike$q(O); var A; aCallable$I(callbackfn); A = arraySpeciesCreate$1(O, 0); A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined); return A; } }); var $forEach$2 = arrayIteration.forEach; var arrayMethodIsStrict$9 = arrayMethodIsStrict$b; var STRICT_METHOD$3 = arrayMethodIsStrict$9('forEach'); // `Array.prototype.forEach` method implementation // https://tc39.es/ecma262/#sec-array.prototype.foreach var arrayForEach = !STRICT_METHOD$3 ? function forEach(callbackfn /* , thisArg */) { return $forEach$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); // eslint-disable-next-line es/no-array-prototype-foreach -- safe } : [].forEach; var $$55 = _export; var forEach$6 = arrayForEach; // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach // eslint-disable-next-line es/no-array-prototype-foreach -- safe $$55({ target: 'Array', proto: true, forced: [].forEach !== forEach$6 }, { forEach: forEach$6 }); var anObject$14 = anObject$1f; var iteratorClose$6 = iteratorClose$8; // call something on iterator step with safe closing on error var callWithSafeIterationClosing$3 = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject$14(value)[0], value[1]) : fn(value); } catch (error) { iteratorClose$6(iterator, 'throw', error); } }; var bind$q = functionBindContext; var call$17 = functionCall; var toObject$r = toObject$D; var callWithSafeIterationClosing$2 = callWithSafeIterationClosing$3; var isArrayIteratorMethod$1 = isArrayIteratorMethod$3; var isConstructor$8 = isConstructor$a; var lengthOfArrayLike$p = lengthOfArrayLike$C; var createProperty$8 = createProperty$b; var getIterator$5 = getIterator$7; var getIteratorMethod$5 = getIteratorMethod$8; var $Array$a = Array; // `Array.from` method implementation // https://tc39.es/ecma262/#sec-array.from var arrayFrom$1 = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject$r(arrayLike); var IS_CONSTRUCTOR = isConstructor$8(this); var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; if (mapping) mapfn = bind$q(mapfn, argumentsLength > 2 ? arguments[2] : undefined); var iteratorMethod = getIteratorMethod$5(O); var index = 0; var length, result, step, iterator, next, value; // if the target is not iterable or it's an array with the default iterator - use a simple case if (iteratorMethod && !(this === $Array$a && isArrayIteratorMethod$1(iteratorMethod))) { iterator = getIterator$5(O, iteratorMethod); next = iterator.next; result = IS_CONSTRUCTOR ? new this() : []; for (;!(step = call$17(next, iterator)).done; index++) { value = mapping ? callWithSafeIterationClosing$2(iterator, mapfn, [step.value, index], true) : step.value; createProperty$8(result, index, value); } } else { length = lengthOfArrayLike$p(O); result = IS_CONSTRUCTOR ? new this(length) : $Array$a(length); for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty$8(result, index, value); } } result.length = index; return result; }; var wellKnownSymbol$E = wellKnownSymbol$T; var ITERATOR$9 = wellKnownSymbol$E('iterator'); var SAFE_CLOSING = false; try { var called = 0; var iteratorWithReturn = { next: function () { return { done: !!called++ }; }, 'return': function () { SAFE_CLOSING = true; } }; iteratorWithReturn[ITERATOR$9] = function () { return this; }; // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing Array.from(iteratorWithReturn, function () { throw 2; }); } catch (error) { /* empty */ } var checkCorrectnessOfIteration$4 = function (exec, SKIP_CLOSING) { try { if (!SKIP_CLOSING && !SAFE_CLOSING) return false; } catch (error) { return false; } // workaround of old WebKit + `eval` bug var ITERATION_SUPPORT = false; try { var object = {}; object[ITERATOR$9] = function () { return { next: function () { return { done: ITERATION_SUPPORT = true }; } }; }; exec(object); } catch (error) { /* empty */ } return ITERATION_SUPPORT; }; var $$54 = _export; var from$4 = arrayFrom$1; var checkCorrectnessOfIteration$3 = checkCorrectnessOfIteration$4; var INCORRECT_ITERATION = !checkCorrectnessOfIteration$3(function (iterable) { // eslint-disable-next-line es/no-array-from -- required for testing Array.from(iterable); }); // `Array.from` method // https://tc39.es/ecma262/#sec-array.from $$54({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { from: from$4 }); var $$53 = _export; var $includes$1 = arrayIncludes.includes; var fails$1a = fails$1u; var addToUnscopables$f = addToUnscopables$n; // FF99+ bug var BROKEN_ON_SPARSE = fails$1a(function () { // eslint-disable-next-line es/no-array-prototype-includes -- detection return !Array(1).includes(); }); // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes $$53({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { includes: function includes(el /* , fromIndex = 0 */) { return $includes$1(this, el, arguments.length > 1 ? arguments[1] : undefined); } }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$f('includes'); /* eslint-disable es/no-array-prototype-indexof -- required for testing */ var $$52 = _export; var uncurryThis$1z = functionUncurryThisClause; var $indexOf$1 = arrayIncludes.indexOf; var arrayMethodIsStrict$8 = arrayMethodIsStrict$b; var nativeIndexOf = uncurryThis$1z([].indexOf); var NEGATIVE_ZERO$1 = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0; var FORCED$A = NEGATIVE_ZERO$1 || !arrayMethodIsStrict$8('indexOf'); // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof $$52({ target: 'Array', proto: true, forced: FORCED$A }, { indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { var fromIndex = arguments.length > 1 ? arguments[1] : undefined; return NEGATIVE_ZERO$1 // convert -0 to +0 ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf$1(this, searchElement, fromIndex); } }); var $$51 = _export; var isArray$6 = isArray$b; // `Array.isArray` method // https://tc39.es/ecma262/#sec-array.isarray $$51({ target: 'Array', stat: true }, { isArray: isArray$6 }); var fails$19 = fails$1u; var isCallable$r = isCallable$K; var isObject$A = isObject$K; var getPrototypeOf$g = objectGetPrototypeOf$2; var defineBuiltIn$p = defineBuiltIn$u; var wellKnownSymbol$D = wellKnownSymbol$T; var ITERATOR$8 = wellKnownSymbol$D('iterator'); var BUGGY_SAFARI_ITERATORS$1 = false; // `%IteratorPrototype%` object // https://tc39.es/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype$6, PrototypeOfArrayIteratorPrototype, arrayIterator$1; /* eslint-disable es/no-array-prototype-keys -- safe */ if ([].keys) { arrayIterator$1 = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator$1)) BUGGY_SAFARI_ITERATORS$1 = true; else { PrototypeOfArrayIteratorPrototype = getPrototypeOf$g(getPrototypeOf$g(arrayIterator$1)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$6 = PrototypeOfArrayIteratorPrototype; } } var NEW_ITERATOR_PROTOTYPE = !isObject$A(IteratorPrototype$6) || fails$19(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype$6[ITERATOR$8].call(test) !== test; }); if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$6 = {}; // `%IteratorPrototype%[@@iterator]()` method // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator if (!isCallable$r(IteratorPrototype$6[ITERATOR$8])) { defineBuiltIn$p(IteratorPrototype$6, ITERATOR$8, function () { return this; }); } var iteratorsCore = { IteratorPrototype: IteratorPrototype$6, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1 }; var IteratorPrototype$5 = iteratorsCore.IteratorPrototype; var create$f = objectCreate$1; var createPropertyDescriptor$6 = createPropertyDescriptor$d; var setToStringTag$a = setToStringTag$d; var Iterators$3 = iterators; var returnThis$1 = function () { return this; }; var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create$f(IteratorPrototype$5, { next: createPropertyDescriptor$6(+!ENUMERABLE_NEXT, next) }); setToStringTag$a(IteratorConstructor, TO_STRING_TAG, false); Iterators$3[TO_STRING_TAG] = returnThis$1; return IteratorConstructor; }; var $$50 = _export; var call$16 = functionCall; var FunctionName$1 = functionName; var isCallable$q = isCallable$K; var createIteratorConstructor$6 = iteratorCreateConstructor; var getPrototypeOf$f = objectGetPrototypeOf$2; var setPrototypeOf$7 = objectSetPrototypeOf$1; var setToStringTag$9 = setToStringTag$d; var createNonEnumerableProperty$d = createNonEnumerableProperty$k; var defineBuiltIn$o = defineBuiltIn$u; var wellKnownSymbol$C = wellKnownSymbol$T; var Iterators$2 = iterators; var IteratorsCore = iteratorsCore; var PROPER_FUNCTION_NAME$3 = FunctionName$1.PROPER; var CONFIGURABLE_FUNCTION_NAME$1 = FunctionName$1.CONFIGURABLE; var IteratorPrototype$4 = IteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR$7 = wellKnownSymbol$C('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis = function () { return this; }; var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor$6(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND]; switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } return function () { return new IteratorConstructor(this); }; }; var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR$7] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; var CurrentIteratorPrototype, methods, KEY; // fix native if (anyNativeIterator) { CurrentIteratorPrototype = getPrototypeOf$f(anyNativeIterator.call(new Iterable())); if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (getPrototypeOf$f(CurrentIteratorPrototype) !== IteratorPrototype$4) { if (setPrototypeOf$7) { setPrototypeOf$7(CurrentIteratorPrototype, IteratorPrototype$4); } else if (!isCallable$q(CurrentIteratorPrototype[ITERATOR$7])) { defineBuiltIn$o(CurrentIteratorPrototype, ITERATOR$7, returnThis); } } // Set @@toStringTag to native iterators setToStringTag$9(CurrentIteratorPrototype, TO_STRING_TAG, true); } } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF if (PROPER_FUNCTION_NAME$3 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) { if (CONFIGURABLE_FUNCTION_NAME$1) { createNonEnumerableProperty$d(IterablePrototype, 'name', VALUES); } else { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return call$16(nativeIterator, this); }; } } // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) }; if (FORCED) for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { defineBuiltIn$o(IterablePrototype, KEY, methods[KEY]); } } else $$50({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } // define iterator if (IterablePrototype[ITERATOR$7] !== defaultIterator) { defineBuiltIn$o(IterablePrototype, ITERATOR$7, defaultIterator, { name: DEFAULT }); } Iterators$2[NAME] = defaultIterator; return methods; }; // `CreateIterResultObject` abstract operation // https://tc39.es/ecma262/#sec-createiterresultobject var createIterResultObject$g = function (value, done) { return { value: value, done: done }; }; var toIndexedObject$d = toIndexedObject$k; var addToUnscopables$e = addToUnscopables$n; var Iterators$1 = iterators; var InternalStateModule$l = internalState; var defineProperty$b = objectDefineProperty.f; var defineIterator$2 = iteratorDefine; var createIterResultObject$f = createIterResultObject$g; var DESCRIPTORS$G = descriptors; var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState$l = InternalStateModule$l.set; var getInternalState$e = InternalStateModule$l.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method // https://tc39.es/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.es/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.es/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.es/ecma262/#sec-createarrayiterator var es_array_iterator = defineIterator$2(Array, 'Array', function (iterated, kind) { setInternalState$l(this, { type: ARRAY_ITERATOR, target: toIndexedObject$d(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState$e(this); var target = state.target; var kind = state.kind; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return createIterResultObject$f(undefined, true); } switch (kind) { case 'keys': return createIterResultObject$f(index, false); case 'values': return createIterResultObject$f(target[index], false); } return createIterResultObject$f([index, target[index]], false); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.es/ecma262/#sec-createunmappedargumentsobject // https://tc39.es/ecma262/#sec-createmappedargumentsobject var values = Iterators$1.Arguments = Iterators$1.Array; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$e('keys'); addToUnscopables$e('values'); addToUnscopables$e('entries'); // V8 ~ Chrome 45- bug if (DESCRIPTORS$G && values.name !== 'values') try { defineProperty$b(values, 'name', { value: 'values' }); } catch (error) { /* empty */ } var $$4$ = _export; var uncurryThis$1y = functionUncurryThis; var IndexedObject$4 = indexedObject; var toIndexedObject$c = toIndexedObject$k; var arrayMethodIsStrict$7 = arrayMethodIsStrict$b; var nativeJoin = uncurryThis$1y([].join); var ES3_STRINGS = IndexedObject$4 !== Object; var FORCED$z = ES3_STRINGS || !arrayMethodIsStrict$7('join', ','); // `Array.prototype.join` method // https://tc39.es/ecma262/#sec-array.prototype.join $$4$({ target: 'Array', proto: true, forced: FORCED$z }, { join: function join(separator) { return nativeJoin(toIndexedObject$c(this), separator === undefined ? ',' : separator); } }); /* eslint-disable es/no-array-prototype-lastindexof -- safe */ var apply$a = functionApply$1; var toIndexedObject$b = toIndexedObject$k; var toIntegerOrInfinity$k = toIntegerOrInfinity$p; var lengthOfArrayLike$o = lengthOfArrayLike$C; var arrayMethodIsStrict$6 = arrayMethodIsStrict$b; var min$b = Math.min; var $lastIndexOf$1 = [].lastIndexOf; var NEGATIVE_ZERO = !!$lastIndexOf$1 && 1 / [1].lastIndexOf(1, -0) < 0; var STRICT_METHOD$2 = arrayMethodIsStrict$6('lastIndexOf'); var FORCED$y = NEGATIVE_ZERO || !STRICT_METHOD$2; // `Array.prototype.lastIndexOf` method implementation // https://tc39.es/ecma262/#sec-array.prototype.lastindexof var arrayLastIndexOf = FORCED$y ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { // convert -0 to +0 if (NEGATIVE_ZERO) return apply$a($lastIndexOf$1, this, arguments) || 0; var O = toIndexedObject$b(this); var length = lengthOfArrayLike$o(O); var index = length - 1; if (arguments.length > 1) index = min$b(index, toIntegerOrInfinity$k(arguments[1])); if (index < 0) index = length + index; for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; return -1; } : $lastIndexOf$1; var $$4_ = _export; var lastIndexOf = arrayLastIndexOf; // `Array.prototype.lastIndexOf` method // https://tc39.es/ecma262/#sec-array.prototype.lastindexof // eslint-disable-next-line es/no-array-prototype-lastindexof -- required for testing $$4_({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, { lastIndexOf: lastIndexOf }); var $$4Z = _export; var $map$1 = arrayIteration.map; var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5; var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map'); // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map // with adding support of @@species $$4Z({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, { map: function map(callbackfn /* , thisArg */) { return $map$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); var $$4Y = _export; var fails$18 = fails$1u; var isConstructor$7 = isConstructor$a; var createProperty$7 = createProperty$b; var $Array$9 = Array; var ISNT_GENERIC = fails$18(function () { function F() { /* empty */ } // eslint-disable-next-line es/no-array-of -- safe return !($Array$9.of.call(F) instanceof F); }); // `Array.of` method // https://tc39.es/ecma262/#sec-array.of // WebKit Array.of isn't generic $$4Y({ target: 'Array', stat: true, forced: ISNT_GENERIC }, { of: function of(/* ...args */) { var index = 0; var argumentsLength = arguments.length; var result = new (isConstructor$7(this) ? this : $Array$9)(argumentsLength); while (argumentsLength > index) createProperty$7(result, index, arguments[index++]); result.length = argumentsLength; return result; } }); var DESCRIPTORS$F = descriptors; var isArray$5 = isArray$b; var $TypeError$x = TypeError; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$c = Object.getOwnPropertyDescriptor; // Safari < 13 does not throw an error in this case var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$F && !function () { // makes no sense without proper strict mode support if (this !== undefined) return true; try { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).length = 1; } catch (error) { return error instanceof TypeError; } }(); var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { if (isArray$5(O) && !getOwnPropertyDescriptor$c(O, 'length').writable) { throw $TypeError$x('Cannot set read only .length'); } return O.length = length; } : function (O, length) { return O.length = length; }; var $$4X = _export; var toObject$q = toObject$D; var lengthOfArrayLike$n = lengthOfArrayLike$C; var setArrayLength$2 = arraySetLength; var doesNotExceedSafeInteger$4 = doesNotExceedSafeInteger$7; var fails$17 = fails$1u; var INCORRECT_TO_LENGTH = fails$17(function () { return [].push.call({ length: 0x100000000 }, 1) !== 4294967297; }); // V8 and Safari <= 15.4, FF < 23 throws InternalError // https://bugs.chromium.org/p/v8/issues/detail?id=12681 var properErrorOnNonWritableLength$1 = function () { try { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).push(); } catch (error) { return error instanceof TypeError; } }; var FORCED$x = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength$1(); // `Array.prototype.push` method // https://tc39.es/ecma262/#sec-array.prototype.push $$4X({ target: 'Array', proto: true, arity: 1, forced: FORCED$x }, { // eslint-disable-next-line no-unused-vars -- required for `.length` push: function push(item) { var O = toObject$q(this); var len = lengthOfArrayLike$n(O); var argCount = arguments.length; doesNotExceedSafeInteger$4(len + argCount); for (var i = 0; i < argCount; i++) { O[len] = arguments[i]; len++; } setArrayLength$2(O, len); return len; } }); var aCallable$H = aCallable$N; var toObject$p = toObject$D; var IndexedObject$3 = indexedObject; var lengthOfArrayLike$m = lengthOfArrayLike$C; var $TypeError$w = TypeError; // `Array.prototype.{ reduce, reduceRight }` methods implementation var createMethod$5 = function (IS_RIGHT) { return function (that, callbackfn, argumentsLength, memo) { aCallable$H(callbackfn); var O = toObject$p(that); var self = IndexedObject$3(O); var length = lengthOfArrayLike$m(O); var index = IS_RIGHT ? length - 1 : 0; var i = IS_RIGHT ? -1 : 1; if (argumentsLength < 2) while (true) { if (index in self) { memo = self[index]; index += i; break; } index += i; if (IS_RIGHT ? index < 0 : length <= index) { throw $TypeError$w('Reduce of empty array with no initial value'); } } for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { memo = callbackfn(memo, self[index], index, O); } return memo; }; }; var arrayReduce = { // `Array.prototype.reduce` method // https://tc39.es/ecma262/#sec-array.prototype.reduce left: createMethod$5(false), // `Array.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-array.prototype.reduceright right: createMethod$5(true) }; var global$T = global$16; var classof$j = classofRaw$2; var engineIsNode = classof$j(global$T.process) === 'process'; var $$4W = _export; var $reduce$1 = arrayReduce.left; var arrayMethodIsStrict$5 = arrayMethodIsStrict$b; var CHROME_VERSION$1 = engineV8Version; var IS_NODE$8 = engineIsNode; // Chrome 80-82 has a critical bug // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 var CHROME_BUG$1 = !IS_NODE$8 && CHROME_VERSION$1 > 79 && CHROME_VERSION$1 < 83; var FORCED$w = CHROME_BUG$1 || !arrayMethodIsStrict$5('reduce'); // `Array.prototype.reduce` method // https://tc39.es/ecma262/#sec-array.prototype.reduce $$4W({ target: 'Array', proto: true, forced: FORCED$w }, { reduce: function reduce(callbackfn /* , initialValue */) { var length = arguments.length; return $reduce$1(this, callbackfn, length, length > 1 ? arguments[1] : undefined); } }); var $$4V = _export; var $reduceRight$1 = arrayReduce.right; var arrayMethodIsStrict$4 = arrayMethodIsStrict$b; var CHROME_VERSION = engineV8Version; var IS_NODE$7 = engineIsNode; // Chrome 80-82 has a critical bug // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 var CHROME_BUG = !IS_NODE$7 && CHROME_VERSION > 79 && CHROME_VERSION < 83; var FORCED$v = CHROME_BUG || !arrayMethodIsStrict$4('reduceRight'); // `Array.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-array.prototype.reduceright $$4V({ target: 'Array', proto: true, forced: FORCED$v }, { reduceRight: function reduceRight(callbackfn /* , initialValue */) { return $reduceRight$1(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); } }); var $$4U = _export; var uncurryThis$1x = functionUncurryThis; var isArray$4 = isArray$b; var nativeReverse = uncurryThis$1x([].reverse); var test$1 = [1, 2]; // `Array.prototype.reverse` method // https://tc39.es/ecma262/#sec-array.prototype.reverse // fix for Safari 12.0 bug // https://bugs.webkit.org/show_bug.cgi?id=188794 $$4U({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, { reverse: function reverse() { // eslint-disable-next-line no-self-assign -- dirty hack if (isArray$4(this)) this.length = this.length; return nativeReverse(this); } }); var $$4T = _export; var isArray$3 = isArray$b; var isConstructor$6 = isConstructor$a; var isObject$z = isObject$K; var toAbsoluteIndex$6 = toAbsoluteIndex$b; var lengthOfArrayLike$l = lengthOfArrayLike$C; var toIndexedObject$a = toIndexedObject$k; var createProperty$6 = createProperty$b; var wellKnownSymbol$B = wellKnownSymbol$T; var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5; var nativeSlice = arraySlice$b; var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice'); var SPECIES$4 = wellKnownSymbol$B('species'); var $Array$8 = Array; var max$8 = Math.max; // `Array.prototype.slice` method // https://tc39.es/ecma262/#sec-array.prototype.slice // fallback for not array-like ES3 strings and DOM objects $$4T({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { slice: function slice(start, end) { var O = toIndexedObject$a(this); var length = lengthOfArrayLike$l(O); var k = toAbsoluteIndex$6(start, length); var fin = toAbsoluteIndex$6(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible var Constructor, result, n; if (isArray$3(O)) { Constructor = O.constructor; // cross-realm fallback if (isConstructor$6(Constructor) && (Constructor === $Array$8 || isArray$3(Constructor.prototype))) { Constructor = undefined; } else if (isObject$z(Constructor)) { Constructor = Constructor[SPECIES$4]; if (Constructor === null) Constructor = undefined; } if (Constructor === $Array$8 || Constructor === undefined) { return nativeSlice(O, k, fin); } } result = new (Constructor === undefined ? $Array$8 : Constructor)(max$8(fin - k, 0)); for (n = 0; k < fin; k++, n++) if (k in O) createProperty$6(result, n, O[k]); result.length = n; return result; } }); var $$4S = _export; var $some$2 = arrayIteration.some; var arrayMethodIsStrict$3 = arrayMethodIsStrict$b; var STRICT_METHOD$1 = arrayMethodIsStrict$3('some'); // `Array.prototype.some` method // https://tc39.es/ecma262/#sec-array.prototype.some $$4S({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 }, { some: function some(callbackfn /* , thisArg */) { return $some$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); var arraySlice$9 = arraySliceSimple; var floor$9 = Math.floor; var mergeSort = function (array, comparefn) { var length = array.length; var middle = floor$9(length / 2); return length < 8 ? insertionSort(array, comparefn) : merge( array, mergeSort(arraySlice$9(array, 0, middle), comparefn), mergeSort(arraySlice$9(array, middle), comparefn), comparefn ); }; var insertionSort = function (array, comparefn) { var length = array.length; var i = 1; var element, j; while (i < length) { j = i; element = array[i]; while (j && comparefn(array[j - 1], element) > 0) { array[j] = array[--j]; } if (j !== i++) array[j] = element; } return array; }; var merge = function (array, left, right, comparefn) { var llength = left.length; var rlength = right.length; var lindex = 0; var rindex = 0; while (lindex < llength || rindex < rlength) { array[lindex + rindex] = (lindex < llength && rindex < rlength) ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++]; } return array; }; var arraySort$1 = mergeSort; var userAgent$5 = engineUserAgent; var firefox = userAgent$5.match(/firefox\/(\d+)/i); var engineFfVersion = !!firefox && +firefox[1]; var UA = engineUserAgent; var engineIsIeOrEdge = /MSIE|Trident/.test(UA); var userAgent$4 = engineUserAgent; var webkit = userAgent$4.match(/AppleWebKit\/(\d+)\./); var engineWebkitVersion = !!webkit && +webkit[1]; var $$4R = _export; var uncurryThis$1w = functionUncurryThis; var aCallable$G = aCallable$N; var toObject$o = toObject$D; var lengthOfArrayLike$k = lengthOfArrayLike$C; var deletePropertyOrThrow$2 = deletePropertyOrThrow$4; var toString$D = toString$I; var fails$16 = fails$1u; var internalSort$1 = arraySort$1; var arrayMethodIsStrict$2 = arrayMethodIsStrict$b; var FF$1 = engineFfVersion; var IE_OR_EDGE$1 = engineIsIeOrEdge; var V8$2 = engineV8Version; var WEBKIT$2 = engineWebkitVersion; var test = []; var nativeSort$1 = uncurryThis$1w(test.sort); var push$n = uncurryThis$1w(test.push); // IE8- var FAILS_ON_UNDEFINED = fails$16(function () { test.sort(undefined); }); // V8 bug var FAILS_ON_NULL = fails$16(function () { test.sort(null); }); // Old WebKit var STRICT_METHOD = arrayMethodIsStrict$2('sort'); var STABLE_SORT$1 = !fails$16(function () { // feature detection can be too slow, so check engines versions if (V8$2) return V8$2 < 70; if (FF$1 && FF$1 > 3) return; if (IE_OR_EDGE$1) return true; if (WEBKIT$2) return WEBKIT$2 < 603; var result = ''; var code, chr, value, index; // generate an array with more 512 elements (Chakra and old V8 fails only in this case) for (code = 65; code < 76; code++) { chr = String.fromCharCode(code); switch (code) { case 66: case 69: case 70: case 72: value = 3; break; case 68: case 71: value = 4; break; default: value = 2; } for (index = 0; index < 47; index++) { test.push({ k: chr + index, v: value }); } } test.sort(function (a, b) { return b.v - a.v; }); for (index = 0; index < test.length; index++) { chr = test[index].k.charAt(0); if (result.charAt(result.length - 1) !== chr) result += chr; } return result !== 'DGBEFHACIJK'; }); var FORCED$u = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT$1; var getSortCompare$1 = function (comparefn) { return function (x, y) { if (y === undefined) return -1; if (x === undefined) return 1; if (comparefn !== undefined) return +comparefn(x, y) || 0; return toString$D(x) > toString$D(y) ? 1 : -1; }; }; // `Array.prototype.sort` method // https://tc39.es/ecma262/#sec-array.prototype.sort $$4R({ target: 'Array', proto: true, forced: FORCED$u }, { sort: function sort(comparefn) { if (comparefn !== undefined) aCallable$G(comparefn); var array = toObject$o(this); if (STABLE_SORT$1) return comparefn === undefined ? nativeSort$1(array) : nativeSort$1(array, comparefn); var items = []; var arrayLength = lengthOfArrayLike$k(array); var itemsLength, index; for (index = 0; index < arrayLength; index++) { if (index in array) push$n(items, array[index]); } internalSort$1(items, getSortCompare$1(comparefn)); itemsLength = lengthOfArrayLike$k(items); index = 0; while (index < itemsLength) array[index] = items[index++]; while (index < arrayLength) deletePropertyOrThrow$2(array, index++); return array; } }); var getBuiltIn$B = getBuiltIn$M; var defineBuiltInAccessor$l = defineBuiltInAccessor$o; var wellKnownSymbol$A = wellKnownSymbol$T; var DESCRIPTORS$E = descriptors; var SPECIES$3 = wellKnownSymbol$A('species'); var setSpecies$7 = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn$B(CONSTRUCTOR_NAME); if (DESCRIPTORS$E && Constructor && !Constructor[SPECIES$3]) { defineBuiltInAccessor$l(Constructor, SPECIES$3, { configurable: true, get: function () { return this; } }); } }; var setSpecies$6 = setSpecies$7; // `Array[@@species]` getter // https://tc39.es/ecma262/#sec-get-array-@@species setSpecies$6('Array'); var $$4Q = _export; var toObject$n = toObject$D; var toAbsoluteIndex$5 = toAbsoluteIndex$b; var toIntegerOrInfinity$j = toIntegerOrInfinity$p; var lengthOfArrayLike$j = lengthOfArrayLike$C; var setArrayLength$1 = arraySetLength; var doesNotExceedSafeInteger$3 = doesNotExceedSafeInteger$7; var arraySpeciesCreate = arraySpeciesCreate$5; var createProperty$5 = createProperty$b; var deletePropertyOrThrow$1 = deletePropertyOrThrow$4; var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5; var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); var max$7 = Math.max; var min$a = Math.min; // `Array.prototype.splice` method // https://tc39.es/ecma262/#sec-array.prototype.splice // with adding support of @@species $$4Q({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { splice: function splice(start, deleteCount /* , ...items */) { var O = toObject$n(this); var len = lengthOfArrayLike$j(O); var actualStart = toAbsoluteIndex$5(start, len); var argumentsLength = arguments.length; var insertCount, actualDeleteCount, A, k, from, to; if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { insertCount = 0; actualDeleteCount = len - actualStart; } else { insertCount = argumentsLength - 2; actualDeleteCount = min$a(max$7(toIntegerOrInfinity$j(deleteCount), 0), len - actualStart); } doesNotExceedSafeInteger$3(len + insertCount - actualDeleteCount); A = arraySpeciesCreate(O, actualDeleteCount); for (k = 0; k < actualDeleteCount; k++) { from = actualStart + k; if (from in O) createProperty$5(A, k, O[from]); } A.length = actualDeleteCount; if (insertCount < actualDeleteCount) { for (k = actualStart; k < len - actualDeleteCount; k++) { from = k + actualDeleteCount; to = k + insertCount; if (from in O) O[to] = O[from]; else deletePropertyOrThrow$1(O, to); } for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow$1(O, k - 1); } else if (insertCount > actualDeleteCount) { for (k = len - actualDeleteCount; k > actualStart; k--) { from = k + actualDeleteCount - 1; to = k + insertCount - 1; if (from in O) O[to] = O[from]; else deletePropertyOrThrow$1(O, to); } } for (k = 0; k < insertCount; k++) { O[k + actualStart] = arguments[k + 2]; } setArrayLength$1(O, len - actualDeleteCount + insertCount); return A; } }); var lengthOfArrayLike$i = lengthOfArrayLike$C; // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed var arrayToReversed$2 = function (O, C) { var len = lengthOfArrayLike$i(O); var A = new C(len); var k = 0; for (; k < len; k++) A[k] = O[len - k - 1]; return A; }; var $$4P = _export; var arrayToReversed$1 = arrayToReversed$2; var toIndexedObject$9 = toIndexedObject$k; var addToUnscopables$d = addToUnscopables$n; var $Array$7 = Array; // `Array.prototype.toReversed` method // https://tc39.es/ecma262/#sec-array.prototype.toreversed $$4P({ target: 'Array', proto: true }, { toReversed: function toReversed() { return arrayToReversed$1(toIndexedObject$9(this), $Array$7); } }); addToUnscopables$d('toReversed'); var lengthOfArrayLike$h = lengthOfArrayLike$C; var arrayFromConstructorAndList$6 = function (Constructor, list) { var index = 0; var length = lengthOfArrayLike$h(list); var result = new Constructor(length); while (length > index) result[index] = list[index++]; return result; }; var global$S = global$16; var entryVirtual = function (CONSTRUCTOR) { return global$S[CONSTRUCTOR].prototype; }; var $$4O = _export; var uncurryThis$1v = functionUncurryThis; var aCallable$F = aCallable$N; var toIndexedObject$8 = toIndexedObject$k; var arrayFromConstructorAndList$5 = arrayFromConstructorAndList$6; var getVirtual$1 = entryVirtual; var addToUnscopables$c = addToUnscopables$n; var $Array$6 = Array; var sort$1 = uncurryThis$1v(getVirtual$1('Array').sort); // `Array.prototype.toSorted` method // https://tc39.es/ecma262/#sec-array.prototype.tosorted $$4O({ target: 'Array', proto: true }, { toSorted: function toSorted(compareFn) { if (compareFn !== undefined) aCallable$F(compareFn); var O = toIndexedObject$8(this); var A = arrayFromConstructorAndList$5($Array$6, O); return sort$1(A, compareFn); } }); addToUnscopables$c('toSorted'); var $$4N = _export; var addToUnscopables$b = addToUnscopables$n; var doesNotExceedSafeInteger$2 = doesNotExceedSafeInteger$7; var lengthOfArrayLike$g = lengthOfArrayLike$C; var toAbsoluteIndex$4 = toAbsoluteIndex$b; var toIndexedObject$7 = toIndexedObject$k; var toIntegerOrInfinity$i = toIntegerOrInfinity$p; var $Array$5 = Array; var max$6 = Math.max; var min$9 = Math.min; // `Array.prototype.toSpliced` method // https://tc39.es/ecma262/#sec-array.prototype.tospliced $$4N({ target: 'Array', proto: true }, { toSpliced: function toSpliced(start, deleteCount /* , ...items */) { var O = toIndexedObject$7(this); var len = lengthOfArrayLike$g(O); var actualStart = toAbsoluteIndex$4(start, len); var argumentsLength = arguments.length; var k = 0; var insertCount, actualDeleteCount, newLen, A; if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { insertCount = 0; actualDeleteCount = len - actualStart; } else { insertCount = argumentsLength - 2; actualDeleteCount = min$9(max$6(toIntegerOrInfinity$i(deleteCount), 0), len - actualStart); } newLen = doesNotExceedSafeInteger$2(len + insertCount - actualDeleteCount); A = $Array$5(newLen); for (; k < actualStart; k++) A[k] = O[k]; for (; k < actualStart + insertCount; k++) A[k] = arguments[k - actualStart + 2]; for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount]; return A; } }); addToUnscopables$b('toSpliced'); // this method was added to unscopables after implementation // in popular engines, so it's moved to a separate module var addToUnscopables$a = addToUnscopables$n; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$a('flat'); // this method was added to unscopables after implementation // in popular engines, so it's moved to a separate module var addToUnscopables$9 = addToUnscopables$n; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$9('flatMap'); var $$4M = _export; var toObject$m = toObject$D; var lengthOfArrayLike$f = lengthOfArrayLike$C; var setArrayLength = arraySetLength; var deletePropertyOrThrow = deletePropertyOrThrow$4; var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$7; // IE8- var INCORRECT_RESULT = [].unshift(0) !== 1; // V8 ~ Chrome < 71 and Safari <= 15.4, FF < 23 throws InternalError var properErrorOnNonWritableLength = function () { try { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).unshift(); } catch (error) { return error instanceof TypeError; } }; var FORCED$t = INCORRECT_RESULT || !properErrorOnNonWritableLength(); // `Array.prototype.unshift` method // https://tc39.es/ecma262/#sec-array.prototype.unshift $$4M({ target: 'Array', proto: true, arity: 1, forced: FORCED$t }, { // eslint-disable-next-line no-unused-vars -- required for `.length` unshift: function unshift(item) { var O = toObject$m(this); var len = lengthOfArrayLike$f(O); var argCount = arguments.length; if (argCount) { doesNotExceedSafeInteger$1(len + argCount); var k = len; while (k--) { var to = k + argCount; if (k in O) O[to] = O[k]; else deletePropertyOrThrow(O, to); } for (var j = 0; j < argCount; j++) { O[j] = arguments[j]; } } return setArrayLength(O, len + argCount); } }); var lengthOfArrayLike$e = lengthOfArrayLike$C; var toIntegerOrInfinity$h = toIntegerOrInfinity$p; var $RangeError$d = RangeError; // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with var arrayWith$2 = function (O, C, index, value) { var len = lengthOfArrayLike$e(O); var relativeIndex = toIntegerOrInfinity$h(index); var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex; if (actualIndex >= len || actualIndex < 0) throw $RangeError$d('Incorrect index'); var A = new C(len); var k = 0; for (; k < len; k++) A[k] = k === actualIndex ? value : O[k]; return A; }; var $$4L = _export; var arrayWith$1 = arrayWith$2; var toIndexedObject$6 = toIndexedObject$k; var $Array$4 = Array; // `Array.prototype.with` method // https://tc39.es/ecma262/#sec-array.prototype.with $$4L({ target: 'Array', proto: true }, { 'with': function (index, value) { return arrayWith$1(toIndexedObject$6(this), $Array$4, index, value); } }); // eslint-disable-next-line es/no-typed-arrays -- safe var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; var defineBuiltIn$n = defineBuiltIn$u; var defineBuiltIns$b = function (target, src, options) { for (var key in src) defineBuiltIn$n(target, key, src[key], options); return target; }; var isPrototypeOf$8 = objectIsPrototypeOf; var $TypeError$v = TypeError; var anInstance$f = function (it, Prototype) { if (isPrototypeOf$8(Prototype, it)) return it; throw $TypeError$v('Incorrect invocation'); }; var toIntegerOrInfinity$g = toIntegerOrInfinity$p; var toLength$b = toLength$d; var $RangeError$c = RangeError; // `ToIndex` abstract operation // https://tc39.es/ecma262/#sec-toindex var toIndex$5 = function (it) { if (it === undefined) return 0; var number = toIntegerOrInfinity$g(it); var length = toLength$b(number); if (number !== length) throw $RangeError$c('Wrong length or index'); return length; }; // `Math.sign` method implementation // https://tc39.es/ecma262/#sec-math.sign // eslint-disable-next-line es/no-math-sign -- safe var mathSign = Math.sign || function sign(x) { var n = +x; // eslint-disable-next-line no-self-compare -- NaN check return n === 0 || n !== n ? n : n < 0 ? -1 : 1; }; // IEEE754 conversions based on https://github.com/feross/ieee754 var sign$3 = mathSign; var trunc$1 = mathTrunc; var $Array$3 = Array; var abs$8 = Math.abs; var pow$5 = Math.pow; var floor$8 = Math.floor; var log$8 = Math.log; var LN2$2 = Math.LN2; var roundToEven = function (number) { var truncated = trunc$1(number); var delta = abs$8(number - truncated); if (delta > 0.5 || delta === 0.5 && truncated % 2 !== 0) { return truncated + sign$3(number); } return truncated; }; var pack = function (number, mantissaLength, bytes) { var buffer = $Array$3(bytes); var exponentLength = bytes * 8 - mantissaLength - 1; var eMax = (1 << exponentLength) - 1; var eBias = eMax >> 1; var rt = mantissaLength === 23 ? pow$5(2, -24) - pow$5(2, -77) : 0; var s = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; var index = 0; var exponent, mantissa, c; number = abs$8(number); // eslint-disable-next-line no-self-compare -- NaN check if (number !== number || number === Infinity) { // eslint-disable-next-line no-self-compare -- NaN check mantissa = number !== number ? 1 : 0; exponent = eMax; } else { exponent = floor$8(log$8(number) / LN2$2); c = pow$5(2, -exponent); if (number * c < 1) { exponent--; c *= 2; } if (exponent + eBias >= 1) { number += rt / c; } else { number += rt * pow$5(2, 1 - eBias); } if (number * c >= 2) { exponent++; c /= 2; } if (exponent + eBias >= eMax) { mantissa = 0; exponent = eMax; } else if (exponent + eBias >= 1) { mantissa = roundToEven((number * c - 1) * pow$5(2, mantissaLength)); exponent += eBias; } else { mantissa = roundToEven(number * pow$5(2, eBias - 1) * pow$5(2, mantissaLength)); exponent = 0; } } while (mantissaLength >= 8) { buffer[index++] = mantissa & 255; mantissa /= 256; mantissaLength -= 8; } exponent = exponent << mantissaLength | mantissa; exponentLength += mantissaLength; while (exponentLength > 0) { buffer[index++] = exponent & 255; exponent /= 256; exponentLength -= 8; } buffer[--index] |= s * 128; return buffer; }; var unpack = function (buffer, mantissaLength) { var bytes = buffer.length; var exponentLength = bytes * 8 - mantissaLength - 1; var eMax = (1 << exponentLength) - 1; var eBias = eMax >> 1; var nBits = exponentLength - 7; var index = bytes - 1; var s = buffer[index--]; var exponent = s & 127; var mantissa; s >>= 7; while (nBits > 0) { exponent = exponent * 256 + buffer[index--]; nBits -= 8; } mantissa = exponent & (1 << -nBits) - 1; exponent >>= -nBits; nBits += mantissaLength; while (nBits > 0) { mantissa = mantissa * 256 + buffer[index--]; nBits -= 8; } if (exponent === 0) { exponent = 1 - eBias; } else if (exponent === eMax) { return mantissa ? NaN : s ? -Infinity : Infinity; } else { mantissa += pow$5(2, mantissaLength); exponent -= eBias; } return (s ? -1 : 1) * mantissa * pow$5(2, exponent - mantissaLength); }; var ieee754 = { pack: pack, unpack: unpack }; var global$R = global$16; var uncurryThis$1u = functionUncurryThis; var DESCRIPTORS$D = descriptors; var NATIVE_ARRAY_BUFFER$2 = arrayBufferBasicDetection; var FunctionName = functionName; var createNonEnumerableProperty$c = createNonEnumerableProperty$k; var defineBuiltInAccessor$k = defineBuiltInAccessor$o; var defineBuiltIns$a = defineBuiltIns$b; var fails$15 = fails$1u; var anInstance$e = anInstance$f; var toIntegerOrInfinity$f = toIntegerOrInfinity$p; var toLength$a = toLength$d; var toIndex$4 = toIndex$5; var IEEE754$1 = ieee754; var getPrototypeOf$e = objectGetPrototypeOf$2; var setPrototypeOf$6 = objectSetPrototypeOf$1; var getOwnPropertyNames$5 = objectGetOwnPropertyNames.f; var arrayFill = arrayFill$1; var arraySlice$8 = arraySliceSimple; var setToStringTag$8 = setToStringTag$d; var InternalStateModule$k = internalState; var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER; var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; var ARRAY_BUFFER$1 = 'ArrayBuffer'; var DATA_VIEW = 'DataView'; var PROTOTYPE = 'prototype'; var WRONG_LENGTH$1 = 'Wrong length'; var WRONG_INDEX = 'Wrong index'; var getInternalArrayBufferState = InternalStateModule$k.getterFor(ARRAY_BUFFER$1); var getInternalDataViewState = InternalStateModule$k.getterFor(DATA_VIEW); var setInternalState$k = InternalStateModule$k.set; var NativeArrayBuffer$1 = global$R[ARRAY_BUFFER$1]; var $ArrayBuffer = NativeArrayBuffer$1; var ArrayBufferPrototype$3 = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; var $DataView = global$R[DATA_VIEW]; var DataViewPrototype$2 = $DataView && $DataView[PROTOTYPE]; var ObjectPrototype$3 = Object.prototype; var Array$3 = global$R.Array; var RangeError$4 = global$R.RangeError; var fill = uncurryThis$1u(arrayFill); var reverse = uncurryThis$1u([].reverse); var packIEEE754$2 = IEEE754$1.pack; var unpackIEEE754$2 = IEEE754$1.unpack; var packInt8 = function (number) { return [number & 0xFF]; }; var packInt16 = function (number) { return [number & 0xFF, number >> 8 & 0xFF]; }; var packInt32 = function (number) { return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF]; }; var unpackInt32 = function (buffer) { return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; }; var packFloat32 = function (number) { return packIEEE754$2(number, 23, 4); }; var packFloat64 = function (number) { return packIEEE754$2(number, 52, 8); }; var addGetter$2 = function (Constructor, key, getInternalState) { defineBuiltInAccessor$k(Constructor[PROTOTYPE], key, { configurable: true, get: function () { return getInternalState(this)[key]; } }); }; var get$5 = function (view, count, index, isLittleEndian) { var store = getInternalDataViewState(view); var intIndex = toIndex$4(index); var boolIsLittleEndian = !!isLittleEndian; if (intIndex + count > store.byteLength) throw RangeError$4(WRONG_INDEX); var bytes = store.bytes; var start = intIndex + store.byteOffset; var pack = arraySlice$8(bytes, start, start + count); return boolIsLittleEndian ? pack : reverse(pack); }; var set$a = function (view, count, index, conversion, value, isLittleEndian) { var store = getInternalDataViewState(view); var intIndex = toIndex$4(index); var pack = conversion(+value); var boolIsLittleEndian = !!isLittleEndian; if (intIndex + count > store.byteLength) throw RangeError$4(WRONG_INDEX); var bytes = store.bytes; var start = intIndex + store.byteOffset; for (var i = 0; i < count; i++) bytes[start + i] = pack[boolIsLittleEndian ? i : count - i - 1]; }; if (!NATIVE_ARRAY_BUFFER$2) { $ArrayBuffer = function ArrayBuffer(length) { anInstance$e(this, ArrayBufferPrototype$3); var byteLength = toIndex$4(length); setInternalState$k(this, { type: ARRAY_BUFFER$1, bytes: fill(Array$3(byteLength), 0), byteLength: byteLength }); if (!DESCRIPTORS$D) { this.byteLength = byteLength; this.detached = false; } }; ArrayBufferPrototype$3 = $ArrayBuffer[PROTOTYPE]; $DataView = function DataView(buffer, byteOffset, byteLength) { anInstance$e(this, DataViewPrototype$2); anInstance$e(buffer, ArrayBufferPrototype$3); var bufferState = getInternalArrayBufferState(buffer); var bufferLength = bufferState.byteLength; var offset = toIntegerOrInfinity$f(byteOffset); if (offset < 0 || offset > bufferLength) throw RangeError$4('Wrong offset'); byteLength = byteLength === undefined ? bufferLength - offset : toLength$a(byteLength); if (offset + byteLength > bufferLength) throw RangeError$4(WRONG_LENGTH$1); setInternalState$k(this, { type: DATA_VIEW, buffer: buffer, byteLength: byteLength, byteOffset: offset, bytes: bufferState.bytes }); if (!DESCRIPTORS$D) { this.buffer = buffer; this.byteLength = byteLength; this.byteOffset = offset; } }; DataViewPrototype$2 = $DataView[PROTOTYPE]; if (DESCRIPTORS$D) { addGetter$2($ArrayBuffer, 'byteLength', getInternalArrayBufferState); addGetter$2($DataView, 'buffer', getInternalDataViewState); addGetter$2($DataView, 'byteLength', getInternalDataViewState); addGetter$2($DataView, 'byteOffset', getInternalDataViewState); } defineBuiltIns$a(DataViewPrototype$2, { getInt8: function getInt8(byteOffset) { return get$5(this, 1, byteOffset)[0] << 24 >> 24; }, getUint8: function getUint8(byteOffset) { return get$5(this, 1, byteOffset)[0]; }, getInt16: function getInt16(byteOffset /* , littleEndian */) { var bytes = get$5(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false); return (bytes[1] << 8 | bytes[0]) << 16 >> 16; }, getUint16: function getUint16(byteOffset /* , littleEndian */) { var bytes = get$5(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false); return bytes[1] << 8 | bytes[0]; }, getInt32: function getInt32(byteOffset /* , littleEndian */) { return unpackInt32(get$5(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)); }, getUint32: function getUint32(byteOffset /* , littleEndian */) { return unpackInt32(get$5(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0; }, getFloat32: function getFloat32(byteOffset /* , littleEndian */) { return unpackIEEE754$2(get$5(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23); }, getFloat64: function getFloat64(byteOffset /* , littleEndian */) { return unpackIEEE754$2(get$5(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52); }, setInt8: function setInt8(byteOffset, value) { set$a(this, 1, byteOffset, packInt8, value); }, setUint8: function setUint8(byteOffset, value) { set$a(this, 1, byteOffset, packInt8, value); }, setInt16: function setInt16(byteOffset, value /* , littleEndian */) { set$a(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false); }, setUint16: function setUint16(byteOffset, value /* , littleEndian */) { set$a(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false); }, setInt32: function setInt32(byteOffset, value /* , littleEndian */) { set$a(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false); }, setUint32: function setUint32(byteOffset, value /* , littleEndian */) { set$a(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false); }, setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { set$a(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false); }, setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { set$a(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false); } }); } else { var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME$2 && NativeArrayBuffer$1.name !== ARRAY_BUFFER$1; /* eslint-disable no-new -- required for testing */ if (!fails$15(function () { NativeArrayBuffer$1(1); }) || !fails$15(function () { new NativeArrayBuffer$1(-1); }) || fails$15(function () { new NativeArrayBuffer$1(); new NativeArrayBuffer$1(1.5); new NativeArrayBuffer$1(NaN); return NativeArrayBuffer$1.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; })) { /* eslint-enable no-new -- required for testing */ $ArrayBuffer = function ArrayBuffer(length) { anInstance$e(this, ArrayBufferPrototype$3); return new NativeArrayBuffer$1(toIndex$4(length)); }; $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype$3; for (var keys$2 = getOwnPropertyNames$5(NativeArrayBuffer$1), j = 0, key$2; keys$2.length > j;) { if (!((key$2 = keys$2[j++]) in $ArrayBuffer)) { createNonEnumerableProperty$c($ArrayBuffer, key$2, NativeArrayBuffer$1[key$2]); } } ArrayBufferPrototype$3.constructor = $ArrayBuffer; } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty$c(NativeArrayBuffer$1, 'name', ARRAY_BUFFER$1); } // WebKit bug - the same parent prototype for typed arrays and data view if (setPrototypeOf$6 && getPrototypeOf$e(DataViewPrototype$2) !== ObjectPrototype$3) { setPrototypeOf$6(DataViewPrototype$2, ObjectPrototype$3); } // iOS Safari 7.x bug var testView = new $DataView(new $ArrayBuffer(2)); var $setInt8 = uncurryThis$1u(DataViewPrototype$2.setInt8); testView.setInt8(0, 2147483648); testView.setInt8(1, 2147483649); if (testView.getInt8(0) || !testView.getInt8(1)) defineBuiltIns$a(DataViewPrototype$2, { setInt8: function setInt8(byteOffset, value) { $setInt8(this, byteOffset, value << 24 >> 24); }, setUint8: function setUint8(byteOffset, value) { $setInt8(this, byteOffset, value << 24 >> 24); } }, { unsafe: true }); } setToStringTag$8($ArrayBuffer, ARRAY_BUFFER$1); setToStringTag$8($DataView, DATA_VIEW); var arrayBuffer = { ArrayBuffer: $ArrayBuffer, DataView: $DataView }; var $$4K = _export; var global$Q = global$16; var arrayBufferModule = arrayBuffer; var setSpecies$5 = setSpecies$7; var ARRAY_BUFFER = 'ArrayBuffer'; var ArrayBuffer$5 = arrayBufferModule[ARRAY_BUFFER]; var NativeArrayBuffer = global$Q[ARRAY_BUFFER]; // `ArrayBuffer` constructor // https://tc39.es/ecma262/#sec-arraybuffer-constructor $$4K({ global: true, constructor: true, forced: NativeArrayBuffer !== ArrayBuffer$5 }, { ArrayBuffer: ArrayBuffer$5 }); setSpecies$5(ARRAY_BUFFER); var NATIVE_ARRAY_BUFFER$1 = arrayBufferBasicDetection; var DESCRIPTORS$C = descriptors; var global$P = global$16; var isCallable$p = isCallable$K; var isObject$y = isObject$K; var hasOwn$q = hasOwnProperty_1; var classof$i = classof$q; var tryToString$1 = tryToString$7; var createNonEnumerableProperty$b = createNonEnumerableProperty$k; var defineBuiltIn$m = defineBuiltIn$u; var defineBuiltInAccessor$j = defineBuiltInAccessor$o; var isPrototypeOf$7 = objectIsPrototypeOf; var getPrototypeOf$d = objectGetPrototypeOf$2; var setPrototypeOf$5 = objectSetPrototypeOf$1; var wellKnownSymbol$z = wellKnownSymbol$T; var uid$3 = uid$7; var InternalStateModule$j = internalState; var enforceInternalState$3 = InternalStateModule$j.enforce; var getInternalState$d = InternalStateModule$j.get; var Int8Array$4 = global$P.Int8Array; var Int8ArrayPrototype$1 = Int8Array$4 && Int8Array$4.prototype; var Uint8ClampedArray$1 = global$P.Uint8ClampedArray; var Uint8ClampedArrayPrototype = Uint8ClampedArray$1 && Uint8ClampedArray$1.prototype; var TypedArray$1 = Int8Array$4 && getPrototypeOf$d(Int8Array$4); var TypedArrayPrototype$2 = Int8ArrayPrototype$1 && getPrototypeOf$d(Int8ArrayPrototype$1); var ObjectPrototype$2 = Object.prototype; var TypeError$7 = global$P.TypeError; var TO_STRING_TAG$8 = wellKnownSymbol$z('toStringTag'); var TYPED_ARRAY_TAG$1 = uid$3('TYPED_ARRAY_TAG'); var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; // Fixing native typed arrays in Opera Presto crashes the browser, see #595 var NATIVE_ARRAY_BUFFER_VIEWS$3 = NATIVE_ARRAY_BUFFER$1 && !!setPrototypeOf$5 && classof$i(global$P.opera) !== 'Opera'; var TYPED_ARRAY_TAG_REQUIRED = false; var NAME$1, Constructor, Prototype; var TypedArrayConstructorsList = { Int8Array: 1, Uint8Array: 1, Uint8ClampedArray: 1, Int16Array: 2, Uint16Array: 2, Int32Array: 4, Uint32Array: 4, Float32Array: 4, Float64Array: 8 }; var BigIntArrayConstructorsList = { BigInt64Array: 8, BigUint64Array: 8 }; var isView = function isView(it) { if (!isObject$y(it)) return false; var klass = classof$i(it); return klass === 'DataView' || hasOwn$q(TypedArrayConstructorsList, klass) || hasOwn$q(BigIntArrayConstructorsList, klass); }; var getTypedArrayConstructor$6 = function (it) { var proto = getPrototypeOf$d(it); if (!isObject$y(proto)) return; var state = getInternalState$d(proto); return (state && hasOwn$q(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor$6(proto); }; var isTypedArray$1 = function (it) { if (!isObject$y(it)) return false; var klass = classof$i(it); return hasOwn$q(TypedArrayConstructorsList, klass) || hasOwn$q(BigIntArrayConstructorsList, klass); }; var aTypedArray$x = function (it) { if (isTypedArray$1(it)) return it; throw TypeError$7('Target is not a typed array'); }; var aTypedArrayConstructor$5 = function (C) { if (isCallable$p(C) && (!setPrototypeOf$5 || isPrototypeOf$7(TypedArray$1, C))) return C; throw TypeError$7(tryToString$1(C) + ' is not a typed array constructor'); }; var exportTypedArrayMethod$y = function (KEY, property, forced, options) { if (!DESCRIPTORS$C) return; if (forced) for (var ARRAY in TypedArrayConstructorsList) { var TypedArrayConstructor = global$P[ARRAY]; if (TypedArrayConstructor && hasOwn$q(TypedArrayConstructor.prototype, KEY)) try { delete TypedArrayConstructor.prototype[KEY]; } catch (error) { // old WebKit bug - some methods are non-configurable try { TypedArrayConstructor.prototype[KEY] = property; } catch (error2) { /* empty */ } } } if (!TypedArrayPrototype$2[KEY] || forced) { defineBuiltIn$m(TypedArrayPrototype$2, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS$3 && Int8ArrayPrototype$1[KEY] || property, options); } }; var exportTypedArrayStaticMethod$3 = function (KEY, property, forced) { var ARRAY, TypedArrayConstructor; if (!DESCRIPTORS$C) return; if (setPrototypeOf$5) { if (forced) for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = global$P[ARRAY]; if (TypedArrayConstructor && hasOwn$q(TypedArrayConstructor, KEY)) try { delete TypedArrayConstructor[KEY]; } catch (error) { /* empty */ } } if (!TypedArray$1[KEY] || forced) { // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable try { return defineBuiltIn$m(TypedArray$1, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS$3 && TypedArray$1[KEY] || property); } catch (error) { /* empty */ } } else return; } for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = global$P[ARRAY]; if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { defineBuiltIn$m(TypedArrayConstructor, KEY, property); } } }; for (NAME$1 in TypedArrayConstructorsList) { Constructor = global$P[NAME$1]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState$3(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; else NATIVE_ARRAY_BUFFER_VIEWS$3 = false; } for (NAME$1 in BigIntArrayConstructorsList) { Constructor = global$P[NAME$1]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState$3(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; } // WebKit bug - typed arrays constructors prototype is Object.prototype if (!NATIVE_ARRAY_BUFFER_VIEWS$3 || !isCallable$p(TypedArray$1) || TypedArray$1 === Function.prototype) { // eslint-disable-next-line no-shadow -- safe TypedArray$1 = function TypedArray() { throw TypeError$7('Incorrect invocation'); }; if (NATIVE_ARRAY_BUFFER_VIEWS$3) for (NAME$1 in TypedArrayConstructorsList) { if (global$P[NAME$1]) setPrototypeOf$5(global$P[NAME$1], TypedArray$1); } } if (!NATIVE_ARRAY_BUFFER_VIEWS$3 || !TypedArrayPrototype$2 || TypedArrayPrototype$2 === ObjectPrototype$2) { TypedArrayPrototype$2 = TypedArray$1.prototype; if (NATIVE_ARRAY_BUFFER_VIEWS$3) for (NAME$1 in TypedArrayConstructorsList) { if (global$P[NAME$1]) setPrototypeOf$5(global$P[NAME$1].prototype, TypedArrayPrototype$2); } } // WebKit bug - one more object in Uint8ClampedArray prototype chain if (NATIVE_ARRAY_BUFFER_VIEWS$3 && getPrototypeOf$d(Uint8ClampedArrayPrototype) !== TypedArrayPrototype$2) { setPrototypeOf$5(Uint8ClampedArrayPrototype, TypedArrayPrototype$2); } if (DESCRIPTORS$C && !hasOwn$q(TypedArrayPrototype$2, TO_STRING_TAG$8)) { TYPED_ARRAY_TAG_REQUIRED = true; defineBuiltInAccessor$j(TypedArrayPrototype$2, TO_STRING_TAG$8, { configurable: true, get: function () { return isObject$y(this) ? this[TYPED_ARRAY_TAG$1] : undefined; } }); for (NAME$1 in TypedArrayConstructorsList) if (global$P[NAME$1]) { createNonEnumerableProperty$b(global$P[NAME$1], TYPED_ARRAY_TAG$1, NAME$1); } } var arrayBufferViewCore = { NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS$3, TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG$1, aTypedArray: aTypedArray$x, aTypedArrayConstructor: aTypedArrayConstructor$5, exportTypedArrayMethod: exportTypedArrayMethod$y, exportTypedArrayStaticMethod: exportTypedArrayStaticMethod$3, getTypedArrayConstructor: getTypedArrayConstructor$6, isView: isView, isTypedArray: isTypedArray$1, TypedArray: TypedArray$1, TypedArrayPrototype: TypedArrayPrototype$2 }; var $$4J = _export; var ArrayBufferViewCore$B = arrayBufferViewCore; var NATIVE_ARRAY_BUFFER_VIEWS$2 = ArrayBufferViewCore$B.NATIVE_ARRAY_BUFFER_VIEWS; // `ArrayBuffer.isView` method // https://tc39.es/ecma262/#sec-arraybuffer.isview $$4J({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS$2 }, { isView: ArrayBufferViewCore$B.isView }); var isConstructor$5 = isConstructor$a; var tryToString = tryToString$7; var $TypeError$u = TypeError; // `Assert: IsConstructor(argument) is true` var aConstructor$5 = function (argument) { if (isConstructor$5(argument)) return argument; throw $TypeError$u(tryToString(argument) + ' is not a constructor'); }; var anObject$13 = anObject$1f; var aConstructor$4 = aConstructor$5; var isNullOrUndefined$g = isNullOrUndefined$k; var wellKnownSymbol$y = wellKnownSymbol$T; var SPECIES$2 = wellKnownSymbol$y('species'); // `SpeciesConstructor` abstract operation // https://tc39.es/ecma262/#sec-speciesconstructor var speciesConstructor$6 = function (O, defaultConstructor) { var C = anObject$13(O).constructor; var S; return C === undefined || isNullOrUndefined$g(S = anObject$13(C)[SPECIES$2]) ? defaultConstructor : aConstructor$4(S); }; var $$4I = _export; var uncurryThis$1t = functionUncurryThisClause; var fails$14 = fails$1u; var ArrayBufferModule$2 = arrayBuffer; var anObject$12 = anObject$1f; var toAbsoluteIndex$3 = toAbsoluteIndex$b; var toLength$9 = toLength$d; var speciesConstructor$5 = speciesConstructor$6; var ArrayBuffer$4 = ArrayBufferModule$2.ArrayBuffer; var DataView$3 = ArrayBufferModule$2.DataView; var DataViewPrototype$1 = DataView$3.prototype; var nativeArrayBufferSlice = uncurryThis$1t(ArrayBuffer$4.prototype.slice); var getUint8$1 = uncurryThis$1t(DataViewPrototype$1.getUint8); var setUint8$1 = uncurryThis$1t(DataViewPrototype$1.setUint8); var INCORRECT_SLICE = fails$14(function () { return !new ArrayBuffer$4(2).slice(1, undefined).byteLength; }); // `ArrayBuffer.prototype.slice` method // https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice $$4I({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { slice: function slice(start, end) { if (nativeArrayBufferSlice && end === undefined) { return nativeArrayBufferSlice(anObject$12(this), start); // FF fix } var length = anObject$12(this).byteLength; var first = toAbsoluteIndex$3(start, length); var fin = toAbsoluteIndex$3(end === undefined ? length : end, length); var result = new (speciesConstructor$5(this, ArrayBuffer$4))(toLength$9(fin - first)); var viewSource = new DataView$3(this); var viewTarget = new DataView$3(result); var index = 0; while (first < fin) { setUint8$1(viewTarget, index++, getUint8$1(viewSource, first++)); } return result; } }); var $$4H = _export; var ArrayBufferModule$1 = arrayBuffer; var NATIVE_ARRAY_BUFFER = arrayBufferBasicDetection; // `DataView` constructor // https://tc39.es/ecma262/#sec-dataview-constructor $$4H({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, { DataView: ArrayBufferModule$1.DataView }); var $$4G = _export; var uncurryThis$1s = functionUncurryThis; var fails$13 = fails$1u; // IE8- non-standard case var FORCED$s = fails$13(function () { // eslint-disable-next-line es/no-date-prototype-getyear-setyear -- detection return new Date(16e11).getYear() !== 120; }); var getFullYear = uncurryThis$1s(Date.prototype.getFullYear); // `Date.prototype.getYear` method // https://tc39.es/ecma262/#sec-date.prototype.getyear $$4G({ target: 'Date', proto: true, forced: FORCED$s }, { getYear: function getYear() { return getFullYear(this) - 1900; } }); // TODO: Remove from `core-js@4` var $$4F = _export; var uncurryThis$1r = functionUncurryThis; var $Date = Date; var thisTimeValue$4 = uncurryThis$1r($Date.prototype.getTime); // `Date.now` method // https://tc39.es/ecma262/#sec-date.now $$4F({ target: 'Date', stat: true }, { now: function now() { return thisTimeValue$4(new $Date()); } }); var $$4E = _export; var uncurryThis$1q = functionUncurryThis; var toIntegerOrInfinity$e = toIntegerOrInfinity$p; var DatePrototype$3 = Date.prototype; var thisTimeValue$3 = uncurryThis$1q(DatePrototype$3.getTime); var setFullYear = uncurryThis$1q(DatePrototype$3.setFullYear); // `Date.prototype.setYear` method // https://tc39.es/ecma262/#sec-date.prototype.setyear $$4E({ target: 'Date', proto: true }, { setYear: function setYear(year) { // validate thisTimeValue$3(this); var yi = toIntegerOrInfinity$e(year); var yyyy = yi >= 0 && yi <= 99 ? yi + 1900 : yi; return setFullYear(this, yyyy); } }); var $$4D = _export; // `Date.prototype.toGMTString` method // https://tc39.es/ecma262/#sec-date.prototype.togmtstring $$4D({ target: 'Date', proto: true }, { toGMTString: Date.prototype.toUTCString }); var toIntegerOrInfinity$d = toIntegerOrInfinity$p; var toString$C = toString$I; var requireObjectCoercible$m = requireObjectCoercible$p; var $RangeError$b = RangeError; // `String.prototype.repeat` method implementation // https://tc39.es/ecma262/#sec-string.prototype.repeat var stringRepeat = function repeat(count) { var str = toString$C(requireObjectCoercible$m(this)); var result = ''; var n = toIntegerOrInfinity$d(count); if (n < 0 || n === Infinity) throw $RangeError$b('Wrong number of repetitions'); for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; return result; }; // https://github.com/tc39/proposal-string-pad-start-end var uncurryThis$1p = functionUncurryThis; var toLength$8 = toLength$d; var toString$B = toString$I; var $repeat$2 = stringRepeat; var requireObjectCoercible$l = requireObjectCoercible$p; var repeat$3 = uncurryThis$1p($repeat$2); var stringSlice$i = uncurryThis$1p(''.slice); var ceil = Math.ceil; // `String.prototype.{ padStart, padEnd }` methods implementation var createMethod$4 = function (IS_END) { return function ($this, maxLength, fillString) { var S = toString$B(requireObjectCoercible$l($this)); var intMaxLength = toLength$8(maxLength); var stringLength = S.length; var fillStr = fillString === undefined ? ' ' : toString$B(fillString); var fillLen, stringFiller; if (intMaxLength <= stringLength || fillStr === '') return S; fillLen = intMaxLength - stringLength; stringFiller = repeat$3(fillStr, ceil(fillLen / fillStr.length)); if (stringFiller.length > fillLen) stringFiller = stringSlice$i(stringFiller, 0, fillLen); return IS_END ? S + stringFiller : stringFiller + S; }; }; var stringPad = { // `String.prototype.padStart` method // https://tc39.es/ecma262/#sec-string.prototype.padstart start: createMethod$4(false), // `String.prototype.padEnd` method // https://tc39.es/ecma262/#sec-string.prototype.padend end: createMethod$4(true) }; var uncurryThis$1o = functionUncurryThis; var fails$12 = fails$1u; var padStart = stringPad.start; var $RangeError$a = RangeError; var $isFinite$2 = isFinite; var abs$7 = Math.abs; var DatePrototype$2 = Date.prototype; var nativeDateToISOString = DatePrototype$2.toISOString; var thisTimeValue$2 = uncurryThis$1o(DatePrototype$2.getTime); var getUTCDate = uncurryThis$1o(DatePrototype$2.getUTCDate); var getUTCFullYear = uncurryThis$1o(DatePrototype$2.getUTCFullYear); var getUTCHours = uncurryThis$1o(DatePrototype$2.getUTCHours); var getUTCMilliseconds = uncurryThis$1o(DatePrototype$2.getUTCMilliseconds); var getUTCMinutes = uncurryThis$1o(DatePrototype$2.getUTCMinutes); var getUTCMonth = uncurryThis$1o(DatePrototype$2.getUTCMonth); var getUTCSeconds = uncurryThis$1o(DatePrototype$2.getUTCSeconds); // `Date.prototype.toISOString` method implementation // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit fails here: var dateToIsoString = (fails$12(function () { return nativeDateToISOString.call(new Date(-5e13 - 1)) !== '0385-07-25T07:06:39.999Z'; }) || !fails$12(function () { nativeDateToISOString.call(new Date(NaN)); })) ? function toISOString() { if (!$isFinite$2(thisTimeValue$2(this))) throw $RangeError$a('Invalid time value'); var date = this; var year = getUTCFullYear(date); var milliseconds = getUTCMilliseconds(date); var sign = year < 0 ? '-' : year > 9999 ? '+' : ''; return sign + padStart(abs$7(year), sign ? 6 : 4, 0) + '-' + padStart(getUTCMonth(date) + 1, 2, 0) + '-' + padStart(getUTCDate(date), 2, 0) + 'T' + padStart(getUTCHours(date), 2, 0) + ':' + padStart(getUTCMinutes(date), 2, 0) + ':' + padStart(getUTCSeconds(date), 2, 0) + '.' + padStart(milliseconds, 3, 0) + 'Z'; } : nativeDateToISOString; var $$4C = _export; var toISOString = dateToIsoString; // `Date.prototype.toISOString` method // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit has a broken implementations $$4C({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== toISOString }, { toISOString: toISOString }); var $$4B = _export; var fails$11 = fails$1u; var toObject$l = toObject$D; var toPrimitive$2 = toPrimitive$4; var FORCED$r = fails$11(function () { return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; }); // `Date.prototype.toJSON` method // https://tc39.es/ecma262/#sec-date.prototype.tojson $$4B({ target: 'Date', proto: true, arity: 1, forced: FORCED$r }, { // eslint-disable-next-line no-unused-vars -- required for `.length` toJSON: function toJSON(key) { var O = toObject$l(this); var pv = toPrimitive$2(O, 'number'); return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); var anObject$11 = anObject$1f; var ordinaryToPrimitive = ordinaryToPrimitive$2; var $TypeError$t = TypeError; // `Date.prototype[@@toPrimitive](hint)` method implementation // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive var dateToPrimitive$1 = function (hint) { anObject$11(this); if (hint === 'string' || hint === 'default') hint = 'string'; else if (hint !== 'number') throw $TypeError$t('Incorrect hint'); return ordinaryToPrimitive(this, hint); }; var hasOwn$p = hasOwnProperty_1; var defineBuiltIn$l = defineBuiltIn$u; var dateToPrimitive = dateToPrimitive$1; var wellKnownSymbol$x = wellKnownSymbol$T; var TO_PRIMITIVE = wellKnownSymbol$x('toPrimitive'); var DatePrototype$1 = Date.prototype; // `Date.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive if (!hasOwn$p(DatePrototype$1, TO_PRIMITIVE)) { defineBuiltIn$l(DatePrototype$1, TO_PRIMITIVE, dateToPrimitive); } // TODO: Remove from `core-js@4` var uncurryThis$1n = functionUncurryThis; var defineBuiltIn$k = defineBuiltIn$u; var DatePrototype = Date.prototype; var INVALID_DATE = 'Invalid Date'; var TO_STRING$1 = 'toString'; var nativeDateToString = uncurryThis$1n(DatePrototype[TO_STRING$1]); var thisTimeValue$1 = uncurryThis$1n(DatePrototype.getTime); // `Date.prototype.toString` method // https://tc39.es/ecma262/#sec-date.prototype.tostring if (String(new Date(NaN)) !== INVALID_DATE) { defineBuiltIn$k(DatePrototype, TO_STRING$1, function toString() { var value = thisTimeValue$1(this); // eslint-disable-next-line no-self-compare -- NaN check return value === value ? nativeDateToString(this) : INVALID_DATE; }); } var $$4A = _export; var uncurryThis$1m = functionUncurryThis; var toString$A = toString$I; var charAt$j = uncurryThis$1m(''.charAt); var charCodeAt$7 = uncurryThis$1m(''.charCodeAt); var exec$e = uncurryThis$1m(/./.exec); var numberToString$2 = uncurryThis$1m(1.0.toString); var toUpperCase = uncurryThis$1m(''.toUpperCase); var raw = /[\w*+\-./@]/; var hex$1 = function (code, length) { var result = numberToString$2(code, 16); while (result.length < length) result = '0' + result; return result; }; // `escape` method // https://tc39.es/ecma262/#sec-escape-string $$4A({ global: true }, { escape: function escape(string) { var str = toString$A(string); var result = ''; var length = str.length; var index = 0; var chr, code; while (index < length) { chr = charAt$j(str, index++); if (exec$e(raw, chr)) { result += chr; } else { code = charCodeAt$7(chr, 0); if (code < 256) { result += '%' + hex$1(code, 2); } else { result += '%u' + toUpperCase(hex$1(code, 4)); } } } return result; } }); var uncurryThis$1l = functionUncurryThis; var aCallable$E = aCallable$N; var isObject$x = isObject$K; var hasOwn$o = hasOwnProperty_1; var arraySlice$7 = arraySlice$b; var NATIVE_BIND = functionBindNative; var $Function = Function; var concat$3 = uncurryThis$1l([].concat); var join$8 = uncurryThis$1l([].join); var factories = {}; var construct = function (C, argsLength, args) { if (!hasOwn$o(factories, argsLength)) { var list = []; var i = 0; for (; i < argsLength; i++) list[i] = 'a[' + i + ']'; factories[argsLength] = $Function('C,a', 'return new C(' + join$8(list, ',') + ')'); } return factories[argsLength](C, args); }; // `Function.prototype.bind` method implementation // https://tc39.es/ecma262/#sec-function.prototype.bind // eslint-disable-next-line es/no-function-prototype-bind -- detection var functionBind = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) { var F = aCallable$E(this); var Prototype = F.prototype; var partArgs = arraySlice$7(arguments, 1); var boundFunction = function bound(/* args... */) { var args = concat$3(partArgs, arraySlice$7(arguments)); return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args); }; if (isObject$x(Prototype)) boundFunction.prototype = Prototype; return boundFunction; }; // TODO: Remove from `core-js@4` var $$4z = _export; var bind$p = functionBind; // `Function.prototype.bind` method // https://tc39.es/ecma262/#sec-function.prototype.bind // eslint-disable-next-line es/no-function-prototype-bind -- detection $$4z({ target: 'Function', proto: true, forced: Function.bind !== bind$p }, { bind: bind$p }); var isCallable$o = isCallable$K; var isObject$w = isObject$K; var definePropertyModule$5 = objectDefineProperty; var getPrototypeOf$c = objectGetPrototypeOf$2; var wellKnownSymbol$w = wellKnownSymbol$T; var makeBuiltIn$1 = makeBuiltInExports; var HAS_INSTANCE = wellKnownSymbol$w('hasInstance'); var FunctionPrototype$2 = Function.prototype; // `Function.prototype[@@hasInstance]` method // https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance if (!(HAS_INSTANCE in FunctionPrototype$2)) { definePropertyModule$5.f(FunctionPrototype$2, HAS_INSTANCE, { value: makeBuiltIn$1(function (O) { if (!isCallable$o(this) || !isObject$w(O)) return false; var P = this.prototype; if (!isObject$w(P)) return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while (O = getPrototypeOf$c(O)) if (P === O) return true; return false; }, HAS_INSTANCE) }); } var DESCRIPTORS$B = descriptors; var FUNCTION_NAME_EXISTS = functionName.EXISTS; var uncurryThis$1k = functionUncurryThis; var defineBuiltInAccessor$i = defineBuiltInAccessor$o; var FunctionPrototype$1 = Function.prototype; var functionToString = uncurryThis$1k(FunctionPrototype$1.toString); var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/; var regExpExec$4 = uncurryThis$1k(nameRE.exec); var NAME = 'name'; // Function instances `.name` property // https://tc39.es/ecma262/#sec-function-instances-name if (DESCRIPTORS$B && !FUNCTION_NAME_EXISTS) { defineBuiltInAccessor$i(FunctionPrototype$1, NAME, { configurable: true, get: function () { try { return regExpExec$4(nameRE, functionToString(this))[1]; } catch (error) { return ''; } } }); } var $$4y = _export; var global$O = global$16; // `globalThis` object // https://tc39.es/ecma262/#sec-globalthis $$4y({ global: true, forced: global$O.globalThis !== global$O }, { globalThis: global$O }); var global$N = global$16; var setToStringTag$7 = setToStringTag$d; // JSON[@@toStringTag] property // https://tc39.es/ecma262/#sec-json-@@tostringtag setToStringTag$7(global$N.JSON, 'JSON', true); var internalMetadata = {exports: {}}; // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it var fails$10 = fails$1u; var arrayBufferNonExtensible = fails$10(function () { if (typeof ArrayBuffer == 'function') { var buffer = new ArrayBuffer(8); // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 }); } }); var fails$$ = fails$1u; var isObject$v = isObject$K; var classof$h = classofRaw$2; var ARRAY_BUFFER_NON_EXTENSIBLE$2 = arrayBufferNonExtensible; // eslint-disable-next-line es/no-object-isextensible -- safe var $isExtensible$2 = Object.isExtensible; var FAILS_ON_PRIMITIVES$6 = fails$$(function () { $isExtensible$2(1); }); // `Object.isExtensible` method // https://tc39.es/ecma262/#sec-object.isextensible var objectIsExtensible = (FAILS_ON_PRIMITIVES$6 || ARRAY_BUFFER_NON_EXTENSIBLE$2) ? function isExtensible(it) { if (!isObject$v(it)) return false; if (ARRAY_BUFFER_NON_EXTENSIBLE$2 && classof$h(it) === 'ArrayBuffer') return false; return $isExtensible$2 ? $isExtensible$2(it) : true; } : $isExtensible$2; var fails$_ = fails$1u; var freezing = !fails$_(function () { // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing return Object.isExtensible(Object.preventExtensions({})); }); var $$4x = _export; var uncurryThis$1j = functionUncurryThis; var hiddenKeys = hiddenKeys$6; var isObject$u = isObject$K; var hasOwn$n = hasOwnProperty_1; var defineProperty$a = objectDefineProperty.f; var getOwnPropertyNamesModule = objectGetOwnPropertyNames; var getOwnPropertyNamesExternalModule = objectGetOwnPropertyNamesExternal; var isExtensible$1 = objectIsExtensible; var uid$2 = uid$7; var FREEZING$7 = freezing; var REQUIRED = false; var METADATA$1 = uid$2('meta'); var id$1 = 0; var setMetadata = function (it) { defineProperty$a(it, METADATA$1, { value: { objectID: 'O' + id$1++, // object ID weakData: {} // weak collections IDs } }); }; var fastKey$1 = function (it, create) { // return a primitive with prefix if (!isObject$u(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!hasOwn$n(it, METADATA$1)) { // can't set metadata to uncaught frozen object if (!isExtensible$1(it)) return 'F'; // not necessary to add metadata if (!create) return 'E'; // add missing metadata setMetadata(it); // return object ID } return it[METADATA$1].objectID; }; var getWeakData$1 = function (it, create) { if (!hasOwn$n(it, METADATA$1)) { // can't set metadata to uncaught frozen object if (!isExtensible$1(it)) return true; // not necessary to add metadata if (!create) return false; // add missing metadata setMetadata(it); // return the store of weak collections IDs } return it[METADATA$1].weakData; }; // add metadata on freeze-family methods calling var onFreeze$3 = function (it) { if (FREEZING$7 && REQUIRED && isExtensible$1(it) && !hasOwn$n(it, METADATA$1)) setMetadata(it); return it; }; var enable = function () { meta.enable = function () { /* empty */ }; REQUIRED = true; var getOwnPropertyNames = getOwnPropertyNamesModule.f; var splice = uncurryThis$1j([].splice); var test = {}; test[METADATA$1] = 1; // prevent exposing of metadata key if (getOwnPropertyNames(test).length) { getOwnPropertyNamesModule.f = function (it) { var result = getOwnPropertyNames(it); for (var i = 0, length = result.length; i < length; i++) { if (result[i] === METADATA$1) { splice(result, i, 1); break; } } return result; }; $$4x({ target: 'Object', stat: true, forced: true }, { getOwnPropertyNames: getOwnPropertyNamesExternalModule.f }); } }; var meta = internalMetadata.exports = { enable: enable, fastKey: fastKey$1, getWeakData: getWeakData$1, onFreeze: onFreeze$3 }; hiddenKeys[METADATA$1] = true; var internalMetadataExports = internalMetadata.exports; var $$4w = _export; var global$M = global$16; var uncurryThis$1i = functionUncurryThis; var isForced$3 = isForced_1; var defineBuiltIn$j = defineBuiltIn$u; var InternalMetadataModule$1 = internalMetadataExports; var iterate$E = iterate$G; var anInstance$d = anInstance$f; var isCallable$n = isCallable$K; var isNullOrUndefined$f = isNullOrUndefined$k; var isObject$t = isObject$K; var fails$Z = fails$1u; var checkCorrectnessOfIteration$2 = checkCorrectnessOfIteration$4; var setToStringTag$6 = setToStringTag$d; var inheritIfRequired$4 = inheritIfRequired$6; var collection$4 = function (CONSTRUCTOR_NAME, wrapper, common) { var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; var ADDER = IS_MAP ? 'set' : 'add'; var NativeConstructor = global$M[CONSTRUCTOR_NAME]; var NativePrototype = NativeConstructor && NativeConstructor.prototype; var Constructor = NativeConstructor; var exported = {}; var fixMethod = function (KEY) { var uncurriedNativeMethod = uncurryThis$1i(NativePrototype[KEY]); defineBuiltIn$j(NativePrototype, KEY, KEY === 'add' ? function add(value) { uncurriedNativeMethod(this, value === 0 ? 0 : value); return this; } : KEY === 'delete' ? function (key) { return IS_WEAK && !isObject$t(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : KEY === 'get' ? function get(key) { return IS_WEAK && !isObject$t(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : KEY === 'has' ? function has(key) { return IS_WEAK && !isObject$t(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : function set(key, value) { uncurriedNativeMethod(this, key === 0 ? 0 : key, value); return this; } ); }; var REPLACE = isForced$3( CONSTRUCTOR_NAME, !isCallable$n(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$Z(function () { new NativeConstructor().entries().next(); })) ); if (REPLACE) { // create collection constructor Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); InternalMetadataModule$1.enable(); } else if (isForced$3(CONSTRUCTOR_NAME, true)) { var instance = new Constructor(); // early implementations not supports chaining var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance; // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false var THROWS_ON_PRIMITIVES = fails$Z(function () { instance.has(1); }); // most early implementations doesn't supports iterables, most modern - not close it correctly // eslint-disable-next-line no-new -- required for testing var ACCEPT_ITERABLES = checkCorrectnessOfIteration$2(function (iterable) { new NativeConstructor(iterable); }); // for early implementations -0 and +0 not the same var BUGGY_ZERO = !IS_WEAK && fails$Z(function () { // V8 ~ Chromium 42- fails only with 5+ elements var $instance = new NativeConstructor(); var index = 5; while (index--) $instance[ADDER](index, index); return !$instance.has(-0); }); if (!ACCEPT_ITERABLES) { Constructor = wrapper(function (dummy, iterable) { anInstance$d(dummy, NativePrototype); var that = inheritIfRequired$4(new NativeConstructor(), dummy, Constructor); if (!isNullOrUndefined$f(iterable)) iterate$E(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); return that; }); Constructor.prototype = NativePrototype; NativePrototype.constructor = Constructor; } if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { fixMethod('delete'); fixMethod('has'); IS_MAP && fixMethod('get'); } if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); // weak collections should not contains .clear method if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; } exported[CONSTRUCTOR_NAME] = Constructor; $$4w({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported); setToStringTag$6(Constructor, CONSTRUCTOR_NAME); if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); return Constructor; }; var create$e = objectCreate$1; var defineBuiltInAccessor$h = defineBuiltInAccessor$o; var defineBuiltIns$9 = defineBuiltIns$b; var bind$o = functionBindContext; var anInstance$c = anInstance$f; var isNullOrUndefined$e = isNullOrUndefined$k; var iterate$D = iterate$G; var defineIterator$1 = iteratorDefine; var createIterResultObject$e = createIterResultObject$g; var setSpecies$4 = setSpecies$7; var DESCRIPTORS$A = descriptors; var fastKey = internalMetadataExports.fastKey; var InternalStateModule$i = internalState; var setInternalState$j = InternalStateModule$i.set; var internalStateGetterFor$1 = InternalStateModule$i.getterFor; var collectionStrong$2 = { getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { var Constructor = wrapper(function (that, iterable) { anInstance$c(that, Prototype); setInternalState$j(that, { type: CONSTRUCTOR_NAME, index: create$e(null), first: undefined, last: undefined, size: 0 }); if (!DESCRIPTORS$A) that.size = 0; if (!isNullOrUndefined$e(iterable)) iterate$D(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); }); var Prototype = Constructor.prototype; var getInternalState = internalStateGetterFor$1(CONSTRUCTOR_NAME); var define = function (that, key, value) { var state = getInternalState(that); var entry = getEntry(that, key); var previous, index; // change existing entry if (entry) { entry.value = value; // create new entry } else { state.last = entry = { index: index = fastKey(key, true), key: key, value: value, previous: previous = state.last, next: undefined, removed: false }; if (!state.first) state.first = entry; if (previous) previous.next = entry; if (DESCRIPTORS$A) state.size++; else that.size++; // add to index if (index !== 'F') state.index[index] = entry; } return that; }; var getEntry = function (that, key) { var state = getInternalState(that); // fast case var index = fastKey(key); var entry; if (index !== 'F') return state.index[index]; // frozen object case for (entry = state.first; entry; entry = entry.next) { if (entry.key === key) return entry; } }; defineBuiltIns$9(Prototype, { // `{ Map, Set }.prototype.clear()` methods // https://tc39.es/ecma262/#sec-map.prototype.clear // https://tc39.es/ecma262/#sec-set.prototype.clear clear: function clear() { var that = this; var state = getInternalState(that); var data = state.index; var entry = state.first; while (entry) { entry.removed = true; if (entry.previous) entry.previous = entry.previous.next = undefined; delete data[entry.index]; entry = entry.next; } state.first = state.last = undefined; if (DESCRIPTORS$A) state.size = 0; else that.size = 0; }, // `{ Map, Set }.prototype.delete(key)` methods // https://tc39.es/ecma262/#sec-map.prototype.delete // https://tc39.es/ecma262/#sec-set.prototype.delete 'delete': function (key) { var that = this; var state = getInternalState(that); var entry = getEntry(that, key); if (entry) { var next = entry.next; var prev = entry.previous; delete state.index[entry.index]; entry.removed = true; if (prev) prev.next = next; if (next) next.previous = prev; if (state.first === entry) state.first = next; if (state.last === entry) state.last = prev; if (DESCRIPTORS$A) state.size--; else that.size--; } return !!entry; }, // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods // https://tc39.es/ecma262/#sec-map.prototype.foreach // https://tc39.es/ecma262/#sec-set.prototype.foreach forEach: function forEach(callbackfn /* , that = undefined */) { var state = getInternalState(this); var boundFunction = bind$o(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var entry; while (entry = entry ? entry.next : state.first) { boundFunction(entry.value, entry.key, this); // revert to the last existing entry while (entry && entry.removed) entry = entry.previous; } }, // `{ Map, Set}.prototype.has(key)` methods // https://tc39.es/ecma262/#sec-map.prototype.has // https://tc39.es/ecma262/#sec-set.prototype.has has: function has(key) { return !!getEntry(this, key); } }); defineBuiltIns$9(Prototype, IS_MAP ? { // `Map.prototype.get(key)` method // https://tc39.es/ecma262/#sec-map.prototype.get get: function get(key) { var entry = getEntry(this, key); return entry && entry.value; }, // `Map.prototype.set(key, value)` method // https://tc39.es/ecma262/#sec-map.prototype.set set: function set(key, value) { return define(this, key === 0 ? 0 : key, value); } } : { // `Set.prototype.add(value)` method // https://tc39.es/ecma262/#sec-set.prototype.add add: function add(value) { return define(this, value = value === 0 ? 0 : value, value); } }); if (DESCRIPTORS$A) defineBuiltInAccessor$h(Prototype, 'size', { configurable: true, get: function () { return getInternalState(this).size; } }); return Constructor; }, setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) { var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; var getInternalCollectionState = internalStateGetterFor$1(CONSTRUCTOR_NAME); var getInternalIteratorState = internalStateGetterFor$1(ITERATOR_NAME); // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods // https://tc39.es/ecma262/#sec-map.prototype.entries // https://tc39.es/ecma262/#sec-map.prototype.keys // https://tc39.es/ecma262/#sec-map.prototype.values // https://tc39.es/ecma262/#sec-map.prototype-@@iterator // https://tc39.es/ecma262/#sec-set.prototype.entries // https://tc39.es/ecma262/#sec-set.prototype.keys // https://tc39.es/ecma262/#sec-set.prototype.values // https://tc39.es/ecma262/#sec-set.prototype-@@iterator defineIterator$1(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { setInternalState$j(this, { type: ITERATOR_NAME, target: iterated, state: getInternalCollectionState(iterated), kind: kind, last: undefined }); }, function () { var state = getInternalIteratorState(this); var kind = state.kind; var entry = state.last; // revert to the last existing entry while (entry && entry.removed) entry = entry.previous; // get next entry if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { // or finish the iteration state.target = undefined; return createIterResultObject$e(undefined, true); } // return step by kind if (kind === 'keys') return createIterResultObject$e(entry.key, false); if (kind === 'values') return createIterResultObject$e(entry.value, false); return createIterResultObject$e([entry.key, entry.value], false); }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // `{ Map, Set }.prototype[@@species]` accessors // https://tc39.es/ecma262/#sec-get-map-@@species // https://tc39.es/ecma262/#sec-get-set-@@species setSpecies$4(CONSTRUCTOR_NAME); } }; var collection$3 = collection$4; var collectionStrong$1 = collectionStrong$2; // `Map` constructor // https://tc39.es/ecma262/#sec-map-objects collection$3('Map', function (init) { return function Map() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong$1); var log$7 = Math.log; // `Math.log1p` method implementation // https://tc39.es/ecma262/#sec-math.log1p // eslint-disable-next-line es/no-math-log1p -- safe var mathLog1p = Math.log1p || function log1p(x) { var n = +x; return n > -1e-8 && n < 1e-8 ? n - n * n / 2 : log$7(1 + n); }; var $$4v = _export; var log1p$1 = mathLog1p; // eslint-disable-next-line es/no-math-acosh -- required for testing var $acosh = Math.acosh; var log$6 = Math.log; var sqrt$2 = Math.sqrt; var LN2$1 = Math.LN2; var FORCED$q = !$acosh // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 || Math.floor($acosh(Number.MAX_VALUE)) !== 710 // Tor Browser bug: Math.acosh(Infinity) -> NaN || $acosh(Infinity) !== Infinity; // `Math.acosh` method // https://tc39.es/ecma262/#sec-math.acosh $$4v({ target: 'Math', stat: true, forced: FORCED$q }, { acosh: function acosh(x) { var n = +x; return n < 1 ? NaN : n > 94906265.62425156 ? log$6(n) + LN2$1 : log1p$1(n - 1 + sqrt$2(n - 1) * sqrt$2(n + 1)); } }); var $$4u = _export; // eslint-disable-next-line es/no-math-asinh -- required for testing var $asinh = Math.asinh; var log$5 = Math.log; var sqrt$1 = Math.sqrt; function asinh(x) { var n = +x; return !isFinite(n) || n === 0 ? n : n < 0 ? -asinh(-n) : log$5(n + sqrt$1(n * n + 1)); } var FORCED$p = !($asinh && 1 / $asinh(0) > 0); // `Math.asinh` method // https://tc39.es/ecma262/#sec-math.asinh // Tor Browser bug: Math.asinh(0) -> -0 $$4u({ target: 'Math', stat: true, forced: FORCED$p }, { asinh: asinh }); var $$4t = _export; // eslint-disable-next-line es/no-math-atanh -- required for testing var $atanh = Math.atanh; var log$4 = Math.log; var FORCED$o = !($atanh && 1 / $atanh(-0) < 0); // `Math.atanh` method // https://tc39.es/ecma262/#sec-math.atanh // Tor Browser bug: Math.atanh(-0) -> 0 $$4t({ target: 'Math', stat: true, forced: FORCED$o }, { atanh: function atanh(x) { var n = +x; return n === 0 ? n : log$4((1 + n) / (1 - n)) / 2; } }); var $$4s = _export; var sign$2 = mathSign; var abs$6 = Math.abs; var pow$4 = Math.pow; // `Math.cbrt` method // https://tc39.es/ecma262/#sec-math.cbrt $$4s({ target: 'Math', stat: true }, { cbrt: function cbrt(x) { var n = +x; return sign$2(n) * pow$4(abs$6(n), 1 / 3); } }); var $$4r = _export; var floor$7 = Math.floor; var log$3 = Math.log; var LOG2E = Math.LOG2E; // `Math.clz32` method // https://tc39.es/ecma262/#sec-math.clz32 $$4r({ target: 'Math', stat: true }, { clz32: function clz32(x) { var n = x >>> 0; return n ? 31 - floor$7(log$3(n + 0.5) * LOG2E) : 32; } }); // eslint-disable-next-line es/no-math-expm1 -- safe var $expm1 = Math.expm1; var exp$2 = Math.exp; // `Math.expm1` method implementation // https://tc39.es/ecma262/#sec-math.expm1 var mathExpm1 = (!$expm1 // Old FF bug // eslint-disable-next-line no-loss-of-precision -- required for old engines || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 // Tor Browser bug || $expm1(-2e-17) !== -2e-17 ) ? function expm1(x) { var n = +x; return n === 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp$2(n) - 1; } : $expm1; var $$4q = _export; var expm1$3 = mathExpm1; // eslint-disable-next-line es/no-math-cosh -- required for testing var $cosh = Math.cosh; var abs$5 = Math.abs; var E$1 = Math.E; var FORCED$n = !$cosh || $cosh(710) === Infinity; // `Math.cosh` method // https://tc39.es/ecma262/#sec-math.cosh $$4q({ target: 'Math', stat: true, forced: FORCED$n }, { cosh: function cosh(x) { var t = expm1$3(abs$5(x) - 1) + 1; return (t + 1 / (t * E$1 * E$1)) * (E$1 / 2); } }); var $$4p = _export; var expm1$2 = mathExpm1; // `Math.expm1` method // https://tc39.es/ecma262/#sec-math.expm1 // eslint-disable-next-line es/no-math-expm1 -- required for testing $$4p({ target: 'Math', stat: true, forced: expm1$2 !== Math.expm1 }, { expm1: expm1$2 }); var sign$1 = mathSign; var abs$4 = Math.abs; var pow$3 = Math.pow; var EPSILON = pow$3(2, -52); var EPSILON32 = pow$3(2, -23); var MAX32 = pow$3(2, 127) * (2 - EPSILON32); var MIN32 = pow$3(2, -126); var roundTiesToEven = function (n) { return n + 1 / EPSILON - 1 / EPSILON; }; // `Math.fround` method implementation // https://tc39.es/ecma262/#sec-math.fround // eslint-disable-next-line es/no-math-fround -- safe var mathFround = Math.fround || function fround(x) { var n = +x; var $abs = abs$4(n); var $sign = sign$1(n); var a, result; if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; a = (1 + EPSILON32 / EPSILON) * $abs; result = a - (a - $abs); // eslint-disable-next-line no-self-compare -- NaN check if (result > MAX32 || result !== result) return $sign * Infinity; return $sign * result; }; var $$4o = _export; var fround$1 = mathFround; // `Math.fround` method // https://tc39.es/ecma262/#sec-math.fround $$4o({ target: 'Math', stat: true }, { fround: fround$1 }); var $$4n = _export; // eslint-disable-next-line es/no-math-hypot -- required for testing var $hypot = Math.hypot; var abs$3 = Math.abs; var sqrt = Math.sqrt; // Chrome 77 bug // https://bugs.chromium.org/p/v8/issues/detail?id=9546 var FORCED$m = !!$hypot && $hypot(Infinity, NaN) !== Infinity; // `Math.hypot` method // https://tc39.es/ecma262/#sec-math.hypot $$4n({ target: 'Math', stat: true, arity: 2, forced: FORCED$m }, { // eslint-disable-next-line no-unused-vars -- required for `.length` hypot: function hypot(value1, value2) { var sum = 0; var i = 0; var aLen = arguments.length; var larg = 0; var arg, div; while (i < aLen) { arg = abs$3(arguments[i++]); if (larg < arg) { div = larg / arg; sum = sum * div * div + 1; larg = arg; } else if (arg > 0) { div = arg / larg; sum += div * div; } else sum += arg; } return larg === Infinity ? Infinity : larg * sqrt(sum); } }); var $$4m = _export; var fails$Y = fails$1u; // eslint-disable-next-line es/no-math-imul -- required for testing var $imul = Math.imul; var FORCED$l = fails$Y(function () { return $imul(0xFFFFFFFF, 5) !== -5 || $imul.length !== 2; }); // `Math.imul` method // https://tc39.es/ecma262/#sec-math.imul // some WebKit versions fails with big numbers, some has wrong arity $$4m({ target: 'Math', stat: true, forced: FORCED$l }, { imul: function imul(x, y) { var UINT16 = 0xFFFF; var xn = +x; var yn = +y; var xl = UINT16 & xn; var yl = UINT16 & yn; return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); } }); var log$2 = Math.log; var LOG10E = Math.LOG10E; // eslint-disable-next-line es/no-math-log10 -- safe var mathLog10 = Math.log10 || function log10(x) { return log$2(x) * LOG10E; }; var $$4l = _export; var log10$1 = mathLog10; // `Math.log10` method // https://tc39.es/ecma262/#sec-math.log10 $$4l({ target: 'Math', stat: true }, { log10: log10$1 }); var $$4k = _export; var log1p = mathLog1p; // `Math.log1p` method // https://tc39.es/ecma262/#sec-math.log1p $$4k({ target: 'Math', stat: true }, { log1p: log1p }); var $$4j = _export; var log$1 = Math.log; var LN2 = Math.LN2; // `Math.log2` method // https://tc39.es/ecma262/#sec-math.log2 $$4j({ target: 'Math', stat: true }, { log2: function log2(x) { return log$1(x) / LN2; } }); var $$4i = _export; var sign = mathSign; // `Math.sign` method // https://tc39.es/ecma262/#sec-math.sign $$4i({ target: 'Math', stat: true }, { sign: sign }); var $$4h = _export; var fails$X = fails$1u; var expm1$1 = mathExpm1; var abs$2 = Math.abs; var exp$1 = Math.exp; var E = Math.E; var FORCED$k = fails$X(function () { // eslint-disable-next-line es/no-math-sinh -- required for testing return Math.sinh(-2e-17) !== -2e-17; }); // `Math.sinh` method // https://tc39.es/ecma262/#sec-math.sinh // V8 near Chromium 38 has a problem with very small numbers $$4h({ target: 'Math', stat: true, forced: FORCED$k }, { sinh: function sinh(x) { var n = +x; return abs$2(n) < 1 ? (expm1$1(n) - expm1$1(-n)) / 2 : (exp$1(n - 1) - exp$1(-n - 1)) * (E / 2); } }); var $$4g = _export; var expm1 = mathExpm1; var exp = Math.exp; // `Math.tanh` method // https://tc39.es/ecma262/#sec-math.tanh $$4g({ target: 'Math', stat: true }, { tanh: function tanh(x) { var n = +x; var a = expm1(n); var b = expm1(-n); return a === Infinity ? 1 : b === Infinity ? -1 : (a - b) / (exp(n) + exp(-n)); } }); var setToStringTag$5 = setToStringTag$d; // Math[@@toStringTag] property // https://tc39.es/ecma262/#sec-math-@@tostringtag setToStringTag$5(Math, 'Math', true); var $$4f = _export; var trunc = mathTrunc; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc $$4f({ target: 'Math', stat: true }, { trunc: trunc }); var uncurryThis$1h = functionUncurryThis; // `thisNumberValue` abstract operation // https://tc39.es/ecma262/#sec-thisnumbervalue var thisNumberValue$5 = uncurryThis$1h(1.0.valueOf); // a string of all valid unicode whitespaces var whitespaces$6 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; var uncurryThis$1g = functionUncurryThis; var requireObjectCoercible$k = requireObjectCoercible$p; var toString$z = toString$I; var whitespaces$5 = whitespaces$6; var replace$8 = uncurryThis$1g(''.replace); var ltrim = RegExp('^[' + whitespaces$5 + ']+'); var rtrim = RegExp('(^|[^' + whitespaces$5 + '])[' + whitespaces$5 + ']+$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation var createMethod$3 = function (TYPE) { return function ($this) { var string = toString$z(requireObjectCoercible$k($this)); if (TYPE & 1) string = replace$8(string, ltrim, ''); if (TYPE & 2) string = replace$8(string, rtrim, '$1'); return string; }; }; var stringTrim = { // `String.prototype.{ trimLeft, trimStart }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimstart start: createMethod$3(1), // `String.prototype.{ trimRight, trimEnd }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimend end: createMethod$3(2), // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim trim: createMethod$3(3) }; var $$4e = _export; var IS_PURE$i = isPure; var DESCRIPTORS$z = descriptors; var global$L = global$16; var path = path$2; var uncurryThis$1f = functionUncurryThis; var isForced$2 = isForced_1; var hasOwn$m = hasOwnProperty_1; var inheritIfRequired$3 = inheritIfRequired$6; var isPrototypeOf$6 = objectIsPrototypeOf; var isSymbol$3 = isSymbol$8; var toPrimitive$1 = toPrimitive$4; var fails$W = fails$1u; var getOwnPropertyNames$4 = objectGetOwnPropertyNames.f; var getOwnPropertyDescriptor$b = objectGetOwnPropertyDescriptor.f; var defineProperty$9 = objectDefineProperty.f; var thisNumberValue$4 = thisNumberValue$5; var trim$2 = stringTrim.trim; var NUMBER = 'Number'; var NativeNumber = global$L[NUMBER]; path[NUMBER]; var NumberPrototype = NativeNumber.prototype; var TypeError$6 = global$L.TypeError; var stringSlice$h = uncurryThis$1f(''.slice); var charCodeAt$6 = uncurryThis$1f(''.charCodeAt); // `ToNumeric` abstract operation // https://tc39.es/ecma262/#sec-tonumeric var toNumeric = function (value) { var primValue = toPrimitive$1(value, 'number'); return typeof primValue == 'bigint' ? primValue : toNumber(primValue); }; // `ToNumber` abstract operation // https://tc39.es/ecma262/#sec-tonumber var toNumber = function (argument) { var it = toPrimitive$1(argument, 'number'); var first, third, radix, maxCode, digits, length, index, code; if (isSymbol$3(it)) throw TypeError$6('Cannot convert a Symbol value to a number'); if (typeof it == 'string' && it.length > 2) { it = trim$2(it); first = charCodeAt$6(it, 0); if (first === 43 || first === 45) { third = charCodeAt$6(it, 2); if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix } else if (first === 48) { switch (charCodeAt$6(it, 1)) { // fast equal of /^0b[01]+$/i case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0o[0-7]+$/i case 79: case 111: radix = 8; maxCode = 55; break; default: return +it; } digits = stringSlice$h(it, 2); length = digits.length; for (index = 0; index < length; index++) { code = charCodeAt$6(digits, index); // parseInt parses a string to a first unavailable symbol // but ToNumber should return NaN if a string contains unavailable symbols if (code < 48 || code > maxCode) return NaN; } return parseInt(digits, radix); } } return +it; }; var FORCED$j = isForced$2(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1')); var calledWithNew = function (dummy) { // includes check on 1..constructor(foo) case return isPrototypeOf$6(NumberPrototype, dummy) && fails$W(function () { thisNumberValue$4(dummy); }); }; // `Number` constructor // https://tc39.es/ecma262/#sec-number-constructor var NumberWrapper = function Number(value) { var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)); return calledWithNew(this) ? inheritIfRequired$3(Object(n), this, NumberWrapper) : n; }; NumberWrapper.prototype = NumberPrototype; if (FORCED$j && !IS_PURE$i) NumberPrototype.constructor = NumberWrapper; $$4e({ global: true, constructor: true, wrap: true, forced: FORCED$j }, { Number: NumberWrapper }); // Use `internal/copy-constructor-properties` helper in `core-js@4` var copyConstructorProperties$1 = function (target, source) { for (var keys = DESCRIPTORS$z ? getOwnPropertyNames$4(source) : ( // ES3: 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES2015 (in case, if modules with ES2015 Number statics required before): 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' + // ESNext 'fromString,range' ).split(','), j = 0, key; keys.length > j; j++) { if (hasOwn$m(source, key = keys[j]) && !hasOwn$m(target, key)) { defineProperty$9(target, key, getOwnPropertyDescriptor$b(source, key)); } } }; if (FORCED$j || IS_PURE$i) copyConstructorProperties$1(path[NUMBER], NativeNumber); var $$4d = _export; // `Number.EPSILON` constant // https://tc39.es/ecma262/#sec-number.epsilon $$4d({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { EPSILON: Math.pow(2, -52) }); var global$K = global$16; var globalIsFinite = global$K.isFinite; // `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite // eslint-disable-next-line es/no-number-isfinite -- safe var numberIsFinite$2 = Number.isFinite || function isFinite(it) { return typeof it == 'number' && globalIsFinite(it); }; var $$4c = _export; var numberIsFinite$1 = numberIsFinite$2; // `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite $$4c({ target: 'Number', stat: true }, { isFinite: numberIsFinite$1 }); var isObject$s = isObject$K; var floor$6 = Math.floor; // `IsIntegralNumber` abstract operation // https://tc39.es/ecma262/#sec-isintegralnumber // eslint-disable-next-line es/no-number-isinteger -- safe var isIntegralNumber$3 = Number.isInteger || function isInteger(it) { return !isObject$s(it) && isFinite(it) && floor$6(it) === it; }; var $$4b = _export; var isIntegralNumber$2 = isIntegralNumber$3; // `Number.isInteger` method // https://tc39.es/ecma262/#sec-number.isinteger $$4b({ target: 'Number', stat: true }, { isInteger: isIntegralNumber$2 }); var $$4a = _export; // `Number.isNaN` method // https://tc39.es/ecma262/#sec-number.isnan $$4a({ target: 'Number', stat: true }, { isNaN: function isNaN(number) { // eslint-disable-next-line no-self-compare -- NaN check return number !== number; } }); var $$49 = _export; var isIntegralNumber$1 = isIntegralNumber$3; var abs$1 = Math.abs; // `Number.isSafeInteger` method // https://tc39.es/ecma262/#sec-number.issafeinteger $$49({ target: 'Number', stat: true }, { isSafeInteger: function isSafeInteger(number) { return isIntegralNumber$1(number) && abs$1(number) <= 0x1FFFFFFFFFFFFF; } }); var $$48 = _export; // `Number.MAX_SAFE_INTEGER` constant // https://tc39.es/ecma262/#sec-number.max_safe_integer $$48({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF }); var $$47 = _export; // `Number.MIN_SAFE_INTEGER` constant // https://tc39.es/ecma262/#sec-number.min_safe_integer $$47({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF }); var global$J = global$16; var fails$V = fails$1u; var uncurryThis$1e = functionUncurryThis; var toString$y = toString$I; var trim$1 = stringTrim.trim; var whitespaces$4 = whitespaces$6; var charAt$i = uncurryThis$1e(''.charAt); var $parseFloat$1 = global$J.parseFloat; var Symbol$6 = global$J.Symbol; var ITERATOR$6 = Symbol$6 && Symbol$6.iterator; var FORCED$i = 1 / $parseFloat$1(whitespaces$4 + '-0') !== -Infinity // MS Edge 18- broken with boxed symbols || (ITERATOR$6 && !fails$V(function () { $parseFloat$1(Object(ITERATOR$6)); })); // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string var numberParseFloat = FORCED$i ? function parseFloat(string) { var trimmedString = trim$1(toString$y(string)); var result = $parseFloat$1(trimmedString); return result === 0 && charAt$i(trimmedString, 0) === '-' ? -0 : result; } : $parseFloat$1; var $$46 = _export; var parseFloat$1 = numberParseFloat; // `Number.parseFloat` method // https://tc39.es/ecma262/#sec-number.parseFloat // eslint-disable-next-line es/no-number-parsefloat -- required for testing $$46({ target: 'Number', stat: true, forced: Number.parseFloat !== parseFloat$1 }, { parseFloat: parseFloat$1 }); var global$I = global$16; var fails$U = fails$1u; var uncurryThis$1d = functionUncurryThis; var toString$x = toString$I; var trim = stringTrim.trim; var whitespaces$3 = whitespaces$6; var $parseInt$2 = global$I.parseInt; var Symbol$5 = global$I.Symbol; var ITERATOR$5 = Symbol$5 && Symbol$5.iterator; var hex = /^[+-]?0x/i; var exec$d = uncurryThis$1d(hex.exec); var FORCED$h = $parseInt$2(whitespaces$3 + '08') !== 8 || $parseInt$2(whitespaces$3 + '0x16') !== 22 // MS Edge 18- broken with boxed symbols || (ITERATOR$5 && !fails$U(function () { $parseInt$2(Object(ITERATOR$5)); })); // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix var numberParseInt = FORCED$h ? function parseInt(string, radix) { var S = trim(toString$x(string)); return $parseInt$2(S, (radix >>> 0) || (exec$d(hex, S) ? 16 : 10)); } : $parseInt$2; var $$45 = _export; var parseInt$3 = numberParseInt; // `Number.parseInt` method // https://tc39.es/ecma262/#sec-number.parseint // eslint-disable-next-line es/no-number-parseint -- required for testing $$45({ target: 'Number', stat: true, forced: Number.parseInt !== parseInt$3 }, { parseInt: parseInt$3 }); var $$44 = _export; var uncurryThis$1c = functionUncurryThis; var toIntegerOrInfinity$c = toIntegerOrInfinity$p; var thisNumberValue$3 = thisNumberValue$5; var $repeat$1 = stringRepeat; var log10 = mathLog10; var fails$T = fails$1u; var $RangeError$9 = RangeError; var $String$2 = String; var $isFinite$1 = isFinite; var abs = Math.abs; var floor$5 = Math.floor; var pow$2 = Math.pow; var round$1 = Math.round; var nativeToExponential = uncurryThis$1c(1.0.toExponential); var repeat$2 = uncurryThis$1c($repeat$1); var stringSlice$g = uncurryThis$1c(''.slice); // Edge 17- var ROUNDS_PROPERLY = nativeToExponential(-6.9e-11, 4) === '-6.9000e-11' // IE11- && Edge 14- && nativeToExponential(1.255, 2) === '1.25e+0' // FF86-, V8 ~ Chrome 49-50 && nativeToExponential(12345, 3) === '1.235e+4' // FF86-, V8 ~ Chrome 49-50 && nativeToExponential(25, 0) === '3e+1'; // IE8- var throwsOnInfinityFraction = function () { return fails$T(function () { nativeToExponential(1, Infinity); }) && fails$T(function () { nativeToExponential(1, -Infinity); }); }; // Safari <11 && FF <50 var properNonFiniteThisCheck = function () { return !fails$T(function () { nativeToExponential(Infinity, Infinity); nativeToExponential(NaN, Infinity); }); }; var FORCED$g = !ROUNDS_PROPERLY || !throwsOnInfinityFraction() || !properNonFiniteThisCheck(); // `Number.prototype.toExponential` method // https://tc39.es/ecma262/#sec-number.prototype.toexponential $$44({ target: 'Number', proto: true, forced: FORCED$g }, { toExponential: function toExponential(fractionDigits) { var x = thisNumberValue$3(this); if (fractionDigits === undefined) return nativeToExponential(x); var f = toIntegerOrInfinity$c(fractionDigits); if (!$isFinite$1(x)) return String(x); // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation if (f < 0 || f > 20) throw $RangeError$9('Incorrect fraction digits'); if (ROUNDS_PROPERLY) return nativeToExponential(x, f); var s = ''; var m = ''; var e = 0; var c = ''; var d = ''; if (x < 0) { s = '-'; x = -x; } if (x === 0) { e = 0; m = repeat$2('0', f + 1); } else { // this block is based on https://gist.github.com/SheetJSDev/1100ad56b9f856c95299ed0e068eea08 // TODO: improve accuracy with big fraction digits var l = log10(x); e = floor$5(l); var n = 0; var w = pow$2(10, e - f); n = round$1(x / w); if (2 * x >= (2 * n + 1) * w) { n += 1; } if (n >= pow$2(10, f + 1)) { n /= 10; e += 1; } m = $String$2(n); } if (f !== 0) { m = stringSlice$g(m, 0, 1) + '.' + stringSlice$g(m, 1); } if (e === 0) { c = '+'; d = '0'; } else { c = e > 0 ? '+' : '-'; d = $String$2(abs(e)); } m += 'e' + c + d; return s + m; } }); var $$43 = _export; var uncurryThis$1b = functionUncurryThis; var toIntegerOrInfinity$b = toIntegerOrInfinity$p; var thisNumberValue$2 = thisNumberValue$5; var $repeat = stringRepeat; var fails$S = fails$1u; var $RangeError$8 = RangeError; var $String$1 = String; var floor$4 = Math.floor; var repeat$1 = uncurryThis$1b($repeat); var stringSlice$f = uncurryThis$1b(''.slice); var nativeToFixed = uncurryThis$1b(1.0.toFixed); var pow$1 = function (x, n, acc) { return n === 0 ? acc : n % 2 === 1 ? pow$1(x, n - 1, acc * x) : pow$1(x * x, n / 2, acc); }; var log = function (x) { var n = 0; var x2 = x; while (x2 >= 4096) { n += 12; x2 /= 4096; } while (x2 >= 2) { n += 1; x2 /= 2; } return n; }; var multiply = function (data, n, c) { var index = -1; var c2 = c; while (++index < 6) { c2 += n * data[index]; data[index] = c2 % 1e7; c2 = floor$4(c2 / 1e7); } }; var divide = function (data, n) { var index = 6; var c = 0; while (--index >= 0) { c += data[index]; data[index] = floor$4(c / n); c = (c % n) * 1e7; } }; var dataToString = function (data) { var index = 6; var s = ''; while (--index >= 0) { if (s !== '' || index === 0 || data[index] !== 0) { var t = $String$1(data[index]); s = s === '' ? t : s + repeat$1('0', 7 - t.length) + t; } } return s; }; var FORCED$f = fails$S(function () { return nativeToFixed(0.00008, 3) !== '0.000' || nativeToFixed(0.9, 0) !== '1' || nativeToFixed(1.255, 2) !== '1.25' || nativeToFixed(1000000000000000128.0, 0) !== '1000000000000000128'; }) || !fails$S(function () { // V8 ~ Android 4.3- nativeToFixed({}); }); // `Number.prototype.toFixed` method // https://tc39.es/ecma262/#sec-number.prototype.tofixed $$43({ target: 'Number', proto: true, forced: FORCED$f }, { toFixed: function toFixed(fractionDigits) { var number = thisNumberValue$2(this); var fractDigits = toIntegerOrInfinity$b(fractionDigits); var data = [0, 0, 0, 0, 0, 0]; var sign = ''; var result = '0'; var e, z, j, k; // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation if (fractDigits < 0 || fractDigits > 20) throw $RangeError$8('Incorrect fraction digits'); // eslint-disable-next-line no-self-compare -- NaN check if (number !== number) return 'NaN'; if (number <= -1e21 || number >= 1e21) return $String$1(number); if (number < 0) { sign = '-'; number = -number; } if (number > 1e-21) { e = log(number * pow$1(2, 69, 1)) - 69; z = e < 0 ? number * pow$1(2, -e, 1) : number / pow$1(2, e, 1); z *= 0x10000000000000; e = 52 - e; if (e > 0) { multiply(data, 0, z); j = fractDigits; while (j >= 7) { multiply(data, 1e7, 0); j -= 7; } multiply(data, pow$1(10, j, 1), 0); j = e - 1; while (j >= 23) { divide(data, 1 << 23); j -= 23; } divide(data, 1 << j); multiply(data, 1, 1); divide(data, 2); result = dataToString(data); } else { multiply(data, 0, z); multiply(data, 1 << -e, 0); result = dataToString(data) + repeat$1('0', fractDigits); } } if (fractDigits > 0) { k = result.length; result = sign + (k <= fractDigits ? '0.' + repeat$1('0', fractDigits - k) + result : stringSlice$f(result, 0, k - fractDigits) + '.' + stringSlice$f(result, k - fractDigits)); } else { result = sign + result; } return result; } }); var $$42 = _export; var uncurryThis$1a = functionUncurryThis; var fails$R = fails$1u; var thisNumberValue$1 = thisNumberValue$5; var nativeToPrecision = uncurryThis$1a(1.0.toPrecision); var FORCED$e = fails$R(function () { // IE7- return nativeToPrecision(1, undefined) !== '1'; }) || !fails$R(function () { // V8 ~ Android 4.3- nativeToPrecision({}); }); // `Number.prototype.toPrecision` method // https://tc39.es/ecma262/#sec-number.prototype.toprecision $$42({ target: 'Number', proto: true, forced: FORCED$e }, { toPrecision: function toPrecision(precision) { return precision === undefined ? nativeToPrecision(thisNumberValue$1(this)) : nativeToPrecision(thisNumberValue$1(this), precision); } }); var DESCRIPTORS$y = descriptors; var uncurryThis$19 = functionUncurryThis; var call$15 = functionCall; var fails$Q = fails$1u; var objectKeys$3 = objectKeys$6; var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols; var propertyIsEnumerableModule = objectPropertyIsEnumerable; var toObject$k = toObject$D; var IndexedObject$2 = indexedObject; // eslint-disable-next-line es/no-object-assign -- safe var $assign = Object.assign; // eslint-disable-next-line es/no-object-defineproperty -- required for testing var defineProperty$8 = Object.defineProperty; var concat$2 = uncurryThis$19([].concat); // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign var objectAssign = !$assign || fails$Q(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS$y && $assign({ b: 1 }, $assign(defineProperty$8({}, 'a', { enumerable: true, get: function () { defineProperty$8(this, 'b', { value: 3, enumerable: false }); } }), { b: 2 })).b !== 1) return true; // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; // eslint-disable-next-line es/no-symbol -- safe var symbol = Symbol('assign detection'); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return $assign({}, A)[symbol] !== 7 || objectKeys$3($assign({}, B)).join('') !== alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` var T = toObject$k(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; var propertyIsEnumerable = propertyIsEnumerableModule.f; while (argumentsLength > index) { var S = IndexedObject$2(arguments[index++]); var keys = getOwnPropertySymbols ? concat$2(objectKeys$3(S), getOwnPropertySymbols(S)) : objectKeys$3(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS$y || call$15(propertyIsEnumerable, S, key)) T[key] = S[key]; } } return T; } : $assign; var $$41 = _export; var assign$1 = objectAssign; // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign // eslint-disable-next-line es/no-object-assign -- required for testing $$41({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign$1 }, { assign: assign$1 }); // TODO: Remove from `core-js@4` var $$40 = _export; var DESCRIPTORS$x = descriptors; var create$d = objectCreate$1; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create $$40({ target: 'Object', stat: true, sham: !DESCRIPTORS$x }, { create: create$d }); var global$H = global$16; var fails$P = fails$1u; var WEBKIT$1 = engineWebkitVersion; // Forced replacement object prototype accessors methods var objectPrototypeAccessorsForced = !fails$P(function () { // This feature detection crashes old WebKit // https://github.com/zloirock/core-js/issues/232 if (WEBKIT$1 && WEBKIT$1 < 535) return; var key = Math.random(); // In FF throws only define methods // eslint-disable-next-line no-undef, no-useless-call, es/no-legacy-object-prototype-accessor-methods -- required for testing __defineSetter__.call(null, key, function () { /* empty */ }); delete global$H[key]; }); var $$3$ = _export; var DESCRIPTORS$w = descriptors; var FORCED$d = objectPrototypeAccessorsForced; var aCallable$D = aCallable$N; var toObject$j = toObject$D; var definePropertyModule$4 = objectDefineProperty; // `Object.prototype.__defineGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__defineGetter__ if (DESCRIPTORS$w) { $$3$({ target: 'Object', proto: true, forced: FORCED$d }, { __defineGetter__: function __defineGetter__(P, getter) { definePropertyModule$4.f(toObject$j(this), P, { get: aCallable$D(getter), enumerable: true, configurable: true }); } }); } var $$3_ = _export; var DESCRIPTORS$v = descriptors; var defineProperties = objectDefineProperties.f; // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe $$3_({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS$v }, { defineProperties: defineProperties }); var $$3Z = _export; var DESCRIPTORS$u = descriptors; var defineProperty$7 = objectDefineProperty.f; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty // eslint-disable-next-line es/no-object-defineproperty -- safe $$3Z({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty$7, sham: !DESCRIPTORS$u }, { defineProperty: defineProperty$7 }); var $$3Y = _export; var DESCRIPTORS$t = descriptors; var FORCED$c = objectPrototypeAccessorsForced; var aCallable$C = aCallable$N; var toObject$i = toObject$D; var definePropertyModule$3 = objectDefineProperty; // `Object.prototype.__defineSetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__defineSetter__ if (DESCRIPTORS$t) { $$3Y({ target: 'Object', proto: true, forced: FORCED$c }, { __defineSetter__: function __defineSetter__(P, setter) { definePropertyModule$3.f(toObject$i(this), P, { set: aCallable$C(setter), enumerable: true, configurable: true }); } }); } var DESCRIPTORS$s = descriptors; var fails$O = fails$1u; var uncurryThis$18 = functionUncurryThis; var objectGetPrototypeOf$1 = objectGetPrototypeOf$2; var objectKeys$2 = objectKeys$6; var toIndexedObject$5 = toIndexedObject$k; var $propertyIsEnumerable = objectPropertyIsEnumerable.f; var propertyIsEnumerable = uncurryThis$18($propertyIsEnumerable); var push$m = uncurryThis$18([].push); // in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys // of `null` prototype objects var IE_BUG = DESCRIPTORS$s && fails$O(function () { // eslint-disable-next-line es/no-object-create -- safe var O = Object.create(null); O[2] = 2; return !propertyIsEnumerable(O, 2); }); // `Object.{ entries, values }` methods implementation var createMethod$2 = function (TO_ENTRIES) { return function (it) { var O = toIndexedObject$5(it); var keys = objectKeys$2(O); var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf$1(O) === null; var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; if (!DESCRIPTORS$s || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) { push$m(result, TO_ENTRIES ? [key, O[key]] : O[key]); } } return result; }; }; var objectToArray = { // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries entries: createMethod$2(true), // `Object.values` method // https://tc39.es/ecma262/#sec-object.values values: createMethod$2(false) }; var $$3X = _export; var $entries = objectToArray.entries; // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries $$3X({ target: 'Object', stat: true }, { entries: function entries(O) { return $entries(O); } }); var $$3W = _export; var FREEZING$6 = freezing; var fails$N = fails$1u; var isObject$r = isObject$K; var onFreeze$2 = internalMetadataExports.onFreeze; // eslint-disable-next-line es/no-object-freeze -- safe var $freeze = Object.freeze; var FAILS_ON_PRIMITIVES$5 = fails$N(function () { $freeze(1); }); // `Object.freeze` method // https://tc39.es/ecma262/#sec-object.freeze $$3W({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$5, sham: !FREEZING$6 }, { freeze: function freeze(it) { return $freeze && isObject$r(it) ? $freeze(onFreeze$2(it)) : it; } }); var $$3V = _export; var iterate$C = iterate$G; var createProperty$4 = createProperty$b; // `Object.fromEntries` method // https://github.com/tc39/proposal-object-from-entries $$3V({ target: 'Object', stat: true }, { fromEntries: function fromEntries(iterable) { var obj = {}; iterate$C(iterable, function (k, v) { createProperty$4(obj, k, v); }, { AS_ENTRIES: true }); return obj; } }); var $$3U = _export; var fails$M = fails$1u; var toIndexedObject$4 = toIndexedObject$k; var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; var DESCRIPTORS$r = descriptors; var FORCED$b = !DESCRIPTORS$r || fails$M(function () { nativeGetOwnPropertyDescriptor$1(1); }); // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor $$3U({ target: 'Object', stat: true, forced: FORCED$b, sham: !DESCRIPTORS$r }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { return nativeGetOwnPropertyDescriptor$1(toIndexedObject$4(it), key); } }); var $$3T = _export; var DESCRIPTORS$q = descriptors; var ownKeys$1 = ownKeys$3; var toIndexedObject$3 = toIndexedObject$k; var getOwnPropertyDescriptorModule$4 = objectGetOwnPropertyDescriptor; var createProperty$3 = createProperty$b; // `Object.getOwnPropertyDescriptors` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors $$3T({ target: 'Object', stat: true, sham: !DESCRIPTORS$q }, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIndexedObject$3(object); var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$4.f; var keys = ownKeys$1(O); var result = {}; var index = 0; var key, descriptor; while (keys.length > index) { descriptor = getOwnPropertyDescriptor(O, key = keys[index++]); if (descriptor !== undefined) createProperty$3(result, key, descriptor); } return result; } }); var $$3S = _export; var fails$L = fails$1u; var getOwnPropertyNames$3 = objectGetOwnPropertyNamesExternal.f; // eslint-disable-next-line es/no-object-getownpropertynames -- required for testing var FAILS_ON_PRIMITIVES$4 = fails$L(function () { return !Object.getOwnPropertyNames(1); }); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames $$3S({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$4 }, { getOwnPropertyNames: getOwnPropertyNames$3 }); var $$3R = _export; var fails$K = fails$1u; var toObject$h = toObject$D; var nativeGetPrototypeOf = objectGetPrototypeOf$2; var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter; var FAILS_ON_PRIMITIVES$3 = fails$K(function () { nativeGetPrototypeOf(1); }); // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof $$3R({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$3, sham: !CORRECT_PROTOTYPE_GETTER$1 }, { getPrototypeOf: function getPrototypeOf(it) { return nativeGetPrototypeOf(toObject$h(it)); } }); var $$3Q = _export; var hasOwn$l = hasOwnProperty_1; // `Object.hasOwn` method // https://tc39.es/ecma262/#sec-object.hasown $$3Q({ target: 'Object', stat: true }, { hasOwn: hasOwn$l }); // `SameValue` abstract operation // https://tc39.es/ecma262/#sec-samevalue // eslint-disable-next-line es/no-object-is -- safe var sameValue$1 = Object.is || function is(x, y) { // eslint-disable-next-line no-self-compare -- NaN check return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y; }; var $$3P = _export; var is = sameValue$1; // `Object.is` method // https://tc39.es/ecma262/#sec-object.is $$3P({ target: 'Object', stat: true }, { is: is }); var $$3O = _export; var $isExtensible$1 = objectIsExtensible; // `Object.isExtensible` method // https://tc39.es/ecma262/#sec-object.isextensible // eslint-disable-next-line es/no-object-isextensible -- safe $$3O({ target: 'Object', stat: true, forced: Object.isExtensible !== $isExtensible$1 }, { isExtensible: $isExtensible$1 }); var $$3N = _export; var fails$J = fails$1u; var isObject$q = isObject$K; var classof$g = classofRaw$2; var ARRAY_BUFFER_NON_EXTENSIBLE$1 = arrayBufferNonExtensible; // eslint-disable-next-line es/no-object-isfrozen -- safe var $isFrozen = Object.isFrozen; var FORCED$a = ARRAY_BUFFER_NON_EXTENSIBLE$1 || fails$J(function () { $isFrozen(1); }); // `Object.isFrozen` method // https://tc39.es/ecma262/#sec-object.isfrozen $$3N({ target: 'Object', stat: true, forced: FORCED$a }, { isFrozen: function isFrozen(it) { if (!isObject$q(it)) return true; if (ARRAY_BUFFER_NON_EXTENSIBLE$1 && classof$g(it) === 'ArrayBuffer') return true; return $isFrozen ? $isFrozen(it) : false; } }); var $$3M = _export; var fails$I = fails$1u; var isObject$p = isObject$K; var classof$f = classofRaw$2; var ARRAY_BUFFER_NON_EXTENSIBLE = arrayBufferNonExtensible; // eslint-disable-next-line es/no-object-issealed -- safe var $isSealed = Object.isSealed; var FORCED$9 = ARRAY_BUFFER_NON_EXTENSIBLE || fails$I(function () { $isSealed(1); }); // `Object.isSealed` method // https://tc39.es/ecma262/#sec-object.issealed $$3M({ target: 'Object', stat: true, forced: FORCED$9 }, { isSealed: function isSealed(it) { if (!isObject$p(it)) return true; if (ARRAY_BUFFER_NON_EXTENSIBLE && classof$f(it) === 'ArrayBuffer') return true; return $isSealed ? $isSealed(it) : false; } }); var $$3L = _export; var toObject$g = toObject$D; var nativeKeys = objectKeys$6; var fails$H = fails$1u; var FAILS_ON_PRIMITIVES$2 = fails$H(function () { nativeKeys(1); }); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys $$3L({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2 }, { keys: function keys(it) { return nativeKeys(toObject$g(it)); } }); var $$3K = _export; var DESCRIPTORS$p = descriptors; var FORCED$8 = objectPrototypeAccessorsForced; var toObject$f = toObject$D; var toPropertyKey$5 = toPropertyKey$a; var getPrototypeOf$b = objectGetPrototypeOf$2; var getOwnPropertyDescriptor$a = objectGetOwnPropertyDescriptor.f; // `Object.prototype.__lookupGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__lookupGetter__ if (DESCRIPTORS$p) { $$3K({ target: 'Object', proto: true, forced: FORCED$8 }, { __lookupGetter__: function __lookupGetter__(P) { var O = toObject$f(this); var key = toPropertyKey$5(P); var desc; do { if (desc = getOwnPropertyDescriptor$a(O, key)) return desc.get; } while (O = getPrototypeOf$b(O)); } }); } var $$3J = _export; var DESCRIPTORS$o = descriptors; var FORCED$7 = objectPrototypeAccessorsForced; var toObject$e = toObject$D; var toPropertyKey$4 = toPropertyKey$a; var getPrototypeOf$a = objectGetPrototypeOf$2; var getOwnPropertyDescriptor$9 = objectGetOwnPropertyDescriptor.f; // `Object.prototype.__lookupSetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__ if (DESCRIPTORS$o) { $$3J({ target: 'Object', proto: true, forced: FORCED$7 }, { __lookupSetter__: function __lookupSetter__(P) { var O = toObject$e(this); var key = toPropertyKey$4(P); var desc; do { if (desc = getOwnPropertyDescriptor$9(O, key)) return desc.set; } while (O = getPrototypeOf$a(O)); } }); } var $$3I = _export; var isObject$o = isObject$K; var onFreeze$1 = internalMetadataExports.onFreeze; var FREEZING$5 = freezing; var fails$G = fails$1u; // eslint-disable-next-line es/no-object-preventextensions -- safe var $preventExtensions = Object.preventExtensions; var FAILS_ON_PRIMITIVES$1 = fails$G(function () { $preventExtensions(1); }); // `Object.preventExtensions` method // https://tc39.es/ecma262/#sec-object.preventextensions $$3I({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1, sham: !FREEZING$5 }, { preventExtensions: function preventExtensions(it) { return $preventExtensions && isObject$o(it) ? $preventExtensions(onFreeze$1(it)) : it; } }); var DESCRIPTORS$n = descriptors; var defineBuiltInAccessor$g = defineBuiltInAccessor$o; var isObject$n = isObject$K; var toObject$d = toObject$D; var requireObjectCoercible$j = requireObjectCoercible$p; // eslint-disable-next-line es/no-object-getprototypeof -- safe var getPrototypeOf$9 = Object.getPrototypeOf; // eslint-disable-next-line es/no-object-setprototypeof -- safe var setPrototypeOf$4 = Object.setPrototypeOf; var ObjectPrototype$1 = Object.prototype; var PROTO = '__proto__'; // `Object.prototype.__proto__` accessor // https://tc39.es/ecma262/#sec-object.prototype.__proto__ if (DESCRIPTORS$n && getPrototypeOf$9 && setPrototypeOf$4 && !(PROTO in ObjectPrototype$1)) try { defineBuiltInAccessor$g(ObjectPrototype$1, PROTO, { configurable: true, get: function __proto__() { return getPrototypeOf$9(toObject$d(this)); }, set: function __proto__(proto) { var O = requireObjectCoercible$j(this); if (!isObject$n(proto) && proto !== null || !isObject$n(O)) return; setPrototypeOf$4(O, proto); } }); } catch (error) { /* empty */ } var $$3H = _export; var isObject$m = isObject$K; var onFreeze = internalMetadataExports.onFreeze; var FREEZING$4 = freezing; var fails$F = fails$1u; // eslint-disable-next-line es/no-object-seal -- safe var $seal = Object.seal; var FAILS_ON_PRIMITIVES = fails$F(function () { $seal(1); }); // `Object.seal` method // https://tc39.es/ecma262/#sec-object.seal $$3H({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING$4 }, { seal: function seal(it) { return $seal && isObject$m(it) ? $seal(onFreeze(it)) : it; } }); var $$3G = _export; var setPrototypeOf$3 = objectSetPrototypeOf$1; // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof $$3G({ target: 'Object', stat: true }, { setPrototypeOf: setPrototypeOf$3 }); var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport; var classof$e = classof$q; // `Object.prototype.toString` method implementation // https://tc39.es/ecma262/#sec-object.prototype.tostring var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() { return '[object ' + classof$e(this) + ']'; }; var TO_STRING_TAG_SUPPORT = toStringTagSupport; var defineBuiltIn$i = defineBuiltIn$u; var toString$w = objectToString; // `Object.prototype.toString` method // https://tc39.es/ecma262/#sec-object.prototype.tostring if (!TO_STRING_TAG_SUPPORT) { defineBuiltIn$i(Object.prototype, 'toString', toString$w, { unsafe: true }); } var $$3F = _export; var $values = objectToArray.values; // `Object.values` method // https://tc39.es/ecma262/#sec-object.values $$3F({ target: 'Object', stat: true }, { values: function values(O) { return $values(O); } }); var $$3E = _export; var $parseFloat = numberParseFloat; // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string $$3E({ global: true, forced: parseFloat !== $parseFloat }, { parseFloat: $parseFloat }); var $$3D = _export; var $parseInt$1 = numberParseInt; // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix $$3D({ global: true, forced: parseInt !== $parseInt$1 }, { parseInt: $parseInt$1 }); var $TypeError$s = TypeError; var validateArgumentsLength$b = function (passed, required) { if (passed < required) throw $TypeError$s('Not enough arguments'); return passed; }; var userAgent$3 = engineUserAgent; // eslint-disable-next-line redos/no-vulnerable -- safe var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$3); var global$G = global$16; var apply$9 = functionApply$1; var bind$n = functionBindContext; var isCallable$m = isCallable$K; var hasOwn$k = hasOwnProperty_1; var fails$E = fails$1u; var html = html$2; var arraySlice$6 = arraySlice$b; var createElement = documentCreateElement$2; var validateArgumentsLength$a = validateArgumentsLength$b; var IS_IOS$1 = engineIsIos; var IS_NODE$6 = engineIsNode; var set$9 = global$G.setImmediate; var clear = global$G.clearImmediate; var process$3 = global$G.process; var Dispatch = global$G.Dispatch; var Function$2 = global$G.Function; var MessageChannel = global$G.MessageChannel; var String$1 = global$G.String; var counter = 0; var queue$2 = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var $location, defer, channel, port; fails$E(function () { // Deno throws a ReferenceError on `location` access without `--location` flag $location = global$G.location; }); var run = function (id) { if (hasOwn$k(queue$2, id)) { var fn = queue$2[id]; delete queue$2[id]; fn(); } }; var runner = function (id) { return function () { run(id); }; }; var eventListener = function (event) { run(event.data); }; var globalPostMessageDefer = function (id) { // old engines have not location.origin global$G.postMessage(String$1(id), $location.protocol + '//' + $location.host); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!set$9 || !clear) { set$9 = function setImmediate(handler) { validateArgumentsLength$a(arguments.length, 1); var fn = isCallable$m(handler) ? handler : Function$2(handler); var args = arraySlice$6(arguments, 1); queue$2[++counter] = function () { apply$9(fn, undefined, args); }; defer(counter); return counter; }; clear = function clearImmediate(id) { delete queue$2[id]; }; // Node.js 0.8- if (IS_NODE$6) { defer = function (id) { process$3.nextTick(runner(id)); }; // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(runner(id)); }; // Browsers with MessageChannel, includes WebWorkers // except iOS - https://github.com/zloirock/core-js/issues/624 } else if (MessageChannel && !IS_IOS$1) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = eventListener; defer = bind$n(port.postMessage, port); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if ( global$G.addEventListener && isCallable$m(global$G.postMessage) && !global$G.importScripts && $location && $location.protocol !== 'file:' && !fails$E(globalPostMessageDefer) ) { defer = globalPostMessageDefer; global$G.addEventListener('message', eventListener, false); // IE8- } else if (ONREADYSTATECHANGE in createElement('script')) { defer = function (id) { html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run(id); }; }; // Rest old browsers } else { defer = function (id) { setTimeout(runner(id), 0); }; } } var task$1 = { set: set$9, clear: clear }; var Queue$2 = function () { this.head = null; this.tail = null; }; Queue$2.prototype = { add: function (item) { var entry = { item: item, next: null }; var tail = this.tail; if (tail) tail.next = entry; else this.head = entry; this.tail = entry; }, get: function () { var entry = this.head; if (entry) { var next = this.head = entry.next; if (next === null) this.tail = null; return entry.item; } } }; var queue$1 = Queue$2; var userAgent$2 = engineUserAgent; var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$2) && typeof Pebble != 'undefined'; var userAgent$1 = engineUserAgent; var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent$1); var global$F = global$16; var bind$m = functionBindContext; var getOwnPropertyDescriptor$8 = objectGetOwnPropertyDescriptor.f; var macrotask = task$1.set; var Queue$1 = queue$1; var IS_IOS = engineIsIos; var IS_IOS_PEBBLE = engineIsIosPebble; var IS_WEBOS_WEBKIT = engineIsWebosWebkit; var IS_NODE$5 = engineIsNode; var MutationObserver = global$F.MutationObserver || global$F.WebKitMutationObserver; var document$2 = global$F.document; var process$2 = global$F.process; var Promise$6 = global$F.Promise; // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` var queueMicrotaskDescriptor = getOwnPropertyDescriptor$8(global$F, 'queueMicrotask'); var microtask$2 = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; var notify$1, toggle, node, promise, then; // modern engines have queueMicrotask method if (!microtask$2) { var queue = new Queue$1(); var flush = function () { var parent, fn; if (IS_NODE$5 && (parent = process$2.domain)) parent.exit(); while (fn = queue.get()) try { fn(); } catch (error) { if (queue.head) notify$1(); throw error; } if (parent) parent.enter(); }; // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898 if (!IS_IOS && !IS_NODE$5 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) { toggle = true; node = document$2.createTextNode(''); new MutationObserver(flush).observe(node, { characterData: true }); notify$1 = function () { node.data = toggle = !toggle; }; // environments with maybe non-completely correct, but existent Promise } else if (!IS_IOS_PEBBLE && Promise$6 && Promise$6.resolve) { // Promise.resolve without an argument throws an error in LG WebOS 2 promise = Promise$6.resolve(undefined); // workaround of WebKit ~ iOS Safari 10.1 bug promise.constructor = Promise$6; then = bind$m(promise.then, promise); notify$1 = function () { then(flush); }; // Node.js without promises } else if (IS_NODE$5) { notify$1 = function () { process$2.nextTick(flush); }; // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessage // - onreadystatechange // - setTimeout } else { // `webpack` dev server bug on IE global methods - use bind(fn, global) macrotask = bind$m(macrotask, global$F); notify$1 = function () { macrotask(flush); }; } microtask$2 = function (fn) { if (!queue.head) notify$1(); queue.add(fn); }; } var microtask_1 = microtask$2; var hostReportErrors$2 = function (a, b) { try { // eslint-disable-next-line no-console -- safe arguments.length === 1 ? console.error(a) : console.error(a, b); } catch (error) { /* empty */ } }; var perform$7 = function (exec) { try { return { error: false, value: exec() }; } catch (error) { return { error: true, value: error }; } }; var global$E = global$16; var promiseNativeConstructor = global$E.Promise; /* global Deno -- Deno case */ var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object'; var IS_DENO$2 = engineIsDeno; var IS_NODE$4 = engineIsNode; var engineIsBrowser = !IS_DENO$2 && !IS_NODE$4 && typeof window == 'object' && typeof document == 'object'; var global$D = global$16; var NativePromiseConstructor$4 = promiseNativeConstructor; var isCallable$l = isCallable$K; var isForced$1 = isForced_1; var inspectSource$1 = inspectSource$4; var wellKnownSymbol$v = wellKnownSymbol$T; var IS_BROWSER$1 = engineIsBrowser; var IS_DENO$1 = engineIsDeno; var V8_VERSION = engineV8Version; NativePromiseConstructor$4 && NativePromiseConstructor$4.prototype; var SPECIES$1 = wellKnownSymbol$v('species'); var SUBCLASSING = false; var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$l(global$D.PromiseRejectionEvent); var FORCED_PROMISE_CONSTRUCTOR$5 = isForced$1('Promise', function () { var PROMISE_CONSTRUCTOR_SOURCE = inspectSource$1(NativePromiseConstructor$4); var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$4); // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // We can't detect it synchronously, so just check versions if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true; // We can't use @@species feature detection in V8 since it causes // deoptimization and performance degradation // https://github.com/zloirock/core-js/issues/679 if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) { // Detect correctness of subclassing with @@species support var promise = new NativePromiseConstructor$4(function (resolve) { resolve(1); }); var FakePromise = function (exec) { exec(function () { /* empty */ }, function () { /* empty */ }); }; var constructor = promise.constructor = {}; constructor[SPECIES$1] = FakePromise; SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise; if (!SUBCLASSING) return true; // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER$1 || IS_DENO$1) && !NATIVE_PROMISE_REJECTION_EVENT$1; }); var promiseConstructorDetection = { CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5, REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1, SUBCLASSING: SUBCLASSING }; var newPromiseCapability$2 = {}; var aCallable$B = aCallable$N; var $TypeError$r = TypeError; var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw $TypeError$r('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aCallable$B(resolve); this.reject = aCallable$B(reject); }; // `NewPromiseCapability` abstract operation // https://tc39.es/ecma262/#sec-newpromisecapability newPromiseCapability$2.f = function (C) { return new PromiseCapability(C); }; var $$3C = _export; var IS_NODE$3 = engineIsNode; var global$C = global$16; var call$14 = functionCall; var defineBuiltIn$h = defineBuiltIn$u; var setPrototypeOf$2 = objectSetPrototypeOf$1; var setToStringTag$4 = setToStringTag$d; var setSpecies$3 = setSpecies$7; var aCallable$A = aCallable$N; var isCallable$k = isCallable$K; var isObject$l = isObject$K; var anInstance$b = anInstance$f; var speciesConstructor$4 = speciesConstructor$6; var task = task$1.set; var microtask$1 = microtask_1; var hostReportErrors$1 = hostReportErrors$2; var perform$6 = perform$7; var Queue = queue$1; var InternalStateModule$h = internalState; var NativePromiseConstructor$3 = promiseNativeConstructor; var PromiseConstructorDetection = promiseConstructorDetection; var newPromiseCapabilityModule$7 = newPromiseCapability$2; var PROMISE = 'Promise'; var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR; var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT; var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING; var getInternalPromiseState = InternalStateModule$h.getterFor(PROMISE); var setInternalState$i = InternalStateModule$h.set; var NativePromisePrototype$2 = NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype; var PromiseConstructor = NativePromiseConstructor$3; var PromisePrototype = NativePromisePrototype$2; var TypeError$5 = global$C.TypeError; var document$1 = global$C.document; var process$1 = global$C.process; var newPromiseCapability$1 = newPromiseCapabilityModule$7.f; var newGenericPromiseCapability = newPromiseCapability$1; var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$C.dispatchEvent); var UNHANDLED_REJECTION = 'unhandledrejection'; var REJECTION_HANDLED = 'rejectionhandled'; var PENDING$2 = 0; var FULFILLED = 1; var REJECTED = 2; var HANDLED = 1; var UNHANDLED = 2; var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; // helpers var isThenable = function (it) { var then; return isObject$l(it) && isCallable$k(then = it.then) ? then : false; }; var callReaction = function (reaction, state) { var value = state.value; var ok = state.state === FULFILLED; var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (state.rejection === UNHANDLED) onHandleUnhandled(state); state.rejection = HANDLED; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); // can throw if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(TypeError$5('Promise-chain cycle')); } else if (then = isThenable(result)) { call$14(then, result, resolve, reject); } else resolve(result); } else reject(value); } catch (error) { if (domain && !exited) domain.exit(); reject(error); } }; var notify = function (state, isReject) { if (state.notified) return; state.notified = true; microtask$1(function () { var reactions = state.reactions; var reaction; while (reaction = reactions.get()) { callReaction(reaction, state); } state.notified = false; if (isReject && !state.rejection) onUnhandled(state); }); }; var dispatchEvent = function (name, promise, reason) { var event, handler; if (DISPATCH_EVENT) { event = document$1.createEvent('Event'); event.promise = promise; event.reason = reason; event.initEvent(name, false, true); global$C.dispatchEvent(event); } else event = { promise: promise, reason: reason }; if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$C['on' + name])) handler(event); else if (name === UNHANDLED_REJECTION) hostReportErrors$1('Unhandled promise rejection', reason); }; var onUnhandled = function (state) { call$14(task, global$C, function () { var promise = state.facade; var value = state.value; var IS_UNHANDLED = isUnhandled(state); var result; if (IS_UNHANDLED) { result = perform$6(function () { if (IS_NODE$3) { process$1.emit('unhandledRejection', value, promise); } else dispatchEvent(UNHANDLED_REJECTION, promise, value); }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should state.rejection = IS_NODE$3 || isUnhandled(state) ? UNHANDLED : HANDLED; if (result.error) throw result.value; } }); }; var isUnhandled = function (state) { return state.rejection !== HANDLED && !state.parent; }; var onHandleUnhandled = function (state) { call$14(task, global$C, function () { var promise = state.facade; if (IS_NODE$3) { process$1.emit('rejectionHandled', promise); } else dispatchEvent(REJECTION_HANDLED, promise, state.value); }); }; var bind$l = function (fn, state, unwrap) { return function (value) { fn(state, value, unwrap); }; }; var internalReject = function (state, value, unwrap) { if (state.done) return; state.done = true; if (unwrap) state = unwrap; state.value = value; state.state = REJECTED; notify(state, true); }; var internalResolve = function (state, value, unwrap) { if (state.done) return; state.done = true; if (unwrap) state = unwrap; try { if (state.facade === value) throw TypeError$5("Promise can't be resolved itself"); var then = isThenable(value); if (then) { microtask$1(function () { var wrapper = { done: false }; try { call$14(then, value, bind$l(internalResolve, wrapper, state), bind$l(internalReject, wrapper, state) ); } catch (error) { internalReject(wrapper, error, state); } }); } else { state.value = value; state.state = FULFILLED; notify(state, false); } } catch (error) { internalReject({ done: false }, error, state); } }; // constructor polyfill if (FORCED_PROMISE_CONSTRUCTOR$4) { // 25.4.3.1 Promise(executor) PromiseConstructor = function Promise(executor) { anInstance$b(this, PromisePrototype); aCallable$A(executor); call$14(Internal, this); var state = getInternalPromiseState(this); try { executor(bind$l(internalResolve, state), bind$l(internalReject, state)); } catch (error) { internalReject(state, error); } }; PromisePrototype = PromiseConstructor.prototype; // eslint-disable-next-line no-unused-vars -- required for `.length` Internal = function Promise(executor) { setInternalState$i(this, { type: PROMISE, done: false, notified: false, parent: false, reactions: new Queue(), rejection: false, state: PENDING$2, value: undefined }); }; // `Promise.prototype.then` method // https://tc39.es/ecma262/#sec-promise.prototype.then Internal.prototype = defineBuiltIn$h(PromisePrototype, 'then', function then(onFulfilled, onRejected) { var state = getInternalPromiseState(this); var reaction = newPromiseCapability$1(speciesConstructor$4(this, PromiseConstructor)); state.parent = true; reaction.ok = isCallable$k(onFulfilled) ? onFulfilled : true; reaction.fail = isCallable$k(onRejected) && onRejected; reaction.domain = IS_NODE$3 ? process$1.domain : undefined; if (state.state === PENDING$2) state.reactions.add(reaction); else microtask$1(function () { callReaction(reaction, state); }); return reaction.promise; }); OwnPromiseCapability = function () { var promise = new Internal(); var state = getInternalPromiseState(promise); this.promise = promise; this.resolve = bind$l(internalResolve, state); this.reject = bind$l(internalReject, state); }; newPromiseCapabilityModule$7.f = newPromiseCapability$1 = function (C) { return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; if (isCallable$k(NativePromiseConstructor$3) && NativePromisePrototype$2 !== Object.prototype) { nativeThen = NativePromisePrototype$2.then; if (!NATIVE_PROMISE_SUBCLASSING) { // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs defineBuiltIn$h(NativePromisePrototype$2, 'then', function then(onFulfilled, onRejected) { var that = this; return new PromiseConstructor(function (resolve, reject) { call$14(nativeThen, that, resolve, reject); }).then(onFulfilled, onRejected); // https://github.com/zloirock/core-js/issues/640 }, { unsafe: true }); } // make `.constructor === Promise` work for native promise-based APIs try { delete NativePromisePrototype$2.constructor; } catch (error) { /* empty */ } // make `instanceof Promise` work for native promise-based APIs if (setPrototypeOf$2) { setPrototypeOf$2(NativePromisePrototype$2, PromisePrototype); } } } $$3C({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, { Promise: PromiseConstructor }); setToStringTag$4(PromiseConstructor, PROMISE, false); setSpecies$3(PROMISE); var NativePromiseConstructor$2 = promiseNativeConstructor; var checkCorrectnessOfIteration$1 = checkCorrectnessOfIteration$4; var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR; var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration$1(function (iterable) { NativePromiseConstructor$2.all(iterable).then(undefined, function () { /* empty */ }); }); var $$3B = _export; var call$13 = functionCall; var aCallable$z = aCallable$N; var newPromiseCapabilityModule$6 = newPromiseCapability$2; var perform$5 = perform$7; var iterate$B = iterate$G; var PROMISE_STATICS_INCORRECT_ITERATION$3 = promiseStaticsIncorrectIteration; // `Promise.all` method // https://tc39.es/ecma262/#sec-promise.all $$3B({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$3 }, { all: function all(iterable) { var C = this; var capability = newPromiseCapabilityModule$6.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform$5(function () { var $promiseResolve = aCallable$z(C.resolve); var values = []; var counter = 0; var remaining = 1; iterate$B(iterable, function (promise) { var index = counter++; var alreadyCalled = false; remaining++; call$13($promiseResolve, C, promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.error) reject(result.value); return capability.promise; } }); var $$3A = _export; var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR; var NativePromiseConstructor$1 = promiseNativeConstructor; var getBuiltIn$A = getBuiltIn$M; var isCallable$j = isCallable$K; var defineBuiltIn$g = defineBuiltIn$u; var NativePromisePrototype$1 = NativePromiseConstructor$1 && NativePromiseConstructor$1.prototype; // `Promise.prototype.catch` method // https://tc39.es/ecma262/#sec-promise.prototype.catch $$3A({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, { 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then` if (isCallable$j(NativePromiseConstructor$1)) { var method$1 = getBuiltIn$A('Promise').prototype['catch']; if (NativePromisePrototype$1['catch'] !== method$1) { defineBuiltIn$g(NativePromisePrototype$1, 'catch', method$1, { unsafe: true }); } } var $$3z = _export; var call$12 = functionCall; var aCallable$y = aCallable$N; var newPromiseCapabilityModule$5 = newPromiseCapability$2; var perform$4 = perform$7; var iterate$A = iterate$G; var PROMISE_STATICS_INCORRECT_ITERATION$2 = promiseStaticsIncorrectIteration; // `Promise.race` method // https://tc39.es/ecma262/#sec-promise.race $$3z({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$2 }, { race: function race(iterable) { var C = this; var capability = newPromiseCapabilityModule$5.f(C); var reject = capability.reject; var result = perform$4(function () { var $promiseResolve = aCallable$y(C.resolve); iterate$A(iterable, function (promise) { call$12($promiseResolve, C, promise).then(capability.resolve, reject); }); }); if (result.error) reject(result.value); return capability.promise; } }); var $$3y = _export; var call$11 = functionCall; var newPromiseCapabilityModule$4 = newPromiseCapability$2; var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR; // `Promise.reject` method // https://tc39.es/ecma262/#sec-promise.reject $$3y({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, { reject: function reject(r) { var capability = newPromiseCapabilityModule$4.f(this); call$11(capability.reject, undefined, r); return capability.promise; } }); var anObject$10 = anObject$1f; var isObject$k = isObject$K; var newPromiseCapability = newPromiseCapability$2; var promiseResolve$2 = function (C, x) { anObject$10(C); if (isObject$k(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; var $$3x = _export; var getBuiltIn$z = getBuiltIn$M; var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR; var promiseResolve$1 = promiseResolve$2; getBuiltIn$z('Promise'); // `Promise.resolve` method // https://tc39.es/ecma262/#sec-promise.resolve $$3x({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { resolve: function resolve(x) { return promiseResolve$1(this, x); } }); var $$3w = _export; var call$10 = functionCall; var aCallable$x = aCallable$N; var newPromiseCapabilityModule$3 = newPromiseCapability$2; var perform$3 = perform$7; var iterate$z = iterate$G; var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration; // `Promise.allSettled` method // https://tc39.es/ecma262/#sec-promise.allsettled $$3w({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, { allSettled: function allSettled(iterable) { var C = this; var capability = newPromiseCapabilityModule$3.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform$3(function () { var promiseResolve = aCallable$x(C.resolve); var values = []; var counter = 0; var remaining = 1; iterate$z(iterable, function (promise) { var index = counter++; var alreadyCalled = false; remaining++; call$10(promiseResolve, C, promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[index] = { status: 'fulfilled', value: value }; --remaining || resolve(values); }, function (error) { if (alreadyCalled) return; alreadyCalled = true; values[index] = { status: 'rejected', reason: error }; --remaining || resolve(values); }); }); --remaining || resolve(values); }); if (result.error) reject(result.value); return capability.promise; } }); var $$3v = _export; var call$$ = functionCall; var aCallable$w = aCallable$N; var getBuiltIn$y = getBuiltIn$M; var newPromiseCapabilityModule$2 = newPromiseCapability$2; var perform$2 = perform$7; var iterate$y = iterate$G; var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration; var PROMISE_ANY_ERROR = 'No one promise resolved'; // `Promise.any` method // https://tc39.es/ecma262/#sec-promise.any $$3v({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { any: function any(iterable) { var C = this; var AggregateError = getBuiltIn$y('AggregateError'); var capability = newPromiseCapabilityModule$2.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform$2(function () { var promiseResolve = aCallable$w(C.resolve); var errors = []; var counter = 0; var remaining = 1; var alreadyResolved = false; iterate$y(iterable, function (promise) { var index = counter++; var alreadyRejected = false; remaining++; call$$(promiseResolve, C, promise).then(function (value) { if (alreadyRejected || alreadyResolved) return; alreadyResolved = true; resolve(value); }, function (error) { if (alreadyRejected || alreadyResolved) return; alreadyRejected = true; errors[index] = error; --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR)); }); }); --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR)); }); if (result.error) reject(result.value); return capability.promise; } }); var $$3u = _export; var NativePromiseConstructor = promiseNativeConstructor; var fails$D = fails$1u; var getBuiltIn$x = getBuiltIn$M; var isCallable$i = isCallable$K; var speciesConstructor$3 = speciesConstructor$6; var promiseResolve = promiseResolve$2; var defineBuiltIn$f = defineBuiltIn$u; var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829 var NON_GENERIC = !!NativePromiseConstructor && fails$D(function () { // eslint-disable-next-line unicorn/no-thenable -- required for testing NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ }); }); // `Promise.prototype.finally` method // https://tc39.es/ecma262/#sec-promise.prototype.finally $$3u({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { 'finally': function (onFinally) { var C = speciesConstructor$3(this, getBuiltIn$x('Promise')); var isFunction = isCallable$i(onFinally); return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then` if (isCallable$i(NativePromiseConstructor)) { var method = getBuiltIn$x('Promise').prototype['finally']; if (NativePromisePrototype['finally'] !== method) { defineBuiltIn$f(NativePromisePrototype, 'finally', method, { unsafe: true }); } } var $$3t = _export; var functionApply = functionApply$1; var aCallable$v = aCallable$N; var anObject$$ = anObject$1f; var fails$C = fails$1u; // MS Edge argumentsList argument is optional var OPTIONAL_ARGUMENTS_LIST = !fails$C(function () { // eslint-disable-next-line es/no-reflect -- required for testing Reflect.apply(function () { /* empty */ }); }); // `Reflect.apply` method // https://tc39.es/ecma262/#sec-reflect.apply $$3t({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, { apply: function apply(target, thisArgument, argumentsList) { return functionApply(aCallable$v(target), thisArgument, anObject$$(argumentsList)); } }); var $$3s = _export; var getBuiltIn$w = getBuiltIn$M; var apply$8 = functionApply$1; var bind$k = functionBind; var aConstructor$3 = aConstructor$5; var anObject$_ = anObject$1f; var isObject$j = isObject$K; var create$c = objectCreate$1; var fails$B = fails$1u; var nativeConstruct = getBuiltIn$w('Reflect', 'construct'); var ObjectPrototype = Object.prototype; var push$l = [].push; // `Reflect.construct` method // https://tc39.es/ecma262/#sec-reflect.construct // MS Edge supports only 2 arguments and argumentsList argument is optional // FF Nightly sets third argument as `new.target`, but does not create `this` from it var NEW_TARGET_BUG = fails$B(function () { function F() { /* empty */ } return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F); }); var ARGS_BUG = !fails$B(function () { nativeConstruct(function () { /* empty */ }); }); var FORCED$6 = NEW_TARGET_BUG || ARGS_BUG; $$3s({ target: 'Reflect', stat: true, forced: FORCED$6, sham: FORCED$6 }, { construct: function construct(Target, args /* , newTarget */) { aConstructor$3(Target); anObject$_(args); var newTarget = arguments.length < 3 ? Target : aConstructor$3(arguments[2]); if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget); if (Target === newTarget) { // w/o altered newTarget, optimization for 0-4 arguments switch (args.length) { case 0: return new Target(); case 1: return new Target(args[0]); case 2: return new Target(args[0], args[1]); case 3: return new Target(args[0], args[1], args[2]); case 4: return new Target(args[0], args[1], args[2], args[3]); } // w/o altered newTarget, lot of arguments case var $args = [null]; apply$8(push$l, $args, args); return new (apply$8(bind$k, Target, $args))(); } // with altered newTarget, not support built-in constructors var proto = newTarget.prototype; var instance = create$c(isObject$j(proto) ? proto : ObjectPrototype); var result = apply$8(Target, instance, args); return isObject$j(result) ? result : instance; } }); var $$3r = _export; var DESCRIPTORS$m = descriptors; var anObject$Z = anObject$1f; var toPropertyKey$3 = toPropertyKey$a; var definePropertyModule$2 = objectDefineProperty; var fails$A = fails$1u; // MS Edge has broken Reflect.defineProperty - throwing instead of returning false var ERROR_INSTEAD_OF_FALSE = fails$A(function () { // eslint-disable-next-line es/no-reflect -- required for testing Reflect.defineProperty(definePropertyModule$2.f({}, 1, { value: 1 }), 1, { value: 2 }); }); // `Reflect.defineProperty` method // https://tc39.es/ecma262/#sec-reflect.defineproperty $$3r({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS$m }, { defineProperty: function defineProperty(target, propertyKey, attributes) { anObject$Z(target); var key = toPropertyKey$3(propertyKey); anObject$Z(attributes); try { definePropertyModule$2.f(target, key, attributes); return true; } catch (error) { return false; } } }); var $$3q = _export; var anObject$Y = anObject$1f; var getOwnPropertyDescriptor$7 = objectGetOwnPropertyDescriptor.f; // `Reflect.deleteProperty` method // https://tc39.es/ecma262/#sec-reflect.deleteproperty $$3q({ target: 'Reflect', stat: true }, { deleteProperty: function deleteProperty(target, propertyKey) { var descriptor = getOwnPropertyDescriptor$7(anObject$Y(target), propertyKey); return descriptor && !descriptor.configurable ? false : delete target[propertyKey]; } }); var hasOwn$j = hasOwnProperty_1; var isDataDescriptor$2 = function (descriptor) { return descriptor !== undefined && (hasOwn$j(descriptor, 'value') || hasOwn$j(descriptor, 'writable')); }; var $$3p = _export; var call$_ = functionCall; var isObject$i = isObject$K; var anObject$X = anObject$1f; var isDataDescriptor$1 = isDataDescriptor$2; var getOwnPropertyDescriptorModule$3 = objectGetOwnPropertyDescriptor; var getPrototypeOf$8 = objectGetPrototypeOf$2; // `Reflect.get` method // https://tc39.es/ecma262/#sec-reflect.get function get$4(target, propertyKey /* , receiver */) { var receiver = arguments.length < 3 ? target : arguments[2]; var descriptor, prototype; if (anObject$X(target) === receiver) return target[propertyKey]; descriptor = getOwnPropertyDescriptorModule$3.f(target, propertyKey); if (descriptor) return isDataDescriptor$1(descriptor) ? descriptor.value : descriptor.get === undefined ? undefined : call$_(descriptor.get, receiver); if (isObject$i(prototype = getPrototypeOf$8(target))) return get$4(prototype, propertyKey, receiver); } $$3p({ target: 'Reflect', stat: true }, { get: get$4 }); var $$3o = _export; var DESCRIPTORS$l = descriptors; var anObject$W = anObject$1f; var getOwnPropertyDescriptorModule$2 = objectGetOwnPropertyDescriptor; // `Reflect.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-reflect.getownpropertydescriptor $$3o({ target: 'Reflect', stat: true, sham: !DESCRIPTORS$l }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { return getOwnPropertyDescriptorModule$2.f(anObject$W(target), propertyKey); } }); var $$3n = _export; var anObject$V = anObject$1f; var objectGetPrototypeOf = objectGetPrototypeOf$2; var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter; // `Reflect.getPrototypeOf` method // https://tc39.es/ecma262/#sec-reflect.getprototypeof $$3n({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, { getPrototypeOf: function getPrototypeOf(target) { return objectGetPrototypeOf(anObject$V(target)); } }); var $$3m = _export; // `Reflect.has` method // https://tc39.es/ecma262/#sec-reflect.has $$3m({ target: 'Reflect', stat: true }, { has: function has(target, propertyKey) { return propertyKey in target; } }); var $$3l = _export; var anObject$U = anObject$1f; var $isExtensible = objectIsExtensible; // `Reflect.isExtensible` method // https://tc39.es/ecma262/#sec-reflect.isextensible $$3l({ target: 'Reflect', stat: true }, { isExtensible: function isExtensible(target) { anObject$U(target); return $isExtensible(target); } }); var $$3k = _export; var ownKeys = ownKeys$3; // `Reflect.ownKeys` method // https://tc39.es/ecma262/#sec-reflect.ownkeys $$3k({ target: 'Reflect', stat: true }, { ownKeys: ownKeys }); var $$3j = _export; var getBuiltIn$v = getBuiltIn$M; var anObject$T = anObject$1f; var FREEZING$3 = freezing; // `Reflect.preventExtensions` method // https://tc39.es/ecma262/#sec-reflect.preventextensions $$3j({ target: 'Reflect', stat: true, sham: !FREEZING$3 }, { preventExtensions: function preventExtensions(target) { anObject$T(target); try { var objectPreventExtensions = getBuiltIn$v('Object', 'preventExtensions'); if (objectPreventExtensions) objectPreventExtensions(target); return true; } catch (error) { return false; } } }); var $$3i = _export; var call$Z = functionCall; var anObject$S = anObject$1f; var isObject$h = isObject$K; var isDataDescriptor = isDataDescriptor$2; var fails$z = fails$1u; var definePropertyModule$1 = objectDefineProperty; var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor; var getPrototypeOf$7 = objectGetPrototypeOf$2; var createPropertyDescriptor$5 = createPropertyDescriptor$d; // `Reflect.set` method // https://tc39.es/ecma262/#sec-reflect.set function set$8(target, propertyKey, V /* , receiver */) { var receiver = arguments.length < 4 ? target : arguments[3]; var ownDescriptor = getOwnPropertyDescriptorModule$1.f(anObject$S(target), propertyKey); var existingDescriptor, prototype, setter; if (!ownDescriptor) { if (isObject$h(prototype = getPrototypeOf$7(target))) { return set$8(prototype, propertyKey, V, receiver); } ownDescriptor = createPropertyDescriptor$5(0); } if (isDataDescriptor(ownDescriptor)) { if (ownDescriptor.writable === false || !isObject$h(receiver)) return false; if (existingDescriptor = getOwnPropertyDescriptorModule$1.f(receiver, propertyKey)) { if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; existingDescriptor.value = V; definePropertyModule$1.f(receiver, propertyKey, existingDescriptor); } else definePropertyModule$1.f(receiver, propertyKey, createPropertyDescriptor$5(0, V)); } else { setter = ownDescriptor.set; if (setter === undefined) return false; call$Z(setter, receiver, V); } return true; } // MS Edge 17-18 Reflect.set allows setting the property to object // with non-writable property on the prototype var MS_EDGE_BUG = fails$z(function () { var Constructor = function () { /* empty */ }; var object = definePropertyModule$1.f(new Constructor(), 'a', { configurable: true }); // eslint-disable-next-line es/no-reflect -- required for testing return Reflect.set(Constructor.prototype, 'a', 1, object) !== false; }); $$3i({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, { set: set$8 }); var $$3h = _export; var anObject$R = anObject$1f; var aPossiblePrototype = aPossiblePrototype$2; var objectSetPrototypeOf = objectSetPrototypeOf$1; // `Reflect.setPrototypeOf` method // https://tc39.es/ecma262/#sec-reflect.setprototypeof if (objectSetPrototypeOf) $$3h({ target: 'Reflect', stat: true }, { setPrototypeOf: function setPrototypeOf(target, proto) { anObject$R(target); aPossiblePrototype(proto); try { objectSetPrototypeOf(target, proto); return true; } catch (error) { return false; } } }); var $$3g = _export; var global$B = global$16; var setToStringTag$3 = setToStringTag$d; $$3g({ global: true }, { Reflect: {} }); // Reflect[@@toStringTag] property // https://tc39.es/ecma262/#sec-reflect-@@tostringtag setToStringTag$3(global$B.Reflect, 'Reflect', true); var isObject$g = isObject$K; var classof$d = classofRaw$2; var wellKnownSymbol$u = wellKnownSymbol$T; var MATCH$2 = wellKnownSymbol$u('match'); // `IsRegExp` abstract operation // https://tc39.es/ecma262/#sec-isregexp var isRegexp = function (it) { var isRegExp; return isObject$g(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$d(it) === 'RegExp'); }; var anObject$Q = anObject$1f; // `RegExp.prototype.flags` getter implementation // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags var regexpFlags$1 = function () { var that = anObject$Q(this); var result = ''; if (that.hasIndices) result += 'd'; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.dotAll) result += 's'; if (that.unicode) result += 'u'; if (that.unicodeSets) result += 'v'; if (that.sticky) result += 'y'; return result; }; var call$Y = functionCall; var hasOwn$i = hasOwnProperty_1; var isPrototypeOf$5 = objectIsPrototypeOf; var regExpFlags$1 = regexpFlags$1; var RegExpPrototype$7 = RegExp.prototype; var regexpGetFlags = function (R) { var flags = R.flags; return flags === undefined && !('flags' in RegExpPrototype$7) && !hasOwn$i(R, 'flags') && isPrototypeOf$5(RegExpPrototype$7, R) ? call$Y(regExpFlags$1, R) : flags; }; var fails$y = fails$1u; var global$A = global$16; // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError var $RegExp$2 = global$A.RegExp; var UNSUPPORTED_Y$3 = fails$y(function () { var re = $RegExp$2('a', 'y'); re.lastIndex = 2; return re.exec('abcd') !== null; }); // UC Browser bug // https://github.com/zloirock/core-js/issues/1008 var MISSED_STICKY$2 = UNSUPPORTED_Y$3 || fails$y(function () { return !$RegExp$2('a', 'y').sticky; }); var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$y(function () { // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 var re = $RegExp$2('^r', 'gy'); re.lastIndex = 2; return re.exec('str') !== null; }); var regexpStickyHelpers = { BROKEN_CARET: BROKEN_CARET, MISSED_STICKY: MISSED_STICKY$2, UNSUPPORTED_Y: UNSUPPORTED_Y$3 }; var fails$x = fails$1u; var global$z = global$16; // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError var $RegExp$1 = global$z.RegExp; var regexpUnsupportedDotAll = fails$x(function () { var re = $RegExp$1('.', 's'); return !(re.dotAll && re.exec('\n') && re.flags === 's'); }); var fails$w = fails$1u; var global$y = global$16; // babel-minify and Closure Compiler transpiles RegExp('(?
b)', 'g') -> /(?b)/g and it causes SyntaxError var $RegExp = global$y.RegExp; var regexpUnsupportedNcg = fails$w(function () { var re = $RegExp('(?b)', 'g'); return re.exec('b').groups.a !== 'b' || 'b'.replace(re, '$c') !== 'bc'; }); var DESCRIPTORS$k = descriptors; var global$x = global$16; var uncurryThis$17 = functionUncurryThis; var isForced = isForced_1; var inheritIfRequired$2 = inheritIfRequired$6; var createNonEnumerableProperty$a = createNonEnumerableProperty$k; var getOwnPropertyNames$2 = objectGetOwnPropertyNames.f; var isPrototypeOf$4 = objectIsPrototypeOf; var isRegExp$4 = isRegexp; var toString$v = toString$I; var getRegExpFlags$4 = regexpGetFlags; var stickyHelpers$2 = regexpStickyHelpers; var proxyAccessor = proxyAccessor$2; var defineBuiltIn$e = defineBuiltIn$u; var fails$v = fails$1u; var hasOwn$h = hasOwnProperty_1; var enforceInternalState$2 = internalState.enforce; var setSpecies$2 = setSpecies$7; var wellKnownSymbol$t = wellKnownSymbol$T; var UNSUPPORTED_DOT_ALL$2 = regexpUnsupportedDotAll; var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg; var MATCH$1 = wellKnownSymbol$t('match'); var NativeRegExp = global$x.RegExp; var RegExpPrototype$6 = NativeRegExp.prototype; var SyntaxError$3 = global$x.SyntaxError; var exec$c = uncurryThis$17(RegExpPrototype$6.exec); var charAt$h = uncurryThis$17(''.charAt); var replace$7 = uncurryThis$17(''.replace); var stringIndexOf$5 = uncurryThis$17(''.indexOf); var stringSlice$e = uncurryThis$17(''.slice); // TODO: Use only proper RegExpIdentifierName var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/; var re1 = /a/g; var re2 = /a/g; // "new" should create a new object, old webkit bug var CORRECT_NEW = new NativeRegExp(re1) !== re1; var MISSED_STICKY$1 = stickyHelpers$2.MISSED_STICKY; var UNSUPPORTED_Y$2 = stickyHelpers$2.UNSUPPORTED_Y; var BASE_FORCED = DESCRIPTORS$k && (!CORRECT_NEW || MISSED_STICKY$1 || UNSUPPORTED_DOT_ALL$2 || UNSUPPORTED_NCG$1 || fails$v(function () { re2[MATCH$1] = false; // RegExp constructor can alter flags and IsRegExp works correct with @@match return NativeRegExp(re1) !== re1 || NativeRegExp(re2) === re2 || String(NativeRegExp(re1, 'i')) !== '/a/i'; })); var handleDotAll = function (string) { var length = string.length; var index = 0; var result = ''; var brackets = false; var chr; for (; index <= length; index++) { chr = charAt$h(string, index); if (chr === '\\') { result += chr + charAt$h(string, ++index); continue; } if (!brackets && chr === '.') { result += '[\\s\\S]'; } else { if (chr === '[') { brackets = true; } else if (chr === ']') { brackets = false; } result += chr; } } return result; }; var handleNCG = function (string) { var length = string.length; var index = 0; var result = ''; var named = []; var names = {}; var brackets = false; var ncg = false; var groupid = 0; var groupname = ''; var chr; for (; index <= length; index++) { chr = charAt$h(string, index); if (chr === '\\') { chr += charAt$h(string, ++index); } else if (chr === ']') { brackets = false; } else if (!brackets) switch (true) { case chr === '[': brackets = true; break; case chr === '(': if (exec$c(IS_NCG, stringSlice$e(string, index + 1))) { index += 2; ncg = true; } result += chr; groupid++; continue; case chr === '>' && ncg: if (groupname === '' || hasOwn$h(names, groupname)) { throw new SyntaxError$3('Invalid capture group name'); } names[groupname] = true; named[named.length] = [groupname, groupid]; ncg = false; groupname = ''; continue; } if (ncg) groupname += chr; else result += chr; } return [result, named]; }; // `RegExp` constructor // https://tc39.es/ecma262/#sec-regexp-constructor if (isForced('RegExp', BASE_FORCED)) { var RegExpWrapper = function RegExp(pattern, flags) { var thisIsRegExp = isPrototypeOf$4(RegExpPrototype$6, this); var patternIsRegExp = isRegExp$4(pattern); var flagsAreUndefined = flags === undefined; var groups = []; var rawPattern = pattern; var rawFlags, dotAll, sticky, handled, result, state; if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) { return pattern; } if (patternIsRegExp || isPrototypeOf$4(RegExpPrototype$6, pattern)) { pattern = pattern.source; if (flagsAreUndefined) flags = getRegExpFlags$4(rawPattern); } pattern = pattern === undefined ? '' : toString$v(pattern); flags = flags === undefined ? '' : toString$v(flags); rawPattern = pattern; if (UNSUPPORTED_DOT_ALL$2 && 'dotAll' in re1) { dotAll = !!flags && stringIndexOf$5(flags, 's') > -1; if (dotAll) flags = replace$7(flags, /s/g, ''); } rawFlags = flags; if (MISSED_STICKY$1 && 'sticky' in re1) { sticky = !!flags && stringIndexOf$5(flags, 'y') > -1; if (sticky && UNSUPPORTED_Y$2) flags = replace$7(flags, /y/g, ''); } if (UNSUPPORTED_NCG$1) { handled = handleNCG(pattern); pattern = handled[0]; groups = handled[1]; } result = inheritIfRequired$2(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype$6, RegExpWrapper); if (dotAll || sticky || groups.length) { state = enforceInternalState$2(result); if (dotAll) { state.dotAll = true; state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags); } if (sticky) state.sticky = true; if (groups.length) state.groups = groups; } if (pattern !== rawPattern) try { // fails in old engines, but we have no alternatives for unsupported regex syntax createNonEnumerableProperty$a(result, 'source', rawPattern === '' ? '(?:)' : rawPattern); } catch (error) { /* empty */ } return result; }; for (var keys$1 = getOwnPropertyNames$2(NativeRegExp), index$1 = 0; keys$1.length > index$1;) { proxyAccessor(RegExpWrapper, NativeRegExp, keys$1[index$1++]); } RegExpPrototype$6.constructor = RegExpWrapper; RegExpWrapper.prototype = RegExpPrototype$6; defineBuiltIn$e(global$x, 'RegExp', RegExpWrapper, { constructor: true }); } // https://tc39.es/ecma262/#sec-get-regexp-@@species setSpecies$2('RegExp'); var DESCRIPTORS$j = descriptors; var UNSUPPORTED_DOT_ALL$1 = regexpUnsupportedDotAll; var classof$c = classofRaw$2; var defineBuiltInAccessor$f = defineBuiltInAccessor$o; var getInternalState$c = internalState.get; var RegExpPrototype$5 = RegExp.prototype; var $TypeError$q = TypeError; // `RegExp.prototype.dotAll` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.dotall if (DESCRIPTORS$j && UNSUPPORTED_DOT_ALL$1) { defineBuiltInAccessor$f(RegExpPrototype$5, 'dotAll', { configurable: true, get: function dotAll() { if (this === RegExpPrototype$5) return undefined; // We can't use InternalStateModule.getterFor because // we don't add metadata for regexps created by a literal. if (classof$c(this) === 'RegExp') { return !!getInternalState$c(this).dotAll; } throw $TypeError$q('Incompatible receiver, RegExp required'); } }); } /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ /* eslint-disable regexp/no-useless-quantifier -- testing */ var call$X = functionCall; var uncurryThis$16 = functionUncurryThis; var toString$u = toString$I; var regexpFlags = regexpFlags$1; var stickyHelpers$1 = regexpStickyHelpers; var shared$4 = sharedExports; var create$b = objectCreate$1; var getInternalState$b = internalState.get; var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll; var UNSUPPORTED_NCG = regexpUnsupportedNcg; var nativeReplace = shared$4('native-string-replace', String.prototype.replace); var nativeExec = RegExp.prototype.exec; var patchedExec = nativeExec; var charAt$g = uncurryThis$16(''.charAt); var indexOf$1 = uncurryThis$16(''.indexOf); var replace$6 = uncurryThis$16(''.replace); var stringSlice$d = uncurryThis$16(''.slice); var UPDATES_LAST_INDEX_WRONG = (function () { var re1 = /a/; var re2 = /b*/g; call$X(nativeExec, re1, 'a'); call$X(nativeExec, re2, 'a'); return re1.lastIndex !== 0 || re2.lastIndex !== 0; })(); var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET; // nonparticipating capturing group, copied from es5-shim's String#split patch. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG; if (PATCH) { patchedExec = function exec(string) { var re = this; var state = getInternalState$b(re); var str = toString$u(string); var raw = state.raw; var result, reCopy, lastIndex, match, i, object, group; if (raw) { raw.lastIndex = re.lastIndex; result = call$X(patchedExec, raw, str); re.lastIndex = raw.lastIndex; return result; } var groups = state.groups; var sticky = UNSUPPORTED_Y$1 && re.sticky; var flags = call$X(regexpFlags, re); var source = re.source; var charsAdded = 0; var strCopy = str; if (sticky) { flags = replace$6(flags, 'y', ''); if (indexOf$1(flags, 'g') === -1) { flags += 'g'; } strCopy = stringSlice$d(str, re.lastIndex); // Support anchored sticky behavior. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$g(str, re.lastIndex - 1) !== '\n')) { source = '(?: ' + source + ')'; strCopy = ' ' + strCopy; charsAdded++; } // ^(? + rx + ) is needed, in combination with some str slicing, to // simulate the 'y' flag. reCopy = new RegExp('^(?:' + source + ')', flags); } if (NPCG_INCLUDED) { reCopy = new RegExp('^' + source + '$(?!\\s)', flags); } if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; match = call$X(nativeExec, sticky ? reCopy : re, strCopy); if (sticky) { if (match) { match.input = stringSlice$d(match.input, charsAdded); match[0] = stringSlice$d(match[0], charsAdded); match.index = re.lastIndex; re.lastIndex += match[0].length; } else re.lastIndex = 0; } else if (UPDATES_LAST_INDEX_WRONG && match) { re.lastIndex = re.global ? match.index + match[0].length : lastIndex; } if (NPCG_INCLUDED && match && match.length > 1) { // Fix browsers whose `exec` methods don't consistently return `undefined` // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/ call$X(nativeReplace, match[0], reCopy, function () { for (i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) match[i] = undefined; } }); } if (match && groups) { match.groups = object = create$b(null); for (i = 0; i < groups.length; i++) { group = groups[i]; object[group[0]] = match[group[1]]; } } return match; }; } var regexpExec$3 = patchedExec; var $$3f = _export; var exec$b = regexpExec$3; // `RegExp.prototype.exec` method // https://tc39.es/ecma262/#sec-regexp.prototype.exec $$3f({ target: 'RegExp', proto: true, forced: /./.exec !== exec$b }, { exec: exec$b }); var global$w = global$16; var DESCRIPTORS$i = descriptors; var defineBuiltInAccessor$e = defineBuiltInAccessor$o; var regExpFlags = regexpFlags$1; var fails$u = fails$1u; // babel-minify and Closure Compiler transpiles RegExp('.', 'd') -> /./d and it causes SyntaxError var RegExp$2 = global$w.RegExp; var RegExpPrototype$4 = RegExp$2.prototype; var FORCED$5 = DESCRIPTORS$i && fails$u(function () { var INDICES_SUPPORT = true; try { RegExp$2('.', 'd'); } catch (error) { INDICES_SUPPORT = false; } var O = {}; // modern V8 bug var calls = ''; var expected = INDICES_SUPPORT ? 'dgimsy' : 'gimsy'; var addGetter = function (key, chr) { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(O, key, { get: function () { calls += chr; return true; } }); }; var pairs = { dotAll: 's', global: 'g', ignoreCase: 'i', multiline: 'm', sticky: 'y' }; if (INDICES_SUPPORT) pairs.hasIndices = 'd'; for (var key in pairs) addGetter(key, pairs[key]); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var result = Object.getOwnPropertyDescriptor(RegExpPrototype$4, 'flags').get.call(O); return result !== expected || calls !== expected; }); // `RegExp.prototype.flags` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags if (FORCED$5) defineBuiltInAccessor$e(RegExpPrototype$4, 'flags', { configurable: true, get: regExpFlags }); var DESCRIPTORS$h = descriptors; var MISSED_STICKY = regexpStickyHelpers.MISSED_STICKY; var classof$b = classofRaw$2; var defineBuiltInAccessor$d = defineBuiltInAccessor$o; var getInternalState$a = internalState.get; var RegExpPrototype$3 = RegExp.prototype; var $TypeError$p = TypeError; // `RegExp.prototype.sticky` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky if (DESCRIPTORS$h && MISSED_STICKY) { defineBuiltInAccessor$d(RegExpPrototype$3, 'sticky', { configurable: true, get: function sticky() { if (this === RegExpPrototype$3) return; // We can't use InternalStateModule.getterFor because // we don't add metadata for regexps created by a literal. if (classof$b(this) === 'RegExp') { return !!getInternalState$a(this).sticky; } throw $TypeError$p('Incompatible receiver, RegExp required'); } }); } // TODO: Remove from `core-js@4` since it's moved to entry points var $$3e = _export; var call$W = functionCall; var isCallable$h = isCallable$K; var anObject$P = anObject$1f; var toString$t = toString$I; var DELEGATES_TO_EXEC = function () { var execCalled = false; var re = /[ac]/; re.exec = function () { execCalled = true; return /./.exec.apply(this, arguments); }; return re.test('abc') === true && execCalled; }(); var nativeTest = /./.test; // `RegExp.prototype.test` method // https://tc39.es/ecma262/#sec-regexp.prototype.test $$3e({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, { test: function (S) { var R = anObject$P(this); var string = toString$t(S); var exec = R.exec; if (!isCallable$h(exec)) return call$W(nativeTest, R, string); var result = call$W(exec, R, string); if (result === null) return false; anObject$P(result); return true; } }); var PROPER_FUNCTION_NAME$1 = functionName.PROPER; var defineBuiltIn$d = defineBuiltIn$u; var anObject$O = anObject$1f; var $toString$2 = toString$I; var fails$t = fails$1u; var getRegExpFlags$3 = regexpGetFlags; var TO_STRING = 'toString'; var RegExpPrototype$2 = RegExp.prototype; var nativeToString = RegExpPrototype$2[TO_STRING]; var NOT_GENERIC = fails$t(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; }); // FF44- RegExp#toString has a wrong name var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name !== TO_STRING; // `RegExp.prototype.toString` method // https://tc39.es/ecma262/#sec-regexp.prototype.tostring if (NOT_GENERIC || INCORRECT_NAME) { defineBuiltIn$d(RegExp.prototype, TO_STRING, function toString() { var R = anObject$O(this); var pattern = $toString$2(R.source); var flags = $toString$2(getRegExpFlags$3(R)); return '/' + pattern + '/' + flags; }, { unsafe: true }); } var collection$2 = collection$4; var collectionStrong = collectionStrong$2; // `Set` constructor // https://tc39.es/ecma262/#sec-set-objects collection$2('Set', function (init) { return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); var $$3d = _export; var uncurryThis$15 = functionUncurryThis; var requireObjectCoercible$i = requireObjectCoercible$p; var toIntegerOrInfinity$a = toIntegerOrInfinity$p; var toString$s = toString$I; var fails$s = fails$1u; var charAt$f = uncurryThis$15(''.charAt); var FORCED$4 = fails$s(function () { // eslint-disable-next-line es/no-array-string-prototype-at -- safe return 'ð ®·'.at(-2) !== '\uD842'; }); // `String.prototype.at` method // https://tc39.es/ecma262/#sec-string.prototype.at $$3d({ target: 'String', proto: true, forced: FORCED$4 }, { at: function at(index) { var S = toString$s(requireObjectCoercible$i(this)); var len = S.length; var relativeIndex = toIntegerOrInfinity$a(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; return (k < 0 || k >= len) ? undefined : charAt$f(S, k); } }); var uncurryThis$14 = functionUncurryThis; var toIntegerOrInfinity$9 = toIntegerOrInfinity$p; var toString$r = toString$I; var requireObjectCoercible$h = requireObjectCoercible$p; var charAt$e = uncurryThis$14(''.charAt); var charCodeAt$5 = uncurryThis$14(''.charCodeAt); var stringSlice$c = uncurryThis$14(''.slice); var createMethod$1 = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = toString$r(requireObjectCoercible$h($this)); var position = toIntegerOrInfinity$9(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; first = charCodeAt$5(S, position); return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt$5(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt$e(S, position) : first : CONVERT_TO_STRING ? stringSlice$c(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; var stringMultibyte = { // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat codeAt: createMethod$1(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt: createMethod$1(true) }; var $$3c = _export; var codeAt$2 = stringMultibyte.codeAt; // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat $$3c({ target: 'String', proto: true }, { codePointAt: function codePointAt(pos) { return codeAt$2(this, pos); } }); var isRegExp$3 = isRegexp; var $TypeError$o = TypeError; var notARegexp = function (it) { if (isRegExp$3(it)) { throw $TypeError$o("The method doesn't accept regular expressions"); } return it; }; var wellKnownSymbol$s = wellKnownSymbol$T; var MATCH = wellKnownSymbol$s('match'); var correctIsRegexpLogic = function (METHOD_NAME) { var regexp = /./; try { '/./'[METHOD_NAME](regexp); } catch (error1) { try { regexp[MATCH] = false; return '/./'[METHOD_NAME](regexp); } catch (error2) { /* empty */ } } return false; }; var $$3b = _export; var uncurryThis$13 = functionUncurryThisClause; var getOwnPropertyDescriptor$6 = objectGetOwnPropertyDescriptor.f; var toLength$7 = toLength$d; var toString$q = toString$I; var notARegExp$2 = notARegexp; var requireObjectCoercible$g = requireObjectCoercible$p; var correctIsRegExpLogic$2 = correctIsRegexpLogic; // eslint-disable-next-line es/no-string-prototype-endswith -- safe var nativeEndsWith = uncurryThis$13(''.endsWith); var slice$6 = uncurryThis$13(''.slice); var min$8 = Math.min; var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$2('endsWith'); // https://github.com/zloirock/core-js/pull/702 var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () { var descriptor = getOwnPropertyDescriptor$6(String.prototype, 'endsWith'); return descriptor && !descriptor.writable; }(); // `String.prototype.endsWith` method // https://tc39.es/ecma262/#sec-string.prototype.endswith $$3b({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, { endsWith: function endsWith(searchString /* , endPosition = @length */) { var that = toString$q(requireObjectCoercible$g(this)); notARegExp$2(searchString); var endPosition = arguments.length > 1 ? arguments[1] : undefined; var len = that.length; var end = endPosition === undefined ? len : min$8(toLength$7(endPosition), len); var search = toString$q(searchString); return nativeEndsWith ? nativeEndsWith(that, search, end) : slice$6(that, end - search.length, end) === search; } }); var $$3a = _export; var uncurryThis$12 = functionUncurryThis; var toAbsoluteIndex$2 = toAbsoluteIndex$b; var $RangeError$7 = RangeError; var fromCharCode$5 = String.fromCharCode; // eslint-disable-next-line es/no-string-fromcodepoint -- required for testing var $fromCodePoint = String.fromCodePoint; var join$7 = uncurryThis$12([].join); // length should be 1, old FF problem var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length !== 1; // `String.fromCodePoint` method // https://tc39.es/ecma262/#sec-string.fromcodepoint $$3a({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, { // eslint-disable-next-line no-unused-vars -- required for `.length` fromCodePoint: function fromCodePoint(x) { var elements = []; var length = arguments.length; var i = 0; var code; while (length > i) { code = +arguments[i++]; if (toAbsoluteIndex$2(code, 0x10FFFF) !== code) throw $RangeError$7(code + ' is not a valid code point'); elements[i] = code < 0x10000 ? fromCharCode$5(code) : fromCharCode$5(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00); } return join$7(elements, ''); } }); var $$39 = _export; var uncurryThis$11 = functionUncurryThis; var notARegExp$1 = notARegexp; var requireObjectCoercible$f = requireObjectCoercible$p; var toString$p = toString$I; var correctIsRegExpLogic$1 = correctIsRegexpLogic; var stringIndexOf$4 = uncurryThis$11(''.indexOf); // `String.prototype.includes` method // https://tc39.es/ecma262/#sec-string.prototype.includes $$39({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, { includes: function includes(searchString /* , position = 0 */) { return !!~stringIndexOf$4( toString$p(requireObjectCoercible$f(this)), toString$p(notARegExp$1(searchString)), arguments.length > 1 ? arguments[1] : undefined ); } }); var $$38 = _export; var uncurryThis$10 = functionUncurryThis; var requireObjectCoercible$e = requireObjectCoercible$p; var toString$o = toString$I; var charCodeAt$4 = uncurryThis$10(''.charCodeAt); // `String.prototype.isWellFormed` method // https://github.com/tc39/proposal-is-usv-string $$38({ target: 'String', proto: true }, { isWellFormed: function isWellFormed() { var S = toString$o(requireObjectCoercible$e(this)); var length = S.length; for (var i = 0; i < length; i++) { var charCode = charCodeAt$4(S, i); // single UTF-16 code unit if ((charCode & 0xF800) !== 0xD800) continue; // unpaired surrogate if (charCode >= 0xDC00 || ++i >= length || (charCodeAt$4(S, i) & 0xFC00) !== 0xDC00) return false; } return true; } }); var charAt$d = stringMultibyte.charAt; var toString$n = toString$I; var InternalStateModule$g = internalState; var defineIterator = iteratorDefine; var createIterResultObject$d = createIterResultObject$g; var STRING_ITERATOR$1 = 'String Iterator'; var setInternalState$h = InternalStateModule$g.set; var getInternalState$9 = InternalStateModule$g.getterFor(STRING_ITERATOR$1); // `String.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState$h(this, { type: STRING_ITERATOR$1, string: toString$n(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState$9(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return createIterResultObject$d(undefined, true); point = charAt$d(string, index); state.index += point.length; return createIterResultObject$d(point, false); }); // TODO: Remove from `core-js@4` since it's moved to entry points var uncurryThis$$ = functionUncurryThisClause; var defineBuiltIn$c = defineBuiltIn$u; var regexpExec$2 = regexpExec$3; var fails$r = fails$1u; var wellKnownSymbol$r = wellKnownSymbol$T; var createNonEnumerableProperty$9 = createNonEnumerableProperty$k; var SPECIES = wellKnownSymbol$r('species'); var RegExpPrototype$1 = RegExp.prototype; var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) { var SYMBOL = wellKnownSymbol$r(KEY); var DELEGATES_TO_SYMBOL = !fails$r(function () { // String methods call symbol-named RegEp methods var O = {}; O[SYMBOL] = function () { return 7; }; return ''[KEY](O) !== 7; }); var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$r(function () { // Symbol-named RegExp methods call .exec var execCalled = false; var re = /a/; if (KEY === 'split') { // We can't use real regex here since it causes deoptimization // and serious performance degradation in V8 // https://github.com/zloirock/core-js/issues/306 re = {}; // RegExp[@@split] doesn't call the regex's exec method, but first creates // a new one. We need to return the patched regex when creating the new one. re.constructor = {}; re.constructor[SPECIES] = function () { return re; }; re.flags = ''; re[SYMBOL] = /./[SYMBOL]; } re.exec = function () { execCalled = true; return null; }; re[SYMBOL](''); return !execCalled; }); if ( !DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED ) { var uncurriedNativeRegExpMethod = uncurryThis$$(/./[SYMBOL]); var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { var uncurriedNativeMethod = uncurryThis$$(nativeMethod); var $exec = regexp.exec; if ($exec === regexpExec$2 || $exec === RegExpPrototype$1.exec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { // The native String method already delegates to @@method (this // polyfilled function), leasing to infinite recursion. // We avoid it by directly calling the native @@method method. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) }; } return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) }; } return { done: false }; }); defineBuiltIn$c(String.prototype, KEY, methods[0]); defineBuiltIn$c(RegExpPrototype$1, SYMBOL, methods[1]); } if (SHAM) createNonEnumerableProperty$9(RegExpPrototype$1[SYMBOL], 'sham', true); }; var charAt$c = stringMultibyte.charAt; // `AdvanceStringIndex` abstract operation // https://tc39.es/ecma262/#sec-advancestringindex var advanceStringIndex$4 = function (S, index, unicode) { return index + (unicode ? charAt$c(S, index).length : 1); }; var call$V = functionCall; var anObject$N = anObject$1f; var isCallable$g = isCallable$K; var classof$a = classofRaw$2; var regexpExec$1 = regexpExec$3; var $TypeError$n = TypeError; // `RegExpExec` abstract operation // https://tc39.es/ecma262/#sec-regexpexec var regexpExecAbstract = function (R, S) { var exec = R.exec; if (isCallable$g(exec)) { var result = call$V(exec, R, S); if (result !== null) anObject$N(result); return result; } if (classof$a(R) === 'RegExp') return call$V(regexpExec$1, R, S); throw $TypeError$n('RegExp#exec called on incompatible receiver'); }; var call$U = functionCall; var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic; var anObject$M = anObject$1f; var isNullOrUndefined$d = isNullOrUndefined$k; var toLength$6 = toLength$d; var toString$m = toString$I; var requireObjectCoercible$d = requireObjectCoercible$p; var getMethod$h = getMethod$l; var advanceStringIndex$3 = advanceStringIndex$4; var regExpExec$3 = regexpExecAbstract; // @@match logic fixRegExpWellKnownSymbolLogic$3('match', function (MATCH, nativeMatch, maybeCallNative) { return [ // `String.prototype.match` method // https://tc39.es/ecma262/#sec-string.prototype.match function match(regexp) { var O = requireObjectCoercible$d(this); var matcher = isNullOrUndefined$d(regexp) ? undefined : getMethod$h(regexp, MATCH); return matcher ? call$U(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$m(O)); }, // `RegExp.prototype[@@match]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@match function (string) { var rx = anObject$M(this); var S = toString$m(string); var res = maybeCallNative(nativeMatch, rx, S); if (res.done) return res.value; if (!rx.global) return regExpExec$3(rx, S); var fullUnicode = rx.unicode; rx.lastIndex = 0; var A = []; var n = 0; var result; while ((result = regExpExec$3(rx, S)) !== null) { var matchStr = toString$m(result[0]); A[n] = matchStr; if (matchStr === '') rx.lastIndex = advanceStringIndex$3(S, toLength$6(rx.lastIndex), fullUnicode); n++; } return n === 0 ? null : A; } ]; }); /* eslint-disable es/no-string-prototype-matchall -- safe */ var $$37 = _export; var call$T = functionCall; var uncurryThis$_ = functionUncurryThisClause; var createIteratorConstructor$5 = iteratorCreateConstructor; var createIterResultObject$c = createIterResultObject$g; var requireObjectCoercible$c = requireObjectCoercible$p; var toLength$5 = toLength$d; var toString$l = toString$I; var anObject$L = anObject$1f; var isNullOrUndefined$c = isNullOrUndefined$k; var classof$9 = classofRaw$2; var isRegExp$2 = isRegexp; var getRegExpFlags$2 = regexpGetFlags; var getMethod$g = getMethod$l; var defineBuiltIn$b = defineBuiltIn$u; var fails$q = fails$1u; var wellKnownSymbol$q = wellKnownSymbol$T; var speciesConstructor$2 = speciesConstructor$6; var advanceStringIndex$2 = advanceStringIndex$4; var regExpExec$2 = regexpExecAbstract; var InternalStateModule$f = internalState; var IS_PURE$h = isPure; var MATCH_ALL = wellKnownSymbol$q('matchAll'); var REGEXP_STRING = 'RegExp String'; var REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator'; var setInternalState$g = InternalStateModule$f.set; var getInternalState$8 = InternalStateModule$f.getterFor(REGEXP_STRING_ITERATOR); var RegExpPrototype = RegExp.prototype; var $TypeError$m = TypeError; var stringIndexOf$3 = uncurryThis$_(''.indexOf); var nativeMatchAll = uncurryThis$_(''.matchAll); var WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails$q(function () { nativeMatchAll('a', /./); }); var $RegExpStringIterator = createIteratorConstructor$5(function RegExpStringIterator(regexp, string, $global, fullUnicode) { setInternalState$g(this, { type: REGEXP_STRING_ITERATOR, regexp: regexp, string: string, global: $global, unicode: fullUnicode, done: false }); }, REGEXP_STRING, function next() { var state = getInternalState$8(this); if (state.done) return createIterResultObject$c(undefined, true); var R = state.regexp; var S = state.string; var match = regExpExec$2(R, S); if (match === null) { state.done = true; return createIterResultObject$c(undefined, true); } if (state.global) { if (toString$l(match[0]) === '') R.lastIndex = advanceStringIndex$2(S, toLength$5(R.lastIndex), state.unicode); return createIterResultObject$c(match, false); } state.done = true; return createIterResultObject$c(match, false); }); var $matchAll = function (string) { var R = anObject$L(this); var S = toString$l(string); var C = speciesConstructor$2(R, RegExp); var flags = toString$l(getRegExpFlags$2(R)); var matcher, $global, fullUnicode; matcher = new C(C === RegExp ? R.source : R, flags); $global = !!~stringIndexOf$3(flags, 'g'); fullUnicode = !!~stringIndexOf$3(flags, 'u'); matcher.lastIndex = toLength$5(R.lastIndex); return new $RegExpStringIterator(matcher, S, $global, fullUnicode); }; // `String.prototype.matchAll` method // https://tc39.es/ecma262/#sec-string.prototype.matchall $$37({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, { matchAll: function matchAll(regexp) { var O = requireObjectCoercible$c(this); var flags, S, matcher, rx; if (!isNullOrUndefined$c(regexp)) { if (isRegExp$2(regexp)) { flags = toString$l(requireObjectCoercible$c(getRegExpFlags$2(regexp))); if (!~stringIndexOf$3(flags, 'g')) throw $TypeError$m('`.matchAll` does not allow non-global regexes'); } if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp); matcher = getMethod$g(regexp, MATCH_ALL); if (matcher === undefined && IS_PURE$h && classof$9(regexp) === 'RegExp') matcher = $matchAll; if (matcher) return call$T(matcher, regexp, O); } else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp); S = toString$l(O); rx = new RegExp(regexp, 'g'); return rx[MATCH_ALL](S); } }); MATCH_ALL in RegExpPrototype || defineBuiltIn$b(RegExpPrototype, MATCH_ALL, $matchAll); // https://github.com/zloirock/core-js/issues/280 var userAgent = engineUserAgent; var stringPadWebkitBug = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent); var $$36 = _export; var $padEnd = stringPad.end; var WEBKIT_BUG$1 = stringPadWebkitBug; // `String.prototype.padEnd` method // https://tc39.es/ecma262/#sec-string.prototype.padend $$36({ target: 'String', proto: true, forced: WEBKIT_BUG$1 }, { padEnd: function padEnd(maxLength /* , fillString = ' ' */) { return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); } }); var $$35 = _export; var $padStart = stringPad.start; var WEBKIT_BUG = stringPadWebkitBug; // `String.prototype.padStart` method // https://tc39.es/ecma262/#sec-string.prototype.padstart $$35({ target: 'String', proto: true, forced: WEBKIT_BUG }, { padStart: function padStart(maxLength /* , fillString = ' ' */) { return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); } }); var $$34 = _export; var uncurryThis$Z = functionUncurryThis; var toIndexedObject$2 = toIndexedObject$k; var toObject$c = toObject$D; var toString$k = toString$I; var lengthOfArrayLike$d = lengthOfArrayLike$C; var push$k = uncurryThis$Z([].push); var join$6 = uncurryThis$Z([].join); // `String.raw` method // https://tc39.es/ecma262/#sec-string.raw $$34({ target: 'String', stat: true }, { raw: function raw(template) { var rawTemplate = toIndexedObject$2(toObject$c(template).raw); var literalSegments = lengthOfArrayLike$d(rawTemplate); if (!literalSegments) return ''; var argumentsLength = arguments.length; var elements = []; var i = 0; while (true) { push$k(elements, toString$k(rawTemplate[i++])); if (i === literalSegments) return join$6(elements, ''); if (i < argumentsLength) push$k(elements, toString$k(arguments[i])); } } }); var $$33 = _export; var repeat = stringRepeat; // `String.prototype.repeat` method // https://tc39.es/ecma262/#sec-string.prototype.repeat $$33({ target: 'String', proto: true }, { repeat: repeat }); var uncurryThis$Y = functionUncurryThis; var toObject$b = toObject$D; var floor$3 = Math.floor; var charAt$b = uncurryThis$Y(''.charAt); var replace$5 = uncurryThis$Y(''.replace); var stringSlice$b = uncurryThis$Y(''.slice); // eslint-disable-next-line redos/no-vulnerable -- safe var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; // `GetSubstitution` abstract operation // https://tc39.es/ecma262/#sec-getsubstitution var getSubstitution$2 = function (matched, str, position, captures, namedCaptures, replacement) { var tailPos = position + matched.length; var m = captures.length; var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; if (namedCaptures !== undefined) { namedCaptures = toObject$b(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } return replace$5(replacement, symbols, function (match, ch) { var capture; switch (charAt$b(ch, 0)) { case '$': return '$'; case '&': return matched; case '`': return stringSlice$b(str, 0, position); case "'": return stringSlice$b(str, tailPos); case '<': capture = namedCaptures[stringSlice$b(ch, 1, -1)]; break; default: // \d\d? var n = +ch; if (n === 0) return match; if (n > m) { var f = floor$3(n / 10); if (f === 0) return match; if (f <= m) return captures[f - 1] === undefined ? charAt$b(ch, 1) : captures[f - 1] + charAt$b(ch, 1); return match; } capture = captures[n - 1]; } return capture === undefined ? '' : capture; }); }; var apply$7 = functionApply$1; var call$S = functionCall; var uncurryThis$X = functionUncurryThis; var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic; var fails$p = fails$1u; var anObject$K = anObject$1f; var isCallable$f = isCallable$K; var isNullOrUndefined$b = isNullOrUndefined$k; var toIntegerOrInfinity$8 = toIntegerOrInfinity$p; var toLength$4 = toLength$d; var toString$j = toString$I; var requireObjectCoercible$b = requireObjectCoercible$p; var advanceStringIndex$1 = advanceStringIndex$4; var getMethod$f = getMethod$l; var getSubstitution$1 = getSubstitution$2; var regExpExec$1 = regexpExecAbstract; var wellKnownSymbol$p = wellKnownSymbol$T; var REPLACE$1 = wellKnownSymbol$p('replace'); var max$5 = Math.max; var min$7 = Math.min; var concat$1 = uncurryThis$X([].concat); var push$j = uncurryThis$X([].push); var stringIndexOf$2 = uncurryThis$X(''.indexOf); var stringSlice$a = uncurryThis$X(''.slice); var maybeToString = function (it) { return it === undefined ? it : String(it); }; // IE <= 11 replaces $0 with the whole match, as if it was $& // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 var REPLACE_KEEPS_$0 = (function () { // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing return 'a'.replace(/./, '$0') === '$0'; })(); // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { if (/./[REPLACE$1]) { return /./[REPLACE$1]('a', '$0') === ''; } return false; })(); var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$p(function () { var re = /./; re.exec = function () { var result = []; result.groups = { a: '7' }; return result; }; // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive return ''.replace(re, '$') !== '7'; }); // @@replace logic fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCallNative) { var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; return [ // `String.prototype.replace` method // https://tc39.es/ecma262/#sec-string.prototype.replace function replace(searchValue, replaceValue) { var O = requireObjectCoercible$b(this); var replacer = isNullOrUndefined$b(searchValue) ? undefined : getMethod$f(searchValue, REPLACE$1); return replacer ? call$S(replacer, searchValue, O, replaceValue) : call$S(nativeReplace, toString$j(O), searchValue, replaceValue); }, // `RegExp.prototype[@@replace]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace function (string, replaceValue) { var rx = anObject$K(this); var S = toString$j(string); if ( typeof replaceValue == 'string' && stringIndexOf$2(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf$2(replaceValue, '$<') === -1 ) { var res = maybeCallNative(nativeReplace, rx, S, replaceValue); if (res.done) return res.value; } var functionalReplace = isCallable$f(replaceValue); if (!functionalReplace) replaceValue = toString$j(replaceValue); var global = rx.global; var fullUnicode; if (global) { fullUnicode = rx.unicode; rx.lastIndex = 0; } var results = []; var result; while (true) { result = regExpExec$1(rx, S); if (result === null) break; push$j(results, result); if (!global) break; var matchStr = toString$j(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$4(rx.lastIndex), fullUnicode); } var accumulatedResult = ''; var nextSourcePosition = 0; for (var i = 0; i < results.length; i++) { result = results[i]; var matched = toString$j(result[0]); var position = max$5(min$7(toIntegerOrInfinity$8(result.index), S.length), 0); var captures = []; var replacement; // NOTE: This is equivalent to // captures = result.slice(1).map(maybeToString) // but for some reason `nativeSlice.call(result, 1, result.length)` (called in // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. for (var j = 1; j < result.length; j++) push$j(captures, maybeToString(result[j])); var namedCaptures = result.groups; if (functionalReplace) { var replacerArgs = concat$1([matched], captures, position, S); if (namedCaptures !== undefined) push$j(replacerArgs, namedCaptures); replacement = toString$j(apply$7(replaceValue, undefined, replacerArgs)); } else { replacement = getSubstitution$1(matched, S, position, captures, namedCaptures, replaceValue); } if (position >= nextSourcePosition) { accumulatedResult += stringSlice$a(S, nextSourcePosition, position) + replacement; nextSourcePosition = position + matched.length; } } return accumulatedResult + stringSlice$a(S, nextSourcePosition); } ]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); var $$32 = _export; var call$R = functionCall; var uncurryThis$W = functionUncurryThis; var requireObjectCoercible$a = requireObjectCoercible$p; var isCallable$e = isCallable$K; var isNullOrUndefined$a = isNullOrUndefined$k; var isRegExp$1 = isRegexp; var toString$i = toString$I; var getMethod$e = getMethod$l; var getRegExpFlags$1 = regexpGetFlags; var getSubstitution = getSubstitution$2; var wellKnownSymbol$o = wellKnownSymbol$T; var REPLACE = wellKnownSymbol$o('replace'); var $TypeError$l = TypeError; var indexOf = uncurryThis$W(''.indexOf); uncurryThis$W(''.replace); var stringSlice$9 = uncurryThis$W(''.slice); var max$4 = Math.max; var stringIndexOf$1 = function (string, searchValue, fromIndex) { if (fromIndex > string.length) return -1; if (searchValue === '') return fromIndex; return indexOf(string, searchValue, fromIndex); }; // `String.prototype.replaceAll` method // https://tc39.es/ecma262/#sec-string.prototype.replaceall $$32({ target: 'String', proto: true }, { replaceAll: function replaceAll(searchValue, replaceValue) { var O = requireObjectCoercible$a(this); var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement; var position = 0; var endOfLastMatch = 0; var result = ''; if (!isNullOrUndefined$a(searchValue)) { IS_REG_EXP = isRegExp$1(searchValue); if (IS_REG_EXP) { flags = toString$i(requireObjectCoercible$a(getRegExpFlags$1(searchValue))); if (!~indexOf(flags, 'g')) throw $TypeError$l('`.replaceAll` does not allow non-global regexes'); } replacer = getMethod$e(searchValue, REPLACE); if (replacer) { return call$R(replacer, searchValue, O, replaceValue); } } string = toString$i(O); searchString = toString$i(searchValue); functionalReplace = isCallable$e(replaceValue); if (!functionalReplace) replaceValue = toString$i(replaceValue); searchLength = searchString.length; advanceBy = max$4(1, searchLength); position = stringIndexOf$1(string, searchString, 0); while (position !== -1) { replacement = functionalReplace ? toString$i(replaceValue(searchString, position, string)) : getSubstitution(searchString, string, position, [], undefined, replaceValue); result += stringSlice$9(string, endOfLastMatch, position) + replacement; endOfLastMatch = position + searchLength; position = stringIndexOf$1(string, searchString, position + advanceBy); } if (endOfLastMatch < string.length) { result += stringSlice$9(string, endOfLastMatch); } return result; } }); var call$Q = functionCall; var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic; var anObject$J = anObject$1f; var isNullOrUndefined$9 = isNullOrUndefined$k; var requireObjectCoercible$9 = requireObjectCoercible$p; var sameValue = sameValue$1; var toString$h = toString$I; var getMethod$d = getMethod$l; var regExpExec = regexpExecAbstract; // @@search logic fixRegExpWellKnownSymbolLogic$1('search', function (SEARCH, nativeSearch, maybeCallNative) { return [ // `String.prototype.search` method // https://tc39.es/ecma262/#sec-string.prototype.search function search(regexp) { var O = requireObjectCoercible$9(this); var searcher = isNullOrUndefined$9(regexp) ? undefined : getMethod$d(regexp, SEARCH); return searcher ? call$Q(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$h(O)); }, // `RegExp.prototype[@@search]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@search function (string) { var rx = anObject$J(this); var S = toString$h(string); var res = maybeCallNative(nativeSearch, rx, S); if (res.done) return res.value; var previousLastIndex = rx.lastIndex; if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; var result = regExpExec(rx, S); if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; return result === null ? -1 : result.index; } ]; }); var apply$6 = functionApply$1; var call$P = functionCall; var uncurryThis$V = functionUncurryThis; var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic; var anObject$I = anObject$1f; var isNullOrUndefined$8 = isNullOrUndefined$k; var isRegExp = isRegexp; var requireObjectCoercible$8 = requireObjectCoercible$p; var speciesConstructor$1 = speciesConstructor$6; var advanceStringIndex = advanceStringIndex$4; var toLength$3 = toLength$d; var toString$g = toString$I; var getMethod$c = getMethod$l; var arraySlice$5 = arraySliceSimple; var callRegExpExec = regexpExecAbstract; var regexpExec = regexpExec$3; var stickyHelpers = regexpStickyHelpers; var fails$o = fails$1u; var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; var MAX_UINT32 = 0xFFFFFFFF; var min$6 = Math.min; var $push = [].push; var exec$a = uncurryThis$V(/./.exec); var push$i = uncurryThis$V($push); var stringSlice$8 = uncurryThis$V(''.slice); // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec // Weex JS has frozen built-in prototypes, so use try / catch wrapper var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$o(function () { // eslint-disable-next-line regexp/no-empty-group -- required for testing var re = /(?:)/; var originalExec = re.exec; re.exec = function () { return originalExec.apply(this, arguments); }; var result = 'ab'.split(re); return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; }); // @@split logic fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) { var internalSplit; if ( 'abbc'.split(/(b)*/)[1] === 'c' || // eslint-disable-next-line regexp/no-empty-group -- required for testing 'test'.split(/(?:)/, -1).length !== 4 || 'ab'.split(/(?:ab)*/).length !== 2 || '.'.split(/(.?)(.?)/).length !== 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing '.'.split(/()()/).length > 1 || ''.split(/.?/).length ) { // based on es5-shim implementation, need to rework it internalSplit = function (separator, limit) { var string = toString$g(requireObjectCoercible$8(this)); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; if (separator === undefined) return [string]; // If `separator` is not a regex, use native split if (!isRegExp(separator)) { return call$P(nativeSplit, string, separator, lim); } var output = []; var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : ''); var lastLastIndex = 0; // Make `global` and avoid `lastIndex` issues by working with a copy var separatorCopy = new RegExp(separator.source, flags + 'g'); var match, lastIndex, lastLength; while (match = call$P(regexpExec, separatorCopy, string)) { lastIndex = separatorCopy.lastIndex; if (lastIndex > lastLastIndex) { push$i(output, stringSlice$8(string, lastLastIndex, match.index)); if (match.length > 1 && match.index < string.length) apply$6($push, output, arraySlice$5(match, 1)); lastLength = match[0].length; lastLastIndex = lastIndex; if (output.length >= lim) break; } if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop } if (lastLastIndex === string.length) { if (lastLength || !exec$a(separatorCopy, '')) push$i(output, ''); } else push$i(output, stringSlice$8(string, lastLastIndex)); return output.length > lim ? arraySlice$5(output, 0, lim) : output; }; // Chakra, V8 } else if ('0'.split(undefined, 0).length) { internalSplit = function (separator, limit) { return separator === undefined && limit === 0 ? [] : call$P(nativeSplit, this, separator, limit); }; } else internalSplit = nativeSplit; return [ // `String.prototype.split` method // https://tc39.es/ecma262/#sec-string.prototype.split function split(separator, limit) { var O = requireObjectCoercible$8(this); var splitter = isNullOrUndefined$8(separator) ? undefined : getMethod$c(separator, SPLIT); return splitter ? call$P(splitter, separator, O, limit) : call$P(internalSplit, toString$g(O), separator, limit); }, // `RegExp.prototype[@@split]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@split // // NOTE: This cannot be properly polyfilled in engines that don't support // the 'y' flag. function (string, limit) { var rx = anObject$I(this); var S = toString$g(string); var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit); if (res.done) return res.value; var C = speciesConstructor$1(rx, RegExp); var unicodeMatching = rx.unicode; var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (UNSUPPORTED_Y ? 'g' : 'y'); // ^(? + rx + ) is needed, in combination with some S slicing, to // simulate the 'y' flag. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; var p = 0; var q = 0; var A = []; while (q < S.length) { splitter.lastIndex = UNSUPPORTED_Y ? 0 : q; var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice$8(S, q) : S); var e; if ( z === null || (e = min$6(toLength$3(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p ) { q = advanceStringIndex(S, q, unicodeMatching); } else { push$i(A, stringSlice$8(S, p, q)); if (A.length === lim) return A; for (var i = 1; i <= z.length - 1; i++) { push$i(A, z[i]); if (A.length === lim) return A; } q = p = e; } } push$i(A, stringSlice$8(S, p)); return A; } ]; }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y); var $$31 = _export; var uncurryThis$U = functionUncurryThisClause; var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f; var toLength$2 = toLength$d; var toString$f = toString$I; var notARegExp = notARegexp; var requireObjectCoercible$7 = requireObjectCoercible$p; var correctIsRegExpLogic = correctIsRegexpLogic; // eslint-disable-next-line es/no-string-prototype-startswith -- safe var nativeStartsWith = uncurryThis$U(''.startsWith); var stringSlice$7 = uncurryThis$U(''.slice); var min$5 = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); // https://github.com/zloirock/core-js/pull/702 var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor$5(String.prototype, 'startsWith'); return descriptor && !descriptor.writable; }(); // `String.prototype.startsWith` method // https://tc39.es/ecma262/#sec-string.prototype.startswith $$31({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { startsWith: function startsWith(searchString /* , position = 0 */) { var that = toString$f(requireObjectCoercible$7(this)); notARegExp(searchString); var index = toLength$2(min$5(arguments.length > 1 ? arguments[1] : undefined, that.length)); var search = toString$f(searchString); return nativeStartsWith ? nativeStartsWith(that, search, index) : stringSlice$7(that, index, index + search.length) === search; } }); var $$30 = _export; var uncurryThis$T = functionUncurryThis; var requireObjectCoercible$6 = requireObjectCoercible$p; var toIntegerOrInfinity$7 = toIntegerOrInfinity$p; var toString$e = toString$I; var stringSlice$6 = uncurryThis$T(''.slice); var max$3 = Math.max; var min$4 = Math.min; // eslint-disable-next-line unicorn/prefer-string-slice -- required for testing var FORCED$3 = !''.substr || 'ab'.substr(-1) !== 'b'; // `String.prototype.substr` method // https://tc39.es/ecma262/#sec-string.prototype.substr $$30({ target: 'String', proto: true, forced: FORCED$3 }, { substr: function substr(start, length) { var that = toString$e(requireObjectCoercible$6(this)); var size = that.length; var intStart = toIntegerOrInfinity$7(start); var intLength, intEnd; if (intStart === Infinity) intStart = 0; if (intStart < 0) intStart = max$3(size + intStart, 0); intLength = length === undefined ? size : toIntegerOrInfinity$7(length); if (intLength <= 0 || intLength === Infinity) return ''; intEnd = min$4(intStart + intLength, size); return intStart >= intEnd ? '' : stringSlice$6(that, intStart, intEnd); } }); var $$2$ = _export; var call$O = functionCall; var uncurryThis$S = functionUncurryThis; var requireObjectCoercible$5 = requireObjectCoercible$p; var toString$d = toString$I; var fails$n = fails$1u; var $Array$2 = Array; var charAt$a = uncurryThis$S(''.charAt); var charCodeAt$3 = uncurryThis$S(''.charCodeAt); var join$5 = uncurryThis$S([].join); // eslint-disable-next-line es/no-string-prototype-iswellformed-towellformed -- safe var $toWellFormed = ''.toWellFormed; var REPLACEMENT_CHARACTER = '\uFFFD'; // Safari bug var TO_STRING_CONVERSION_BUG = $toWellFormed && fails$n(function () { return call$O($toWellFormed, 1) !== '1'; }); // `String.prototype.toWellFormed` method // https://github.com/tc39/proposal-is-usv-string $$2$({ target: 'String', proto: true, forced: TO_STRING_CONVERSION_BUG }, { toWellFormed: function toWellFormed() { var S = toString$d(requireObjectCoercible$5(this)); if (TO_STRING_CONVERSION_BUG) return call$O($toWellFormed, S); var length = S.length; var result = $Array$2(length); for (var i = 0; i < length; i++) { var charCode = charCodeAt$3(S, i); // single UTF-16 code unit if ((charCode & 0xF800) !== 0xD800) result[i] = charAt$a(S, i); // unpaired surrogate else if (charCode >= 0xDC00 || i + 1 >= length || (charCodeAt$3(S, i + 1) & 0xFC00) !== 0xDC00) result[i] = REPLACEMENT_CHARACTER; // surrogate pair else { result[i] = charAt$a(S, i); result[++i] = charAt$a(S, i); } } return join$5(result, ''); } }); var PROPER_FUNCTION_NAME = functionName.PROPER; var fails$m = fails$1u; var whitespaces$2 = whitespaces$6; var non = '\u200B\u0085\u180E'; // check that a method works with the correct list // of whitespaces and has a correct name var stringTrimForced = function (METHOD_NAME) { return fails$m(function () { return !!whitespaces$2[METHOD_NAME]() || non[METHOD_NAME]() !== non || (PROPER_FUNCTION_NAME && whitespaces$2[METHOD_NAME].name !== METHOD_NAME); }); }; var $$2_ = _export; var $trim = stringTrim.trim; var forcedStringTrimMethod$2 = stringTrimForced; // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim $$2_({ target: 'String', proto: true, forced: forcedStringTrimMethod$2('trim') }, { trim: function trim() { return $trim(this); } }); var $trimEnd = stringTrim.end; var forcedStringTrimMethod$1 = stringTrimForced; // `String.prototype.{ trimEnd, trimRight }` method // https://tc39.es/ecma262/#sec-string.prototype.trimend // https://tc39.es/ecma262/#String.prototype.trimright var stringTrimEnd = forcedStringTrimMethod$1('trimEnd') ? function trimEnd() { return $trimEnd(this); // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimEnd; var $$2Z = _export; var trimEnd$1 = stringTrimEnd; // `String.prototype.trimRight` method // https://tc39.es/ecma262/#sec-string.prototype.trimend // eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe $$2Z({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimRight !== trimEnd$1 }, { trimRight: trimEnd$1 }); // TODO: Remove this line from `core-js@4` var $$2Y = _export; var trimEnd = stringTrimEnd; // `String.prototype.trimEnd` method // https://tc39.es/ecma262/#sec-string.prototype.trimend // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe $$2Y({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimEnd !== trimEnd }, { trimEnd: trimEnd }); var $trimStart = stringTrim.start; var forcedStringTrimMethod = stringTrimForced; // `String.prototype.{ trimStart, trimLeft }` method // https://tc39.es/ecma262/#sec-string.prototype.trimstart // https://tc39.es/ecma262/#String.prototype.trimleft var stringTrimStart = forcedStringTrimMethod('trimStart') ? function trimStart() { return $trimStart(this); // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimStart; var $$2X = _export; var trimStart$1 = stringTrimStart; // `String.prototype.trimLeft` method // https://tc39.es/ecma262/#sec-string.prototype.trimleft // eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe $$2X({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimLeft !== trimStart$1 }, { trimLeft: trimStart$1 }); // TODO: Remove this line from `core-js@4` var $$2W = _export; var trimStart = stringTrimStart; // `String.prototype.trimStart` method // https://tc39.es/ecma262/#sec-string.prototype.trimstart // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe $$2W({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimStart !== trimStart }, { trimStart: trimStart }); var uncurryThis$R = functionUncurryThis; var requireObjectCoercible$4 = requireObjectCoercible$p; var toString$c = toString$I; var quot = /"/g; var replace$4 = uncurryThis$R(''.replace); // `CreateHTML` abstract operation // https://tc39.es/ecma262/#sec-createhtml var createHtml = function (string, tag, attribute, value) { var S = toString$c(requireObjectCoercible$4(string)); var p1 = '<' + tag; if (attribute !== '') p1 += ' ' + attribute + '="' + replace$4(toString$c(value), quot, '"') + '"'; return p1 + '>' + S + ''; }; var fails$l = fails$1u; // check the existence of a method, lowercase // of a tag and escaping quotes in arguments var stringHtmlForced = function (METHOD_NAME) { return fails$l(function () { var test = ''[METHOD_NAME]('"'); return test !== test.toLowerCase() || test.split('"').length > 3; }); }; var $$2V = _export; var createHTML$c = createHtml; var forcedStringHTMLMethod$c = stringHtmlForced; // `String.prototype.anchor` method // https://tc39.es/ecma262/#sec-string.prototype.anchor $$2V({ target: 'String', proto: true, forced: forcedStringHTMLMethod$c('anchor') }, { anchor: function anchor(name) { return createHTML$c(this, 'a', 'name', name); } }); var $$2U = _export; var createHTML$b = createHtml; var forcedStringHTMLMethod$b = stringHtmlForced; // `String.prototype.big` method // https://tc39.es/ecma262/#sec-string.prototype.big $$2U({ target: 'String', proto: true, forced: forcedStringHTMLMethod$b('big') }, { big: function big() { return createHTML$b(this, 'big', '', ''); } }); var $$2T = _export; var createHTML$a = createHtml; var forcedStringHTMLMethod$a = stringHtmlForced; // `String.prototype.blink` method // https://tc39.es/ecma262/#sec-string.prototype.blink $$2T({ target: 'String', proto: true, forced: forcedStringHTMLMethod$a('blink') }, { blink: function blink() { return createHTML$a(this, 'blink', '', ''); } }); var $$2S = _export; var createHTML$9 = createHtml; var forcedStringHTMLMethod$9 = stringHtmlForced; // `String.prototype.bold` method // https://tc39.es/ecma262/#sec-string.prototype.bold $$2S({ target: 'String', proto: true, forced: forcedStringHTMLMethod$9('bold') }, { bold: function bold() { return createHTML$9(this, 'b', '', ''); } }); var $$2R = _export; var createHTML$8 = createHtml; var forcedStringHTMLMethod$8 = stringHtmlForced; // `String.prototype.fixed` method // https://tc39.es/ecma262/#sec-string.prototype.fixed $$2R({ target: 'String', proto: true, forced: forcedStringHTMLMethod$8('fixed') }, { fixed: function fixed() { return createHTML$8(this, 'tt', '', ''); } }); var $$2Q = _export; var createHTML$7 = createHtml; var forcedStringHTMLMethod$7 = stringHtmlForced; // `String.prototype.fontcolor` method // https://tc39.es/ecma262/#sec-string.prototype.fontcolor $$2Q({ target: 'String', proto: true, forced: forcedStringHTMLMethod$7('fontcolor') }, { fontcolor: function fontcolor(color) { return createHTML$7(this, 'font', 'color', color); } }); var $$2P = _export; var createHTML$6 = createHtml; var forcedStringHTMLMethod$6 = stringHtmlForced; // `String.prototype.fontsize` method // https://tc39.es/ecma262/#sec-string.prototype.fontsize $$2P({ target: 'String', proto: true, forced: forcedStringHTMLMethod$6('fontsize') }, { fontsize: function fontsize(size) { return createHTML$6(this, 'font', 'size', size); } }); var $$2O = _export; var createHTML$5 = createHtml; var forcedStringHTMLMethod$5 = stringHtmlForced; // `String.prototype.italics` method // https://tc39.es/ecma262/#sec-string.prototype.italics $$2O({ target: 'String', proto: true, forced: forcedStringHTMLMethod$5('italics') }, { italics: function italics() { return createHTML$5(this, 'i', '', ''); } }); var $$2N = _export; var createHTML$4 = createHtml; var forcedStringHTMLMethod$4 = stringHtmlForced; // `String.prototype.link` method // https://tc39.es/ecma262/#sec-string.prototype.link $$2N({ target: 'String', proto: true, forced: forcedStringHTMLMethod$4('link') }, { link: function link(url) { return createHTML$4(this, 'a', 'href', url); } }); var $$2M = _export; var createHTML$3 = createHtml; var forcedStringHTMLMethod$3 = stringHtmlForced; // `String.prototype.small` method // https://tc39.es/ecma262/#sec-string.prototype.small $$2M({ target: 'String', proto: true, forced: forcedStringHTMLMethod$3('small') }, { small: function small() { return createHTML$3(this, 'small', '', ''); } }); var $$2L = _export; var createHTML$2 = createHtml; var forcedStringHTMLMethod$2 = stringHtmlForced; // `String.prototype.strike` method // https://tc39.es/ecma262/#sec-string.prototype.strike $$2L({ target: 'String', proto: true, forced: forcedStringHTMLMethod$2('strike') }, { strike: function strike() { return createHTML$2(this, 'strike', '', ''); } }); var $$2K = _export; var createHTML$1 = createHtml; var forcedStringHTMLMethod$1 = stringHtmlForced; // `String.prototype.sub` method // https://tc39.es/ecma262/#sec-string.prototype.sub $$2K({ target: 'String', proto: true, forced: forcedStringHTMLMethod$1('sub') }, { sub: function sub() { return createHTML$1(this, 'sub', '', ''); } }); var $$2J = _export; var createHTML = createHtml; var forcedStringHTMLMethod = stringHtmlForced; // `String.prototype.sup` method // https://tc39.es/ecma262/#sec-string.prototype.sup $$2J({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sup') }, { sup: function sup() { return createHTML(this, 'sup', '', ''); } }); var typedArrayConstructor = {exports: {}}; /* eslint-disable no-new -- required for testing */ var global$v = global$16; var fails$k = fails$1u; var checkCorrectnessOfIteration = checkCorrectnessOfIteration$4; var NATIVE_ARRAY_BUFFER_VIEWS$1 = arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; var ArrayBuffer$3 = global$v.ArrayBuffer; var Int8Array$3 = global$v.Int8Array; var typedArrayConstructorsRequireWrappers = !NATIVE_ARRAY_BUFFER_VIEWS$1 || !fails$k(function () { Int8Array$3(1); }) || !fails$k(function () { new Int8Array$3(-1); }) || !checkCorrectnessOfIteration(function (iterable) { new Int8Array$3(); new Int8Array$3(null); new Int8Array$3(1.5); new Int8Array$3(iterable); }, true) || fails$k(function () { // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill return new Int8Array$3(new ArrayBuffer$3(2), 1, undefined).length !== 1; }); var toIntegerOrInfinity$6 = toIntegerOrInfinity$p; var $RangeError$6 = RangeError; var toPositiveInteger$5 = function (it) { var result = toIntegerOrInfinity$6(it); if (result < 0) throw $RangeError$6("The argument can't be less than 0"); return result; }; var toPositiveInteger$4 = toPositiveInteger$5; var $RangeError$5 = RangeError; var toOffset$2 = function (it, BYTES) { var offset = toPositiveInteger$4(it); if (offset % BYTES) throw $RangeError$5('Wrong offset'); return offset; }; var round = Math.round; var toUint8Clamped$2 = function (it) { var value = round(it); return value < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; }; var classof$8 = classof$q; var isBigIntArray$3 = function (it) { var klass = classof$8(it); return klass === 'BigInt64Array' || klass === 'BigUint64Array'; }; var toPrimitive = toPrimitive$4; var $TypeError$k = TypeError; // `ToBigInt` abstract operation // https://tc39.es/ecma262/#sec-tobigint var toBigInt$4 = function (argument) { var prim = toPrimitive(argument, 'number'); if (typeof prim == 'number') throw $TypeError$k("Can't convert number to bigint"); // eslint-disable-next-line es/no-bigint -- safe return BigInt(prim); }; var bind$j = functionBindContext; var call$N = functionCall; var aConstructor$2 = aConstructor$5; var toObject$a = toObject$D; var lengthOfArrayLike$c = lengthOfArrayLike$C; var getIterator$4 = getIterator$7; var getIteratorMethod$4 = getIteratorMethod$8; var isArrayIteratorMethod = isArrayIteratorMethod$3; var isBigIntArray$2 = isBigIntArray$3; var aTypedArrayConstructor$4 = arrayBufferViewCore.aTypedArrayConstructor; var toBigInt$3 = toBigInt$4; var typedArrayFrom$2 = function from(source /* , mapfn, thisArg */) { var C = aConstructor$2(this); var O = toObject$a(source); var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var iteratorMethod = getIteratorMethod$4(O); var i, length, result, thisIsBigIntArray, value, step, iterator, next; if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) { iterator = getIterator$4(O, iteratorMethod); next = iterator.next; O = []; while (!(step = call$N(next, iterator)).done) { O.push(step.value); } } if (mapping && argumentsLength > 2) { mapfn = bind$j(mapfn, arguments[2]); } length = lengthOfArrayLike$c(O); result = new (aTypedArrayConstructor$4(C))(length); thisIsBigIntArray = isBigIntArray$2(result); for (i = 0; length > i; i++) { value = mapping ? mapfn(O[i], i) : O[i]; // FF30- typed arrays doesn't properly convert objects to typed array values result[i] = thisIsBigIntArray ? toBigInt$3(value) : +value; } return result; }; var $$2I = _export; var global$u = global$16; var call$M = functionCall; var DESCRIPTORS$g = descriptors; var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS$2 = typedArrayConstructorsRequireWrappers; var ArrayBufferViewCore$A = arrayBufferViewCore; var ArrayBufferModule = arrayBuffer; var anInstance$a = anInstance$f; var createPropertyDescriptor$4 = createPropertyDescriptor$d; var createNonEnumerableProperty$8 = createNonEnumerableProperty$k; var isIntegralNumber = isIntegralNumber$3; var toLength$1 = toLength$d; var toIndex$3 = toIndex$5; var toOffset$1 = toOffset$2; var toUint8Clamped$1 = toUint8Clamped$2; var toPropertyKey$2 = toPropertyKey$a; var hasOwn$g = hasOwnProperty_1; var classof$7 = classof$q; var isObject$f = isObject$K; var isSymbol$2 = isSymbol$8; var create$a = objectCreate$1; var isPrototypeOf$3 = objectIsPrototypeOf; var setPrototypeOf$1 = objectSetPrototypeOf$1; var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f; var typedArrayFrom$1 = typedArrayFrom$2; var forEach$5 = arrayIteration.forEach; var setSpecies$1 = setSpecies$7; var defineBuiltInAccessor$c = defineBuiltInAccessor$o; var definePropertyModule = objectDefineProperty; var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor; var InternalStateModule$e = internalState; var inheritIfRequired$1 = inheritIfRequired$6; var getInternalState$7 = InternalStateModule$e.get; var setInternalState$f = InternalStateModule$e.set; var enforceInternalState$1 = InternalStateModule$e.enforce; var nativeDefineProperty = definePropertyModule.f; var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; var RangeError$3 = global$u.RangeError; var ArrayBuffer$2 = ArrayBufferModule.ArrayBuffer; var ArrayBufferPrototype$2 = ArrayBuffer$2.prototype; var DataView$2 = ArrayBufferModule.DataView; var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore$A.NATIVE_ARRAY_BUFFER_VIEWS; var TYPED_ARRAY_TAG = ArrayBufferViewCore$A.TYPED_ARRAY_TAG; var TypedArray = ArrayBufferViewCore$A.TypedArray; var TypedArrayPrototype$1 = ArrayBufferViewCore$A.TypedArrayPrototype; var aTypedArrayConstructor$3 = ArrayBufferViewCore$A.aTypedArrayConstructor; var isTypedArray = ArrayBufferViewCore$A.isTypedArray; var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; var WRONG_LENGTH = 'Wrong length'; var fromList = function (C, list) { aTypedArrayConstructor$3(C); var index = 0; var length = list.length; var result = new C(length); while (length > index) result[index] = list[index++]; return result; }; var addGetter$1 = function (it, key) { defineBuiltInAccessor$c(it, key, { configurable: true, get: function () { return getInternalState$7(this)[key]; } }); }; var isArrayBuffer = function (it) { var klass; return isPrototypeOf$3(ArrayBufferPrototype$2, it) || (klass = classof$7(it)) === 'ArrayBuffer' || klass === 'SharedArrayBuffer'; }; var isTypedArrayIndex = function (target, key) { return isTypedArray(target) && !isSymbol$2(key) && key in target && isIntegralNumber(+key) && key >= 0; }; var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { key = toPropertyKey$2(key); return isTypedArrayIndex(target, key) ? createPropertyDescriptor$4(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key); }; var wrappedDefineProperty = function defineProperty(target, key, descriptor) { key = toPropertyKey$2(key); if (isTypedArrayIndex(target, key) && isObject$f(descriptor) && hasOwn$g(descriptor, 'value') && !hasOwn$g(descriptor, 'get') && !hasOwn$g(descriptor, 'set') // TODO: add validation descriptor w/o calling accessors && !descriptor.configurable && (!hasOwn$g(descriptor, 'writable') || descriptor.writable) && (!hasOwn$g(descriptor, 'enumerable') || descriptor.enumerable) ) { target[key] = descriptor.value; return target; } return nativeDefineProperty(target, key, descriptor); }; if (DESCRIPTORS$g) { if (!NATIVE_ARRAY_BUFFER_VIEWS) { getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; definePropertyModule.f = wrappedDefineProperty; addGetter$1(TypedArrayPrototype$1, 'buffer'); addGetter$1(TypedArrayPrototype$1, 'byteOffset'); addGetter$1(TypedArrayPrototype$1, 'byteLength'); addGetter$1(TypedArrayPrototype$1, 'length'); } $$2I({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, defineProperty: wrappedDefineProperty }); typedArrayConstructor.exports = function (TYPE, wrapper, CLAMPED) { var BYTES = TYPE.match(/\d+/)[0] / 8; var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; var GETTER = 'get' + TYPE; var SETTER = 'set' + TYPE; var NativeTypedArrayConstructor = global$u[CONSTRUCTOR_NAME]; var TypedArrayConstructor = NativeTypedArrayConstructor; var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; var exported = {}; var getter = function (that, index) { var data = getInternalState$7(that); return data.view[GETTER](index * BYTES + data.byteOffset, true); }; var setter = function (that, index, value) { var data = getInternalState$7(that); data.view[SETTER](index * BYTES + data.byteOffset, CLAMPED ? toUint8Clamped$1(value) : value, true); }; var addElement = function (that, index) { nativeDefineProperty(that, index, { get: function () { return getter(this, index); }, set: function (value) { return setter(this, index, value); }, enumerable: true }); }; if (!NATIVE_ARRAY_BUFFER_VIEWS) { TypedArrayConstructor = wrapper(function (that, data, offset, $length) { anInstance$a(that, TypedArrayConstructorPrototype); var index = 0; var byteOffset = 0; var buffer, byteLength, length; if (!isObject$f(data)) { length = toIndex$3(data); byteLength = length * BYTES; buffer = new ArrayBuffer$2(byteLength); } else if (isArrayBuffer(data)) { buffer = data; byteOffset = toOffset$1(offset, BYTES); var $len = data.byteLength; if ($length === undefined) { if ($len % BYTES) throw RangeError$3(WRONG_LENGTH); byteLength = $len - byteOffset; if (byteLength < 0) throw RangeError$3(WRONG_LENGTH); } else { byteLength = toLength$1($length) * BYTES; if (byteLength + byteOffset > $len) throw RangeError$3(WRONG_LENGTH); } length = byteLength / BYTES; } else if (isTypedArray(data)) { return fromList(TypedArrayConstructor, data); } else { return call$M(typedArrayFrom$1, TypedArrayConstructor, data); } setInternalState$f(that, { buffer: buffer, byteOffset: byteOffset, byteLength: byteLength, length: length, view: new DataView$2(buffer) }); while (index < length) addElement(that, index++); }); if (setPrototypeOf$1) setPrototypeOf$1(TypedArrayConstructor, TypedArray); TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create$a(TypedArrayPrototype$1); } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS$2) { TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { anInstance$a(dummy, TypedArrayConstructorPrototype); return inheritIfRequired$1(function () { if (!isObject$f(data)) return new NativeTypedArrayConstructor(toIndex$3(data)); if (isArrayBuffer(data)) return $length !== undefined ? new NativeTypedArrayConstructor(data, toOffset$1(typedArrayOffset, BYTES), $length) : typedArrayOffset !== undefined ? new NativeTypedArrayConstructor(data, toOffset$1(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data); if (isTypedArray(data)) return fromList(TypedArrayConstructor, data); return call$M(typedArrayFrom$1, TypedArrayConstructor, data); }(), dummy, TypedArrayConstructor); }); if (setPrototypeOf$1) setPrototypeOf$1(TypedArrayConstructor, TypedArray); forEach$5(getOwnPropertyNames$1(NativeTypedArrayConstructor), function (key) { if (!(key in TypedArrayConstructor)) { createNonEnumerableProperty$8(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); } }); TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; } if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { createNonEnumerableProperty$8(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); } enforceInternalState$1(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor; if (TYPED_ARRAY_TAG) { createNonEnumerableProperty$8(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); } var FORCED = TypedArrayConstructor !== NativeTypedArrayConstructor; exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; $$2I({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported); if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { createNonEnumerableProperty$8(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); } if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { createNonEnumerableProperty$8(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); } setSpecies$1(CONSTRUCTOR_NAME); }; } else typedArrayConstructor.exports = function () { /* empty */ }; var typedArrayConstructorExports = typedArrayConstructor.exports; var createTypedArrayConstructor$8 = typedArrayConstructorExports; // `Float32Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor$8('Float32', function (init) { return function Float32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); var createTypedArrayConstructor$7 = typedArrayConstructorExports; // `Float64Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor$7('Float64', function (init) { return function Float64Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); var createTypedArrayConstructor$6 = typedArrayConstructorExports; // `Int8Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor$6('Int8', function (init) { return function Int8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); var createTypedArrayConstructor$5 = typedArrayConstructorExports; // `Int16Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor$5('Int16', function (init) { return function Int16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); var createTypedArrayConstructor$4 = typedArrayConstructorExports; // `Int32Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor$4('Int32', function (init) { return function Int32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); var createTypedArrayConstructor$3 = typedArrayConstructorExports; // `Uint8Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor$3('Uint8', function (init) { return function Uint8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); var createTypedArrayConstructor$2 = typedArrayConstructorExports; // `Uint8ClampedArray` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor$2('Uint8', function (init) { return function Uint8ClampedArray(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }, true); var createTypedArrayConstructor$1 = typedArrayConstructorExports; // `Uint16Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor$1('Uint16', function (init) { return function Uint16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); var createTypedArrayConstructor = typedArrayConstructorExports; // `Uint32Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Uint32', function (init) { return function Uint32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); var ArrayBufferViewCore$z = arrayBufferViewCore; var lengthOfArrayLike$b = lengthOfArrayLike$C; var toIntegerOrInfinity$5 = toIntegerOrInfinity$p; var aTypedArray$w = ArrayBufferViewCore$z.aTypedArray; var exportTypedArrayMethod$x = ArrayBufferViewCore$z.exportTypedArrayMethod; // `%TypedArray%.prototype.at` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.at exportTypedArrayMethod$x('at', function at(index) { var O = aTypedArray$w(this); var len = lengthOfArrayLike$b(O); var relativeIndex = toIntegerOrInfinity$5(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; return (k < 0 || k >= len) ? undefined : O[k]; }); var uncurryThis$Q = functionUncurryThis; var ArrayBufferViewCore$y = arrayBufferViewCore; var $ArrayCopyWithin = arrayCopyWithin; var u$ArrayCopyWithin = uncurryThis$Q($ArrayCopyWithin); var aTypedArray$v = ArrayBufferViewCore$y.aTypedArray; var exportTypedArrayMethod$w = ArrayBufferViewCore$y.exportTypedArrayMethod; // `%TypedArray%.prototype.copyWithin` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin exportTypedArrayMethod$w('copyWithin', function copyWithin(target, start /* , end */) { return u$ArrayCopyWithin(aTypedArray$v(this), target, start, arguments.length > 2 ? arguments[2] : undefined); }); var ArrayBufferViewCore$x = arrayBufferViewCore; var $every$1 = arrayIteration.every; var aTypedArray$u = ArrayBufferViewCore$x.aTypedArray; var exportTypedArrayMethod$v = ArrayBufferViewCore$x.exportTypedArrayMethod; // `%TypedArray%.prototype.every` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.every exportTypedArrayMethod$v('every', function every(callbackfn /* , thisArg */) { return $every$1(aTypedArray$u(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$w = arrayBufferViewCore; var $fill = arrayFill$1; var toBigInt$2 = toBigInt$4; var classof$6 = classof$q; var call$L = functionCall; var uncurryThis$P = functionUncurryThis; var fails$j = fails$1u; var aTypedArray$t = ArrayBufferViewCore$w.aTypedArray; var exportTypedArrayMethod$u = ArrayBufferViewCore$w.exportTypedArrayMethod; var slice$5 = uncurryThis$P(''.slice); // V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18 var CONVERSION_BUG = fails$j(function () { var count = 0; // eslint-disable-next-line es/no-typed-arrays -- safe new Int8Array(2).fill({ valueOf: function () { return count++; } }); return count !== 1; }); // `%TypedArray%.prototype.fill` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill exportTypedArrayMethod$u('fill', function fill(value /* , start, end */) { var length = arguments.length; aTypedArray$t(this); var actualValue = slice$5(classof$6(this), 0, 3) === 'Big' ? toBigInt$2(value) : +value; return call$L($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined); }, CONVERSION_BUG); var ArrayBufferViewCore$v = arrayBufferViewCore; var speciesConstructor = speciesConstructor$6; var aTypedArrayConstructor$2 = ArrayBufferViewCore$v.aTypedArrayConstructor; var getTypedArrayConstructor$5 = ArrayBufferViewCore$v.getTypedArrayConstructor; // a part of `TypedArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#typedarray-species-create var typedArraySpeciesConstructor$5 = function (originalArray) { return aTypedArrayConstructor$2(speciesConstructor(originalArray, getTypedArrayConstructor$5(originalArray))); }; var arrayFromConstructorAndList$4 = arrayFromConstructorAndList$6; var typedArraySpeciesConstructor$4 = typedArraySpeciesConstructor$5; var typedArrayFromSpeciesAndList = function (instance, list) { return arrayFromConstructorAndList$4(typedArraySpeciesConstructor$4(instance), list); }; var ArrayBufferViewCore$u = arrayBufferViewCore; var $filter = arrayIteration.filter; var fromSpeciesAndList$2 = typedArrayFromSpeciesAndList; var aTypedArray$s = ArrayBufferViewCore$u.aTypedArray; var exportTypedArrayMethod$t = ArrayBufferViewCore$u.exportTypedArrayMethod; // `%TypedArray%.prototype.filter` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter exportTypedArrayMethod$t('filter', function filter(callbackfn /* , thisArg */) { var list = $filter(aTypedArray$s(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); return fromSpeciesAndList$2(this, list); }); var ArrayBufferViewCore$t = arrayBufferViewCore; var $find$1 = arrayIteration.find; var aTypedArray$r = ArrayBufferViewCore$t.aTypedArray; var exportTypedArrayMethod$s = ArrayBufferViewCore$t.exportTypedArrayMethod; // `%TypedArray%.prototype.find` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.find exportTypedArrayMethod$s('find', function find(predicate /* , thisArg */) { return $find$1(aTypedArray$r(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$s = arrayBufferViewCore; var $findIndex = arrayIteration.findIndex; var aTypedArray$q = ArrayBufferViewCore$s.aTypedArray; var exportTypedArrayMethod$r = ArrayBufferViewCore$s.exportTypedArrayMethod; // `%TypedArray%.prototype.findIndex` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex exportTypedArrayMethod$r('findIndex', function findIndex(predicate /* , thisArg */) { return $findIndex(aTypedArray$q(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$r = arrayBufferViewCore; var $findLast = arrayIterationFromLast.findLast; var aTypedArray$p = ArrayBufferViewCore$r.aTypedArray; var exportTypedArrayMethod$q = ArrayBufferViewCore$r.exportTypedArrayMethod; // `%TypedArray%.prototype.findLast` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.findlast exportTypedArrayMethod$q('findLast', function findLast(predicate /* , thisArg */) { return $findLast(aTypedArray$p(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$q = arrayBufferViewCore; var $findLastIndex = arrayIterationFromLast.findLastIndex; var aTypedArray$o = ArrayBufferViewCore$q.aTypedArray; var exportTypedArrayMethod$p = ArrayBufferViewCore$q.exportTypedArrayMethod; // `%TypedArray%.prototype.findLastIndex` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.findlastindex exportTypedArrayMethod$p('findLastIndex', function findLastIndex(predicate /* , thisArg */) { return $findLastIndex(aTypedArray$o(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$p = arrayBufferViewCore; var $forEach$1 = arrayIteration.forEach; var aTypedArray$n = ArrayBufferViewCore$p.aTypedArray; var exportTypedArrayMethod$o = ArrayBufferViewCore$p.exportTypedArrayMethod; // `%TypedArray%.prototype.forEach` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach exportTypedArrayMethod$o('forEach', function forEach(callbackfn /* , thisArg */) { $forEach$1(aTypedArray$n(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS$1 = typedArrayConstructorsRequireWrappers; var exportTypedArrayStaticMethod$2 = arrayBufferViewCore.exportTypedArrayStaticMethod; var typedArrayFrom = typedArrayFrom$2; // `%TypedArray%.from` method // https://tc39.es/ecma262/#sec-%typedarray%.from exportTypedArrayStaticMethod$2('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS$1); var ArrayBufferViewCore$o = arrayBufferViewCore; var $includes = arrayIncludes.includes; var aTypedArray$m = ArrayBufferViewCore$o.aTypedArray; var exportTypedArrayMethod$n = ArrayBufferViewCore$o.exportTypedArrayMethod; // `%TypedArray%.prototype.includes` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes exportTypedArrayMethod$n('includes', function includes(searchElement /* , fromIndex */) { return $includes(aTypedArray$m(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$n = arrayBufferViewCore; var $indexOf = arrayIncludes.indexOf; var aTypedArray$l = ArrayBufferViewCore$n.aTypedArray; var exportTypedArrayMethod$m = ArrayBufferViewCore$n.exportTypedArrayMethod; // `%TypedArray%.prototype.indexOf` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof exportTypedArrayMethod$m('indexOf', function indexOf(searchElement /* , fromIndex */) { return $indexOf(aTypedArray$l(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); var global$t = global$16; var fails$i = fails$1u; var uncurryThis$O = functionUncurryThis; var ArrayBufferViewCore$m = arrayBufferViewCore; var ArrayIterators = es_array_iterator; var wellKnownSymbol$n = wellKnownSymbol$T; var ITERATOR$4 = wellKnownSymbol$n('iterator'); var Uint8Array$1 = global$t.Uint8Array; var arrayValues = uncurryThis$O(ArrayIterators.values); var arrayKeys = uncurryThis$O(ArrayIterators.keys); var arrayEntries = uncurryThis$O(ArrayIterators.entries); var aTypedArray$k = ArrayBufferViewCore$m.aTypedArray; var exportTypedArrayMethod$l = ArrayBufferViewCore$m.exportTypedArrayMethod; var TypedArrayPrototype = Uint8Array$1 && Uint8Array$1.prototype; var GENERIC = !fails$i(function () { TypedArrayPrototype[ITERATOR$4].call([1]); }); var ITERATOR_IS_VALUES = !!TypedArrayPrototype && TypedArrayPrototype.values && TypedArrayPrototype[ITERATOR$4] === TypedArrayPrototype.values && TypedArrayPrototype.values.name === 'values'; var typedArrayValues = function values() { return arrayValues(aTypedArray$k(this)); }; // `%TypedArray%.prototype.entries` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries exportTypedArrayMethod$l('entries', function entries() { return arrayEntries(aTypedArray$k(this)); }, GENERIC); // `%TypedArray%.prototype.keys` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys exportTypedArrayMethod$l('keys', function keys() { return arrayKeys(aTypedArray$k(this)); }, GENERIC); // `%TypedArray%.prototype.values` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.values exportTypedArrayMethod$l('values', typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); // `%TypedArray%.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator exportTypedArrayMethod$l(ITERATOR$4, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); var ArrayBufferViewCore$l = arrayBufferViewCore; var uncurryThis$N = functionUncurryThis; var aTypedArray$j = ArrayBufferViewCore$l.aTypedArray; var exportTypedArrayMethod$k = ArrayBufferViewCore$l.exportTypedArrayMethod; var $join = uncurryThis$N([].join); // `%TypedArray%.prototype.join` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.join exportTypedArrayMethod$k('join', function join(separator) { return $join(aTypedArray$j(this), separator); }); var ArrayBufferViewCore$k = arrayBufferViewCore; var apply$5 = functionApply$1; var $lastIndexOf = arrayLastIndexOf; var aTypedArray$i = ArrayBufferViewCore$k.aTypedArray; var exportTypedArrayMethod$j = ArrayBufferViewCore$k.exportTypedArrayMethod; // `%TypedArray%.prototype.lastIndexOf` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof exportTypedArrayMethod$j('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { var length = arguments.length; return apply$5($lastIndexOf, aTypedArray$i(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]); }); var ArrayBufferViewCore$j = arrayBufferViewCore; var $map = arrayIteration.map; var typedArraySpeciesConstructor$3 = typedArraySpeciesConstructor$5; var aTypedArray$h = ArrayBufferViewCore$j.aTypedArray; var exportTypedArrayMethod$i = ArrayBufferViewCore$j.exportTypedArrayMethod; // `%TypedArray%.prototype.map` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.map exportTypedArrayMethod$i('map', function map(mapfn /* , thisArg */) { return $map(aTypedArray$h(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { return new (typedArraySpeciesConstructor$3(O))(length); }); }); var ArrayBufferViewCore$i = arrayBufferViewCore; var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = typedArrayConstructorsRequireWrappers; var aTypedArrayConstructor$1 = ArrayBufferViewCore$i.aTypedArrayConstructor; var exportTypedArrayStaticMethod$1 = ArrayBufferViewCore$i.exportTypedArrayStaticMethod; // `%TypedArray%.of` method // https://tc39.es/ecma262/#sec-%typedarray%.of exportTypedArrayStaticMethod$1('of', function of(/* ...items */) { var index = 0; var length = arguments.length; var result = new (aTypedArrayConstructor$1(this))(length); while (length > index) result[index] = arguments[index++]; return result; }, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS); var ArrayBufferViewCore$h = arrayBufferViewCore; var $reduce = arrayReduce.left; var aTypedArray$g = ArrayBufferViewCore$h.aTypedArray; var exportTypedArrayMethod$h = ArrayBufferViewCore$h.exportTypedArrayMethod; // `%TypedArray%.prototype.reduce` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce exportTypedArrayMethod$h('reduce', function reduce(callbackfn /* , initialValue */) { var length = arguments.length; return $reduce(aTypedArray$g(this), callbackfn, length, length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$g = arrayBufferViewCore; var $reduceRight = arrayReduce.right; var aTypedArray$f = ArrayBufferViewCore$g.aTypedArray; var exportTypedArrayMethod$g = ArrayBufferViewCore$g.exportTypedArrayMethod; // `%TypedArray%.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright exportTypedArrayMethod$g('reduceRight', function reduceRight(callbackfn /* , initialValue */) { var length = arguments.length; return $reduceRight(aTypedArray$f(this), callbackfn, length, length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$f = arrayBufferViewCore; var aTypedArray$e = ArrayBufferViewCore$f.aTypedArray; var exportTypedArrayMethod$f = ArrayBufferViewCore$f.exportTypedArrayMethod; var floor$2 = Math.floor; // `%TypedArray%.prototype.reverse` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse exportTypedArrayMethod$f('reverse', function reverse() { var that = this; var length = aTypedArray$e(that).length; var middle = floor$2(length / 2); var index = 0; var value; while (index < middle) { value = that[index]; that[index++] = that[--length]; that[length] = value; } return that; }); var global$s = global$16; var call$K = functionCall; var ArrayBufferViewCore$e = arrayBufferViewCore; var lengthOfArrayLike$a = lengthOfArrayLike$C; var toOffset = toOffset$2; var toIndexedObject$1 = toObject$D; var fails$h = fails$1u; var RangeError$2 = global$s.RangeError; var Int8Array$2 = global$s.Int8Array; var Int8ArrayPrototype = Int8Array$2 && Int8Array$2.prototype; var $set = Int8ArrayPrototype && Int8ArrayPrototype.set; var aTypedArray$d = ArrayBufferViewCore$e.aTypedArray; var exportTypedArrayMethod$e = ArrayBufferViewCore$e.exportTypedArrayMethod; var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails$h(function () { // eslint-disable-next-line es/no-typed-arrays -- required for testing var array = new Uint8ClampedArray(2); call$K($set, array, { length: 1, 0: 3 }, 1); return array[1] !== 3; }); // https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore$e.NATIVE_ARRAY_BUFFER_VIEWS && fails$h(function () { var array = new Int8Array$2(2); array.set(1); array.set('2', 1); return array[0] !== 0 || array[1] !== 2; }); // `%TypedArray%.prototype.set` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set exportTypedArrayMethod$e('set', function set(arrayLike /* , offset */) { aTypedArray$d(this); var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); var src = toIndexedObject$1(arrayLike); if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call$K($set, this, src, offset); var length = this.length; var len = lengthOfArrayLike$a(src); var index = 0; if (len + offset > length) throw RangeError$2('Wrong length'); while (index < len) this[offset + index] = src[index++]; }, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG); var ArrayBufferViewCore$d = arrayBufferViewCore; var typedArraySpeciesConstructor$2 = typedArraySpeciesConstructor$5; var fails$g = fails$1u; var arraySlice$4 = arraySlice$b; var aTypedArray$c = ArrayBufferViewCore$d.aTypedArray; var exportTypedArrayMethod$d = ArrayBufferViewCore$d.exportTypedArrayMethod; var FORCED$2 = fails$g(function () { // eslint-disable-next-line es/no-typed-arrays -- required for testing new Int8Array(1).slice(); }); // `%TypedArray%.prototype.slice` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice exportTypedArrayMethod$d('slice', function slice(start, end) { var list = arraySlice$4(aTypedArray$c(this), start, end); var C = typedArraySpeciesConstructor$2(this); var index = 0; var length = list.length; var result = new C(length); while (length > index) result[index] = list[index++]; return result; }, FORCED$2); var ArrayBufferViewCore$c = arrayBufferViewCore; var $some$1 = arrayIteration.some; var aTypedArray$b = ArrayBufferViewCore$c.aTypedArray; var exportTypedArrayMethod$c = ArrayBufferViewCore$c.exportTypedArrayMethod; // `%TypedArray%.prototype.some` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.some exportTypedArrayMethod$c('some', function some(callbackfn /* , thisArg */) { return $some$1(aTypedArray$b(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); var global$r = global$16; var uncurryThis$M = functionUncurryThisClause; var fails$f = fails$1u; var aCallable$u = aCallable$N; var internalSort = arraySort$1; var ArrayBufferViewCore$b = arrayBufferViewCore; var FF = engineFfVersion; var IE_OR_EDGE = engineIsIeOrEdge; var V8$1 = engineV8Version; var WEBKIT = engineWebkitVersion; var aTypedArray$a = ArrayBufferViewCore$b.aTypedArray; var exportTypedArrayMethod$b = ArrayBufferViewCore$b.exportTypedArrayMethod; var Uint16Array = global$r.Uint16Array; var nativeSort = Uint16Array && uncurryThis$M(Uint16Array.prototype.sort); // WebKit var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails$f(function () { nativeSort(new Uint16Array(2), null); }) && fails$f(function () { nativeSort(new Uint16Array(2), {}); })); var STABLE_SORT = !!nativeSort && !fails$f(function () { // feature detection can be too slow, so check engines versions if (V8$1) return V8$1 < 74; if (FF) return FF < 67; if (IE_OR_EDGE) return true; if (WEBKIT) return WEBKIT < 602; var array = new Uint16Array(516); var expected = Array(516); var index, mod; for (index = 0; index < 516; index++) { mod = index % 4; array[index] = 515 - index; expected[index] = index - 2 * mod + 3; } nativeSort(array, function (a, b) { return (a / 4 | 0) - (b / 4 | 0); }); for (index = 0; index < 516; index++) { if (array[index] !== expected[index]) return true; } }); var getSortCompare = function (comparefn) { return function (x, y) { if (comparefn !== undefined) return +comparefn(x, y) || 0; // eslint-disable-next-line no-self-compare -- NaN check if (y !== y) return -1; // eslint-disable-next-line no-self-compare -- NaN check if (x !== x) return 1; if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1; return x > y; }; }; // `%TypedArray%.prototype.sort` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort exportTypedArrayMethod$b('sort', function sort(comparefn) { if (comparefn !== undefined) aCallable$u(comparefn); if (STABLE_SORT) return nativeSort(this, comparefn); return internalSort(aTypedArray$a(this), getSortCompare(comparefn)); }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS); var ArrayBufferViewCore$a = arrayBufferViewCore; var toLength = toLength$d; var toAbsoluteIndex$1 = toAbsoluteIndex$b; var typedArraySpeciesConstructor$1 = typedArraySpeciesConstructor$5; var aTypedArray$9 = ArrayBufferViewCore$a.aTypedArray; var exportTypedArrayMethod$a = ArrayBufferViewCore$a.exportTypedArrayMethod; // `%TypedArray%.prototype.subarray` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray exportTypedArrayMethod$a('subarray', function subarray(begin, end) { var O = aTypedArray$9(this); var length = O.length; var beginIndex = toAbsoluteIndex$1(begin, length); var C = typedArraySpeciesConstructor$1(O); return new C( O.buffer, O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex$1(end, length)) - beginIndex) ); }); var global$q = global$16; var apply$4 = functionApply$1; var ArrayBufferViewCore$9 = arrayBufferViewCore; var fails$e = fails$1u; var arraySlice$3 = arraySlice$b; var Int8Array$1 = global$q.Int8Array; var aTypedArray$8 = ArrayBufferViewCore$9.aTypedArray; var exportTypedArrayMethod$9 = ArrayBufferViewCore$9.exportTypedArrayMethod; var $toLocaleString = [].toLocaleString; // iOS Safari 6.x fails here var TO_LOCALE_STRING_BUG = !!Int8Array$1 && fails$e(function () { $toLocaleString.call(new Int8Array$1(1)); }); var FORCED$1 = fails$e(function () { return [1, 2].toLocaleString() !== new Int8Array$1([1, 2]).toLocaleString(); }) || !fails$e(function () { Int8Array$1.prototype.toLocaleString.call([1, 2]); }); // `%TypedArray%.prototype.toLocaleString` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring exportTypedArrayMethod$9('toLocaleString', function toLocaleString() { return apply$4( $toLocaleString, TO_LOCALE_STRING_BUG ? arraySlice$3(aTypedArray$8(this)) : aTypedArray$8(this), arraySlice$3(arguments) ); }, FORCED$1); var arrayToReversed = arrayToReversed$2; var ArrayBufferViewCore$8 = arrayBufferViewCore; var aTypedArray$7 = ArrayBufferViewCore$8.aTypedArray; var exportTypedArrayMethod$8 = ArrayBufferViewCore$8.exportTypedArrayMethod; var getTypedArrayConstructor$4 = ArrayBufferViewCore$8.getTypedArrayConstructor; // `%TypedArray%.prototype.toReversed` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.toreversed exportTypedArrayMethod$8('toReversed', function toReversed() { return arrayToReversed(aTypedArray$7(this), getTypedArrayConstructor$4(this)); }); var ArrayBufferViewCore$7 = arrayBufferViewCore; var uncurryThis$L = functionUncurryThis; var aCallable$t = aCallable$N; var arrayFromConstructorAndList$3 = arrayFromConstructorAndList$6; var aTypedArray$6 = ArrayBufferViewCore$7.aTypedArray; var getTypedArrayConstructor$3 = ArrayBufferViewCore$7.getTypedArrayConstructor; var exportTypedArrayMethod$7 = ArrayBufferViewCore$7.exportTypedArrayMethod; var sort = uncurryThis$L(ArrayBufferViewCore$7.TypedArrayPrototype.sort); // `%TypedArray%.prototype.toSorted` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tosorted exportTypedArrayMethod$7('toSorted', function toSorted(compareFn) { if (compareFn !== undefined) aCallable$t(compareFn); var O = aTypedArray$6(this); var A = arrayFromConstructorAndList$3(getTypedArrayConstructor$3(O), O); return sort(A, compareFn); }); var exportTypedArrayMethod$6 = arrayBufferViewCore.exportTypedArrayMethod; var fails$d = fails$1u; var global$p = global$16; var uncurryThis$K = functionUncurryThis; var Uint8Array = global$p.Uint8Array; var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {}; var arrayToString = [].toString; var join$4 = uncurryThis$K([].join); if (fails$d(function () { arrayToString.call({}); })) { arrayToString = function toString() { return join$4(this); }; } var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString !== arrayToString; // `%TypedArray%.prototype.toString` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring exportTypedArrayMethod$6('toString', arrayToString, IS_NOT_ARRAY_METHOD); var arrayWith = arrayWith$2; var ArrayBufferViewCore$6 = arrayBufferViewCore; var isBigIntArray$1 = isBigIntArray$3; var toIntegerOrInfinity$4 = toIntegerOrInfinity$p; var toBigInt$1 = toBigInt$4; var aTypedArray$5 = ArrayBufferViewCore$6.aTypedArray; var getTypedArrayConstructor$2 = ArrayBufferViewCore$6.getTypedArrayConstructor; var exportTypedArrayMethod$5 = ArrayBufferViewCore$6.exportTypedArrayMethod; var PROPER_ORDER$1 = !!function () { try { // eslint-disable-next-line no-throw-literal, es/no-typed-arrays, es/no-array-prototype-with -- required for testing new Int8Array(1)['with'](2, { valueOf: function () { throw 8; } }); } catch (error) { // some early implementations, like WebKit, does not follow the final semantic // https://github.com/tc39/proposal-change-array-by-copy/pull/86 return error === 8; } }(); // `%TypedArray%.prototype.with` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.with exportTypedArrayMethod$5('with', { 'with': function (index, value) { var O = aTypedArray$5(this); var relativeIndex = toIntegerOrInfinity$4(index); var actualValue = isBigIntArray$1(O) ? toBigInt$1(value) : +value; return arrayWith(O, getTypedArrayConstructor$2(O), relativeIndex, actualValue); } }['with'], !PROPER_ORDER$1); var $$2H = _export; var uncurryThis$J = functionUncurryThis; var toString$b = toString$I; var fromCharCode$4 = String.fromCharCode; var charAt$9 = uncurryThis$J(''.charAt); var exec$9 = uncurryThis$J(/./.exec); var stringSlice$5 = uncurryThis$J(''.slice); var hex2 = /^[\da-f]{2}$/i; var hex4 = /^[\da-f]{4}$/i; // `unescape` method // https://tc39.es/ecma262/#sec-unescape-string $$2H({ global: true }, { unescape: function unescape(string) { var str = toString$b(string); var result = ''; var length = str.length; var index = 0; var chr, part; while (index < length) { chr = charAt$9(str, index++); if (chr === '%') { if (charAt$9(str, index) === 'u') { part = stringSlice$5(str, index + 1, index + 5); if (exec$9(hex4, part)) { result += fromCharCode$4(parseInt(part, 16)); index += 5; continue; } } else { part = stringSlice$5(str, index, index + 2); if (exec$9(hex2, part)) { result += fromCharCode$4(parseInt(part, 16)); index += 2; continue; } } } result += chr; } return result; } }); var uncurryThis$I = functionUncurryThis; var defineBuiltIns$8 = defineBuiltIns$b; var getWeakData = internalMetadataExports.getWeakData; var anInstance$9 = anInstance$f; var anObject$H = anObject$1f; var isNullOrUndefined$7 = isNullOrUndefined$k; var isObject$e = isObject$K; var iterate$x = iterate$G; var ArrayIterationModule = arrayIteration; var hasOwn$f = hasOwnProperty_1; var InternalStateModule$d = internalState; var setInternalState$e = InternalStateModule$d.set; var internalStateGetterFor = InternalStateModule$d.getterFor; var find$1 = ArrayIterationModule.find; var findIndex = ArrayIterationModule.findIndex; var splice$1 = uncurryThis$I([].splice); var id = 0; // fallback for uncaught frozen keys var uncaughtFrozenStore = function (state) { return state.frozen || (state.frozen = new UncaughtFrozenStore()); }; var UncaughtFrozenStore = function () { this.entries = []; }; var findUncaughtFrozen = function (store, key) { return find$1(store.entries, function (it) { return it[0] === key; }); }; UncaughtFrozenStore.prototype = { get: function (key) { var entry = findUncaughtFrozen(this, key); if (entry) return entry[1]; }, has: function (key) { return !!findUncaughtFrozen(this, key); }, set: function (key, value) { var entry = findUncaughtFrozen(this, key); if (entry) entry[1] = value; else this.entries.push([key, value]); }, 'delete': function (key) { var index = findIndex(this.entries, function (it) { return it[0] === key; }); if (~index) splice$1(this.entries, index, 1); return !!~index; } }; var collectionWeak$2 = { getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { var Constructor = wrapper(function (that, iterable) { anInstance$9(that, Prototype); setInternalState$e(that, { type: CONSTRUCTOR_NAME, id: id++, frozen: undefined }); if (!isNullOrUndefined$7(iterable)) iterate$x(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); }); var Prototype = Constructor.prototype; var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); var define = function (that, key, value) { var state = getInternalState(that); var data = getWeakData(anObject$H(key), true); if (data === true) uncaughtFrozenStore(state).set(key, value); else data[state.id] = value; return that; }; defineBuiltIns$8(Prototype, { // `{ WeakMap, WeakSet }.prototype.delete(key)` methods // https://tc39.es/ecma262/#sec-weakmap.prototype.delete // https://tc39.es/ecma262/#sec-weakset.prototype.delete 'delete': function (key) { var state = getInternalState(this); if (!isObject$e(key)) return false; var data = getWeakData(key); if (data === true) return uncaughtFrozenStore(state)['delete'](key); return data && hasOwn$f(data, state.id) && delete data[state.id]; }, // `{ WeakMap, WeakSet }.prototype.has(key)` methods // https://tc39.es/ecma262/#sec-weakmap.prototype.has // https://tc39.es/ecma262/#sec-weakset.prototype.has has: function has(key) { var state = getInternalState(this); if (!isObject$e(key)) return false; var data = getWeakData(key); if (data === true) return uncaughtFrozenStore(state).has(key); return data && hasOwn$f(data, state.id); } }); defineBuiltIns$8(Prototype, IS_MAP ? { // `WeakMap.prototype.get(key)` method // https://tc39.es/ecma262/#sec-weakmap.prototype.get get: function get(key) { var state = getInternalState(this); if (isObject$e(key)) { var data = getWeakData(key); if (data === true) return uncaughtFrozenStore(state).get(key); return data ? data[state.id] : undefined; } }, // `WeakMap.prototype.set(key, value)` method // https://tc39.es/ecma262/#sec-weakmap.prototype.set set: function set(key, value) { return define(this, key, value); } } : { // `WeakSet.prototype.add(value)` method // https://tc39.es/ecma262/#sec-weakset.prototype.add add: function add(value) { return define(this, value, true); } }); return Constructor; } }; var FREEZING$2 = freezing; var global$o = global$16; var uncurryThis$H = functionUncurryThis; var defineBuiltIns$7 = defineBuiltIns$b; var InternalMetadataModule = internalMetadataExports; var collection$1 = collection$4; var collectionWeak$1 = collectionWeak$2; var isObject$d = isObject$K; var enforceInternalState = internalState.enforce; var fails$c = fails$1u; var NATIVE_WEAK_MAP = weakMapBasicDetection; var $Object$3 = Object; // eslint-disable-next-line es/no-array-isarray -- safe var isArray$2 = Array.isArray; // eslint-disable-next-line es/no-object-isextensible -- safe var isExtensible = $Object$3.isExtensible; // eslint-disable-next-line es/no-object-isfrozen -- safe var isFrozen$2 = $Object$3.isFrozen; // eslint-disable-next-line es/no-object-issealed -- safe var isSealed = $Object$3.isSealed; // eslint-disable-next-line es/no-object-freeze -- safe var freeze$2 = $Object$3.freeze; // eslint-disable-next-line es/no-object-seal -- safe var seal = $Object$3.seal; var FROZEN = {}; var SEALED = {}; var IS_IE11 = !global$o.ActiveXObject && 'ActiveXObject' in global$o; var InternalWeakMap; var wrapper = function (init) { return function WeakMap() { return init(this, arguments.length ? arguments[0] : undefined); }; }; // `WeakMap` constructor // https://tc39.es/ecma262/#sec-weakmap-constructor var $WeakMap = collection$1('WeakMap', wrapper, collectionWeak$1); var WeakMapPrototype$1 = $WeakMap.prototype; var nativeSet = uncurryThis$H(WeakMapPrototype$1.set); // Chakra Edge bug: adding frozen arrays to WeakMap unfreeze them var hasMSEdgeFreezingBug = function () { return FREEZING$2 && fails$c(function () { var frozenArray = freeze$2([]); nativeSet(new $WeakMap(), frozenArray, 1); return !isFrozen$2(frozenArray); }); }; // IE11 WeakMap frozen keys fix // We can't use feature detection because it crash some old IE builds // https://github.com/zloirock/core-js/issues/485 if (NATIVE_WEAK_MAP) if (IS_IE11) { InternalWeakMap = collectionWeak$1.getConstructor(wrapper, 'WeakMap', true); InternalMetadataModule.enable(); var nativeDelete = uncurryThis$H(WeakMapPrototype$1['delete']); var nativeHas = uncurryThis$H(WeakMapPrototype$1.has); var nativeGet = uncurryThis$H(WeakMapPrototype$1.get); defineBuiltIns$7(WeakMapPrototype$1, { 'delete': function (key) { if (isObject$d(key) && !isExtensible(key)) { var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeDelete(this, key) || state.frozen['delete'](key); } return nativeDelete(this, key); }, has: function has(key) { if (isObject$d(key) && !isExtensible(key)) { var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas(this, key) || state.frozen.has(key); } return nativeHas(this, key); }, get: function get(key) { if (isObject$d(key) && !isExtensible(key)) { var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key); } return nativeGet(this, key); }, set: function set(key, value) { if (isObject$d(key) && !isExtensible(key)) { var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value); } else nativeSet(this, key, value); return this; } }); // Chakra Edge frozen keys fix } else if (hasMSEdgeFreezingBug()) { defineBuiltIns$7(WeakMapPrototype$1, { set: function set(key, value) { var arrayIntegrityLevel; if (isArray$2(key)) { if (isFrozen$2(key)) arrayIntegrityLevel = FROZEN; else if (isSealed(key)) arrayIntegrityLevel = SEALED; } nativeSet(this, key, value); if (arrayIntegrityLevel === FROZEN) freeze$2(key); if (arrayIntegrityLevel === SEALED) seal(key); return this; } }); } var collection = collection$4; var collectionWeak = collectionWeak$2; // `WeakSet` constructor // https://tc39.es/ecma262/#sec-weakset-constructor collection('WeakSet', function (init) { return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionWeak); var $$2G = _export; var isPrototypeOf$2 = objectIsPrototypeOf; var getPrototypeOf$6 = objectGetPrototypeOf$2; var setPrototypeOf = objectSetPrototypeOf$1; var copyConstructorProperties = copyConstructorProperties$6; var create$9 = objectCreate$1; var createNonEnumerableProperty$7 = createNonEnumerableProperty$k; var createPropertyDescriptor$3 = createPropertyDescriptor$d; var installErrorStack = errorStackInstall; var normalizeStringArgument$2 = normalizeStringArgument$6; var wellKnownSymbol$m = wellKnownSymbol$T; var TO_STRING_TAG$7 = wellKnownSymbol$m('toStringTag'); var $Error = Error; var $SuppressedError = function SuppressedError(error, suppressed, message) { var isInstance = isPrototypeOf$2(SuppressedErrorPrototype, this); var that; if (setPrototypeOf) { that = setPrototypeOf($Error(), isInstance ? getPrototypeOf$6(this) : SuppressedErrorPrototype); } else { that = isInstance ? this : create$9(SuppressedErrorPrototype); createNonEnumerableProperty$7(that, TO_STRING_TAG$7, 'Error'); } if (message !== undefined) createNonEnumerableProperty$7(that, 'message', normalizeStringArgument$2(message)); installErrorStack(that, $SuppressedError, that.stack, 1); createNonEnumerableProperty$7(that, 'error', error); createNonEnumerableProperty$7(that, 'suppressed', suppressed); return that; }; if (setPrototypeOf) setPrototypeOf($SuppressedError, $Error); else copyConstructorProperties($SuppressedError, $Error, { name: true }); var SuppressedErrorPrototype = $SuppressedError.prototype = create$9($Error.prototype, { constructor: createPropertyDescriptor$3(1, $SuppressedError), message: createPropertyDescriptor$3(1, ''), name: createPropertyDescriptor$3(1, 'SuppressedError') }); // `SuppressedError` constructor // https://github.com/tc39/proposal-explicit-resource-management $$2G({ global: true, constructor: true, arity: 3 }, { SuppressedError: $SuppressedError }); var global$n = global$16; var shared$3 = sharedStore; var isCallable$d = isCallable$K; var getPrototypeOf$5 = objectGetPrototypeOf$2; var defineBuiltIn$a = defineBuiltIn$u; var wellKnownSymbol$l = wellKnownSymbol$T; var USE_FUNCTION_CONSTRUCTOR = 'USE_FUNCTION_CONSTRUCTOR'; var ASYNC_ITERATOR$3 = wellKnownSymbol$l('asyncIterator'); var AsyncIterator = global$n.AsyncIterator; var PassedAsyncIteratorPrototype = shared$3.AsyncIteratorPrototype; var AsyncIteratorPrototype$5, prototype; if (PassedAsyncIteratorPrototype) { AsyncIteratorPrototype$5 = PassedAsyncIteratorPrototype; } else if (isCallable$d(AsyncIterator)) { AsyncIteratorPrototype$5 = AsyncIterator.prototype; } else if (shared$3[USE_FUNCTION_CONSTRUCTOR] || global$n[USE_FUNCTION_CONSTRUCTOR]) { try { // eslint-disable-next-line no-new-func -- we have no alternatives without usage of modern syntax prototype = getPrototypeOf$5(getPrototypeOf$5(getPrototypeOf$5(Function('return async function*(){}()')()))); if (getPrototypeOf$5(prototype) === Object.prototype) AsyncIteratorPrototype$5 = prototype; } catch (error) { /* empty */ } } if (!AsyncIteratorPrototype$5) AsyncIteratorPrototype$5 = {}; if (!isCallable$d(AsyncIteratorPrototype$5[ASYNC_ITERATOR$3])) { defineBuiltIn$a(AsyncIteratorPrototype$5, ASYNC_ITERATOR$3, function () { return this; }); } var asyncIteratorPrototype = AsyncIteratorPrototype$5; var call$J = functionCall; var anObject$G = anObject$1f; var create$8 = objectCreate$1; var getMethod$b = getMethod$l; var defineBuiltIns$6 = defineBuiltIns$b; var InternalStateModule$c = internalState; var getBuiltIn$u = getBuiltIn$M; var AsyncIteratorPrototype$4 = asyncIteratorPrototype; var createIterResultObject$b = createIterResultObject$g; var Promise$5 = getBuiltIn$u('Promise'); var ASYNC_FROM_SYNC_ITERATOR = 'AsyncFromSyncIterator'; var setInternalState$d = InternalStateModule$c.set; var getInternalState$6 = InternalStateModule$c.getterFor(ASYNC_FROM_SYNC_ITERATOR); var asyncFromSyncIteratorContinuation = function (result, resolve, reject) { var done = result.done; Promise$5.resolve(result.value).then(function (value) { resolve(createIterResultObject$b(value, done)); }, reject); }; var AsyncFromSyncIterator$4 = function AsyncIterator(iteratorRecord) { iteratorRecord.type = ASYNC_FROM_SYNC_ITERATOR; setInternalState$d(this, iteratorRecord); }; AsyncFromSyncIterator$4.prototype = defineBuiltIns$6(create$8(AsyncIteratorPrototype$4), { next: function next() { var state = getInternalState$6(this); return new Promise$5(function (resolve, reject) { var result = anObject$G(call$J(state.next, state.iterator)); asyncFromSyncIteratorContinuation(result, resolve, reject); }); }, 'return': function () { var iterator = getInternalState$6(this).iterator; return new Promise$5(function (resolve, reject) { var $return = getMethod$b(iterator, 'return'); if ($return === undefined) return resolve(createIterResultObject$b(undefined, true)); var result = anObject$G(call$J($return, iterator)); asyncFromSyncIteratorContinuation(result, resolve, reject); }); } }); var asyncFromSyncIterator = AsyncFromSyncIterator$4; // `GetIteratorDirect(obj)` abstract operation // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect var getIteratorDirect$o = function (obj) { return { iterator: obj, next: obj.next, done: false }; }; var call$I = functionCall; var AsyncFromSyncIterator$3 = asyncFromSyncIterator; var anObject$F = anObject$1f; var getIterator$3 = getIterator$7; var getIteratorDirect$n = getIteratorDirect$o; var getMethod$a = getMethod$l; var wellKnownSymbol$k = wellKnownSymbol$T; var ASYNC_ITERATOR$2 = wellKnownSymbol$k('asyncIterator'); var getAsyncIterator$1 = function (it, usingIterator) { var method = arguments.length < 2 ? getMethod$a(it, ASYNC_ITERATOR$2) : usingIterator; return method ? anObject$F(call$I(method, it)) : new AsyncFromSyncIterator$3(getIteratorDirect$n(getIterator$3(it))); }; var call$H = functionCall; var getBuiltIn$t = getBuiltIn$M; var getMethod$9 = getMethod$l; var asyncIteratorClose = function (iterator, method, argument, reject) { try { var returnMethod = getMethod$9(iterator, 'return'); if (returnMethod) { return getBuiltIn$t('Promise').resolve(call$H(returnMethod, iterator)).then(function () { method(argument); }, function (error) { reject(error); }); } } catch (error2) { return reject(error2); } method(argument); }; // https://github.com/tc39/proposal-iterator-helpers // https://github.com/tc39/proposal-array-from-async var call$G = functionCall; var aCallable$s = aCallable$N; var anObject$E = anObject$1f; var isObject$c = isObject$K; var doesNotExceedSafeInteger = doesNotExceedSafeInteger$7; var getBuiltIn$s = getBuiltIn$M; var getIteratorDirect$m = getIteratorDirect$o; var closeAsyncIteration$4 = asyncIteratorClose; var createMethod = function (TYPE) { var IS_TO_ARRAY = TYPE === 0; var IS_FOR_EACH = TYPE === 1; var IS_EVERY = TYPE === 2; var IS_SOME = TYPE === 3; return function (object, fn, target) { anObject$E(object); var MAPPING = fn !== undefined; if (MAPPING || !IS_TO_ARRAY) aCallable$s(fn); var record = getIteratorDirect$m(object); var Promise = getBuiltIn$s('Promise'); var iterator = record.iterator; var next = record.next; var counter = 0; return new Promise(function (resolve, reject) { var ifAbruptCloseAsyncIterator = function (error) { closeAsyncIteration$4(iterator, reject, error, reject); }; var loop = function () { try { if (MAPPING) try { doesNotExceedSafeInteger(counter); } catch (error5) { ifAbruptCloseAsyncIterator(error5); } Promise.resolve(anObject$E(call$G(next, iterator))).then(function (step) { try { if (anObject$E(step).done) { if (IS_TO_ARRAY) { target.length = counter; resolve(target); } else resolve(IS_SOME ? false : IS_EVERY || undefined); } else { var value = step.value; try { if (MAPPING) { var result = fn(value, counter); var handler = function ($result) { if (IS_FOR_EACH) { loop(); } else if (IS_EVERY) { $result ? loop() : closeAsyncIteration$4(iterator, resolve, false, reject); } else if (IS_TO_ARRAY) { try { target[counter++] = $result; loop(); } catch (error4) { ifAbruptCloseAsyncIterator(error4); } } else { $result ? closeAsyncIteration$4(iterator, resolve, IS_SOME || value, reject) : loop(); } }; if (isObject$c(result)) Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator); else handler(result); } else { target[counter++] = value; loop(); } } catch (error3) { ifAbruptCloseAsyncIterator(error3); } } } catch (error2) { reject(error2); } }, reject); } catch (error) { reject(error); } }; loop(); }); }; }; var asyncIteratorIteration = { toArray: createMethod(0), forEach: createMethod(1), every: createMethod(2), some: createMethod(3), find: createMethod(4) }; var bind$i = functionBindContext; var uncurryThis$G = functionUncurryThis; var toObject$9 = toObject$D; var isConstructor$4 = isConstructor$a; var getAsyncIterator = getAsyncIterator$1; var getIterator$2 = getIterator$7; var getIteratorDirect$l = getIteratorDirect$o; var getIteratorMethod$3 = getIteratorMethod$8; var getMethod$8 = getMethod$l; var getVirtual = entryVirtual; var getBuiltIn$r = getBuiltIn$M; var wellKnownSymbol$j = wellKnownSymbol$T; var AsyncFromSyncIterator$2 = asyncFromSyncIterator; var toArray = asyncIteratorIteration.toArray; var ASYNC_ITERATOR$1 = wellKnownSymbol$j('asyncIterator'); var arrayIterator = uncurryThis$G(getVirtual('Array').values); var arrayIteratorNext = uncurryThis$G(arrayIterator([]).next); var safeArrayIterator = function () { return new SafeArrayIterator(this); }; var SafeArrayIterator = function (O) { this.iterator = arrayIterator(O); }; SafeArrayIterator.prototype.next = function () { return arrayIteratorNext(this.iterator); }; // `Array.fromAsync` method implementation // https://github.com/tc39/proposal-array-from-async var arrayFromAsync$1 = function fromAsync(asyncItems /* , mapfn = undefined, thisArg = undefined */) { var C = this; var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var thisArg = argumentsLength > 2 ? arguments[2] : undefined; return new (getBuiltIn$r('Promise'))(function (resolve) { var O = toObject$9(asyncItems); if (mapfn !== undefined) mapfn = bind$i(mapfn, thisArg); var usingAsyncIterator = getMethod$8(O, ASYNC_ITERATOR$1); var usingSyncIterator = usingAsyncIterator ? undefined : getIteratorMethod$3(O) || safeArrayIterator; var A = isConstructor$4(C) ? new C() : []; var iterator = usingAsyncIterator ? getAsyncIterator(O, usingAsyncIterator) : new AsyncFromSyncIterator$2(getIteratorDirect$l(getIterator$2(O, usingSyncIterator))); resolve(toArray(iterator, mapfn, A)); }); }; var $$2F = _export; var fromAsync = arrayFromAsync$1; // `Array.fromAsync` method // https://github.com/tc39/proposal-array-from-async $$2F({ target: 'Array', stat: true }, { fromAsync: fromAsync }); // TODO: remove from `core-js@4` var $$2E = _export; var $filterReject$3 = arrayIteration.filterReject; var addToUnscopables$8 = addToUnscopables$n; // `Array.prototype.filterOut` method // https://github.com/tc39/proposal-array-filtering $$2E({ target: 'Array', proto: true, forced: true }, { filterOut: function filterOut(callbackfn /* , thisArg */) { return $filterReject$3(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables$8('filterOut'); var $$2D = _export; var $filterReject$2 = arrayIteration.filterReject; var addToUnscopables$7 = addToUnscopables$n; // `Array.prototype.filterReject` method // https://github.com/tc39/proposal-array-filtering $$2D({ target: 'Array', proto: true, forced: true }, { filterReject: function filterReject(callbackfn /* , thisArg */) { return $filterReject$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables$7('filterReject'); var bind$h = functionBindContext; var uncurryThis$F = functionUncurryThis; var IndexedObject$1 = indexedObject; var toObject$8 = toObject$D; var toPropertyKey$1 = toPropertyKey$a; var lengthOfArrayLike$9 = lengthOfArrayLike$C; var objectCreate = objectCreate$1; var arrayFromConstructorAndList$2 = arrayFromConstructorAndList$6; var $Array$1 = Array; var push$h = uncurryThis$F([].push); var arrayGroup = function ($this, callbackfn, that, specificConstructor) { var O = toObject$8($this); var self = IndexedObject$1(O); var boundFunction = bind$h(callbackfn, that); var target = objectCreate(null); var length = lengthOfArrayLike$9(self); var index = 0; var Constructor, key, value; for (;length > index; index++) { value = self[index]; key = toPropertyKey$1(boundFunction(value, index, O)); // in some IE versions, `hasOwnProperty` returns incorrect result on integer keys // but since it's a `null` prototype object, we can safely use `in` if (key in target) push$h(target[key], value); else target[key] = [value]; } // TODO: Remove this block from `core-js@4` if (specificConstructor) { Constructor = specificConstructor(O); if (Constructor !== $Array$1) { for (key in target) target[key] = arrayFromConstructorAndList$2(Constructor, target[key]); } } return target; }; var $$2C = _export; var $group$2 = arrayGroup; var addToUnscopables$6 = addToUnscopables$n; // `Array.prototype.group` method // https://github.com/tc39/proposal-array-grouping $$2C({ target: 'Array', proto: true }, { group: function group(callbackfn /* , thisArg */) { var thisArg = arguments.length > 1 ? arguments[1] : undefined; return $group$2(this, callbackfn, thisArg); } }); addToUnscopables$6('group'); // TODO: Remove from `core-js@4` var $$2B = _export; var $group$1 = arrayGroup; var arrayMethodIsStrict$1 = arrayMethodIsStrict$b; var addToUnscopables$5 = addToUnscopables$n; // `Array.prototype.groupBy` method // https://github.com/tc39/proposal-array-grouping // https://bugs.webkit.org/show_bug.cgi?id=236541 $$2B({ target: 'Array', proto: true, forced: !arrayMethodIsStrict$1('groupBy') }, { groupBy: function groupBy(callbackfn /* , thisArg */) { var thisArg = arguments.length > 1 ? arguments[1] : undefined; return $group$1(this, callbackfn, thisArg); } }); addToUnscopables$5('groupBy'); var uncurryThis$E = functionUncurryThis; // eslint-disable-next-line es/no-map -- safe var MapPrototype$1 = Map.prototype; var mapHelpers = { // eslint-disable-next-line es/no-map -- safe Map: Map, set: uncurryThis$E(MapPrototype$1.set), get: uncurryThis$E(MapPrototype$1.get), has: uncurryThis$E(MapPrototype$1.has), remove: uncurryThis$E(MapPrototype$1['delete']), proto: MapPrototype$1 }; var bind$g = functionBindContext; var uncurryThis$D = functionUncurryThis; var IndexedObject = indexedObject; var toObject$7 = toObject$D; var lengthOfArrayLike$8 = lengthOfArrayLike$C; var MapHelpers$9 = mapHelpers; var Map$b = MapHelpers$9.Map; var mapGet$1 = MapHelpers$9.get; var mapHas$2 = MapHelpers$9.has; var mapSet$2 = MapHelpers$9.set; var push$g = uncurryThis$D([].push); // `Array.prototype.groupToMap` method // https://github.com/tc39/proposal-array-grouping var arrayGroupToMap = function groupToMap(callbackfn /* , thisArg */) { var O = toObject$7(this); var self = IndexedObject(O); var boundFunction = bind$g(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var map = new Map$b(); var length = lengthOfArrayLike$8(self); var index = 0; var key, value; for (;length > index; index++) { value = self[index]; key = boundFunction(value, index, O); if (mapHas$2(map, key)) push$g(mapGet$1(map, key), value); else mapSet$2(map, key, [value]); } return map; }; // TODO: Remove from `core-js@4` var $$2A = _export; var arrayMethodIsStrict = arrayMethodIsStrict$b; var addToUnscopables$4 = addToUnscopables$n; var $groupToMap$1 = arrayGroupToMap; // `Array.prototype.groupByToMap` method // https://github.com/tc39/proposal-array-grouping // https://bugs.webkit.org/show_bug.cgi?id=236541 $$2A({ target: 'Array', proto: true, name: 'groupToMap', forced: !arrayMethodIsStrict('groupByToMap') }, { groupByToMap: $groupToMap$1 }); addToUnscopables$4('groupByToMap'); var $$2z = _export; var addToUnscopables$3 = addToUnscopables$n; var $groupToMap = arrayGroupToMap; var IS_PURE$g = isPure; // `Array.prototype.groupToMap` method // https://github.com/tc39/proposal-array-grouping $$2z({ target: 'Array', proto: true, forced: IS_PURE$g }, { groupToMap: $groupToMap }); addToUnscopables$3('groupToMap'); var $$2y = _export; var isArray$1 = isArray$b; // eslint-disable-next-line es/no-object-isfrozen -- safe var isFrozen$1 = Object.isFrozen; var isFrozenStringArray = function (array, allowUndefined) { if (!isFrozen$1 || !isArray$1(array) || !isFrozen$1(array)) return false; var index = 0; var length = array.length; var element; while (index < length) { element = array[index++]; if (!(typeof element == 'string' || (allowUndefined && element === undefined))) { return false; } } return length !== 0; }; // `Array.isTemplateObject` method // https://github.com/tc39/proposal-array-is-template-object $$2y({ target: 'Array', stat: true, sham: true, forced: true }, { isTemplateObject: function isTemplateObject(value) { if (!isFrozenStringArray(value, true)) return false; var raw = value.raw; return raw.length === value.length && isFrozenStringArray(raw, false); } }); // TODO: Remove from `core-js@4` var DESCRIPTORS$f = descriptors; var addToUnscopables$2 = addToUnscopables$n; var toObject$6 = toObject$D; var lengthOfArrayLike$7 = lengthOfArrayLike$C; var defineBuiltInAccessor$b = defineBuiltInAccessor$o; // `Array.prototype.lastIndex` getter // https://github.com/keithamus/proposal-array-last if (DESCRIPTORS$f) { defineBuiltInAccessor$b(Array.prototype, 'lastIndex', { configurable: true, get: function lastIndex() { var O = toObject$6(this); var len = lengthOfArrayLike$7(O); return len === 0 ? 0 : len - 1; } }); addToUnscopables$2('lastIndex'); } // TODO: Remove from `core-js@4` var DESCRIPTORS$e = descriptors; var addToUnscopables$1 = addToUnscopables$n; var toObject$5 = toObject$D; var lengthOfArrayLike$6 = lengthOfArrayLike$C; var defineBuiltInAccessor$a = defineBuiltInAccessor$o; // `Array.prototype.lastIndex` accessor // https://github.com/keithamus/proposal-array-last if (DESCRIPTORS$e) { defineBuiltInAccessor$a(Array.prototype, 'lastItem', { configurable: true, get: function lastItem() { var O = toObject$5(this); var len = lengthOfArrayLike$6(O); return len === 0 ? undefined : O[len - 1]; }, set: function lastItem(value) { var O = toObject$5(this); var len = lengthOfArrayLike$6(O); return O[len === 0 ? 0 : len - 1] = value; } }); addToUnscopables$1('lastItem'); } var call$F = functionCall; var iterateSimple$8 = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) { var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator; var next = record.next; var step, result; while (!(step = call$F(next, iterator)).done) { result = fn(step.value); if (result !== undefined) return result; } }; var uncurryThis$C = functionUncurryThis; var iterateSimple$7 = iterateSimple$8; var MapHelpers$8 = mapHelpers; var Map$a = MapHelpers$8.Map; var MapPrototype = MapHelpers$8.proto; var forEach$4 = uncurryThis$C(MapPrototype.forEach); var entries = uncurryThis$C(MapPrototype.entries); var next$1 = entries(new Map$a()).next; var mapIterate = function (map, fn, interruptible) { return interruptible ? iterateSimple$7({ iterator: entries(map), next: next$1 }, function (entry) { return fn(entry[1], entry[0]); }) : forEach$4(map, fn); }; var uncurryThis$B = functionUncurryThis; var aCallable$r = aCallable$N; var isNullOrUndefined$6 = isNullOrUndefined$k; var lengthOfArrayLike$5 = lengthOfArrayLike$C; var toObject$4 = toObject$D; var MapHelpers$7 = mapHelpers; var iterate$w = mapIterate; var Map$9 = MapHelpers$7.Map; var mapHas$1 = MapHelpers$7.has; var mapSet$1 = MapHelpers$7.set; var push$f = uncurryThis$B([].push); // `Array.prototype.uniqueBy` method // https://github.com/tc39/proposal-array-unique var arrayUniqueBy$2 = function uniqueBy(resolver) { var that = toObject$4(this); var length = lengthOfArrayLike$5(that); var result = []; var map = new Map$9(); var resolverFunction = !isNullOrUndefined$6(resolver) ? aCallable$r(resolver) : function (value) { return value; }; var index, item, key; for (index = 0; index < length; index++) { item = that[index]; key = resolverFunction(item); if (!mapHas$1(map, key)) mapSet$1(map, key, item); } iterate$w(map, function (value) { push$f(result, value); }); return result; }; var $$2x = _export; var addToUnscopables = addToUnscopables$n; var uniqueBy = arrayUniqueBy$2; // `Array.prototype.uniqueBy` method // https://github.com/tc39/proposal-array-unique $$2x({ target: 'Array', proto: true, forced: true }, { uniqueBy: uniqueBy }); addToUnscopables('uniqueBy'); var uncurryThisAccessor$2 = functionUncurryThisAccessor; var classof$5 = classofRaw$2; var $TypeError$j = TypeError; // Includes // - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]). // - If IsSharedArrayBuffer(O) is true, throw a TypeError exception. var arrayBufferByteLength$2 = uncurryThisAccessor$2(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) { if (classof$5(O) !== 'ArrayBuffer') throw $TypeError$j('ArrayBuffer expected'); return O.byteLength; }; var uncurryThis$A = functionUncurryThis; var arrayBufferByteLength$1 = arrayBufferByteLength$2; var slice$4 = uncurryThis$A(ArrayBuffer.prototype.slice); var arrayBufferIsDetached = function (O) { if (arrayBufferByteLength$1(O) !== 0) return false; try { slice$4(O, 0, 0); return false; } catch (error) { return true; } }; var DESCRIPTORS$d = descriptors; var defineBuiltInAccessor$9 = defineBuiltInAccessor$o; var isDetached$1 = arrayBufferIsDetached; var ArrayBufferPrototype$1 = ArrayBuffer.prototype; if (DESCRIPTORS$d && !('detached' in ArrayBufferPrototype$1)) { defineBuiltInAccessor$9(ArrayBufferPrototype$1, 'detached', { configurable: true, get: function detached() { return isDetached$1(this); } }); } var global$m = global$16; var fails$b = fails$1u; var V8 = engineV8Version; var IS_BROWSER = engineIsBrowser; var IS_DENO = engineIsDeno; var IS_NODE$2 = engineIsNode; var structuredClone$1 = global$m.structuredClone; var structuredCloneProperTransfer = !!structuredClone$1 && !fails$b(function () { // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation // https://github.com/zloirock/core-js/issues/679 if ((IS_DENO && V8 > 92) || (IS_NODE$2 && V8 > 94) || (IS_BROWSER && V8 > 97)) return false; var buffer = new ArrayBuffer(8); var clone = structuredClone$1(buffer, { transfer: [buffer] }); return buffer.byteLength !== 0 || clone.byteLength !== 8; }); var global$l = global$16; var uncurryThis$z = functionUncurryThis; var uncurryThisAccessor$1 = functionUncurryThisAccessor; var toIndex$2 = toIndex$5; var isDetached = arrayBufferIsDetached; var arrayBufferByteLength = arrayBufferByteLength$2; var PROPER_TRANSFER$1 = structuredCloneProperTransfer; var TypeError$4 = global$l.TypeError; var structuredClone = global$l.structuredClone; var ArrayBuffer$1 = global$l.ArrayBuffer; var DataView$1 = global$l.DataView; var min$3 = Math.min; var ArrayBufferPrototype = ArrayBuffer$1.prototype; var DataViewPrototype = DataView$1.prototype; var slice$3 = uncurryThis$z(ArrayBufferPrototype.slice); var isResizable = uncurryThisAccessor$1(ArrayBufferPrototype, 'resizable', 'get'); var maxByteLength = uncurryThisAccessor$1(ArrayBufferPrototype, 'maxByteLength', 'get'); var getInt8 = uncurryThis$z(DataViewPrototype.getInt8); var setInt8 = uncurryThis$z(DataViewPrototype.setInt8); var arrayBufferTransfer = PROPER_TRANSFER$1 && function (arrayBuffer, newLength, preserveResizability) { var byteLength = arrayBufferByteLength(arrayBuffer); var newByteLength = newLength === undefined ? byteLength : toIndex$2(newLength); var fixedLength = !isResizable || !isResizable(arrayBuffer); if (isDetached(arrayBuffer)) throw TypeError$4('ArrayBuffer is detached'); var newBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] }); if (byteLength === newByteLength && (preserveResizability || fixedLength)) return newBuffer; if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) return slice$3(newBuffer, 0, newByteLength); var options = (preserveResizability && !fixedLength) && maxByteLength ? { maxByteLength: maxByteLength(newBuffer) } : undefined; var newNewBuffer = new ArrayBuffer$1(newByteLength, options); var a = new DataView$1(newBuffer); var b = new DataView$1(newNewBuffer); var copyLength = min$3(newByteLength, byteLength); for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i)); return newNewBuffer; }; var $$2w = _export; var $transfer$1 = arrayBufferTransfer; // `ArrayBuffer.prototype.transfer` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer if ($transfer$1) $$2w({ target: 'ArrayBuffer', proto: true }, { transfer: function transfer() { return $transfer$1(this, arguments.length ? arguments[0] : undefined, true); } }); var $$2v = _export; var $transfer = arrayBufferTransfer; // `ArrayBuffer.prototype.transferToFixedLength` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfertofixedlength if ($transfer) $$2v({ target: 'ArrayBuffer', proto: true }, { transferToFixedLength: function transferToFixedLength() { return $transfer(this, arguments.length ? arguments[0] : undefined, false); } }); var call$E = functionCall; var uncurryThis$y = functionUncurryThis; var bind$f = functionBindContext; var anObject$D = anObject$1f; var aCallable$q = aCallable$N; var isNullOrUndefined$5 = isNullOrUndefined$k; var getMethod$7 = getMethod$l; var wellKnownSymbol$i = wellKnownSymbol$T; var ASYNC_DISPOSE$2 = wellKnownSymbol$i('asyncDispose'); var DISPOSE$2 = wellKnownSymbol$i('dispose'); var push$e = uncurryThis$y([].push); // `GetDisposeMethod` abstract operation // https://tc39.es/proposal-explicit-resource-management/#sec-getdisposemethod var getDisposeMethod = function (V, hint) { if (hint === 'async-dispose') { var method = getMethod$7(V, ASYNC_DISPOSE$2); if (method !== undefined) return method; method = getMethod$7(V, DISPOSE$2); return function () { call$E(method, this); }; } return getMethod$7(V, DISPOSE$2); }; // `CreateDisposableResource` abstract operation // https://tc39.es/proposal-explicit-resource-management/#sec-createdisposableresource var createDisposableResource = function (V, hint, method) { if (arguments.length < 3 && !isNullOrUndefined$5(V)) { method = aCallable$q(getDisposeMethod(anObject$D(V), hint)); } return method === undefined ? function () { return undefined; } : bind$f(method, V); }; // `AddDisposableResource` abstract operation // https://tc39.es/proposal-explicit-resource-management/#sec-adddisposableresource var addDisposableResource$2 = function (disposable, V, hint, method) { var resource; if (arguments.length < 4) { // When `V`` is either `null` or `undefined` and hint is `async-dispose`, // we record that the resource was evaluated to ensure we will still perform an `Await` when resources are later disposed. if (isNullOrUndefined$5(V) && hint === 'sync-dispose') return; resource = createDisposableResource(V, hint); } else { resource = createDisposableResource(undefined, hint, method); } push$e(disposable.stack, resource); }; // https://github.com/tc39/proposal-async-explicit-resource-management var $$2u = _export; var DESCRIPTORS$c = descriptors; var getBuiltIn$q = getBuiltIn$M; var aCallable$p = aCallable$N; var anInstance$8 = anInstance$f; var defineBuiltIn$9 = defineBuiltIn$u; var defineBuiltIns$5 = defineBuiltIns$b; var defineBuiltInAccessor$8 = defineBuiltInAccessor$o; var wellKnownSymbol$h = wellKnownSymbol$T; var InternalStateModule$b = internalState; var addDisposableResource$1 = addDisposableResource$2; var Promise$4 = getBuiltIn$q('Promise'); var SuppressedError$1 = getBuiltIn$q('SuppressedError'); var $ReferenceError$1 = ReferenceError; var ASYNC_DISPOSE$1 = wellKnownSymbol$h('asyncDispose'); var TO_STRING_TAG$6 = wellKnownSymbol$h('toStringTag'); var ASYNC_DISPOSABLE_STACK = 'AsyncDisposableStack'; var setInternalState$c = InternalStateModule$b.set; var getAsyncDisposableStackInternalState = InternalStateModule$b.getterFor(ASYNC_DISPOSABLE_STACK); var HINT$1 = 'async-dispose'; var DISPOSED$1 = 'disposed'; var PENDING$1 = 'pending'; var getPendingAsyncDisposableStackInternalState = function (stack) { var internalState = getAsyncDisposableStackInternalState(stack); if (internalState.state === DISPOSED$1) throw $ReferenceError$1(ASYNC_DISPOSABLE_STACK + ' already disposed'); return internalState; }; var $AsyncDisposableStack = function AsyncDisposableStack() { setInternalState$c(anInstance$8(this, AsyncDisposableStackPrototype), { type: ASYNC_DISPOSABLE_STACK, state: PENDING$1, stack: [] }); if (!DESCRIPTORS$c) this.disposed = false; }; var AsyncDisposableStackPrototype = $AsyncDisposableStack.prototype; defineBuiltIns$5(AsyncDisposableStackPrototype, { disposeAsync: function disposeAsync() { var asyncDisposableStack = this; return new Promise$4(function (resolve, reject) { var internalState = getAsyncDisposableStackInternalState(asyncDisposableStack); if (internalState.state === DISPOSED$1) return resolve(undefined); internalState.state = DISPOSED$1; if (!DESCRIPTORS$c) asyncDisposableStack.disposed = true; var stack = internalState.stack; var i = stack.length; var thrown = false; var suppressed; var handleError = function (result) { if (thrown) { suppressed = new SuppressedError$1(result, suppressed); } else { thrown = true; suppressed = result; } loop(); }; var loop = function () { if (i) { var disposeMethod = stack[--i]; stack[i] = null; try { Promise$4.resolve(disposeMethod()).then(loop, handleError); } catch (error) { handleError(error); } } else { internalState.stack = null; thrown ? reject(suppressed) : resolve(undefined); } }; loop(); }); }, use: function use(value) { addDisposableResource$1(getPendingAsyncDisposableStackInternalState(this), value, HINT$1); return value; }, adopt: function adopt(value, onDispose) { var internalState = getPendingAsyncDisposableStackInternalState(this); aCallable$p(onDispose); addDisposableResource$1(internalState, undefined, HINT$1, function () { return onDispose(value); }); return value; }, defer: function defer(onDispose) { var internalState = getPendingAsyncDisposableStackInternalState(this); aCallable$p(onDispose); addDisposableResource$1(internalState, undefined, HINT$1, onDispose); }, move: function move() { var internalState = getPendingAsyncDisposableStackInternalState(this); var newAsyncDisposableStack = new $AsyncDisposableStack(); getAsyncDisposableStackInternalState(newAsyncDisposableStack).stack = internalState.stack; internalState.stack = []; internalState.state = DISPOSED$1; if (!DESCRIPTORS$c) this.disposed = true; return newAsyncDisposableStack; } }); if (DESCRIPTORS$c) defineBuiltInAccessor$8(AsyncDisposableStackPrototype, 'disposed', { configurable: true, get: function disposed() { return getAsyncDisposableStackInternalState(this).state === DISPOSED$1; } }); defineBuiltIn$9(AsyncDisposableStackPrototype, ASYNC_DISPOSE$1, AsyncDisposableStackPrototype.disposeAsync, { name: 'disposeAsync' }); defineBuiltIn$9(AsyncDisposableStackPrototype, TO_STRING_TAG$6, ASYNC_DISPOSABLE_STACK, { nonWritable: true }); $$2u({ global: true, constructor: true }, { AsyncDisposableStack: $AsyncDisposableStack }); var $$2t = _export; var anInstance$7 = anInstance$f; var getPrototypeOf$4 = objectGetPrototypeOf$2; var createNonEnumerableProperty$6 = createNonEnumerableProperty$k; var hasOwn$e = hasOwnProperty_1; var wellKnownSymbol$g = wellKnownSymbol$T; var AsyncIteratorPrototype$3 = asyncIteratorPrototype; var IS_PURE$f = isPure; var TO_STRING_TAG$5 = wellKnownSymbol$g('toStringTag'); var $TypeError$i = TypeError; var AsyncIteratorConstructor = function AsyncIterator() { anInstance$7(this, AsyncIteratorPrototype$3); if (getPrototypeOf$4(this) === AsyncIteratorPrototype$3) throw $TypeError$i('Abstract class AsyncIterator not directly constructable'); }; AsyncIteratorConstructor.prototype = AsyncIteratorPrototype$3; if (!hasOwn$e(AsyncIteratorPrototype$3, TO_STRING_TAG$5)) { createNonEnumerableProperty$6(AsyncIteratorPrototype$3, TO_STRING_TAG$5, 'AsyncIterator'); } if (!hasOwn$e(AsyncIteratorPrototype$3, 'constructor') || AsyncIteratorPrototype$3.constructor === Object) { createNonEnumerableProperty$6(AsyncIteratorPrototype$3, 'constructor', AsyncIteratorConstructor); } // `AsyncIterator` constructor // https://github.com/tc39/proposal-async-iterator-helpers $$2t({ global: true, constructor: true, forced: IS_PURE$f }, { AsyncIterator: AsyncIteratorConstructor }); var call$D = functionCall; var perform$1 = perform$7; var anObject$C = anObject$1f; var create$7 = objectCreate$1; var createNonEnumerableProperty$5 = createNonEnumerableProperty$k; var defineBuiltIns$4 = defineBuiltIns$b; var wellKnownSymbol$f = wellKnownSymbol$T; var InternalStateModule$a = internalState; var getBuiltIn$p = getBuiltIn$M; var getMethod$6 = getMethod$l; var AsyncIteratorPrototype$2 = asyncIteratorPrototype; var createIterResultObject$a = createIterResultObject$g; var iteratorClose$5 = iteratorClose$8; var Promise$3 = getBuiltIn$p('Promise'); var TO_STRING_TAG$4 = wellKnownSymbol$f('toStringTag'); var ASYNC_ITERATOR_HELPER = 'AsyncIteratorHelper'; var WRAP_FOR_VALID_ASYNC_ITERATOR = 'WrapForValidAsyncIterator'; var setInternalState$b = InternalStateModule$a.set; var createAsyncIteratorProxyPrototype = function (IS_ITERATOR) { var IS_GENERATOR = !IS_ITERATOR; var getInternalState = InternalStateModule$a.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ASYNC_ITERATOR : ASYNC_ITERATOR_HELPER); var getStateOrEarlyExit = function (that) { var stateCompletion = perform$1(function () { return getInternalState(that); }); var stateError = stateCompletion.error; var state = stateCompletion.value; if (stateError || (IS_GENERATOR && state.done)) { return { exit: true, value: stateError ? Promise$3.reject(state) : Promise$3.resolve(createIterResultObject$a(undefined, true)) }; } return { exit: false, value: state }; }; return defineBuiltIns$4(create$7(AsyncIteratorPrototype$2), { next: function next() { var stateCompletion = getStateOrEarlyExit(this); var state = stateCompletion.value; if (stateCompletion.exit) return state; var handlerCompletion = perform$1(function () { return anObject$C(state.nextHandler(Promise$3)); }); var handlerError = handlerCompletion.error; var value = handlerCompletion.value; if (handlerError) state.done = true; return handlerError ? Promise$3.reject(value) : Promise$3.resolve(value); }, 'return': function () { var stateCompletion = getStateOrEarlyExit(this); var state = stateCompletion.value; if (stateCompletion.exit) return state; state.done = true; var iterator = state.iterator; var returnMethod, result; var completion = perform$1(function () { if (state.inner) try { iteratorClose$5(state.inner.iterator, 'normal'); } catch (error) { return iteratorClose$5(iterator, 'throw', error); } return getMethod$6(iterator, 'return'); }); returnMethod = result = completion.value; if (completion.error) return Promise$3.reject(result); if (returnMethod === undefined) return Promise$3.resolve(createIterResultObject$a(undefined, true)); completion = perform$1(function () { return call$D(returnMethod, iterator); }); result = completion.value; if (completion.error) return Promise$3.reject(result); return IS_ITERATOR ? Promise$3.resolve(result) : Promise$3.resolve(result).then(function (resolved) { anObject$C(resolved); return createIterResultObject$a(undefined, true); }); } }); }; var WrapForValidAsyncIteratorPrototype = createAsyncIteratorProxyPrototype(true); var AsyncIteratorHelperPrototype = createAsyncIteratorProxyPrototype(false); createNonEnumerableProperty$5(AsyncIteratorHelperPrototype, TO_STRING_TAG$4, 'Async Iterator Helper'); var asyncIteratorCreateProxy = function (nextHandler, IS_ITERATOR) { var AsyncIteratorProxy = function AsyncIterator(record, state) { if (state) { state.iterator = record.iterator; state.next = record.next; } else state = record; state.type = IS_ITERATOR ? WRAP_FOR_VALID_ASYNC_ITERATOR : ASYNC_ITERATOR_HELPER; state.nextHandler = nextHandler; state.counter = 0; state.done = false; setInternalState$b(this, state); }; AsyncIteratorProxy.prototype = IS_ITERATOR ? WrapForValidAsyncIteratorPrototype : AsyncIteratorHelperPrototype; return AsyncIteratorProxy; }; var call$C = functionCall; var aCallable$o = aCallable$N; var anObject$B = anObject$1f; var isObject$b = isObject$K; var getIteratorDirect$k = getIteratorDirect$o; var createAsyncIteratorProxy$5 = asyncIteratorCreateProxy; var createIterResultObject$9 = createIterResultObject$g; var closeAsyncIteration$3 = asyncIteratorClose; var AsyncIteratorProxy$4 = createAsyncIteratorProxy$5(function (Promise) { var state = this; var iterator = state.iterator; var mapper = state.mapper; return new Promise(function (resolve, reject) { var doneAndReject = function (error) { state.done = true; reject(error); }; var ifAbruptCloseAsyncIterator = function (error) { closeAsyncIteration$3(iterator, doneAndReject, error, doneAndReject); }; Promise.resolve(anObject$B(call$C(state.next, iterator))).then(function (step) { try { if (anObject$B(step).done) { state.done = true; resolve(createIterResultObject$9(undefined, true)); } else { var value = step.value; try { var result = mapper(value, state.counter++); var handler = function (mapped) { resolve(createIterResultObject$9(mapped, false)); }; if (isObject$b(result)) Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator); else handler(result); } catch (error2) { ifAbruptCloseAsyncIterator(error2); } } } catch (error) { doneAndReject(error); } }, doneAndReject); }); }); // `AsyncIterator.prototype.map` method // https://github.com/tc39/proposal-iterator-helpers var asyncIteratorMap = function map(mapper) { anObject$B(this); aCallable$o(mapper); return new AsyncIteratorProxy$4(getIteratorDirect$k(this), { mapper: mapper }); }; var call$B = functionCall; var map$3 = asyncIteratorMap; var callback$1 = function (value, counter) { return [counter, value]; }; // `AsyncIterator.prototype.indexed` method // https://github.com/tc39/proposal-iterator-helpers var asyncIteratorIndexed = function indexed() { return call$B(map$3, this, callback$1); }; // TODO: Remove from `core-js@4` var $$2s = _export; var indexed$3 = asyncIteratorIndexed; // `AsyncIterator.prototype.asIndexedPairs` method // https://github.com/tc39/proposal-iterator-helpers $$2s({ target: 'AsyncIterator', name: 'indexed', proto: true, real: true, forced: true }, { asIndexedPairs: indexed$3 }); // https://github.com/tc39/proposal-async-explicit-resource-management var call$A = functionCall; var defineBuiltIn$8 = defineBuiltIn$u; var getBuiltIn$o = getBuiltIn$M; var getMethod$5 = getMethod$l; var hasOwn$d = hasOwnProperty_1; var wellKnownSymbol$e = wellKnownSymbol$T; var AsyncIteratorPrototype$1 = asyncIteratorPrototype; var ASYNC_DISPOSE = wellKnownSymbol$e('asyncDispose'); var Promise$2 = getBuiltIn$o('Promise'); if (!hasOwn$d(AsyncIteratorPrototype$1, ASYNC_DISPOSE)) { defineBuiltIn$8(AsyncIteratorPrototype$1, ASYNC_DISPOSE, function () { var O = this; return new Promise$2(function (resolve, reject) { var $return = getMethod$5(O, 'return'); if ($return) { Promise$2.resolve(call$A($return, O)).then(function () { resolve(undefined); }, reject); } else resolve(undefined); }); }); } var $RangeError$4 = RangeError; var notANan = function (it) { // eslint-disable-next-line no-self-compare -- NaN check if (it === it) return it; throw $RangeError$4('NaN is not allowed'); }; var $$2r = _export; var call$z = functionCall; var anObject$A = anObject$1f; var getIteratorDirect$j = getIteratorDirect$o; var notANaN$3 = notANan; var toPositiveInteger$3 = toPositiveInteger$5; var createAsyncIteratorProxy$4 = asyncIteratorCreateProxy; var createIterResultObject$8 = createIterResultObject$g; var IS_PURE$e = isPure; var AsyncIteratorProxy$3 = createAsyncIteratorProxy$4(function (Promise) { var state = this; return new Promise(function (resolve, reject) { var doneAndReject = function (error) { state.done = true; reject(error); }; var loop = function () { try { Promise.resolve(anObject$A(call$z(state.next, state.iterator))).then(function (step) { try { if (anObject$A(step).done) { state.done = true; resolve(createIterResultObject$8(undefined, true)); } else if (state.remaining) { state.remaining--; loop(); } else resolve(createIterResultObject$8(step.value, false)); } catch (err) { doneAndReject(err); } }, doneAndReject); } catch (error) { doneAndReject(error); } }; loop(); }); }); // `AsyncIterator.prototype.drop` method // https://github.com/tc39/proposal-async-iterator-helpers $$2r({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$e }, { drop: function drop(limit) { anObject$A(this); var remaining = toPositiveInteger$3(notANaN$3(+limit)); return new AsyncIteratorProxy$3(getIteratorDirect$j(this), { remaining: remaining }); } }); var $$2q = _export; var $every = asyncIteratorIteration.every; // `AsyncIterator.prototype.every` method // https://github.com/tc39/proposal-async-iterator-helpers $$2q({ target: 'AsyncIterator', proto: true, real: true }, { every: function every(predicate) { return $every(this, predicate); } }); var $$2p = _export; var call$y = functionCall; var aCallable$n = aCallable$N; var anObject$z = anObject$1f; var isObject$a = isObject$K; var getIteratorDirect$i = getIteratorDirect$o; var createAsyncIteratorProxy$3 = asyncIteratorCreateProxy; var createIterResultObject$7 = createIterResultObject$g; var closeAsyncIteration$2 = asyncIteratorClose; var IS_PURE$d = isPure; var AsyncIteratorProxy$2 = createAsyncIteratorProxy$3(function (Promise) { var state = this; var iterator = state.iterator; var predicate = state.predicate; return new Promise(function (resolve, reject) { var doneAndReject = function (error) { state.done = true; reject(error); }; var ifAbruptCloseAsyncIterator = function (error) { closeAsyncIteration$2(iterator, doneAndReject, error, doneAndReject); }; var loop = function () { try { Promise.resolve(anObject$z(call$y(state.next, iterator))).then(function (step) { try { if (anObject$z(step).done) { state.done = true; resolve(createIterResultObject$7(undefined, true)); } else { var value = step.value; try { var result = predicate(value, state.counter++); var handler = function (selected) { selected ? resolve(createIterResultObject$7(value, false)) : loop(); }; if (isObject$a(result)) Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator); else handler(result); } catch (error3) { ifAbruptCloseAsyncIterator(error3); } } } catch (error2) { doneAndReject(error2); } }, doneAndReject); } catch (error) { doneAndReject(error); } }; loop(); }); }); // `AsyncIterator.prototype.filter` method // https://github.com/tc39/proposal-async-iterator-helpers $$2p({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$d }, { filter: function filter(predicate) { anObject$z(this); aCallable$n(predicate); return new AsyncIteratorProxy$2(getIteratorDirect$i(this), { predicate: predicate }); } }); var $$2o = _export; var $find = asyncIteratorIteration.find; // `AsyncIterator.prototype.find` method // https://github.com/tc39/proposal-async-iterator-helpers $$2o({ target: 'AsyncIterator', proto: true, real: true }, { find: function find(predicate) { return $find(this, predicate); } }); var call$x = functionCall; var isCallable$c = isCallable$K; var anObject$y = anObject$1f; var getIteratorDirect$h = getIteratorDirect$o; var getIteratorMethod$2 = getIteratorMethod$8; var getMethod$4 = getMethod$l; var wellKnownSymbol$d = wellKnownSymbol$T; var AsyncFromSyncIterator$1 = asyncFromSyncIterator; var ASYNC_ITERATOR = wellKnownSymbol$d('asyncIterator'); var getAsyncIteratorFlattenable$2 = function from(obj) { var object = anObject$y(obj); var alreadyAsync = true; var method = getMethod$4(object, ASYNC_ITERATOR); var iterator; if (!isCallable$c(method)) { method = getIteratorMethod$2(object); alreadyAsync = false; } if (method !== undefined) { iterator = call$x(method, object); } else { iterator = object; alreadyAsync = true; } anObject$y(iterator); return getIteratorDirect$h(alreadyAsync ? iterator : new AsyncFromSyncIterator$1(getIteratorDirect$h(iterator))); }; var $$2n = _export; var call$w = functionCall; var aCallable$m = aCallable$N; var anObject$x = anObject$1f; var isObject$9 = isObject$K; var getIteratorDirect$g = getIteratorDirect$o; var createAsyncIteratorProxy$2 = asyncIteratorCreateProxy; var createIterResultObject$6 = createIterResultObject$g; var getAsyncIteratorFlattenable$1 = getAsyncIteratorFlattenable$2; var closeAsyncIteration$1 = asyncIteratorClose; var IS_PURE$c = isPure; var AsyncIteratorProxy$1 = createAsyncIteratorProxy$2(function (Promise) { var state = this; var iterator = state.iterator; var mapper = state.mapper; return new Promise(function (resolve, reject) { var doneAndReject = function (error) { state.done = true; reject(error); }; var ifAbruptCloseAsyncIterator = function (error) { closeAsyncIteration$1(iterator, doneAndReject, error, doneAndReject); }; var outerLoop = function () { try { Promise.resolve(anObject$x(call$w(state.next, iterator))).then(function (step) { try { if (anObject$x(step).done) { state.done = true; resolve(createIterResultObject$6(undefined, true)); } else { var value = step.value; try { var result = mapper(value, state.counter++); var handler = function (mapped) { try { state.inner = getAsyncIteratorFlattenable$1(mapped); innerLoop(); } catch (error4) { ifAbruptCloseAsyncIterator(error4); } }; if (isObject$9(result)) Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator); else handler(result); } catch (error3) { ifAbruptCloseAsyncIterator(error3); } } } catch (error2) { doneAndReject(error2); } }, doneAndReject); } catch (error) { doneAndReject(error); } }; var innerLoop = function () { var inner = state.inner; if (inner) { try { Promise.resolve(anObject$x(call$w(inner.next, inner.iterator))).then(function (result) { try { if (anObject$x(result).done) { state.inner = null; outerLoop(); } else resolve(createIterResultObject$6(result.value, false)); } catch (error1) { ifAbruptCloseAsyncIterator(error1); } }, ifAbruptCloseAsyncIterator); } catch (error) { ifAbruptCloseAsyncIterator(error); } } else outerLoop(); }; innerLoop(); }); }); // `AsyncIterator.prototype.flaMap` method // https://github.com/tc39/proposal-async-iterator-helpers $$2n({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$c }, { flatMap: function flatMap(mapper) { anObject$x(this); aCallable$m(mapper); return new AsyncIteratorProxy$1(getIteratorDirect$g(this), { mapper: mapper, inner: null }); } }); var $$2m = _export; var $forEach = asyncIteratorIteration.forEach; // `AsyncIterator.prototype.forEach` method // https://github.com/tc39/proposal-async-iterator-helpers $$2m({ target: 'AsyncIterator', proto: true, real: true }, { forEach: function forEach(fn) { return $forEach(this, fn); } }); var call$v = functionCall; var createAsyncIteratorProxy$1 = asyncIteratorCreateProxy; var asyncIteratorWrap = createAsyncIteratorProxy$1(function () { return call$v(this.next, this.iterator); }, true); var $$2l = _export; var toObject$3 = toObject$D; var isPrototypeOf$1 = objectIsPrototypeOf; var getAsyncIteratorFlattenable = getAsyncIteratorFlattenable$2; var AsyncIteratorPrototype = asyncIteratorPrototype; var WrapAsyncIterator$1 = asyncIteratorWrap; var IS_PURE$b = isPure; // `AsyncIterator.from` method // https://github.com/tc39/proposal-async-iterator-helpers $$2l({ target: 'AsyncIterator', stat: true, forced: IS_PURE$b }, { from: function from(O) { var iteratorRecord = getAsyncIteratorFlattenable(typeof O == 'string' ? toObject$3(O) : O); return isPrototypeOf$1(AsyncIteratorPrototype, iteratorRecord.iterator) ? iteratorRecord.iterator : new WrapAsyncIterator$1(iteratorRecord); } }); // TODO: Remove from `core-js@4` var $$2k = _export; var indexed$2 = asyncIteratorIndexed; // `AsyncIterator.prototype.indexed` method // https://github.com/tc39/proposal-iterator-helpers $$2k({ target: 'AsyncIterator', proto: true, real: true, forced: true }, { indexed: indexed$2 }); var $$2j = _export; var map$2 = asyncIteratorMap; var IS_PURE$a = isPure; // `AsyncIterator.prototype.map` method // https://github.com/tc39/proposal-async-iterator-helpers $$2j({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$a }, { map: map$2 }); var $$2i = _export; var call$u = functionCall; var aCallable$l = aCallable$N; var anObject$w = anObject$1f; var isObject$8 = isObject$K; var getBuiltIn$n = getBuiltIn$M; var getIteratorDirect$f = getIteratorDirect$o; var closeAsyncIteration = asyncIteratorClose; var Promise$1 = getBuiltIn$n('Promise'); var $TypeError$h = TypeError; // `AsyncIterator.prototype.reduce` method // https://github.com/tc39/proposal-async-iterator-helpers $$2i({ target: 'AsyncIterator', proto: true, real: true }, { reduce: function reduce(reducer /* , initialValue */) { anObject$w(this); aCallable$l(reducer); var record = getIteratorDirect$f(this); var iterator = record.iterator; var next = record.next; var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; var counter = 0; return new Promise$1(function (resolve, reject) { var ifAbruptCloseAsyncIterator = function (error) { closeAsyncIteration(iterator, reject, error, reject); }; var loop = function () { try { Promise$1.resolve(anObject$w(call$u(next, iterator))).then(function (step) { try { if (anObject$w(step).done) { noInitial ? reject($TypeError$h('Reduce of empty iterator with no initial value')) : resolve(accumulator); } else { var value = step.value; if (noInitial) { noInitial = false; accumulator = value; loop(); } else try { var result = reducer(accumulator, value, counter); var handler = function ($result) { accumulator = $result; loop(); }; if (isObject$8(result)) Promise$1.resolve(result).then(handler, ifAbruptCloseAsyncIterator); else handler(result); } catch (error3) { ifAbruptCloseAsyncIterator(error3); } } counter++; } catch (error2) { reject(error2); } }, reject); } catch (error) { reject(error); } }; loop(); }); } }); var $$2h = _export; var $some = asyncIteratorIteration.some; // `AsyncIterator.prototype.some` method // https://github.com/tc39/proposal-async-iterator-helpers $$2h({ target: 'AsyncIterator', proto: true, real: true }, { some: function some(predicate) { return $some(this, predicate); } }); var $$2g = _export; var call$t = functionCall; var anObject$v = anObject$1f; var getIteratorDirect$e = getIteratorDirect$o; var notANaN$2 = notANan; var toPositiveInteger$2 = toPositiveInteger$5; var createAsyncIteratorProxy = asyncIteratorCreateProxy; var createIterResultObject$5 = createIterResultObject$g; var IS_PURE$9 = isPure; var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise) { var state = this; var iterator = state.iterator; var returnMethod; if (!state.remaining--) { var resultDone = createIterResultObject$5(undefined, true); state.done = true; returnMethod = iterator['return']; if (returnMethod !== undefined) { return Promise.resolve(call$t(returnMethod, iterator, undefined)).then(function () { return resultDone; }); } return resultDone; } return Promise.resolve(call$t(state.next, iterator)).then(function (step) { if (anObject$v(step).done) { state.done = true; return createIterResultObject$5(undefined, true); } return createIterResultObject$5(step.value, false); }).then(null, function (error) { state.done = true; throw error; }); }); // `AsyncIterator.prototype.take` method // https://github.com/tc39/proposal-async-iterator-helpers $$2g({ target: 'AsyncIterator', proto: true, real: true, forced: IS_PURE$9 }, { take: function take(limit) { anObject$v(this); var remaining = toPositiveInteger$2(notANaN$2(+limit)); return new AsyncIteratorProxy(getIteratorDirect$e(this), { remaining: remaining }); } }); var $$2f = _export; var $toArray = asyncIteratorIteration.toArray; // `AsyncIterator.prototype.toArray` method // https://github.com/tc39/proposal-async-iterator-helpers $$2f({ target: 'AsyncIterator', proto: true, real: true }, { toArray: function toArray() { return $toArray(this, undefined, []); } }); var InternalStateModule$9 = internalState; var createIteratorConstructor$4 = iteratorCreateConstructor; var createIterResultObject$4 = createIterResultObject$g; var isNullOrUndefined$4 = isNullOrUndefined$k; var isObject$7 = isObject$K; var defineBuiltInAccessor$7 = defineBuiltInAccessor$o; var DESCRIPTORS$b = descriptors; var INCORRECT_RANGE = 'Incorrect Iterator.range arguments'; var NUMERIC_RANGE_ITERATOR = 'NumericRangeIterator'; var setInternalState$a = InternalStateModule$9.set; var getInternalState$5 = InternalStateModule$9.getterFor(NUMERIC_RANGE_ITERATOR); var $RangeError$3 = RangeError; var $TypeError$g = TypeError; var $RangeIterator = createIteratorConstructor$4(function NumericRangeIterator(start, end, option, type, zero, one) { // TODO: Drop the first `typeof` check after removing legacy methods in `core-js@4` if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) { throw $TypeError$g(INCORRECT_RANGE); } if (start === Infinity || start === -Infinity) { throw $RangeError$3(INCORRECT_RANGE); } var ifIncrease = end > start; var inclusiveEnd = false; var step; if (option === undefined) { step = undefined; } else if (isObject$7(option)) { step = option.step; inclusiveEnd = !!option.inclusive; } else if (typeof option == type) { step = option; } else { throw $TypeError$g(INCORRECT_RANGE); } if (isNullOrUndefined$4(step)) { step = ifIncrease ? one : -one; } if (typeof step != type) { throw $TypeError$g(INCORRECT_RANGE); } if (step === Infinity || step === -Infinity || (step === zero && start !== end)) { throw $RangeError$3(INCORRECT_RANGE); } // eslint-disable-next-line no-self-compare -- NaN check var hitsEnd = start !== start || end !== end || step !== step || (end > start) !== (step > zero); setInternalState$a(this, { type: NUMERIC_RANGE_ITERATOR, start: start, end: end, step: step, inclusive: inclusiveEnd, hitsEnd: hitsEnd, currentCount: zero, zero: zero }); if (!DESCRIPTORS$b) { this.start = start; this.end = end; this.step = step; this.inclusive = inclusiveEnd; } }, NUMERIC_RANGE_ITERATOR, function next() { var state = getInternalState$5(this); if (state.hitsEnd) return createIterResultObject$4(undefined, true); var start = state.start; var end = state.end; var step = state.step; var currentYieldingValue = start + (step * state.currentCount++); if (currentYieldingValue === end) state.hitsEnd = true; var inclusiveEnd = state.inclusive; var endCondition; if (end > start) { endCondition = inclusiveEnd ? currentYieldingValue > end : currentYieldingValue >= end; } else { endCondition = inclusiveEnd ? end > currentYieldingValue : end >= currentYieldingValue; } if (endCondition) { state.hitsEnd = true; return createIterResultObject$4(undefined, true); } return createIterResultObject$4(currentYieldingValue, false); }); var addGetter = function (key) { defineBuiltInAccessor$7($RangeIterator.prototype, key, { get: function () { return getInternalState$5(this)[key]; }, set: function () { /* empty */ }, configurable: true, enumerable: false }); }; if (DESCRIPTORS$b) { addGetter('start'); addGetter('end'); addGetter('inclusive'); addGetter('step'); } var numericRangeIterator = $RangeIterator; /* eslint-disable es/no-bigint -- safe */ var $$2e = _export; var NumericRangeIterator$2 = numericRangeIterator; // `BigInt.range` method // https://github.com/tc39/proposal-Number.range // TODO: Remove from `core-js@4` if (typeof BigInt == 'function') { $$2e({ target: 'BigInt', stat: true, forced: true }, { range: function range(start, end, option) { return new NumericRangeIterator$2(start, end, option, 'bigint', BigInt(0), BigInt(1)); } }); } // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` var getBuiltIn$m = getBuiltIn$M; var create$6 = objectCreate$1; var isObject$6 = isObject$K; var $Object$2 = Object; var $TypeError$f = TypeError; var Map$8 = getBuiltIn$m('Map'); var WeakMap$3 = getBuiltIn$m('WeakMap'); var Node$1 = function () { // keys this.object = null; this.symbol = null; // child nodes this.primitives = null; this.objectsByIndex = create$6(null); }; Node$1.prototype.get = function (key, initializer) { return this[key] || (this[key] = initializer()); }; Node$1.prototype.next = function (i, it, IS_OBJECT) { var store = IS_OBJECT ? this.objectsByIndex[i] || (this.objectsByIndex[i] = new WeakMap$3()) : this.primitives || (this.primitives = new Map$8()); var entry = store.get(it); if (!entry) store.set(it, entry = new Node$1()); return entry; }; var root = new Node$1(); var compositeKey = function () { var active = root; var length = arguments.length; var i, it; // for prevent leaking, start from objects for (i = 0; i < length; i++) { if (isObject$6(it = arguments[i])) active = active.next(i, it, true); } if (this === $Object$2 && active === root) throw $TypeError$f('Composite keys must contain a non-primitive component'); for (i = 0; i < length; i++) { if (!isObject$6(it = arguments[i])) active = active.next(i, it, false); } return active; }; var $$2d = _export; var apply$3 = functionApply$1; var getCompositeKeyNode$1 = compositeKey; var getBuiltIn$l = getBuiltIn$M; var create$5 = objectCreate$1; var $Object$1 = Object; var initializer = function () { var freeze = getBuiltIn$l('Object', 'freeze'); return freeze ? freeze(create$5(null)) : create$5(null); }; // https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey $$2d({ global: true, forced: true }, { compositeKey: function compositeKey() { return apply$3(getCompositeKeyNode$1, $Object$1, arguments).get('object', initializer); } }); var $$2c = _export; var getCompositeKeyNode = compositeKey; var getBuiltIn$k = getBuiltIn$M; var apply$2 = functionApply$1; // https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey $$2c({ global: true, forced: true }, { compositeSymbol: function compositeSymbol() { if (arguments.length === 1 && typeof arguments[0] == 'string') return getBuiltIn$k('Symbol')['for'](arguments[0]); return apply$2(getCompositeKeyNode, null, arguments).get('symbol', getBuiltIn$k('Symbol')); } }); var $$2b = _export; var uncurryThis$x = functionUncurryThis; var unpackIEEE754$1 = ieee754.unpack; // eslint-disable-next-line es/no-typed-arrays -- safe var getUint16 = uncurryThis$x(DataView.prototype.getUint16); // `DataView.prototype.getFloat16` method // https://github.com/tc39/proposal-float16array $$2b({ target: 'DataView', proto: true }, { getFloat16: function getFloat16(byteOffset /* , littleEndian */) { var uint16 = getUint16(this, byteOffset, arguments.length > 1 ? arguments[1] : false); return unpackIEEE754$1([uint16 & 0xFF, uint16 >> 8 & 0xFF], 10); } }); var $$2a = _export; var uncurryThis$w = functionUncurryThis; // eslint-disable-next-line es/no-typed-arrays -- safe var getUint8 = uncurryThis$w(DataView.prototype.getUint8); // `DataView.prototype.getUint8Clamped` method // https://github.com/tc39/proposal-dataview-get-set-uint8c $$2a({ target: 'DataView', proto: true, forced: true }, { getUint8Clamped: function getUint8Clamped(byteOffset) { return getUint8(this, byteOffset); } }); var $$29 = _export; var uncurryThis$v = functionUncurryThis; var classof$4 = classof$q; var toIndex$1 = toIndex$5; var packIEEE754$1 = ieee754.pack; var $TypeError$e = TypeError; // eslint-disable-next-line es/no-typed-arrays -- safe var setUint16 = uncurryThis$v(DataView.prototype.setUint16); // `DataView.prototype.setFloat16` method // https://github.com/tc39/proposal-float16array $$29({ target: 'DataView', proto: true }, { setFloat16: function setFloat16(byteOffset, value /* , littleEndian */) { if (classof$4(this) !== 'DataView') throw $TypeError$e('Incorrect receiver'); var offset = toIndex$1(byteOffset); var bytes = packIEEE754$1(+value, 10, 2); return setUint16(this, offset, bytes[1] << 8 | bytes[0], arguments.length > 2 ? arguments[2] : false); } }); var $$28 = _export; var uncurryThis$u = functionUncurryThis; var classof$3 = classof$q; var toIndex = toIndex$5; var toUint8Clamped = toUint8Clamped$2; var $TypeError$d = TypeError; // eslint-disable-next-line es/no-typed-arrays -- safe var setUint8 = uncurryThis$u(DataView.prototype.setUint8); // `DataView.prototype.setUint8Clamped` method // https://github.com/tc39/proposal-dataview-get-set-uint8c $$28({ target: 'DataView', proto: true, forced: true }, { setUint8Clamped: function setUint8Clamped(byteOffset, value) { if (classof$3(this) !== 'DataView') throw $TypeError$d('Incorrect receiver'); var offset = toIndex(byteOffset); return setUint8(this, offset, toUint8Clamped(value)); } }); // https://github.com/tc39/proposal-explicit-resource-management var $$27 = _export; var DESCRIPTORS$a = descriptors; var getBuiltIn$j = getBuiltIn$M; var aCallable$k = aCallable$N; var anInstance$6 = anInstance$f; var defineBuiltIn$7 = defineBuiltIn$u; var defineBuiltIns$3 = defineBuiltIns$b; var defineBuiltInAccessor$6 = defineBuiltInAccessor$o; var wellKnownSymbol$c = wellKnownSymbol$T; var InternalStateModule$8 = internalState; var addDisposableResource = addDisposableResource$2; var SuppressedError = getBuiltIn$j('SuppressedError'); var $ReferenceError = ReferenceError; var DISPOSE$1 = wellKnownSymbol$c('dispose'); var TO_STRING_TAG$3 = wellKnownSymbol$c('toStringTag'); var DISPOSABLE_STACK = 'DisposableStack'; var setInternalState$9 = InternalStateModule$8.set; var getDisposableStackInternalState = InternalStateModule$8.getterFor(DISPOSABLE_STACK); var HINT = 'sync-dispose'; var DISPOSED = 'disposed'; var PENDING = 'pending'; var getPendingDisposableStackInternalState = function (stack) { var internalState = getDisposableStackInternalState(stack); if (internalState.state === DISPOSED) throw $ReferenceError(DISPOSABLE_STACK + ' already disposed'); return internalState; }; var $DisposableStack = function DisposableStack() { setInternalState$9(anInstance$6(this, DisposableStackPrototype), { type: DISPOSABLE_STACK, state: PENDING, stack: [] }); if (!DESCRIPTORS$a) this.disposed = false; }; var DisposableStackPrototype = $DisposableStack.prototype; defineBuiltIns$3(DisposableStackPrototype, { dispose: function dispose() { var internalState = getDisposableStackInternalState(this); if (internalState.state === DISPOSED) return; internalState.state = DISPOSED; if (!DESCRIPTORS$a) this.disposed = true; var stack = internalState.stack; var i = stack.length; var thrown = false; var suppressed; while (i) { var disposeMethod = stack[--i]; stack[i] = null; try { disposeMethod(); } catch (errorResult) { if (thrown) { suppressed = new SuppressedError(errorResult, suppressed); } else { thrown = true; suppressed = errorResult; } } } internalState.stack = null; if (thrown) throw suppressed; }, use: function use(value) { addDisposableResource(getPendingDisposableStackInternalState(this), value, HINT); return value; }, adopt: function adopt(value, onDispose) { var internalState = getPendingDisposableStackInternalState(this); aCallable$k(onDispose); addDisposableResource(internalState, undefined, HINT, function () { onDispose(value); }); return value; }, defer: function defer(onDispose) { var internalState = getPendingDisposableStackInternalState(this); aCallable$k(onDispose); addDisposableResource(internalState, undefined, HINT, onDispose); }, move: function move() { var internalState = getPendingDisposableStackInternalState(this); var newDisposableStack = new $DisposableStack(); getDisposableStackInternalState(newDisposableStack).stack = internalState.stack; internalState.stack = []; internalState.state = DISPOSED; if (!DESCRIPTORS$a) this.disposed = true; return newDisposableStack; } }); if (DESCRIPTORS$a) defineBuiltInAccessor$6(DisposableStackPrototype, 'disposed', { configurable: true, get: function disposed() { return getDisposableStackInternalState(this).state === DISPOSED; } }); defineBuiltIn$7(DisposableStackPrototype, DISPOSE$1, DisposableStackPrototype.dispose, { name: 'dispose' }); defineBuiltIn$7(DisposableStackPrototype, TO_STRING_TAG$3, DISPOSABLE_STACK, { nonWritable: true }); $$27({ global: true, constructor: true }, { DisposableStack: $DisposableStack }); var uncurryThis$t = functionUncurryThis; var aCallable$j = aCallable$N; var functionDemethodize = function demethodize() { return uncurryThis$t(aCallable$j(this)); }; var $$26 = _export; var demethodize$1 = functionDemethodize; // `Function.prototype.demethodize` method // https://github.com/js-choi/proposal-function-demethodize $$26({ target: 'Function', proto: true, forced: true }, { demethodize: demethodize$1 }); var $$25 = _export; var uncurryThis$s = functionUncurryThis; var $isCallable = isCallable$K; var inspectSource = inspectSource$4; var hasOwn$c = hasOwnProperty_1; var DESCRIPTORS$9 = descriptors; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$4 = Object.getOwnPropertyDescriptor; var classRegExp = /^\s*class\b/; var exec$8 = uncurryThis$s(classRegExp.exec); var isClassConstructor = function (argument) { try { // `Function#toString` throws on some built-it function in some legacy engines // (for example, `DOMQuad` and similar in FF41-) if (!DESCRIPTORS$9 || !exec$8(classRegExp, inspectSource(argument))) return false; } catch (error) { /* empty */ } var prototype = getOwnPropertyDescriptor$4(argument, 'prototype'); return !!prototype && hasOwn$c(prototype, 'writable') && !prototype.writable; }; // `Function.isCallable` method // https://github.com/caitp/TC39-Proposals/blob/trunk/tc39-reflect-isconstructor-iscallable.md $$25({ target: 'Function', stat: true, sham: true, forced: true }, { isCallable: function isCallable(argument) { return $isCallable(argument) && !isClassConstructor(argument); } }); var $$24 = _export; var isConstructor$3 = isConstructor$a; // `Function.isConstructor` method // https://github.com/caitp/TC39-Proposals/blob/trunk/tc39-reflect-isconstructor-iscallable.md $$24({ target: 'Function', stat: true, forced: true }, { isConstructor: isConstructor$3 }); var wellKnownSymbol$b = wellKnownSymbol$T; var defineProperty$6 = objectDefineProperty.f; var METADATA = wellKnownSymbol$b('metadata'); var FunctionPrototype = Function.prototype; // Function.prototype[@@metadata] // https://github.com/tc39/proposal-decorator-metadata if (FunctionPrototype[METADATA] === undefined) { defineProperty$6(FunctionPrototype, METADATA, { value: null }); } var $$23 = _export; var demethodize = functionDemethodize; // `Function.prototype.unThis` method // https://github.com/js-choi/proposal-function-demethodize // TODO: Remove from `core-js@4` $$23({ target: 'Function', proto: true, forced: true, name: 'demethodize' }, { unThis: demethodize }); var $$22 = _export; var global$k = global$16; var anInstance$5 = anInstance$f; var isCallable$b = isCallable$K; var getPrototypeOf$3 = objectGetPrototypeOf$2; var createNonEnumerableProperty$4 = createNonEnumerableProperty$k; var fails$a = fails$1u; var hasOwn$b = hasOwnProperty_1; var wellKnownSymbol$a = wellKnownSymbol$T; var IteratorPrototype$3 = iteratorsCore.IteratorPrototype; var TO_STRING_TAG$2 = wellKnownSymbol$a('toStringTag'); var $TypeError$c = TypeError; var NativeIterator = global$k.Iterator; // FF56- have non-standard global helper `Iterator` var FORCED = !isCallable$b(NativeIterator) || NativeIterator.prototype !== IteratorPrototype$3 // FF44- non-standard `Iterator` passes previous tests || !fails$a(function () { NativeIterator({}); }); var IteratorConstructor = function Iterator() { anInstance$5(this, IteratorPrototype$3); if (getPrototypeOf$3(this) === IteratorPrototype$3) throw $TypeError$c('Abstract class Iterator not directly constructable'); }; if (!hasOwn$b(IteratorPrototype$3, TO_STRING_TAG$2)) { createNonEnumerableProperty$4(IteratorPrototype$3, TO_STRING_TAG$2, 'Iterator'); } if (FORCED || !hasOwn$b(IteratorPrototype$3, 'constructor') || IteratorPrototype$3.constructor === Object) { createNonEnumerableProperty$4(IteratorPrototype$3, 'constructor', IteratorConstructor); } IteratorConstructor.prototype = IteratorPrototype$3; // `Iterator` constructor // https://github.com/tc39/proposal-iterator-helpers $$22({ global: true, constructor: true, forced: FORCED }, { Iterator: IteratorConstructor }); var call$s = functionCall; var create$4 = objectCreate$1; var createNonEnumerableProperty$3 = createNonEnumerableProperty$k; var defineBuiltIns$2 = defineBuiltIns$b; var wellKnownSymbol$9 = wellKnownSymbol$T; var InternalStateModule$7 = internalState; var getMethod$3 = getMethod$l; var IteratorPrototype$2 = iteratorsCore.IteratorPrototype; var createIterResultObject$3 = createIterResultObject$g; var iteratorClose$4 = iteratorClose$8; var TO_STRING_TAG$1 = wellKnownSymbol$9('toStringTag'); var ITERATOR_HELPER = 'IteratorHelper'; var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator'; var setInternalState$8 = InternalStateModule$7.set; var createIteratorProxyPrototype = function (IS_ITERATOR) { var getInternalState = InternalStateModule$7.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER); return defineBuiltIns$2(create$4(IteratorPrototype$2), { next: function next() { var state = getInternalState(this); // for simplification: // for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject` // for `%IteratorHelperPrototype%.next` - just a value if (IS_ITERATOR) return state.nextHandler(); try { var result = state.done ? undefined : state.nextHandler(); return createIterResultObject$3(result, state.done); } catch (error) { state.done = true; throw error; } }, 'return': function () { var state = getInternalState(this); var iterator = state.iterator; state.done = true; if (IS_ITERATOR) { var returnMethod = getMethod$3(iterator, 'return'); return returnMethod ? call$s(returnMethod, iterator) : createIterResultObject$3(undefined, true); } if (state.inner) try { iteratorClose$4(state.inner.iterator, 'normal'); } catch (error) { return iteratorClose$4(iterator, 'throw', error); } iteratorClose$4(iterator, 'normal'); return createIterResultObject$3(undefined, true); } }); }; var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true); var IteratorHelperPrototype = createIteratorProxyPrototype(false); createNonEnumerableProperty$3(IteratorHelperPrototype, TO_STRING_TAG$1, 'Iterator Helper'); var iteratorCreateProxy = function (nextHandler, IS_ITERATOR) { var IteratorProxy = function Iterator(record, state) { if (state) { state.iterator = record.iterator; state.next = record.next; } else state = record; state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER; state.nextHandler = nextHandler; state.counter = 0; state.done = false; setInternalState$8(this, state); }; IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype; return IteratorProxy; }; var call$r = functionCall; var aCallable$i = aCallable$N; var anObject$u = anObject$1f; var getIteratorDirect$d = getIteratorDirect$o; var createIteratorProxy$5 = iteratorCreateProxy; var callWithSafeIterationClosing$1 = callWithSafeIterationClosing$3; var IteratorProxy$5 = createIteratorProxy$5(function () { var iterator = this.iterator; var result = anObject$u(call$r(this.next, iterator)); var done = this.done = !!result.done; if (!done) return callWithSafeIterationClosing$1(iterator, this.mapper, [result.value, this.counter++], true); }); // `Iterator.prototype.map` method // https://github.com/tc39/proposal-iterator-helpers var iteratorMap = function map(mapper) { anObject$u(this); aCallable$i(mapper); return new IteratorProxy$5(getIteratorDirect$d(this), { mapper: mapper }); }; var call$q = functionCall; var map$1 = iteratorMap; var callback = function (value, counter) { return [counter, value]; }; // `Iterator.prototype.indexed` method // https://github.com/tc39/proposal-iterator-helpers var iteratorIndexed = function indexed() { return call$q(map$1, this, callback); }; // TODO: Remove from `core-js@4` var $$21 = _export; var indexed$1 = iteratorIndexed; // `Iterator.prototype.asIndexedPairs` method // https://github.com/tc39/proposal-iterator-helpers $$21({ target: 'Iterator', name: 'indexed', proto: true, real: true, forced: true }, { asIndexedPairs: indexed$1 }); // https://github.com/tc39/proposal-explicit-resource-management var call$p = functionCall; var defineBuiltIn$6 = defineBuiltIn$u; var getMethod$2 = getMethod$l; var hasOwn$a = hasOwnProperty_1; var wellKnownSymbol$8 = wellKnownSymbol$T; var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; var DISPOSE = wellKnownSymbol$8('dispose'); if (!hasOwn$a(IteratorPrototype$1, DISPOSE)) { defineBuiltIn$6(IteratorPrototype$1, DISPOSE, function () { var $return = getMethod$2(this, 'return'); if ($return) call$p($return, this); }); } var $$20 = _export; var call$o = functionCall; var anObject$t = anObject$1f; var getIteratorDirect$c = getIteratorDirect$o; var notANaN$1 = notANan; var toPositiveInteger$1 = toPositiveInteger$5; var createIteratorProxy$4 = iteratorCreateProxy; var IS_PURE$8 = isPure; var IteratorProxy$4 = createIteratorProxy$4(function () { var iterator = this.iterator; var next = this.next; var result, done; while (this.remaining) { this.remaining--; result = anObject$t(call$o(next, iterator)); done = this.done = !!result.done; if (done) return; } result = anObject$t(call$o(next, iterator)); done = this.done = !!result.done; if (!done) return result.value; }); // `Iterator.prototype.drop` method // https://github.com/tc39/proposal-iterator-helpers $$20({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$8 }, { drop: function drop(limit) { anObject$t(this); var remaining = toPositiveInteger$1(notANaN$1(+limit)); return new IteratorProxy$4(getIteratorDirect$c(this), { remaining: remaining }); } }); var $$1$ = _export; var iterate$v = iterate$G; var aCallable$h = aCallable$N; var anObject$s = anObject$1f; var getIteratorDirect$b = getIteratorDirect$o; // `Iterator.prototype.every` method // https://github.com/tc39/proposal-iterator-helpers $$1$({ target: 'Iterator', proto: true, real: true }, { every: function every(predicate) { anObject$s(this); aCallable$h(predicate); var record = getIteratorDirect$b(this); var counter = 0; return !iterate$v(record, function (value, stop) { if (!predicate(value, counter++)) return stop(); }, { IS_RECORD: true, INTERRUPTED: true }).stopped; } }); var $$1_ = _export; var call$n = functionCall; var aCallable$g = aCallable$N; var anObject$r = anObject$1f; var getIteratorDirect$a = getIteratorDirect$o; var createIteratorProxy$3 = iteratorCreateProxy; var callWithSafeIterationClosing = callWithSafeIterationClosing$3; var IS_PURE$7 = isPure; var IteratorProxy$3 = createIteratorProxy$3(function () { var iterator = this.iterator; var predicate = this.predicate; var next = this.next; var result, done, value; while (true) { result = anObject$r(call$n(next, iterator)); done = this.done = !!result.done; if (done) return; value = result.value; if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value; } }); // `Iterator.prototype.filter` method // https://github.com/tc39/proposal-iterator-helpers $$1_({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$7 }, { filter: function filter(predicate) { anObject$r(this); aCallable$g(predicate); return new IteratorProxy$3(getIteratorDirect$a(this), { predicate: predicate }); } }); var $$1Z = _export; var iterate$u = iterate$G; var aCallable$f = aCallable$N; var anObject$q = anObject$1f; var getIteratorDirect$9 = getIteratorDirect$o; // `Iterator.prototype.find` method // https://github.com/tc39/proposal-iterator-helpers $$1Z({ target: 'Iterator', proto: true, real: true }, { find: function find(predicate) { anObject$q(this); aCallable$f(predicate); var record = getIteratorDirect$9(this); var counter = 0; return iterate$u(record, function (value, stop) { if (predicate(value, counter++)) return stop(value); }, { IS_RECORD: true, INTERRUPTED: true }).result; } }); var call$m = functionCall; var anObject$p = anObject$1f; var getIteratorDirect$8 = getIteratorDirect$o; var getIteratorMethod$1 = getIteratorMethod$8; var getIteratorFlattenable$2 = function (obj, stringHandling) { if (!stringHandling || typeof obj !== 'string') anObject$p(obj); var method = getIteratorMethod$1(obj); return getIteratorDirect$8(anObject$p(method !== undefined ? call$m(method, obj) : obj)); }; var $$1Y = _export; var call$l = functionCall; var aCallable$e = aCallable$N; var anObject$o = anObject$1f; var getIteratorDirect$7 = getIteratorDirect$o; var getIteratorFlattenable$1 = getIteratorFlattenable$2; var createIteratorProxy$2 = iteratorCreateProxy; var iteratorClose$3 = iteratorClose$8; var IS_PURE$6 = isPure; var IteratorProxy$2 = createIteratorProxy$2(function () { var iterator = this.iterator; var mapper = this.mapper; var result, inner; while (true) { if (inner = this.inner) try { result = anObject$o(call$l(inner.next, inner.iterator)); if (!result.done) return result.value; this.inner = null; } catch (error) { iteratorClose$3(iterator, 'throw', error); } result = anObject$o(call$l(this.next, iterator)); if (this.done = !!result.done) return; try { this.inner = getIteratorFlattenable$1(mapper(result.value, this.counter++), false); } catch (error) { iteratorClose$3(iterator, 'throw', error); } } }); // `Iterator.prototype.flatMap` method // https://github.com/tc39/proposal-iterator-helpers $$1Y({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$6 }, { flatMap: function flatMap(mapper) { anObject$o(this); aCallable$e(mapper); return new IteratorProxy$2(getIteratorDirect$7(this), { mapper: mapper, inner: null }); } }); var $$1X = _export; var iterate$t = iterate$G; var aCallable$d = aCallable$N; var anObject$n = anObject$1f; var getIteratorDirect$6 = getIteratorDirect$o; // `Iterator.prototype.forEach` method // https://github.com/tc39/proposal-iterator-helpers $$1X({ target: 'Iterator', proto: true, real: true }, { forEach: function forEach(fn) { anObject$n(this); aCallable$d(fn); var record = getIteratorDirect$6(this); var counter = 0; iterate$t(record, function (value) { fn(value, counter++); }, { IS_RECORD: true }); } }); var $$1W = _export; var call$k = functionCall; var toObject$2 = toObject$D; var isPrototypeOf = objectIsPrototypeOf; var IteratorPrototype = iteratorsCore.IteratorPrototype; var createIteratorProxy$1 = iteratorCreateProxy; var getIteratorFlattenable = getIteratorFlattenable$2; var IS_PURE$5 = isPure; var IteratorProxy$1 = createIteratorProxy$1(function () { return call$k(this.next, this.iterator); }, true); // `Iterator.from` method // https://github.com/tc39/proposal-iterator-helpers $$1W({ target: 'Iterator', stat: true, forced: IS_PURE$5 }, { from: function from(O) { var iteratorRecord = getIteratorFlattenable(typeof O == 'string' ? toObject$2(O) : O, true); return isPrototypeOf(IteratorPrototype, iteratorRecord.iterator) ? iteratorRecord.iterator : new IteratorProxy$1(iteratorRecord); } }); // TODO: Remove from `core-js@4` var $$1V = _export; var indexed = iteratorIndexed; // `Iterator.prototype.indexed` method // https://github.com/tc39/proposal-iterator-helpers $$1V({ target: 'Iterator', proto: true, real: true, forced: true }, { indexed: indexed }); var $$1U = _export; var map = iteratorMap; var IS_PURE$4 = isPure; // `Iterator.prototype.map` method // https://github.com/tc39/proposal-iterator-helpers $$1U({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$4 }, { map: map }); /* eslint-disable es/no-bigint -- safe */ var $$1T = _export; var NumericRangeIterator$1 = numericRangeIterator; var $TypeError$b = TypeError; // `Iterator.range` method // https://github.com/tc39/proposal-Number.range $$1T({ target: 'Iterator', stat: true, forced: true }, { range: function range(start, end, option) { if (typeof start == 'number') return new NumericRangeIterator$1(start, end, option, 'number', 0, 1); if (typeof start == 'bigint') return new NumericRangeIterator$1(start, end, option, 'bigint', BigInt(0), BigInt(1)); throw $TypeError$b('Incorrect Iterator.range arguments'); } }); var $$1S = _export; var iterate$s = iterate$G; var aCallable$c = aCallable$N; var anObject$m = anObject$1f; var getIteratorDirect$5 = getIteratorDirect$o; var $TypeError$a = TypeError; // `Iterator.prototype.reduce` method // https://github.com/tc39/proposal-iterator-helpers $$1S({ target: 'Iterator', proto: true, real: true }, { reduce: function reduce(reducer /* , initialValue */) { anObject$m(this); aCallable$c(reducer); var record = getIteratorDirect$5(this); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; var counter = 0; iterate$s(record, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = reducer(accumulator, value, counter); } counter++; }, { IS_RECORD: true }); if (noInitial) throw $TypeError$a('Reduce of empty iterator with no initial value'); return accumulator; } }); var $$1R = _export; var iterate$r = iterate$G; var aCallable$b = aCallable$N; var anObject$l = anObject$1f; var getIteratorDirect$4 = getIteratorDirect$o; // `Iterator.prototype.some` method // https://github.com/tc39/proposal-iterator-helpers $$1R({ target: 'Iterator', proto: true, real: true }, { some: function some(predicate) { anObject$l(this); aCallable$b(predicate); var record = getIteratorDirect$4(this); var counter = 0; return iterate$r(record, function (value, stop) { if (predicate(value, counter++)) return stop(); }, { IS_RECORD: true, INTERRUPTED: true }).stopped; } }); var $$1Q = _export; var call$j = functionCall; var anObject$k = anObject$1f; var getIteratorDirect$3 = getIteratorDirect$o; var notANaN = notANan; var toPositiveInteger = toPositiveInteger$5; var createIteratorProxy = iteratorCreateProxy; var iteratorClose$2 = iteratorClose$8; var IS_PURE$3 = isPure; var IteratorProxy = createIteratorProxy(function () { var iterator = this.iterator; if (!this.remaining--) { this.done = true; return iteratorClose$2(iterator, 'normal', undefined); } var result = anObject$k(call$j(this.next, iterator)); var done = this.done = !!result.done; if (!done) return result.value; }); // `Iterator.prototype.take` method // https://github.com/tc39/proposal-iterator-helpers $$1Q({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$3 }, { take: function take(limit) { anObject$k(this); var remaining = toPositiveInteger(notANaN(+limit)); return new IteratorProxy(getIteratorDirect$3(this), { remaining: remaining }); } }); var $$1P = _export; var anObject$j = anObject$1f; var iterate$q = iterate$G; var getIteratorDirect$2 = getIteratorDirect$o; var push$d = [].push; // `Iterator.prototype.toArray` method // https://github.com/tc39/proposal-iterator-helpers $$1P({ target: 'Iterator', proto: true, real: true }, { toArray: function toArray() { var result = []; iterate$q(getIteratorDirect$2(anObject$j(this)), push$d, { that: result, IS_RECORD: true }); return result; } }); var $$1O = _export; var anObject$i = anObject$1f; var AsyncFromSyncIterator = asyncFromSyncIterator; var WrapAsyncIterator = asyncIteratorWrap; var getIteratorDirect$1 = getIteratorDirect$o; var IS_PURE$2 = isPure; // `Iterator.prototype.toAsync` method // https://github.com/tc39/proposal-async-iterator-helpers $$1O({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$2 }, { toAsync: function toAsync() { return new WrapAsyncIterator(getIteratorDirect$1(new AsyncFromSyncIterator(getIteratorDirect$1(anObject$i(this))))); } }); /* eslint-disable es/no-json -- safe */ var fails$9 = fails$1u; var nativeRawJson = !fails$9(function () { var unsafeInt = '9007199254740993'; var raw = JSON.rawJSON(unsafeInt); return !JSON.isRawJSON(raw) || JSON.stringify(raw) !== unsafeInt; }); var isObject$5 = isObject$K; var getInternalState$4 = internalState.get; var isRawJson = function isRawJSON(O) { if (!isObject$5(O)) return false; var state = getInternalState$4(O); return !!state && state.type === 'RawJSON'; }; var $$1N = _export; var NATIVE_RAW_JSON$1 = nativeRawJson; var isRawJSON$1 = isRawJson; // `JSON.parse` method // https://tc39.es/proposal-json-parse-with-source/#sec-json.israwjson // https://github.com/tc39/proposal-json-parse-with-source $$1N({ target: 'JSON', stat: true, forced: !NATIVE_RAW_JSON$1 }, { isRawJSON: isRawJSON$1 }); var uncurryThis$r = functionUncurryThis; var hasOwn$9 = hasOwnProperty_1; var $SyntaxError$2 = SyntaxError; var $parseInt = parseInt; var fromCharCode$3 = String.fromCharCode; var at$2 = uncurryThis$r(''.charAt); var slice$2 = uncurryThis$r(''.slice); var exec$7 = uncurryThis$r(/./.exec); var codePoints = { '\\"': '"', '\\\\': '\\', '\\/': '/', '\\b': '\b', '\\f': '\f', '\\n': '\n', '\\r': '\r', '\\t': '\t' }; var IS_4_HEX_DIGITS = /^[\da-f]{4}$/i; // eslint-disable-next-line regexp/no-control-character -- safe var IS_C0_CONTROL_CODE = /^[\u0000-\u001F]$/; var parseJsonString = function (source, i) { var unterminated = true; var value = ''; while (i < source.length) { var chr = at$2(source, i); if (chr === '\\') { var twoChars = slice$2(source, i, i + 2); if (hasOwn$9(codePoints, twoChars)) { value += codePoints[twoChars]; i += 2; } else if (twoChars === '\\u') { i += 2; var fourHexDigits = slice$2(source, i, i + 4); if (!exec$7(IS_4_HEX_DIGITS, fourHexDigits)) throw $SyntaxError$2('Bad Unicode escape at: ' + i); value += fromCharCode$3($parseInt(fourHexDigits, 16)); i += 4; } else throw $SyntaxError$2('Unknown escape sequence: "' + twoChars + '"'); } else if (chr === '"') { unterminated = false; i++; break; } else { if (exec$7(IS_C0_CONTROL_CODE, chr)) throw $SyntaxError$2('Bad control character in string literal at: ' + i); value += chr; i++; } } if (unterminated) throw $SyntaxError$2('Unterminated string at: ' + i); return { value: value, end: i }; }; var $$1M = _export; var DESCRIPTORS$8 = descriptors; var global$j = global$16; var getBuiltIn$i = getBuiltIn$M; var uncurryThis$q = functionUncurryThis; var call$i = functionCall; var isCallable$a = isCallable$K; var isObject$4 = isObject$K; var isArray = isArray$b; var hasOwn$8 = hasOwnProperty_1; var toString$a = toString$I; var lengthOfArrayLike$4 = lengthOfArrayLike$C; var createProperty$2 = createProperty$b; var fails$8 = fails$1u; var parseJSONString$1 = parseJsonString; var NATIVE_SYMBOL = symbolConstructorDetection; var JSON$1 = global$j.JSON; var Number$1 = global$j.Number; var SyntaxError$2 = global$j.SyntaxError; var nativeParse = JSON$1 && JSON$1.parse; var enumerableOwnProperties = getBuiltIn$i('Object', 'keys'); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor; var at$1 = uncurryThis$q(''.charAt); var slice$1 = uncurryThis$q(''.slice); var exec$6 = uncurryThis$q(/./.exec); var push$c = uncurryThis$q([].push); var IS_DIGIT = /^\d$/; var IS_NON_ZERO_DIGIT = /^[1-9]$/; var IS_NUMBER_START = /^(?:-|\d)$/; var IS_WHITESPACE$1 = /^[\t\n\r ]$/; var PRIMITIVE = 0; var OBJECT = 1; var $parse = function (source, reviver) { source = toString$a(source); var context = new Context(source, 0); var root = context.parse(); var value = root.value; var endIndex = context.skip(IS_WHITESPACE$1, root.end); if (endIndex < source.length) { throw SyntaxError$2('Unexpected extra character: "' + at$1(source, endIndex) + '" after the parsed data at: ' + endIndex); } return isCallable$a(reviver) ? internalize({ '': value }, '', reviver, root) : value; }; var internalize = function (holder, name, reviver, node) { var val = holder[name]; var unmodified = node && val === node.value; var context = unmodified && typeof node.source == 'string' ? { source: node.source } : {}; var elementRecordsLen, keys, len, i, P; if (isObject$4(val)) { var nodeIsArray = isArray(val); var nodes = unmodified ? node.nodes : nodeIsArray ? [] : {}; if (nodeIsArray) { elementRecordsLen = nodes.length; len = lengthOfArrayLike$4(val); for (i = 0; i < len; i++) { internalizeProperty(val, i, internalize(val, '' + i, reviver, i < elementRecordsLen ? nodes[i] : undefined)); } } else { keys = enumerableOwnProperties(val); len = lengthOfArrayLike$4(keys); for (i = 0; i < len; i++) { P = keys[i]; internalizeProperty(val, P, internalize(val, P, reviver, hasOwn$8(nodes, P) ? nodes[P] : undefined)); } } } return call$i(reviver, holder, name, val, context); }; var internalizeProperty = function (object, key, value) { if (DESCRIPTORS$8) { var descriptor = getOwnPropertyDescriptor$3(object, key); if (descriptor && !descriptor.configurable) return; } if (value === undefined) delete object[key]; else createProperty$2(object, key, value); }; var Node = function (value, end, source, nodes) { this.value = value; this.end = end; this.source = source; this.nodes = nodes; }; var Context = function (source, index) { this.source = source; this.index = index; }; // https://www.json.org/json-en.html Context.prototype = { fork: function (nextIndex) { return new Context(this.source, nextIndex); }, parse: function () { var source = this.source; var i = this.skip(IS_WHITESPACE$1, this.index); var fork = this.fork(i); var chr = at$1(source, i); if (exec$6(IS_NUMBER_START, chr)) return fork.number(); switch (chr) { case '{': return fork.object(); case '[': return fork.array(); case '"': return fork.string(); case 't': return fork.keyword(true); case 'f': return fork.keyword(false); case 'n': return fork.keyword(null); } throw SyntaxError$2('Unexpected character: "' + chr + '" at: ' + i); }, node: function (type, value, start, end, nodes) { return new Node(value, end, type ? null : slice$1(this.source, start, end), nodes); }, object: function () { var source = this.source; var i = this.index + 1; var expectKeypair = false; var object = {}; var nodes = {}; while (i < source.length) { i = this.until(['"', '}'], i); if (at$1(source, i) === '}' && !expectKeypair) { i++; break; } // Parsing the key var result = this.fork(i).string(); var key = result.value; i = result.end; i = this.until([':'], i) + 1; // Parsing value i = this.skip(IS_WHITESPACE$1, i); result = this.fork(i).parse(); createProperty$2(nodes, key, result); createProperty$2(object, key, result.value); i = this.until([',', '}'], result.end); var chr = at$1(source, i); if (chr === ',') { expectKeypair = true; i++; } else if (chr === '}') { i++; break; } } return this.node(OBJECT, object, this.index, i, nodes); }, array: function () { var source = this.source; var i = this.index + 1; var expectElement = false; var array = []; var nodes = []; while (i < source.length) { i = this.skip(IS_WHITESPACE$1, i); if (at$1(source, i) === ']' && !expectElement) { i++; break; } var result = this.fork(i).parse(); push$c(nodes, result); push$c(array, result.value); i = this.until([',', ']'], result.end); if (at$1(source, i) === ',') { expectElement = true; i++; } else if (at$1(source, i) === ']') { i++; break; } } return this.node(OBJECT, array, this.index, i, nodes); }, string: function () { var index = this.index; var parsed = parseJSONString$1(this.source, this.index + 1); return this.node(PRIMITIVE, parsed.value, index, parsed.end); }, number: function () { var source = this.source; var startIndex = this.index; var i = startIndex; if (at$1(source, i) === '-') i++; if (at$1(source, i) === '0') i++; else if (exec$6(IS_NON_ZERO_DIGIT, at$1(source, i))) i = this.skip(IS_DIGIT, ++i); else throw SyntaxError$2('Failed to parse number at: ' + i); if (at$1(source, i) === '.') i = this.skip(IS_DIGIT, ++i); if (at$1(source, i) === 'e' || at$1(source, i) === 'E') { i++; if (at$1(source, i) === '+' || at$1(source, i) === '-') i++; var exponentStartIndex = i; i = this.skip(IS_DIGIT, i); if (exponentStartIndex === i) throw SyntaxError$2("Failed to parse number's exponent value at: " + i); } return this.node(PRIMITIVE, Number$1(slice$1(source, startIndex, i)), startIndex, i); }, keyword: function (value) { var keyword = '' + value; var index = this.index; var endIndex = index + keyword.length; if (slice$1(this.source, index, endIndex) !== keyword) throw SyntaxError$2('Failed to parse value at: ' + index); return this.node(PRIMITIVE, value, index, endIndex); }, skip: function (regex, i) { var source = this.source; for (; i < source.length; i++) if (!exec$6(regex, at$1(source, i))) break; return i; }, until: function (array, i) { i = this.skip(IS_WHITESPACE$1, i); var chr = at$1(this.source, i); for (var j = 0; j < array.length; j++) if (array[j] === chr) return i; throw SyntaxError$2('Unexpected character: "' + chr + '" at: ' + i); } }; var NO_SOURCE_SUPPORT = fails$8(function () { var unsafeInt = '9007199254740993'; var source; nativeParse(unsafeInt, function (key, value, context) { source = context.source; }); return source !== unsafeInt; }); var PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails$8(function () { // Safari 9 bug return 1 / nativeParse('-0 \t') !== -Infinity; }); // `JSON.parse` method // https://tc39.es/ecma262/#sec-json.parse // https://github.com/tc39/proposal-json-parse-with-source $$1M({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, { parse: function parse(text, reviver) { return PROPER_BASE_PARSE && !isCallable$a(reviver) ? nativeParse(text) : $parse(text, reviver); } }); var $$1L = _export; var FREEZING$1 = freezing; var NATIVE_RAW_JSON = nativeRawJson; var getBuiltIn$h = getBuiltIn$M; var call$h = functionCall; var uncurryThis$p = functionUncurryThis; var isCallable$9 = isCallable$K; var isRawJSON = isRawJson; var toString$9 = toString$I; var createProperty$1 = createProperty$b; var parseJSONString = parseJsonString; var getReplacerFunction = getJsonReplacerFunction; var uid$1 = uid$7; var setInternalState$7 = internalState.set; var $String = String; var $SyntaxError$1 = SyntaxError; var parse$1 = getBuiltIn$h('JSON', 'parse'); var $stringify = getBuiltIn$h('JSON', 'stringify'); var create$3 = getBuiltIn$h('Object', 'create'); var freeze$1 = getBuiltIn$h('Object', 'freeze'); var at = uncurryThis$p(''.charAt); var slice = uncurryThis$p(''.slice); var exec$5 = uncurryThis$p(/./.exec); var push$b = uncurryThis$p([].push); var MARK = uid$1(); var MARK_LENGTH = MARK.length; var ERROR_MESSAGE = 'Unacceptable as raw JSON'; var IS_WHITESPACE = /^[\t\n\r ]$/; // `JSON.parse` method // https://tc39.es/proposal-json-parse-with-source/#sec-json.israwjson // https://github.com/tc39/proposal-json-parse-with-source $$1L({ target: 'JSON', stat: true, forced: !NATIVE_RAW_JSON }, { rawJSON: function rawJSON(text) { var jsonString = toString$9(text); if (jsonString === '' || exec$5(IS_WHITESPACE, at(jsonString, 0)) || exec$5(IS_WHITESPACE, at(jsonString, jsonString.length - 1))) { throw $SyntaxError$1(ERROR_MESSAGE); } var parsed = parse$1(jsonString); if (typeof parsed == 'object' && parsed !== null) throw $SyntaxError$1(ERROR_MESSAGE); var obj = create$3(null); setInternalState$7(obj, { type: 'RawJSON' }); createProperty$1(obj, 'rawJSON', jsonString); return FREEZING$1 ? freeze$1(obj) : obj; } }); // `JSON.stringify` method // https://tc39.es/ecma262/#sec-json.stringify // https://github.com/tc39/proposal-json-parse-with-source if ($stringify) $$1L({ target: 'JSON', stat: true, arity: 3, forced: !NATIVE_RAW_JSON }, { stringify: function stringify(text, replacer, space) { var replacerFunction = getReplacerFunction(replacer); var rawStrings = []; var json = $stringify(text, function (key, value) { // some old implementations (like WebKit) could pass numbers as keys var v = isCallable$9(replacerFunction) ? call$h(replacerFunction, this, $String(key), value) : value; return isRawJSON(v) ? MARK + (push$b(rawStrings, v.rawJSON) - 1) : v; }, space); if (typeof json != 'string') return json; var result = ''; var length = json.length; for (var i = 0; i < length; i++) { var chr = at(json, i); if (chr === '"') { var end = parseJSONString(json, ++i).end - 1; var string = slice(json, i, end); result += slice(string, 0, MARK_LENGTH) === MARK ? rawStrings[slice(string, MARK_LENGTH)] : '"' + string + '"'; i = end; } else result += chr; } return result; } }); var has$c = mapHelpers.has; // Perform ? RequireInternalSlot(M, [[MapData]]) var aMap$e = function (it) { has$c(it); return it; }; var $$1K = _export; var aMap$d = aMap$e; var remove$5 = mapHelpers.remove; // `Map.prototype.deleteAll` method // https://github.com/tc39/proposal-collection-methods $$1K({ target: 'Map', proto: true, real: true, forced: true }, { deleteAll: function deleteAll(/* ...elements */) { var collection = aMap$d(this); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = remove$5(collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; } }); var $$1J = _export; var aMap$c = aMap$e; var MapHelpers$6 = mapHelpers; var get$3 = MapHelpers$6.get; var has$b = MapHelpers$6.has; var set$7 = MapHelpers$6.set; // `Map.prototype.emplace` method // https://github.com/tc39/proposal-upsert $$1J({ target: 'Map', proto: true, real: true, forced: true }, { emplace: function emplace(key, handler) { var map = aMap$c(this); var value, inserted; if (has$b(map, key)) { value = get$3(map, key); if ('update' in handler) { value = handler.update(value, key, map); set$7(map, key, value); } return value; } inserted = handler.insert(key, map); set$7(map, key, inserted); return inserted; } }); var $$1I = _export; var bind$e = functionBindContext; var aMap$b = aMap$e; var iterate$p = mapIterate; // `Map.prototype.every` method // https://github.com/tc39/proposal-collection-methods $$1I({ target: 'Map', proto: true, real: true, forced: true }, { every: function every(callbackfn /* , thisArg */) { var map = aMap$b(this); var boundFunction = bind$e(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate$p(map, function (value, key) { if (!boundFunction(value, key, map)) return false; }, true) !== false; } }); var $$1H = _export; var bind$d = functionBindContext; var aMap$a = aMap$e; var MapHelpers$5 = mapHelpers; var iterate$o = mapIterate; var Map$7 = MapHelpers$5.Map; var set$6 = MapHelpers$5.set; // `Map.prototype.filter` method // https://github.com/tc39/proposal-collection-methods $$1H({ target: 'Map', proto: true, real: true, forced: true }, { filter: function filter(callbackfn /* , thisArg */) { var map = aMap$a(this); var boundFunction = bind$d(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new Map$7(); iterate$o(map, function (value, key) { if (boundFunction(value, key, map)) set$6(newMap, key, value); }); return newMap; } }); var $$1G = _export; var bind$c = functionBindContext; var aMap$9 = aMap$e; var iterate$n = mapIterate; // `Map.prototype.find` method // https://github.com/tc39/proposal-collection-methods $$1G({ target: 'Map', proto: true, real: true, forced: true }, { find: function find(callbackfn /* , thisArg */) { var map = aMap$9(this); var boundFunction = bind$c(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var result = iterate$n(map, function (value, key) { if (boundFunction(value, key, map)) return { value: value }; }, true); return result && result.value; } }); var $$1F = _export; var bind$b = functionBindContext; var aMap$8 = aMap$e; var iterate$m = mapIterate; // `Map.prototype.findKey` method // https://github.com/tc39/proposal-collection-methods $$1F({ target: 'Map', proto: true, real: true, forced: true }, { findKey: function findKey(callbackfn /* , thisArg */) { var map = aMap$8(this); var boundFunction = bind$b(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var result = iterate$m(map, function (value, key) { if (boundFunction(value, key, map)) return { key: key }; }, true); return result && result.key; } }); // https://tc39.github.io/proposal-setmap-offrom/ var bind$a = functionBindContext; var call$g = functionCall; var aCallable$a = aCallable$N; var aConstructor$1 = aConstructor$5; var isNullOrUndefined$3 = isNullOrUndefined$k; var iterate$l = iterate$G; var push$a = [].push; var collectionFrom = function from(source /* , mapFn, thisArg */) { var length = arguments.length; var mapFn = length > 1 ? arguments[1] : undefined; var mapping, array, n, boundFunction; aConstructor$1(this); mapping = mapFn !== undefined; if (mapping) aCallable$a(mapFn); if (isNullOrUndefined$3(source)) return new this(); array = []; if (mapping) { n = 0; boundFunction = bind$a(mapFn, length > 2 ? arguments[2] : undefined); iterate$l(source, function (nextItem) { call$g(push$a, array, boundFunction(nextItem, n++)); }); } else { iterate$l(source, push$a, { that: array }); } return new this(array); }; var $$1E = _export; var from$3 = collectionFrom; // `Map.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from $$1E({ target: 'Map', stat: true, forced: true }, { from: from$3 }); var $$1D = _export; var uncurryThis$o = functionUncurryThis; var aCallable$9 = aCallable$N; var requireObjectCoercible$3 = requireObjectCoercible$p; var iterate$k = iterate$G; var MapHelpers$4 = mapHelpers; var IS_PURE$1 = isPure; var Map$6 = MapHelpers$4.Map; var has$a = MapHelpers$4.has; var get$2 = MapHelpers$4.get; var set$5 = MapHelpers$4.set; var push$9 = uncurryThis$o([].push); // `Map.groupBy` method // https://github.com/tc39/proposal-array-grouping $$1D({ target: 'Map', stat: true, forced: IS_PURE$1 }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible$3(items); aCallable$9(callbackfn); var map = new Map$6(); var k = 0; iterate$k(items, function (value) { var key = callbackfn(value, k++); if (!has$a(map, key)) set$5(map, key, [value]); else push$9(get$2(map, key), value); }); return map; } }); // `SameValueZero` abstract operation // https://tc39.es/ecma262/#sec-samevaluezero var sameValueZero$1 = function (x, y) { // eslint-disable-next-line no-self-compare -- NaN check return x === y || x !== x && y !== y; }; var $$1C = _export; var sameValueZero = sameValueZero$1; var aMap$7 = aMap$e; var iterate$j = mapIterate; // `Map.prototype.includes` method // https://github.com/tc39/proposal-collection-methods $$1C({ target: 'Map', proto: true, real: true, forced: true }, { includes: function includes(searchElement) { return iterate$j(aMap$7(this), function (value) { if (sameValueZero(value, searchElement)) return true; }, true) === true; } }); var $$1B = _export; var call$f = functionCall; var iterate$i = iterate$G; var isCallable$8 = isCallable$K; var aCallable$8 = aCallable$N; var Map$5 = mapHelpers.Map; // `Map.keyBy` method // https://github.com/tc39/proposal-collection-methods $$1B({ target: 'Map', stat: true, forced: true }, { keyBy: function keyBy(iterable, keyDerivative) { var C = isCallable$8(this) ? this : Map$5; var newMap = new C(); aCallable$8(keyDerivative); var setter = aCallable$8(newMap.set); iterate$i(iterable, function (element) { call$f(setter, newMap, keyDerivative(element), element); }); return newMap; } }); var $$1A = _export; var aMap$6 = aMap$e; var iterate$h = mapIterate; // `Map.prototype.keyOf` method // https://github.com/tc39/proposal-collection-methods $$1A({ target: 'Map', proto: true, real: true, forced: true }, { keyOf: function keyOf(searchElement) { var result = iterate$h(aMap$6(this), function (value, key) { if (value === searchElement) return { key: key }; }, true); return result && result.key; } }); var $$1z = _export; var bind$9 = functionBindContext; var aMap$5 = aMap$e; var MapHelpers$3 = mapHelpers; var iterate$g = mapIterate; var Map$4 = MapHelpers$3.Map; var set$4 = MapHelpers$3.set; // `Map.prototype.mapKeys` method // https://github.com/tc39/proposal-collection-methods $$1z({ target: 'Map', proto: true, real: true, forced: true }, { mapKeys: function mapKeys(callbackfn /* , thisArg */) { var map = aMap$5(this); var boundFunction = bind$9(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new Map$4(); iterate$g(map, function (value, key) { set$4(newMap, boundFunction(value, key, map), value); }); return newMap; } }); var $$1y = _export; var bind$8 = functionBindContext; var aMap$4 = aMap$e; var MapHelpers$2 = mapHelpers; var iterate$f = mapIterate; var Map$3 = MapHelpers$2.Map; var set$3 = MapHelpers$2.set; // `Map.prototype.mapValues` method // https://github.com/tc39/proposal-collection-methods $$1y({ target: 'Map', proto: true, real: true, forced: true }, { mapValues: function mapValues(callbackfn /* , thisArg */) { var map = aMap$4(this); var boundFunction = bind$8(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new Map$3(); iterate$f(map, function (value, key) { set$3(newMap, key, boundFunction(value, key, map)); }); return newMap; } }); var $$1x = _export; var aMap$3 = aMap$e; var iterate$e = iterate$G; var set$2 = mapHelpers.set; // `Map.prototype.merge` method // https://github.com/tc39/proposal-collection-methods $$1x({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, { // eslint-disable-next-line no-unused-vars -- required for `.length` merge: function merge(iterable /* ...iterables */) { var map = aMap$3(this); var argumentsLength = arguments.length; var i = 0; while (i < argumentsLength) { iterate$e(arguments[i++], function (key, value) { set$2(map, key, value); }, { AS_ENTRIES: true }); } return map; } }); var arraySlice$2 = arraySlice$b; // https://tc39.github.io/proposal-setmap-offrom/ var collectionOf = function of() { return new this(arraySlice$2(arguments)); }; var $$1w = _export; var of$3 = collectionOf; // `Map.of` method // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of $$1w({ target: 'Map', stat: true, forced: true }, { of: of$3 }); var $$1v = _export; var aCallable$7 = aCallable$N; var aMap$2 = aMap$e; var iterate$d = mapIterate; var $TypeError$9 = TypeError; // `Map.prototype.reduce` method // https://github.com/tc39/proposal-collection-methods $$1v({ target: 'Map', proto: true, real: true, forced: true }, { reduce: function reduce(callbackfn /* , initialValue */) { var map = aMap$2(this); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable$7(callbackfn); iterate$d(map, function (value, key) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, key, map); } }); if (noInitial) throw $TypeError$9('Reduce of empty map with no initial value'); return accumulator; } }); var $$1u = _export; var bind$7 = functionBindContext; var aMap$1 = aMap$e; var iterate$c = mapIterate; // `Map.prototype.some` method // https://github.com/tc39/proposal-collection-methods $$1u({ target: 'Map', proto: true, real: true, forced: true }, { some: function some(callbackfn /* , thisArg */) { var map = aMap$1(this); var boundFunction = bind$7(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate$c(map, function (value, key) { if (boundFunction(value, key, map)) return true; }, true) === true; } }); var $$1t = _export; var aCallable$6 = aCallable$N; var aMap = aMap$e; var MapHelpers$1 = mapHelpers; var $TypeError$8 = TypeError; var get$1 = MapHelpers$1.get; var has$9 = MapHelpers$1.has; var set$1 = MapHelpers$1.set; // `Map.prototype.update` method // https://github.com/tc39/proposal-collection-methods $$1t({ target: 'Map', proto: true, real: true, forced: true }, { update: function update(key, callback /* , thunk */) { var map = aMap(this); var length = arguments.length; aCallable$6(callback); var isPresentInMap = has$9(map, key); if (!isPresentInMap && length < 3) { throw $TypeError$8('Updating absent value'); } var value = isPresentInMap ? get$1(map, key) : aCallable$6(length > 2 ? arguments[2] : undefined)(key, map); set$1(map, key, callback(value, key, map)); return map; } }); var call$e = functionCall; var aCallable$5 = aCallable$N; var isCallable$7 = isCallable$K; var anObject$h = anObject$1f; var $TypeError$7 = TypeError; // `Map.prototype.upsert` method // https://github.com/tc39/proposal-upsert var mapUpsert = function upsert(key, updateFn /* , insertFn */) { var map = anObject$h(this); var get = aCallable$5(map.get); var has = aCallable$5(map.has); var set = aCallable$5(map.set); var insertFn = arguments.length > 2 ? arguments[2] : undefined; var value; if (!isCallable$7(updateFn) && !isCallable$7(insertFn)) { throw $TypeError$7('At least one callback required'); } if (call$e(has, map, key)) { value = call$e(get, map, key); if (isCallable$7(updateFn)) { value = updateFn(value); call$e(set, map, key, value); } } else if (isCallable$7(insertFn)) { value = insertFn(); call$e(set, map, key, value); } return value; }; // TODO: remove from `core-js@4` var $$1s = _export; var upsert$2 = mapUpsert; // `Map.prototype.updateOrInsert` method (replaced by `Map.prototype.emplace`) // https://github.com/thumbsupep/proposal-upsert $$1s({ target: 'Map', proto: true, real: true, name: 'upsert', forced: true }, { updateOrInsert: upsert$2 }); // TODO: remove from `core-js@4` var $$1r = _export; var upsert$1 = mapUpsert; // `Map.prototype.upsert` method (replaced by `Map.prototype.emplace`) // https://github.com/thumbsupep/proposal-upsert $$1r({ target: 'Map', proto: true, real: true, forced: true }, { upsert: upsert$1 }); var $$1q = _export; var min$2 = Math.min; var max$2 = Math.max; // `Math.clamp` method // https://rwaldron.github.io/proposal-math-extensions/ $$1q({ target: 'Math', stat: true, forced: true }, { clamp: function clamp(x, lower, upper) { return min$2(upper, max$2(lower, x)); } }); var $$1p = _export; // `Math.DEG_PER_RAD` constant // https://rwaldron.github.io/proposal-math-extensions/ $$1p({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true }, { DEG_PER_RAD: Math.PI / 180 }); var $$1o = _export; var RAD_PER_DEG = 180 / Math.PI; // `Math.degrees` method // https://rwaldron.github.io/proposal-math-extensions/ $$1o({ target: 'Math', stat: true, forced: true }, { degrees: function degrees(radians) { return radians * RAD_PER_DEG; } }); // `Math.scale` method implementation // https://rwaldron.github.io/proposal-math-extensions/ var mathScale = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { var nx = +x; var nInLow = +inLow; var nInHigh = +inHigh; var nOutLow = +outLow; var nOutHigh = +outHigh; // eslint-disable-next-line no-self-compare -- NaN check if (nx !== nx || nInLow !== nInLow || nInHigh !== nInHigh || nOutLow !== nOutLow || nOutHigh !== nOutHigh) return NaN; if (nx === Infinity || nx === -Infinity) return nx; return (nx - nInLow) * (nOutHigh - nOutLow) / (nInHigh - nInLow) + nOutLow; }; var $$1n = _export; var scale$1 = mathScale; var fround = mathFround; // `Math.fscale` method // https://rwaldron.github.io/proposal-math-extensions/ $$1n({ target: 'Math', stat: true, forced: true }, { fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { return fround(scale$1(x, inLow, inHigh, outLow, outHigh)); } }); var $$1m = _export; var IEEE754 = ieee754; var packIEEE754 = IEEE754.pack; var unpackIEEE754 = IEEE754.unpack; var $isFinite = isFinite; // `Math.f16round` method // https://github.com/tc39/proposal-float16array $$1m({ target: 'Math', stat: true }, { f16round: function f16round(x) { var n = +x; return $isFinite(n) && n !== 0 ? unpackIEEE754(packIEEE754(n, 10, 2), 10) : n; } }); var $$1l = _export; // `Math.iaddh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $$1l({ target: 'Math', stat: true, forced: true }, { iaddh: function iaddh(x0, x1, y0, y1) { var $x0 = x0 >>> 0; var $x1 = x1 >>> 0; var $y0 = y0 >>> 0; return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; } }); var $$1k = _export; // `Math.imulh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $$1k({ target: 'Math', stat: true, forced: true }, { imulh: function imulh(u, v) { var UINT16 = 0xFFFF; var $u = +u; var $v = +v; var u0 = $u & UINT16; var v0 = $v & UINT16; var u1 = $u >> 16; var v1 = $v >> 16; var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); } }); var $$1j = _export; // `Math.isubh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $$1j({ target: 'Math', stat: true, forced: true }, { isubh: function isubh(x0, x1, y0, y1) { var $x0 = x0 >>> 0; var $x1 = x1 >>> 0; var $y0 = y0 >>> 0; return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; } }); var $$1i = _export; // `Math.RAD_PER_DEG` constant // https://rwaldron.github.io/proposal-math-extensions/ $$1i({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true }, { RAD_PER_DEG: 180 / Math.PI }); var $$1h = _export; var DEG_PER_RAD = Math.PI / 180; // `Math.radians` method // https://rwaldron.github.io/proposal-math-extensions/ $$1h({ target: 'Math', stat: true, forced: true }, { radians: function radians(degrees) { return degrees * DEG_PER_RAD; } }); var $$1g = _export; var scale = mathScale; // `Math.scale` method // https://rwaldron.github.io/proposal-math-extensions/ $$1g({ target: 'Math', stat: true, forced: true }, { scale: scale }); var $$1f = _export; var anObject$g = anObject$1f; var numberIsFinite = numberIsFinite$2; var createIteratorConstructor$3 = iteratorCreateConstructor; var createIterResultObject$2 = createIterResultObject$g; var InternalStateModule$6 = internalState; var SEEDED_RANDOM = 'Seeded Random'; var SEEDED_RANDOM_GENERATOR = SEEDED_RANDOM + ' Generator'; var SEED_TYPE_ERROR = 'Math.seededPRNG() argument should have a "seed" field with a finite value.'; var setInternalState$6 = InternalStateModule$6.set; var getInternalState$3 = InternalStateModule$6.getterFor(SEEDED_RANDOM_GENERATOR); var $TypeError$6 = TypeError; var $SeededRandomGenerator = createIteratorConstructor$3(function SeededRandomGenerator(seed) { setInternalState$6(this, { type: SEEDED_RANDOM_GENERATOR, seed: seed % 2147483647 }); }, SEEDED_RANDOM, function next() { var state = getInternalState$3(this); var seed = state.seed = (state.seed * 1103515245 + 12345) % 2147483647; return createIterResultObject$2((seed & 1073741823) / 1073741823, false); }); // `Math.seededPRNG` method // https://github.com/tc39/proposal-seeded-random // based on https://github.com/tc39/proposal-seeded-random/blob/78b8258835b57fc2100d076151ab506bc3202ae6/demo.html $$1f({ target: 'Math', stat: true, forced: true }, { seededPRNG: function seededPRNG(it) { var seed = anObject$g(it).seed; if (!numberIsFinite(seed)) throw $TypeError$6(SEED_TYPE_ERROR); return new $SeededRandomGenerator(seed); } }); var $$1e = _export; // `Math.signbit` method // https://github.com/tc39/proposal-Math.signbit $$1e({ target: 'Math', stat: true, forced: true }, { signbit: function signbit(x) { var n = +x; // eslint-disable-next-line no-self-compare -- NaN check return n === n && n === 0 ? 1 / n === -Infinity : n < 0; } }); var $$1d = _export; // `Math.umulh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $$1d({ target: 'Math', stat: true, forced: true }, { umulh: function umulh(u, v) { var UINT16 = 0xFFFF; var $u = +u; var $v = +v; var u0 = $u & UINT16; var v0 = $v & UINT16; var u1 = $u >>> 16; var v1 = $v >>> 16; var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); } }); var $$1c = _export; var uncurryThis$n = functionUncurryThis; var toIntegerOrInfinity$3 = toIntegerOrInfinity$p; var parseInt$2 = numberParseInt; var INVALID_NUMBER_REPRESENTATION = 'Invalid number representation'; var INVALID_RADIX = 'Invalid radix'; var $RangeError$2 = RangeError; var $SyntaxError = SyntaxError; var $TypeError$5 = TypeError; var valid = /^[\da-z]+$/; var charAt$8 = uncurryThis$n(''.charAt); var exec$4 = uncurryThis$n(valid.exec); var numberToString$1 = uncurryThis$n(1.0.toString); var stringSlice$4 = uncurryThis$n(''.slice); // `Number.fromString` method // https://github.com/tc39/proposal-number-fromstring $$1c({ target: 'Number', stat: true, forced: true }, { fromString: function fromString(string, radix) { var sign = 1; var R, mathNum; if (typeof string != 'string') throw $TypeError$5(INVALID_NUMBER_REPRESENTATION); if (!string.length) throw $SyntaxError(INVALID_NUMBER_REPRESENTATION); if (charAt$8(string, 0) === '-') { sign = -1; string = stringSlice$4(string, 1); if (!string.length) throw $SyntaxError(INVALID_NUMBER_REPRESENTATION); } R = radix === undefined ? 10 : toIntegerOrInfinity$3(radix); if (R < 2 || R > 36) throw $RangeError$2(INVALID_RADIX); if (!exec$4(valid, string) || numberToString$1(mathNum = parseInt$2(string, R), R) !== string) { throw $SyntaxError(INVALID_NUMBER_REPRESENTATION); } return sign * mathNum; } }); var $$1b = _export; var NumericRangeIterator = numericRangeIterator; // `Number.range` method // https://github.com/tc39/proposal-Number.range // TODO: Remove from `core-js@4` $$1b({ target: 'Number', stat: true, forced: true }, { range: function range(start, end, option) { return new NumericRangeIterator(start, end, option, 'number', 0, 1); } }); var InternalStateModule$5 = internalState; var createIteratorConstructor$2 = iteratorCreateConstructor; var createIterResultObject$1 = createIterResultObject$g; var hasOwn$7 = hasOwnProperty_1; var objectKeys$1 = objectKeys$6; var toObject$1 = toObject$D; var OBJECT_ITERATOR = 'Object Iterator'; var setInternalState$5 = InternalStateModule$5.set; var getInternalState$2 = InternalStateModule$5.getterFor(OBJECT_ITERATOR); var objectIterator = createIteratorConstructor$2(function ObjectIterator(source, mode) { var object = toObject$1(source); setInternalState$5(this, { type: OBJECT_ITERATOR, mode: mode, object: object, keys: objectKeys$1(object), index: 0 }); }, 'Object', function next() { var state = getInternalState$2(this); var keys = state.keys; while (true) { if (keys === null || state.index >= keys.length) { state.object = state.keys = null; return createIterResultObject$1(undefined, true); } var key = keys[state.index++]; var object = state.object; if (!hasOwn$7(object, key)) continue; switch (state.mode) { case 'keys': return createIterResultObject$1(key, false); case 'values': return createIterResultObject$1(object[key], false); } /* entries */ return createIterResultObject$1([key, object[key]], false); } }); // TODO: Remove from `core-js@4` var $$1a = _export; var ObjectIterator$2 = objectIterator; // `Object.iterateEntries` method // https://github.com/tc39/proposal-object-iteration $$1a({ target: 'Object', stat: true, forced: true }, { iterateEntries: function iterateEntries(object) { return new ObjectIterator$2(object, 'entries'); } }); // TODO: Remove from `core-js@4` var $$19 = _export; var ObjectIterator$1 = objectIterator; // `Object.iterateKeys` method // https://github.com/tc39/proposal-object-iteration $$19({ target: 'Object', stat: true, forced: true }, { iterateKeys: function iterateKeys(object) { return new ObjectIterator$1(object, 'keys'); } }); // TODO: Remove from `core-js@4` var $$18 = _export; var ObjectIterator = objectIterator; // `Object.iterateValues` method // https://github.com/tc39/proposal-object-iteration $$18({ target: 'Object', stat: true, forced: true }, { iterateValues: function iterateValues(object) { return new ObjectIterator(object, 'values'); } }); var $$17 = _export; var getBuiltIn$g = getBuiltIn$M; var uncurryThis$m = functionUncurryThis; var aCallable$4 = aCallable$N; var requireObjectCoercible$2 = requireObjectCoercible$p; var toPropertyKey = toPropertyKey$a; var iterate$b = iterate$G; var create$2 = getBuiltIn$g('Object', 'create'); var push$8 = uncurryThis$m([].push); // `Object.groupBy` method // https://github.com/tc39/proposal-array-grouping $$17({ target: 'Object', stat: true }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible$2(items); aCallable$4(callbackfn); var obj = create$2(null); var k = 0; iterate$b(items, function (value) { var key = toPropertyKey(callbackfn(value, k++)); // in some IE versions, `hasOwnProperty` returns incorrect result on integer keys // but since it's a `null` prototype object, we can safely use `in` if (key in obj) push$8(obj[key], value); else obj[key] = [value]; }); return obj; } }); var global$i = global$16; var isCallable$6 = isCallable$K; var wellKnownSymbol$7 = wellKnownSymbol$T; var $$OBSERVABLE$2 = wellKnownSymbol$7('observable'); var NativeObservable = global$i.Observable; var NativeObservablePrototype = NativeObservable && NativeObservable.prototype; var observableForced = !isCallable$6(NativeObservable) || !isCallable$6(NativeObservable.from) || !isCallable$6(NativeObservable.of) || !isCallable$6(NativeObservablePrototype.subscribe) || !isCallable$6(NativeObservablePrototype[$$OBSERVABLE$2]); // https://github.com/tc39/proposal-observable var $$16 = _export; var call$d = functionCall; var DESCRIPTORS$7 = descriptors; var setSpecies = setSpecies$7; var aCallable$3 = aCallable$N; var anObject$f = anObject$1f; var anInstance$4 = anInstance$f; var isCallable$5 = isCallable$K; var isNullOrUndefined$2 = isNullOrUndefined$k; var isObject$3 = isObject$K; var getMethod$1 = getMethod$l; var defineBuiltIn$5 = defineBuiltIn$u; var defineBuiltIns$1 = defineBuiltIns$b; var defineBuiltInAccessor$5 = defineBuiltInAccessor$o; var hostReportErrors = hostReportErrors$2; var wellKnownSymbol$6 = wellKnownSymbol$T; var InternalStateModule$4 = internalState; var OBSERVABLE_FORCED$2 = observableForced; var $$OBSERVABLE$1 = wellKnownSymbol$6('observable'); var OBSERVABLE = 'Observable'; var SUBSCRIPTION = 'Subscription'; var SUBSCRIPTION_OBSERVER = 'SubscriptionObserver'; var getterFor$1 = InternalStateModule$4.getterFor; var setInternalState$4 = InternalStateModule$4.set; var getObservableInternalState = getterFor$1(OBSERVABLE); var getSubscriptionInternalState = getterFor$1(SUBSCRIPTION); var getSubscriptionObserverInternalState = getterFor$1(SUBSCRIPTION_OBSERVER); var SubscriptionState = function (observer) { this.observer = anObject$f(observer); this.cleanup = undefined; this.subscriptionObserver = undefined; }; SubscriptionState.prototype = { type: SUBSCRIPTION, clean: function () { var cleanup = this.cleanup; if (cleanup) { this.cleanup = undefined; try { cleanup(); } catch (error) { hostReportErrors(error); } } }, close: function () { if (!DESCRIPTORS$7) { var subscription = this.facade; var subscriptionObserver = this.subscriptionObserver; subscription.closed = true; if (subscriptionObserver) subscriptionObserver.closed = true; } this.observer = undefined; }, isClosed: function () { return this.observer === undefined; } }; var Subscription = function (observer, subscriber) { var subscriptionState = setInternalState$4(this, new SubscriptionState(observer)); var start; if (!DESCRIPTORS$7) this.closed = false; try { if (start = getMethod$1(observer, 'start')) call$d(start, observer, this); } catch (error) { hostReportErrors(error); } if (subscriptionState.isClosed()) return; var subscriptionObserver = subscriptionState.subscriptionObserver = new SubscriptionObserver(subscriptionState); try { var cleanup = subscriber(subscriptionObserver); var subscription = cleanup; if (!isNullOrUndefined$2(cleanup)) subscriptionState.cleanup = isCallable$5(cleanup.unsubscribe) ? function () { subscription.unsubscribe(); } : aCallable$3(cleanup); } catch (error) { subscriptionObserver.error(error); return; } if (subscriptionState.isClosed()) subscriptionState.clean(); }; Subscription.prototype = defineBuiltIns$1({}, { unsubscribe: function unsubscribe() { var subscriptionState = getSubscriptionInternalState(this); if (!subscriptionState.isClosed()) { subscriptionState.close(); subscriptionState.clean(); } } }); if (DESCRIPTORS$7) defineBuiltInAccessor$5(Subscription.prototype, 'closed', { configurable: true, get: function closed() { return getSubscriptionInternalState(this).isClosed(); } }); var SubscriptionObserver = function (subscriptionState) { setInternalState$4(this, { type: SUBSCRIPTION_OBSERVER, subscriptionState: subscriptionState }); if (!DESCRIPTORS$7) this.closed = false; }; SubscriptionObserver.prototype = defineBuiltIns$1({}, { next: function next(value) { var subscriptionState = getSubscriptionObserverInternalState(this).subscriptionState; if (!subscriptionState.isClosed()) { var observer = subscriptionState.observer; try { var nextMethod = getMethod$1(observer, 'next'); if (nextMethod) call$d(nextMethod, observer, value); } catch (error) { hostReportErrors(error); } } }, error: function error(value) { var subscriptionState = getSubscriptionObserverInternalState(this).subscriptionState; if (!subscriptionState.isClosed()) { var observer = subscriptionState.observer; subscriptionState.close(); try { var errorMethod = getMethod$1(observer, 'error'); if (errorMethod) call$d(errorMethod, observer, value); else hostReportErrors(value); } catch (err) { hostReportErrors(err); } subscriptionState.clean(); } }, complete: function complete() { var subscriptionState = getSubscriptionObserverInternalState(this).subscriptionState; if (!subscriptionState.isClosed()) { var observer = subscriptionState.observer; subscriptionState.close(); try { var completeMethod = getMethod$1(observer, 'complete'); if (completeMethod) call$d(completeMethod, observer); } catch (error) { hostReportErrors(error); } subscriptionState.clean(); } } }); if (DESCRIPTORS$7) defineBuiltInAccessor$5(SubscriptionObserver.prototype, 'closed', { configurable: true, get: function closed() { return getSubscriptionObserverInternalState(this).subscriptionState.isClosed(); } }); var $Observable = function Observable(subscriber) { anInstance$4(this, ObservablePrototype); setInternalState$4(this, { type: OBSERVABLE, subscriber: aCallable$3(subscriber) }); }; var ObservablePrototype = $Observable.prototype; defineBuiltIns$1(ObservablePrototype, { subscribe: function subscribe(observer) { var length = arguments.length; return new Subscription(isCallable$5(observer) ? { next: observer, error: length > 1 ? arguments[1] : undefined, complete: length > 2 ? arguments[2] : undefined } : isObject$3(observer) ? observer : {}, getObservableInternalState(this).subscriber); } }); defineBuiltIn$5(ObservablePrototype, $$OBSERVABLE$1, function () { return this; }); $$16({ global: true, constructor: true, forced: OBSERVABLE_FORCED$2 }, { Observable: $Observable }); setSpecies(OBSERVABLE); var $$15 = _export; var getBuiltIn$f = getBuiltIn$M; var call$c = functionCall; var anObject$e = anObject$1f; var isConstructor$2 = isConstructor$a; var getIterator$1 = getIterator$7; var getMethod = getMethod$l; var iterate$a = iterate$G; var wellKnownSymbol$5 = wellKnownSymbol$T; var OBSERVABLE_FORCED$1 = observableForced; var $$OBSERVABLE = wellKnownSymbol$5('observable'); // `Observable.from` method // https://github.com/tc39/proposal-observable $$15({ target: 'Observable', stat: true, forced: OBSERVABLE_FORCED$1 }, { from: function from(x) { var C = isConstructor$2(this) ? this : getBuiltIn$f('Observable'); var observableMethod = getMethod(anObject$e(x), $$OBSERVABLE); if (observableMethod) { var observable = anObject$e(call$c(observableMethod, x)); return observable.constructor === C ? observable : new C(function (observer) { return observable.subscribe(observer); }); } var iterator = getIterator$1(x); return new C(function (observer) { iterate$a(iterator, function (it, stop) { observer.next(it); if (observer.closed) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }); observer.complete(); }); } }); var $$14 = _export; var getBuiltIn$e = getBuiltIn$M; var isConstructor$1 = isConstructor$a; var OBSERVABLE_FORCED = observableForced; var Array$2 = getBuiltIn$e('Array'); // `Observable.of` method // https://github.com/tc39/proposal-observable $$14({ target: 'Observable', stat: true, forced: OBSERVABLE_FORCED }, { of: function of() { var C = isConstructor$1(this) ? this : getBuiltIn$e('Observable'); var length = arguments.length; var items = Array$2(length); var index = 0; while (index < length) items[index] = arguments[index++]; return new C(function (observer) { for (var i = 0; i < length; i++) { observer.next(items[i]); if (observer.closed) return; } observer.complete(); }); } }); // TODO: Remove from `core-js@4` var $$13 = _export; var newPromiseCapabilityModule$1 = newPromiseCapability$2; var perform = perform$7; // `Promise.try` method // https://github.com/tc39/proposal-promise-try $$13({ target: 'Promise', stat: true, forced: true }, { 'try': function (callbackfn) { var promiseCapability = newPromiseCapabilityModule$1.f(this); var result = perform(callbackfn); (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); return promiseCapability.promise; } }); var $$12 = _export; var newPromiseCapabilityModule = newPromiseCapability$2; // `Promise.withResolvers` method // https://github.com/tc39/proposal-promise-with-resolvers $$12({ target: 'Promise', stat: true }, { withResolvers: function withResolvers() { var promiseCapability = newPromiseCapabilityModule.f(this); return { promise: promiseCapability.promise, resolve: promiseCapability.resolve, reject: promiseCapability.reject }; } }); // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` var getBuiltIn$d = getBuiltIn$M; var uncurryThis$l = functionUncurryThis; var shared$2 = sharedExports; var Map$2 = getBuiltIn$d('Map'); var WeakMap$2 = getBuiltIn$d('WeakMap'); var push$7 = uncurryThis$l([].push); var metadata = shared$2('metadata'); var store$1 = metadata.store || (metadata.store = new WeakMap$2()); var getOrCreateMetadataMap$1 = function (target, targetKey, create) { var targetMetadata = store$1.get(target); if (!targetMetadata) { if (!create) return; store$1.set(target, targetMetadata = new Map$2()); } var keyMetadata = targetMetadata.get(targetKey); if (!keyMetadata) { if (!create) return; targetMetadata.set(targetKey, keyMetadata = new Map$2()); } return keyMetadata; }; var ordinaryHasOwnMetadata$3 = function (MetadataKey, O, P) { var metadataMap = getOrCreateMetadataMap$1(O, P, false); return metadataMap === undefined ? false : metadataMap.has(MetadataKey); }; var ordinaryGetOwnMetadata$2 = function (MetadataKey, O, P) { var metadataMap = getOrCreateMetadataMap$1(O, P, false); return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); }; var ordinaryDefineOwnMetadata$2 = function (MetadataKey, MetadataValue, O, P) { getOrCreateMetadataMap$1(O, P, true).set(MetadataKey, MetadataValue); }; var ordinaryOwnMetadataKeys$2 = function (target, targetKey) { var metadataMap = getOrCreateMetadataMap$1(target, targetKey, false); var keys = []; if (metadataMap) metadataMap.forEach(function (_, key) { push$7(keys, key); }); return keys; }; var toMetadataKey$9 = function (it) { return it === undefined || typeof it == 'symbol' ? it : String(it); }; var reflectMetadata = { store: store$1, getMap: getOrCreateMetadataMap$1, has: ordinaryHasOwnMetadata$3, get: ordinaryGetOwnMetadata$2, set: ordinaryDefineOwnMetadata$2, keys: ordinaryOwnMetadataKeys$2, toKey: toMetadataKey$9 }; // TODO: Remove from `core-js@4` var $$11 = _export; var ReflectMetadataModule$8 = reflectMetadata; var anObject$d = anObject$1f; var toMetadataKey$8 = ReflectMetadataModule$8.toKey; var ordinaryDefineOwnMetadata$1 = ReflectMetadataModule$8.set; // `Reflect.defineMetadata` method // https://github.com/rbuckton/reflect-metadata $$11({ target: 'Reflect', stat: true }, { defineMetadata: function defineMetadata(metadataKey, metadataValue, target /* , targetKey */) { var targetKey = arguments.length < 4 ? undefined : toMetadataKey$8(arguments[3]); ordinaryDefineOwnMetadata$1(metadataKey, metadataValue, anObject$d(target), targetKey); } }); var $$10 = _export; var ReflectMetadataModule$7 = reflectMetadata; var anObject$c = anObject$1f; var toMetadataKey$7 = ReflectMetadataModule$7.toKey; var getOrCreateMetadataMap = ReflectMetadataModule$7.getMap; var store = ReflectMetadataModule$7.store; // `Reflect.deleteMetadata` method // https://github.com/rbuckton/reflect-metadata $$10({ target: 'Reflect', stat: true }, { deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$7(arguments[2]); var metadataMap = getOrCreateMetadataMap(anObject$c(target), targetKey, false); if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; if (metadataMap.size) return true; var targetMetadata = store.get(target); targetMetadata['delete'](targetKey); return !!targetMetadata.size || store['delete'](target); } }); // TODO: Remove from `core-js@4` var $$$ = _export; var ReflectMetadataModule$6 = reflectMetadata; var anObject$b = anObject$1f; var getPrototypeOf$2 = objectGetPrototypeOf$2; var ordinaryHasOwnMetadata$2 = ReflectMetadataModule$6.has; var ordinaryGetOwnMetadata$1 = ReflectMetadataModule$6.get; var toMetadataKey$6 = ReflectMetadataModule$6.toKey; var ordinaryGetMetadata = function (MetadataKey, O, P) { var hasOwn = ordinaryHasOwnMetadata$2(MetadataKey, O, P); if (hasOwn) return ordinaryGetOwnMetadata$1(MetadataKey, O, P); var parent = getPrototypeOf$2(O); return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; }; // `Reflect.getMetadata` method // https://github.com/rbuckton/reflect-metadata $$$({ target: 'Reflect', stat: true }, { getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$6(arguments[2]); return ordinaryGetMetadata(metadataKey, anObject$b(target), targetKey); } }); // TODO: Remove from `core-js@4` var $$_ = _export; var uncurryThis$k = functionUncurryThis; var ReflectMetadataModule$5 = reflectMetadata; var anObject$a = anObject$1f; var getPrototypeOf$1 = objectGetPrototypeOf$2; var $arrayUniqueBy$1 = arrayUniqueBy$2; var arrayUniqueBy$1 = uncurryThis$k($arrayUniqueBy$1); var concat = uncurryThis$k([].concat); var ordinaryOwnMetadataKeys$1 = ReflectMetadataModule$5.keys; var toMetadataKey$5 = ReflectMetadataModule$5.toKey; var ordinaryMetadataKeys = function (O, P) { var oKeys = ordinaryOwnMetadataKeys$1(O, P); var parent = getPrototypeOf$1(O); if (parent === null) return oKeys; var pKeys = ordinaryMetadataKeys(parent, P); return pKeys.length ? oKeys.length ? arrayUniqueBy$1(concat(oKeys, pKeys)) : pKeys : oKeys; }; // `Reflect.getMetadataKeys` method // https://github.com/rbuckton/reflect-metadata $$_({ target: 'Reflect', stat: true }, { getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { var targetKey = arguments.length < 2 ? undefined : toMetadataKey$5(arguments[1]); return ordinaryMetadataKeys(anObject$a(target), targetKey); } }); // TODO: Remove from `core-js@4` var $$Z = _export; var ReflectMetadataModule$4 = reflectMetadata; var anObject$9 = anObject$1f; var ordinaryGetOwnMetadata = ReflectMetadataModule$4.get; var toMetadataKey$4 = ReflectMetadataModule$4.toKey; // `Reflect.getOwnMetadata` method // https://github.com/rbuckton/reflect-metadata $$Z({ target: 'Reflect', stat: true }, { getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$4(arguments[2]); return ordinaryGetOwnMetadata(metadataKey, anObject$9(target), targetKey); } }); // TODO: Remove from `core-js@4` var $$Y = _export; var ReflectMetadataModule$3 = reflectMetadata; var anObject$8 = anObject$1f; var ordinaryOwnMetadataKeys = ReflectMetadataModule$3.keys; var toMetadataKey$3 = ReflectMetadataModule$3.toKey; // `Reflect.getOwnMetadataKeys` method // https://github.com/rbuckton/reflect-metadata $$Y({ target: 'Reflect', stat: true }, { getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { var targetKey = arguments.length < 2 ? undefined : toMetadataKey$3(arguments[1]); return ordinaryOwnMetadataKeys(anObject$8(target), targetKey); } }); // TODO: Remove from `core-js@4` var $$X = _export; var ReflectMetadataModule$2 = reflectMetadata; var anObject$7 = anObject$1f; var getPrototypeOf = objectGetPrototypeOf$2; var ordinaryHasOwnMetadata$1 = ReflectMetadataModule$2.has; var toMetadataKey$2 = ReflectMetadataModule$2.toKey; var ordinaryHasMetadata = function (MetadataKey, O, P) { var hasOwn = ordinaryHasOwnMetadata$1(MetadataKey, O, P); if (hasOwn) return true; var parent = getPrototypeOf(O); return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; }; // `Reflect.hasMetadata` method // https://github.com/rbuckton/reflect-metadata $$X({ target: 'Reflect', stat: true }, { hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$2(arguments[2]); return ordinaryHasMetadata(metadataKey, anObject$7(target), targetKey); } }); // TODO: Remove from `core-js@4` var $$W = _export; var ReflectMetadataModule$1 = reflectMetadata; var anObject$6 = anObject$1f; var ordinaryHasOwnMetadata = ReflectMetadataModule$1.has; var toMetadataKey$1 = ReflectMetadataModule$1.toKey; // `Reflect.hasOwnMetadata` method // https://github.com/rbuckton/reflect-metadata $$W({ target: 'Reflect', stat: true }, { hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$1(arguments[2]); return ordinaryHasOwnMetadata(metadataKey, anObject$6(target), targetKey); } }); var $$V = _export; var ReflectMetadataModule = reflectMetadata; var anObject$5 = anObject$1f; var toMetadataKey = ReflectMetadataModule.toKey; var ordinaryDefineOwnMetadata = ReflectMetadataModule.set; // `Reflect.metadata` method // https://github.com/rbuckton/reflect-metadata $$V({ target: 'Reflect', stat: true }, { metadata: function metadata(metadataKey, metadataValue) { return function decorator(target, key) { ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject$5(target), toMetadataKey(key)); }; } }); var uncurryThis$j = functionUncurryThis; // eslint-disable-next-line es/no-set -- safe var SetPrototype$1 = Set.prototype; var setHelpers = { // eslint-disable-next-line es/no-set -- safe Set: Set, add: uncurryThis$j(SetPrototype$1.add), has: uncurryThis$j(SetPrototype$1.has), remove: uncurryThis$j(SetPrototype$1['delete']), proto: SetPrototype$1 }; var has$8 = setHelpers.has; // Perform ? RequireInternalSlot(M, [[SetData]]) var aSet$g = function (it) { has$8(it); return it; }; var $$U = _export; var aSet$f = aSet$g; var add$7 = setHelpers.add; // `Set.prototype.addAll` method // https://github.com/tc39/proposal-collection-methods $$U({ target: 'Set', proto: true, real: true, forced: true }, { addAll: function addAll(/* ...elements */) { var set = aSet$f(this); for (var k = 0, len = arguments.length; k < len; k++) { add$7(set, arguments[k]); } return set; } }); var $$T = _export; var aSet$e = aSet$g; var remove$4 = setHelpers.remove; // `Set.prototype.deleteAll` method // https://github.com/tc39/proposal-collection-methods $$T({ target: 'Set', proto: true, real: true, forced: true }, { deleteAll: function deleteAll(/* ...elements */) { var collection = aSet$e(this); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = remove$4(collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; } }); var uncurryThis$i = functionUncurryThis; var iterateSimple$6 = iterateSimple$8; var SetHelpers$8 = setHelpers; var Set$7 = SetHelpers$8.Set; var SetPrototype = SetHelpers$8.proto; var forEach$3 = uncurryThis$i(SetPrototype.forEach); var keys = uncurryThis$i(SetPrototype.keys); var next = keys(new Set$7()).next; var setIterate = function (set, fn, interruptible) { return interruptible ? iterateSimple$6({ iterator: keys(set), next: next }, fn) : forEach$3(set, fn); }; var SetHelpers$7 = setHelpers; var iterate$9 = setIterate; var Set$6 = SetHelpers$7.Set; var add$6 = SetHelpers$7.add; var setClone = function (set) { var result = new Set$6(); iterate$9(set, function (it) { add$6(result, it); }); return result; }; var uncurryThisAccessor = functionUncurryThisAccessor; var SetHelpers$6 = setHelpers; var setSize = uncurryThisAccessor(SetHelpers$6.proto, 'size', 'get') || function (set) { return set.size; }; var aCallable$2 = aCallable$N; var anObject$4 = anObject$1f; var call$b = functionCall; var toIntegerOrInfinity$2 = toIntegerOrInfinity$p; var getIteratorDirect = getIteratorDirect$o; var INVALID_SIZE = 'Invalid size'; var $RangeError$1 = RangeError; var $TypeError$4 = TypeError; var max$1 = Math.max; var SetRecord = function (set, size, has, keys) { this.set = set; this.size = size; this.has = has; this.keys = keys; }; SetRecord.prototype = { getIterator: function () { return getIteratorDirect(anObject$4(call$b(this.keys, this.set))); }, includes: function (it) { return call$b(this.has, this.set, it); } }; // `GetSetRecord` abstract operation // https://tc39.es/proposal-set-methods/#sec-getsetrecord var getSetRecord$7 = function (obj) { anObject$4(obj); var numSize = +obj.size; // NOTE: If size is undefined, then numSize will be NaN // eslint-disable-next-line no-self-compare -- NaN check if (numSize !== numSize) throw $TypeError$4(INVALID_SIZE); var intSize = toIntegerOrInfinity$2(numSize); if (intSize < 0) throw $RangeError$1(INVALID_SIZE); return new SetRecord( obj, max$1(intSize, 0), aCallable$2(obj.has), aCallable$2(obj.keys) ); }; var aSet$d = aSet$g; var SetHelpers$5 = setHelpers; var clone$2 = setClone; var size$4 = setSize; var getSetRecord$6 = getSetRecord$7; var iterateSet$2 = setIterate; var iterateSimple$5 = iterateSimple$8; var has$7 = SetHelpers$5.has; var remove$3 = SetHelpers$5.remove; // `Set.prototype.difference` method // https://github.com/tc39/proposal-set-methods var setDifference = function difference(other) { var O = aSet$d(this); var otherRec = getSetRecord$6(other); var result = clone$2(O); if (size$4(O) <= otherRec.size) iterateSet$2(O, function (e) { if (otherRec.includes(e)) remove$3(result, e); }); else iterateSimple$5(otherRec.getIterator(), function (e) { if (has$7(O, e)) remove$3(result, e); }); return result; }; var getBuiltIn$c = getBuiltIn$M; var createSetLike = function (size) { return { size: size, has: function () { return false; }, keys: function () { return { next: function () { return { done: true }; } }; } }; }; var setMethodAcceptSetLike$7 = function (name) { var Set = getBuiltIn$c('Set'); try { new Set()[name](createSetLike(0)); try { // late spec change, early WebKit ~ Safari 17.0 beta implementation does not pass it // https://github.com/tc39/proposal-set-methods/pull/88 new Set()[name](createSetLike(-1)); return false; } catch (error2) { return true; } } catch (error) { return false; } }; var $$S = _export; var difference = setDifference; var setMethodAcceptSetLike$6 = setMethodAcceptSetLike$7; // `Set.prototype.difference` method // https://github.com/tc39/proposal-set-methods $$S({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$6('difference') }, { difference: difference }); var classof$2 = classof$q; var hasOwn$6 = hasOwnProperty_1; var isNullOrUndefined$1 = isNullOrUndefined$k; var wellKnownSymbol$4 = wellKnownSymbol$T; var Iterators = iterators; var ITERATOR$3 = wellKnownSymbol$4('iterator'); var $Object = Object; var isIterable$1 = function (it) { if (isNullOrUndefined$1(it)) return false; var O = $Object(it); return O[ITERATOR$3] !== undefined || '@@iterator' in O || hasOwn$6(Iterators, classof$2(O)); }; var getBuiltIn$b = getBuiltIn$M; var isCallable$4 = isCallable$K; var isIterable = isIterable$1; var isObject$2 = isObject$K; var Set$5 = getBuiltIn$b('Set'); var isSetLike = function (it) { return isObject$2(it) && typeof it.size == 'number' && isCallable$4(it.has) && isCallable$4(it.keys); }; // fallback old -> new set methods proposal arguments var toSetLike$7 = function (it) { if (isSetLike(it)) return it; return isIterable(it) ? new Set$5(it) : it; }; var $$R = _export; var call$a = functionCall; var toSetLike$6 = toSetLike$7; var $difference = setDifference; // `Set.prototype.difference` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $$R({ target: 'Set', proto: true, real: true, forced: true }, { difference: function difference(other) { return call$a($difference, this, toSetLike$6(other)); } }); var $$Q = _export; var bind$6 = functionBindContext; var aSet$c = aSet$g; var iterate$8 = setIterate; // `Set.prototype.every` method // https://github.com/tc39/proposal-collection-methods $$Q({ target: 'Set', proto: true, real: true, forced: true }, { every: function every(callbackfn /* , thisArg */) { var set = aSet$c(this); var boundFunction = bind$6(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate$8(set, function (value) { if (!boundFunction(value, value, set)) return false; }, true) !== false; } }); var $$P = _export; var bind$5 = functionBindContext; var aSet$b = aSet$g; var SetHelpers$4 = setHelpers; var iterate$7 = setIterate; var Set$4 = SetHelpers$4.Set; var add$5 = SetHelpers$4.add; // `Set.prototype.filter` method // https://github.com/tc39/proposal-collection-methods $$P({ target: 'Set', proto: true, real: true, forced: true }, { filter: function filter(callbackfn /* , thisArg */) { var set = aSet$b(this); var boundFunction = bind$5(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newSet = new Set$4(); iterate$7(set, function (value) { if (boundFunction(value, value, set)) add$5(newSet, value); }); return newSet; } }); var $$O = _export; var bind$4 = functionBindContext; var aSet$a = aSet$g; var iterate$6 = setIterate; // `Set.prototype.find` method // https://github.com/tc39/proposal-collection-methods $$O({ target: 'Set', proto: true, real: true, forced: true }, { find: function find(callbackfn /* , thisArg */) { var set = aSet$a(this); var boundFunction = bind$4(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var result = iterate$6(set, function (value) { if (boundFunction(value, value, set)) return { value: value }; }, true); return result && result.value; } }); var $$N = _export; var from$2 = collectionFrom; // `Set.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from $$N({ target: 'Set', stat: true, forced: true }, { from: from$2 }); var aSet$9 = aSet$g; var SetHelpers$3 = setHelpers; var size$3 = setSize; var getSetRecord$5 = getSetRecord$7; var iterateSet$1 = setIterate; var iterateSimple$4 = iterateSimple$8; var Set$3 = SetHelpers$3.Set; var add$4 = SetHelpers$3.add; var has$6 = SetHelpers$3.has; // `Set.prototype.intersection` method // https://github.com/tc39/proposal-set-methods var setIntersection = function intersection(other) { var O = aSet$9(this); var otherRec = getSetRecord$5(other); var result = new Set$3(); if (size$3(O) > otherRec.size) { iterateSimple$4(otherRec.getIterator(), function (e) { if (has$6(O, e)) add$4(result, e); }); } else { iterateSet$1(O, function (e) { if (otherRec.includes(e)) add$4(result, e); }); } return result; }; var $$M = _export; var fails$7 = fails$1u; var intersection = setIntersection; var setMethodAcceptSetLike$5 = setMethodAcceptSetLike$7; var INCORRECT = !setMethodAcceptSetLike$5('intersection') || fails$7(function () { // eslint-disable-next-line es/no-array-from, es/no-set -- testing return Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2]))) !== '3,2'; }); // `Set.prototype.intersection` method // https://github.com/tc39/proposal-set-methods $$M({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { intersection: intersection }); var $$L = _export; var call$9 = functionCall; var toSetLike$5 = toSetLike$7; var $intersection = setIntersection; // `Set.prototype.intersection` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $$L({ target: 'Set', proto: true, real: true, forced: true }, { intersection: function intersection(other) { return call$9($intersection, this, toSetLike$5(other)); } }); var aSet$8 = aSet$g; var has$5 = setHelpers.has; var size$2 = setSize; var getSetRecord$4 = getSetRecord$7; var iterateSet = setIterate; var iterateSimple$3 = iterateSimple$8; var iteratorClose$1 = iteratorClose$8; // `Set.prototype.isDisjointFrom` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom var setIsDisjointFrom = function isDisjointFrom(other) { var O = aSet$8(this); var otherRec = getSetRecord$4(other); if (size$2(O) <= otherRec.size) return iterateSet(O, function (e) { if (otherRec.includes(e)) return false; }, true) !== false; var iterator = otherRec.getIterator(); return iterateSimple$3(iterator, function (e) { if (has$5(O, e)) return iteratorClose$1(iterator, 'normal', false); }) !== false; }; var $$K = _export; var isDisjointFrom = setIsDisjointFrom; var setMethodAcceptSetLike$4 = setMethodAcceptSetLike$7; // `Set.prototype.isDisjointFrom` method // https://github.com/tc39/proposal-set-methods $$K({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$4('isDisjointFrom') }, { isDisjointFrom: isDisjointFrom }); var $$J = _export; var call$8 = functionCall; var toSetLike$4 = toSetLike$7; var $isDisjointFrom = setIsDisjointFrom; // `Set.prototype.isDisjointFrom` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $$J({ target: 'Set', proto: true, real: true, forced: true }, { isDisjointFrom: function isDisjointFrom(other) { return call$8($isDisjointFrom, this, toSetLike$4(other)); } }); var aSet$7 = aSet$g; var size$1 = setSize; var iterate$5 = setIterate; var getSetRecord$3 = getSetRecord$7; // `Set.prototype.isSubsetOf` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf var setIsSubsetOf = function isSubsetOf(other) { var O = aSet$7(this); var otherRec = getSetRecord$3(other); if (size$1(O) > otherRec.size) return false; return iterate$5(O, function (e) { if (!otherRec.includes(e)) return false; }, true) !== false; }; var $$I = _export; var isSubsetOf = setIsSubsetOf; var setMethodAcceptSetLike$3 = setMethodAcceptSetLike$7; // `Set.prototype.isSubsetOf` method // https://github.com/tc39/proposal-set-methods $$I({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$3('isSubsetOf') }, { isSubsetOf: isSubsetOf }); var $$H = _export; var call$7 = functionCall; var toSetLike$3 = toSetLike$7; var $isSubsetOf = setIsSubsetOf; // `Set.prototype.isSubsetOf` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $$H({ target: 'Set', proto: true, real: true, forced: true }, { isSubsetOf: function isSubsetOf(other) { return call$7($isSubsetOf, this, toSetLike$3(other)); } }); var aSet$6 = aSet$g; var has$4 = setHelpers.has; var size = setSize; var getSetRecord$2 = getSetRecord$7; var iterateSimple$2 = iterateSimple$8; var iteratorClose = iteratorClose$8; // `Set.prototype.isSupersetOf` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf var setIsSupersetOf = function isSupersetOf(other) { var O = aSet$6(this); var otherRec = getSetRecord$2(other); if (size(O) < otherRec.size) return false; var iterator = otherRec.getIterator(); return iterateSimple$2(iterator, function (e) { if (!has$4(O, e)) return iteratorClose(iterator, 'normal', false); }) !== false; }; var $$G = _export; var isSupersetOf = setIsSupersetOf; var setMethodAcceptSetLike$2 = setMethodAcceptSetLike$7; // `Set.prototype.isSupersetOf` method // https://github.com/tc39/proposal-set-methods $$G({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$2('isSupersetOf') }, { isSupersetOf: isSupersetOf }); var $$F = _export; var call$6 = functionCall; var toSetLike$2 = toSetLike$7; var $isSupersetOf = setIsSupersetOf; // `Set.prototype.isSupersetOf` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $$F({ target: 'Set', proto: true, real: true, forced: true }, { isSupersetOf: function isSupersetOf(other) { return call$6($isSupersetOf, this, toSetLike$2(other)); } }); var $$E = _export; var uncurryThis$h = functionUncurryThis; var aSet$5 = aSet$g; var iterate$4 = setIterate; var toString$8 = toString$I; var arrayJoin = uncurryThis$h([].join); var push$6 = uncurryThis$h([].push); // `Set.prototype.join` method // https://github.com/tc39/proposal-collection-methods $$E({ target: 'Set', proto: true, real: true, forced: true }, { join: function join(separator) { var set = aSet$5(this); var sep = separator === undefined ? ',' : toString$8(separator); var array = []; iterate$4(set, function (value) { push$6(array, value); }); return arrayJoin(array, sep); } }); var $$D = _export; var bind$3 = functionBindContext; var aSet$4 = aSet$g; var SetHelpers$2 = setHelpers; var iterate$3 = setIterate; var Set$2 = SetHelpers$2.Set; var add$3 = SetHelpers$2.add; // `Set.prototype.map` method // https://github.com/tc39/proposal-collection-methods $$D({ target: 'Set', proto: true, real: true, forced: true }, { map: function map(callbackfn /* , thisArg */) { var set = aSet$4(this); var boundFunction = bind$3(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newSet = new Set$2(); iterate$3(set, function (value) { add$3(newSet, boundFunction(value, value, set)); }); return newSet; } }); var $$C = _export; var of$2 = collectionOf; // `Set.of` method // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of $$C({ target: 'Set', stat: true, forced: true }, { of: of$2 }); var $$B = _export; var aCallable$1 = aCallable$N; var aSet$3 = aSet$g; var iterate$2 = setIterate; var $TypeError$3 = TypeError; // `Set.prototype.reduce` method // https://github.com/tc39/proposal-collection-methods $$B({ target: 'Set', proto: true, real: true, forced: true }, { reduce: function reduce(callbackfn /* , initialValue */) { var set = aSet$3(this); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable$1(callbackfn); iterate$2(set, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, value, set); } }); if (noInitial) throw $TypeError$3('Reduce of empty set with no initial value'); return accumulator; } }); var $$A = _export; var bind$2 = functionBindContext; var aSet$2 = aSet$g; var iterate$1 = setIterate; // `Set.prototype.some` method // https://github.com/tc39/proposal-collection-methods $$A({ target: 'Set', proto: true, real: true, forced: true }, { some: function some(callbackfn /* , thisArg */) { var set = aSet$2(this); var boundFunction = bind$2(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate$1(set, function (value) { if (boundFunction(value, value, set)) return true; }, true) === true; } }); var aSet$1 = aSet$g; var SetHelpers$1 = setHelpers; var clone$1 = setClone; var getSetRecord$1 = getSetRecord$7; var iterateSimple$1 = iterateSimple$8; var add$2 = SetHelpers$1.add; var has$3 = SetHelpers$1.has; var remove$2 = SetHelpers$1.remove; // `Set.prototype.symmetricDifference` method // https://github.com/tc39/proposal-set-methods var setSymmetricDifference = function symmetricDifference(other) { var O = aSet$1(this); var keysIter = getSetRecord$1(other).getIterator(); var result = clone$1(O); iterateSimple$1(keysIter, function (e) { if (has$3(O, e)) remove$2(result, e); else add$2(result, e); }); return result; }; var $$z = _export; var symmetricDifference = setSymmetricDifference; var setMethodAcceptSetLike$1 = setMethodAcceptSetLike$7; // `Set.prototype.symmetricDifference` method // https://github.com/tc39/proposal-set-methods $$z({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$1('symmetricDifference') }, { symmetricDifference: symmetricDifference }); var $$y = _export; var call$5 = functionCall; var toSetLike$1 = toSetLike$7; var $symmetricDifference = setSymmetricDifference; // `Set.prototype.symmetricDifference` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $$y({ target: 'Set', proto: true, real: true, forced: true }, { symmetricDifference: function symmetricDifference(other) { return call$5($symmetricDifference, this, toSetLike$1(other)); } }); var aSet = aSet$g; var add$1 = setHelpers.add; var clone = setClone; var getSetRecord = getSetRecord$7; var iterateSimple = iterateSimple$8; // `Set.prototype.union` method // https://github.com/tc39/proposal-set-methods var setUnion = function union(other) { var O = aSet(this); var keysIter = getSetRecord(other).getIterator(); var result = clone(O); iterateSimple(keysIter, function (it) { add$1(result, it); }); return result; }; var $$x = _export; var union = setUnion; var setMethodAcceptSetLike = setMethodAcceptSetLike$7; // `Set.prototype.union` method // https://github.com/tc39/proposal-set-methods $$x({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, { union: union }); var $$w = _export; var call$4 = functionCall; var toSetLike = toSetLike$7; var $union = setUnion; // `Set.prototype.union` method // https://github.com/tc39/proposal-set-methods // TODO: Obsolete version, remove from `core-js@4` $$w({ target: 'Set', proto: true, real: true, forced: true }, { union: function union(other) { return call$4($union, this, toSetLike(other)); } }); // TODO: Remove from `core-js@4` var $$v = _export; var charAt$7 = stringMultibyte.charAt; var requireObjectCoercible$1 = requireObjectCoercible$p; var toIntegerOrInfinity$1 = toIntegerOrInfinity$p; var toString$7 = toString$I; // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at $$v({ target: 'String', proto: true, forced: true }, { at: function at(index) { var S = toString$7(requireObjectCoercible$1(this)); var len = S.length; var relativeIndex = toIntegerOrInfinity$1(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; return (k < 0 || k >= len) ? undefined : charAt$7(S, k); } }); var uncurryThis$g = functionUncurryThis; var toIndexedObject = toIndexedObject$k; var toString$6 = toString$I; var lengthOfArrayLike$3 = lengthOfArrayLike$C; var $TypeError$2 = TypeError; var push$5 = uncurryThis$g([].push); var join$3 = uncurryThis$g([].join); // `String.cooked` method // https://tc39.es/proposal-string-cooked/ var stringCooked = function cooked(template /* , ...substitutions */) { var cookedTemplate = toIndexedObject(template); var literalSegments = lengthOfArrayLike$3(cookedTemplate); if (!literalSegments) return ''; var argumentsLength = arguments.length; var elements = []; var i = 0; while (true) { var nextVal = cookedTemplate[i++]; if (nextVal === undefined) throw $TypeError$2('Incorrect template'); push$5(elements, toString$6(nextVal)); if (i === literalSegments) return join$3(elements, ''); if (i < argumentsLength) push$5(elements, toString$6(arguments[i])); } }; var $$u = _export; var cooked$1 = stringCooked; // `String.cooked` method // https://github.com/tc39/proposal-string-cooked $$u({ target: 'String', stat: true, forced: true }, { cooked: cooked$1 }); var $$t = _export; var createIteratorConstructor$1 = iteratorCreateConstructor; var createIterResultObject = createIterResultObject$g; var requireObjectCoercible = requireObjectCoercible$p; var toString$5 = toString$I; var InternalStateModule$3 = internalState; var StringMultibyteModule = stringMultibyte; var codeAt$1 = StringMultibyteModule.codeAt; var charAt$6 = StringMultibyteModule.charAt; var STRING_ITERATOR = 'String Iterator'; var setInternalState$3 = InternalStateModule$3.set; var getInternalState$1 = InternalStateModule$3.getterFor(STRING_ITERATOR); // TODO: unify with String#@@iterator var $StringIterator = createIteratorConstructor$1(function StringIterator(string) { setInternalState$3(this, { type: STRING_ITERATOR, string: string, index: 0 }); }, 'String', function next() { var state = getInternalState$1(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return createIterResultObject(undefined, true); point = charAt$6(string, index); state.index += point.length; return createIterResultObject({ codePoint: codeAt$1(point, 0), position: index }, false); }); // `String.prototype.codePoints` method // https://github.com/tc39/proposal-string-prototype-codepoints $$t({ target: 'String', proto: true, forced: true }, { codePoints: function codePoints() { return new $StringIterator(toString$5(requireObjectCoercible(this))); } }); // adapted from https://github.com/jridgewell/string-dedent var getBuiltIn$a = getBuiltIn$M; var uncurryThis$f = functionUncurryThis; var fromCharCode$2 = String.fromCharCode; var fromCodePoint = getBuiltIn$a('String', 'fromCodePoint'); var charAt$5 = uncurryThis$f(''.charAt); var charCodeAt$2 = uncurryThis$f(''.charCodeAt); var stringIndexOf = uncurryThis$f(''.indexOf); var stringSlice$3 = uncurryThis$f(''.slice); var ZERO_CODE = 48; var NINE_CODE = 57; var LOWER_A_CODE = 97; var LOWER_F_CODE = 102; var UPPER_A_CODE = 65; var UPPER_F_CODE = 70; var isDigit = function (str, index) { var c = charCodeAt$2(str, index); return c >= ZERO_CODE && c <= NINE_CODE; }; var parseHex = function (str, index, end) { if (end >= str.length) return -1; var n = 0; for (; index < end; index++) { var c = hexToInt(charCodeAt$2(str, index)); if (c === -1) return -1; n = n * 16 + c; } return n; }; var hexToInt = function (c) { if (c >= ZERO_CODE && c <= NINE_CODE) return c - ZERO_CODE; if (c >= LOWER_A_CODE && c <= LOWER_F_CODE) return c - LOWER_A_CODE + 10; if (c >= UPPER_A_CODE && c <= UPPER_F_CODE) return c - UPPER_A_CODE + 10; return -1; }; var stringParse = function (raw) { var out = ''; var start = 0; // We need to find every backslash escape sequence, and cook the escape into a real char. var i = 0; var n; while ((i = stringIndexOf(raw, '\\', i)) > -1) { out += stringSlice$3(raw, start, i); // If the backslash is the last char of the string, then it was an invalid sequence. // This can't actually happen in a tagged template literal, but could happen if you manually // invoked the tag with an array. if (++i === raw.length) return; var next = charAt$5(raw, i++); switch (next) { // Escaped control codes need to be individually processed. case 'b': out += '\b'; break; case 't': out += '\t'; break; case 'n': out += '\n'; break; case 'v': out += '\v'; break; case 'f': out += '\f'; break; case 'r': out += '\r'; break; // Escaped line terminators just skip the char. case '\r': // Treat `\r\n` as a single terminator. if (i < raw.length && charAt$5(raw, i) === '\n') ++i; // break omitted case '\n': case '\u2028': case '\u2029': break; // `\0` is a null control char, but `\0` followed by another digit is an illegal octal escape. case '0': if (isDigit(raw, i)) return; out += '\0'; break; // Hex escapes must contain 2 hex chars. case 'x': n = parseHex(raw, i, i + 2); if (n === -1) return; i += 2; out += fromCharCode$2(n); break; // Unicode escapes contain either 4 chars, or an unlimited number between `{` and `}`. // The hex value must not overflow 0x10FFFF. case 'u': if (i < raw.length && charAt$5(raw, i) === '{') { var end = stringIndexOf(raw, '}', ++i); if (end === -1) return; n = parseHex(raw, i, end); i = end + 1; } else { n = parseHex(raw, i, i + 4); i += 4; } if (n === -1 || n > 0x10FFFF) return; out += fromCodePoint(n); break; default: if (isDigit(next, 0)) return; out += next; } start = i; } return out + stringSlice$3(raw, start); }; var FREEZING = freezing; var $$s = _export; var shared$1 = sharedExports; var getBuiltIn$9 = getBuiltIn$M; var makeBuiltIn = makeBuiltInExports; var uncurryThis$e = functionUncurryThis; var apply$1 = functionApply$1; var anObject$3 = anObject$1f; var toObject = toObject$D; var isCallable$3 = isCallable$K; var lengthOfArrayLike$2 = lengthOfArrayLike$C; var defineProperty$5 = objectDefineProperty.f; var createArrayFromList = arraySliceSimple; var cooked = stringCooked; var parse = stringParse; var whitespaces$1 = whitespaces$6; var WeakMap$1 = getBuiltIn$9('WeakMap'); var globalDedentRegistry = shared$1('GlobalDedentRegistry', new WeakMap$1()); /* eslint-disable no-self-assign -- prototype methods protection */ globalDedentRegistry.has = globalDedentRegistry.has; globalDedentRegistry.get = globalDedentRegistry.get; globalDedentRegistry.set = globalDedentRegistry.set; /* eslint-enable no-self-assign -- prototype methods protection */ var $Array = Array; var $TypeError$1 = TypeError; // eslint-disable-next-line es/no-object-freeze -- safe var freeze = Object.freeze || Object; // eslint-disable-next-line es/no-object-isfrozen -- safe var isFrozen = Object.isFrozen; var min$1 = Math.min; var charAt$4 = uncurryThis$e(''.charAt); var stringSlice$2 = uncurryThis$e(''.slice); var split$3 = uncurryThis$e(''.split); var exec$3 = uncurryThis$e(/./.exec); var NEW_LINE = /([\n\u2028\u2029]|\r\n?)/g; var LEADING_WHITESPACE = RegExp('^[' + whitespaces$1 + ']*'); var NON_WHITESPACE = RegExp('[^' + whitespaces$1 + ']'); var INVALID_TAG = 'Invalid tag'; var INVALID_OPENING_LINE = 'Invalid opening line'; var INVALID_CLOSING_LINE = 'Invalid closing line'; var dedentTemplateStringsArray = function (template) { var rawInput = template.raw; // https://github.com/tc39/proposal-string-dedent/issues/75 if (FREEZING && !isFrozen(rawInput)) throw $TypeError$1('Raw template should be frozen'); if (globalDedentRegistry.has(rawInput)) return globalDedentRegistry.get(rawInput); var raw = dedentStringsArray(rawInput); var cookedArr = cookStrings(raw); defineProperty$5(cookedArr, 'raw', { value: freeze(raw) }); freeze(cookedArr); globalDedentRegistry.set(rawInput, cookedArr); return cookedArr; }; var dedentStringsArray = function (template) { var t = toObject(template); var length = lengthOfArrayLike$2(t); var blocks = $Array(length); var dedented = $Array(length); var i = 0; var lines, common, quasi, k; if (!length) throw $TypeError$1(INVALID_TAG); for (; i < length; i++) { var element = t[i]; if (typeof element == 'string') blocks[i] = split$3(element, NEW_LINE); else throw $TypeError$1(INVALID_TAG); } for (i = 0; i < length; i++) { var lastSplit = i + 1 === length; lines = blocks[i]; if (i === 0) { if (lines.length === 1 || lines[0].length > 0) { throw $TypeError$1(INVALID_OPENING_LINE); } lines[1] = ''; } if (lastSplit) { if (lines.length === 1 || exec$3(NON_WHITESPACE, lines[lines.length - 1])) { throw $TypeError$1(INVALID_CLOSING_LINE); } lines[lines.length - 2] = ''; lines[lines.length - 1] = ''; } for (var j = 2; j < lines.length; j += 2) { var text = lines[j]; var lineContainsTemplateExpression = j + 1 === lines.length && !lastSplit; var leading = exec$3(LEADING_WHITESPACE, text)[0]; if (!lineContainsTemplateExpression && leading.length === text.length) { lines[j] = ''; continue; } common = commonLeadingIndentation(leading, common); } } var count = common ? common.length : 0; for (i = 0; i < length; i++) { lines = blocks[i]; quasi = lines[0]; k = 1; for (; k < lines.length; k += 2) { quasi += lines[k] + stringSlice$2(lines[k + 1], count); } dedented[i] = quasi; } return dedented; }; var commonLeadingIndentation = function (a, b) { if (b === undefined || a === b) return a; var i = 0; for (var len = min$1(a.length, b.length); i < len; i++) { if (charAt$4(a, i) !== charAt$4(b, i)) break; } return stringSlice$2(a, 0, i); }; var cookStrings = function (raw) { var i = 0; var length = raw.length; var result = $Array(length); for (; i < length; i++) { result[i] = parse(raw[i]); } return result; }; var makeDedentTag = function (tag) { return makeBuiltIn(function (template /* , ...substitutions */) { var args = createArrayFromList(arguments); args[0] = dedentTemplateStringsArray(anObject$3(template)); return apply$1(tag, this, args); }, ''); }; var cookedDedentTag = makeDedentTag(cooked); // `String.dedent` method // https://github.com/tc39/proposal-string-dedent $$s({ target: 'String', stat: true, forced: true }, { dedent: function dedent(templateOrFn /* , ...substitutions */) { anObject$3(templateOrFn); if (isCallable$3(templateOrFn)) return makeDedentTag(templateOrFn); return apply$1(cookedDedentTag, this, arguments); } }); var global$h = global$16; var defineWellKnownSymbol$7 = wellKnownSymbolDefine; var defineProperty$4 = objectDefineProperty.f; var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f; var Symbol$4 = global$h.Symbol; // `Symbol.asyncDispose` well-known symbol // https://github.com/tc39/proposal-async-explicit-resource-management defineWellKnownSymbol$7('asyncDispose'); if (Symbol$4) { var descriptor$4 = getOwnPropertyDescriptor$2(Symbol$4, 'asyncDispose'); // workaround of NodeJS 20.4 bug // https://github.com/nodejs/node/issues/48699 // and incorrect descriptor from some transpilers and userland helpers if (descriptor$4.enumerable && descriptor$4.configurable && descriptor$4.writable) { defineProperty$4(Symbol$4, 'asyncDispose', { value: descriptor$4.value, enumerable: false, configurable: false, writable: false }); } } var global$g = global$16; var defineWellKnownSymbol$6 = wellKnownSymbolDefine; var defineProperty$3 = objectDefineProperty.f; var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; var Symbol$3 = global$g.Symbol; // `Symbol.dispose` well-known symbol // https://github.com/tc39/proposal-explicit-resource-management defineWellKnownSymbol$6('dispose'); if (Symbol$3) { var descriptor$3 = getOwnPropertyDescriptor$1(Symbol$3, 'dispose'); // workaround of NodeJS 20.4 bug // https://github.com/nodejs/node/issues/48699 // and incorrect descriptor from some transpilers and userland helpers if (descriptor$3.enumerable && descriptor$3.configurable && descriptor$3.writable) { defineProperty$3(Symbol$3, 'dispose', { value: descriptor$3.value, enumerable: false, configurable: false, writable: false }); } } var getBuiltIn$8 = getBuiltIn$M; var uncurryThis$d = functionUncurryThis; var Symbol$2 = getBuiltIn$8('Symbol'); var keyFor = Symbol$2.keyFor; var thisSymbolValue$1 = uncurryThis$d(Symbol$2.prototype.valueOf); // `Symbol.isRegisteredSymbol` method // https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol var symbolIsRegistered = Symbol$2.isRegisteredSymbol || function isRegisteredSymbol(value) { try { return keyFor(thisSymbolValue$1(value)) !== undefined; } catch (error) { return false; } }; var $$r = _export; var isRegisteredSymbol$1 = symbolIsRegistered; // `Symbol.isRegisteredSymbol` method // https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol $$r({ target: 'Symbol', stat: true }, { isRegisteredSymbol: isRegisteredSymbol$1 }); var $$q = _export; var isRegisteredSymbol = symbolIsRegistered; // `Symbol.isRegistered` method // obsolete version of https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol $$q({ target: 'Symbol', stat: true, name: 'isRegisteredSymbol' }, { isRegistered: isRegisteredSymbol }); var shared = sharedExports; var getBuiltIn$7 = getBuiltIn$M; var uncurryThis$c = functionUncurryThis; var isSymbol$1 = isSymbol$8; var wellKnownSymbol$3 = wellKnownSymbol$T; var Symbol$1 = getBuiltIn$7('Symbol'); var $isWellKnownSymbol = Symbol$1.isWellKnownSymbol; var getOwnPropertyNames = getBuiltIn$7('Object', 'getOwnPropertyNames'); var thisSymbolValue = uncurryThis$c(Symbol$1.prototype.valueOf); var WellKnownSymbolsStore = shared('wks'); for (var i = 0, symbolKeys = getOwnPropertyNames(Symbol$1), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) { // some old engines throws on access to some keys like `arguments` or `caller` try { var symbolKey = symbolKeys[i]; if (isSymbol$1(Symbol$1[symbolKey])) wellKnownSymbol$3(symbolKey); } catch (error) { /* empty */ } } // `Symbol.isWellKnownSymbol` method // https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected var symbolIsWellKnown = function isWellKnownSymbol(value) { if ($isWellKnownSymbol && $isWellKnownSymbol(value)) return true; try { var symbol = thisSymbolValue(value); for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) { // eslint-disable-next-line eqeqeq -- polyfilled symbols case if (WellKnownSymbolsStore[keys[j]] == symbol) return true; } } catch (error) { /* empty */ } return false; }; var $$p = _export; var isWellKnownSymbol$1 = symbolIsWellKnown; // `Symbol.isWellKnownSymbol` method // https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected $$p({ target: 'Symbol', stat: true, forced: true }, { isWellKnownSymbol: isWellKnownSymbol$1 }); var $$o = _export; var isWellKnownSymbol = symbolIsWellKnown; // `Symbol.isWellKnown` method // obsolete version of https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected $$o({ target: 'Symbol', stat: true, name: 'isWellKnownSymbol', forced: true }, { isWellKnown: isWellKnownSymbol }); var defineWellKnownSymbol$5 = wellKnownSymbolDefine; // `Symbol.matcher` well-known symbol // https://github.com/tc39/proposal-pattern-matching defineWellKnownSymbol$5('matcher'); // TODO: Remove from `core-js@4` var defineWellKnownSymbol$4 = wellKnownSymbolDefine; // `Symbol.metadata` well-known symbol // https://github.com/tc39/proposal-decorators defineWellKnownSymbol$4('metadata'); var defineWellKnownSymbol$3 = wellKnownSymbolDefine; // `Symbol.metadataKey` well-known symbol // https://github.com/tc39/proposal-decorator-metadata defineWellKnownSymbol$3('metadataKey'); var defineWellKnownSymbol$2 = wellKnownSymbolDefine; // `Symbol.observable` well-known symbol // https://github.com/tc39/proposal-observable defineWellKnownSymbol$2('observable'); // TODO: remove from `core-js@4` var defineWellKnownSymbol$1 = wellKnownSymbolDefine; // `Symbol.patternMatch` well-known symbol // https://github.com/tc39/proposal-pattern-matching defineWellKnownSymbol$1('patternMatch'); // TODO: remove from `core-js@4` var defineWellKnownSymbol = wellKnownSymbolDefine; defineWellKnownSymbol('replaceAll'); // TODO: Remove from `core-js@4` var getBuiltIn$6 = getBuiltIn$M; var aConstructor = aConstructor$5; var arrayFromAsync = arrayFromAsync$1; var ArrayBufferViewCore$5 = arrayBufferViewCore; var arrayFromConstructorAndList$1 = arrayFromConstructorAndList$6; var aTypedArrayConstructor = ArrayBufferViewCore$5.aTypedArrayConstructor; var exportTypedArrayStaticMethod = ArrayBufferViewCore$5.exportTypedArrayStaticMethod; // `%TypedArray%.fromAsync` method // https://github.com/tc39/proposal-array-from-async exportTypedArrayStaticMethod('fromAsync', function fromAsync(asyncItems /* , mapfn = undefined, thisArg = undefined */) { var C = this; var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var thisArg = argumentsLength > 2 ? arguments[2] : undefined; return new (getBuiltIn$6('Promise'))(function (resolve) { aConstructor(C); resolve(arrayFromAsync(asyncItems, mapfn, thisArg)); }).then(function (list) { return arrayFromConstructorAndList$1(aTypedArrayConstructor(C), list); }); }, true); // TODO: Remove from `core-js@4` var ArrayBufferViewCore$4 = arrayBufferViewCore; var $filterReject$1 = arrayIteration.filterReject; var fromSpeciesAndList$1 = typedArrayFromSpeciesAndList; var aTypedArray$4 = ArrayBufferViewCore$4.aTypedArray; var exportTypedArrayMethod$4 = ArrayBufferViewCore$4.exportTypedArrayMethod; // `%TypedArray%.prototype.filterOut` method // https://github.com/tc39/proposal-array-filtering exportTypedArrayMethod$4('filterOut', function filterOut(callbackfn /* , thisArg */) { var list = $filterReject$1(aTypedArray$4(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); return fromSpeciesAndList$1(this, list); }, true); var ArrayBufferViewCore$3 = arrayBufferViewCore; var $filterReject = arrayIteration.filterReject; var fromSpeciesAndList = typedArrayFromSpeciesAndList; var aTypedArray$3 = ArrayBufferViewCore$3.aTypedArray; var exportTypedArrayMethod$3 = ArrayBufferViewCore$3.exportTypedArrayMethod; // `%TypedArray%.prototype.filterReject` method // https://github.com/tc39/proposal-array-filtering exportTypedArrayMethod$3('filterReject', function filterReject(callbackfn /* , thisArg */) { var list = $filterReject(aTypedArray$3(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); return fromSpeciesAndList(this, list); }, true); // TODO: Remove from `core-js@4` var ArrayBufferViewCore$2 = arrayBufferViewCore; var $group = arrayGroup; var typedArraySpeciesConstructor = typedArraySpeciesConstructor$5; var aTypedArray$2 = ArrayBufferViewCore$2.aTypedArray; var exportTypedArrayMethod$2 = ArrayBufferViewCore$2.exportTypedArrayMethod; // `%TypedArray%.prototype.groupBy` method // https://github.com/tc39/proposal-array-grouping exportTypedArrayMethod$2('groupBy', function groupBy(callbackfn /* , thisArg */) { var thisArg = arguments.length > 1 ? arguments[1] : undefined; return $group(aTypedArray$2(this), callbackfn, thisArg, typedArraySpeciesConstructor); }, true); // TODO: Remove from `core-js@4` var ArrayBufferViewCore$1 = arrayBufferViewCore; var lengthOfArrayLike$1 = lengthOfArrayLike$C; var isBigIntArray = isBigIntArray$3; var toAbsoluteIndex = toAbsoluteIndex$b; var toBigInt = toBigInt$4; var toIntegerOrInfinity = toIntegerOrInfinity$p; var fails$6 = fails$1u; var aTypedArray$1 = ArrayBufferViewCore$1.aTypedArray; var getTypedArrayConstructor$1 = ArrayBufferViewCore$1.getTypedArrayConstructor; var exportTypedArrayMethod$1 = ArrayBufferViewCore$1.exportTypedArrayMethod; var max = Math.max; var min = Math.min; // some early implementations, like WebKit, does not follow the final semantic var PROPER_ORDER = !fails$6(function () { // eslint-disable-next-line es/no-typed-arrays -- required for testing var array = new Int8Array([1]); var spliced = array.toSpliced(1, 0, { valueOf: function () { array[0] = 2; return 3; } }); return spliced[0] !== 2 || spliced[1] !== 3; }); // `%TypedArray%.prototype.toSpliced` method // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSpliced exportTypedArrayMethod$1('toSpliced', function toSpliced(start, deleteCount /* , ...items */) { var O = aTypedArray$1(this); var C = getTypedArrayConstructor$1(O); var len = lengthOfArrayLike$1(O); var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; var k = 0; var insertCount, actualDeleteCount, thisIsBigIntArray, convertedItems, value, newLen, A; if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { insertCount = 0; actualDeleteCount = len - actualStart; } else { actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); insertCount = argumentsLength - 2; if (insertCount) { convertedItems = new C(insertCount); thisIsBigIntArray = isBigIntArray(convertedItems); for (var i = 2; i < argumentsLength; i++) { value = arguments[i]; // FF30- typed arrays doesn't properly convert objects to typed array values convertedItems[i - 2] = thisIsBigIntArray ? toBigInt(value) : +value; } } } newLen = len + insertCount - actualDeleteCount; A = new C(newLen); for (; k < actualStart; k++) A[k] = O[k]; for (; k < actualStart + insertCount; k++) A[k] = convertedItems[k - actualStart]; for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount]; return A; }, !PROPER_ORDER); var uncurryThis$b = functionUncurryThis; var ArrayBufferViewCore = arrayBufferViewCore; var arrayFromConstructorAndList = arrayFromConstructorAndList$6; var $arrayUniqueBy = arrayUniqueBy$2; var aTypedArray = ArrayBufferViewCore.aTypedArray; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var arrayUniqueBy = uncurryThis$b($arrayUniqueBy); // `%TypedArray%.prototype.uniqueBy` method // https://github.com/tc39/proposal-array-unique exportTypedArrayMethod('uniqueBy', function uniqueBy(resolver) { aTypedArray(this); return arrayFromConstructorAndList(getTypedArrayConstructor(this), arrayUniqueBy(this, resolver)); }, true); var uncurryThis$a = functionUncurryThis; // eslint-disable-next-line es/no-weak-map -- safe var WeakMapPrototype = WeakMap.prototype; var weakMapHelpers = { // eslint-disable-next-line es/no-weak-map -- safe WeakMap: WeakMap, set: uncurryThis$a(WeakMapPrototype.set), get: uncurryThis$a(WeakMapPrototype.get), has: uncurryThis$a(WeakMapPrototype.has), remove: uncurryThis$a(WeakMapPrototype['delete']) }; var has$2 = weakMapHelpers.has; // Perform ? RequireInternalSlot(M, [[WeakMapData]]) var aWeakMap$2 = function (it) { has$2(it); return it; }; var $$n = _export; var aWeakMap$1 = aWeakMap$2; var remove$1 = weakMapHelpers.remove; // `WeakMap.prototype.deleteAll` method // https://github.com/tc39/proposal-collection-methods $$n({ target: 'WeakMap', proto: true, real: true, forced: true }, { deleteAll: function deleteAll(/* ...elements */) { var collection = aWeakMap$1(this); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = remove$1(collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; } }); var $$m = _export; var from$1 = collectionFrom; // `WeakMap.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from $$m({ target: 'WeakMap', stat: true, forced: true }, { from: from$1 }); var $$l = _export; var of$1 = collectionOf; // `WeakMap.of` method // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of $$l({ target: 'WeakMap', stat: true, forced: true }, { of: of$1 }); var $$k = _export; var aWeakMap = aWeakMap$2; var WeakMapHelpers = weakMapHelpers; var get = WeakMapHelpers.get; var has$1 = WeakMapHelpers.has; var set = WeakMapHelpers.set; // `WeakMap.prototype.emplace` method // https://github.com/tc39/proposal-upsert $$k({ target: 'WeakMap', proto: true, real: true, forced: true }, { emplace: function emplace(key, handler) { var map = aWeakMap(this); var value, inserted; if (has$1(map, key)) { value = get(map, key); if ('update' in handler) { value = handler.update(value, key, map); set(map, key, value); } return value; } inserted = handler.insert(key, map); set(map, key, inserted); return inserted; } }); // TODO: remove from `core-js@4` var $$j = _export; var upsert = mapUpsert; // `WeakMap.prototype.upsert` method (replaced by `WeakMap.prototype.emplace`) // https://github.com/tc39/proposal-upsert $$j({ target: 'WeakMap', proto: true, real: true, forced: true }, { upsert: upsert }); var uncurryThis$9 = functionUncurryThis; // eslint-disable-next-line es/no-weak-set -- safe var WeakSetPrototype = WeakSet.prototype; var weakSetHelpers = { // eslint-disable-next-line es/no-weak-set -- safe WeakSet: WeakSet, add: uncurryThis$9(WeakSetPrototype.add), has: uncurryThis$9(WeakSetPrototype.has), remove: uncurryThis$9(WeakSetPrototype['delete']) }; var has = weakSetHelpers.has; // Perform ? RequireInternalSlot(M, [[WeakSetData]]) var aWeakSet$2 = function (it) { has(it); return it; }; var $$i = _export; var aWeakSet$1 = aWeakSet$2; var add = weakSetHelpers.add; // `WeakSet.prototype.addAll` method // https://github.com/tc39/proposal-collection-methods $$i({ target: 'WeakSet', proto: true, real: true, forced: true }, { addAll: function addAll(/* ...elements */) { var set = aWeakSet$1(this); for (var k = 0, len = arguments.length; k < len; k++) { add(set, arguments[k]); } return set; } }); var $$h = _export; var aWeakSet = aWeakSet$2; var remove = weakSetHelpers.remove; // `WeakSet.prototype.deleteAll` method // https://github.com/tc39/proposal-collection-methods $$h({ target: 'WeakSet', proto: true, real: true, forced: true }, { deleteAll: function deleteAll(/* ...elements */) { var collection = aWeakSet(this); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = remove(collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; } }); var $$g = _export; var from = collectionFrom; // `WeakSet.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from $$g({ target: 'WeakSet', stat: true, forced: true }, { from: from }); var $$f = _export; var of = collectionOf; // `WeakSet.of` method // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of $$f({ target: 'WeakSet', stat: true, forced: true }, { of: of }); var itoc$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; var ctoi$1 = {}; for (var index = 0; index < 66; index++) ctoi$1[itoc$1.charAt(index)] = index; var base64Map = { itoc: itoc$1, ctoi: ctoi$1 }; var $$e = _export; var global$f = global$16; var getBuiltIn$5 = getBuiltIn$M; var uncurryThis$8 = functionUncurryThis; var call$3 = functionCall; var fails$5 = fails$1u; var toString$4 = toString$I; var hasOwn$5 = hasOwnProperty_1; var validateArgumentsLength$9 = validateArgumentsLength$b; var ctoi = base64Map.ctoi; var disallowed = /[^\d+/a-z]/i; var whitespaces = /[\t\n\f\r ]+/g; var finalEq = /[=]{1,2}$/; var $atob = getBuiltIn$5('atob'); var fromCharCode$1 = String.fromCharCode; var charAt$3 = uncurryThis$8(''.charAt); var replace$3 = uncurryThis$8(''.replace); var exec$2 = uncurryThis$8(disallowed.exec); var NO_SPACES_IGNORE = fails$5(function () { return $atob(' ') !== ''; }); var NO_ENCODING_CHECK = !fails$5(function () { $atob('a'); }); var NO_ARG_RECEIVING_CHECK$1 = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && !fails$5(function () { $atob(); }); var WRONG_ARITY$1 = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && $atob.length !== 1; // `atob` method // https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob $$e({ global: true, bind: true, enumerable: true, forced: NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK$1 || WRONG_ARITY$1 }, { atob: function atob(data) { validateArgumentsLength$9(arguments.length, 1); // `webpack` dev server bug on IE global methods - use call(fn, global, ...) if (NO_ARG_RECEIVING_CHECK$1 || WRONG_ARITY$1) return call$3($atob, global$f, data); var string = replace$3(toString$4(data), whitespaces, ''); var output = ''; var position = 0; var bc = 0; var chr, bs; if (string.length % 4 === 0) { string = replace$3(string, finalEq, ''); } if (string.length % 4 === 1 || exec$2(disallowed, string)) { throw new (getBuiltIn$5('DOMException'))('The string is not correctly encoded', 'InvalidCharacterError'); } while (chr = charAt$3(string, position++)) { if (hasOwn$5(ctoi, chr)) { bs = bc % 4 ? bs * 64 + ctoi[chr] : ctoi[chr]; if (bc++ % 4) output += fromCharCode$1(255 & bs >> (-2 * bc & 6)); } } return output; } }); var $$d = _export; var global$e = global$16; var getBuiltIn$4 = getBuiltIn$M; var uncurryThis$7 = functionUncurryThis; var call$2 = functionCall; var fails$4 = fails$1u; var toString$3 = toString$I; var validateArgumentsLength$8 = validateArgumentsLength$b; var itoc = base64Map.itoc; var $btoa = getBuiltIn$4('btoa'); var charAt$2 = uncurryThis$7(''.charAt); var charCodeAt$1 = uncurryThis$7(''.charCodeAt); var NO_ARG_RECEIVING_CHECK = !!$btoa && !fails$4(function () { $btoa(); }); var WRONG_ARG_CONVERSION = !!$btoa && fails$4(function () { return $btoa(null) !== 'bnVsbA=='; }); var WRONG_ARITY = !!$btoa && $btoa.length !== 1; // `btoa` method // https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa $$d({ global: true, bind: true, enumerable: true, forced: NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, { btoa: function btoa(data) { validateArgumentsLength$8(arguments.length, 1); // `webpack` dev server bug on IE global methods - use call(fn, global, ...) if (NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY) return call$2($btoa, global$e, toString$3(data)); var string = toString$3(data); var output = ''; var position = 0; var map = itoc; var block, charCode; while (charAt$2(string, position) || (map = '=', position % 1)) { charCode = charCodeAt$1(string, position += 3 / 4); if (charCode > 0xFF) { throw new (getBuiltIn$4('DOMException'))('The string contains characters outside of the Latin1 range', 'InvalidCharacterError'); } block = block << 8 | charCode; output += charAt$2(map, 63 & block >> 8 - position % 1 * 8); } return output; } }); // iterable DOM collections // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods var domIterables = { CSSRuleList: 0, CSSStyleDeclaration: 0, CSSValueList: 0, ClientRectList: 0, DOMRectList: 0, DOMStringList: 0, DOMTokenList: 1, DataTransferItemList: 0, FileList: 0, HTMLAllCollection: 0, HTMLCollection: 0, HTMLFormElement: 0, HTMLSelectElement: 0, MediaList: 0, MimeTypeArray: 0, NamedNodeMap: 0, NodeList: 1, PaintRequestList: 0, Plugin: 0, PluginArray: 0, SVGLengthList: 0, SVGNumberList: 0, SVGPathSegList: 0, SVGPointList: 0, SVGStringList: 0, SVGTransformList: 0, SourceBufferList: 0, StyleSheetList: 0, TextTrackCueList: 0, TextTrackList: 0, TouchList: 0 }; // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList` var documentCreateElement = documentCreateElement$2; var classList = documentCreateElement('span').classList; var DOMTokenListPrototype$2 = classList && classList.constructor && classList.constructor.prototype; var domTokenListPrototype = DOMTokenListPrototype$2 === Object.prototype ? undefined : DOMTokenListPrototype$2; var global$d = global$16; var DOMIterables$1 = domIterables; var DOMTokenListPrototype$1 = domTokenListPrototype; var forEach$2 = arrayForEach; var createNonEnumerableProperty$2 = createNonEnumerableProperty$k; var handlePrototype$1 = function (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype && CollectionPrototype.forEach !== forEach$2) try { createNonEnumerableProperty$2(CollectionPrototype, 'forEach', forEach$2); } catch (error) { CollectionPrototype.forEach = forEach$2; } }; for (var COLLECTION_NAME$1 in DOMIterables$1) { if (DOMIterables$1[COLLECTION_NAME$1]) { handlePrototype$1(global$d[COLLECTION_NAME$1] && global$d[COLLECTION_NAME$1].prototype); } } handlePrototype$1(DOMTokenListPrototype$1); var global$c = global$16; var DOMIterables = domIterables; var DOMTokenListPrototype = domTokenListPrototype; var ArrayIteratorMethods = es_array_iterator; var createNonEnumerableProperty$1 = createNonEnumerableProperty$k; var wellKnownSymbol$2 = wellKnownSymbol$T; var ITERATOR$2 = wellKnownSymbol$2('iterator'); var TO_STRING_TAG = wellKnownSymbol$2('toStringTag'); var ArrayValues = ArrayIteratorMethods.values; var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { if (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[ITERATOR$2] !== ArrayValues) try { createNonEnumerableProperty$1(CollectionPrototype, ITERATOR$2, ArrayValues); } catch (error) { CollectionPrototype[ITERATOR$2] = ArrayValues; } if (!CollectionPrototype[TO_STRING_TAG]) { createNonEnumerableProperty$1(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); } if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); } catch (error) { CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; } } } }; for (var COLLECTION_NAME in DOMIterables) { handlePrototype(global$c[COLLECTION_NAME] && global$c[COLLECTION_NAME].prototype, COLLECTION_NAME); } handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); var IS_NODE$1 = engineIsNode; var tryNodeRequire$1 = function (name) { try { // eslint-disable-next-line no-new-func -- safe if (IS_NODE$1) return Function('return require("' + name + '")')(); } catch (error) { /* empty */ } }; var domExceptionConstants = { IndexSizeError: { s: 'INDEX_SIZE_ERR', c: 1, m: 1 }, DOMStringSizeError: { s: 'DOMSTRING_SIZE_ERR', c: 2, m: 0 }, HierarchyRequestError: { s: 'HIERARCHY_REQUEST_ERR', c: 3, m: 1 }, WrongDocumentError: { s: 'WRONG_DOCUMENT_ERR', c: 4, m: 1 }, InvalidCharacterError: { s: 'INVALID_CHARACTER_ERR', c: 5, m: 1 }, NoDataAllowedError: { s: 'NO_DATA_ALLOWED_ERR', c: 6, m: 0 }, NoModificationAllowedError: { s: 'NO_MODIFICATION_ALLOWED_ERR', c: 7, m: 1 }, NotFoundError: { s: 'NOT_FOUND_ERR', c: 8, m: 1 }, NotSupportedError: { s: 'NOT_SUPPORTED_ERR', c: 9, m: 1 }, InUseAttributeError: { s: 'INUSE_ATTRIBUTE_ERR', c: 10, m: 1 }, InvalidStateError: { s: 'INVALID_STATE_ERR', c: 11, m: 1 }, SyntaxError: { s: 'SYNTAX_ERR', c: 12, m: 1 }, InvalidModificationError: { s: 'INVALID_MODIFICATION_ERR', c: 13, m: 1 }, NamespaceError: { s: 'NAMESPACE_ERR', c: 14, m: 1 }, InvalidAccessError: { s: 'INVALID_ACCESS_ERR', c: 15, m: 1 }, ValidationError: { s: 'VALIDATION_ERR', c: 16, m: 0 }, TypeMismatchError: { s: 'TYPE_MISMATCH_ERR', c: 17, m: 1 }, SecurityError: { s: 'SECURITY_ERR', c: 18, m: 1 }, NetworkError: { s: 'NETWORK_ERR', c: 19, m: 1 }, AbortError: { s: 'ABORT_ERR', c: 20, m: 1 }, URLMismatchError: { s: 'URL_MISMATCH_ERR', c: 21, m: 1 }, QuotaExceededError: { s: 'QUOTA_EXCEEDED_ERR', c: 22, m: 1 }, TimeoutError: { s: 'TIMEOUT_ERR', c: 23, m: 1 }, InvalidNodeTypeError: { s: 'INVALID_NODE_TYPE_ERR', c: 24, m: 1 }, DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 } }; var $$c = _export; var tryNodeRequire = tryNodeRequire$1; var getBuiltIn$3 = getBuiltIn$M; var fails$3 = fails$1u; var create$1 = objectCreate$1; var createPropertyDescriptor$2 = createPropertyDescriptor$d; var defineProperty$2 = objectDefineProperty.f; var defineBuiltIn$4 = defineBuiltIn$u; var defineBuiltInAccessor$4 = defineBuiltInAccessor$o; var hasOwn$4 = hasOwnProperty_1; var anInstance$3 = anInstance$f; var anObject$2 = anObject$1f; var errorToString = errorToString$2; var normalizeStringArgument$1 = normalizeStringArgument$6; var DOMExceptionConstants$1 = domExceptionConstants; var clearErrorStack$1 = errorStackClear; var InternalStateModule$2 = internalState; var DESCRIPTORS$6 = descriptors; var DOM_EXCEPTION$2 = 'DOMException'; var DATA_CLONE_ERR = 'DATA_CLONE_ERR'; var Error$3 = getBuiltIn$3('Error'); // NodeJS < 17.0 does not expose `DOMException` to global var NativeDOMException$1 = getBuiltIn$3(DOM_EXCEPTION$2) || (function () { try { // NodeJS < 15.0 does not expose `MessageChannel` to global var MessageChannel = getBuiltIn$3('MessageChannel') || tryNodeRequire('worker_threads').MessageChannel; // eslint-disable-next-line es/no-weak-map, unicorn/require-post-message-target-origin -- safe new MessageChannel().port1.postMessage(new WeakMap()); } catch (error) { if (error.name === DATA_CLONE_ERR && error.code === 25) return error.constructor; } })(); var NativeDOMExceptionPrototype = NativeDOMException$1 && NativeDOMException$1.prototype; var ErrorPrototype = Error$3.prototype; var setInternalState$2 = InternalStateModule$2.set; var getInternalState = InternalStateModule$2.getterFor(DOM_EXCEPTION$2); var HAS_STACK = 'stack' in Error$3(DOM_EXCEPTION$2); var codeFor = function (name) { return hasOwn$4(DOMExceptionConstants$1, name) && DOMExceptionConstants$1[name].m ? DOMExceptionConstants$1[name].c : 0; }; var $DOMException$1 = function DOMException() { anInstance$3(this, DOMExceptionPrototype$1); var argumentsLength = arguments.length; var message = normalizeStringArgument$1(argumentsLength < 1 ? undefined : arguments[0]); var name = normalizeStringArgument$1(argumentsLength < 2 ? undefined : arguments[1], 'Error'); var code = codeFor(name); setInternalState$2(this, { type: DOM_EXCEPTION$2, name: name, message: message, code: code }); if (!DESCRIPTORS$6) { this.name = name; this.message = message; this.code = code; } if (HAS_STACK) { var error = Error$3(message); error.name = DOM_EXCEPTION$2; defineProperty$2(this, 'stack', createPropertyDescriptor$2(1, clearErrorStack$1(error.stack, 1))); } }; var DOMExceptionPrototype$1 = $DOMException$1.prototype = create$1(ErrorPrototype); var createGetterDescriptor = function (get) { return { enumerable: true, configurable: true, get: get }; }; var getterFor = function (key) { return createGetterDescriptor(function () { return getInternalState(this)[key]; }); }; if (DESCRIPTORS$6) { // `DOMException.prototype.code` getter defineBuiltInAccessor$4(DOMExceptionPrototype$1, 'code', getterFor('code')); // `DOMException.prototype.message` getter defineBuiltInAccessor$4(DOMExceptionPrototype$1, 'message', getterFor('message')); // `DOMException.prototype.name` getter defineBuiltInAccessor$4(DOMExceptionPrototype$1, 'name', getterFor('name')); } defineProperty$2(DOMExceptionPrototype$1, 'constructor', createPropertyDescriptor$2(1, $DOMException$1)); // FF36- DOMException is a function, but can't be constructed var INCORRECT_CONSTRUCTOR = fails$3(function () { return !(new NativeDOMException$1() instanceof Error$3); }); // Safari 10.1 / Chrome 32- / IE8- DOMException.prototype.toString bugs var INCORRECT_TO_STRING = INCORRECT_CONSTRUCTOR || fails$3(function () { return ErrorPrototype.toString !== errorToString || String(new NativeDOMException$1(1, 2)) !== '2: 1'; }); // Deno 1.6.3- DOMException.prototype.code just missed var INCORRECT_CODE = INCORRECT_CONSTRUCTOR || fails$3(function () { return new NativeDOMException$1(1, 'DataCloneError').code !== 25; }); // Deno 1.6.3- DOMException constants just missed INCORRECT_CONSTRUCTOR || NativeDOMException$1[DATA_CLONE_ERR] !== 25 || NativeDOMExceptionPrototype[DATA_CLONE_ERR] !== 25; var FORCED_CONSTRUCTOR$1 = INCORRECT_CONSTRUCTOR; // `DOMException` constructor // https://webidl.spec.whatwg.org/#idl-DOMException $$c({ global: true, constructor: true, forced: FORCED_CONSTRUCTOR$1 }, { DOMException: FORCED_CONSTRUCTOR$1 ? $DOMException$1 : NativeDOMException$1 }); var PolyfilledDOMException$1 = getBuiltIn$3(DOM_EXCEPTION$2); var PolyfilledDOMExceptionPrototype$1 = PolyfilledDOMException$1.prototype; if (INCORRECT_TO_STRING && (NativeDOMException$1 === PolyfilledDOMException$1)) { defineBuiltIn$4(PolyfilledDOMExceptionPrototype$1, 'toString', errorToString); } if (INCORRECT_CODE && DESCRIPTORS$6 && NativeDOMException$1 === PolyfilledDOMException$1) { defineBuiltInAccessor$4(PolyfilledDOMExceptionPrototype$1, 'code', createGetterDescriptor(function () { return codeFor(anObject$2(this).name); })); } // `DOMException` constants for (var key$1 in DOMExceptionConstants$1) if (hasOwn$4(DOMExceptionConstants$1, key$1)) { var constant$1 = DOMExceptionConstants$1[key$1]; var constantName$1 = constant$1.s; var descriptor$2 = createPropertyDescriptor$2(6, constant$1.c); if (!hasOwn$4(PolyfilledDOMException$1, constantName$1)) { defineProperty$2(PolyfilledDOMException$1, constantName$1, descriptor$2); } if (!hasOwn$4(PolyfilledDOMExceptionPrototype$1, constantName$1)) { defineProperty$2(PolyfilledDOMExceptionPrototype$1, constantName$1, descriptor$2); } } var $$b = _export; var global$b = global$16; var getBuiltIn$2 = getBuiltIn$M; var createPropertyDescriptor$1 = createPropertyDescriptor$d; var defineProperty$1 = objectDefineProperty.f; var hasOwn$3 = hasOwnProperty_1; var anInstance$2 = anInstance$f; var inheritIfRequired = inheritIfRequired$6; var normalizeStringArgument = normalizeStringArgument$6; var DOMExceptionConstants = domExceptionConstants; var clearErrorStack = errorStackClear; var DESCRIPTORS$5 = descriptors; var DOM_EXCEPTION$1 = 'DOMException'; var Error$2 = getBuiltIn$2('Error'); var NativeDOMException = getBuiltIn$2(DOM_EXCEPTION$1); var $DOMException = function DOMException() { anInstance$2(this, DOMExceptionPrototype); var argumentsLength = arguments.length; var message = normalizeStringArgument(argumentsLength < 1 ? undefined : arguments[0]); var name = normalizeStringArgument(argumentsLength < 2 ? undefined : arguments[1], 'Error'); var that = new NativeDOMException(message, name); var error = Error$2(message); error.name = DOM_EXCEPTION$1; defineProperty$1(that, 'stack', createPropertyDescriptor$1(1, clearErrorStack(error.stack, 1))); inheritIfRequired(that, this, $DOMException); return that; }; var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype; var ERROR_HAS_STACK = 'stack' in Error$2(DOM_EXCEPTION$1); var DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var descriptor$1 = NativeDOMException && DESCRIPTORS$5 && Object.getOwnPropertyDescriptor(global$b, DOM_EXCEPTION$1); // Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it // https://github.com/Jarred-Sumner/bun/issues/399 var BUGGY_DESCRIPTOR = !!descriptor$1 && !(descriptor$1.writable && descriptor$1.configurable); var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK; // `DOMException` constructor patch for `.stack` where it's required // https://webidl.spec.whatwg.org/#es-DOMException-specialness $$b({ global: true, constructor: true, forced: FORCED_CONSTRUCTOR }, { // TODO: fix export logic DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException }); var PolyfilledDOMException = getBuiltIn$2(DOM_EXCEPTION$1); var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype; if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) { { defineProperty$1(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor$1(1, PolyfilledDOMException)); } for (var key in DOMExceptionConstants) if (hasOwn$3(DOMExceptionConstants, key)) { var constant = DOMExceptionConstants[key]; var constantName = constant.s; if (!hasOwn$3(PolyfilledDOMException, constantName)) { defineProperty$1(PolyfilledDOMException, constantName, createPropertyDescriptor$1(6, constant.c)); } } } var getBuiltIn$1 = getBuiltIn$M; var setToStringTag$2 = setToStringTag$d; var DOM_EXCEPTION = 'DOMException'; // `DOMException.prototype[@@toStringTag]` property setToStringTag$2(getBuiltIn$1(DOM_EXCEPTION), DOM_EXCEPTION); var $$a = _export; var global$a = global$16; var clearImmediate = task$1.clear; // `clearImmediate` method // http://w3c.github.io/setImmediate/#si-clearImmediate $$a({ global: true, bind: true, enumerable: true, forced: global$a.clearImmediate !== clearImmediate }, { clearImmediate: clearImmediate }); /* global Bun -- Deno case */ var engineIsBun = typeof Bun == 'function' && Bun && typeof Bun.version == 'string'; var global$9 = global$16; var apply = functionApply$1; var isCallable$2 = isCallable$K; var ENGINE_IS_BUN = engineIsBun; var USER_AGENT = engineUserAgent; var arraySlice$1 = arraySlice$b; var validateArgumentsLength$7 = validateArgumentsLength$b; var Function$1 = global$9.Function; // dirty IE9- and Bun 0.3.0- checks var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && (function () { var version = global$9.Bun.version.split('.'); return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0'); })(); // IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers // https://github.com/oven-sh/bun/issues/1633 var schedulersFix$3 = function (scheduler, hasTimeArg) { var firstParamIndex = hasTimeArg ? 2 : 1; return WRAP ? function (handler, timeout /* , ...arguments */) { var boundArgs = validateArgumentsLength$7(arguments.length, 1) > firstParamIndex; var fn = isCallable$2(handler) ? handler : Function$1(handler); var params = boundArgs ? arraySlice$1(arguments, firstParamIndex) : []; var callback = boundArgs ? function () { apply(fn, this, params); } : fn; return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback); } : scheduler; }; var $$9 = _export; var global$8 = global$16; var setTask = task$1.set; var schedulersFix$2 = schedulersFix$3; // https://github.com/oven-sh/bun/issues/1633 var setImmediate = global$8.setImmediate ? schedulersFix$2(setTask, false) : setTask; // `setImmediate` method // http://w3c.github.io/setImmediate/#si-setImmediate $$9({ global: true, bind: true, enumerable: true, forced: global$8.setImmediate !== setImmediate }, { setImmediate: setImmediate }); var $$8 = _export; var global$7 = global$16; var microtask = microtask_1; var aCallable = aCallable$N; var validateArgumentsLength$6 = validateArgumentsLength$b; var IS_NODE = engineIsNode; var process = global$7.process; // `queueMicrotask` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask $$8({ global: true, enumerable: true, dontCallGetSet: true }, { queueMicrotask: function queueMicrotask(fn) { validateArgumentsLength$6(arguments.length, 1); aCallable(fn); var domain = IS_NODE && process.domain; microtask(domain ? domain.bind(fn) : fn); } }); var $$7 = _export; var global$6 = global$16; var defineBuiltInAccessor$3 = defineBuiltInAccessor$o; var DESCRIPTORS$4 = descriptors; var $TypeError = TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; var INCORRECT_VALUE = global$6.self !== global$6; // `self` getter // https://html.spec.whatwg.org/multipage/window-object.html#dom-self try { if (DESCRIPTORS$4) { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var descriptor = Object.getOwnPropertyDescriptor(global$6, 'self'); // some engines have `self`, but with incorrect descriptor // https://github.com/denoland/deno/issues/15765 if (INCORRECT_VALUE || !descriptor || !descriptor.get || !descriptor.enumerable) { defineBuiltInAccessor$3(global$6, 'self', { get: function self() { return global$6; }, set: function self(value) { if (this !== global$6) throw $TypeError('Illegal invocation'); defineProperty(global$6, 'self', { value: value, writable: true, configurable: true, enumerable: true }); }, configurable: true, enumerable: true }); } } else $$7({ global: true, simple: true, forced: INCORRECT_VALUE }, { self: global$6 }); } catch (error) { /* empty */ } var $$6 = _export; var global$5 = global$16; var getBuiltin = getBuiltIn$M; var uncurryThis$6 = functionUncurryThis; var fails$2 = fails$1u; var uid = uid$7; var isCallable$1 = isCallable$K; var isConstructor = isConstructor$a; var isNullOrUndefined = isNullOrUndefined$k; var isObject$1 = isObject$K; var isSymbol = isSymbol$8; var iterate = iterate$G; var anObject$1 = anObject$1f; var classof$1 = classof$q; var hasOwn$2 = hasOwnProperty_1; var createProperty = createProperty$b; var createNonEnumerableProperty = createNonEnumerableProperty$k; var lengthOfArrayLike = lengthOfArrayLike$C; var validateArgumentsLength$5 = validateArgumentsLength$b; var getRegExpFlags = regexpGetFlags; var MapHelpers = mapHelpers; var SetHelpers = setHelpers; var ERROR_STACK_INSTALLABLE = errorStackInstallable; var PROPER_TRANSFER = structuredCloneProperTransfer; var Object$1 = global$5.Object; var Array$1 = global$5.Array; var Date$1 = global$5.Date; var Error$1 = global$5.Error; var EvalError = global$5.EvalError; var RangeError$1 = global$5.RangeError; var ReferenceError$1 = global$5.ReferenceError; var SyntaxError$1 = global$5.SyntaxError; var TypeError$3 = global$5.TypeError; var URIError = global$5.URIError; var PerformanceMark = global$5.PerformanceMark; var WebAssembly = global$5.WebAssembly; var CompileError = WebAssembly && WebAssembly.CompileError || Error$1; var LinkError = WebAssembly && WebAssembly.LinkError || Error$1; var RuntimeError = WebAssembly && WebAssembly.RuntimeError || Error$1; var DOMException = getBuiltin('DOMException'); var Map$1 = MapHelpers.Map; var mapHas = MapHelpers.has; var mapGet = MapHelpers.get; var mapSet = MapHelpers.set; var Set$1 = SetHelpers.Set; var setAdd = SetHelpers.add; var objectKeys = getBuiltin('Object', 'keys'); var push$4 = uncurryThis$6([].push); var thisBooleanValue = uncurryThis$6(true.valueOf); var thisNumberValue = uncurryThis$6(1.0.valueOf); var thisStringValue = uncurryThis$6(''.valueOf); var thisTimeValue = uncurryThis$6(Date$1.prototype.getTime); var PERFORMANCE_MARK = uid('structuredClone'); var DATA_CLONE_ERROR = 'DataCloneError'; var TRANSFERRING = 'Transferring'; var checkBasicSemantic = function (structuredCloneImplementation) { return !fails$2(function () { var set1 = new global$5.Set([7]); var set2 = structuredCloneImplementation(set1); var number = structuredCloneImplementation(Object$1(7)); return set2 === set1 || !set2.has(7) || typeof number != 'object' || +number !== 7; }) && structuredCloneImplementation; }; var checkErrorsCloning = function (structuredCloneImplementation, $Error) { return !fails$2(function () { var error = new $Error(); var test = structuredCloneImplementation({ a: error, b: error }); return !(test && test.a === test.b && test.a instanceof $Error && test.a.stack === error.stack); }); }; // https://github.com/whatwg/html/pull/5749 var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { return !fails$2(function () { var test = structuredCloneImplementation(new global$5.AggregateError([1], PERFORMANCE_MARK, { cause: 3 })); return test.name !== 'AggregateError' || test.errors[0] !== 1 || test.message !== PERFORMANCE_MARK || test.cause !== 3; }); }; // FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+ // FF<103 and Safari implementations can't clone errors // https://bugzilla.mozilla.org/show_bug.cgi?id=1556604 // FF103 can clone errors, but `.stack` of clone is an empty string // https://bugzilla.mozilla.org/show_bug.cgi?id=1778762 // FF104+ fixed it on usual errors, but not on DOMExceptions // https://bugzilla.mozilla.org/show_bug.cgi?id=1777321 // Chrome <102 returns `null` if cloned object contains multiple references to one error // https://bugs.chromium.org/p/v8/issues/detail?id=12542 // NodeJS implementation can't clone DOMExceptions // https://github.com/nodejs/node/issues/41038 // only FF103+ supports new (html/5749) error cloning semantic var nativeStructuredClone = global$5.structuredClone; var FORCED_REPLACEMENT = !checkErrorsCloning(nativeStructuredClone, Error$1) || !checkErrorsCloning(nativeStructuredClone, DOMException) || !checkNewErrorsCloningSemantic(nativeStructuredClone); // Chrome 82+, Safari 14.1+, Deno 1.11+ // Chrome 78-81 implementation swaps `.name` and `.message` of cloned `DOMException` // Chrome returns `null` if cloned object contains multiple references to one error // Safari 14.1 implementation doesn't clone some `RegExp` flags, so requires a workaround // Safari implementation can't clone errors // Deno 1.2-1.10 implementations too naive // NodeJS 16.0+ does not have `PerformanceMark` constructor // NodeJS <17.2 structured cloning implementation from `performance.mark` is too naive // and can't clone, for example, `RegExp` or some boxed primitives // https://github.com/nodejs/node/issues/40840 // no one of those implementations supports new (html/5749) error cloning semantic var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function (value) { return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail; }); var nativeRestrictedStructuredClone = checkBasicSemantic(nativeStructuredClone) || structuredCloneFromMark; var throwUncloneable = function (type) { throw new DOMException('Uncloneable type: ' + type, DATA_CLONE_ERROR); }; var throwUnpolyfillable = function (type, action) { throw new DOMException((action || 'Cloning') + ' of ' + type + ' cannot be properly polyfilled in this engine', DATA_CLONE_ERROR); }; var tryNativeRestrictedStructuredClone = function (value, type) { if (!nativeRestrictedStructuredClone) throwUnpolyfillable(type); return nativeRestrictedStructuredClone(value); }; var createDataTransfer = function () { var dataTransfer; try { dataTransfer = new global$5.DataTransfer(); } catch (error) { try { dataTransfer = new global$5.ClipboardEvent('').clipboardData; } catch (error2) { /* empty */ } } return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null; }; var cloneBuffer = function (value, map, $type) { if (mapHas(map, value)) return mapGet(map, value); var type = $type || classof$1(value); var clone, length, options, source, target, i; if (type === 'SharedArrayBuffer') { if (nativeRestrictedStructuredClone) clone = nativeRestrictedStructuredClone(value); // SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original else clone = value; } else { var DataView = global$5.DataView; // `ArrayBuffer#slice` is not available in IE10 // `ArrayBuffer#slice` and `DataView` are not available in old FF if (!DataView && typeof value.slice != 'function') throwUnpolyfillable('ArrayBuffer'); // detached buffers throws in `DataView` and `.slice` try { if (typeof value.slice == 'function' && !value.resizable) { clone = value.slice(0); } else { length = value.byteLength; options = 'maxByteLength' in value ? { maxByteLength: value.maxByteLength } : undefined; clone = new ArrayBuffer(length, options); source = new DataView(value); target = new DataView(clone); for (i = 0; i < length; i++) { target.setUint8(i, source.getUint8(i)); } } } catch (error) { throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR); } } mapSet(map, value, clone); return clone; }; var cloneView = function (value, type, offset, length, map) { var C = global$5[type]; // in some old engines like Safari 9, typeof C is 'object' // on Uint8ClampedArray or some other constructors if (!isObject$1(C)) throwUnpolyfillable(type); return new C(cloneBuffer(value.buffer, map), offset, length); }; var Placeholder = function (object, type, metadata) { this.object = object; this.type = type; this.metadata = metadata; }; var structuredCloneInternal = function (value, map, transferredBuffers) { if (isSymbol(value)) throwUncloneable('Symbol'); if (!isObject$1(value)) return value; // effectively preserves circular references if (map) { if (mapHas(map, value)) return mapGet(map, value); } else map = new Map$1(); var type = classof$1(value); var C, name, cloned, dataTransfer, i, length, keys, key; switch (type) { case 'Array': cloned = Array$1(lengthOfArrayLike(value)); break; case 'Object': cloned = {}; break; case 'Map': cloned = new Map$1(); break; case 'Set': cloned = new Set$1(); break; case 'RegExp': // in this block because of a Safari 14.1 bug // old FF does not clone regexes passed to the constructor, so get the source and flags directly cloned = new RegExp(value.source, getRegExpFlags(value)); break; case 'Error': name = value.name; switch (name) { case 'AggregateError': cloned = getBuiltin('AggregateError')([]); break; case 'EvalError': cloned = EvalError(); break; case 'RangeError': cloned = RangeError$1(); break; case 'ReferenceError': cloned = ReferenceError$1(); break; case 'SyntaxError': cloned = SyntaxError$1(); break; case 'TypeError': cloned = TypeError$3(); break; case 'URIError': cloned = URIError(); break; case 'CompileError': cloned = CompileError(); break; case 'LinkError': cloned = LinkError(); break; case 'RuntimeError': cloned = RuntimeError(); break; default: cloned = Error$1(); } break; case 'DOMException': cloned = new DOMException(value.message, value.name); break; case 'ArrayBuffer': case 'SharedArrayBuffer': cloned = transferredBuffers ? new Placeholder(value, type) : cloneBuffer(value, map, type); break; case 'DataView': case 'Int8Array': case 'Uint8Array': case 'Uint8ClampedArray': case 'Int16Array': case 'Uint16Array': case 'Int32Array': case 'Uint32Array': case 'Float16Array': case 'Float32Array': case 'Float64Array': case 'BigInt64Array': case 'BigUint64Array': length = type === 'DataView' ? value.byteLength : value.length; cloned = transferredBuffers ? new Placeholder(value, type, { offset: value.byteOffset, length: length }) : cloneView(value, type, value.byteOffset, length, map); break; case 'DOMQuad': try { cloned = new DOMQuad( structuredCloneInternal(value.p1, map, transferredBuffers), structuredCloneInternal(value.p2, map, transferredBuffers), structuredCloneInternal(value.p3, map, transferredBuffers), structuredCloneInternal(value.p4, map, transferredBuffers) ); } catch (error) { cloned = tryNativeRestrictedStructuredClone(value, type); } break; case 'File': if (nativeRestrictedStructuredClone) try { cloned = nativeRestrictedStructuredClone(value); // NodeJS 20.0.0 bug, https://github.com/nodejs/node/issues/47612 if (classof$1(cloned) !== type) cloned = undefined; } catch (error) { /* empty */ } if (!cloned) try { cloned = new File([value], value.name, value); } catch (error) { /* empty */ } if (!cloned) throwUnpolyfillable(type); break; case 'FileList': dataTransfer = createDataTransfer(); if (dataTransfer) { for (i = 0, length = lengthOfArrayLike(value); i < length; i++) { dataTransfer.items.add(structuredCloneInternal(value[i], map, transferredBuffers)); } cloned = dataTransfer.files; } else cloned = tryNativeRestrictedStructuredClone(value, type); break; case 'ImageData': // Safari 9 ImageData is a constructor, but typeof ImageData is 'object' try { cloned = new ImageData( structuredCloneInternal(value.data, map, transferredBuffers), value.width, value.height, { colorSpace: value.colorSpace } ); } catch (error) { cloned = tryNativeRestrictedStructuredClone(value, type); } break; default: if (nativeRestrictedStructuredClone) { cloned = nativeRestrictedStructuredClone(value); } else switch (type) { case 'BigInt': // can be a 3rd party polyfill cloned = Object$1(value.valueOf()); break; case 'Boolean': cloned = Object$1(thisBooleanValue(value)); break; case 'Number': cloned = Object$1(thisNumberValue(value)); break; case 'String': cloned = Object$1(thisStringValue(value)); break; case 'Date': cloned = new Date$1(thisTimeValue(value)); break; case 'Blob': try { cloned = value.slice(0, value.size, value.type); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMPoint': case 'DOMPointReadOnly': C = global$5[type]; try { cloned = C.fromPoint ? C.fromPoint(value) : new C(value.x, value.y, value.z, value.w); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMRect': case 'DOMRectReadOnly': C = global$5[type]; try { cloned = C.fromRect ? C.fromRect(value) : new C(value.x, value.y, value.width, value.height); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMMatrix': case 'DOMMatrixReadOnly': C = global$5[type]; try { cloned = C.fromMatrix ? C.fromMatrix(value) : new C(value); } catch (error) { throwUnpolyfillable(type); } break; case 'AudioData': case 'VideoFrame': if (!isCallable$1(value.clone)) throwUnpolyfillable(type); try { cloned = value.clone(); } catch (error) { throwUncloneable(type); } break; case 'CropTarget': case 'CryptoKey': case 'FileSystemDirectoryHandle': case 'FileSystemFileHandle': case 'FileSystemHandle': case 'GPUCompilationInfo': case 'GPUCompilationMessage': case 'ImageBitmap': case 'RTCCertificate': case 'WebAssembly.Module': throwUnpolyfillable(type); // break omitted default: throwUncloneable(type); } } mapSet(map, value, cloned); switch (type) { case 'Array': case 'Object': keys = objectKeys(value); for (i = 0, length = lengthOfArrayLike(keys); i < length; i++) { key = keys[i]; createProperty(cloned, key, structuredCloneInternal(value[key], map, transferredBuffers)); } break; case 'Map': value.forEach(function (v, k) { mapSet(cloned, structuredCloneInternal(k, map, transferredBuffers), structuredCloneInternal(v, map, transferredBuffers)); }); break; case 'Set': value.forEach(function (v) { setAdd(cloned, structuredCloneInternal(v, map, transferredBuffers)); }); break; case 'Error': createNonEnumerableProperty(cloned, 'message', structuredCloneInternal(value.message, map, transferredBuffers)); if (hasOwn$2(value, 'cause')) { createNonEnumerableProperty(cloned, 'cause', structuredCloneInternal(value.cause, map, transferredBuffers)); } if (name === 'AggregateError') { cloned.errors = structuredCloneInternal(value.errors, map, transferredBuffers); } // break omitted case 'DOMException': if (ERROR_STACK_INSTALLABLE) { createNonEnumerableProperty(cloned, 'stack', structuredCloneInternal(value.stack, map, transferredBuffers)); } } return cloned; }; var replacePlaceholders = function (value, map) { if (!isObject$1(value)) return value; if (mapHas(map, value)) return mapGet(map, value); var type, object, metadata, i, length, keys, key, replacement; if (value instanceof Placeholder) { type = value.type; object = value.object; switch (type) { case 'ArrayBuffer': case 'SharedArrayBuffer': replacement = cloneBuffer(object, map, type); break; case 'DataView': case 'Int8Array': case 'Uint8Array': case 'Uint8ClampedArray': case 'Int16Array': case 'Uint16Array': case 'Int32Array': case 'Uint32Array': case 'Float16Array': case 'Float32Array': case 'Float64Array': case 'BigInt64Array': case 'BigUint64Array': metadata = value.metadata; replacement = cloneView(object, type, metadata.offset, metadata.length, map); } } else switch (classof$1(value)) { case 'Array': case 'Object': keys = objectKeys(value); for (i = 0, length = lengthOfArrayLike(keys); i < length; i++) { key = keys[i]; value[key] = replacePlaceholders(value[key], map); } break; case 'Map': replacement = new Map$1(); value.forEach(function (v, k) { mapSet(replacement, replacePlaceholders(k, map), replacePlaceholders(v, map)); }); break; case 'Set': replacement = new Set$1(); value.forEach(function (v) { setAdd(replacement, replacePlaceholders(v, map)); }); break; case 'Error': value.message = replacePlaceholders(value.message, map); if (hasOwn$2(value, 'cause')) { value.cause = replacePlaceholders(value.cause, map); } if (value.name === 'AggregateError') { value.errors = replacePlaceholders(value.errors, map); } // break omitted case 'DOMException': if (ERROR_STACK_INSTALLABLE) { value.stack = replacePlaceholders(value.stack, map); } } mapSet(map, value, replacement || value); return replacement || value; }; var tryToTransfer = function (rawTransfer, map) { if (!isObject$1(rawTransfer)) throw TypeError$3('Transfer option cannot be converted to a sequence'); var transfer = []; iterate(rawTransfer, function (value) { push$4(transfer, anObject$1(value)); }); var i = 0; var length = lengthOfArrayLike(transfer); var buffers = []; var value, type, C, transferred, canvas, context; while (i < length) { value = transfer[i++]; type = classof$1(value); if (type === 'ArrayBuffer') { push$4(buffers, value); continue; } if (mapHas(map, value)) throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR); if (PROPER_TRANSFER) { transferred = nativeStructuredClone(value, { transfer: [value] }); } else switch (type) { case 'ImageBitmap': C = global$5.OffscreenCanvas; if (!isConstructor(C)) throwUnpolyfillable(type, TRANSFERRING); try { canvas = new C(value.width, value.height); context = canvas.getContext('bitmaprenderer'); context.transferFromImageBitmap(value); transferred = canvas.transferToImageBitmap(); } catch (error) { /* empty */ } break; case 'AudioData': case 'VideoFrame': if (!isCallable$1(value.clone) || !isCallable$1(value.close)) throwUnpolyfillable(type, TRANSFERRING); try { transferred = value.clone(); value.close(); } catch (error) { /* empty */ } break; case 'MediaSourceHandle': case 'MessagePort': case 'OffscreenCanvas': case 'ReadableStream': case 'TransformStream': case 'WritableStream': throwUnpolyfillable(type, TRANSFERRING); } if (transferred === undefined) throw new DOMException('This object cannot be transferred: ' + type, DATA_CLONE_ERROR); mapSet(map, value, transferred); } return buffers; }; var tryToTransferBuffers = function (transfer, map) { var i = 0; var length = lengthOfArrayLike(transfer); var value, transferred; while (i < length) { value = transfer[i++]; if (mapHas(map, value)) throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR); if (PROPER_TRANSFER) { transferred = nativeStructuredClone(value, { transfer: [value] }); } else { if (!isCallable$1(value.transfer)) throwUnpolyfillable('ArrayBuffer', TRANSFERRING); transferred = value.transfer(); } mapSet(map, value, transferred); } }; // `structuredClone` method // https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone $$6({ global: true, enumerable: true, sham: !PROPER_TRANSFER, forced: FORCED_REPLACEMENT }, { structuredClone: function structuredClone(value /* , { transfer } */) { var options = validateArgumentsLength$5(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject$1(arguments[1]) : undefined; var transfer = options ? options.transfer : undefined; var transferredBuffers = false; var map, buffers; if (transfer !== undefined) { map = new Map$1(); buffers = tryToTransfer(transfer, map); transferredBuffers = !!lengthOfArrayLike(buffers); } var clone = structuredCloneInternal(value, map, transferredBuffers); // since of an issue with cloning views of transferred buffers, we a forced to transfer / clone them in 2 steps // https://github.com/zloirock/core-js/issues/1265 if (transferredBuffers) { map = new Map$1(); tryToTransferBuffers(transfer, map); clone = replacePlaceholders(clone, map); } return clone; } }); var $$5 = _export; var global$4 = global$16; var schedulersFix$1 = schedulersFix$3; var setInterval = schedulersFix$1(global$4.setInterval, true); // Bun / IE9- setInterval additional parameters fix // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval $$5({ global: true, bind: true, forced: global$4.setInterval !== setInterval }, { setInterval: setInterval }); var $$4 = _export; var global$3 = global$16; var schedulersFix = schedulersFix$3; var setTimeout$1 = schedulersFix(global$3.setTimeout, true); // Bun / IE9- setTimeout additional parameters fix // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout $$4({ global: true, bind: true, forced: global$3.setTimeout !== setTimeout$1 }, { setTimeout: setTimeout$1 }); var fails$1 = fails$1u; var wellKnownSymbol$1 = wellKnownSymbol$T; var DESCRIPTORS$3 = descriptors; var IS_PURE = isPure; var ITERATOR$1 = wellKnownSymbol$1('iterator'); var urlConstructorDetection = !fails$1(function () { // eslint-disable-next-line unicorn/relative-url-style -- required for testing var url = new URL('b?a=1&b=2&c=3', 'http://a'); var params = url.searchParams; var params2 = new URLSearchParams('a=1&a=2&b=3'); var result = ''; url.pathname = 'c%20d'; params.forEach(function (value, key) { params['delete']('b'); result += key + value; }); params2['delete']('a', 2); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 params2['delete']('b', undefined); return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b'))) || (!params.size && (IS_PURE || !DESCRIPTORS$3)) || !params.sort || url.href !== 'http://a/c%20d?a=1&c=3' || params.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !params[ITERATOR$1] // throws in Edge || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' // not punycoded in Edge || new URL('http://теÑÑ‚').host !== 'xn--e1aybc' // not escaped in Chrome 62- || new URL('http://a#б').hash !== '#%D0%B1' // fails in Chrome 66- || result !== 'a1c3' // throws in Safari || new URL('http://x', undefined).host !== 'x'; }); // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js var uncurryThis$5 = functionUncurryThis; var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 var base = 36; var tMin = 1; var tMax = 26; var skew = 38; var damp = 700; var initialBias = 72; var initialN = 128; // 0x80 var delimiter = '-'; // '\x2D' var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process'; var baseMinusTMin = base - tMin; var $RangeError = RangeError; var exec$1 = uncurryThis$5(regexSeparators.exec); var floor$1 = Math.floor; var fromCharCode = String.fromCharCode; var charCodeAt = uncurryThis$5(''.charCodeAt); var join$2 = uncurryThis$5([].join); var push$3 = uncurryThis$5([].push); var replace$2 = uncurryThis$5(''.replace); var split$2 = uncurryThis$5(''.split); var toLowerCase$1 = uncurryThis$5(''.toLowerCase); /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. */ var ucs2decode = function (string) { var output = []; var counter = 0; var length = string.length; while (counter < length) { var value = charCodeAt(string, counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // It's a high surrogate, and there is a next character. var extra = charCodeAt(string, counter++); if ((extra & 0xFC00) === 0xDC00) { // Low surrogate. push$3(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // It's an unmatched surrogate; only append this code unit, in case the // next code unit is the high surrogate of a surrogate pair. push$3(output, value); counter--; } } else { push$3(output, value); } } return output; }; /** * Converts a digit/integer into a basic code point. */ var digitToBasic = function (digit) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26); }; /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 */ var adapt = function (delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor$1(delta / damp) : delta >> 1; delta += floor$1(delta / numPoints); while (delta > baseMinusTMin * tMax >> 1) { delta = floor$1(delta / baseMinusTMin); k += base; } return floor$1(k + (baseMinusTMin + 1) * delta / (delta + skew)); }; /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. */ var encode = function (input) { var output = []; // Convert the input in UCS-2 to an array of Unicode code points. input = ucs2decode(input); // Cache the length. var inputLength = input.length; // Initialize the state. var n = initialN; var delta = 0; var bias = initialBias; var i, currentValue; // Handle the basic code points. for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue < 0x80) { push$3(output, fromCharCode(currentValue)); } } var basicLength = output.length; // number of basic code points. var handledCPCount = basicLength; // number of code points that have been handled; // Finish the basic string with a delimiter unless it's empty. if (basicLength) { push$3(output, delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next larger one: var m = maxInt; for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's state to , but guard against overflow. var handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor$1((maxInt - delta) / handledCPCountPlusOne)) { throw $RangeError(OVERFLOW_ERROR); } delta += (m - n) * handledCPCountPlusOne; n = m; for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue < n && ++delta > maxInt) { throw $RangeError(OVERFLOW_ERROR); } if (currentValue === n) { // Represent delta as a generalized variable-length integer. var q = delta; var k = base; while (true) { var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; if (q < t) break; var qMinusT = q - t; var baseMinusT = base - t; push$3(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT))); q = floor$1(qMinusT / baseMinusT); k += base; } push$3(output, fromCharCode(digitToBasic(q))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); delta = 0; handledCPCount++; } } delta++; n++; } return join$2(output, ''); }; var stringPunycodeToAscii = function (input) { var encoded = []; var labels = split$2(replace$2(toLowerCase$1(input), regexSeparators, '\u002E'), '.'); var i, label; for (i = 0; i < labels.length; i++) { label = labels[i]; push$3(encoded, exec$1(regexNonASCII, label) ? 'xn--' + encode(label) : label); } return join$2(encoded, '.'); }; // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` var $$3 = _export; var global$2 = global$16; var call$1 = functionCall; var uncurryThis$4 = functionUncurryThis; var DESCRIPTORS$2 = descriptors; var USE_NATIVE_URL$2 = urlConstructorDetection; var defineBuiltIn$3 = defineBuiltIn$u; var defineBuiltInAccessor$2 = defineBuiltInAccessor$o; var defineBuiltIns = defineBuiltIns$b; var setToStringTag$1 = setToStringTag$d; var createIteratorConstructor = iteratorCreateConstructor; var InternalStateModule$1 = internalState; var anInstance$1 = anInstance$f; var isCallable = isCallable$K; var hasOwn$1 = hasOwnProperty_1; var bind$1 = functionBindContext; var classof = classof$q; var anObject = anObject$1f; var isObject = isObject$K; var $toString$1 = toString$I; var create = objectCreate$1; var createPropertyDescriptor = createPropertyDescriptor$d; var getIterator = getIterator$7; var getIteratorMethod = getIteratorMethod$8; var validateArgumentsLength$4 = validateArgumentsLength$b; var wellKnownSymbol = wellKnownSymbol$T; var arraySort = arraySort$1; var ITERATOR = wellKnownSymbol('iterator'); var URL_SEARCH_PARAMS = 'URLSearchParams'; var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator'; var setInternalState$1 = InternalStateModule$1.set; var getInternalParamsState = InternalStateModule$1.getterFor(URL_SEARCH_PARAMS); var getInternalIteratorState = InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Avoid NodeJS experimental warning var safeGetBuiltIn = function (name) { if (!DESCRIPTORS$2) return global$2[name]; var descriptor = getOwnPropertyDescriptor(global$2, name); return descriptor && descriptor.value; }; var nativeFetch = safeGetBuiltIn('fetch'); var NativeRequest = safeGetBuiltIn('Request'); var Headers = safeGetBuiltIn('Headers'); var RequestPrototype = NativeRequest && NativeRequest.prototype; var HeadersPrototype = Headers && Headers.prototype; var RegExp$1 = global$2.RegExp; var TypeError$2 = global$2.TypeError; var decodeURIComponent = global$2.decodeURIComponent; var encodeURIComponent$1 = global$2.encodeURIComponent; var charAt$1 = uncurryThis$4(''.charAt); var join$1 = uncurryThis$4([].join); var push$2 = uncurryThis$4([].push); var replace$1 = uncurryThis$4(''.replace); var shift$1 = uncurryThis$4([].shift); var splice = uncurryThis$4([].splice); var split$1 = uncurryThis$4(''.split); var stringSlice$1 = uncurryThis$4(''.slice); var plus = /\+/g; var sequences = Array(4); var percentSequence = function (bytes) { return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp$1('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); }; var percentDecode = function (sequence) { try { return decodeURIComponent(sequence); } catch (error) { return sequence; } }; var deserialize = function (it) { var result = replace$1(it, plus, ' '); var bytes = 4; try { return decodeURIComponent(result); } catch (error) { while (bytes) { result = replace$1(result, percentSequence(bytes--), percentDecode); } return result; } }; var find = /[!'()~]|%20/g; var replacements = { '!': '%21', "'": '%27', '(': '%28', ')': '%29', '~': '%7E', '%20': '+' }; var replacer = function (match) { return replacements[match]; }; var serialize = function (it) { return replace$1(encodeURIComponent$1(it), find, replacer); }; var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { setInternalState$1(this, { type: URL_SEARCH_PARAMS_ITERATOR, iterator: getIterator(getInternalParamsState(params).entries), kind: kind }); }, 'Iterator', function next() { var state = getInternalIteratorState(this); var kind = state.kind; var step = state.iterator.next(); var entry = step.value; if (!step.done) { step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value]; } return step; }, true); var URLSearchParamsState = function (init) { this.entries = []; this.url = null; if (init !== undefined) { if (isObject(init)) this.parseObject(init); else this.parseQuery(typeof init == 'string' ? charAt$1(init, 0) === '?' ? stringSlice$1(init, 1) : init : $toString$1(init)); } }; URLSearchParamsState.prototype = { type: URL_SEARCH_PARAMS, bindURL: function (url) { this.url = url; this.update(); }, parseObject: function (object) { var iteratorMethod = getIteratorMethod(object); var iterator, next, step, entryIterator, entryNext, first, second; if (iteratorMethod) { iterator = getIterator(object, iteratorMethod); next = iterator.next; while (!(step = call$1(next, iterator)).done) { entryIterator = getIterator(anObject(step.value)); entryNext = entryIterator.next; if ( (first = call$1(entryNext, entryIterator)).done || (second = call$1(entryNext, entryIterator)).done || !call$1(entryNext, entryIterator).done ) throw TypeError$2('Expected sequence with length 2'); push$2(this.entries, { key: $toString$1(first.value), value: $toString$1(second.value) }); } } else for (var key in object) if (hasOwn$1(object, key)) { push$2(this.entries, { key: key, value: $toString$1(object[key]) }); } }, parseQuery: function (query) { if (query) { var attributes = split$1(query, '&'); var index = 0; var attribute, entry; while (index < attributes.length) { attribute = attributes[index++]; if (attribute.length) { entry = split$1(attribute, '='); push$2(this.entries, { key: deserialize(shift$1(entry)), value: deserialize(join$1(entry, '=')) }); } } } }, serialize: function () { var entries = this.entries; var result = []; var index = 0; var entry; while (index < entries.length) { entry = entries[index++]; push$2(result, serialize(entry.key) + '=' + serialize(entry.value)); } return join$1(result, '&'); }, update: function () { this.entries.length = 0; this.parseQuery(this.url.query); }, updateURL: function () { if (this.url) this.url.update(); } }; // `URLSearchParams` constructor // https://url.spec.whatwg.org/#interface-urlsearchparams var URLSearchParamsConstructor = function URLSearchParams(/* init */) { anInstance$1(this, URLSearchParamsPrototype$3); var init = arguments.length > 0 ? arguments[0] : undefined; var state = setInternalState$1(this, new URLSearchParamsState(init)); if (!DESCRIPTORS$2) this.size = state.entries.length; }; var URLSearchParamsPrototype$3 = URLSearchParamsConstructor.prototype; defineBuiltIns(URLSearchParamsPrototype$3, { // `URLSearchParams.prototype.append` method // https://url.spec.whatwg.org/#dom-urlsearchparams-append append: function append(name, value) { var state = getInternalParamsState(this); validateArgumentsLength$4(arguments.length, 2); push$2(state.entries, { key: $toString$1(name), value: $toString$1(value) }); if (!DESCRIPTORS$2) this.length++; state.updateURL(); }, // `URLSearchParams.prototype.delete` method // https://url.spec.whatwg.org/#dom-urlsearchparams-delete 'delete': function (name /* , value */) { var state = getInternalParamsState(this); var length = validateArgumentsLength$4(arguments.length, 1); var entries = state.entries; var key = $toString$1(name); var $value = length < 2 ? undefined : arguments[1]; var value = $value === undefined ? $value : $toString$1($value); var index = 0; while (index < entries.length) { var entry = entries[index]; if (entry.key === key && (value === undefined || entry.value === value)) { splice(entries, index, 1); if (value !== undefined) break; } else index++; } if (!DESCRIPTORS$2) this.size = entries.length; state.updateURL(); }, // `URLSearchParams.prototype.get` method // https://url.spec.whatwg.org/#dom-urlsearchparams-get get: function get(name) { var entries = getInternalParamsState(this).entries; validateArgumentsLength$4(arguments.length, 1); var key = $toString$1(name); var index = 0; for (; index < entries.length; index++) { if (entries[index].key === key) return entries[index].value; } return null; }, // `URLSearchParams.prototype.getAll` method // https://url.spec.whatwg.org/#dom-urlsearchparams-getall getAll: function getAll(name) { var entries = getInternalParamsState(this).entries; validateArgumentsLength$4(arguments.length, 1); var key = $toString$1(name); var result = []; var index = 0; for (; index < entries.length; index++) { if (entries[index].key === key) push$2(result, entries[index].value); } return result; }, // `URLSearchParams.prototype.has` method // https://url.spec.whatwg.org/#dom-urlsearchparams-has has: function has(name /* , value */) { var entries = getInternalParamsState(this).entries; var length = validateArgumentsLength$4(arguments.length, 1); var key = $toString$1(name); var $value = length < 2 ? undefined : arguments[1]; var value = $value === undefined ? $value : $toString$1($value); var index = 0; while (index < entries.length) { var entry = entries[index++]; if (entry.key === key && (value === undefined || entry.value === value)) return true; } return false; }, // `URLSearchParams.prototype.set` method // https://url.spec.whatwg.org/#dom-urlsearchparams-set set: function set(name, value) { var state = getInternalParamsState(this); validateArgumentsLength$4(arguments.length, 1); var entries = state.entries; var found = false; var key = $toString$1(name); var val = $toString$1(value); var index = 0; var entry; for (; index < entries.length; index++) { entry = entries[index]; if (entry.key === key) { if (found) splice(entries, index--, 1); else { found = true; entry.value = val; } } } if (!found) push$2(entries, { key: key, value: val }); if (!DESCRIPTORS$2) this.size = entries.length; state.updateURL(); }, // `URLSearchParams.prototype.sort` method // https://url.spec.whatwg.org/#dom-urlsearchparams-sort sort: function sort() { var state = getInternalParamsState(this); arraySort(state.entries, function (a, b) { return a.key > b.key ? 1 : -1; }); state.updateURL(); }, // `URLSearchParams.prototype.forEach` method forEach: function forEach(callback /* , thisArg */) { var entries = getInternalParamsState(this).entries; var boundFunction = bind$1(callback, arguments.length > 1 ? arguments[1] : undefined); var index = 0; var entry; while (index < entries.length) { entry = entries[index++]; boundFunction(entry.value, entry.key, this); } }, // `URLSearchParams.prototype.keys` method keys: function keys() { return new URLSearchParamsIterator(this, 'keys'); }, // `URLSearchParams.prototype.values` method values: function values() { return new URLSearchParamsIterator(this, 'values'); }, // `URLSearchParams.prototype.entries` method entries: function entries() { return new URLSearchParamsIterator(this, 'entries'); } }, { enumerable: true }); // `URLSearchParams.prototype[@@iterator]` method defineBuiltIn$3(URLSearchParamsPrototype$3, ITERATOR, URLSearchParamsPrototype$3.entries, { name: 'entries' }); // `URLSearchParams.prototype.toString` method // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior defineBuiltIn$3(URLSearchParamsPrototype$3, 'toString', function toString() { return getInternalParamsState(this).serialize(); }, { enumerable: true }); // `URLSearchParams.prototype.size` getter // https://github.com/whatwg/url/pull/734 if (DESCRIPTORS$2) defineBuiltInAccessor$2(URLSearchParamsPrototype$3, 'size', { get: function size() { return getInternalParamsState(this).entries.length; }, configurable: true, enumerable: true }); setToStringTag$1(URLSearchParamsConstructor, URL_SEARCH_PARAMS); $$3({ global: true, constructor: true, forced: !USE_NATIVE_URL$2 }, { URLSearchParams: URLSearchParamsConstructor }); // Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams` if (!USE_NATIVE_URL$2 && isCallable(Headers)) { var headersHas = uncurryThis$4(HeadersPrototype.has); var headersSet = uncurryThis$4(HeadersPrototype.set); var wrapRequestOptions = function (init) { if (isObject(init)) { var body = init.body; var headers; if (classof(body) === URL_SEARCH_PARAMS) { headers = init.headers ? new Headers(init.headers) : new Headers(); if (!headersHas(headers, 'content-type')) { headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } return create(init, { body: createPropertyDescriptor(0, $toString$1(body)), headers: createPropertyDescriptor(0, headers) }); } } return init; }; if (isCallable(nativeFetch)) { $$3({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, { fetch: function fetch(input /* , init */) { return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {}); } }); } if (isCallable(NativeRequest)) { var RequestConstructor = function Request(input /* , init */) { anInstance$1(this, RequestPrototype); return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {}); }; RequestPrototype.constructor = RequestConstructor; RequestConstructor.prototype = RequestPrototype; $$3({ global: true, constructor: true, dontCallGetSet: true, forced: true }, { Request: RequestConstructor }); } } var web_urlSearchParams_constructor = { URLSearchParams: URLSearchParamsConstructor, getState: getInternalParamsState }; // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` var $$2 = _export; var DESCRIPTORS$1 = descriptors; var USE_NATIVE_URL$1 = urlConstructorDetection; var global$1 = global$16; var bind = functionBindContext; var uncurryThis$3 = functionUncurryThis; var defineBuiltIn$2 = defineBuiltIn$u; var defineBuiltInAccessor$1 = defineBuiltInAccessor$o; var anInstance = anInstance$f; var hasOwn = hasOwnProperty_1; var assign = objectAssign; var arrayFrom = arrayFrom$1; var arraySlice = arraySliceSimple; var codeAt = stringMultibyte.codeAt; var toASCII = stringPunycodeToAscii; var $toString = toString$I; var setToStringTag = setToStringTag$d; var validateArgumentsLength$3 = validateArgumentsLength$b; var URLSearchParamsModule = web_urlSearchParams_constructor; var InternalStateModule = internalState; var setInternalState = InternalStateModule.set; var getInternalURLState = InternalStateModule.getterFor('URL'); var URLSearchParams$1 = URLSearchParamsModule.URLSearchParams; var getInternalSearchParamsState = URLSearchParamsModule.getState; var NativeURL = global$1.URL; var TypeError$1 = global$1.TypeError; var parseInt$1 = global$1.parseInt; var floor = Math.floor; var pow = Math.pow; var charAt = uncurryThis$3(''.charAt); var exec = uncurryThis$3(/./.exec); var join = uncurryThis$3([].join); var numberToString = uncurryThis$3(1.0.toString); var pop = uncurryThis$3([].pop); var push$1 = uncurryThis$3([].push); var replace = uncurryThis$3(''.replace); var shift = uncurryThis$3([].shift); var split = uncurryThis$3(''.split); var stringSlice = uncurryThis$3(''.slice); var toLowerCase = uncurryThis$3(''.toLowerCase); var unshift = uncurryThis$3([].unshift); var INVALID_AUTHORITY = 'Invalid authority'; var INVALID_SCHEME = 'Invalid scheme'; var INVALID_HOST = 'Invalid host'; var INVALID_PORT = 'Invalid port'; var ALPHA = /[a-z]/i; // eslint-disable-next-line regexp/no-obscure-range -- safe var ALPHANUMERIC = /[\d+-.a-z]/i; var DIGIT = /\d/; var HEX_START = /^0x/i; var OCT = /^[0-7]+$/; var DEC = /^\d+$/; var HEX = /^[\da-f]+$/i; /* eslint-disable regexp/no-control-character -- safe */ var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/; var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/; var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/; var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/; var TAB_AND_NEW_LINE = /[\t\n\r]/g; /* eslint-enable regexp/no-control-character -- safe */ var EOF; // https://url.spec.whatwg.org/#ipv4-number-parser var parseIPv4 = function (input) { var parts = split(input, '.'); var partsLength, numbers, index, part, radix, number, ipv4; if (parts.length && parts[parts.length - 1] === '') { parts.length--; } partsLength = parts.length; if (partsLength > 4) return input; numbers = []; for (index = 0; index < partsLength; index++) { part = parts[index]; if (part === '') return input; radix = 10; if (part.length > 1 && charAt(part, 0) === '0') { radix = exec(HEX_START, part) ? 16 : 8; part = stringSlice(part, radix === 8 ? 1 : 2); } if (part === '') { number = 0; } else { if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part)) return input; number = parseInt$1(part, radix); } push$1(numbers, number); } for (index = 0; index < partsLength; index++) { number = numbers[index]; if (index === partsLength - 1) { if (number >= pow(256, 5 - partsLength)) return null; } else if (number > 255) return null; } ipv4 = pop(numbers); for (index = 0; index < numbers.length; index++) { ipv4 += numbers[index] * pow(256, 3 - index); } return ipv4; }; // https://url.spec.whatwg.org/#concept-ipv6-parser // eslint-disable-next-line max-statements -- TODO var parseIPv6 = function (input) { var address = [0, 0, 0, 0, 0, 0, 0, 0]; var pieceIndex = 0; var compress = null; var pointer = 0; var value, length, numbersSeen, ipv4Piece, number, swaps, swap; var chr = function () { return charAt(input, pointer); }; if (chr() === ':') { if (charAt(input, 1) !== ':') return; pointer += 2; pieceIndex++; compress = pieceIndex; } while (chr()) { if (pieceIndex === 8) return; if (chr() === ':') { if (compress !== null) return; pointer++; pieceIndex++; compress = pieceIndex; continue; } value = length = 0; while (length < 4 && exec(HEX, chr())) { value = value * 16 + parseInt$1(chr(), 16); pointer++; length++; } if (chr() === '.') { if (length === 0) return; pointer -= length; if (pieceIndex > 6) return; numbersSeen = 0; while (chr()) { ipv4Piece = null; if (numbersSeen > 0) { if (chr() === '.' && numbersSeen < 4) pointer++; else return; } if (!exec(DIGIT, chr())) return; while (exec(DIGIT, chr())) { number = parseInt$1(chr(), 10); if (ipv4Piece === null) ipv4Piece = number; else if (ipv4Piece === 0) return; else ipv4Piece = ipv4Piece * 10 + number; if (ipv4Piece > 255) return; pointer++; } address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; numbersSeen++; if (numbersSeen === 2 || numbersSeen === 4) pieceIndex++; } if (numbersSeen !== 4) return; break; } else if (chr() === ':') { pointer++; if (!chr()) return; } else if (chr()) return; address[pieceIndex++] = value; } if (compress !== null) { swaps = pieceIndex - compress; pieceIndex = 7; while (pieceIndex !== 0 && swaps > 0) { swap = address[pieceIndex]; address[pieceIndex--] = address[compress + swaps - 1]; address[compress + --swaps] = swap; } } else if (pieceIndex !== 8) return; return address; }; var findLongestZeroSequence = function (ipv6) { var maxIndex = null; var maxLength = 1; var currStart = null; var currLength = 0; var index = 0; for (; index < 8; index++) { if (ipv6[index] !== 0) { if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } currStart = null; currLength = 0; } else { if (currStart === null) currStart = index; ++currLength; } } if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } return maxIndex; }; // https://url.spec.whatwg.org/#host-serializing var serializeHost = function (host) { var result, index, compress, ignore0; // ipv4 if (typeof host == 'number') { result = []; for (index = 0; index < 4; index++) { unshift(result, host % 256); host = floor(host / 256); } return join(result, '.'); // ipv6 } else if (typeof host == 'object') { result = ''; compress = findLongestZeroSequence(host); for (index = 0; index < 8; index++) { if (ignore0 && host[index] === 0) continue; if (ignore0) ignore0 = false; if (compress === index) { result += index ? ':' : '::'; ignore0 = true; } else { result += numberToString(host[index], 16); if (index < 7) result += ':'; } } return '[' + result + ']'; } return host; }; var C0ControlPercentEncodeSet = {}; var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 }); var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { '#': 1, '?': 1, '{': 1, '}': 1 }); var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1 }); var percentEncode = function (chr, set) { var code = codeAt(chr, 0); return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr); }; // https://url.spec.whatwg.org/#special-scheme var specialSchemes = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 }; // https://url.spec.whatwg.org/#windows-drive-letter var isWindowsDriveLetter = function (string, normalized) { var second; return string.length === 2 && exec(ALPHA, charAt(string, 0)) && ((second = charAt(string, 1)) === ':' || (!normalized && second === '|')); }; // https://url.spec.whatwg.org/#start-with-a-windows-drive-letter var startsWithWindowsDriveLetter = function (string) { var third; return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && ( string.length === 2 || ((third = charAt(string, 2)) === '/' || third === '\\' || third === '?' || third === '#') ); }; // https://url.spec.whatwg.org/#single-dot-path-segment var isSingleDot = function (segment) { return segment === '.' || toLowerCase(segment) === '%2e'; }; // https://url.spec.whatwg.org/#double-dot-path-segment var isDoubleDot = function (segment) { segment = toLowerCase(segment); return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; }; // States: var SCHEME_START = {}; var SCHEME = {}; var NO_SCHEME = {}; var SPECIAL_RELATIVE_OR_AUTHORITY = {}; var PATH_OR_AUTHORITY = {}; var RELATIVE = {}; var RELATIVE_SLASH = {}; var SPECIAL_AUTHORITY_SLASHES = {}; var SPECIAL_AUTHORITY_IGNORE_SLASHES = {}; var AUTHORITY = {}; var HOST = {}; var HOSTNAME = {}; var PORT = {}; var FILE = {}; var FILE_SLASH = {}; var FILE_HOST = {}; var PATH_START = {}; var PATH = {}; var CANNOT_BE_A_BASE_URL_PATH = {}; var QUERY = {}; var FRAGMENT = {}; var URLState = function (url, isBase, base) { var urlString = $toString(url); var baseState, failure, searchParams; if (isBase) { failure = this.parse(urlString); if (failure) throw TypeError$1(failure); this.searchParams = null; } else { if (base !== undefined) baseState = new URLState(base, true); failure = this.parse(urlString, null, baseState); if (failure) throw TypeError$1(failure); searchParams = getInternalSearchParamsState(new URLSearchParams$1()); searchParams.bindURL(this); this.searchParams = searchParams; } }; URLState.prototype = { type: 'URL', // https://url.spec.whatwg.org/#url-parsing // eslint-disable-next-line max-statements -- TODO parse: function (input, stateOverride, base) { var url = this; var state = stateOverride || SCHEME_START; var pointer = 0; var buffer = ''; var seenAt = false; var seenBracket = false; var seenPasswordToken = false; var codePoints, chr, bufferCodePoints, failure; input = $toString(input); if (!stateOverride) { url.scheme = ''; url.username = ''; url.password = ''; url.host = null; url.port = null; url.path = []; url.query = null; url.fragment = null; url.cannotBeABaseURL = false; input = replace(input, LEADING_C0_CONTROL_OR_SPACE, ''); input = replace(input, TRAILING_C0_CONTROL_OR_SPACE, '$1'); } input = replace(input, TAB_AND_NEW_LINE, ''); codePoints = arrayFrom(input); while (pointer <= codePoints.length) { chr = codePoints[pointer]; switch (state) { case SCHEME_START: if (chr && exec(ALPHA, chr)) { buffer += toLowerCase(chr); state = SCHEME; } else if (!stateOverride) { state = NO_SCHEME; continue; } else return INVALID_SCHEME; break; case SCHEME: if (chr && (exec(ALPHANUMERIC, chr) || chr === '+' || chr === '-' || chr === '.')) { buffer += toLowerCase(chr); } else if (chr === ':') { if (stateOverride && ( (url.isSpecial() !== hasOwn(specialSchemes, buffer)) || (buffer === 'file' && (url.includesCredentials() || url.port !== null)) || (url.scheme === 'file' && !url.host) )) return; url.scheme = buffer; if (stateOverride) { if (url.isSpecial() && specialSchemes[url.scheme] === url.port) url.port = null; return; } buffer = ''; if (url.scheme === 'file') { state = FILE; } else if (url.isSpecial() && base && base.scheme === url.scheme) { state = SPECIAL_RELATIVE_OR_AUTHORITY; } else if (url.isSpecial()) { state = SPECIAL_AUTHORITY_SLASHES; } else if (codePoints[pointer + 1] === '/') { state = PATH_OR_AUTHORITY; pointer++; } else { url.cannotBeABaseURL = true; push$1(url.path, ''); state = CANNOT_BE_A_BASE_URL_PATH; } } else if (!stateOverride) { buffer = ''; state = NO_SCHEME; pointer = 0; continue; } else return INVALID_SCHEME; break; case NO_SCHEME: if (!base || (base.cannotBeABaseURL && chr !== '#')) return INVALID_SCHEME; if (base.cannotBeABaseURL && chr === '#') { url.scheme = base.scheme; url.path = arraySlice(base.path); url.query = base.query; url.fragment = ''; url.cannotBeABaseURL = true; state = FRAGMENT; break; } state = base.scheme === 'file' ? FILE : RELATIVE; continue; case SPECIAL_RELATIVE_OR_AUTHORITY: if (chr === '/' && codePoints[pointer + 1] === '/') { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; pointer++; } else { state = RELATIVE; continue; } break; case PATH_OR_AUTHORITY: if (chr === '/') { state = AUTHORITY; break; } else { state = PATH; continue; } case RELATIVE: url.scheme = base.scheme; if (chr === EOF) { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = arraySlice(base.path); url.query = base.query; } else if (chr === '/' || (chr === '\\' && url.isSpecial())) { state = RELATIVE_SLASH; } else if (chr === '?') { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = arraySlice(base.path); url.query = ''; state = QUERY; } else if (chr === '#') { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = arraySlice(base.path); url.query = base.query; url.fragment = ''; state = FRAGMENT; } else { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = arraySlice(base.path); url.path.length--; state = PATH; continue; } break; case RELATIVE_SLASH: if (url.isSpecial() && (chr === '/' || chr === '\\')) { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; } else if (chr === '/') { state = AUTHORITY; } else { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; state = PATH; continue; } break; case SPECIAL_AUTHORITY_SLASHES: state = SPECIAL_AUTHORITY_IGNORE_SLASHES; if (chr !== '/' || charAt(buffer, pointer + 1) !== '/') continue; pointer++; break; case SPECIAL_AUTHORITY_IGNORE_SLASHES: if (chr !== '/' && chr !== '\\') { state = AUTHORITY; continue; } break; case AUTHORITY: if (chr === '@') { if (seenAt) buffer = '%40' + buffer; seenAt = true; bufferCodePoints = arrayFrom(buffer); for (var i = 0; i < bufferCodePoints.length; i++) { var codePoint = bufferCodePoints[i]; if (codePoint === ':' && !seenPasswordToken) { seenPasswordToken = true; continue; } var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); if (seenPasswordToken) url.password += encodedCodePoints; else url.username += encodedCodePoints; } buffer = ''; } else if ( chr === EOF || chr === '/' || chr === '?' || chr === '#' || (chr === '\\' && url.isSpecial()) ) { if (seenAt && buffer === '') return INVALID_AUTHORITY; pointer -= arrayFrom(buffer).length + 1; buffer = ''; state = HOST; } else buffer += chr; break; case HOST: case HOSTNAME: if (stateOverride && url.scheme === 'file') { state = FILE_HOST; continue; } else if (chr === ':' && !seenBracket) { if (buffer === '') return INVALID_HOST; failure = url.parseHost(buffer); if (failure) return failure; buffer = ''; state = PORT; if (stateOverride === HOSTNAME) return; } else if ( chr === EOF || chr === '/' || chr === '?' || chr === '#' || (chr === '\\' && url.isSpecial()) ) { if (url.isSpecial() && buffer === '') return INVALID_HOST; if (stateOverride && buffer === '' && (url.includesCredentials() || url.port !== null)) return; failure = url.parseHost(buffer); if (failure) return failure; buffer = ''; state = PATH_START; if (stateOverride) return; continue; } else { if (chr === '[') seenBracket = true; else if (chr === ']') seenBracket = false; buffer += chr; } break; case PORT: if (exec(DIGIT, chr)) { buffer += chr; } else if ( chr === EOF || chr === '/' || chr === '?' || chr === '#' || (chr === '\\' && url.isSpecial()) || stateOverride ) { if (buffer !== '') { var port = parseInt$1(buffer, 10); if (port > 0xFFFF) return INVALID_PORT; url.port = (url.isSpecial() && port === specialSchemes[url.scheme]) ? null : port; buffer = ''; } if (stateOverride) return; state = PATH_START; continue; } else return INVALID_PORT; break; case FILE: url.scheme = 'file'; if (chr === '/' || chr === '\\') state = FILE_SLASH; else if (base && base.scheme === 'file') { switch (chr) { case EOF: url.host = base.host; url.path = arraySlice(base.path); url.query = base.query; break; case '?': url.host = base.host; url.path = arraySlice(base.path); url.query = ''; state = QUERY; break; case '#': url.host = base.host; url.path = arraySlice(base.path); url.query = base.query; url.fragment = ''; state = FRAGMENT; break; default: if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) { url.host = base.host; url.path = arraySlice(base.path); url.shortenPath(); } state = PATH; continue; } } else { state = PATH; continue; } break; case FILE_SLASH: if (chr === '/' || chr === '\\') { state = FILE_HOST; break; } if (base && base.scheme === 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) { if (isWindowsDriveLetter(base.path[0], true)) push$1(url.path, base.path[0]); else url.host = base.host; } state = PATH; continue; case FILE_HOST: if (chr === EOF || chr === '/' || chr === '\\' || chr === '?' || chr === '#') { if (!stateOverride && isWindowsDriveLetter(buffer)) { state = PATH; } else if (buffer === '') { url.host = ''; if (stateOverride) return; state = PATH_START; } else { failure = url.parseHost(buffer); if (failure) return failure; if (url.host === 'localhost') url.host = ''; if (stateOverride) return; buffer = ''; state = PATH_START; } continue; } else buffer += chr; break; case PATH_START: if (url.isSpecial()) { state = PATH; if (chr !== '/' && chr !== '\\') continue; } else if (!stateOverride && chr === '?') { url.query = ''; state = QUERY; } else if (!stateOverride && chr === '#') { url.fragment = ''; state = FRAGMENT; } else if (chr !== EOF) { state = PATH; if (chr !== '/') continue; } break; case PATH: if ( chr === EOF || chr === '/' || (chr === '\\' && url.isSpecial()) || (!stateOverride && (chr === '?' || chr === '#')) ) { if (isDoubleDot(buffer)) { url.shortenPath(); if (chr !== '/' && !(chr === '\\' && url.isSpecial())) { push$1(url.path, ''); } } else if (isSingleDot(buffer)) { if (chr !== '/' && !(chr === '\\' && url.isSpecial())) { push$1(url.path, ''); } } else { if (url.scheme === 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { if (url.host) url.host = ''; buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter } push$1(url.path, buffer); } buffer = ''; if (url.scheme === 'file' && (chr === EOF || chr === '?' || chr === '#')) { while (url.path.length > 1 && url.path[0] === '') { shift(url.path); } } if (chr === '?') { url.query = ''; state = QUERY; } else if (chr === '#') { url.fragment = ''; state = FRAGMENT; } } else { buffer += percentEncode(chr, pathPercentEncodeSet); } break; case CANNOT_BE_A_BASE_URL_PATH: if (chr === '?') { url.query = ''; state = QUERY; } else if (chr === '#') { url.fragment = ''; state = FRAGMENT; } else if (chr !== EOF) { url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet); } break; case QUERY: if (!stateOverride && chr === '#') { url.fragment = ''; state = FRAGMENT; } else if (chr !== EOF) { if (chr === "'" && url.isSpecial()) url.query += '%27'; else if (chr === '#') url.query += '%23'; else url.query += percentEncode(chr, C0ControlPercentEncodeSet); } break; case FRAGMENT: if (chr !== EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet); break; } pointer++; } }, // https://url.spec.whatwg.org/#host-parsing parseHost: function (input) { var result, codePoints, index; if (charAt(input, 0) === '[') { if (charAt(input, input.length - 1) !== ']') return INVALID_HOST; result = parseIPv6(stringSlice(input, 1, -1)); if (!result) return INVALID_HOST; this.host = result; // opaque host } else if (!this.isSpecial()) { if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST; result = ''; codePoints = arrayFrom(input); for (index = 0; index < codePoints.length; index++) { result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); } this.host = result; } else { input = toASCII(input); if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST; result = parseIPv4(input); if (result === null) return INVALID_HOST; this.host = result; } }, // https://url.spec.whatwg.org/#cannot-have-a-username-password-port cannotHaveUsernamePasswordPort: function () { return !this.host || this.cannotBeABaseURL || this.scheme === 'file'; }, // https://url.spec.whatwg.org/#include-credentials includesCredentials: function () { return this.username !== '' || this.password !== ''; }, // https://url.spec.whatwg.org/#is-special isSpecial: function () { return hasOwn(specialSchemes, this.scheme); }, // https://url.spec.whatwg.org/#shorten-a-urls-path shortenPath: function () { var path = this.path; var pathSize = path.length; if (pathSize && (this.scheme !== 'file' || pathSize !== 1 || !isWindowsDriveLetter(path[0], true))) { path.length--; } }, // https://url.spec.whatwg.org/#concept-url-serializer serialize: function () { var url = this; var scheme = url.scheme; var username = url.username; var password = url.password; var host = url.host; var port = url.port; var path = url.path; var query = url.query; var fragment = url.fragment; var output = scheme + ':'; if (host !== null) { output += '//'; if (url.includesCredentials()) { output += username + (password ? ':' + password : '') + '@'; } output += serializeHost(host); if (port !== null) output += ':' + port; } else if (scheme === 'file') output += '//'; output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : ''; if (query !== null) output += '?' + query; if (fragment !== null) output += '#' + fragment; return output; }, // https://url.spec.whatwg.org/#dom-url-href setHref: function (href) { var failure = this.parse(href); if (failure) throw TypeError$1(failure); this.searchParams.update(); }, // https://url.spec.whatwg.org/#dom-url-origin getOrigin: function () { var scheme = this.scheme; var port = this.port; if (scheme === 'blob') try { return new URLConstructor(scheme.path[0]).origin; } catch (error) { return 'null'; } if (scheme === 'file' || !this.isSpecial()) return 'null'; return scheme + '://' + serializeHost(this.host) + (port !== null ? ':' + port : ''); }, // https://url.spec.whatwg.org/#dom-url-protocol getProtocol: function () { return this.scheme + ':'; }, setProtocol: function (protocol) { this.parse($toString(protocol) + ':', SCHEME_START); }, // https://url.spec.whatwg.org/#dom-url-username getUsername: function () { return this.username; }, setUsername: function (username) { var codePoints = arrayFrom($toString(username)); if (this.cannotHaveUsernamePasswordPort()) return; this.username = ''; for (var i = 0; i < codePoints.length; i++) { this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }, // https://url.spec.whatwg.org/#dom-url-password getPassword: function () { return this.password; }, setPassword: function (password) { var codePoints = arrayFrom($toString(password)); if (this.cannotHaveUsernamePasswordPort()) return; this.password = ''; for (var i = 0; i < codePoints.length; i++) { this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }, // https://url.spec.whatwg.org/#dom-url-host getHost: function () { var host = this.host; var port = this.port; return host === null ? '' : port === null ? serializeHost(host) : serializeHost(host) + ':' + port; }, setHost: function (host) { if (this.cannotBeABaseURL) return; this.parse(host, HOST); }, // https://url.spec.whatwg.org/#dom-url-hostname getHostname: function () { var host = this.host; return host === null ? '' : serializeHost(host); }, setHostname: function (hostname) { if (this.cannotBeABaseURL) return; this.parse(hostname, HOSTNAME); }, // https://url.spec.whatwg.org/#dom-url-port getPort: function () { var port = this.port; return port === null ? '' : $toString(port); }, setPort: function (port) { if (this.cannotHaveUsernamePasswordPort()) return; port = $toString(port); if (port === '') this.port = null; else this.parse(port, PORT); }, // https://url.spec.whatwg.org/#dom-url-pathname getPathname: function () { var path = this.path; return this.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : ''; }, setPathname: function (pathname) { if (this.cannotBeABaseURL) return; this.path = []; this.parse(pathname, PATH_START); }, // https://url.spec.whatwg.org/#dom-url-search getSearch: function () { var query = this.query; return query ? '?' + query : ''; }, setSearch: function (search) { search = $toString(search); if (search === '') { this.query = null; } else { if (charAt(search, 0) === '?') search = stringSlice(search, 1); this.query = ''; this.parse(search, QUERY); } this.searchParams.update(); }, // https://url.spec.whatwg.org/#dom-url-searchparams getSearchParams: function () { return this.searchParams.facade; }, // https://url.spec.whatwg.org/#dom-url-hash getHash: function () { var fragment = this.fragment; return fragment ? '#' + fragment : ''; }, setHash: function (hash) { hash = $toString(hash); if (hash === '') { this.fragment = null; return; } if (charAt(hash, 0) === '#') hash = stringSlice(hash, 1); this.fragment = ''; this.parse(hash, FRAGMENT); }, update: function () { this.query = this.searchParams.serialize() || null; } }; // `URL` constructor // https://url.spec.whatwg.org/#url-class var URLConstructor = function URL(url /* , base */) { var that = anInstance(this, URLPrototype); var base = validateArgumentsLength$3(arguments.length, 1) > 1 ? arguments[1] : undefined; var state = setInternalState(that, new URLState(url, false, base)); if (!DESCRIPTORS$1) { that.href = state.serialize(); that.origin = state.getOrigin(); that.protocol = state.getProtocol(); that.username = state.getUsername(); that.password = state.getPassword(); that.host = state.getHost(); that.hostname = state.getHostname(); that.port = state.getPort(); that.pathname = state.getPathname(); that.search = state.getSearch(); that.searchParams = state.getSearchParams(); that.hash = state.getHash(); } }; var URLPrototype = URLConstructor.prototype; var accessorDescriptor = function (getter, setter) { return { get: function () { return getInternalURLState(this)[getter](); }, set: setter && function (value) { return getInternalURLState(this)[setter](value); }, configurable: true, enumerable: true }; }; if (DESCRIPTORS$1) { // `URL.prototype.href` accessors pair // https://url.spec.whatwg.org/#dom-url-href defineBuiltInAccessor$1(URLPrototype, 'href', accessorDescriptor('serialize', 'setHref')); // `URL.prototype.origin` getter // https://url.spec.whatwg.org/#dom-url-origin defineBuiltInAccessor$1(URLPrototype, 'origin', accessorDescriptor('getOrigin')); // `URL.prototype.protocol` accessors pair // https://url.spec.whatwg.org/#dom-url-protocol defineBuiltInAccessor$1(URLPrototype, 'protocol', accessorDescriptor('getProtocol', 'setProtocol')); // `URL.prototype.username` accessors pair // https://url.spec.whatwg.org/#dom-url-username defineBuiltInAccessor$1(URLPrototype, 'username', accessorDescriptor('getUsername', 'setUsername')); // `URL.prototype.password` accessors pair // https://url.spec.whatwg.org/#dom-url-password defineBuiltInAccessor$1(URLPrototype, 'password', accessorDescriptor('getPassword', 'setPassword')); // `URL.prototype.host` accessors pair // https://url.spec.whatwg.org/#dom-url-host defineBuiltInAccessor$1(URLPrototype, 'host', accessorDescriptor('getHost', 'setHost')); // `URL.prototype.hostname` accessors pair // https://url.spec.whatwg.org/#dom-url-hostname defineBuiltInAccessor$1(URLPrototype, 'hostname', accessorDescriptor('getHostname', 'setHostname')); // `URL.prototype.port` accessors pair // https://url.spec.whatwg.org/#dom-url-port defineBuiltInAccessor$1(URLPrototype, 'port', accessorDescriptor('getPort', 'setPort')); // `URL.prototype.pathname` accessors pair // https://url.spec.whatwg.org/#dom-url-pathname defineBuiltInAccessor$1(URLPrototype, 'pathname', accessorDescriptor('getPathname', 'setPathname')); // `URL.prototype.search` accessors pair // https://url.spec.whatwg.org/#dom-url-search defineBuiltInAccessor$1(URLPrototype, 'search', accessorDescriptor('getSearch', 'setSearch')); // `URL.prototype.searchParams` getter // https://url.spec.whatwg.org/#dom-url-searchparams defineBuiltInAccessor$1(URLPrototype, 'searchParams', accessorDescriptor('getSearchParams')); // `URL.prototype.hash` accessors pair // https://url.spec.whatwg.org/#dom-url-hash defineBuiltInAccessor$1(URLPrototype, 'hash', accessorDescriptor('getHash', 'setHash')); } // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson defineBuiltIn$2(URLPrototype, 'toJSON', function toJSON() { return getInternalURLState(this).serialize(); }, { enumerable: true }); // `URL.prototype.toString` method // https://url.spec.whatwg.org/#URL-stringification-behavior defineBuiltIn$2(URLPrototype, 'toString', function toString() { return getInternalURLState(this).serialize(); }, { enumerable: true }); if (NativeURL) { var nativeCreateObjectURL = NativeURL.createObjectURL; var nativeRevokeObjectURL = NativeURL.revokeObjectURL; // `URL.createObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL if (nativeCreateObjectURL) defineBuiltIn$2(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL)); // `URL.revokeObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL if (nativeRevokeObjectURL) defineBuiltIn$2(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL)); } setToStringTag(URLConstructor, 'URL'); $$2({ global: true, constructor: true, forced: !USE_NATIVE_URL$1, sham: !DESCRIPTORS$1 }, { URL: URLConstructor }); var $$1 = _export; var getBuiltIn = getBuiltIn$M; var fails = fails$1u; var validateArgumentsLength$2 = validateArgumentsLength$b; var toString$2 = toString$I; var USE_NATIVE_URL = urlConstructorDetection; var URL$1 = getBuiltIn('URL'); // https://github.com/nodejs/node/issues/47505 // https://github.com/denoland/deno/issues/18893 var THROWS_WITHOUT_ARGUMENTS = USE_NATIVE_URL && fails(function () { URL$1.canParse(); }); // `URL.canParse` method // https://url.spec.whatwg.org/#dom-url-canparse $$1({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS }, { canParse: function canParse(url) { var length = validateArgumentsLength$2(arguments.length, 1); var urlString = toString$2(url); var base = length < 2 || arguments[1] === undefined ? undefined : toString$2(arguments[1]); try { return !!new URL$1(urlString, base); } catch (error) { return false; } } }); var $ = _export; var call = functionCall; // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson $({ target: 'URL', proto: true, enumerable: true }, { toJSON: function toJSON() { return call(URL.prototype.toString, this); } }); var defineBuiltIn$1 = defineBuiltIn$u; var uncurryThis$2 = functionUncurryThis; var toString$1 = toString$I; var validateArgumentsLength$1 = validateArgumentsLength$b; var $URLSearchParams$1 = URLSearchParams; var URLSearchParamsPrototype$2 = $URLSearchParams$1.prototype; var append = uncurryThis$2(URLSearchParamsPrototype$2.append); var $delete = uncurryThis$2(URLSearchParamsPrototype$2['delete']); var forEach$1 = uncurryThis$2(URLSearchParamsPrototype$2.forEach); var push = uncurryThis$2([].push); var params$1 = new $URLSearchParams$1('a=1&a=2&b=3'); params$1['delete']('a', 1); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 params$1['delete']('b', undefined); if (params$1 + '' !== 'a=2') { defineBuiltIn$1(URLSearchParamsPrototype$2, 'delete', function (name /* , value */) { var length = arguments.length; var $value = length < 2 ? undefined : arguments[1]; if (length && $value === undefined) return $delete(this, name); var entries = []; forEach$1(this, function (v, k) { // also validates `this` push(entries, { key: k, value: v }); }); validateArgumentsLength$1(length, 1); var key = toString$1(name); var value = toString$1($value); var index = 0; var dindex = 0; var found = false; var entriesLength = entries.length; var entry; while (index < entriesLength) { entry = entries[index++]; if (found || entry.key === key) { found = true; $delete(this, entry.key); } else dindex++; } while (dindex < entriesLength) { entry = entries[dindex++]; if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value); } }, { enumerable: true, unsafe: true }); } var defineBuiltIn = defineBuiltIn$u; var uncurryThis$1 = functionUncurryThis; var toString = toString$I; var validateArgumentsLength = validateArgumentsLength$b; var $URLSearchParams = URLSearchParams; var URLSearchParamsPrototype$1 = $URLSearchParams.prototype; var getAll = uncurryThis$1(URLSearchParamsPrototype$1.getAll); var $has = uncurryThis$1(URLSearchParamsPrototype$1.has); var params = new $URLSearchParams('a=1'); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 if (params.has('a', 2) || !params.has('a', undefined)) { defineBuiltIn(URLSearchParamsPrototype$1, 'has', function has(name /* , value */) { var length = arguments.length; var $value = length < 2 ? undefined : arguments[1]; if (length && $value === undefined) return $has(this, name); var values = getAll(this, name); // also validates `this` validateArgumentsLength(length, 1); var value = toString($value); var index = 0; while (index < values.length) { if (values[index++] === value) return true; } return false; }, { enumerable: true, unsafe: true }); } var DESCRIPTORS = descriptors; var uncurryThis = functionUncurryThis; var defineBuiltInAccessor = defineBuiltInAccessor$o; var URLSearchParamsPrototype = URLSearchParams.prototype; var forEach = uncurryThis(URLSearchParamsPrototype.forEach); // `URLSearchParams.prototype.size` getter // https://github.com/whatwg/url/pull/734 if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) { defineBuiltInAccessor(URLSearchParamsPrototype, 'size', { get: function size() { var count = 0; forEach(this, function () { count++; }); return count; }, configurable: true, enumerable: true }); } rollup-3.29.4/test/form/samples/supports-core-js/main.js000066400000000000000000000000221450520414700232310ustar00rootroot00000000000000import 'core-js'; rollup-3.29.4/test/form/samples/supports-es5-shim/000077500000000000000000000000001450520414700220455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/supports-es5-shim/_config.js000066400000000000000000000007141450520414700240110ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports es5-shim', options: { onwarn(warning) { if (warning.code !== 'THIS_IS_UNDEFINED') { throw new Error(warning.message); } }, // TODO notable exception: Promise.resolve(thenable) not yet retained // check against tree-shake: false when updating the shim treeshake: true, plugins: [ require('@rollup/plugin-node-resolve').default(), require('@rollup/plugin-commonjs')() ] } }); rollup-3.29.4/test/form/samples/supports-es5-shim/_expected.js000066400000000000000000002757461450520414700243700ustar00rootroot00000000000000var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; var es5Shim = {exports: {}}; /*! * https://github.com/es-shims/es5-shim * @license es5-shim Copyright 2009-2020 by contributors, MIT License * see https://github.com/es-shims/es5-shim/blob/master/LICENSE */ (function (module, exports) { // UMD (Universal Module Definition) // see https://github.com/umdjs/umd/blob/master/templates/returnExports.js (function (root, factory) { /* global define */ { // Node. Does not work with strict CommonJS, but // only CommonJS-like enviroments that support module.exports, // like Node. module.exports = factory(); } }(commonjsGlobal, function () { /** * Brings an environment as close to ECMAScript 5 compliance * as is possible with the facilities of erstwhile engines. * * Annotated ES5: https://es5.github.io/ (specific links below) * ES5 Spec: https://www.ecma-international.org/wp-content/uploads/ECMA-262_5.1_edition_june_2011.pdf * Required reading: https://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/ */ // Shortcut to an often accessed properties, in order to avoid multiple // dereference that costs universally. This also holds a reference to known-good // functions. var $Array = Array; var ArrayPrototype = $Array.prototype; var $Object = Object; var ObjectPrototype = $Object.prototype; var $Function = Function; var FunctionPrototype = $Function.prototype; var $String = String; var StringPrototype = $String.prototype; var $Number = Number; var NumberPrototype = $Number.prototype; var array_slice = ArrayPrototype.slice; var array_splice = ArrayPrototype.splice; var array_push = ArrayPrototype.push; var array_unshift = ArrayPrototype.unshift; var array_concat = ArrayPrototype.concat; var array_join = ArrayPrototype.join; var call = FunctionPrototype.call; var apply = FunctionPrototype.apply; var max = Math.max; var min = Math.min; var floor = Math.floor; var abs = Math.abs; var pow = Math.pow; var round = Math.round; var log = Math.log; var LOG10E = Math.LOG10E; var log10 = Math.log10 || function log10(value) { return log(value) * LOG10E; }; // Having a toString local variable name breaks in Opera so use to_string. var to_string = ObjectPrototype.toString; /* eslint-disable one-var-declaration-per-line, no-redeclare, max-statements-per-line */ var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { return false; /* not a function */ } }, tryFunctionObject = function tryFunctionObject(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]', isCallable = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; }; var isRegex; /* inlined from https://npmjs.com/is-regex */ var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; }; var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; }; /* eslint-enable one-var-declaration-per-line, no-redeclare, max-statements-per-line */ /* inlined from https://npmjs.com/define-properties */ var supportsDescriptors = $Object.defineProperty && (function () { try { var obj = {}; $Object.defineProperty(obj, 'x', { enumerable: false, value: obj }); // eslint-disable-next-line no-unreachable-loop, max-statements-per-line for (var _ in obj) { return false; } // jscs:ignore disallowUnusedVariables return obj.x === obj; } catch (e) { /* this is ES3 */ return false; } }()); var defineProperties = (function (has) { // Define configurable, writable, and non-enumerable props // if they don't exist. var defineProperty; if (supportsDescriptors) { defineProperty = function (object, name, method, forceAssign) { if (!forceAssign && (name in object)) { return; } $Object.defineProperty(object, name, { configurable: true, enumerable: false, writable: true, value: method }); }; } else { defineProperty = function (object, name, method, forceAssign) { if (!forceAssign && (name in object)) { return; } object[name] = method; // eslint-disable-line no-param-reassign }; } return function defineProperties(object, map, forceAssign) { for (var name in map) { if (has.call(map, name)) { defineProperty(object, name, map[name], forceAssign); } } }; }(ObjectPrototype.hasOwnProperty)); // this is needed in Chrome 15 (probably earlier) - 36 // https://bugs.chromium.org/p/v8/issues/detail?id=3334 if ($Object.defineProperty && supportsDescriptors) { var F = function () {}; var toStringSentinel = {}; var sentinel = { toString: toStringSentinel }; $Object.defineProperty(F, 'prototype', { value: sentinel, writable: false }); if ((new F()).toString !== toStringSentinel) { var $dP = $Object.defineProperty; var $gOPD = $Object.getOwnPropertyDescriptor; defineProperties($Object, { defineProperty: function defineProperty(o, k, d) { var key = $String(k); if (typeof o === 'function' && key === 'prototype') { var desc = $gOPD(o, key); if (desc.writable && !d.writable && 'value' in d) { try { o[key] = d.value; // eslint-disable-line no-param-reassign } catch (e) { /**/ } } return $dP(o, key, { configurable: 'configurable' in d ? d.configurable : desc.configurable, enumerable: 'enumerable' in d ? d.enumerable : desc.enumerable, writable: d.writable }); } return $dP(o, key, d); } }, true); } } // // Util // ====== // /* replaceable with https://npmjs.com/package/es-abstract /helpers/isPrimitive */ var isPrimitive = function isPrimitive(input) { var type = typeof input; return input === null || (type !== 'object' && type !== 'function'); }; var isActualNaN = $Number.isNaN || function isActualNaN(x) { return x !== x; }; var ES = { // ES5 9.4 // https://es5.github.io/#x9.4 // http://jsperf.com/to-integer /* replaceable with https://npmjs.com/package/es-abstract ES5.ToInteger */ ToInteger: function ToInteger(num) { var n = +num; if (isActualNaN(n)) { n = 0; } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) { n = (n > 0 || -1) * floor(abs(n)); } return n; }, /* replaceable with https://npmjs.com/package/es-abstract ES5.ToPrimitive */ ToPrimitive: function ToPrimitive(input) { var val, valueOf, toStr; if (isPrimitive(input)) { return input; } valueOf = input.valueOf; if (isCallable(valueOf)) { val = valueOf.call(input); if (isPrimitive(val)) { return val; } } toStr = input.toString; if (isCallable(toStr)) { val = toStr.call(input); if (isPrimitive(val)) { return val; } } throw new TypeError(); }, // ES5 9.9 // https://es5.github.io/#x9.9 /* replaceable with https://npmjs.com/package/es-abstract ES5.ToObject */ ToObject: function (o) { if (o == null) { // this matches both null and undefined throw new TypeError("can't convert " + o + ' to object'); } return $Object(o); }, /* replaceable with https://npmjs.com/package/es-abstract ES5.ToUint32 */ ToUint32: function ToUint32(x) { return x >>> 0; } }; // // Function // ======== // // ES-5 15.3.4.5 // https://es5.github.io/#x15.3.4.5 var Empty = function Empty() {}; defineProperties(FunctionPrototype, { bind: function bind(that) { // .length is 1 // 1. Let Target be the this value. var target = this; // 2. If IsCallable(Target) is false, throw a TypeError exception. if (!isCallable(target)) { throw new TypeError('Function.prototype.bind called on incompatible ' + target); } // 3. Let A be a new (possibly empty) internal list of all of the // argument values provided after thisArg (arg1, arg2 etc), in order. // XXX slicedArgs will stand in for "A" if used var args = array_slice.call(arguments, 1); // for normal call // 4. Let F be a new native ECMAScript object. // 11. Set the [[Prototype]] internal property of F to the standard // built-in Function prototype object as specified in 15.3.3.1. // 12. Set the [[Call]] internal property of F as described in // 15.3.4.5.1. // 13. Set the [[Construct]] internal property of F as described in // 15.3.4.5.2. // 14. Set the [[HasInstance]] internal property of F as described in // 15.3.4.5.3. var bound; var binder = function () { if (this instanceof bound) { // 15.3.4.5.2 [[Construct]] // When the [[Construct]] internal method of a function object, // F that was created using the bind function is called with a // list of arguments ExtraArgs, the following steps are taken: // 1. Let target be the value of F's [[TargetFunction]] // internal property. // 2. If target has no [[Construct]] internal method, a // TypeError exception is thrown. // 3. Let boundArgs be the value of F's [[BoundArgs]] internal // property. // 4. Let args be a new list containing the same values as the // list boundArgs in the same order followed by the same // values as the list ExtraArgs in the same order. // 5. Return the result of calling the [[Construct]] internal // method of target providing args as the arguments. var result = apply.call( target, this, array_concat.call(args, array_slice.call(arguments)) ); if ($Object(result) === result) { return result; } return this; } // 15.3.4.5.1 [[Call]] // When the [[Call]] internal method of a function object, F, // which was created using the bind function is called with a // this value and a list of arguments ExtraArgs, the following // steps are taken: // 1. Let boundArgs be the value of F's [[BoundArgs]] internal // property. // 2. Let boundThis be the value of F's [[BoundThis]] internal // property. // 3. Let target be the value of F's [[TargetFunction]] internal // property. // 4. Let args be a new list containing the same values as the // list boundArgs in the same order followed by the same // values as the list ExtraArgs in the same order. // 5. Return the result of calling the [[Call]] internal method // of target providing boundThis as the this value and // providing args as the arguments. // equiv: target.call(this, ...boundArgs, ...args) return apply.call( target, that, array_concat.call(args, array_slice.call(arguments)) ); }; // 15. If the [[Class]] internal property of Target is "Function", then // a. Let L be the length property of Target minus the length of A. // b. Set the length own property of F to either 0 or L, whichever is // larger. // 16. Else set the length own property of F to 0. var boundLength = max(0, target.length - args.length); // 17. Set the attributes of the length own property of F to the values // specified in 15.3.5.1. var boundArgs = []; for (var i = 0; i < boundLength; i++) { array_push.call(boundArgs, '$' + i); } // XXX Build a dynamic function with desired amount of arguments is the only // way to set the length property of a function. // In environments where Content Security Policies enabled (Chrome extensions, // for ex.) all use of eval or Function costructor throws an exception. // However in all of these environments Function.prototype.bind exists // and so this code will never be executed. bound = $Function('binder', 'return function (' + array_join.call(boundArgs, ',') + '){ return binder.apply(this, arguments); }')(binder); if (target.prototype) { Empty.prototype = target.prototype; bound.prototype = new Empty(); // Clean up dangling references. Empty.prototype = null; } // TODO // 18. Set the [[Extensible]] internal property of F to true. // TODO // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3). // 20. Call the [[DefineOwnProperty]] internal method of F with // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]: // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and // false. // 21. Call the [[DefineOwnProperty]] internal method of F with // arguments "arguments", PropertyDescriptor {[[Get]]: thrower, // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false}, // and false. // TODO // NOTE Function objects created using Function.prototype.bind do not // have a prototype property or the [[Code]], [[FormalParameters]], and // [[Scope]] internal properties. // XXX can't delete prototype in pure-js. // 22. Return F. return bound; } }); // _Please note: Shortcuts are defined after `Function.prototype.bind` as we // use it in defining shortcuts. var owns = call.bind(ObjectPrototype.hasOwnProperty); var toStr = call.bind(ObjectPrototype.toString); var arraySlice = call.bind(array_slice); var arraySliceApply = apply.bind(array_slice); /* globals document */ if (typeof document === 'object' && document && document.documentElement) { try { arraySlice(document.documentElement.childNodes); } catch (e) { var origArraySlice = arraySlice; var origArraySliceApply = arraySliceApply; arraySlice = function arraySliceIE(arr) { var r = []; var i = arr.length; while (i-- > 0) { r[i] = arr[i]; } return origArraySliceApply(r, origArraySlice(arguments, 1)); }; arraySliceApply = function arraySliceApplyIE(arr, args) { return origArraySliceApply(arraySlice(arr), args); }; } } var strSlice = call.bind(StringPrototype.slice); var strSplit = call.bind(StringPrototype.split); var strIndexOf = call.bind(StringPrototype.indexOf); var pushCall = call.bind(array_push); var isEnum = call.bind(ObjectPrototype.propertyIsEnumerable); var arraySort = call.bind(ArrayPrototype.sort); // // Array // ===== // var isArray = $Array.isArray || function isArray(obj) { return toStr(obj) === '[object Array]'; }; // ES5 15.4.4.12 // https://es5.github.io/#x15.4.4.13 // Return len+argCount. // [bugfix, ielt8] // IE < 8 bug: [].unshift(0) === undefined but should be "1" var hasUnshiftReturnValueBug = [].unshift(0) !== 1; defineProperties(ArrayPrototype, { unshift: function () { array_unshift.apply(this, arguments); return this.length; } }, hasUnshiftReturnValueBug); // ES5 15.4.3.2 // https://es5.github.io/#x15.4.3.2 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray defineProperties($Array, { isArray: isArray }); // The IsCallable() check in the Array functions // has been replaced with a strict check on the // internal class of the object to trap cases where // the provided function was actually a regular // expression literal, which in V8 and // JavaScriptCore is a typeof "function". Only in // V8 are regular expression literals permitted as // reduce parameters, so it is desirable in the // general case for the shim to match the more // strict and common behavior of rejecting regular // expressions. // ES5 15.4.4.18 // https://es5.github.io/#x15.4.4.18 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach // Check failure of by-index access of string characters (IE < 9) // and failure of `0 in boxedString` (Rhino) var boxedString = $Object('a'); var splitString = boxedString[0] !== 'a' || !(0 in boxedString); var properlyBoxesContext = function properlyBoxed(method) { // Check node 0.6.21 bug where third parameter is not boxed var properlyBoxesNonStrict = true; var properlyBoxesStrict = true; var threwException = false; if (method) { try { method.call('foo', function (_, __, context) { if (typeof context !== 'object') { properlyBoxesNonStrict = false; } }); method.call([1], function () { 'use strict'; properlyBoxesStrict = typeof this === 'string'; }, 'x'); } catch (e) { threwException = true; } } return !!method && !threwException && properlyBoxesNonStrict && properlyBoxesStrict; }; defineProperties(ArrayPrototype, { forEach: function forEach(callbackfn/*, thisArg*/) { var object = ES.ToObject(this); var self = splitString && isString(this) ? strSplit(this, '') : object; var i = -1; var length = ES.ToUint32(self.length); var T; if (arguments.length > 1) { T = arguments[1]; } // If no callback function or if callback is not a callable function if (!isCallable(callbackfn)) { throw new TypeError('Array.prototype.forEach callback must be a function'); } while (++i < length) { if (i in self) { // Invoke the callback function with call, passing arguments: // context, property value, property key, thisArg object if (typeof T === 'undefined') { callbackfn(self[i], i, object); } else { callbackfn.call(T, self[i], i, object); } } } } }, !properlyBoxesContext(ArrayPrototype.forEach)); // ES5 15.4.4.19 // https://es5.github.io/#x15.4.4.19 // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map defineProperties(ArrayPrototype, { map: function map(callbackfn/*, thisArg*/) { var object = ES.ToObject(this); var self = splitString && isString(this) ? strSplit(this, '') : object; var length = ES.ToUint32(self.length); var result = $Array(length); var T; if (arguments.length > 1) { T = arguments[1]; } // If no callback function or if callback is not a callable function if (!isCallable(callbackfn)) { throw new TypeError('Array.prototype.map callback must be a function'); } for (var i = 0; i < length; i++) { if (i in self) { if (typeof T === 'undefined') { result[i] = callbackfn(self[i], i, object); } else { result[i] = callbackfn.call(T, self[i], i, object); } } } return result; } }, !properlyBoxesContext(ArrayPrototype.map)); // ES5 15.4.4.20 // https://es5.github.io/#x15.4.4.20 // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter defineProperties(ArrayPrototype, { filter: function filter(callbackfn/*, thisArg*/) { var object = ES.ToObject(this); var self = splitString && isString(this) ? strSplit(this, '') : object; var length = ES.ToUint32(self.length); var result = []; var value; var T; if (arguments.length > 1) { T = arguments[1]; } // If no callback function or if callback is not a callable function if (!isCallable(callbackfn)) { throw new TypeError('Array.prototype.filter callback must be a function'); } for (var i = 0; i < length; i++) { if (i in self) { value = self[i]; if (typeof T === 'undefined' ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) { pushCall(result, value); } } } return result; } }, !properlyBoxesContext(ArrayPrototype.filter)); // ES5 15.4.4.16 // https://es5.github.io/#x15.4.4.16 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every defineProperties(ArrayPrototype, { every: function every(callbackfn/*, thisArg*/) { var object = ES.ToObject(this); var self = splitString && isString(this) ? strSplit(this, '') : object; var length = ES.ToUint32(self.length); var T; if (arguments.length > 1) { T = arguments[1]; } // If no callback function or if callback is not a callable function if (!isCallable(callbackfn)) { throw new TypeError('Array.prototype.every callback must be a function'); } for (var i = 0; i < length; i++) { if (i in self && !(typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) { return false; } } return true; } }, !properlyBoxesContext(ArrayPrototype.every)); // ES5 15.4.4.17 // https://es5.github.io/#x15.4.4.17 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some defineProperties(ArrayPrototype, { some: function some(callbackfn/*, thisArg */) { var object = ES.ToObject(this); var self = splitString && isString(this) ? strSplit(this, '') : object; var length = ES.ToUint32(self.length); var T; if (arguments.length > 1) { T = arguments[1]; } // If no callback function or if callback is not a callable function if (!isCallable(callbackfn)) { throw new TypeError('Array.prototype.some callback must be a function'); } for (var i = 0; i < length; i++) { if (i in self && (typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) { return true; } } return false; } }, !properlyBoxesContext(ArrayPrototype.some)); // ES5 15.4.4.21 // https://es5.github.io/#x15.4.4.21 // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce var reduceCoercesToObject = false; if (ArrayPrototype.reduce) { reduceCoercesToObject = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) { return list; }) === 'object'; } defineProperties(ArrayPrototype, { reduce: function reduce(callbackfn/*, initialValue*/) { var object = ES.ToObject(this); var self = splitString && isString(this) ? strSplit(this, '') : object; var length = ES.ToUint32(self.length); // If no callback function or if callback is not a callable function if (!isCallable(callbackfn)) { throw new TypeError('Array.prototype.reduce callback must be a function'); } // no value to return if no initial value and an empty array if (length === 0 && arguments.length === 1) { throw new TypeError('reduce of empty array with no initial value'); } var i = 0; var result; if (arguments.length >= 2) { result = arguments[1]; } else { do { if (i in self) { result = self[i++]; break; } // if array contains no values, no initial value to return if (++i >= length) { throw new TypeError('reduce of empty array with no initial value'); } } while (true); } for (; i < length; i++) { if (i in self) { result = callbackfn(result, self[i], i, object); } } return result; } }, !reduceCoercesToObject); // ES5 15.4.4.22 // https://es5.github.io/#x15.4.4.22 // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight var reduceRightCoercesToObject = false; if (ArrayPrototype.reduceRight) { reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) { return list; }) === 'object'; } defineProperties(ArrayPrototype, { reduceRight: function reduceRight(callbackfn/*, initial*/) { var object = ES.ToObject(this); var self = splitString && isString(this) ? strSplit(this, '') : object; var length = ES.ToUint32(self.length); // If no callback function or if callback is not a callable function if (!isCallable(callbackfn)) { throw new TypeError('Array.prototype.reduceRight callback must be a function'); } // no value to return if no initial value, empty array if (length === 0 && arguments.length === 1) { throw new TypeError('reduceRight of empty array with no initial value'); } var result; var i = length - 1; if (arguments.length >= 2) { result = arguments[1]; } else { do { if (i in self) { result = self[i--]; break; } // if array contains no values, no initial value to return if (--i < 0) { throw new TypeError('reduceRight of empty array with no initial value'); } } while (true); } if (i < 0) { return result; } do { if (i in self) { result = callbackfn(result, self[i], i, object); } } while (i--); return result; } }, !reduceRightCoercesToObject); // ES5 15.4.4.14 // https://es5.github.io/#x15.4.4.14 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1; defineProperties(ArrayPrototype, { indexOf: function indexOf(searchElement/*, fromIndex */) { var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this); var length = ES.ToUint32(self.length); if (length === 0) { return -1; } var i = 0; if (arguments.length > 1) { i = ES.ToInteger(arguments[1]); } // handle negative indices i = i >= 0 ? i : max(0, length + i); for (; i < length; i++) { if (i in self && self[i] === searchElement) { return i; } } return -1; } }, hasFirefox2IndexOfBug); // ES5 15.4.4.15 // https://es5.github.io/#x15.4.4.15 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1; defineProperties(ArrayPrototype, { lastIndexOf: function lastIndexOf(searchElement/*, fromIndex */) { var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this); var length = ES.ToUint32(self.length); if (length === 0) { return -1; } var i = length - 1; if (arguments.length > 1) { i = min(i, ES.ToInteger(arguments[1])); } // handle negative indices i = i >= 0 ? i : length - abs(i); for (; i >= 0; i--) { if (i in self && searchElement === self[i]) { return i; } } return -1; } }, hasFirefox2LastIndexOfBug); // ES5 15.4.4.12 // https://es5.github.io/#x15.4.4.12 var spliceNoopReturnsEmptyArray = (function () { var a = [1, 2]; var result = a.splice(); return a.length === 2 && isArray(result) && result.length === 0; }()); defineProperties(ArrayPrototype, { // Safari 5.0 bug where .splice() returns undefined splice: function splice(start, deleteCount) { if (arguments.length === 0) { return []; } return array_splice.apply(this, arguments); } }, !spliceNoopReturnsEmptyArray); var spliceWorksWithEmptyObject = (function () { var obj = {}; ArrayPrototype.splice.call(obj, 0, 0, 1); return obj.length === 1; }()); var hasES6Defaults = [0, 1, 2].splice(0).length === 3; defineProperties(ArrayPrototype, { splice: function splice(start, deleteCount) { if (arguments.length === 0) { return []; } var args = arguments; this.length = max(ES.ToInteger(this.length), 0); if (arguments.length > 0 && typeof deleteCount !== 'number') { args = arraySlice(arguments); if (args.length < 2) { pushCall(args, this.length - start); } else { args[1] = ES.ToInteger(deleteCount); } } return array_splice.apply(this, args); } }, !spliceWorksWithEmptyObject || !hasES6Defaults); var spliceWorksWithLargeSparseArrays = (function () { // Per https://github.com/es-shims/es5-shim/issues/295 // Safari 7/8 breaks with sparse arrays of size 1e5 or greater var arr = new $Array(1e5); // note: the index MUST be 8 or larger or the test will false pass arr[8] = 'x'; arr.splice(1, 1); // note: this test must be defined *after* the indexOf shim // per https://github.com/es-shims/es5-shim/issues/313 return arr.indexOf('x') === 7; }()); var spliceWorksWithSmallSparseArrays = (function () { // Per https://github.com/es-shims/es5-shim/issues/295 // Opera 12.15 breaks on this, no idea why. var n = 256; var arr = []; arr[n] = 'a'; arr.splice(n + 1, 0, 'b'); return arr[n] === 'a'; }()); defineProperties(ArrayPrototype, { splice: function splice(start, deleteCount) { var O = ES.ToObject(this); var A = []; var len = ES.ToUint32(O.length); var relativeStart = ES.ToInteger(start); var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len); var actualDeleteCount = arguments.length === 0 ? 0 : arguments.length === 1 ? len - actualStart : min(max(ES.ToInteger(deleteCount), 0), len - actualStart); var k = 0; var from; while (k < actualDeleteCount) { from = $String(actualStart + k); if (owns(O, from)) { A[k] = O[from]; } k += 1; } var items = arraySlice(arguments, 2); var itemCount = items.length; var to; if (itemCount < actualDeleteCount) { k = actualStart; var maxK = len - actualDeleteCount; while (k < maxK) { from = $String(k + actualDeleteCount); to = $String(k + itemCount); if (owns(O, from)) { O[to] = O[from]; } else { delete O[to]; } k += 1; } k = len; var minK = len - actualDeleteCount + itemCount; while (k > minK) { delete O[k - 1]; k -= 1; } } else if (itemCount > actualDeleteCount) { k = len - actualDeleteCount; while (k > actualStart) { from = $String(k + actualDeleteCount - 1); to = $String(k + itemCount - 1); if (owns(O, from)) { O[to] = O[from]; } else { delete O[to]; } k -= 1; } } k = actualStart; for (var i = 0; i < items.length; ++i) { O[k] = items[i]; k += 1; } O.length = len - actualDeleteCount + itemCount; return A; } }, !spliceWorksWithLargeSparseArrays || !spliceWorksWithSmallSparseArrays); var originalJoin = ArrayPrototype.join; var hasStringJoinBug; try { hasStringJoinBug = Array.prototype.join.call('123', ',') !== '1,2,3'; } catch (e) { hasStringJoinBug = true; } if (hasStringJoinBug) { defineProperties(ArrayPrototype, { join: function join(separator) { var sep = typeof separator === 'undefined' ? ',' : separator; return originalJoin.call(isString(this) ? strSplit(this, '') : this, sep); } }, hasStringJoinBug); } var hasJoinUndefinedBug = [1, 2].join(undefined) !== '1,2'; if (hasJoinUndefinedBug) { defineProperties(ArrayPrototype, { join: function join(separator) { var sep = typeof separator === 'undefined' ? ',' : separator; return originalJoin.call(this, sep); } }, hasJoinUndefinedBug); } var pushShim = function push(item) { var O = ES.ToObject(this); var n = ES.ToUint32(O.length); var i = 0; while (i < arguments.length) { O[n + i] = arguments[i]; i += 1; } O.length = n + i; return n + i; }; var pushIsNotGeneric = (function () { var obj = {}; var result = Array.prototype.push.call(obj, undefined); return result !== 1 || obj.length !== 1 || typeof obj[0] !== 'undefined' || !owns(obj, 0); }()); defineProperties(ArrayPrototype, { push: function push(item) { if (isArray(this)) { return array_push.apply(this, arguments); } return pushShim.apply(this, arguments); } }, pushIsNotGeneric); // This fixes a very weird bug in Opera 10.6 when pushing `undefined var pushUndefinedIsWeird = (function () { var arr = []; var result = arr.push(undefined); return result !== 1 || arr.length !== 1 || typeof arr[0] !== 'undefined' || !owns(arr, 0); }()); defineProperties(ArrayPrototype, { push: pushShim }, pushUndefinedIsWeird); // ES5 15.2.3.14 // https://es5.github.io/#x15.4.4.10 // Fix boxed string bug defineProperties(ArrayPrototype, { slice: function (start, end) { var arr = isString(this) ? strSplit(this, '') : this; return arraySliceApply(arr, arguments); } }, splitString); var sortIgnoresNonFunctions = (function () { try { [1, 2].sort(null); } catch (e) { try { [1, 2].sort({}); } catch (e2) { return false; } } return true; }()); var sortThrowsOnRegex = (function () { // this is a problem in Firefox 4, in which `typeof /a/ === 'function'` try { [1, 2].sort(/a/); return false; } catch (e) {} return true; }()); var sortIgnoresUndefined = (function () { // applies in IE 8, for one. try { [1, 2].sort(undefined); return true; } catch (e) {} return false; }()); defineProperties(ArrayPrototype, { sort: function sort(compareFn) { if (typeof compareFn === 'undefined') { return arraySort(this); } if (!isCallable(compareFn)) { throw new TypeError('Array.prototype.sort callback must be a function'); } return arraySort(this, compareFn); } }, sortIgnoresNonFunctions || !sortIgnoresUndefined || !sortThrowsOnRegex); // // Object // ====== // // ES5 15.2.3.14 // https://es5.github.io/#x15.2.3.14 // https://web.archive.org/web/20140727042234/http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation // eslint-disable-next-line quote-props var hasDontEnumBug = !isEnum({ 'toString': null }, 'toString'); // jscs:ignore disallowQuotedKeysInObjects var hasProtoEnumBug = isEnum(function () {}, 'prototype'); var hasStringEnumBug = !owns('x', '0'); var equalsConstructorPrototype = function (o) { var ctor = o.constructor; return ctor && ctor.prototype === o; }; var excludedKeys = { $applicationCache: true, $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $onmozfullscreenchange: true, $onmozfullscreenerror: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true, $width: true, $height: true, $top: true, $localStorage: true }; var hasAutomationEqualityBug = (function () { /* globals window */ if (typeof window === 'undefined') { return false; } for (var k in window) { try { if (!excludedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') { equalsConstructorPrototype(window[k]); } } catch (e) { return true; } } return false; }()); var equalsConstructorPrototypeIfNotBuggy = function (object) { if (typeof window === 'undefined' || !hasAutomationEqualityBug) { return equalsConstructorPrototype(object); } try { return equalsConstructorPrototype(object); } catch (e) { return false; } }; var dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ]; var dontEnumsLength = dontEnums.length; // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js // can be replaced with require('is-arguments') if we ever use a build process instead var isStandardArguments = function isArguments(value) { return toStr(value) === '[object Arguments]'; }; var isLegacyArguments = function isArguments(value) { return value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && !isArray(value) && isCallable(value.callee); }; var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments; defineProperties($Object, { keys: function keys(object) { var isFn = isCallable(object); var isArgs = isArguments(object); var isObject = object !== null && typeof object === 'object'; var isStr = isObject && isString(object); if (!isObject && !isFn && !isArgs) { throw new TypeError('Object.keys called on a non-object'); } var theKeys = []; var skipProto = hasProtoEnumBug && isFn; if ((isStr && hasStringEnumBug) || isArgs) { for (var i = 0; i < object.length; ++i) { pushCall(theKeys, $String(i)); } } if (!isArgs) { for (var name in object) { if (!(skipProto && name === 'prototype') && owns(object, name)) { pushCall(theKeys, $String(name)); } } } if (hasDontEnumBug) { var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); for (var j = 0; j < dontEnumsLength; j++) { var dontEnum = dontEnums[j]; if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) { pushCall(theKeys, dontEnum); } } } return theKeys; } }); var keysWorksWithArguments = $Object.keys && (function () { // Safari 5.0 bug return $Object.keys(arguments).length === 2; }(1, 2)); var keysHasArgumentsLengthBug = $Object.keys && (function () { var argKeys = $Object.keys(arguments); return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1; }(1)); var originalKeys = $Object.keys; defineProperties($Object, { keys: function keys(object) { if (isArguments(object)) { return originalKeys(arraySlice(object)); } return originalKeys(object); } }, !keysWorksWithArguments || keysHasArgumentsLengthBug); // // Date // ==== // var hasNegativeMonthYearBug = new Date(-3509827329600292).getUTCMonth() !== 0; var aNegativeTestDate = new Date(-1509842289600292); var aPositiveTestDate = new Date(1449662400000); var hasToUTCStringFormatBug = aNegativeTestDate.toUTCString() !== 'Mon, 01 Jan -45875 11:59:59 GMT'; var hasToDateStringFormatBug; var hasToStringFormatBug; var timeZoneOffset = aNegativeTestDate.getTimezoneOffset(); if (timeZoneOffset < -720) { hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875'; hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/).test(String(aPositiveTestDate)); } else { hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875'; hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/).test(String(aPositiveTestDate)); } var originalGetFullYear = call.bind(Date.prototype.getFullYear); var originalGetMonth = call.bind(Date.prototype.getMonth); var originalGetDate = call.bind(Date.prototype.getDate); var originalGetUTCFullYear = call.bind(Date.prototype.getUTCFullYear); var originalGetUTCMonth = call.bind(Date.prototype.getUTCMonth); var originalGetUTCDate = call.bind(Date.prototype.getUTCDate); var originalGetUTCDay = call.bind(Date.prototype.getUTCDay); var originalGetUTCHours = call.bind(Date.prototype.getUTCHours); var originalGetUTCMinutes = call.bind(Date.prototype.getUTCMinutes); var originalGetUTCSeconds = call.bind(Date.prototype.getUTCSeconds); var originalGetUTCMilliseconds = call.bind(Date.prototype.getUTCMilliseconds); var dayName = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; var monthName = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var daysInMonth = function daysInMonth(month, year) { return originalGetDate(new Date(year, month, 0)); }; defineProperties(Date.prototype, { getFullYear: function getFullYear() { if (!this || !(this instanceof Date)) { throw new TypeError('this is not a Date object.'); } var year = originalGetFullYear(this); if (year < 0 && originalGetMonth(this) > 11) { return year + 1; } return year; }, getMonth: function getMonth() { if (!this || !(this instanceof Date)) { throw new TypeError('this is not a Date object.'); } var year = originalGetFullYear(this); var month = originalGetMonth(this); if (year < 0 && month > 11) { return 0; } return month; }, getDate: function getDate() { if (!this || !(this instanceof Date)) { throw new TypeError('this is not a Date object.'); } var year = originalGetFullYear(this); var month = originalGetMonth(this); var date = originalGetDate(this); if (year < 0 && month > 11) { if (month === 12) { return date; } var days = daysInMonth(0, year + 1); return (days - date) + 1; } return date; }, getUTCFullYear: function getUTCFullYear() { if (!this || !(this instanceof Date)) { throw new TypeError('this is not a Date object.'); } var year = originalGetUTCFullYear(this); if (year < 0 && originalGetUTCMonth(this) > 11) { return year + 1; } return year; }, getUTCMonth: function getUTCMonth() { if (!this || !(this instanceof Date)) { throw new TypeError('this is not a Date object.'); } var year = originalGetUTCFullYear(this); var month = originalGetUTCMonth(this); if (year < 0 && month > 11) { return 0; } return month; }, getUTCDate: function getUTCDate() { if (!this || !(this instanceof Date)) { throw new TypeError('this is not a Date object.'); } var year = originalGetUTCFullYear(this); var month = originalGetUTCMonth(this); var date = originalGetUTCDate(this); if (year < 0 && month > 11) { if (month === 12) { return date; } var days = daysInMonth(0, year + 1); return (days - date) + 1; } return date; } }, hasNegativeMonthYearBug); defineProperties(Date.prototype, { toUTCString: function toUTCString() { if (!this || !(this instanceof Date)) { throw new TypeError('this is not a Date object.'); } var day = originalGetUTCDay(this); var date = originalGetUTCDate(this); var month = originalGetUTCMonth(this); var year = originalGetUTCFullYear(this); var hour = originalGetUTCHours(this); var minute = originalGetUTCMinutes(this); var second = originalGetUTCSeconds(this); return dayName[day] + ', ' + (date < 10 ? '0' + date : date) + ' ' + monthName[month] + ' ' + year + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute) + ':' + (second < 10 ? '0' + second : second) + ' GMT'; } }, hasNegativeMonthYearBug || hasToUTCStringFormatBug); // Opera 12 has `,` defineProperties(Date.prototype, { toDateString: function toDateString() { if (!this || !(this instanceof Date)) { throw new TypeError('this is not a Date object.'); } var day = this.getDay(); var date = this.getDate(); var month = this.getMonth(); var year = this.getFullYear(); return dayName[day] + ' ' + monthName[month] + ' ' + (date < 10 ? '0' + date : date) + ' ' + year; } }, hasNegativeMonthYearBug || hasToDateStringFormatBug); // can't use defineProperties here because of toString enumeration issue in IE <= 8 if (hasNegativeMonthYearBug || hasToStringFormatBug) { Date.prototype.toString = function toString() { if (!this || !(this instanceof Date)) { throw new TypeError('this is not a Date object.'); } var day = this.getDay(); var date = this.getDate(); var month = this.getMonth(); var year = this.getFullYear(); var hour = this.getHours(); var minute = this.getMinutes(); var second = this.getSeconds(); var timezoneOffset = this.getTimezoneOffset(); var hoursOffset = floor(abs(timezoneOffset) / 60); var minutesOffset = floor(abs(timezoneOffset) % 60); return dayName[day] + ' ' + monthName[month] + ' ' + (date < 10 ? '0' + date : date) + ' ' + year + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute) + ':' + (second < 10 ? '0' + second : second) + ' GMT' + (timezoneOffset > 0 ? '-' : '+') + (hoursOffset < 10 ? '0' + hoursOffset : hoursOffset) + (minutesOffset < 10 ? '0' + minutesOffset : minutesOffset); }; if (supportsDescriptors) { $Object.defineProperty(Date.prototype, 'toString', { configurable: true, enumerable: false, writable: true }); } } // ES5 15.9.5.43 // https://es5.github.io/#x15.9.5.43 // This function returns a String value represent the instance in time // represented by this Date object. The format of the String is the Date Time // string format defined in 15.9.1.15. All fields are present in the String. // The time zone is always UTC, denoted by the suffix Z. If the time value of // this object is not a finite Number a RangeError exception is thrown. var negativeDate = -62198755200000; var negativeYearString = '-000001'; var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1; // eslint-disable-line max-len var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z'; var getTime = call.bind(Date.prototype.getTime); defineProperties(Date.prototype, { toISOString: function toISOString() { if (!isFinite(this) || !isFinite(getTime(this))) { // Adope Photoshop requires the second check. throw new RangeError('Date.prototype.toISOString called on non-finite value.'); } var year = originalGetUTCFullYear(this); var month = originalGetUTCMonth(this); // see https://github.com/es-shims/es5-shim/issues/111 year += floor(month / 12); month = ((month % 12) + 12) % 12; // the date time string format is specified in 15.9.1.15. var result = [ month + 1, originalGetUTCDate(this), originalGetUTCHours(this), originalGetUTCMinutes(this), originalGetUTCSeconds(this) ]; year = ( (year < 0 ? '-' : (year > 9999 ? '+' : '')) + strSlice('00000' + abs(year), (0 <= year && year <= 9999) ? -4 : -6) ); for (var i = 0; i < result.length; ++i) { // pad months, days, hours, minutes, and seconds to have two digits. result[i] = strSlice('00' + result[i], -2); } // pad milliseconds to have three digits. return ( year + '-' + arraySlice(result, 0, 2).join('-') + 'T' + arraySlice(result, 2).join(':') + '.' + strSlice('000' + originalGetUTCMilliseconds(this), -3) + 'Z' ); } }, hasNegativeDateBug || hasSafari51DateBug); // ES5 15.9.5.44 // https://es5.github.io/#x15.9.5.44 // This function provides a String representation of a Date object for use by // JSON.stringify (15.12.3). var dateToJSONIsSupported = (function () { try { return Date.prototype.toJSON && new Date(NaN).toJSON() === null && new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 && Date.prototype.toJSON.call({ // generic toISOString: function () { return true; } }); } catch (e) { return false; } }()); if (!dateToJSONIsSupported) { Date.prototype.toJSON = function toJSON(key) { // When the toJSON method is called with argument key, the following // steps are taken: // 1. Let O be the result of calling ToObject, giving it the this // value as its argument. // 2. Let tv be ES.ToPrimitive(O, hint Number). var O = $Object(this); var tv = ES.ToPrimitive(O); // 3. If tv is a Number and is not finite, return null. if (typeof tv === 'number' && !isFinite(tv)) { return null; } // 4. Let toISO be the result of calling the [[Get]] internal method of // O with argument "toISOString". var toISO = O.toISOString; // 5. If IsCallable(toISO) is false, throw a TypeError exception. if (!isCallable(toISO)) { throw new TypeError('toISOString property is not callable'); } // 6. Return the result of calling the [[Call]] internal method of // toISO with O as the this value and an empty argument list. return toISO.call(O); // NOTE 1 The argument is ignored. // NOTE 2 The toJSON function is intentionally generic; it does not // require that its this value be a Date object. Therefore, it can be // transferred to other kinds of objects for use as a method. However, // it does require that any such object have a toISOString method. An // object is free to use the argument key to filter its // stringification. }; } // ES5 15.9.4.2 // https://es5.github.io/#x15.9.4.2 // based on work shared by Daniel Friesen (dantman) // https://gist.github.com/303249 var supportsExtendedYears = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15; var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z')) || !isNaN(Date.parse('2012-12-31T23:59:60.000Z')); var doesNotParseY2KNewYear = isNaN(Date.parse('2000-01-01T00:00:00.000Z')); if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) { // XXX global assignment won't work in embeddings that use // an alternate object for the context. var maxSafeUnsigned32Bit = pow(2, 31) - 1; var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime()); // eslint-disable-next-line no-implicit-globals, no-global-assign Date = (function (NativeDate) { // Date.length === 7 var DateShim = function Date(Y, M, D, h, m, s, ms) { var length = arguments.length; var date; if (this instanceof NativeDate) { var seconds = s; var millis = ms; if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) { // work around a Safari 8/9 bug where it treats the seconds as signed var msToShift = floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit; var sToShift = floor(msToShift / 1e3); seconds += sToShift; millis -= sToShift * 1e3; } var parsed = DateShim.parse(Y); var hasNegTimestampParseBug = isNaN(parsed); date = length === 1 && $String(Y) === Y && !hasNegTimestampParseBug // isString(Y) // We explicitly pass it through parse: ? new NativeDate(parsed) // We have to manually make calls depending on argument // length here : length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis) : length >= 6 ? new NativeDate(Y, M, D, h, m, seconds) : length >= 5 ? new NativeDate(Y, M, D, h, m) : length >= 4 ? new NativeDate(Y, M, D, h) : length >= 3 ? new NativeDate(Y, M, D) : length >= 2 ? new NativeDate(Y, M) : length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y) : new NativeDate(); } else { date = NativeDate.apply(this, arguments); } if (!isPrimitive(date)) { // Prevent mixups with unfixed Date object defineProperties(date, { constructor: DateShim }, true); } return date; }; // 15.9.1.15 Date Time String Format. var isoDateExpression = new RegExp('^' + '(\\d{4}|[+-]\\d{6})' // four-digit year capture or sign + 6-digit extended year + '(?:-(\\d{2})' // optional month capture + '(?:-(\\d{2})' // optional day capture + '(?:' // capture hours:minutes:seconds.milliseconds + 'T(\\d{2})' // hours capture + ':(\\d{2})' // minutes capture + '(?:' // optional :seconds.milliseconds + ':(\\d{2})' // seconds capture + '(?:(\\.\\d{1,}))?' // milliseconds capture + ')?' + '(' // capture UTC offset component + 'Z|' // UTC capture + '(?:' // offset specifier +/-hours:minutes + '([-+])' // sign capture + '(\\d{2})' // hours offset capture + ':(\\d{2})' // minutes offset capture + ')' + ')?)?)?)?' + '$'); var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; var dayFromMonth = function dayFromMonth(year, month) { var t = month > 1 ? 1 : 0; return ( months[month] + floor((year - 1969 + t) / 4) - floor((year - 1901 + t) / 100) + floor((year - 1601 + t) / 400) + (365 * (year - 1970)) ); }; var toUTC = function toUTC(t) { var s = 0; var ms = t; if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) { // work around a Safari 8/9 bug where it treats the seconds as signed var msToShift = floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit; var sToShift = floor(msToShift / 1e3); s += sToShift; ms -= sToShift * 1e3; } return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms)); }; // Copy any custom methods a 3rd party library may have added for (var key in NativeDate) { if (owns(NativeDate, key)) { DateShim[key] = NativeDate[key]; } } // Copy "native" methods explicitly; they may be non-enumerable defineProperties(DateShim, { now: NativeDate.now, UTC: NativeDate.UTC }, true); DateShim.prototype = NativeDate.prototype; defineProperties(DateShim.prototype, { constructor: DateShim }, true); // Upgrade Date.parse to handle simplified ISO 8601 strings var parseShim = function parse(string) { var match = isoDateExpression.exec(string); if (match) { // parse months, days, hours, minutes, seconds, and milliseconds // provide default values if necessary // parse the UTC offset component var year = $Number(match[1]), month = $Number(match[2] || 1) - 1, day = $Number(match[3] || 1) - 1, hour = $Number(match[4] || 0), minute = $Number(match[5] || 0), second = $Number(match[6] || 0), millisecond = floor($Number(match[7] || 0) * 1000), // When time zone is missed, local offset should be used // (ES 5.1 bug) // see https://bugs.ecmascript.org/show_bug.cgi?id=112 isLocalTime = Boolean(match[4] && !match[8]), signOffset = match[9] === '-' ? 1 : -1, hourOffset = $Number(match[10] || 0), minuteOffset = $Number(match[11] || 0), result; var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0; if ( hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) && minute < 60 && second < 60 && millisecond < 1000 && month > -1 && month < 12 && hourOffset < 24 && minuteOffset < 60 // detect invalid offsets && day > -1 && day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month)) ) { result = ( ((dayFromMonth(year, month) + day) * 24) + hour + (hourOffset * signOffset) ) * 60; result = (( ((result + minute + (minuteOffset * signOffset)) * 60) + second ) * 1000) + millisecond; if (isLocalTime) { result = toUTC(result); } if (-8.64e15 <= result && result <= 8.64e15) { return result; } } return NaN; } return NativeDate.parse.apply(this, arguments); }; defineProperties(DateShim, { parse: parseShim }); return DateShim; }(Date)); } // ES5 15.9.4.4 // https://es5.github.io/#x15.9.4.4 if (!Date.now) { Date.now = function now() { return new Date().getTime(); }; } // // Number // ====== // // ES5.1 15.7.4.5 // https://es5.github.io/#x15.7.4.5 var hasToFixedBugs = NumberPrototype.toFixed && ( (0.00008).toFixed(3) !== '0.000' || (0.9).toFixed(0) !== '1' || (1.255).toFixed(2) !== '1.25' || (1000000000000000128).toFixed(0) !== '1000000000000000128' ); var toFixedHelpers = { base: 1e7, size: 6, data: [0, 0, 0, 0, 0, 0], multiply: function multiply(n, c) { var i = -1; var c2 = c; while (++i < toFixedHelpers.size) { c2 += n * toFixedHelpers.data[i]; toFixedHelpers.data[i] = c2 % toFixedHelpers.base; c2 = floor(c2 / toFixedHelpers.base); } }, divide: function divide(n) { var i = toFixedHelpers.size; var c = 0; while (--i >= 0) { c += toFixedHelpers.data[i]; toFixedHelpers.data[i] = floor(c / n); c = (c % n) * toFixedHelpers.base; } }, numToString: function numToString() { var i = toFixedHelpers.size; var s = ''; while (--i >= 0) { if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) { var t = $String(toFixedHelpers.data[i]); if (s === '') { s = t; } else { s += strSlice('0000000', 0, 7 - t.length) + t; } } } return s; }, pow: function pow(x, n, acc) { return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc))); }, log: function log(x) { var n = 0; var x2 = x; while (x2 >= 4096) { n += 12; x2 /= 4096; } while (x2 >= 2) { n += 1; x2 /= 2; } return n; } }; var toFixedShim = function toFixed(fractionDigits) { var f, x, s, m, e, z, j, k; // Test for NaN and round fractionDigits down f = $Number(fractionDigits); f = isActualNaN(f) ? 0 : floor(f); if (f < 0 || f > 20) { throw new RangeError('Number.toFixed called with invalid number of decimals'); } x = $Number(this); if (isActualNaN(x)) { return 'NaN'; } // If it is too big or small, return the string value of the number if (x <= -1e21 || x >= 1e21) { return $String(x); } s = ''; if (x < 0) { s = '-'; x = -x; } m = '0'; if (x > 1e-21) { // 1e-21 < x < 1e21 // -70 < log2(x) < 70 e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69; z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1)); z *= 0x10000000000000; // pow(2, 52); e = 52 - e; // -18 < e < 122 // x = z / 2 ^ e if (e > 0) { toFixedHelpers.multiply(0, z); j = f; while (j >= 7) { toFixedHelpers.multiply(1e7, 0); j -= 7; } toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0); j = e - 1; while (j >= 23) { toFixedHelpers.divide(1 << 23); j -= 23; } toFixedHelpers.divide(1 << j); toFixedHelpers.multiply(1, 1); toFixedHelpers.divide(2); m = toFixedHelpers.numToString(); } else { toFixedHelpers.multiply(0, z); toFixedHelpers.multiply(1 << (-e), 0); m = toFixedHelpers.numToString() + strSlice('0.00000000000000000000', 2, 2 + f); } } if (f > 0) { k = m.length; if (k <= f) { m = s + strSlice('0.0000000000000000000', 0, f - k + 2) + m; } else { m = s + strSlice(m, 0, k - f) + '.' + strSlice(m, k - f); } } else { m = s + m; } return m; }; defineProperties(NumberPrototype, { toFixed: toFixedShim }, hasToFixedBugs); var hasToExponentialRoundingBug = (function () { try { return (-6.9e-11).toExponential(4) !== '-6.9000e-11'; } catch (e) { return false; } }()); var toExponentialAllowsInfiniteDigits = (function () { try { (1).toExponential(Infinity); (1).toExponential(-Infinity); return true; } catch (e) { return false; } }()); var originalToExponential = call.bind(NumberPrototype.toExponential); var numberToString = call.bind(NumberPrototype.toString); var numberValueOf = call.bind(NumberPrototype.valueOf); defineProperties(NumberPrototype, { toExponential: function toExponential(fractionDigits) { // 1: Let x be this Number value. var x = numberValueOf(this); if (typeof fractionDigits === 'undefined') { return originalToExponential(x); } var f = ES.ToInteger(fractionDigits); if (isActualNaN(x)) { return 'NaN'; } if (f < 0 || f > 20) { if (!isFinite(f)) { // IE 6 doesn't throw in the native one throw new RangeError('toExponential() argument must be between 0 and 20'); } // this will probably have thrown already return originalToExponential(x, f); } // only cases left are a finite receiver + in-range fractionDigits // implementation adapted from https://gist.github.com/SheetJSDev/1100ad56b9f856c95299ed0e068eea08 // 4: Let s be the empty string var s = ''; // 5: If x < 0 if (x < 0) { s = '-'; x = -x; } // 6: If x = +Infinity if (x === Infinity) { return s + 'Infinity'; } // 7: If fractionDigits is not undefined and (f < 0 or f > 20), throw a RangeError exception. if (typeof fractionDigits !== 'undefined' && (f < 0 || f > 20)) { throw new RangeError('Fraction digits ' + fractionDigits + ' out of range'); } var m = ''; var e = 0; var c = ''; var d = ''; // 8: If x = 0 then if (x === 0) { e = 0; f = 0; m = '0'; } else { // 9: Else, x != 0 var L = log10(x); e = floor(L); // 10 ** e <= x and x < 10 ** (e+1) var n = 0; if (typeof fractionDigits !== 'undefined') { // eslint-disable-line no-negated-condition var w = pow(10, e - f); // x / 10 ** (f+1) < w and w <= x / 10 ** f n = round(x / w); // 10 ** f <= n and n < 10 ** (f+1) if (2 * x >= (((2 * n) + 1) * w)) { n += 1; // pick larger value } if (n >= pow(10, f + 1)) { // 10e-1 = 1e0 n /= 10; e += 1; } } else { f = 16; // start from Math.ceil(Math.log10(Number.MAX_SAFE_INTEGER)) and loop down var guess_n = round(pow(10, L - e + f)); var target_f = f; while (f-- > 0) { guess_n = round(pow(10, L - e + f)); if ( abs((guess_n * pow(10, e - f)) - x) <= abs((n * pow(10, e - target_f)) - x) ) { target_f = f; n = guess_n; } } } m = numberToString(n, 10); if (typeof fractionDigits === 'undefined') { while (strSlice(m, -1) === '0') { m = strSlice(m, 0, -1); d += 1; } } } // 10: If f != 0, then if (f !== 0) { m = strSlice(m, 0, 1) + '.' + strSlice(m, 1); } // 11: If e = 0, then if (e === 0) { c = '+'; d = '0'; } else { // 12: Else c = e > 0 ? '+' : '-'; d = numberToString(abs(e), 10); } // 13: Let m be the concatenation of the four Strings m, "e", c, and d. m += 'e' + c + d; // 14: Return the concatenation of the Strings s and m. return s + m; } }, hasToExponentialRoundingBug || toExponentialAllowsInfiniteDigits); var hasToPrecisionUndefinedBug = (function () { try { return 1.0.toPrecision(undefined) === '1'; } catch (e) { return true; } }()); var originalToPrecision = call.bind(NumberPrototype.toPrecision); defineProperties(NumberPrototype, { toPrecision: function toPrecision(precision) { return typeof precision === 'undefined' ? originalToPrecision(this) : originalToPrecision(this, precision); } }, hasToPrecisionUndefinedBug); // // String // ====== // // ES5 15.5.4.14 // https://es5.github.io/#x15.5.4.14 // [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers] // Many browsers do not split properly with regular expressions or they // do not perform the split correctly under obscure conditions. // See https://blog.stevenlevithan.com/archives/cross-browser-split // I've tested in many browsers and this seems to cover the deviant ones: // 'ab'.split(/(?:ab)*/) should be ["", ""], not [""] // '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""] // 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not // [undefined, "t", undefined, "e", ...] // ''.split(/.?/) should be [], not [""] // '.'.split(/()()/) should be ["."], not ["", "", "."] if ( 'ab'.split(/(?:ab)*/).length !== 2 || '.'.split(/(.?)(.?)/).length !== 4 || 'tesst'.split(/(s)*/)[1] === 't' || 'test'.split(/(?:)/, -1).length !== 4 || ''.split(/.?/).length || '.'.split(/()()/).length > 1 ) { (function () { var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group var maxSafe32BitInt = pow(2, 32) - 1; StringPrototype.split = function split(separator, limit) { var string = String(this); if (typeof separator === 'undefined' && limit === 0) { return []; } // If `separator` is not a regex, use native split if (!isRegex(separator)) { return strSplit(this, separator, limit); } var output = []; var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') // in ES6 + (separator.sticky ? 'y' : ''), // Firefox 3+ and ES6 lastLastIndex = 0, // Make `global` and avoid `lastIndex` issues by working with a copy separator2, match, lastIndex, lastLength; var separatorCopy = new RegExp(separator.source, flags + 'g'); if (!compliantExecNpcg) { // Doesn't need flags gy, but they don't hurt separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); } /* Values for `limit`, per the spec: * If undefined: 4294967295 // maxSafe32BitInt * If 0, Infinity, or NaN: 0 * If positive number: limit = floor(limit); if (limit > 4294967295) limit -= 4294967296; * If negative number: 4294967296 - floor(abs(limit)) * If other: Type-convert, then use the above rules */ var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit); match = separatorCopy.exec(string); while (match) { // `separatorCopy.lastIndex` is not reliable cross-browser lastIndex = match.index + match[0].length; if (lastIndex > lastLastIndex) { pushCall(output, strSlice(string, lastLastIndex, match.index)); // Fix browsers whose `exec` methods don't consistently return `undefined` for // nonparticipating capturing groups if (!compliantExecNpcg && match.length > 1) { /* eslint-disable no-loop-func */ match[0].replace(separator2, function () { for (var i = 1; i < arguments.length - 2; i++) { if (typeof arguments[i] === 'undefined') { match[i] = void 0; } } }); /* eslint-enable no-loop-func */ } if (match.length > 1 && match.index < string.length) { array_push.apply(output, arraySlice(match, 1)); } lastLength = match[0].length; lastLastIndex = lastIndex; if (output.length >= splitLimit) { break; } } if (separatorCopy.lastIndex === match.index) { separatorCopy.lastIndex++; // Avoid an infinite loop } match = separatorCopy.exec(string); } if (lastLastIndex === string.length) { if (lastLength || !separatorCopy.test('')) { pushCall(output, ''); } } else { pushCall(output, strSlice(string, lastLastIndex)); } return output.length > splitLimit ? arraySlice(output, 0, splitLimit) : output; }; }()); // [bugfix, chrome] // If separator is undefined, then the result array contains just one String, // which is the this value (converted to a String). If limit is not undefined, // then the output array is truncated so that it contains no more than limit // elements. // "0".split(undefined, 0) -> [] } else if ('0'.split(void 0, 0).length) { StringPrototype.split = function split(separator, limit) { if (typeof separator === 'undefined' && limit === 0) { return []; } return strSplit(this, separator, limit); }; } var str_replace = StringPrototype.replace; var replaceReportsGroupsCorrectly = (function () { var groups = []; 'x'.replace(/x(.)?/g, function (match, group) { pushCall(groups, group); }); return groups.length === 1 && typeof groups[0] === 'undefined'; }()); if (!replaceReportsGroupsCorrectly) { StringPrototype.replace = function replace(searchValue, replaceValue) { var isFn = isCallable(replaceValue); var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source); if (!isFn || !hasCapturingGroups) { return str_replace.call(this, searchValue, replaceValue); } var wrappedReplaceValue = function (match) { var length = arguments.length; var originalLastIndex = searchValue.lastIndex; searchValue.lastIndex = 0; // eslint-disable-line no-param-reassign var args = searchValue.exec(match) || []; searchValue.lastIndex = originalLastIndex; // eslint-disable-line no-param-reassign pushCall(args, arguments[length - 2], arguments[length - 1]); return replaceValue.apply(this, args); }; return str_replace.call(this, searchValue, wrappedReplaceValue); }; } // ECMA-262, 3rd B.2.3 // Not an ECMAScript standard, although ECMAScript 3rd Edition has a // non-normative section suggesting uniform semantics and it should be // normalized across all browsers // [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b'; var string_substr = hasNegativeSubstrBug && call.bind(StringPrototype.substr); defineProperties(StringPrototype, { substr: function substr(start, length) { var normalizedStart = start; if (start < 0) { normalizedStart = max(this.length + start, 0); } return string_substr(this, normalizedStart, length); } }, hasNegativeSubstrBug); // ES5 15.5.4.20 // whitespace from: https://es5.github.io/#x15.5.4.20 var mvs = '\u180E'; var mvsIsWS = (/\s/).test(mvs); var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF' .replace(/\S/g, ''); // remove the mongolian vowel separator (\u180E) in modern engines var zeroWidth = '\u200b'; var wsRegexChars = '[' + ws + ']'; var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*'); var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$'); var hasTrimWhitespaceBug = StringPrototype.trim && ( ws.trim() !== '' // if ws is not considered whitespace || zeroWidth.trim() === '' // if zero-width IS considered whitespace || mvs.trim() !== (mvsIsWS ? '' : mvs) // if MVS is either wrongly considered whitespace, or, wrongly considered NOT whitespace ); defineProperties(StringPrototype, { // https://blog.stevenlevithan.com/archives/faster-trim-javascript // http://perfectionkills.com/whitespace-deviations/ trim: function trim() { if (typeof this === 'undefined' || this === null) { throw new TypeError("can't convert " + this + ' to object'); } return $String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, ''); } }, hasTrimWhitespaceBug); var trim = call.bind(String.prototype.trim); var hasLastIndexBug = StringPrototype.lastIndexOf && 'abcã‚ã„'.lastIndexOf('ã‚ã„', 2) !== -1; defineProperties(StringPrototype, { lastIndexOf: function lastIndexOf(searchString) { if (typeof this === 'undefined' || this === null) { throw new TypeError("can't convert " + this + ' to object'); } var S = $String(this); var searchStr = $String(searchString); var numPos = arguments.length > 1 ? $Number(arguments[1]) : NaN; var pos = isActualNaN(numPos) ? Infinity : ES.ToInteger(numPos); var start = min(max(pos, 0), S.length); var searchLen = searchStr.length; var k = start + searchLen; while (k > 0) { k = max(0, k - searchLen); var index = strIndexOf(strSlice(S, k, start + searchLen), searchStr); if (index !== -1) { return k + index; } } return -1; } }, hasLastIndexBug); var originalLastIndexOf = StringPrototype.lastIndexOf; defineProperties(StringPrototype, { lastIndexOf: function lastIndexOf(searchString) { return originalLastIndexOf.apply(this, arguments); } }, StringPrototype.lastIndexOf.length !== 1); var hexRegex = /^[-+]?0[xX]/; // ES-5 15.1.2.2 if ( parseInt(ws + '08') !== 8 // eslint-disable-line radix || parseInt(ws + '0x16') !== 22 // eslint-disable-line radix || (mvsIsWS ? parseInt(mvs + 1) !== 1 : !isNaN(parseInt(mvs + 1))) // eslint-disable-line radix ) { // eslint-disable-next-line no-global-assign, no-implicit-globals parseInt = (function (origParseInt) { return function parseInt(str, radix) { if (this instanceof parseInt) { new origParseInt(); } // eslint-disable-line new-cap, no-new, max-statements-per-line var string = trim(String(str)); var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10); return origParseInt(string, defaultedRadix); }; }(parseInt)); } // Edge 15-18 var parseIntFailsToThrowOnBoxedSymbols = (function () { if (typeof Symbol !== 'function') { return false; } try { // eslint-disable-next-line radix parseInt(Object(Symbol.iterator)); return true; } catch (e) { /**/ } try { // eslint-disable-next-line radix parseInt(Symbol.iterator); return true; } catch (e) { /**/ } return false; }()); if (parseIntFailsToThrowOnBoxedSymbols) { var symbolValueOf = Symbol.prototype.valueOf; // eslint-disable-next-line no-global-assign, no-implicit-globals parseInt = (function (origParseInt) { return function parseInt(str, radix) { if (this instanceof parseInt) { new origParseInt(); } // eslint-disable-line new-cap, no-new, max-statements-per-line var isSym = typeof str === 'symbol'; if (!isSym && str && typeof str === 'object') { try { symbolValueOf.call(str); isSym = true; } catch (e) { /**/ } } if (isSym) { // handle Symbols in node 8.3/8.4 // eslint-disable-next-line no-implicit-coercion, no-unused-expressions '' + str; // jscs:ignore disallowImplicitTypeConversion } var string = trim(String(str)); var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10); return origParseInt(string, defaultedRadix); }; }(parseInt)); } // https://es5.github.io/#x15.1.2.3 if (1 / parseFloat('-0') !== -Infinity) { // eslint-disable-next-line no-global-assign, no-implicit-globals, no-native-reassign parseFloat = (function (origParseFloat) { return function parseFloat(string) { var inputString = trim(String(string)); var result = origParseFloat(inputString); return result === 0 && strSlice(inputString, 0, 1) === '-' ? -0 : result; }; }(parseFloat)); } if (String(new RangeError('test')) !== 'RangeError: test') { var errorToStringShim = function toString() { if (typeof this === 'undefined' || this === null) { throw new TypeError("can't convert " + this + ' to object'); } var name = this.name; if (typeof name === 'undefined') { name = 'Error'; } else if (typeof name !== 'string') { name = $String(name); } var msg = this.message; if (typeof msg === 'undefined') { msg = ''; } else if (typeof msg !== 'string') { msg = $String(msg); } if (!name) { return msg; } if (!msg) { return name; } return name + ': ' + msg; }; // can't use defineProperties here because of toString enumeration issue in IE <= 8 Error.prototype.toString = errorToStringShim; } if (supportsDescriptors) { var ensureNonEnumerable = function (obj, prop) { if (isEnum(obj, prop)) { var desc = Object.getOwnPropertyDescriptor(obj, prop); if (desc.configurable) { desc.enumerable = false; Object.defineProperty(obj, prop, desc); } } }; ensureNonEnumerable(Error.prototype, 'message'); if (Error.prototype.message !== '') { Error.prototype.message = ''; } ensureNonEnumerable(Error.prototype, 'name'); } if (String(/a/mig) !== '/a/gim') { var regexToString = function toString() { var str = '/' + this.source + '/'; if (this.global) { str += 'g'; } if (this.ignoreCase) { str += 'i'; } if (this.multiline) { str += 'm'; } return str; }; // can't use defineProperties here because of toString enumeration issue in IE <= 8 RegExp.prototype.toString = regexToString; } })); } (es5Shim)); rollup-3.29.4/test/form/samples/supports-es5-shim/main.js000066400000000000000000000000231450520414700233220ustar00rootroot00000000000000import 'es5-shim'; rollup-3.29.4/test/form/samples/supports-es6-shim/000077500000000000000000000000001450520414700220465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/supports-es6-shim/_config.js000066400000000000000000000006141450520414700240110ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports es6-shim', options: { onwarn(warning) { if (warning.code !== 'THIS_IS_UNDEFINED') { throw new Error(warning.message); } }, // check against tree-shake: false when updating the shim treeshake: true, plugins: [ require('@rollup/plugin-node-resolve').default(), require('@rollup/plugin-commonjs').default() ] } }); rollup-3.29.4/test/form/samples/supports-es6-shim/_expected.js000066400000000000000000004266641450520414700243660ustar00rootroot00000000000000var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; var es6Shim = {exports: {}}; /*! * https://github.com/paulmillr/es6-shim * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com) * and contributors, MIT License * es6-shim: v0.35.4 * see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE * Details and documentation: * https://github.com/paulmillr/es6-shim/ */ (function (module, exports) { // UMD (Universal Module Definition) // see https://github.com/umdjs/umd/blob/master/returnExports.js (function (root, factory) { /*global define */ { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory(); } }(commonjsGlobal, function () { var _apply = Function.call.bind(Function.apply); var _call = Function.call.bind(Function.call); var isArray = Array.isArray; var keys = Object.keys; var not = function notThunker(func) { return function notThunk() { return !_apply(func, this, arguments); }; }; var throwsError = function (func) { try { func(); return false; } catch (e) { return true; } }; var valueOrFalseIfThrows = function valueOrFalseIfThrows(func) { try { return func(); } catch (e) { return false; } }; var isCallableWithoutNew = not(throwsError); var arePropertyDescriptorsSupported = function () { // if Object.defineProperty exists but throws, it's IE 8 return !throwsError(function () { return Object.defineProperty({}, 'x', { get: function () { } }); // eslint-disable-line getter-return }); }; var supportsDescriptors = !!Object.defineProperty && arePropertyDescriptorsSupported(); var functionsHaveNames = (function foo() {}).name === 'foo'; var _forEach = Function.call.bind(Array.prototype.forEach); var _reduce = Function.call.bind(Array.prototype.reduce); var _filter = Function.call.bind(Array.prototype.filter); var _some = Function.call.bind(Array.prototype.some); var defineProperty = function (object, name, value, force) { if (!force && name in object) { return; } if (supportsDescriptors) { Object.defineProperty(object, name, { configurable: true, enumerable: false, writable: true, value: value }); } else { object[name] = value; } }; // Define configurable, writable and non-enumerable props // if they don’t exist. var defineProperties = function (object, map, forceOverride) { _forEach(keys(map), function (name) { var method = map[name]; defineProperty(object, name, method, !!forceOverride); }); }; var _toString = Function.call.bind(Object.prototype.toString); var isCallable = typeof /abc/ === 'function' ? function IsCallableSlow(x) { // Some old browsers (IE, FF) say that typeof /abc/ === 'function' return typeof x === 'function' && _toString(x) === '[object Function]'; } : function IsCallableFast(x) { return typeof x === 'function'; }; var Value = { getter: function (object, name, getter) { if (!supportsDescriptors) { throw new TypeError('getters require true ES5 support'); } Object.defineProperty(object, name, { configurable: true, enumerable: false, get: getter }); }, proxy: function (originalObject, key, targetObject) { if (!supportsDescriptors) { throw new TypeError('getters require true ES5 support'); } var originalDescriptor = Object.getOwnPropertyDescriptor(originalObject, key); Object.defineProperty(targetObject, key, { configurable: originalDescriptor.configurable, enumerable: originalDescriptor.enumerable, get: function getKey() { return originalObject[key]; }, set: function setKey(value) { originalObject[key] = value; } }); }, redefine: function (object, property, newValue) { if (supportsDescriptors) { var descriptor = Object.getOwnPropertyDescriptor(object, property); descriptor.value = newValue; Object.defineProperty(object, property, descriptor); } else { object[property] = newValue; } }, defineByDescriptor: function (object, property, descriptor) { if (supportsDescriptors) { Object.defineProperty(object, property, descriptor); } else if ('value' in descriptor) { object[property] = descriptor.value; } }, preserveToString: function (target, source) { if (source && isCallable(source.toString)) { defineProperty(target, 'toString', source.toString.bind(source), true); } } }; // Simple shim for Object.create on ES3 browsers // (unlike real shim, no attempt to support `prototype === null`) var create = Object.create || function (prototype, properties) { var Prototype = function Prototype() {}; Prototype.prototype = prototype; var object = new Prototype(); if (typeof properties !== 'undefined') { keys(properties).forEach(function (key) { Value.defineByDescriptor(object, key, properties[key]); }); } return object; }; var supportsSubclassing = function (C, f) { if (!Object.setPrototypeOf) { return false; /* skip test on IE < 11 */ } return valueOrFalseIfThrows(function () { var Sub = function Subclass(arg) { var o = new C(arg); Object.setPrototypeOf(o, Subclass.prototype); return o; }; Object.setPrototypeOf(Sub, C); Sub.prototype = create(C.prototype, { constructor: { value: Sub } }); return f(Sub); }); }; var getGlobal = function () { /* global self, window */ // the only reliable means to get the global object is // `Function('return this')()` // However, this causes CSP violations in Chrome apps. if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof commonjsGlobal !== 'undefined') { return commonjsGlobal; } throw new Error('unable to locate global object'); }; var globals = getGlobal(); var globalIsFinite = globals.isFinite; var _indexOf = Function.call.bind(String.prototype.indexOf); var _arrayIndexOfApply = Function.apply.bind(Array.prototype.indexOf); var _concat = Function.call.bind(Array.prototype.concat); // var _sort = Function.call.bind(Array.prototype.sort); var _strSlice = Function.call.bind(String.prototype.slice); var _push = Function.call.bind(Array.prototype.push); var _pushApply = Function.apply.bind(Array.prototype.push); var _join = Function.call.bind(Array.prototype.join); var _shift = Function.call.bind(Array.prototype.shift); var _max = Math.max; var _min = Math.min; var _floor = Math.floor; var _abs = Math.abs; var _exp = Math.exp; var _log = Math.log; var _sqrt = Math.sqrt; var _hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); var ArrayIterator; // make our implementation private var noop = function () {}; var OrigMap = globals.Map; var origMapDelete = OrigMap && OrigMap.prototype['delete']; var origMapGet = OrigMap && OrigMap.prototype.get; var origMapHas = OrigMap && OrigMap.prototype.has; var origMapSet = OrigMap && OrigMap.prototype.set; var Symbol = globals.Symbol || {}; var symbolSpecies = Symbol.species || '@@species'; var numberIsNaN = Number.isNaN || function isNaN(value) { // NaN !== NaN, but they are identical. // NaNs are the only non-reflexive value, i.e., if x !== x, // then x is NaN. // isNaN is broken: it converts its argument to number, so // isNaN('foo') => true return value !== value; }; var numberIsFinite = Number.isFinite || function isFinite(value) { return typeof value === 'number' && globalIsFinite(value); }; var _sign = isCallable(Math.sign) ? Math.sign : function sign(value) { var number = Number(value); if (number === 0) { return number; } if (numberIsNaN(number)) { return number; } return number < 0 ? -1 : 1; }; var _log1p = function log1p(value) { var x = Number(value); if (x < -1 || numberIsNaN(x)) { return NaN; } if (x === 0 || x === Infinity) { return x; } if (x === -1) { return -Infinity; } return (1 + x) - 1 === 0 ? x : x * (_log(1 + x) / ((1 + x) - 1)); }; // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js // can be replaced with require('is-arguments') if we ever use a build process instead var isStandardArguments = function isArguments(value) { return _toString(value) === '[object Arguments]'; }; var isLegacyArguments = function isArguments(value) { return value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && _toString(value) !== '[object Array]' && _toString(value.callee) === '[object Function]'; }; var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments; var Type = { primitive: function (x) { return x === null || (typeof x !== 'function' && typeof x !== 'object'); }, string: function (x) { return _toString(x) === '[object String]'; }, regex: function (x) { return _toString(x) === '[object RegExp]'; }, symbol: function (x) { return typeof globals.Symbol === 'function' && typeof x === 'symbol'; } }; var overrideNative = function overrideNative(object, property, replacement) { var original = object[property]; defineProperty(object, property, replacement, true); Value.preserveToString(object[property], original); }; // eslint-disable-next-line no-restricted-properties var hasSymbols = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' && Type.symbol(Symbol()); // This is a private name in the es6 spec, equal to '[Symbol.iterator]' // we're going to use an arbitrary _-prefixed name to make our shims // work properly with each other, even though we don't have full Iterator // support. That is, `Array.from(map.keys())` will work, but we don't // pretend to export a "real" Iterator interface. var $iterator$ = Type.symbol(Symbol.iterator) ? Symbol.iterator : '_es6-shim iterator_'; // Firefox ships a partial implementation using the name @@iterator. // https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14 // So use that name if we detect it. if (globals.Set && typeof new globals.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } // Reflect if (!globals.Reflect) { defineProperty(globals, 'Reflect', {}, true); } var Reflect = globals.Reflect; var $String = String; /* global document */ var domAll = (typeof document === 'undefined' || !document) ? null : document.all; var isNullOrUndefined = domAll == null ? function isNullOrUndefined(x) { return x == null; } : function isNullOrUndefinedAndNotDocumentAll(x) { return x == null && x !== domAll; }; var ES = { // http://www.ecma-international.org/ecma-262/6.0/#sec-call Call: function Call(F, V) { var args = arguments.length > 2 ? arguments[2] : []; if (!ES.IsCallable(F)) { throw new TypeError(F + ' is not a function'); } return _apply(F, V, args); }, RequireObjectCoercible: function (x, optMessage) { if (isNullOrUndefined(x)) { throw new TypeError(optMessage || 'Cannot call method on ' + x); } return x; }, // This might miss the "(non-standard exotic and does not implement // [[Call]])" case from // http://www.ecma-international.org/ecma-262/6.0/#sec-typeof-operator-runtime-semantics-evaluation // but we can't find any evidence these objects exist in practice. // If we find some in the future, you could test `Object(x) === x`, // which is reliable according to // http://www.ecma-international.org/ecma-262/6.0/#sec-toobject // but is not well optimized by runtimes and creates an object // whenever it returns false, and thus is very slow. TypeIsObject: function (x) { if (x === void 0 || x === null || x === true || x === false) { return false; } return typeof x === 'function' || typeof x === 'object' || x === domAll; }, ToObject: function (o, optMessage) { return Object(ES.RequireObjectCoercible(o, optMessage)); }, IsCallable: isCallable, IsConstructor: function (x) { // We can't tell callables from constructors in ES5 return ES.IsCallable(x); }, ToInt32: function (x) { return ES.ToNumber(x) >> 0; }, ToUint32: function (x) { return ES.ToNumber(x) >>> 0; }, ToNumber: function (value) { if (hasSymbols && _toString(value) === '[object Symbol]') { throw new TypeError('Cannot convert a Symbol value to a number'); } return +value; }, ToInteger: function (value) { var number = ES.ToNumber(value); if (numberIsNaN(number)) { return 0; } if (number === 0 || !numberIsFinite(number)) { return number; } return (number > 0 ? 1 : -1) * _floor(_abs(number)); }, ToLength: function (value) { var len = ES.ToInteger(value); if (len <= 0) { return 0; } // includes converting -0 to +0 if (len > Number.MAX_SAFE_INTEGER) { return Number.MAX_SAFE_INTEGER; } return len; }, SameValue: function (a, b) { if (a === b) { // 0 === -0, but they are not identical. if (a === 0) { return 1 / a === 1 / b; } return true; } return numberIsNaN(a) && numberIsNaN(b); }, SameValueZero: function (a, b) { // same as SameValue except for SameValueZero(+0, -0) == true return (a === b) || (numberIsNaN(a) && numberIsNaN(b)); }, GetIterator: function (o) { if (isArguments(o)) { // special case support for `arguments` return new ArrayIterator(o, 'value'); } var itFn = ES.GetMethod(o, $iterator$); if (!ES.IsCallable(itFn)) { // Better diagnostics if itFn is null or undefined throw new TypeError('value is not an iterable'); } var it = ES.Call(itFn, o); if (!ES.TypeIsObject(it)) { throw new TypeError('bad iterator'); } return it; }, GetMethod: function (o, p) { var func = ES.ToObject(o)[p]; if (isNullOrUndefined(func)) { return void 0; } if (!ES.IsCallable(func)) { throw new TypeError('Method not callable: ' + p); } return func; }, IteratorComplete: function (iterResult) { return !!iterResult.done; }, IteratorClose: function (iterator, completionIsThrow) { var returnMethod = ES.GetMethod(iterator, 'return'); if (returnMethod === void 0) { return; } var innerResult, innerException; try { innerResult = ES.Call(returnMethod, iterator); } catch (e) { innerException = e; } if (completionIsThrow) { return; } if (innerException) { throw innerException; } if (!ES.TypeIsObject(innerResult)) { throw new TypeError("Iterator's return method returned a non-object."); } }, IteratorNext: function (it) { var result = arguments.length > 1 ? it.next(arguments[1]) : it.next(); if (!ES.TypeIsObject(result)) { throw new TypeError('bad iterator'); } return result; }, IteratorStep: function (it) { var result = ES.IteratorNext(it); var done = ES.IteratorComplete(result); return done ? false : result; }, Construct: function (C, args, newTarget, isES6internal) { var target = typeof newTarget === 'undefined' ? C : newTarget; if (!isES6internal && Reflect.construct) { // Try to use Reflect.construct if available return Reflect.construct(C, args, target); } // OK, we have to fake it. This will only work if the // C.[[ConstructorKind]] == "base" -- but that's the only // kind we can make in ES5 code anyway. // OrdinaryCreateFromConstructor(target, "%ObjectPrototype%") var proto = target.prototype; if (!ES.TypeIsObject(proto)) { proto = Object.prototype; } var obj = create(proto); // Call the constructor. var result = ES.Call(C, obj, args); return ES.TypeIsObject(result) ? result : obj; }, SpeciesConstructor: function (O, defaultConstructor) { var C = O.constructor; if (C === void 0) { return defaultConstructor; } if (!ES.TypeIsObject(C)) { throw new TypeError('Bad constructor'); } var S = C[symbolSpecies]; if (isNullOrUndefined(S)) { return defaultConstructor; } if (!ES.IsConstructor(S)) { throw new TypeError('Bad @@species'); } return S; }, CreateHTML: function (string, tag, attribute, value) { var S = ES.ToString(string); var p1 = '<' + tag; if (attribute !== '') { var V = ES.ToString(value); var escapedV = V.replace(/"/g, '"'); p1 += ' ' + attribute + '="' + escapedV + '"'; } var p2 = p1 + '>'; var p3 = p2 + S; return p3 + ''; }, IsRegExp: function IsRegExp(argument) { if (!ES.TypeIsObject(argument)) { return false; } var isRegExp = argument[Symbol.match]; if (typeof isRegExp !== 'undefined') { return !!isRegExp; } return Type.regex(argument); }, ToString: function ToString(string) { if (hasSymbols && _toString(string) === '[object Symbol]') { throw new TypeError('Cannot convert a Symbol value to a number'); } return $String(string); } }; // Well-known Symbol shims if (supportsDescriptors && hasSymbols) { var defineWellKnownSymbol = function defineWellKnownSymbol(name) { if (Type.symbol(Symbol[name])) { return Symbol[name]; } // eslint-disable-next-line no-restricted-properties var sym = Symbol['for']('Symbol.' + name); Object.defineProperty(Symbol, name, { configurable: false, enumerable: false, writable: false, value: sym }); return sym; }; if (!Type.symbol(Symbol.search)) { var symbolSearch = defineWellKnownSymbol('search'); var originalSearch = String.prototype.search; defineProperty(RegExp.prototype, symbolSearch, function search(string) { return ES.Call(originalSearch, string, [this]); }); var searchShim = function search(regexp) { var O = ES.RequireObjectCoercible(this); if (!isNullOrUndefined(regexp)) { var searcher = ES.GetMethod(regexp, symbolSearch); if (typeof searcher !== 'undefined') { return ES.Call(searcher, regexp, [O]); } } return ES.Call(originalSearch, O, [ES.ToString(regexp)]); }; overrideNative(String.prototype, 'search', searchShim); } if (!Type.symbol(Symbol.replace)) { var symbolReplace = defineWellKnownSymbol('replace'); var originalReplace = String.prototype.replace; defineProperty(RegExp.prototype, symbolReplace, function replace(string, replaceValue) { return ES.Call(originalReplace, string, [this, replaceValue]); }); var replaceShim = function replace(searchValue, replaceValue) { var O = ES.RequireObjectCoercible(this); if (!isNullOrUndefined(searchValue)) { var replacer = ES.GetMethod(searchValue, symbolReplace); if (typeof replacer !== 'undefined') { return ES.Call(replacer, searchValue, [O, replaceValue]); } } return ES.Call(originalReplace, O, [ES.ToString(searchValue), replaceValue]); }; overrideNative(String.prototype, 'replace', replaceShim); } if (!Type.symbol(Symbol.split)) { var symbolSplit = defineWellKnownSymbol('split'); var originalSplit = String.prototype.split; defineProperty(RegExp.prototype, symbolSplit, function split(string, limit) { return ES.Call(originalSplit, string, [this, limit]); }); var splitShim = function split(separator, limit) { var O = ES.RequireObjectCoercible(this); if (!isNullOrUndefined(separator)) { var splitter = ES.GetMethod(separator, symbolSplit); if (typeof splitter !== 'undefined') { return ES.Call(splitter, separator, [O, limit]); } } return ES.Call(originalSplit, O, [ES.ToString(separator), limit]); }; overrideNative(String.prototype, 'split', splitShim); } var symbolMatchExists = Type.symbol(Symbol.match); var stringMatchIgnoresSymbolMatch = symbolMatchExists && (function () { // Firefox 41, through Nightly 45 has Symbol.match, but String#match ignores it. // Firefox 40 and below have Symbol.match but String#match works fine. var o = {}; o[Symbol.match] = function () { return 42; }; return 'a'.match(o) !== 42; }()); if (!symbolMatchExists || stringMatchIgnoresSymbolMatch) { var symbolMatch = defineWellKnownSymbol('match'); var originalMatch = String.prototype.match; defineProperty(RegExp.prototype, symbolMatch, function match(string) { return ES.Call(originalMatch, string, [this]); }); var matchShim = function match(regexp) { var O = ES.RequireObjectCoercible(this); if (!isNullOrUndefined(regexp)) { var matcher = ES.GetMethod(regexp, symbolMatch); if (typeof matcher !== 'undefined') { return ES.Call(matcher, regexp, [O]); } } return ES.Call(originalMatch, O, [ES.ToString(regexp)]); }; overrideNative(String.prototype, 'match', matchShim); } } var wrapConstructor = function wrapConstructor(original, replacement, keysToSkip) { Value.preserveToString(replacement, original); if (Object.setPrototypeOf) { // sets up proper prototype chain where possible Object.setPrototypeOf(original, replacement); } if (supportsDescriptors) { _forEach(Object.getOwnPropertyNames(original), function (key) { if (key in noop || keysToSkip[key]) { return; } Value.proxy(original, key, replacement); }); } else { _forEach(Object.keys(original), function (key) { if (key in noop || keysToSkip[key]) { return; } replacement[key] = original[key]; }); } replacement.prototype = original.prototype; Value.redefine(original.prototype, 'constructor', replacement); }; var defaultSpeciesGetter = function () { return this; }; var addDefaultSpecies = function (C) { if (supportsDescriptors && !_hasOwnProperty(C, symbolSpecies)) { Value.getter(C, symbolSpecies, defaultSpeciesGetter); } }; var addIterator = function (prototype, impl) { var implementation = impl || function iterator() { return this; }; defineProperty(prototype, $iterator$, implementation); if (!prototype[$iterator$] && Type.symbol($iterator$)) { // implementations are buggy when $iterator$ is a Symbol prototype[$iterator$] = implementation; } }; var createDataProperty = function createDataProperty(object, name, value) { if (supportsDescriptors) { Object.defineProperty(object, name, { configurable: true, enumerable: true, writable: true, value: value }); } else { object[name] = value; } }; var createDataPropertyOrThrow = function createDataPropertyOrThrow(object, name, value) { createDataProperty(object, name, value); if (!ES.SameValue(object[name], value)) { throw new TypeError('property is nonconfigurable'); } }; var emulateES6construct = function (o, defaultNewTarget, defaultProto, slots) { // This is an es5 approximation to es6 construct semantics. in es6, // 'new Foo' invokes Foo.[[Construct]] which (for almost all objects) // just sets the internal variable NewTarget (in es6 syntax `new.target`) // to Foo and then returns Foo(). // Many ES6 object then have constructors of the form: // 1. If NewTarget is undefined, throw a TypeError exception // 2. Let xxx by OrdinaryCreateFromConstructor(NewTarget, yyy, zzz) // So we're going to emulate those first two steps. if (!ES.TypeIsObject(o)) { throw new TypeError('Constructor requires `new`: ' + defaultNewTarget.name); } var proto = defaultNewTarget.prototype; if (!ES.TypeIsObject(proto)) { proto = defaultProto; } var obj = create(proto); for (var name in slots) { if (_hasOwnProperty(slots, name)) { var value = slots[name]; defineProperty(obj, name, value, true); } } return obj; }; // Firefox 31 reports this function's length as 0 // https://bugzilla.mozilla.org/show_bug.cgi?id=1062484 if (String.fromCodePoint && String.fromCodePoint.length !== 1) { var originalFromCodePoint = String.fromCodePoint; overrideNative(String, 'fromCodePoint', function fromCodePoint(codePoints) { return ES.Call(originalFromCodePoint, this, arguments); }); } var StringShims = { fromCodePoint: function fromCodePoint(codePoints) { var result = []; var next; for (var i = 0, length = arguments.length; i < length; i++) { next = Number(arguments[i]); if (!ES.SameValue(next, ES.ToInteger(next)) || next < 0 || next > 0x10FFFF) { throw new RangeError('Invalid code point ' + next); } if (next < 0x10000) { _push(result, String.fromCharCode(next)); } else { next -= 0x10000; _push(result, String.fromCharCode((next >> 10) + 0xD800)); _push(result, String.fromCharCode((next % 0x400) + 0xDC00)); } } return _join(result, ''); }, raw: function raw(template) { var cooked = ES.ToObject(template, 'bad template'); var raw = ES.ToObject(cooked.raw, 'bad raw value'); var len = raw.length; var literalSegments = ES.ToLength(len); if (literalSegments <= 0) { return ''; } var stringElements = []; var nextIndex = 0; var nextKey, next, nextSeg, nextSub; while (nextIndex < literalSegments) { nextKey = ES.ToString(nextIndex); nextSeg = ES.ToString(raw[nextKey]); _push(stringElements, nextSeg); if (nextIndex + 1 >= literalSegments) { break; } next = nextIndex + 1 < arguments.length ? arguments[nextIndex + 1] : ''; nextSub = ES.ToString(next); _push(stringElements, nextSub); nextIndex += 1; } return _join(stringElements, ''); } }; if (String.raw && String.raw({ raw: { 0: 'x', 1: 'y', length: 2 } }) !== 'xy') { // IE 11 TP has a broken String.raw implementation overrideNative(String, 'raw', StringShims.raw); } defineProperties(String, StringShims); // Fast repeat, uses the `Exponentiation by squaring` algorithm. // Perf: http://jsperf.com/string-repeat2/2 var stringRepeat = function repeat(s, times) { if (times < 1) { return ''; } if (times % 2) { return repeat(s, times - 1) + s; } var half = repeat(s, times / 2); return half + half; }; var stringMaxLength = Infinity; var StringPrototypeShims = { repeat: function repeat(times) { var thisStr = ES.ToString(ES.RequireObjectCoercible(this)); var numTimes = ES.ToInteger(times); if (numTimes < 0 || numTimes >= stringMaxLength) { throw new RangeError('repeat count must be less than infinity and not overflow maximum string size'); } return stringRepeat(thisStr, numTimes); }, startsWith: function startsWith(searchString) { var S = ES.ToString(ES.RequireObjectCoercible(this)); if (ES.IsRegExp(searchString)) { throw new TypeError('Cannot call method "startsWith" with a regex'); } var searchStr = ES.ToString(searchString); var position; if (arguments.length > 1) { position = arguments[1]; } var start = _max(ES.ToInteger(position), 0); return _strSlice(S, start, start + searchStr.length) === searchStr; }, endsWith: function endsWith(searchString) { var S = ES.ToString(ES.RequireObjectCoercible(this)); if (ES.IsRegExp(searchString)) { throw new TypeError('Cannot call method "endsWith" with a regex'); } var searchStr = ES.ToString(searchString); var len = S.length; var endPosition; if (arguments.length > 1) { endPosition = arguments[1]; } var pos = typeof endPosition === 'undefined' ? len : ES.ToInteger(endPosition); var end = _min(_max(pos, 0), len); return _strSlice(S, end - searchStr.length, end) === searchStr; }, includes: function includes(searchString) { if (ES.IsRegExp(searchString)) { throw new TypeError('"includes" does not accept a RegExp'); } var searchStr = ES.ToString(searchString); var position; if (arguments.length > 1) { position = arguments[1]; } // Somehow this trick makes method 100% compat with the spec. return _indexOf(this, searchStr, position) !== -1; }, codePointAt: function codePointAt(pos) { var thisStr = ES.ToString(ES.RequireObjectCoercible(this)); var position = ES.ToInteger(pos); var length = thisStr.length; if (position >= 0 && position < length) { var first = thisStr.charCodeAt(position); var isEnd = position + 1 === length; if (first < 0xD800 || first > 0xDBFF || isEnd) { return first; } var second = thisStr.charCodeAt(position + 1); if (second < 0xDC00 || second > 0xDFFF) { return first; } return ((first - 0xD800) * 1024) + (second - 0xDC00) + 0x10000; } } }; if (String.prototype.includes && 'a'.includes('a', Infinity) !== false) { overrideNative(String.prototype, 'includes', StringPrototypeShims.includes); } if (String.prototype.startsWith && String.prototype.endsWith) { var startsWithRejectsRegex = throwsError(function () { /* throws if spec-compliant */ return '/a/'.startsWith(/a/); }); var startsWithHandlesInfinity = valueOrFalseIfThrows(function () { return 'abc'.startsWith('a', Infinity) === false; }); if (!startsWithRejectsRegex || !startsWithHandlesInfinity) { // Firefox (< 37?) and IE 11 TP have a noncompliant startsWith implementation overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); } } if (hasSymbols) { var startsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () { var re = /a/; re[Symbol.match] = false; return '/a/'.startsWith(re); }); if (!startsWithSupportsSymbolMatch) { overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); } var endsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () { var re = /a/; re[Symbol.match] = false; return '/a/'.endsWith(re); }); if (!endsWithSupportsSymbolMatch) { overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); } var includesSupportsSymbolMatch = valueOrFalseIfThrows(function () { var re = /a/; re[Symbol.match] = false; return '/a/'.includes(re); }); if (!includesSupportsSymbolMatch) { overrideNative(String.prototype, 'includes', StringPrototypeShims.includes); } } defineProperties(String.prototype, StringPrototypeShims); // whitespace from: http://es5.github.io/#x15.5.4.20 // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 var ws = [ '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', '\u2029\uFEFF' ].join(''); var trimRegexp = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); var trimShim = function trim() { return ES.ToString(ES.RequireObjectCoercible(this)).replace(trimRegexp, ''); }; var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); var nonWSregex = new RegExp('[' + nonWS + ']', 'g'); var isBadHexRegex = /^[-+]0x[0-9a-f]+$/i; var hasStringTrimBug = nonWS.trim().length !== nonWS.length; defineProperty(String.prototype, 'trim', trimShim, hasStringTrimBug); // Given an argument x, it will return an IteratorResult object, // with value set to x and done to false. // Given no arguments, it will return an iterator completion object. var iteratorResult = function (x) { return { value: x, done: arguments.length === 0 }; }; // see http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype-@@iterator var StringIterator = function (s) { ES.RequireObjectCoercible(s); defineProperty(this, '_s', ES.ToString(s)); defineProperty(this, '_i', 0); }; StringIterator.prototype.next = function () { var s = this._s; var i = this._i; if (typeof s === 'undefined' || i >= s.length) { this._s = void 0; return iteratorResult(); } var first = s.charCodeAt(i); var second, len; if (first < 0xD800 || first > 0xDBFF || (i + 1) === s.length) { len = 1; } else { second = s.charCodeAt(i + 1); len = (second < 0xDC00 || second > 0xDFFF) ? 1 : 2; } this._i = i + len; return iteratorResult(s.substr(i, len)); }; addIterator(StringIterator.prototype); addIterator(String.prototype, function () { return new StringIterator(this); }); var ArrayShims = { from: function from(items) { var C = this; var mapFn; if (arguments.length > 1) { mapFn = arguments[1]; } var mapping, T; if (typeof mapFn === 'undefined') { mapping = false; } else { if (!ES.IsCallable(mapFn)) { throw new TypeError('Array.from: when provided, the second argument must be a function'); } if (arguments.length > 2) { T = arguments[2]; } mapping = true; } // Note that that Arrays will use ArrayIterator: // https://bugs.ecmascript.org/show_bug.cgi?id=2416 var usingIterator = typeof (isArguments(items) || ES.GetMethod(items, $iterator$)) !== 'undefined'; var length, result, i; if (usingIterator) { result = ES.IsConstructor(C) ? Object(new C()) : []; var iterator = ES.GetIterator(items); var next, nextValue; i = 0; while (true) { next = ES.IteratorStep(iterator); if (next === false) { break; } nextValue = next.value; try { if (mapping) { nextValue = typeof T === 'undefined' ? mapFn(nextValue, i) : _call(mapFn, T, nextValue, i); } result[i] = nextValue; } catch (e) { ES.IteratorClose(iterator, true); throw e; } i += 1; } length = i; } else { var arrayLike = ES.ToObject(items); length = ES.ToLength(arrayLike.length); result = ES.IsConstructor(C) ? Object(new C(length)) : new Array(length); var value; for (i = 0; i < length; ++i) { value = arrayLike[i]; if (mapping) { value = typeof T === 'undefined' ? mapFn(value, i) : _call(mapFn, T, value, i); } createDataPropertyOrThrow(result, i, value); } } result.length = length; return result; }, of: function of() { var len = arguments.length; var C = this; var A = isArray(C) || !ES.IsCallable(C) ? new Array(len) : ES.Construct(C, [len]); for (var k = 0; k < len; ++k) { createDataPropertyOrThrow(A, k, arguments[k]); } A.length = len; return A; } }; defineProperties(Array, ArrayShims); addDefaultSpecies(Array); // Our ArrayIterator is private; see // https://github.com/paulmillr/es6-shim/issues/252 ArrayIterator = function (array, kind) { defineProperty(this, 'i', 0); defineProperty(this, 'array', array); defineProperty(this, 'kind', kind); }; defineProperties(ArrayIterator.prototype, { next: function () { var i = this.i; var array = this.array; if (!(this instanceof ArrayIterator)) { throw new TypeError('Not an ArrayIterator'); } if (typeof array !== 'undefined') { var len = ES.ToLength(array.length); if (i < len) { //for (; i < len; i++) { var kind = this.kind; var retval; if (kind === 'key') { retval = i; } else if (kind === 'value') { retval = array[i]; } else if (kind === 'entry') { retval = [i, array[i]]; } this.i = i + 1; return iteratorResult(retval); } } this.array = void 0; return iteratorResult(); } }); addIterator(ArrayIterator.prototype); /* var orderKeys = function orderKeys(a, b) { var aNumeric = String(ES.ToInteger(a)) === a; var bNumeric = String(ES.ToInteger(b)) === b; if (aNumeric && bNumeric) { return b - a; } else if (aNumeric && !bNumeric) { return -1; } else if (!aNumeric && bNumeric) { return 1; } else { return a.localeCompare(b); } }; var getAllKeys = function getAllKeys(object) { var ownKeys = []; var keys = []; for (var key in object) { _push(_hasOwnProperty(object, key) ? ownKeys : keys, key); } _sort(ownKeys, orderKeys); _sort(keys, orderKeys); return _concat(ownKeys, keys); }; */ // note: this is positioned here because it depends on ArrayIterator var arrayOfSupportsSubclassing = Array.of === ArrayShims.of || (function () { // Detects a bug in Webkit nightly r181886 var Foo = function Foo(len) { this.length = len; }; Foo.prototype = []; var fooArr = Array.of.apply(Foo, [1, 2]); return fooArr instanceof Foo && fooArr.length === 2; }()); if (!arrayOfSupportsSubclassing) { overrideNative(Array, 'of', ArrayShims.of); } var ArrayPrototypeShims = { copyWithin: function copyWithin(target, start) { var o = ES.ToObject(this); var len = ES.ToLength(o.length); var relativeTarget = ES.ToInteger(target); var relativeStart = ES.ToInteger(start); var to = relativeTarget < 0 ? _max(len + relativeTarget, 0) : _min(relativeTarget, len); var from = relativeStart < 0 ? _max(len + relativeStart, 0) : _min(relativeStart, len); var end; if (arguments.length > 2) { end = arguments[2]; } var relativeEnd = typeof end === 'undefined' ? len : ES.ToInteger(end); var finalItem = relativeEnd < 0 ? _max(len + relativeEnd, 0) : _min(relativeEnd, len); var count = _min(finalItem - from, len - to); var direction = 1; if (from < to && to < (from + count)) { direction = -1; from += count - 1; to += count - 1; } while (count > 0) { if (from in o) { o[to] = o[from]; } else { delete o[to]; } from += direction; to += direction; count -= 1; } return o; }, fill: function fill(value) { var start; if (arguments.length > 1) { start = arguments[1]; } var end; if (arguments.length > 2) { end = arguments[2]; } var O = ES.ToObject(this); var len = ES.ToLength(O.length); start = ES.ToInteger(typeof start === 'undefined' ? 0 : start); end = ES.ToInteger(typeof end === 'undefined' ? len : end); var relativeStart = start < 0 ? _max(len + start, 0) : _min(start, len); var relativeEnd = end < 0 ? len + end : end; for (var i = relativeStart; i < len && i < relativeEnd; ++i) { O[i] = value; } return O; }, find: function find(predicate) { var list = ES.ToObject(this); var length = ES.ToLength(list.length); if (!ES.IsCallable(predicate)) { throw new TypeError('Array#find: predicate must be a function'); } var thisArg = arguments.length > 1 ? arguments[1] : null; for (var i = 0, value; i < length; i++) { value = list[i]; if (thisArg) { if (_call(predicate, thisArg, value, i, list)) { return value; } } else if (predicate(value, i, list)) { return value; } } }, findIndex: function findIndex(predicate) { var list = ES.ToObject(this); var length = ES.ToLength(list.length); if (!ES.IsCallable(predicate)) { throw new TypeError('Array#findIndex: predicate must be a function'); } var thisArg = arguments.length > 1 ? arguments[1] : null; for (var i = 0; i < length; i++) { if (thisArg) { if (_call(predicate, thisArg, list[i], i, list)) { return i; } } else if (predicate(list[i], i, list)) { return i; } } return -1; }, keys: function keys() { return new ArrayIterator(this, 'key'); }, values: function values() { return new ArrayIterator(this, 'value'); }, entries: function entries() { return new ArrayIterator(this, 'entry'); } }; // Safari 7.1 defines Array#keys and Array#entries natively, // but the resulting ArrayIterator objects don't have a "next" method. if (Array.prototype.keys && !ES.IsCallable([1].keys().next)) { delete Array.prototype.keys; } if (Array.prototype.entries && !ES.IsCallable([1].entries().next)) { delete Array.prototype.entries; } // Chrome 38 defines Array#keys and Array#entries, and Array#@@iterator, but not Array#values if (Array.prototype.keys && Array.prototype.entries && !Array.prototype.values && Array.prototype[$iterator$]) { defineProperties(Array.prototype, { values: Array.prototype[$iterator$] }); if (Type.symbol(Symbol.unscopables)) { Array.prototype[Symbol.unscopables].values = true; } } // Chrome 40 defines Array#values with the incorrect name, although Array#{keys,entries} have the correct name if (functionsHaveNames && Array.prototype.values && Array.prototype.values.name !== 'values') { var originalArrayPrototypeValues = Array.prototype.values; overrideNative(Array.prototype, 'values', function values() { return ES.Call(originalArrayPrototypeValues, this, arguments); }); defineProperty(Array.prototype, $iterator$, Array.prototype.values, true); } defineProperties(Array.prototype, ArrayPrototypeShims); if (1 / [true].indexOf(true, -0) < 0) { // indexOf when given a position arg of -0 should return +0. // https://github.com/tc39/ecma262/pull/316 defineProperty(Array.prototype, 'indexOf', function indexOf(searchElement) { var value = _arrayIndexOfApply(this, arguments); if (value === 0 && (1 / value) < 0) { return 0; } return value; }, true); } addIterator(Array.prototype, function () { return this.values(); }); // Chrome defines keys/values/entries on Array, but doesn't give us // any way to identify its iterator. So add our own shimmed field. if (Object.getPrototypeOf) { var ChromeArrayIterator = Object.getPrototypeOf([].values()); if (ChromeArrayIterator) { // in WSH, this is `undefined` addIterator(ChromeArrayIterator); } } // note: this is positioned here because it relies on Array#entries var arrayFromSwallowsNegativeLengths = (function () { // Detects a Firefox bug in v32 // https://bugzilla.mozilla.org/show_bug.cgi?id=1063993 return valueOrFalseIfThrows(function () { return Array.from({ length: -1 }).length === 0; }); }()); var arrayFromHandlesIterables = (function () { // Detects a bug in Webkit nightly r181886 var arr = Array.from([0].entries()); return arr.length === 1 && isArray(arr[0]) && arr[0][0] === 0 && arr[0][1] === 0; }()); if (!arrayFromSwallowsNegativeLengths || !arrayFromHandlesIterables) { overrideNative(Array, 'from', ArrayShims.from); } var arrayFromHandlesUndefinedMapFunction = (function () { // Microsoft Edge v0.11 throws if the mapFn argument is *provided* but undefined, // but the spec doesn't care if it's provided or not - undefined doesn't throw. return valueOrFalseIfThrows(function () { return Array.from([0], void 0); }); }()); if (!arrayFromHandlesUndefinedMapFunction) { var origArrayFrom = Array.from; overrideNative(Array, 'from', function from(items) { if (arguments.length > 1 && typeof arguments[1] !== 'undefined') { return ES.Call(origArrayFrom, this, arguments); } return _call(origArrayFrom, this, items); }); } var int32sAsOne = -(Math.pow(2, 32) - 1); var toLengthsCorrectly = function (method, reversed) { var obj = { length: int32sAsOne }; obj[reversed ? (obj.length >>> 0) - 1 : 0] = true; return valueOrFalseIfThrows(function () { _call(method, obj, function () { // note: in nonconforming browsers, this will be called // -1 >>> 0 times, which is 4294967295, so the throw matters. throw new RangeError('should not reach here'); }, []); return true; }); }; if (!toLengthsCorrectly(Array.prototype.forEach)) { var originalForEach = Array.prototype.forEach; overrideNative(Array.prototype, 'forEach', function forEach(callbackFn) { return ES.Call(originalForEach, this.length >= 0 ? this : [], arguments); }); } if (!toLengthsCorrectly(Array.prototype.map)) { var originalMap = Array.prototype.map; overrideNative(Array.prototype, 'map', function map(callbackFn) { return ES.Call(originalMap, this.length >= 0 ? this : [], arguments); }); } if (!toLengthsCorrectly(Array.prototype.filter)) { var originalFilter = Array.prototype.filter; overrideNative(Array.prototype, 'filter', function filter(callbackFn) { return ES.Call(originalFilter, this.length >= 0 ? this : [], arguments); }); } if (!toLengthsCorrectly(Array.prototype.some)) { var originalSome = Array.prototype.some; overrideNative(Array.prototype, 'some', function some(callbackFn) { return ES.Call(originalSome, this.length >= 0 ? this : [], arguments); }); } if (!toLengthsCorrectly(Array.prototype.every)) { var originalEvery = Array.prototype.every; overrideNative(Array.prototype, 'every', function every(callbackFn) { return ES.Call(originalEvery, this.length >= 0 ? this : [], arguments); }); } if (!toLengthsCorrectly(Array.prototype.reduce)) { var originalReduce = Array.prototype.reduce; overrideNative(Array.prototype, 'reduce', function reduce(callbackFn) { return ES.Call(originalReduce, this.length >= 0 ? this : [], arguments); }); } if (!toLengthsCorrectly(Array.prototype.reduceRight, true)) { var originalReduceRight = Array.prototype.reduceRight; overrideNative(Array.prototype, 'reduceRight', function reduceRight(callbackFn) { return ES.Call(originalReduceRight, this.length >= 0 ? this : [], arguments); }); } var lacksOctalSupport = Number('0o10') !== 8; var lacksBinarySupport = Number('0b10') !== 2; var trimsNonWhitespace = _some(nonWS, function (c) { return Number(c + 0 + c) === 0; }); if (lacksOctalSupport || lacksBinarySupport || trimsNonWhitespace) { var OrigNumber = Number; var binaryRegex = /^0b[01]+$/i; var octalRegex = /^0o[0-7]+$/i; // Note that in IE 8, RegExp.prototype.test doesn't seem to exist: ie, "test" is an own property of regexes. wtf. var isBinary = binaryRegex.test.bind(binaryRegex); var isOctal = octalRegex.test.bind(octalRegex); var toPrimitive = function (O, hint) { // need to replace this with `es-to-primitive/es6` var result; if (typeof O.valueOf === 'function') { result = O.valueOf(); if (Type.primitive(result)) { return result; } } if (typeof O.toString === 'function') { result = O.toString(); if (Type.primitive(result)) { return result; } } throw new TypeError('No default value'); }; var hasNonWS = nonWSregex.test.bind(nonWSregex); var isBadHex = isBadHexRegex.test.bind(isBadHexRegex); var NumberShim = (function () { // this is wrapped in an IIFE because of IE 6-8's wacky scoping issues with named function expressions. var NumberShim = function Number(value) { var primValue; if (arguments.length > 0) { primValue = Type.primitive(value) ? value : toPrimitive(value, 'number'); } else { primValue = 0; } if (typeof primValue === 'string') { primValue = ES.Call(trimShim, primValue); if (isBinary(primValue)) { primValue = parseInt(_strSlice(primValue, 2), 2); } else if (isOctal(primValue)) { primValue = parseInt(_strSlice(primValue, 2), 8); } else if (hasNonWS(primValue) || isBadHex(primValue)) { primValue = NaN; } } var receiver = this; var valueOfSucceeds = valueOrFalseIfThrows(function () { OrigNumber.prototype.valueOf.call(receiver); return true; }); if (receiver instanceof NumberShim && !valueOfSucceeds) { return new OrigNumber(primValue); } return OrigNumber(primValue); }; return NumberShim; }()); wrapConstructor(OrigNumber, NumberShim, {}); // this is necessary for ES3 browsers, where these properties are non-enumerable. defineProperties(NumberShim, { NaN: OrigNumber.NaN, MAX_VALUE: OrigNumber.MAX_VALUE, MIN_VALUE: OrigNumber.MIN_VALUE, NEGATIVE_INFINITY: OrigNumber.NEGATIVE_INFINITY, POSITIVE_INFINITY: OrigNumber.POSITIVE_INFINITY }); Number = NumberShim; // eslint-disable-line no-global-assign Value.redefine(globals, 'Number', NumberShim); } var maxSafeInteger = Math.pow(2, 53) - 1; defineProperties(Number, { MAX_SAFE_INTEGER: maxSafeInteger, MIN_SAFE_INTEGER: -maxSafeInteger, EPSILON: 2.220446049250313e-16, parseInt: globals.parseInt, parseFloat: globals.parseFloat, isFinite: numberIsFinite, isInteger: function isInteger(value) { return numberIsFinite(value) && ES.ToInteger(value) === value; }, isSafeInteger: function isSafeInteger(value) { return Number.isInteger(value) && _abs(value) <= Number.MAX_SAFE_INTEGER; }, isNaN: numberIsNaN }); // Firefox 37 has a conforming Number.parseInt, but it's not === to the global parseInt (fixed in v40) defineProperty(Number, 'parseInt', globals.parseInt, Number.parseInt !== globals.parseInt); // Work around bugs in Array#find and Array#findIndex -- early // implementations skipped holes in sparse arrays. (Note that the // implementations of find/findIndex indirectly use shimmed // methods of Number, so this test has to happen down here.) /* eslint-disable no-sparse-arrays */ if ([, 1].find(function () { return true; }) === 1) { overrideNative(Array.prototype, 'find', ArrayPrototypeShims.find); } if ([, 1].findIndex(function () { return true; }) !== 0) { overrideNative(Array.prototype, 'findIndex', ArrayPrototypeShims.findIndex); } /* eslint-enable no-sparse-arrays */ var isEnumerableOn = Function.bind.call(Function.bind, Object.prototype.propertyIsEnumerable); var ensureEnumerable = function ensureEnumerable(obj, prop) { if (supportsDescriptors && isEnumerableOn(obj, prop)) { Object.defineProperty(obj, prop, { enumerable: false }); } }; var sliceArgs = function sliceArgs() { // per https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments // and https://gist.github.com/WebReflection/4327762cb87a8c634a29 var initial = Number(this); var len = arguments.length; var desiredArgCount = len - initial; var args = new Array(desiredArgCount < 0 ? 0 : desiredArgCount); for (var i = initial; i < len; ++i) { args[i - initial] = arguments[i]; } return args; }; var assignTo = function assignTo(source) { return function assignToSource(target, key) { target[key] = source[key]; return target; }; }; var assignReducer = function (target, source) { var sourceKeys = keys(Object(source)); var symbols; if (ES.IsCallable(Object.getOwnPropertySymbols)) { symbols = _filter(Object.getOwnPropertySymbols(Object(source)), isEnumerableOn(source)); } return _reduce(_concat(sourceKeys, symbols || []), assignTo(source), target); }; var ObjectShims = { // 19.1.3.1 assign: function (target, source) { var to = ES.ToObject(target, 'Cannot convert undefined or null to object'); return _reduce(ES.Call(sliceArgs, 1, arguments), assignReducer, to); }, // Added in WebKit in https://bugs.webkit.org/show_bug.cgi?id=143865 is: function is(a, b) { return ES.SameValue(a, b); } }; var assignHasPendingExceptions = Object.assign && Object.preventExtensions && (function () { // Firefox 37 still has "pending exception" logic in its Object.assign implementation, // which is 72% slower than our shim, and Firefox 40's native implementation. var thrower = Object.preventExtensions({ 1: 2 }); try { Object.assign(thrower, 'xy'); } catch (e) { return thrower[1] === 'y'; } }()); if (assignHasPendingExceptions) { overrideNative(Object, 'assign', ObjectShims.assign); } defineProperties(Object, ObjectShims); if (supportsDescriptors) { var ES5ObjectShims = { // 19.1.3.9 // shim from https://gist.github.com/WebReflection/5593554 setPrototypeOf: (function (Object) { var set; var checkArgs = function (O, proto) { if (!ES.TypeIsObject(O)) { throw new TypeError('cannot set prototype on a non-object'); } if (!(proto === null || ES.TypeIsObject(proto))) { throw new TypeError('can only set prototype to an object or null' + proto); } }; var setPrototypeOf = function (O, proto) { checkArgs(O, proto); _call(set, O, proto); return O; }; try { // this works already in Firefox and Safari set = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; _call(set, {}, null); } catch (e) { if (Object.prototype !== ({}).__proto__) { // eslint-disable-line no-proto // IE < 11 cannot be shimmed return; } // probably Chrome or some old Mobile stock browser set = function (proto) { this.__proto__ = proto; // eslint-disable-line no-proto }; // please note that this will **not** work // in those browsers that do not inherit // __proto__ by mistake from Object.prototype // in these cases we should probably throw an error // or at least be informed about the issue setPrototypeOf.polyfill = setPrototypeOf( setPrototypeOf({}, null), Object.prototype ) instanceof Object; // setPrototypeOf.polyfill === true means it works as meant // setPrototypeOf.polyfill === false means it's not 100% reliable // setPrototypeOf.polyfill === undefined // or // setPrototypeOf.polyfill == null means it's not a polyfill // which means it works as expected // we can even delete Object.prototype.__proto__; } return setPrototypeOf; }(Object)) }; defineProperties(Object, ES5ObjectShims); } // Workaround bug in Opera 12 where setPrototypeOf(x, null) doesn't work, // but Object.create(null) does. if ( Object.setPrototypeOf && Object.getPrototypeOf && Object.getPrototypeOf(Object.setPrototypeOf({}, null)) !== null && Object.getPrototypeOf(Object.create(null)) === null ) { (function () { var FAKENULL = Object.create(null); var gpo = Object.getPrototypeOf; var spo = Object.setPrototypeOf; Object.getPrototypeOf = function (o) { var result = gpo(o); return result === FAKENULL ? null : result; }; Object.setPrototypeOf = function (o, p) { var proto = p === null ? FAKENULL : p; return spo(o, proto); }; Object.setPrototypeOf.polyfill = false; }()); } var objectKeysAcceptsPrimitives = !throwsError(function () { return Object.keys('foo'); }); if (!objectKeysAcceptsPrimitives) { var originalObjectKeys = Object.keys; overrideNative(Object, 'keys', function keys(value) { return originalObjectKeys(ES.ToObject(value)); }); keys = Object.keys; } var objectKeysRejectsRegex = throwsError(function () { return Object.keys(/a/g); }); if (objectKeysRejectsRegex) { var regexRejectingObjectKeys = Object.keys; overrideNative(Object, 'keys', function keys(value) { if (Type.regex(value)) { var regexKeys = []; for (var k in value) { if (_hasOwnProperty(value, k)) { _push(regexKeys, k); } } return regexKeys; } return regexRejectingObjectKeys(value); }); keys = Object.keys; } if (Object.getOwnPropertyNames) { var objectGOPNAcceptsPrimitives = !throwsError(function () { return Object.getOwnPropertyNames('foo'); }); if (!objectGOPNAcceptsPrimitives) { var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : []; var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; overrideNative(Object, 'getOwnPropertyNames', function getOwnPropertyNames(value) { var val = ES.ToObject(value); if (_toString(val) === '[object Window]') { try { return originalObjectGetOwnPropertyNames(val); } catch (e) { // IE bug where layout engine calls userland gOPN for cross-domain `window` objects return _concat([], cachedWindowNames); } } return originalObjectGetOwnPropertyNames(val); }); } } if (Object.getOwnPropertyDescriptor) { var objectGOPDAcceptsPrimitives = !throwsError(function () { return Object.getOwnPropertyDescriptor('foo', 'bar'); }); if (!objectGOPDAcceptsPrimitives) { var originalObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; overrideNative(Object, 'getOwnPropertyDescriptor', function getOwnPropertyDescriptor(value, property) { return originalObjectGetOwnPropertyDescriptor(ES.ToObject(value), property); }); } } if (Object.seal) { var objectSealAcceptsPrimitives = !throwsError(function () { return Object.seal('foo'); }); if (!objectSealAcceptsPrimitives) { var originalObjectSeal = Object.seal; overrideNative(Object, 'seal', function seal(value) { if (!ES.TypeIsObject(value)) { return value; } return originalObjectSeal(value); }); } } if (Object.isSealed) { var objectIsSealedAcceptsPrimitives = !throwsError(function () { return Object.isSealed('foo'); }); if (!objectIsSealedAcceptsPrimitives) { var originalObjectIsSealed = Object.isSealed; overrideNative(Object, 'isSealed', function isSealed(value) { if (!ES.TypeIsObject(value)) { return true; } return originalObjectIsSealed(value); }); } } if (Object.freeze) { var objectFreezeAcceptsPrimitives = !throwsError(function () { return Object.freeze('foo'); }); if (!objectFreezeAcceptsPrimitives) { var originalObjectFreeze = Object.freeze; overrideNative(Object, 'freeze', function freeze(value) { if (!ES.TypeIsObject(value)) { return value; } return originalObjectFreeze(value); }); } } if (Object.isFrozen) { var objectIsFrozenAcceptsPrimitives = !throwsError(function () { return Object.isFrozen('foo'); }); if (!objectIsFrozenAcceptsPrimitives) { var originalObjectIsFrozen = Object.isFrozen; overrideNative(Object, 'isFrozen', function isFrozen(value) { if (!ES.TypeIsObject(value)) { return true; } return originalObjectIsFrozen(value); }); } } if (Object.preventExtensions) { var objectPreventExtensionsAcceptsPrimitives = !throwsError(function () { return Object.preventExtensions('foo'); }); if (!objectPreventExtensionsAcceptsPrimitives) { var originalObjectPreventExtensions = Object.preventExtensions; overrideNative(Object, 'preventExtensions', function preventExtensions(value) { if (!ES.TypeIsObject(value)) { return value; } return originalObjectPreventExtensions(value); }); } } if (Object.isExtensible) { var objectIsExtensibleAcceptsPrimitives = !throwsError(function () { return Object.isExtensible('foo'); }); if (!objectIsExtensibleAcceptsPrimitives) { var originalObjectIsExtensible = Object.isExtensible; overrideNative(Object, 'isExtensible', function isExtensible(value) { if (!ES.TypeIsObject(value)) { return false; } return originalObjectIsExtensible(value); }); } } if (Object.getPrototypeOf) { var objectGetProtoAcceptsPrimitives = !throwsError(function () { return Object.getPrototypeOf('foo'); }); if (!objectGetProtoAcceptsPrimitives) { var originalGetProto = Object.getPrototypeOf; overrideNative(Object, 'getPrototypeOf', function getPrototypeOf(value) { return originalGetProto(ES.ToObject(value)); }); } } var hasFlags = supportsDescriptors && (function () { var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags'); return desc && ES.IsCallable(desc.get); }()); if (supportsDescriptors && !hasFlags) { var regExpFlagsGetter = function flags() { if (!ES.TypeIsObject(this)) { throw new TypeError('Method called on incompatible type: must be an object.'); } var result = ''; if (this.global) { result += 'g'; } if (this.ignoreCase) { result += 'i'; } if (this.multiline) { result += 'm'; } if (this.unicode) { result += 'u'; } if (this.sticky) { result += 'y'; } return result; }; Value.getter(RegExp.prototype, 'flags', regExpFlagsGetter); } var regExpSupportsFlagsWithRegex = supportsDescriptors && valueOrFalseIfThrows(function () { return String(new RegExp(/a/g, 'i')) === '/a/i'; }); var regExpNeedsToSupportSymbolMatch = hasSymbols && supportsDescriptors && (function () { // Edge 0.12 supports flags fully, but does not support Symbol.match var regex = /./; regex[Symbol.match] = false; return RegExp(regex) === regex; }()); var regexToStringIsGeneric = valueOrFalseIfThrows(function () { return RegExp.prototype.toString.call({ source: 'abc' }) === '/abc/'; }); var regexToStringSupportsGenericFlags = regexToStringIsGeneric && valueOrFalseIfThrows(function () { return RegExp.prototype.toString.call({ source: 'a', flags: 'b' }) === '/a/b'; }); if (!regexToStringIsGeneric || !regexToStringSupportsGenericFlags) { var origRegExpToString = RegExp.prototype.toString; defineProperty(RegExp.prototype, 'toString', function toString() { var R = ES.RequireObjectCoercible(this); if (Type.regex(R)) { return _call(origRegExpToString, R); } var pattern = $String(R.source); var flags = $String(R.flags); return '/' + pattern + '/' + flags; }, true); Value.preserveToString(RegExp.prototype.toString, origRegExpToString); RegExp.prototype.toString.prototype = void 0; } if (supportsDescriptors && (!regExpSupportsFlagsWithRegex || regExpNeedsToSupportSymbolMatch)) { var flagsGetter = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get; var sourceDesc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source') || {}; var legacySourceGetter = function () { // prior to it being a getter, it's own + nonconfigurable return this.source; }; var sourceGetter = ES.IsCallable(sourceDesc.get) ? sourceDesc.get : legacySourceGetter; var OrigRegExp = RegExp; var RegExpShim = (function () { return function RegExp(pattern, flags) { var patternIsRegExp = ES.IsRegExp(pattern); var calledWithNew = this instanceof RegExp; if (!calledWithNew && patternIsRegExp && typeof flags === 'undefined' && pattern.constructor === RegExp) { return pattern; } var P = pattern; var F = flags; if (Type.regex(pattern)) { P = ES.Call(sourceGetter, pattern); F = typeof flags === 'undefined' ? ES.Call(flagsGetter, pattern) : flags; return new RegExp(P, F); } else if (patternIsRegExp) { P = pattern.source; F = typeof flags === 'undefined' ? pattern.flags : flags; } return new OrigRegExp(pattern, flags); }; }()); wrapConstructor(OrigRegExp, RegExpShim, { $input: true // Chrome < v39 & Opera < 26 have a nonstandard "$input" property }); RegExp = RegExpShim; // eslint-disable-line no-global-assign Value.redefine(globals, 'RegExp', RegExpShim); } if (supportsDescriptors) { var regexGlobals = { input: '$_', lastMatch: '$&', lastParen: '$+', leftContext: '$`', rightContext: '$\'' }; _forEach(keys(regexGlobals), function (prop) { if (prop in RegExp && !(regexGlobals[prop] in RegExp)) { Value.getter(RegExp, regexGlobals[prop], function get() { return RegExp[prop]; }); } }); } addDefaultSpecies(RegExp); var inverseEpsilon = 1 / Number.EPSILON; var roundTiesToEven = function roundTiesToEven(n) { // Even though this reduces down to `return n`, it takes advantage of built-in rounding. return (n + inverseEpsilon) - inverseEpsilon; }; var BINARY_32_EPSILON = Math.pow(2, -23); var BINARY_32_MAX_VALUE = Math.pow(2, 127) * (2 - BINARY_32_EPSILON); var BINARY_32_MIN_VALUE = Math.pow(2, -126); var E = Math.E; var LOG2E = Math.LOG2E; var LOG10E = Math.LOG10E; var numberCLZ = Number.prototype.clz; delete Number.prototype.clz; // Safari 8 has Number#clz var MathShims = { acosh: function acosh(value) { var x = Number(value); if (numberIsNaN(x) || value < 1) { return NaN; } if (x === 1) { return 0; } if (x === Infinity) { return x; } var xInvSquared = 1 / (x * x); if (x < 2) { return _log1p(x - 1 + (_sqrt(1 - xInvSquared) * x)); } var halfX = x / 2; return _log1p(halfX + (_sqrt(1 - xInvSquared) * halfX) - 1) + (1 / LOG2E); }, asinh: function asinh(value) { var x = Number(value); if (x === 0 || !globalIsFinite(x)) { return x; } var a = _abs(x); var aSquared = a * a; var s = _sign(x); if (a < 1) { return s * _log1p(a + (aSquared / (_sqrt(aSquared + 1) + 1))); } return s * (_log1p((a / 2) + (_sqrt(1 + (1 / aSquared)) * a / 2) - 1) + (1 / LOG2E)); }, atanh: function atanh(value) { var x = Number(value); if (x === 0) { return x; } if (x === -1) { return -Infinity; } if (x === 1) { return Infinity; } if (numberIsNaN(x) || x < -1 || x > 1) { return NaN; } var a = _abs(x); return _sign(x) * _log1p(2 * a / (1 - a)) / 2; }, cbrt: function cbrt(value) { var x = Number(value); if (x === 0) { return x; } var negate = x < 0; var result; if (negate) { x = -x; } if (x === Infinity) { result = Infinity; } else { result = _exp(_log(x) / 3); // from http://en.wikipedia.org/wiki/Cube_root#Numerical_methods result = ((x / (result * result)) + (2 * result)) / 3; } return negate ? -result : result; }, clz32: function clz32(value) { // See https://bugs.ecmascript.org/show_bug.cgi?id=2465 var x = Number(value); var number = ES.ToUint32(x); if (number === 0) { return 32; } return numberCLZ ? ES.Call(numberCLZ, number) : 31 - _floor(_log(number + 0.5) * LOG2E); }, cosh: function cosh(value) { var x = Number(value); if (x === 0) { return 1; } // +0 or -0 if (numberIsNaN(x)) { return NaN; } if (!globalIsFinite(x)) { return Infinity; } var t = _exp(_abs(x) - 1); return (t + (1 / (t * E * E))) * (E / 2); }, expm1: function expm1(value) { var x = Number(value); if (x === -Infinity) { return -1; } if (!globalIsFinite(x) || x === 0) { return x; } if (_abs(x) > 0.5) { return _exp(x) - 1; } // A more precise approximation using Taylor series expansion // from https://github.com/paulmillr/es6-shim/issues/314#issuecomment-70293986 var t = x; var sum = 0; var n = 1; while (sum + t !== sum) { sum += t; n += 1; t *= x / n; } return sum; }, hypot: function hypot(x, y) { var result = 0; var largest = 0; for (var i = 0; i < arguments.length; ++i) { var value = _abs(Number(arguments[i])); if (largest < value) { result *= (largest / value) * (largest / value); result += 1; largest = value; } else { result += value > 0 ? (value / largest) * (value / largest) : value; } } return largest === Infinity ? Infinity : largest * _sqrt(result); }, log2: function log2(value) { return _log(value) * LOG2E; }, log10: function log10(value) { return _log(value) * LOG10E; }, log1p: _log1p, sign: _sign, sinh: function sinh(value) { var x = Number(value); if (!globalIsFinite(x) || x === 0) { return x; } var a = _abs(x); if (a < 1) { var u = Math.expm1(a); return _sign(x) * u * (1 + (1 / (u + 1))) / 2; } var t = _exp(a - 1); return _sign(x) * (t - (1 / (t * E * E))) * (E / 2); }, tanh: function tanh(value) { var x = Number(value); if (numberIsNaN(x) || x === 0) { return x; } // can exit early at +-20 as JS loses precision for true value at this integer if (x >= 20) { return 1; } if (x <= -20) { return -1; } return (Math.expm1(x) - Math.expm1(-x)) / (_exp(x) + _exp(-x)); }, trunc: function trunc(value) { var x = Number(value); return x < 0 ? -_floor(-x) : _floor(x); }, imul: function imul(x, y) { // taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul var a = ES.ToUint32(x); var b = ES.ToUint32(y); var ah = (a >>> 16) & 0xffff; var al = a & 0xffff; var bh = (b >>> 16) & 0xffff; var bl = b & 0xffff; // the shift by 0 fixes the sign on the high part // the final |0 converts the unsigned value into a signed value return (al * bl) + ((((ah * bl) + (al * bh)) << 16) >>> 0) | 0; }, fround: function fround(x) { var v = Number(x); if (v === 0 || v === Infinity || v === -Infinity || numberIsNaN(v)) { return v; } var sign = _sign(v); var abs = _abs(v); if (abs < BINARY_32_MIN_VALUE) { return sign * roundTiesToEven(abs / BINARY_32_MIN_VALUE / BINARY_32_EPSILON) * BINARY_32_MIN_VALUE * BINARY_32_EPSILON; } // Veltkamp's splitting (?) var a = (1 + (BINARY_32_EPSILON / Number.EPSILON)) * abs; var result = a - (a - abs); if (result > BINARY_32_MAX_VALUE || numberIsNaN(result)) { return sign * Infinity; } return sign * result; } }; var withinULPDistance = function withinULPDistance(result, expected, distance) { return _abs(1 - (result / expected)) / Number.EPSILON < (distance || 8); }; defineProperties(Math, MathShims); // Chrome < 40 sinh returns ∞ for large numbers defineProperty(Math, 'sinh', MathShims.sinh, Math.sinh(710) === Infinity); // Chrome < 40 cosh returns ∞ for large numbers defineProperty(Math, 'cosh', MathShims.cosh, Math.cosh(710) === Infinity); // IE 11 TP has an imprecise log1p: reports Math.log1p(-1e-17) as 0 defineProperty(Math, 'log1p', MathShims.log1p, Math.log1p(-1e-17) !== -1e-17); // IE 11 TP has an imprecise asinh: reports Math.asinh(-1e7) as not exactly equal to -Math.asinh(1e7) defineProperty(Math, 'asinh', MathShims.asinh, Math.asinh(-1e7) !== -Math.asinh(1e7)); // Chrome < 54 asinh returns ∞ for large numbers and should not defineProperty(Math, 'asinh', MathShims.asinh, Math.asinh(1e+300) === Infinity); // Chrome < 54 atanh incorrectly returns 0 for large numbers defineProperty(Math, 'atanh', MathShims.atanh, Math.atanh(1e-300) === 0); // Chrome 40 has an imprecise Math.tanh with very small numbers defineProperty(Math, 'tanh', MathShims.tanh, Math.tanh(-2e-17) !== -2e-17); // Chrome 40 loses Math.acosh precision with high numbers defineProperty(Math, 'acosh', MathShims.acosh, Math.acosh(Number.MAX_VALUE) === Infinity); // Chrome < 54 has an inaccurate acosh for EPSILON deltas defineProperty(Math, 'acosh', MathShims.acosh, !withinULPDistance(Math.acosh(1 + Number.EPSILON), Math.sqrt(2 * Number.EPSILON))); // Firefox 38 on Windows defineProperty(Math, 'cbrt', MathShims.cbrt, !withinULPDistance(Math.cbrt(1e-300), 1e-100)); // node 0.11 has an imprecise Math.sinh with very small numbers defineProperty(Math, 'sinh', MathShims.sinh, Math.sinh(-2e-17) !== -2e-17); // FF 35 on Linux reports 22025.465794806725 for Math.expm1(10) var expm1OfTen = Math.expm1(10); defineProperty(Math, 'expm1', MathShims.expm1, expm1OfTen > 22025.465794806719 || expm1OfTen < 22025.4657948067165168); // node v12.11 - v12.15 report NaN defineProperty(Math, 'hypot', MathShims.hypot, Math.hypot(Infinity, NaN) !== Infinity); var origMathRound = Math.round; // breaks in e.g. Safari 8, Internet Explorer 11, Opera 12 var roundHandlesBoundaryConditions = Math.round(0.5 - (Number.EPSILON / 4)) === 0 && Math.round(-0.5 + (Number.EPSILON / 3.99)) === 1; // When engines use Math.floor(x + 0.5) internally, Math.round can be buggy for large integers. // This behavior should be governed by "round to nearest, ties to even mode" // see http://www.ecma-international.org/ecma-262/6.0/#sec-terms-and-definitions-number-type // These are the boundary cases where it breaks. var smallestPositiveNumberWhereRoundBreaks = inverseEpsilon + 1; var largestPositiveNumberWhereRoundBreaks = (2 * inverseEpsilon) - 1; var roundDoesNotIncreaseIntegers = [ smallestPositiveNumberWhereRoundBreaks, largestPositiveNumberWhereRoundBreaks ].every(function (num) { return Math.round(num) === num; }); defineProperty(Math, 'round', function round(x) { var floor = _floor(x); var ceil = floor === -1 ? -0 : floor + 1; return x - floor < 0.5 ? floor : ceil; }, !roundHandlesBoundaryConditions || !roundDoesNotIncreaseIntegers); Value.preserveToString(Math.round, origMathRound); var origImul = Math.imul; if (Math.imul(0xffffffff, 5) !== -5) { // Safari 6.1, at least, reports "0" for this value Math.imul = MathShims.imul; Value.preserveToString(Math.imul, origImul); } if (Math.imul.length !== 2) { // Safari 8.0.4 has a length of 1 // fixed in https://bugs.webkit.org/show_bug.cgi?id=143658 overrideNative(Math, 'imul', function imul(x, y) { return ES.Call(origImul, Math, arguments); }); } // Promises // Simplest possible implementation; use a 3rd-party library if you // want the best possible speed and/or long stack traces. var PromiseShim = (function () { var setTimeout = globals.setTimeout; // some environments don't have setTimeout - no way to shim here. if (typeof setTimeout !== 'function' && typeof setTimeout !== 'object') { return; } ES.IsPromise = function (promise) { if (!ES.TypeIsObject(promise)) { return false; } if (typeof promise._promise === 'undefined') { return false; // uninitialized, or missing our hidden field. } return true; }; // "PromiseCapability" in the spec is what most promise implementations // call a "deferred". var PromiseCapability = function (C) { if (!ES.IsConstructor(C)) { throw new TypeError('Bad promise constructor'); } var capability = this; var resolver = function (resolve, reject) { if (capability.resolve !== void 0 || capability.reject !== void 0) { throw new TypeError('Bad Promise implementation!'); } capability.resolve = resolve; capability.reject = reject; }; // Initialize fields to inform optimizers about the object shape. capability.resolve = void 0; capability.reject = void 0; capability.promise = new C(resolver); if (!(ES.IsCallable(capability.resolve) && ES.IsCallable(capability.reject))) { throw new TypeError('Bad promise constructor'); } }; // find an appropriate setImmediate-alike var makeZeroTimeout; if (typeof window !== 'undefined' && ES.IsCallable(window.postMessage)) { makeZeroTimeout = function () { // from http://dbaron.org/log/20100309-faster-timeouts var timeouts = []; var messageName = 'zero-timeout-message'; var setZeroTimeout = function (fn) { _push(timeouts, fn); window.postMessage(messageName, '*'); }; var handleMessage = function (event) { if (event.source === window && event.data === messageName) { event.stopPropagation(); if (timeouts.length === 0) { return; } var fn = _shift(timeouts); fn(); } }; window.addEventListener('message', handleMessage, true); return setZeroTimeout; }; } var makePromiseAsap = function () { // An efficient task-scheduler based on a pre-existing Promise // implementation, which we can use even if we override the // global Promise below (in order to workaround bugs) // https://github.com/Raynos/observ-hash/issues/2#issuecomment-35857671 var P = globals.Promise; var pr = P && P.resolve && P.resolve(); return pr && function (task) { return pr.then(task); }; }; var enqueue = ES.IsCallable(globals.setImmediate) ? globals.setImmediate : ( typeof process === 'object' && process.nextTick ? process.nextTick : makePromiseAsap() || (ES.IsCallable(makeZeroTimeout) ? makeZeroTimeout() : function (task) { setTimeout(task, 0); }) ); // fallback // Constants for Promise implementation var PROMISE_IDENTITY = function (x) { return x; }; var PROMISE_THROWER = function (e) { throw e; }; var PROMISE_PENDING = 0; var PROMISE_FULFILLED = 1; var PROMISE_REJECTED = 2; // We store fulfill/reject handlers and capabilities in a single array. var PROMISE_FULFILL_OFFSET = 0; var PROMISE_REJECT_OFFSET = 1; var PROMISE_CAPABILITY_OFFSET = 2; // This is used in an optimization for chaining promises via then. var PROMISE_FAKE_CAPABILITY = {}; var enqueuePromiseReactionJob = function (handler, capability, argument) { enqueue(function () { promiseReactionJob(handler, capability, argument); }); }; var promiseReactionJob = function (handler, promiseCapability, argument) { var handlerResult, f; if (promiseCapability === PROMISE_FAKE_CAPABILITY) { // Fast case, when we don't actually need to chain through to a // (real) promiseCapability. return handler(argument); } try { handlerResult = handler(argument); f = promiseCapability.resolve; } catch (e) { handlerResult = e; f = promiseCapability.reject; } f(handlerResult); }; var fulfillPromise = function (promise, value) { var _promise = promise._promise; var length = _promise.reactionLength; if (length > 0) { enqueuePromiseReactionJob( _promise.fulfillReactionHandler0, _promise.reactionCapability0, value ); _promise.fulfillReactionHandler0 = void 0; _promise.rejectReactions0 = void 0; _promise.reactionCapability0 = void 0; if (length > 1) { for (var i = 1, idx = 0; i < length; i++, idx += 3) { enqueuePromiseReactionJob( _promise[idx + PROMISE_FULFILL_OFFSET], _promise[idx + PROMISE_CAPABILITY_OFFSET], value ); promise[idx + PROMISE_FULFILL_OFFSET] = void 0; promise[idx + PROMISE_REJECT_OFFSET] = void 0; promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0; } } } _promise.result = value; _promise.state = PROMISE_FULFILLED; _promise.reactionLength = 0; }; var rejectPromise = function (promise, reason) { var _promise = promise._promise; var length = _promise.reactionLength; if (length > 0) { enqueuePromiseReactionJob( _promise.rejectReactionHandler0, _promise.reactionCapability0, reason ); _promise.fulfillReactionHandler0 = void 0; _promise.rejectReactions0 = void 0; _promise.reactionCapability0 = void 0; if (length > 1) { for (var i = 1, idx = 0; i < length; i++, idx += 3) { enqueuePromiseReactionJob( _promise[idx + PROMISE_REJECT_OFFSET], _promise[idx + PROMISE_CAPABILITY_OFFSET], reason ); promise[idx + PROMISE_FULFILL_OFFSET] = void 0; promise[idx + PROMISE_REJECT_OFFSET] = void 0; promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0; } } } _promise.result = reason; _promise.state = PROMISE_REJECTED; _promise.reactionLength = 0; }; var createResolvingFunctions = function (promise) { var alreadyResolved = false; var resolve = function (resolution) { var then; if (alreadyResolved) { return; } alreadyResolved = true; if (resolution === promise) { return rejectPromise(promise, new TypeError('Self resolution')); } if (!ES.TypeIsObject(resolution)) { return fulfillPromise(promise, resolution); } try { then = resolution.then; } catch (e) { return rejectPromise(promise, e); } if (!ES.IsCallable(then)) { return fulfillPromise(promise, resolution); } enqueue(function () { promiseResolveThenableJob(promise, resolution, then); }); }; var reject = function (reason) { if (alreadyResolved) { return; } alreadyResolved = true; return rejectPromise(promise, reason); }; return { resolve: resolve, reject: reject }; }; var optimizedThen = function (then, thenable, resolve, reject) { // Optimization: since we discard the result, we can pass our // own then implementation a special hint to let it know it // doesn't have to create it. (The PROMISE_FAKE_CAPABILITY // object is local to this implementation and unforgeable outside.) if (then === Promise$prototype$then) { _call(then, thenable, resolve, reject, PROMISE_FAKE_CAPABILITY); } else { _call(then, thenable, resolve, reject); } }; var promiseResolveThenableJob = function (promise, thenable, then) { var resolvingFunctions = createResolvingFunctions(promise); var resolve = resolvingFunctions.resolve; var reject = resolvingFunctions.reject; try { optimizedThen(then, thenable, resolve, reject); } catch (e) { reject(e); } }; var Promise$prototype, Promise$prototype$then; var Promise = (function () { var PromiseShim = function Promise(resolver) { if (!(this instanceof PromiseShim)) { throw new TypeError('Constructor Promise requires "new"'); } if (this && this._promise) { throw new TypeError('Bad construction'); } // see https://bugs.ecmascript.org/show_bug.cgi?id=2482 if (!ES.IsCallable(resolver)) { throw new TypeError('not a valid resolver'); } var promise = emulateES6construct(this, PromiseShim, Promise$prototype, { _promise: { result: void 0, state: PROMISE_PENDING, // The first member of the "reactions" array is inlined here, // since most promises only have one reaction. // We've also exploded the 'reaction' object to inline the // "handler" and "capability" fields, since both fulfill and // reject reactions share the same capability. reactionLength: 0, fulfillReactionHandler0: void 0, rejectReactionHandler0: void 0, reactionCapability0: void 0 } }); var resolvingFunctions = createResolvingFunctions(promise); var reject = resolvingFunctions.reject; try { resolver(resolvingFunctions.resolve, reject); } catch (e) { reject(e); } return promise; }; return PromiseShim; }()); Promise$prototype = Promise.prototype; var _promiseAllResolver = function (index, values, capability, remaining) { var alreadyCalled = false; return function (x) { if (alreadyCalled) { return; } alreadyCalled = true; values[index] = x; if ((--remaining.count) === 0) { var resolve = capability.resolve; resolve(values); // call w/ this===undefined } }; }; var performPromiseAll = function (iteratorRecord, C, resultCapability) { var it = iteratorRecord.iterator; var values = []; var remaining = { count: 1 }; var next, nextValue; var index = 0; while (true) { try { next = ES.IteratorStep(it); if (next === false) { iteratorRecord.done = true; break; } nextValue = next.value; } catch (e) { iteratorRecord.done = true; throw e; } values[index] = void 0; var nextPromise = C.resolve(nextValue); var resolveElement = _promiseAllResolver( index, values, resultCapability, remaining ); remaining.count += 1; optimizedThen(nextPromise.then, nextPromise, resolveElement, resultCapability.reject); index += 1; } if ((--remaining.count) === 0) { var resolve = resultCapability.resolve; resolve(values); // call w/ this===undefined } return resultCapability.promise; }; var performPromiseRace = function (iteratorRecord, C, resultCapability) { var it = iteratorRecord.iterator; var next, nextValue, nextPromise; while (true) { try { next = ES.IteratorStep(it); if (next === false) { // NOTE: If iterable has no items, resulting promise will never // resolve; see: // https://github.com/domenic/promises-unwrapping/issues/75 // https://bugs.ecmascript.org/show_bug.cgi?id=2515 iteratorRecord.done = true; break; } nextValue = next.value; } catch (e) { iteratorRecord.done = true; throw e; } nextPromise = C.resolve(nextValue); optimizedThen(nextPromise.then, nextPromise, resultCapability.resolve, resultCapability.reject); } return resultCapability.promise; }; defineProperties(Promise, { all: function all(iterable) { var C = this; if (!ES.TypeIsObject(C)) { throw new TypeError('Promise is not object'); } var capability = new PromiseCapability(C); var iterator, iteratorRecord; try { iterator = ES.GetIterator(iterable); iteratorRecord = { iterator: iterator, done: false }; return performPromiseAll(iteratorRecord, C, capability); } catch (e) { var exception = e; if (iteratorRecord && !iteratorRecord.done) { try { ES.IteratorClose(iterator, true); } catch (ee) { exception = ee; } } var reject = capability.reject; reject(exception); return capability.promise; } }, race: function race(iterable) { var C = this; if (!ES.TypeIsObject(C)) { throw new TypeError('Promise is not object'); } var capability = new PromiseCapability(C); var iterator, iteratorRecord; try { iterator = ES.GetIterator(iterable); iteratorRecord = { iterator: iterator, done: false }; return performPromiseRace(iteratorRecord, C, capability); } catch (e) { var exception = e; if (iteratorRecord && !iteratorRecord.done) { try { ES.IteratorClose(iterator, true); } catch (ee) { exception = ee; } } var reject = capability.reject; reject(exception); return capability.promise; } }, reject: function reject(reason) { var C = this; if (!ES.TypeIsObject(C)) { throw new TypeError('Bad promise constructor'); } var capability = new PromiseCapability(C); var rejectFunc = capability.reject; rejectFunc(reason); // call with this===undefined return capability.promise; }, resolve: function resolve(v) { // See https://esdiscuss.org/topic/fixing-promise-resolve for spec var C = this; if (!ES.TypeIsObject(C)) { throw new TypeError('Bad promise constructor'); } if (ES.IsPromise(v)) { var constructor = v.constructor; if (constructor === C) { return v; } } var capability = new PromiseCapability(C); var resolveFunc = capability.resolve; resolveFunc(v); // call with this===undefined return capability.promise; } }); defineProperties(Promise$prototype, { 'catch': function (onRejected) { return this.then(null, onRejected); }, then: function then(onFulfilled, onRejected) { var promise = this; if (!ES.IsPromise(promise)) { throw new TypeError('not a promise'); } var C = ES.SpeciesConstructor(promise, Promise); var resultCapability; var returnValueIsIgnored = arguments.length > 2 && arguments[2] === PROMISE_FAKE_CAPABILITY; if (returnValueIsIgnored && C === Promise) { resultCapability = PROMISE_FAKE_CAPABILITY; } else { resultCapability = new PromiseCapability(C); } // PerformPromiseThen(promise, onFulfilled, onRejected, resultCapability) // Note that we've split the 'reaction' object into its two // components, "capabilities" and "handler" // "capabilities" is always equal to `resultCapability` var fulfillReactionHandler = ES.IsCallable(onFulfilled) ? onFulfilled : PROMISE_IDENTITY; var rejectReactionHandler = ES.IsCallable(onRejected) ? onRejected : PROMISE_THROWER; var _promise = promise._promise; var value; if (_promise.state === PROMISE_PENDING) { if (_promise.reactionLength === 0) { _promise.fulfillReactionHandler0 = fulfillReactionHandler; _promise.rejectReactionHandler0 = rejectReactionHandler; _promise.reactionCapability0 = resultCapability; } else { var idx = 3 * (_promise.reactionLength - 1); _promise[idx + PROMISE_FULFILL_OFFSET] = fulfillReactionHandler; _promise[idx + PROMISE_REJECT_OFFSET] = rejectReactionHandler; _promise[idx + PROMISE_CAPABILITY_OFFSET] = resultCapability; } _promise.reactionLength += 1; } else if (_promise.state === PROMISE_FULFILLED) { value = _promise.result; enqueuePromiseReactionJob( fulfillReactionHandler, resultCapability, value ); } else if (_promise.state === PROMISE_REJECTED) { value = _promise.result; enqueuePromiseReactionJob( rejectReactionHandler, resultCapability, value ); } else { throw new TypeError('unexpected Promise state'); } return resultCapability.promise; } }); // This helps the optimizer by ensuring that methods which take // capabilities aren't polymorphic. PROMISE_FAKE_CAPABILITY = new PromiseCapability(Promise); Promise$prototype$then = Promise$prototype.then; return Promise; }()); // Chrome's native Promise has extra methods that it shouldn't have. Let's remove them. if (globals.Promise) { delete globals.Promise.accept; delete globals.Promise.defer; delete globals.Promise.prototype.chain; } if (typeof PromiseShim === 'function') { // export the Promise constructor. defineProperties(globals, { Promise: PromiseShim }); // In Chrome 33 (and thereabouts) Promise is defined, but the // implementation is buggy in a number of ways. Let's check subclassing // support to see if we have a buggy implementation. var promiseSupportsSubclassing = supportsSubclassing(globals.Promise, function (S) { return S.resolve(42).then(function () {}) instanceof S; }); var promiseIgnoresNonFunctionThenCallbacks = !throwsError(function () { return globals.Promise.reject(42).then(null, 5).then(null, noop); }); var promiseRequiresObjectContext = throwsError(function () { return globals.Promise.call(3, noop); }); // Promise.resolve() was errata'ed late in the ES6 process. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1170742 // https://code.google.com/p/v8/issues/detail?id=4161 // It serves as a proxy for a number of other bugs in early Promise // implementations. var promiseResolveBroken = (function (Promise) { var p = Promise.resolve(5); p.constructor = {}; var p2 = Promise.resolve(p); try { p2.then(null, noop).then(null, noop); // avoid "uncaught rejection" warnings in console } catch (e) { return true; // v8 native Promises break here https://code.google.com/p/chromium/issues/detail?id=575314 } return p === p2; // This *should* be false! }(globals.Promise)); // Chrome 46 (probably older too) does not retrieve a thenable's .then synchronously var getsThenSynchronously = supportsDescriptors && (function () { var count = 0; // eslint-disable-next-line getter-return var thenable = Object.defineProperty({}, 'then', { get: function () { count += 1; } }); Promise.resolve(thenable); return count === 1; }()); var BadResolverPromise = function BadResolverPromise(executor) { var p = new Promise(executor); executor(3, function () {}); this.then = p.then; this.constructor = BadResolverPromise; }; BadResolverPromise.prototype = Promise.prototype; BadResolverPromise.all = Promise.all; // Chrome Canary 49 (probably older too) has some implementation bugs var hasBadResolverPromise = valueOrFalseIfThrows(function () { return !!BadResolverPromise.all([1, 2]); }); if ( !promiseSupportsSubclassing || !promiseIgnoresNonFunctionThenCallbacks || !promiseRequiresObjectContext || promiseResolveBroken || !getsThenSynchronously || hasBadResolverPromise ) { Promise = PromiseShim; // eslint-disable-line no-global-assign overrideNative(globals, 'Promise', PromiseShim); } if (Promise.all.length !== 1) { var origAll = Promise.all; overrideNative(Promise, 'all', function all(iterable) { return ES.Call(origAll, this, arguments); }); } if (Promise.race.length !== 1) { var origRace = Promise.race; overrideNative(Promise, 'race', function race(iterable) { return ES.Call(origRace, this, arguments); }); } if (Promise.resolve.length !== 1) { var origResolve = Promise.resolve; overrideNative(Promise, 'resolve', function resolve(x) { return ES.Call(origResolve, this, arguments); }); } if (Promise.reject.length !== 1) { var origReject = Promise.reject; overrideNative(Promise, 'reject', function reject(r) { return ES.Call(origReject, this, arguments); }); } ensureEnumerable(Promise, 'all'); ensureEnumerable(Promise, 'race'); ensureEnumerable(Promise, 'resolve'); ensureEnumerable(Promise, 'reject'); addDefaultSpecies(Promise); } // Map and Set require a true ES5 environment // Their fast path also requires that the environment preserve // property insertion order, which is not guaranteed by the spec. var testOrder = function (a) { var b = keys(_reduce(a, function (o, k) { o[k] = true; return o; }, {})); return a.join(':') === b.join(':'); }; var preservesInsertionOrder = testOrder(['z', 'a', 'bb']); // some engines (eg, Chrome) only preserve insertion order for string keys var preservesNumericInsertionOrder = testOrder(['z', 1, 'a', '3', 2]); if (supportsDescriptors) { var fastkey = function fastkey(key, skipInsertionOrderCheck) { if (!skipInsertionOrderCheck && !preservesInsertionOrder) { return null; } if (isNullOrUndefined(key)) { return '^' + ES.ToString(key); } else if (typeof key === 'string') { return '$' + key; } else if (typeof key === 'number') { // note that -0 will get coerced to "0" when used as a property key if (!preservesNumericInsertionOrder) { return 'n' + key; } return key; } else if (typeof key === 'boolean') { return 'b' + key; } return null; }; var emptyObject = function emptyObject() { // accomodate some older not-quite-ES5 browsers return Object.create ? Object.create(null) : {}; }; var addIterableToMap = function addIterableToMap(MapConstructor, map, iterable) { if (isArray(iterable) || Type.string(iterable)) { _forEach(iterable, function (entry) { if (!ES.TypeIsObject(entry)) { throw new TypeError('Iterator value ' + entry + ' is not an entry object'); } map.set(entry[0], entry[1]); }); } else if (iterable instanceof MapConstructor) { _call(MapConstructor.prototype.forEach, iterable, function (value, key) { map.set(key, value); }); } else { var iter, adder; if (!isNullOrUndefined(iterable)) { adder = map.set; if (!ES.IsCallable(adder)) { throw new TypeError('bad map'); } iter = ES.GetIterator(iterable); } if (typeof iter !== 'undefined') { while (true) { var next = ES.IteratorStep(iter); if (next === false) { break; } var nextItem = next.value; try { if (!ES.TypeIsObject(nextItem)) { throw new TypeError('Iterator value ' + nextItem + ' is not an entry object'); } _call(adder, map, nextItem[0], nextItem[1]); } catch (e) { ES.IteratorClose(iter, true); throw e; } } } } }; var addIterableToSet = function addIterableToSet(SetConstructor, set, iterable) { if (isArray(iterable) || Type.string(iterable)) { _forEach(iterable, function (value) { set.add(value); }); } else if (iterable instanceof SetConstructor) { _call(SetConstructor.prototype.forEach, iterable, function (value) { set.add(value); }); } else { var iter, adder; if (!isNullOrUndefined(iterable)) { adder = set.add; if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); } iter = ES.GetIterator(iterable); } if (typeof iter !== 'undefined') { while (true) { var next = ES.IteratorStep(iter); if (next === false) { break; } var nextValue = next.value; try { _call(adder, set, nextValue); } catch (e) { ES.IteratorClose(iter, true); throw e; } } } } }; var collectionShims = { Map: (function () { var empty = {}; var MapEntry = function MapEntry(key, value) { this.key = key; this.value = value; this.next = null; this.prev = null; }; MapEntry.prototype.isRemoved = function isRemoved() { return this.key === empty; }; var isMap = function isMap(map) { return !!map._es6map; }; var requireMapSlot = function requireMapSlot(map, method) { if (!ES.TypeIsObject(map) || !isMap(map)) { throw new TypeError('Method Map.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(map)); } }; var MapIterator = function MapIterator(map, kind) { requireMapSlot(map, '[[MapIterator]]'); defineProperty(this, 'head', map._head); defineProperty(this, 'i', this.head); defineProperty(this, 'kind', kind); }; MapIterator.prototype = { isMapIterator: true, next: function next() { if (!this.isMapIterator) { throw new TypeError('Not a MapIterator'); } var i = this.i; var kind = this.kind; var head = this.head; if (typeof this.i === 'undefined') { return iteratorResult(); } while (i.isRemoved() && i !== head) { // back up off of removed entries i = i.prev; } // advance to next unreturned element. var result; while (i.next !== head) { i = i.next; if (!i.isRemoved()) { if (kind === 'key') { result = i.key; } else if (kind === 'value') { result = i.value; } else { result = [i.key, i.value]; } this.i = i; return iteratorResult(result); } } // once the iterator is done, it is done forever. this.i = void 0; return iteratorResult(); } }; addIterator(MapIterator.prototype); var Map$prototype; var MapShim = function Map() { if (!(this instanceof Map)) { throw new TypeError('Constructor Map requires "new"'); } if (this && this._es6map) { throw new TypeError('Bad construction'); } var map = emulateES6construct(this, Map, Map$prototype, { _es6map: true, _head: null, _map: OrigMap ? new OrigMap() : null, _size: 0, _storage: emptyObject() }); var head = new MapEntry(null, null); // circular doubly-linked list. /* eslint no-multi-assign: 1 */ head.next = head.prev = head; map._head = head; // Optionally initialize map from iterable if (arguments.length > 0) { addIterableToMap(Map, map, arguments[0]); } return map; }; Map$prototype = MapShim.prototype; Value.getter(Map$prototype, 'size', function () { if (typeof this._size === 'undefined') { throw new TypeError('size method called on incompatible Map'); } return this._size; }); defineProperties(Map$prototype, { get: function get(key) { requireMapSlot(this, 'get'); var entry; var fkey = fastkey(key, true); if (fkey !== null) { // fast O(1) path entry = this._storage[fkey]; if (entry) { return entry.value; } return; } if (this._map) { // fast object key path entry = origMapGet.call(this._map, key); if (entry) { return entry.value; } return; } var head = this._head; var i = head; while ((i = i.next) !== head) { if (ES.SameValueZero(i.key, key)) { return i.value; } } }, has: function has(key) { requireMapSlot(this, 'has'); var fkey = fastkey(key, true); if (fkey !== null) { // fast O(1) path return typeof this._storage[fkey] !== 'undefined'; } if (this._map) { // fast object key path return origMapHas.call(this._map, key); } var head = this._head; var i = head; while ((i = i.next) !== head) { if (ES.SameValueZero(i.key, key)) { return true; } } return false; }, set: function set(key, value) { requireMapSlot(this, 'set'); var head = this._head; var i = head; var entry; var fkey = fastkey(key, true); if (fkey !== null) { // fast O(1) path if (typeof this._storage[fkey] !== 'undefined') { this._storage[fkey].value = value; return this; } entry = this._storage[fkey] = new MapEntry(key, value); /* eslint no-multi-assign: 1 */ i = head.prev; // fall through } else if (this._map) { // fast object key path if (origMapHas.call(this._map, key)) { origMapGet.call(this._map, key).value = value; } else { entry = new MapEntry(key, value); origMapSet.call(this._map, key, entry); i = head.prev; // fall through } } while ((i = i.next) !== head) { if (ES.SameValueZero(i.key, key)) { i.value = value; return this; } } entry = entry || new MapEntry(key, value); if (ES.SameValue(-0, key)) { entry.key = +0; // coerce -0 to +0 in entry } entry.next = this._head; entry.prev = this._head.prev; entry.prev.next = entry; entry.next.prev = entry; this._size += 1; return this; }, 'delete': function (key) { requireMapSlot(this, 'delete'); var head = this._head; var i = head; var fkey = fastkey(key, true); if (fkey !== null) { // fast O(1) path if (typeof this._storage[fkey] === 'undefined') { return false; } i = this._storage[fkey].prev; delete this._storage[fkey]; // fall through } else if (this._map) { // fast object key path if (!origMapHas.call(this._map, key)) { return false; } i = origMapGet.call(this._map, key).prev; origMapDelete.call(this._map, key); // fall through } while ((i = i.next) !== head) { if (ES.SameValueZero(i.key, key)) { i.key = empty; i.value = empty; i.prev.next = i.next; i.next.prev = i.prev; this._size -= 1; return true; } } return false; }, clear: function clear() { /* eslint no-multi-assign: 1 */ requireMapSlot(this, 'clear'); this._map = OrigMap ? new OrigMap() : null; this._size = 0; this._storage = emptyObject(); var head = this._head; var i = head; var p = i.next; while ((i = p) !== head) { i.key = empty; i.value = empty; p = i.next; i.next = i.prev = head; } head.next = head.prev = head; }, keys: function keys() { requireMapSlot(this, 'keys'); return new MapIterator(this, 'key'); }, values: function values() { requireMapSlot(this, 'values'); return new MapIterator(this, 'value'); }, entries: function entries() { requireMapSlot(this, 'entries'); return new MapIterator(this, 'key+value'); }, forEach: function forEach(callback) { requireMapSlot(this, 'forEach'); var context = arguments.length > 1 ? arguments[1] : null; var it = this.entries(); for (var entry = it.next(); !entry.done; entry = it.next()) { if (context) { _call(callback, context, entry.value[1], entry.value[0], this); } else { callback(entry.value[1], entry.value[0], this); } } } }); addIterator(Map$prototype, Map$prototype.entries); return MapShim; }()), Set: (function () { var isSet = function isSet(set) { return set._es6set && typeof set._storage !== 'undefined'; }; var requireSetSlot = function requireSetSlot(set, method) { if (!ES.TypeIsObject(set) || !isSet(set)) { // https://github.com/paulmillr/es6-shim/issues/176 throw new TypeError('Set.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(set)); } }; // Creating a Map is expensive. To speed up the common case of // Sets containing only string or numeric keys, we use an object // as backing storage and lazily create a full Map only when // required. var Set$prototype; var SetShim = function Set() { if (!(this instanceof Set)) { throw new TypeError('Constructor Set requires "new"'); } if (this && this._es6set) { throw new TypeError('Bad construction'); } var set = emulateES6construct(this, Set, Set$prototype, { _es6set: true, '[[SetData]]': null, _storage: emptyObject() }); if (!set._es6set) { throw new TypeError('bad set'); } // Optionally initialize Set from iterable if (arguments.length > 0) { addIterableToSet(Set, set, arguments[0]); } return set; }; Set$prototype = SetShim.prototype; var decodeKey = function (key) { var k = key; if (k === '^null') { return null; } else if (k === '^undefined') { return void 0; } var first = k.charAt(0); if (first === '$') { return _strSlice(k, 1); } else if (first === 'n') { return +_strSlice(k, 1); } else if (first === 'b') { return k === 'btrue'; } return +k; }; // Switch from the object backing storage to a full Map. var ensureMap = function ensureMap(set) { if (!set['[[SetData]]']) { var m = new collectionShims.Map(); set['[[SetData]]'] = m; _forEach(keys(set._storage), function (key) { var k = decodeKey(key); m.set(k, k); }); set['[[SetData]]'] = m; } set._storage = null; // free old backing storage }; Value.getter(SetShim.prototype, 'size', function () { requireSetSlot(this, 'size'); if (this._storage) { return keys(this._storage).length; } ensureMap(this); return this['[[SetData]]'].size; }); defineProperties(SetShim.prototype, { has: function has(key) { requireSetSlot(this, 'has'); var fkey; if (this._storage && (fkey = fastkey(key)) !== null) { return !!this._storage[fkey]; } ensureMap(this); return this['[[SetData]]'].has(key); }, add: function add(key) { requireSetSlot(this, 'add'); var fkey; if (this._storage && (fkey = fastkey(key)) !== null) { this._storage[fkey] = true; return this; } ensureMap(this); this['[[SetData]]'].set(key, key); return this; }, 'delete': function (key) { requireSetSlot(this, 'delete'); var fkey; if (this._storage && (fkey = fastkey(key)) !== null) { var hasFKey = _hasOwnProperty(this._storage, fkey); return (delete this._storage[fkey]) && hasFKey; } ensureMap(this); return this['[[SetData]]']['delete'](key); }, clear: function clear() { requireSetSlot(this, 'clear'); if (this._storage) { this._storage = emptyObject(); } if (this['[[SetData]]']) { this['[[SetData]]'].clear(); } }, values: function values() { requireSetSlot(this, 'values'); ensureMap(this); return new SetIterator(this['[[SetData]]'].values()); }, entries: function entries() { requireSetSlot(this, 'entries'); ensureMap(this); return new SetIterator(this['[[SetData]]'].entries()); }, forEach: function forEach(callback) { requireSetSlot(this, 'forEach'); var context = arguments.length > 1 ? arguments[1] : null; var entireSet = this; ensureMap(entireSet); this['[[SetData]]'].forEach(function (value, key) { if (context) { _call(callback, context, key, key, entireSet); } else { callback(key, key, entireSet); } }); } }); defineProperty(SetShim.prototype, 'keys', SetShim.prototype.values, true); addIterator(SetShim.prototype, SetShim.prototype.values); var SetIterator = function SetIterator(it) { defineProperty(this, 'it', it); }; SetIterator.prototype = { isSetIterator: true, next: function next() { if (!this.isSetIterator) { throw new TypeError('Not a SetIterator'); } return this.it.next(); } }; addIterator(SetIterator.prototype); return SetShim; }()) }; var isGoogleTranslate = globals.Set && !Set.prototype['delete'] && Set.prototype.remove && Set.prototype.items && Set.prototype.map && Array.isArray(new Set().keys); if (isGoogleTranslate) { // special-case force removal of wildly invalid Set implementation in Google Translate iframes // see https://github.com/paulmillr/es6-shim/issues/438 / https://twitter.com/ljharb/status/849335573114363904 globals.Set = collectionShims.Set; } if (globals.Map || globals.Set) { // Safari 8, for example, doesn't accept an iterable. var mapAcceptsArguments = valueOrFalseIfThrows(function () { return new Map([[1, 2]]).get(1) === 2; }); if (!mapAcceptsArguments) { globals.Map = function Map() { if (!(this instanceof Map)) { throw new TypeError('Constructor Map requires "new"'); } var m = new OrigMap(); if (arguments.length > 0) { addIterableToMap(Map, m, arguments[0]); } delete m.constructor; Object.setPrototypeOf(m, globals.Map.prototype); return m; }; globals.Map.prototype = create(OrigMap.prototype); defineProperty(globals.Map.prototype, 'constructor', globals.Map, true); Value.preserveToString(globals.Map, OrigMap); } var testMap = new Map(); var mapUsesSameValueZero = (function () { // Chrome 38-42, node 0.11/0.12, iojs 1/2 also have a bug when the Map has a size > 4 var m = new Map([[1, 0], [2, 0], [3, 0], [4, 0]]); m.set(-0, m); return m.get(0) === m && m.get(-0) === m && m.has(0) && m.has(-0); }()); var mapSupportsChaining = testMap.set(1, 2) === testMap; if (!mapUsesSameValueZero || !mapSupportsChaining) { overrideNative(Map.prototype, 'set', function set(k, v) { _call(origMapSet, this, k === 0 ? 0 : k, v); return this; }); } if (!mapUsesSameValueZero) { defineProperties(Map.prototype, { get: function get(k) { return _call(origMapGet, this, k === 0 ? 0 : k); }, has: function has(k) { return _call(origMapHas, this, k === 0 ? 0 : k); } }, true); Value.preserveToString(Map.prototype.get, origMapGet); Value.preserveToString(Map.prototype.has, origMapHas); } var testSet = new Set(); var setUsesSameValueZero = Set.prototype['delete'] && Set.prototype.add && Set.prototype.has && (function (s) { s['delete'](0); s.add(-0); return !s.has(0); }(testSet)); var setSupportsChaining = testSet.add(1) === testSet; if (!setUsesSameValueZero || !setSupportsChaining) { var origSetAdd = Set.prototype.add; Set.prototype.add = function add(v) { _call(origSetAdd, this, v === 0 ? 0 : v); return this; }; Value.preserveToString(Set.prototype.add, origSetAdd); } if (!setUsesSameValueZero) { var origSetHas = Set.prototype.has; Set.prototype.has = function has(v) { return _call(origSetHas, this, v === 0 ? 0 : v); }; Value.preserveToString(Set.prototype.has, origSetHas); var origSetDel = Set.prototype['delete']; Set.prototype['delete'] = function SetDelete(v) { return _call(origSetDel, this, v === 0 ? 0 : v); }; Value.preserveToString(Set.prototype['delete'], origSetDel); } var mapSupportsSubclassing = supportsSubclassing(globals.Map, function (M) { var m = new M([]); // Firefox 32 is ok with the instantiating the subclass but will // throw when the map is used. m.set(42, 42); return m instanceof M; }); // without Object.setPrototypeOf, subclassing is not possible var mapFailsToSupportSubclassing = Object.setPrototypeOf && !mapSupportsSubclassing; var mapRequiresNew = (function () { try { return !(globals.Map() instanceof globals.Map); } catch (e) { return e instanceof TypeError; } }()); if (globals.Map.length !== 0 || mapFailsToSupportSubclassing || !mapRequiresNew) { globals.Map = function Map() { if (!(this instanceof Map)) { throw new TypeError('Constructor Map requires "new"'); } var m = new OrigMap(); if (arguments.length > 0) { addIterableToMap(Map, m, arguments[0]); } delete m.constructor; Object.setPrototypeOf(m, Map.prototype); return m; }; globals.Map.prototype = OrigMap.prototype; defineProperty(globals.Map.prototype, 'constructor', globals.Map, true); Value.preserveToString(globals.Map, OrigMap); } var setSupportsSubclassing = supportsSubclassing(globals.Set, function (S) { var s = new S([]); s.add(42, 42); return s instanceof S; }); // without Object.setPrototypeOf, subclassing is not possible var setFailsToSupportSubclassing = Object.setPrototypeOf && !setSupportsSubclassing; var setRequiresNew = (function () { try { return !(globals.Set() instanceof globals.Set); } catch (e) { return e instanceof TypeError; } }()); if (globals.Set.length !== 0 || setFailsToSupportSubclassing || !setRequiresNew) { var OrigSet = globals.Set; globals.Set = function Set() { if (!(this instanceof Set)) { throw new TypeError('Constructor Set requires "new"'); } var s = new OrigSet(); if (arguments.length > 0) { addIterableToSet(Set, s, arguments[0]); } delete s.constructor; Object.setPrototypeOf(s, Set.prototype); return s; }; globals.Set.prototype = OrigSet.prototype; defineProperty(globals.Set.prototype, 'constructor', globals.Set, true); Value.preserveToString(globals.Set, OrigSet); } var newMap = new globals.Map(); var mapIterationThrowsStopIterator = !valueOrFalseIfThrows(function () { return newMap.keys().next().done; }); /* - In Firefox < 23, Map#size is a function. - In all current Firefox, Set#entries/keys/values & Map#clear do not exist - https://bugzilla.mozilla.org/show_bug.cgi?id=869996 - In Firefox 24, Map and Set do not implement forEach - In Firefox 25 at least, Map and Set are callable without "new" */ if ( typeof globals.Map.prototype.clear !== 'function' || new globals.Set().size !== 0 || newMap.size !== 0 || typeof globals.Map.prototype.keys !== 'function' || typeof globals.Set.prototype.keys !== 'function' || typeof globals.Map.prototype.forEach !== 'function' || typeof globals.Set.prototype.forEach !== 'function' || isCallableWithoutNew(globals.Map) || isCallableWithoutNew(globals.Set) || typeof newMap.keys().next !== 'function' // Safari 8 || mapIterationThrowsStopIterator // Firefox 25 || !mapSupportsSubclassing ) { defineProperties(globals, { Map: collectionShims.Map, Set: collectionShims.Set }, true); } if (globals.Set.prototype.keys !== globals.Set.prototype.values) { // Fixed in WebKit with https://bugs.webkit.org/show_bug.cgi?id=144190 defineProperty(globals.Set.prototype, 'keys', globals.Set.prototype.values, true); } // Shim incomplete iterator implementations. addIterator(Object.getPrototypeOf((new globals.Map()).keys())); addIterator(Object.getPrototypeOf((new globals.Set()).keys())); if (functionsHaveNames && globals.Set.prototype.has.name !== 'has') { // Microsoft Edge v0.11.10074.0 is missing a name on Set#has var anonymousSetHas = globals.Set.prototype.has; overrideNative(globals.Set.prototype, 'has', function has(key) { return _call(anonymousSetHas, this, key); }); } } defineProperties(globals, collectionShims); addDefaultSpecies(globals.Map); addDefaultSpecies(globals.Set); } var throwUnlessTargetIsObject = function throwUnlessTargetIsObject(target) { if (!ES.TypeIsObject(target)) { throw new TypeError('target must be an object'); } }; // Some Reflect methods are basically the same as // those on the Object global, except that a TypeError is thrown if // target isn't an object. As well as returning a boolean indicating // the success of the operation. var ReflectShims = { // Apply method in a functional form. apply: function apply() { return ES.Call(ES.Call, null, arguments); }, // New operator in a functional form. construct: function construct(constructor, args) { if (!ES.IsConstructor(constructor)) { throw new TypeError('First argument must be a constructor.'); } var newTarget = arguments.length > 2 ? arguments[2] : constructor; if (!ES.IsConstructor(newTarget)) { throw new TypeError('new.target must be a constructor.'); } return ES.Construct(constructor, args, newTarget, 'internal'); }, // When deleting a non-existent or configurable property, // true is returned. // When attempting to delete a non-configurable property, // it will return false. deleteProperty: function deleteProperty(target, key) { throwUnlessTargetIsObject(target); if (supportsDescriptors) { var desc = Object.getOwnPropertyDescriptor(target, key); if (desc && !desc.configurable) { return false; } } // Will return true. return delete target[key]; }, has: function has(target, key) { throwUnlessTargetIsObject(target); return key in target; } }; if (Object.getOwnPropertyNames) { Object.assign(ReflectShims, { // Basically the result of calling the internal [[OwnPropertyKeys]]. // Concatenating propertyNames and propertySymbols should do the trick. // This should continue to work together with a Symbol shim // which overrides Object.getOwnPropertyNames and implements // Object.getOwnPropertySymbols. ownKeys: function ownKeys(target) { throwUnlessTargetIsObject(target); var keys = Object.getOwnPropertyNames(target); if (ES.IsCallable(Object.getOwnPropertySymbols)) { _pushApply(keys, Object.getOwnPropertySymbols(target)); } return keys; } }); } var callAndCatchException = function ConvertExceptionToBoolean(func) { return !throwsError(func); }; if (Object.preventExtensions) { Object.assign(ReflectShims, { isExtensible: function isExtensible(target) { throwUnlessTargetIsObject(target); return Object.isExtensible(target); }, preventExtensions: function preventExtensions(target) { throwUnlessTargetIsObject(target); return callAndCatchException(function () { return Object.preventExtensions(target); }); } }); } if (supportsDescriptors) { var internalGet = function get(target, key, receiver) { var desc = Object.getOwnPropertyDescriptor(target, key); if (!desc) { var parent = Object.getPrototypeOf(target); if (parent === null) { return void 0; } return internalGet(parent, key, receiver); } if ('value' in desc) { return desc.value; } if (desc.get) { return ES.Call(desc.get, receiver); } return void 0; }; var internalSet = function set(target, key, value, receiver) { var desc = Object.getOwnPropertyDescriptor(target, key); if (!desc) { var parent = Object.getPrototypeOf(target); if (parent !== null) { return internalSet(parent, key, value, receiver); } desc = { value: void 0, writable: true, enumerable: true, configurable: true }; } if ('value' in desc) { if (!desc.writable) { return false; } if (!ES.TypeIsObject(receiver)) { return false; } var existingDesc = Object.getOwnPropertyDescriptor(receiver, key); if (existingDesc) { return Reflect.defineProperty(receiver, key, { value: value }); } return Reflect.defineProperty(receiver, key, { value: value, writable: true, enumerable: true, configurable: true }); } if (desc.set) { _call(desc.set, receiver, value); return true; } return false; }; Object.assign(ReflectShims, { defineProperty: function defineProperty(target, propertyKey, attributes) { throwUnlessTargetIsObject(target); return callAndCatchException(function () { return Object.defineProperty(target, propertyKey, attributes); }); }, getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { throwUnlessTargetIsObject(target); return Object.getOwnPropertyDescriptor(target, propertyKey); }, // Syntax in a functional form. get: function get(target, key) { throwUnlessTargetIsObject(target); var receiver = arguments.length > 2 ? arguments[2] : target; return internalGet(target, key, receiver); }, set: function set(target, key, value) { throwUnlessTargetIsObject(target); var receiver = arguments.length > 3 ? arguments[3] : target; return internalSet(target, key, value, receiver); } }); } if (Object.getPrototypeOf) { var objectDotGetPrototypeOf = Object.getPrototypeOf; ReflectShims.getPrototypeOf = function getPrototypeOf(target) { throwUnlessTargetIsObject(target); return objectDotGetPrototypeOf(target); }; } if (Object.setPrototypeOf && ReflectShims.getPrototypeOf) { var willCreateCircularPrototype = function (object, lastProto) { var proto = lastProto; while (proto) { if (object === proto) { return true; } proto = ReflectShims.getPrototypeOf(proto); } return false; }; Object.assign(ReflectShims, { // Sets the prototype of the given object. // Returns true on success, otherwise false. setPrototypeOf: function setPrototypeOf(object, proto) { throwUnlessTargetIsObject(object); if (proto !== null && !ES.TypeIsObject(proto)) { throw new TypeError('proto must be an object or null'); } // If they already are the same, we're done. if (proto === Reflect.getPrototypeOf(object)) { return true; } // Cannot alter prototype if object not extensible. if (Reflect.isExtensible && !Reflect.isExtensible(object)) { return false; } // Ensure that we do not create a circular prototype chain. if (willCreateCircularPrototype(object, proto)) { return false; } Object.setPrototypeOf(object, proto); return true; } }); } var defineOrOverrideReflectProperty = function (key, shim) { if (!ES.IsCallable(globals.Reflect[key])) { defineProperty(globals.Reflect, key, shim); } else { var acceptsPrimitives = valueOrFalseIfThrows(function () { globals.Reflect[key](1); globals.Reflect[key](NaN); globals.Reflect[key](true); return true; }); if (acceptsPrimitives) { overrideNative(globals.Reflect, key, shim); } } }; Object.keys(ReflectShims).forEach(function (key) { defineOrOverrideReflectProperty(key, ReflectShims[key]); }); var originalReflectGetProto = globals.Reflect.getPrototypeOf; if (functionsHaveNames && originalReflectGetProto && originalReflectGetProto.name !== 'getPrototypeOf') { overrideNative(globals.Reflect, 'getPrototypeOf', function getPrototypeOf(target) { return _call(originalReflectGetProto, globals.Reflect, target); }); } if (globals.Reflect.setPrototypeOf) { if (valueOrFalseIfThrows(function () { globals.Reflect.setPrototypeOf(1, {}); return true; })) { overrideNative(globals.Reflect, 'setPrototypeOf', ReflectShims.setPrototypeOf); } } if (globals.Reflect.defineProperty) { if (!valueOrFalseIfThrows(function () { var basic = !globals.Reflect.defineProperty(1, 'test', { value: 1 }); // "extensible" fails on Edge 0.12 var extensible = typeof Object.preventExtensions !== 'function' || !globals.Reflect.defineProperty(Object.preventExtensions({}), 'test', {}); return basic && extensible; })) { overrideNative(globals.Reflect, 'defineProperty', ReflectShims.defineProperty); } } if (globals.Reflect.construct) { if (!valueOrFalseIfThrows(function () { var F = function F() {}; return globals.Reflect.construct(function () {}, [], F) instanceof F; })) { overrideNative(globals.Reflect, 'construct', ReflectShims.construct); } } if (String(new Date(NaN)) !== 'Invalid Date') { var dateToString = Date.prototype.toString; var shimmedDateToString = function toString() { var valueOf = +this; if (valueOf !== valueOf) { return 'Invalid Date'; } return ES.Call(dateToString, this); }; overrideNative(Date.prototype, 'toString', shimmedDateToString); } // Annex B HTML methods // http://www.ecma-international.org/ecma-262/6.0/#sec-additional-properties-of-the-string.prototype-object var stringHTMLshims = { anchor: function anchor(name) { return ES.CreateHTML(this, 'a', 'name', name); }, big: function big() { return ES.CreateHTML(this, 'big', '', ''); }, blink: function blink() { return ES.CreateHTML(this, 'blink', '', ''); }, bold: function bold() { return ES.CreateHTML(this, 'b', '', ''); }, fixed: function fixed() { return ES.CreateHTML(this, 'tt', '', ''); }, fontcolor: function fontcolor(color) { return ES.CreateHTML(this, 'font', 'color', color); }, fontsize: function fontsize(size) { return ES.CreateHTML(this, 'font', 'size', size); }, italics: function italics() { return ES.CreateHTML(this, 'i', '', ''); }, link: function link(url) { return ES.CreateHTML(this, 'a', 'href', url); }, small: function small() { return ES.CreateHTML(this, 'small', '', ''); }, strike: function strike() { return ES.CreateHTML(this, 'strike', '', ''); }, sub: function sub() { return ES.CreateHTML(this, 'sub', '', ''); }, sup: function sub() { return ES.CreateHTML(this, 'sup', '', ''); } }; _forEach(Object.keys(stringHTMLshims), function (key) { var method = String.prototype[key]; var shouldOverwrite = false; if (ES.IsCallable(method)) { var output = _call(method, '', ' " '); var quotesCount = _concat([], output.match(/"/g)).length; shouldOverwrite = output !== output.toLowerCase() || quotesCount > 2; } else { shouldOverwrite = true; } if (shouldOverwrite) { overrideNative(String.prototype, key, stringHTMLshims[key]); } }); var JSONstringifiesSymbols = (function () { // Microsoft Edge v0.12 stringifies Symbols incorrectly if (!hasSymbols) { return false; } // Symbols are not supported var stringify = typeof JSON === 'object' && typeof JSON.stringify === 'function' ? JSON.stringify : null; if (!stringify) { return false; } // JSON.stringify is not supported if (typeof stringify(Symbol()) !== 'undefined') { return true; } // Symbols should become `undefined` if (stringify([Symbol()]) !== '[null]') { return true; } // Symbols in arrays should become `null` var obj = { a: Symbol() }; obj[Symbol()] = true; if (stringify(obj) !== '{}') { return true; } // Symbol-valued keys *and* Symbol-valued properties should be omitted return false; }()); var JSONstringifyAcceptsObjectSymbol = valueOrFalseIfThrows(function () { // Chrome 45 throws on stringifying object symbols if (!hasSymbols) { return true; } // Symbols are not supported return JSON.stringify(Object(Symbol())) === '{}' && JSON.stringify([Object(Symbol())]) === '[{}]'; }); if (JSONstringifiesSymbols || !JSONstringifyAcceptsObjectSymbol) { var origStringify = JSON.stringify; overrideNative(JSON, 'stringify', function stringify(value) { if (typeof value === 'symbol') { return; } var replacer; if (arguments.length > 1) { replacer = arguments[1]; } var args = [value]; if (!isArray(replacer)) { var replaceFn = ES.IsCallable(replacer) ? replacer : null; var wrappedReplacer = function (key, val) { var parsedValue = replaceFn ? _call(replaceFn, this, key, val) : val; if (typeof parsedValue !== 'symbol') { if (Type.symbol(parsedValue)) { return assignTo({})(parsedValue); } return parsedValue; } }; args.push(wrappedReplacer); } else { // create wrapped replacer that handles an array replacer? args.push(replacer); } if (arguments.length > 2) { args.push(arguments[2]); } return origStringify.apply(this, args); }); } return globals; })); } (es6Shim)); rollup-3.29.4/test/form/samples/supports-es6-shim/main.js000066400000000000000000000000231450520414700233230ustar00rootroot00000000000000import 'es6-shim'; rollup-3.29.4/test/form/samples/switch-scopes/000077500000000000000000000000001450520414700213115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/switch-scopes/_config.js000066400000000000000000000001761450520414700232570ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly handles switch scopes', options: { output: { name: 'myBundle' } } }); rollup-3.29.4/test/form/samples/switch-scopes/_expected.js000066400000000000000000000001671450520414700236130ustar00rootroot00000000000000const x = globalThis.unknown; switch ( globalThis.unknown ) { case 2: x(); } switch ( globalThis.unknown() ) { } rollup-3.29.4/test/form/samples/switch-scopes/main.js000066400000000000000000000004601450520414700225730ustar00rootroot00000000000000const x = globalThis.unknown; function y () {} switch ( globalThis.unknown ) { case 1: const x = function () {}; x(); } switch ( globalThis.unknown ) { case 2: x(); } switch ( globalThis.unknown ) { case 3: const y = globalThis.unknown; } y(); switch ( globalThis.unknown() ) { case 4: } rollup-3.29.4/test/form/samples/synthetic-named-exports/000077500000000000000000000000001450520414700233145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/synthetic-named-exports/_config.js000066400000000000000000000007071450520414700252620ustar00rootroot00000000000000module.exports = defineTest({ description: 'synthetic named exports', options: { plugins: [ { name: 'test', resolveId(id) { if (id.endsWith('dep1.js')) { return id; } return null; }, load(id) { if (id.endsWith('dep1.js')) { return { code: ` const d = { fn: 42, hello: 'hola' }; export default d;`, syntheticNamedExports: true }; } return null; } } ] } }); rollup-3.29.4/test/form/samples/synthetic-named-exports/_expected.js000066400000000000000000000001561450520414700256140ustar00rootroot00000000000000const d = { fn: 42, hello: 'hola' }; console.log(d.fn); console.log(d.foo); console.log(d["some-prop"]); rollup-3.29.4/test/form/samples/synthetic-named-exports/main.js000066400000000000000000000002101450520414700245670ustar00rootroot00000000000000import { fn, foo } from './dep1.js'; import * as ns from './dep1.js'; console.log(fn); console.log(foo); console.log(ns['some-prop']); rollup-3.29.4/test/form/samples/system-comments/000077500000000000000000000000001450520414700216655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-comments/_config.js000066400000000000000000000002471450520414700236320ustar00rootroot00000000000000module.exports = defineTest({ description: 'Correctly places leading comments when rendering system bindings', options: { output: { format: 'system' } } }); rollup-3.29.4/test/form/samples/system-comments/_expected.js000066400000000000000000000007061450520414700241660ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const pureFunc = () => console.log('not really pure') || 0; var singleLine = exports('singleLine', /*#__PURE__*/pureFunc()); exports('singleLine', singleLine = /*#__PURE__*/pureFunc()); var multiLine = exports('multiLine', /*#__PURE__*/ pureFunc()); exports('multiLine', multiLine = /*#__PURE__*/ pureFunc()); }) }; })); rollup-3.29.4/test/form/samples/system-comments/main.js000066400000000000000000000003621450520414700231500ustar00rootroot00000000000000const pureFunc = () => console.log('not really pure') || 0; export var singleLine = /*#__PURE__*/pureFunc(); singleLine = /*#__PURE__*/pureFunc(); export var multiLine = /*#__PURE__*/ pureFunc(); multiLine = /*#__PURE__*/ pureFunc(); rollup-3.29.4/test/form/samples/system-default-comments/000077500000000000000000000000001450520414700233075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-default-comments/_config.js000066400000000000000000000002561450520414700252540ustar00rootroot00000000000000module.exports = defineTest({ description: 'Correctly places leading comments when rendering system default exports', options: { output: { format: 'system' } } }); rollup-3.29.4/test/form/samples/system-default-comments/_expected.js000066400000000000000000000003501450520414700256030ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const pureFunc = () => console.log('not really pure') || 0; var main = exports('default', /*#__PURE__*/pureFunc()); }) }; })); rollup-3.29.4/test/form/samples/system-default-comments/main.js000066400000000000000000000001451450520414700245710ustar00rootroot00000000000000const pureFunc = () => console.log('not really pure') || 0; export default /*#__PURE__*/pureFunc(); rollup-3.29.4/test/form/samples/system-export-declarations/000077500000000000000000000000001450520414700240275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-export-declarations/_config.js000066400000000000000000000002351450520414700257710ustar00rootroot00000000000000module.exports = defineTest({ description: 'Renders declarations where some variables are exported', options: { output: { format: 'system' } } }); rollup-3.29.4/test/form/samples/system-export-declarations/_expected.js000066400000000000000000000012061450520414700263240ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { // middle binding const a1 = 1, a2 = exports('a2', 2), a3 = 3; console.log(a1, a2, a3); // first binding const b1 = exports('b1', 1), b2 = 2; console.log(b1, b2); // last binding const c1 = 1, c2 = exports('c2', 2); console.log(c1, c2); // middle binding with other bindings removed const d2 = exports('d2', 2); // uninitialized binding let e1 = 1, e2, e3 = 3; exports('e2', e2); console.log(e1, e2, e3); // destructuring declaration let {f1, f2} = globalThis.obj; exports('f2', f2); }) }; })); rollup-3.29.4/test/form/samples/system-export-declarations/main.js000066400000000000000000000010101450520414700253010ustar00rootroot00000000000000// middle binding const a1 = 1, a2 = 2, a3 = 3; console.log(a1, a2, a3); export { a2 }; // first binding const b1 = 1, b2 = 2; console.log(b1, b2); export { b1 }; // last binding const c1 = 1, c2 = 2; console.log(c1, c2); export { c2 }; // middle binding with other bindings removed const d1 = 1, d2 = 2, d3 = 3; export { d2 }; // uninitialized binding let e1 = 1, e2, e3 = 3; console.log(e1, e2, e3); export { e2 }; // destructuring declaration let {f1, f2} = globalThis.obj, {f3} = globalThis.obj; export { f2 }; rollup-3.29.4/test/form/samples/system-export-destructuring-declaration/000077500000000000000000000000001450520414700265445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-export-destructuring-declaration/_config.js000066400000000000000000000002271450520414700305070ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports destructuring declarations for systemJS', options: { output: { format: 'system' } } }); rollup-3.29.4/test/form/samples/system-export-destructuring-declaration/_expected.js000066400000000000000000000007721450520414700310500ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const {a = 1, ...b} = global1, c = global2, {d} = global3; exports({ a: a, b: b, c: c, d: d }); const [e, ...f] = global4; exports({ e: e, f: f }); const {g, x: h = 2, y: {z: i}, a: [j ,k,, l]} = global5; exports({ g: g, h: h, i: i, j: j, k: k, l: l }); var m = exports('m', 1); var {m} = global6; exports('m', m); (function (v) { return exports('m', m), v; })({m} = global7); }) }; })); rollup-3.29.4/test/form/samples/system-export-destructuring-declaration/main.js000066400000000000000000000003401450520414700300230ustar00rootroot00000000000000export const {a = 1, ...b} = global1, c = global2, {d} = global3; export const [e, ...f] = global4; export const {g, x: h = 2, y: {z: i}, a: [j ,k,, l]} = global5; export var m = 1; var {m} = global6; null, {m} = global7; rollup-3.29.4/test/form/samples/system-export-rendering-compact/000077500000000000000000000000001450520414700247605ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-export-rendering-compact/_config.js000066400000000000000000000003021450520414700267150ustar00rootroot00000000000000module.exports = defineTest({ description: 'Renders updates of exported variables for SystemJS output in compact mode', options: { output: { format: 'system', compact: true } } }); rollup-3.29.4/test/form/samples/system-export-rendering-compact/_expected.js000066400000000000000000000026241450520414700272620ustar00rootroot00000000000000System.register([],(function(exports){'use strict';return{execute:(function(){// --- // Single export name let foo = exports('foo',1); // Assignment // foo = 2 exports('foo',foo = 2); console.log(exports('foo',foo = 2)); // foo += 2 exports('foo',foo += 2); console.log(exports('foo',foo += 2)); // { foo } = obj (function(v){return exports('foo',foo),v}({ foo } = obj)); console.log(function(v){return exports('foo',foo),v}({ foo } = obj)); // Update // foo++ exports('foo',foo+1),foo++; console.log((exports('foo',foo+1),foo++)); exports('foo',foo-1),foo--; // ++foo exports('foo',++foo); console.log(exports('foo',++foo)); exports('foo',--foo); // --- // Multiple export names let bar = 1; exports({bar:bar,bar2:bar}); // Assignment // bar = 2 bar = 2,exports({bar:bar,bar2:bar}),bar; console.log((bar = 2,exports({bar:bar,bar2:bar}),bar)); // bar += 2 bar += 2,exports({bar:bar,bar2:bar}),bar; console.log((bar += 2,exports({bar:bar,bar2:bar}),bar)); // { bar } = obj (function(v){return exports({bar:bar,bar2:bar}),v}({ bar } = obj)); console.log(function(v){return exports({bar:bar,bar2:bar}),v}({ bar } = obj)); // Update // bar++ exports({bar:bar+1,bar2:bar+1}),bar++; console.log((exports({bar:bar+1,bar2:bar+1}),bar++)); exports({bar:bar-1,bar2:bar-1}),bar--; // ++bar ++bar,exports({bar:bar,bar2:bar}),bar; console.log((++bar,exports({bar:bar,bar2:bar}),bar)); --bar,exports({bar:bar,bar2:bar}),bar;})}}));rollup-3.29.4/test/form/samples/system-export-rendering-compact/main.js000066400000000000000000000012161450520414700262420ustar00rootroot00000000000000// --- // Single export name export let foo = 1; // Assignment // foo = 2 foo = 2; console.log(foo = 2); // foo += 2 foo += 2; console.log(foo += 2); // { foo } = obj ({ foo } = obj); console.log({ foo } = obj); // Update // foo++ foo++; console.log(foo++); foo--; // ++foo ++foo; console.log(++foo); --foo; // --- // Multiple export names export let bar = 1; export { bar as bar2 }; // Assignment // bar = 2 bar = 2; console.log(bar = 2); // bar += 2 bar += 2; console.log(bar += 2); // { bar } = obj ({ bar } = obj); console.log({ bar } = obj); // Update // bar++ bar++; console.log(bar++); bar--; // ++bar ++bar; console.log(++bar); --bar; rollup-3.29.4/test/form/samples/system-export-rendering/000077500000000000000000000000001450520414700233345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-export-rendering/_config.js000066400000000000000000000002401450520414700252720ustar00rootroot00000000000000module.exports = defineTest({ description: 'Renders updates of exported variables for SystemJS output', options: { output: { format: 'system' } } }); rollup-3.29.4/test/form/samples/system-export-rendering/_expected.js000066400000000000000000000032751450520414700256410ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { // --- // Single export name let foo = exports('foo', 1); // Assignment // foo = 2 exports('foo', foo = 2); console.log(exports('foo', foo = 2)); // foo += 2 exports('foo', foo += 2); console.log(exports('foo', foo += 2)); // { foo } = obj (function (v) { return exports('foo', foo), v; }({ foo } = obj)); console.log(function (v) { return exports('foo', foo), v; }({ foo } = obj)); // Update // foo++ exports('foo', foo + 1), foo++; console.log((exports('foo', foo + 1), foo++)); exports('foo', foo - 1), foo--; // ++foo exports('foo', ++foo); console.log(exports('foo', ++foo)); exports('foo', --foo); // --- // Multiple export names let bar = 1; exports({ bar: bar, bar2: bar }); // Assignment // bar = 2 bar = 2, exports({ bar: bar, bar2: bar }), bar; console.log((bar = 2, exports({ bar: bar, bar2: bar }), bar)); // bar += 2 bar += 2, exports({ bar: bar, bar2: bar }), bar; console.log((bar += 2, exports({ bar: bar, bar2: bar }), bar)); // { bar } = obj (function (v) { return exports({ bar: bar, bar2: bar }), v; }({ bar } = obj)); console.log(function (v) { return exports({ bar: bar, bar2: bar }), v; }({ bar } = obj)); // Update // bar++ exports({ bar: bar + 1, bar2: bar + 1 }), bar++; console.log((exports({ bar: bar + 1, bar2: bar + 1 }), bar++)); exports({ bar: bar - 1, bar2: bar - 1 }), bar--; // ++bar ++bar, exports({ bar: bar, bar2: bar }), bar; console.log((++bar, exports({ bar: bar, bar2: bar }), bar)); --bar, exports({ bar: bar, bar2: bar }), bar; }) }; })); rollup-3.29.4/test/form/samples/system-export-rendering/main.js000066400000000000000000000012161450520414700246160ustar00rootroot00000000000000// --- // Single export name export let foo = 1; // Assignment // foo = 2 foo = 2; console.log(foo = 2); // foo += 2 foo += 2; console.log(foo += 2); // { foo } = obj ({ foo } = obj); console.log({ foo } = obj); // Update // foo++ foo++; console.log(foo++); foo--; // ++foo ++foo; console.log(++foo); --foo; // --- // Multiple export names export let bar = 1; export { bar as bar2 }; // Assignment // bar = 2 bar = 2; console.log(bar = 2); // bar += 2 bar += 2; console.log(bar += 2); // { bar } = obj ({ bar } = obj); console.log({ bar } = obj); // Update // bar++ bar++; console.log(bar++); bar--; // ++bar ++bar; console.log(++bar); --bar; rollup-3.29.4/test/form/samples/system-module-reserved/000077500000000000000000000000001450520414700231425ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-module-reserved/_config.js000066400000000000000000000003231450520414700251020ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not output reserved system format identifiers', options: { external: ['test'], output: { name: 'systemReserved', globals: { test: 'test' } } } }); rollup-3.29.4/test/form/samples/system-module-reserved/_expected/000077500000000000000000000000001450520414700251025ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-module-reserved/_expected/amd.js000066400000000000000000000001401450520414700261740ustar00rootroot00000000000000define(['test'], (function (test) { 'use strict'; console.log(test.module, test.other); })); rollup-3.29.4/test/form/samples/system-module-reserved/_expected/cjs.js000066400000000000000000000001221450520414700262120ustar00rootroot00000000000000'use strict'; var test = require('test'); console.log(test.module, test.other); rollup-3.29.4/test/form/samples/system-module-reserved/_expected/es.js000066400000000000000000000001031450520414700260410ustar00rootroot00000000000000import { module, other } from 'test'; console.log(module, other); rollup-3.29.4/test/form/samples/system-module-reserved/_expected/iife.js000066400000000000000000000001251450520414700263520ustar00rootroot00000000000000(function (test) { 'use strict'; console.log(test.module, test.other); })(test); rollup-3.29.4/test/form/samples/system-module-reserved/_expected/system.js000066400000000000000000000004211450520414700267610ustar00rootroot00000000000000System.register('systemReserved', ['test'], (function () { 'use strict'; var module$1, other; return { setters: [function (module) { module$1 = module.module; other = module.other; }], execute: (function () { console.log(module$1, other); }) }; })); rollup-3.29.4/test/form/samples/system-module-reserved/_expected/umd.js000066400000000000000000000005761450520414700262350ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('test')) : typeof define === 'function' && define.amd ? define(['test'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.test)); })(this, (function (test) { 'use strict'; console.log(test.module, test.other); })); rollup-3.29.4/test/form/samples/system-module-reserved/main.js000066400000000000000000000001031450520414700244160ustar00rootroot00000000000000import { module, other } from 'test'; console.log(module, other); rollup-3.29.4/test/form/samples/system-multiple-export-bindings/000077500000000000000000000000001450520414700250055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-multiple-export-bindings/_config.js000066400000000000000000000002731450520414700267510ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports multiple live bindings for the same symbol in systemJS', options: { output: { format: 'system', exports: 'named' } } }); rollup-3.29.4/test/form/samples/system-multiple-export-bindings/_expected.js000066400000000000000000000026001450520414700273010ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports({ fn: fn, fn2: fn }); const x = exports('x', 123); const y = exports('y', 456); var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, x: x, y: y }); exports({ namespace: namespace, namespace2: namespace }); // Namespace variable // Variable Declaration let a = 1, b = 2, c = 3; exports({ a: a, a2: a, b: b, c: c, c2: c }); // Export default expression var a$1 = exports('default', a); // Assignment Expression a = exports('b', b = (c = 0, exports({ c: c, c2: c }), c)), exports({ a: a, a2: a }), a; // Destructing Assignment Expression (function (v) { return exports({ a: a, a2: a, b: b, c: c, c2: c }), v; }({ a, b, c } = { c: 4, b: 5, a: 6 })); // Destructuring Defaults var p = 5; exports({ p: p, pp: p }); var q = 10; exports({ q: q, qq: q }); (function (v) { return exports({ p: p, pp: p }), v; }({ p = (q = 20, exports({ q: q, qq: q }), q) } = {})); // Function Assignment function fn () { } fn = 5, exports({ fn: fn, fn2: fn }), fn; // Update Expression (exports({ a: a + 1, a2: a + 1 }), a++), (exports('b', b + 1), b++), (++c, exports({ c: c, c2: c }), c); (exports({ a: a + 1, a2: a + 1 }), a++); // Class Declaration class A {} exports({ A: A, B: A }); }) }; })); rollup-3.29.4/test/form/samples/system-multiple-export-bindings/main.js000066400000000000000000000012651450520414700262730ustar00rootroot00000000000000// Namespace variable import * as namespace from './namespace'; export { namespace, namespace as namespace2 } export * from './namespace'; // Variable Declaration export let a = 1, b = 2, c = 3; export { a as a2, c as c2 } // Export default expression export default a; // Assignment Expression a = b = c = 0; // Destructing Assignment Expression ({ a, b, c } = { c: 4, b: 5, a: 6 }); // Destructuring Defaults export var p = 5; export var q = 10; export { p as pp, q as qq } ({ p = q = 20 } = {}); // Function Assignment export function fn () { } fn = 5; export { fn as fn2 } // Update Expression a++, b++, ++c; true && a++; // Class Declaration export class A {} export { A as B } rollup-3.29.4/test/form/samples/system-multiple-export-bindings/namespace.js000066400000000000000000000000531450520414700272750ustar00rootroot00000000000000export const x = 123; export const y = 456;rollup-3.29.4/test/form/samples/system-null-setters/000077500000000000000000000000001450520414700225015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-null-setters/_config.js000066400000000000000000000003271450520414700244450ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows to avoid null setters for side effect only imports', options: { external: ['external'], output: { format: 'system', systemNullSetters: false } } }); rollup-3.29.4/test/form/samples/system-null-setters/_expected.js000066400000000000000000000002161450520414700247760ustar00rootroot00000000000000System.register(['external'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/system-null-setters/main.js000066400000000000000000000000241450520414700237570ustar00rootroot00000000000000import 'external'; rollup-3.29.4/test/form/samples/system-reexports/000077500000000000000000000000001450520414700220735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-reexports/_config.js000066400000000000000000000002261450520414700240350ustar00rootroot00000000000000module.exports = defineTest({ description: 'merges reexports in systemjs', options: { external: () => true, output: { format: 'system' } } }); rollup-3.29.4/test/form/samples/system-reexports/_expected.js000066400000000000000000000017571450520414700244030ustar00rootroot00000000000000System.register(['external1', 'external2', 'external3', 'external4', 'external5'], (function (exports) { 'use strict'; var _starExcludes = { default: 1, namedReexport1: 1, namedReexport2a: 1, namedReexport2b: 1, namespaceReexport3: 1, namedReexport5: 1, namespaceReexport5: 1 }; return { setters: [function (module) { exports('namedReexport1', module.namedReexport1); }, function (module) { exports({ namedReexport2a: module.namedReexport2a, namedReexport2b: module.default }); }, function (module) { exports('namespaceReexport3', module); }, function (module) { var setter = {}; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }, function (module) { var setter = { namedReexport5: module.namedReexport5, namespaceReexport5: module }; for (var name in module) { if (!_starExcludes[name]) setter[name] = module[name]; } exports(setter); }], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/system-reexports/main.js000066400000000000000000000005311450520414700233540ustar00rootroot00000000000000export { namedReexport1 } from 'external1'; export { namedReexport2a } from 'external2'; export { default as namedReexport2b } from 'external2'; export * as namespaceReexport3 from 'external3'; export * from 'external4'; export { namedReexport5 } from 'external5'; export * as namespaceReexport5 from 'external5'; export * from 'external5'; rollup-3.29.4/test/form/samples/system-reexports/system.js000066400000000000000000000010161450520414700237530ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var effect1 = () => console.log( 'effect' ); // must not be removed! function isKept1 ( x = effect1 ) { x(); } isKept1(); var effect2 = () => console.log( 'effect' ); // must not be removed! var isKept2 = function ( x = effect2 ) { x(); }; isKept2(); var effect3 = () => console.log( 'effect' ); // must not be removed! var isKept3 = ( x = effect3 ) => { x(); }; isKept3(); }) }; })); rollup-3.29.4/test/form/samples/system-semicolon/000077500000000000000000000000001450520414700220305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-semicolon/_config.js000066400000000000000000000002141450520414700237670ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports asi in system binding output', options: { output: { format: 'system' } } }); rollup-3.29.4/test/form/samples/system-semicolon/_expected.js000066400000000000000000000004441450520414700243300ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); }) }; })); rollup-3.29.4/test/form/samples/system-semicolon/main.js000066400000000000000000000002151450520414700233100ustar00rootroot00000000000000export default typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {} rollup-3.29.4/test/form/samples/system-uninitialized/000077500000000000000000000000001450520414700227105ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/system-uninitialized/_config.js000066400000000000000000000004211450520414700246470ustar00rootroot00000000000000// Changed due to https://github.com/acornjs/acorn/issues/806 // Consider reverting this change should this become an acorn option module.exports = defineTest({ description: 'supports uninitialized binding exports', options: { output: { format: 'system' } } }); rollup-3.29.4/test/form/samples/system-uninitialized/_expected.js000066400000000000000000000003461450520414700252110ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('q', q); var p; exports('p', p); function q () { exports('p', p = 10); } }) }; })); rollup-3.29.4/test/form/samples/system-uninitialized/main.js000066400000000000000000000000611450520414700241670ustar00rootroot00000000000000export var p; export function q () { p = 10; } rollup-3.29.4/test/form/samples/tdz-access-in-declaration/000077500000000000000000000000001450520414700234455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tdz-access-in-declaration/_config.js000066400000000000000000000001501450520414700254030ustar00rootroot00000000000000module.exports = defineTest({ description: 'detect accessing TDZ variables within the declaration' }); rollup-3.29.4/test/form/samples/tdz-access-in-declaration/_expected.js000066400000000000000000000002471450520414700257460ustar00rootroot00000000000000const a = a; // keep const b = getB(); // keep function getB() { return b; } function getC() { return c; } const c = getC(); // keep class d extends d {} // keep rollup-3.29.4/test/form/samples/tdz-access-in-declaration/main.js000066400000000000000000000002471450520414700247320ustar00rootroot00000000000000const a = a; // keep const b = getB(); // keep function getB() { return b; } function getC() { return c; } const c = getC(); // keep class d extends d {} // keep rollup-3.29.4/test/form/samples/tdz-common/000077500000000000000000000000001450520414700206055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tdz-common/_config.js000066400000000000000000000001211450520414700225410ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserve common TDZ violations' }); rollup-3.29.4/test/form/samples/tdz-common/_expected.js000066400000000000000000000020311450520414700230770ustar00rootroot00000000000000console.log(function() { if (x) return "HELLO"; // TDZ const x = 1; // keep return "WORLD"; // not reached }()); const C = 1 + C + 2; // TDZ let L = L; // TDZ console.log("X+" ); // optimize console.log(Y ? "Y+" : "Y-"); // TDZ const Y = 2; // keep console.log(Z ? "Z+" : "Z-"); // TDZ const Z = 3; // keep console.log("Z+" ); // keep console.log(obj.x.y ? 1 : 2); // TDZ const obj = { // keep x: { y: true } }; console.log(3 ); // keep L2; // TDZ for L2 L3 = 20; // TDZ for L3 let L2, L3; // keep L2, L3 L3 = 30; // keep cls; // TDZ class cls {} // Note that typical var/const/let use is still optimized (function() { console.log(A ? "A" : "!A"); var A = 1; console.log("A" ); console.log("B"); console.log("B" ); console.log("C" ); console.log("D" ); })(); (function let_tdz() { let flag = false; function foo() { if (flag) { value; // TDZ } let value; } foo(); flag = true; foo(); })(); rollup-3.29.4/test/form/samples/tdz-common/main.js000066400000000000000000000031071450520414700220700ustar00rootroot00000000000000console.log(function() { if (x) return "HELLO"; // TDZ const x = 1; // keep return "WORLD"; // not reached }()); const unused1 = 1; // drop let unused2 = 2; // drop unused3; // drop var unused3 = 3; // drop class unused4 {} // drop const C = 1 + C + 2; // TDZ let L = L; // TDZ const X = 1; // drop console.log(X ? "X+" : "X-"); // optimize console.log(Y ? "Y+" : "Y-"); // TDZ const Y = 2; // keep console.log(Z ? "Z+" : "Z-"); // TDZ const Z = 3; // keep console.log(Z ? "Z+" : "Z-"); // keep console.log(obj.x.y ? 1 : 2); // TDZ const obj = { // keep x: { y: true } }; console.log(obj.x.y ? 3 : 4); // keep V2, L2; // TDZ for L2 var V2; // drop V3 = 10, L3 = 20; // TDZ for L3 let L1, L2, L3, L4; // keep L2, L3 var V3; // drop L3 = 30; // keep L4 = 40; // drop cls; // TDZ class cls {} // Note that typical var/const/let use is still optimized (function() { console.log(A ? "A" : "!A"); var A = 1, B = 2; const C = 3; let D = 4; console.log(A ? "A" : "!A"); if (B) console.log("B"); else console.log("!B"); console.log(B ? "B" : "!B"); console.log(C ? "C" : "!C"); console.log(D ? "D" : "!D"); })(); (function let_tdz() { let flag = false; function foo() { if (flag) { value; // TDZ } let value; } foo(); flag = true; foo(); })(); // should be dropped (function() { function foo() { const access = () => value; let value; access(); }; foo(); })(); rollup-3.29.4/test/form/samples/tdz-pattern-access/000077500000000000000000000000001450520414700222315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tdz-pattern-access/_config.js000066400000000000000000000001741450520414700241750ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles accessing variables declared in patterns before their declaration' }); rollup-3.29.4/test/form/samples/tdz-pattern-access/_expected.js000066400000000000000000000002051450520414700245240ustar00rootroot00000000000000x + y; const { x } = {}; const [y] = []; if (z) console.log('unimportant'); else console.log('retained'); var { z } = { z: true }; rollup-3.29.4/test/form/samples/tdz-pattern-access/main.js000066400000000000000000000002271450520414700235140ustar00rootroot00000000000000const tdzAccess = x + y; const { x } = {}; const [y] = []; if (z) console.log('unimportant'); else console.log('retained'); var { z } = { z: true }; rollup-3.29.4/test/form/samples/template-literal/000077500000000000000000000000001450520414700217635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/template-literal/computed-properties/000077500000000000000000000000001450520414700257755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/template-literal/computed-properties/_config.js000066400000000000000000000001461450520414700277400ustar00rootroot00000000000000module.exports = defineTest({ description: 'Resolve template literals in computed property keys' }); rollup-3.29.4/test/form/samples/template-literal/computed-properties/_expected.js000066400000000000000000000001531450520414700302720ustar00rootroot00000000000000{ console.log('kept'); } { console.log('kept'); } { console.log('kept'); } { console.log('kept'); } rollup-3.29.4/test/form/samples/template-literal/computed-properties/main.js000066400000000000000000000005761450520414700272670ustar00rootroot00000000000000const x = { [`x.y`]: true, [`x\ny`]: true, ['a.b']: true, ['a\nb']: true }; if (x['x.y']) { console.log('kept'); } else { console.log('removed'); } if (x['x\ny']) { console.log('kept'); } else { console.log('removed'); } if (x[`a.b`]) { console.log('kept'); } else { console.log('removed'); } if (x[`a\nb`]) { console.log('kept'); } else { console.log('removed'); } rollup-3.29.4/test/form/samples/template-literal/simplify-conditionals/000077500000000000000000000000001450520414700263035ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/template-literal/simplify-conditionals/_config.js000066400000000000000000000001601450520414700302420ustar00rootroot00000000000000module.exports = defineTest({ description: 'Template literals can be simplified when used in conditionals' }); rollup-3.29.4/test/form/samples/template-literal/simplify-conditionals/_expected.js000066400000000000000000000002411450520414700305760ustar00rootroot00000000000000{ console.log('kept'); } { console.log('kept'); } if (`${Math.random() > 0.5 ? 'truthy' : ''}`) { console.log('kept 1'); } else { console.log('kept 2'); } rollup-3.29.4/test/form/samples/template-literal/simplify-conditionals/main.js000066400000000000000000000003731450520414700275700ustar00rootroot00000000000000if (`truthy`) { console.log('kept'); } else { console.log('removed'); } if (``) { console.log('removed'); } else { console.log('kept'); } if (`${Math.random() > 0.5 ? 'truthy' : ''}`) { console.log('kept 1'); } else { console.log('kept 2'); } rollup-3.29.4/test/form/samples/this-in-class-body/000077500000000000000000000000001450520414700221275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/this-in-class-body/_config.js000066400000000000000000000001441450520414700240700ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses the correct "this" value in class properties' }); rollup-3.29.4/test/form/samples/this-in-class-body/_expected.js000066400000000000000000000012331450520414700244240ustar00rootroot00000000000000class Used { static flag = false; static mutate = () => { this.flag = true; }; } Used.mutate(); if (Used.flag) console.log('retained'); else console.log('unimportant'); class InstanceMutation { static flag = false; flag = false; mutate = () => { this.flag = true; }; } new InstanceMutation().mutate(); console.log('retained'); class UsedSuper { static flag = false; } class UsedWithSuper extends UsedSuper { static mutate = () => { super.flag = true; }; } UsedWithSuper.mutate(); if (UsedWithSuper.flag) console.log('retained'); else console.log('unimportant'); // Assignments via "super" do NOT mutate the super class! console.log('retained'); rollup-3.29.4/test/form/samples/this-in-class-body/main.js000066400000000000000000000015561450520414700234200ustar00rootroot00000000000000class Unused { static flag = false; static mutate = () => { this.flag = true; }; } Unused.mutate(); class Used { static flag = false; static mutate = () => { this.flag = true; }; } Used.mutate(); if (Used.flag) console.log('retained'); else console.log('unimportant'); class InstanceMutation { static flag = false; flag = false; mutate = () => { this.flag = true; }; } new InstanceMutation().mutate(); if (InstanceMutation.flag) console.log('removed'); else console.log('retained'); class UsedSuper { static flag = false; } class UsedWithSuper extends UsedSuper { static mutate = () => { super.flag = true; }; } UsedWithSuper.mutate(); if (UsedWithSuper.flag) console.log('retained'); else console.log('unimportant'); // Assignments via "super" do NOT mutate the super class! if (UsedSuper.flag) console.log('removed'); else console.log('retained'); rollup-3.29.4/test/form/samples/this-in-imports/000077500000000000000000000000001450520414700215645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/this-in-imports/_config.js000066400000000000000000000001751450520414700235310ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly keep or ignore "this"-expressions when calling imported functions' }); rollup-3.29.4/test/form/samples/this-in-imports/_expected.js000066400000000000000000000001651450520414700240640ustar00rootroot00000000000000function B$1 () { this.x = 1; } function B () { this.x = 1; } function B3 () { this.x = 1; } B$1(); B(); B3(); rollup-3.29.4/test/form/samples/this-in-imports/lib1.js000066400000000000000000000001151450520414700227460ustar00rootroot00000000000000export function A () { this.x = 1; } export function B () { this.x = 1; } rollup-3.29.4/test/form/samples/this-in-imports/lib2.js000066400000000000000000000001151450520414700227470ustar00rootroot00000000000000export function A () { this.x = 1; } export function B () { this.x = 1; } rollup-3.29.4/test/form/samples/this-in-imports/lib3a.js000066400000000000000000000000541450520414700231130ustar00rootroot00000000000000export default function () { this.x = 1; } rollup-3.29.4/test/form/samples/this-in-imports/lib3b.js000066400000000000000000000000541450520414700231140ustar00rootroot00000000000000export default function () { this.x = 1; } rollup-3.29.4/test/form/samples/this-in-imports/main.js000066400000000000000000000003741450520414700230520ustar00rootroot00000000000000import * as lib1 from './lib1'; import { A as A2, B as B2 } from './lib2'; import A3 from './lib3a'; import B3 from './lib3b'; const a1 = new lib1.A(); const b1 = lib1.B(); const a2 = new A2(); const b2 = B2(); const a3 = new A3(); const b3 = B3(); rollup-3.29.4/test/form/samples/this-is-undefined/000077500000000000000000000000001450520414700220355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/this-is-undefined/_config.js000066400000000000000000000002241450520414700237750ustar00rootroot00000000000000module.exports = defineTest({ description: 'top-level `this` expression is rewritten as `undefined`', expectedWarnings: ['THIS_IS_UNDEFINED'] }); rollup-3.29.4/test/form/samples/this-is-undefined/_expected/000077500000000000000000000000001450520414700237755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/this-is-undefined/_expected/amd.js000066400000000000000000000006551450520414700251020ustar00rootroot00000000000000define((function () { 'use strict'; const fooContext = {}; function foo () { // inside a function, `this` should be untouched... assert.strictEqual( this, fooContext ); } const bar = () => { // ...unless it's an arrow function assert.strictEqual( undefined, undefined ); }; foo.call( fooContext ); bar.call( {} ); // outside a function, `this` is undefined assert.strictEqual( undefined, undefined ); })); rollup-3.29.4/test/form/samples/this-is-undefined/_expected/cjs.js000066400000000000000000000006041450520414700251120ustar00rootroot00000000000000'use strict'; const fooContext = {}; function foo () { // inside a function, `this` should be untouched... assert.strictEqual( this, fooContext ); } const bar = () => { // ...unless it's an arrow function assert.strictEqual( undefined, undefined ); }; foo.call( fooContext ); bar.call( {} ); // outside a function, `this` is undefined assert.strictEqual( undefined, undefined ); rollup-3.29.4/test/form/samples/this-is-undefined/_expected/es.js000066400000000000000000000005651450520414700247500ustar00rootroot00000000000000const fooContext = {}; function foo () { // inside a function, `this` should be untouched... assert.strictEqual( this, fooContext ); } const bar = () => { // ...unless it's an arrow function assert.strictEqual( undefined, undefined ); }; foo.call( fooContext ); bar.call( {} ); // outside a function, `this` is undefined assert.strictEqual( undefined, undefined ); rollup-3.29.4/test/form/samples/this-is-undefined/_expected/iife.js000066400000000000000000000006501450520414700252500ustar00rootroot00000000000000(function () { 'use strict'; const fooContext = {}; function foo () { // inside a function, `this` should be untouched... assert.strictEqual( this, fooContext ); } const bar = () => { // ...unless it's an arrow function assert.strictEqual( undefined, undefined ); }; foo.call( fooContext ); bar.call( {} ); // outside a function, `this` is undefined assert.strictEqual( undefined, undefined ); })(); rollup-3.29.4/test/form/samples/this-is-undefined/_expected/system.js000066400000000000000000000010021450520414700256500ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const fooContext = {}; function foo () { // inside a function, `this` should be untouched... assert.strictEqual( this, fooContext ); } const bar = () => { // ...unless it's an arrow function assert.strictEqual( undefined, undefined ); }; foo.call( fooContext ); bar.call( {} ); // outside a function, `this` is undefined assert.strictEqual( undefined, undefined ); }) }; })); rollup-3.29.4/test/form/samples/this-is-undefined/_expected/umd.js000066400000000000000000000010131450520414700251130ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const fooContext = {}; function foo () { // inside a function, `this` should be untouched... assert.strictEqual( this, fooContext ); } const bar = () => { // ...unless it's an arrow function assert.strictEqual( undefined, undefined ); }; foo.call( fooContext ); bar.call( {} ); // outside a function, `this` is undefined assert.strictEqual( undefined, undefined ); })); rollup-3.29.4/test/form/samples/this-is-undefined/main.js000066400000000000000000000005521450520414700233210ustar00rootroot00000000000000const fooContext = {}; function foo () { // inside a function, `this` should be untouched... assert.strictEqual( this, fooContext ); } const bar = () => { // ...unless it's an arrow function assert.strictEqual( this, undefined ); } foo.call( fooContext ); bar.call( {} ); // outside a function, `this` is undefined assert.strictEqual( this, undefined ); rollup-3.29.4/test/form/samples/top-level-await/000077500000000000000000000000001450520414700215305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/top-level-await/_config.js000066400000000000000000000001461450520414700234730ustar00rootroot00000000000000module.exports = defineTest({ description: 'top-level await support', formats: ['system', 'es'] }); rollup-3.29.4/test/form/samples/top-level-await/_expected/000077500000000000000000000000001450520414700234705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/top-level-await/_expected/es.js000066400000000000000000000000571450520414700244370ustar00rootroot00000000000000await operation(); await retainedOperation(); rollup-3.29.4/test/form/samples/top-level-await/_expected/system.js000066400000000000000000000002411450520414700253470ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (async function () { await operation(); await retainedOperation(); }) }; })); rollup-3.29.4/test/form/samples/top-level-await/main.js000066400000000000000000000001341450520414700230100ustar00rootroot00000000000000await operation(); if (false) await treeshakenOperation(); else await retainedOperation(); rollup-3.29.4/test/form/samples/tree-shake-arguments-conditional/000077500000000000000000000000001450520414700250525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-arguments-conditional/_config.js000066400000000000000000000001631450520414700270140ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks tree-shaking of arguments through simplified conditionals' }); rollup-3.29.4/test/form/samples/tree-shake-arguments-conditional/_expected.js000066400000000000000000000001471450520414700273520ustar00rootroot00000000000000function ignoringArgs() { return 'no args'; } const handler = ignoringArgs; console.log(handler()); rollup-3.29.4/test/form/samples/tree-shake-arguments-conditional/main.js000066400000000000000000000002721450520414700263350ustar00rootroot00000000000000function ignoringArgs() { return 'no args'; } function takingArgs(arg) { return arg; } const handler = false ? takingArgs : ignoringArgs; console.log(handler('should be removed')); rollup-3.29.4/test/form/samples/tree-shake-curried-functions/000077500000000000000000000000001450520414700242075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-curried-functions/_config.js000066400000000000000000000002111450520414700261430ustar00rootroot00000000000000module.exports = defineTest({ description: 'Remove side-effect-free curried functions (#1263)', expectedWarnings: ['EMPTY_BUNDLE'] }); rollup-3.29.4/test/form/samples/tree-shake-curried-functions/_expected.js000066400000000000000000000000011450520414700264740ustar00rootroot00000000000000 rollup-3.29.4/test/form/samples/tree-shake-curried-functions/main.js000066400000000000000000000001661450520414700254740ustar00rootroot00000000000000function foo(a) { return function(b) { return a+b; } } function bar(a, b) { return a+b; } foo(1)(2); bar(1,2); rollup-3.29.4/test/form/samples/tree-shake-default-exports/000077500000000000000000000000001450520414700236725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-default-exports/_config.js000066400000000000000000000001311450520414700256270ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly remove unused default exports' }); rollup-3.29.4/test/form/samples/tree-shake-default-exports/_expected/000077500000000000000000000000001450520414700256325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-default-exports/_expected/amd.js000066400000000000000000000016201450520414700267300ustar00rootroot00000000000000define((function () { 'use strict'; /* header 3 */ /* leading retained */ /*#__KEEP__*/ console.log( 'side-effect' ) || 43; // trailing retained /* footer 3 */ /* header 4 */ /* leading retained */ var importedValue = 42; // trailing retained /* footer 4 */ /* header 5 */ /* leading retained */ function importedUsedFunction () { console.log( 'unnamed' ); } // trailing retained /* footer 5 */ /* header 6 */ /* leading retained */ function usedNamedFunction () { console.log( 'named' ); } // trailing retained /* footer 6 */ /* header 7 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 7 */ /* header 8 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 8 */ console.log(importedValue); importedUsedFunction(); usedNamedFunction(); })); rollup-3.29.4/test/form/samples/tree-shake-default-exports/_expected/cjs.js000066400000000000000000000015211450520414700267460ustar00rootroot00000000000000'use strict'; /* header 3 */ /* leading retained */ /*#__KEEP__*/ console.log( 'side-effect' ) || 43; // trailing retained /* footer 3 */ /* header 4 */ /* leading retained */ var importedValue = 42; // trailing retained /* footer 4 */ /* header 5 */ /* leading retained */ function importedUsedFunction () { console.log( 'unnamed' ); } // trailing retained /* footer 5 */ /* header 6 */ /* leading retained */ function usedNamedFunction () { console.log( 'named' ); } // trailing retained /* footer 6 */ /* header 7 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 7 */ /* header 8 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 8 */ console.log(importedValue); importedUsedFunction(); usedNamedFunction(); rollup-3.29.4/test/form/samples/tree-shake-default-exports/_expected/es.js000066400000000000000000000015021450520414700265750ustar00rootroot00000000000000/* header 3 */ /* leading retained */ /*#__KEEP__*/ console.log( 'side-effect' ) || 43; // trailing retained /* footer 3 */ /* header 4 */ /* leading retained */ var importedValue = 42; // trailing retained /* footer 4 */ /* header 5 */ /* leading retained */ function importedUsedFunction () { console.log( 'unnamed' ); } // trailing retained /* footer 5 */ /* header 6 */ /* leading retained */ function usedNamedFunction () { console.log( 'named' ); } // trailing retained /* footer 6 */ /* header 7 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 7 */ /* header 8 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 8 */ console.log(importedValue); importedUsedFunction(); usedNamedFunction(); rollup-3.29.4/test/form/samples/tree-shake-default-exports/_expected/iife.js000066400000000000000000000016131450520414700271050ustar00rootroot00000000000000(function () { 'use strict'; /* header 3 */ /* leading retained */ /*#__KEEP__*/ console.log( 'side-effect' ) || 43; // trailing retained /* footer 3 */ /* header 4 */ /* leading retained */ var importedValue = 42; // trailing retained /* footer 4 */ /* header 5 */ /* leading retained */ function importedUsedFunction () { console.log( 'unnamed' ); } // trailing retained /* footer 5 */ /* header 6 */ /* leading retained */ function usedNamedFunction () { console.log( 'named' ); } // trailing retained /* footer 6 */ /* header 7 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 7 */ /* header 8 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 8 */ console.log(importedValue); importedUsedFunction(); usedNamedFunction(); })(); rollup-3.29.4/test/form/samples/tree-shake-default-exports/_expected/system.js000066400000000000000000000020211450520414700275070ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { /* header 3 */ /* leading retained */ /*#__KEEP__*/ console.log( 'side-effect' ) || 43; // trailing retained /* footer 3 */ /* header 4 */ /* leading retained */ var importedValue = 42; // trailing retained /* footer 4 */ /* header 5 */ /* leading retained */ function importedUsedFunction () { console.log( 'unnamed' ); } // trailing retained /* footer 5 */ /* header 6 */ /* leading retained */ function usedNamedFunction () { console.log( 'named' ); } // trailing retained /* footer 6 */ /* header 7 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 7 */ /* header 8 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 8 */ console.log(importedValue); importedUsedFunction(); usedNamedFunction(); }) }; })); rollup-3.29.4/test/form/samples/tree-shake-default-exports/_expected/umd.js000066400000000000000000000017561450520414700267660ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; /* header 3 */ /* leading retained */ /*#__KEEP__*/ console.log( 'side-effect' ) || 43; // trailing retained /* footer 3 */ /* header 4 */ /* leading retained */ var importedValue = 42; // trailing retained /* footer 4 */ /* header 5 */ /* leading retained */ function importedUsedFunction () { console.log( 'unnamed' ); } // trailing retained /* footer 5 */ /* header 6 */ /* leading retained */ function usedNamedFunction () { console.log( 'named' ); } // trailing retained /* footer 6 */ /* header 7 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 7 */ /* header 8 */ /* leading retained */ ({ effect: console.log( 'side-effect' ) || 43 }); // trailing retained /* footer 8 */ console.log(importedValue); importedUsedFunction(); usedNamedFunction(); })); rollup-3.29.4/test/form/samples/tree-shake-default-exports/main.js000066400000000000000000000006211450520414700251530ustar00rootroot00000000000000import './unused.js'; import './unusedFunction.js'; import './unusedSideEffect.js'; import importedValue from './used.js'; import importedUsedFunction from './usedFunction.js'; import importedUsedNamedFunction from './usedNamedFunction.js'; import './unusedSideEffectObject1.js'; import './unusedSideEffectObject2.js'; console.log(importedValue); importedUsedFunction(); importedUsedNamedFunction(); rollup-3.29.4/test/form/samples/tree-shake-default-exports/unused.js000066400000000000000000000001351450520414700255320ustar00rootroot00000000000000/* header 1 */ /* leading removed */ export default 43; // trailing removed /* footer 1 */ rollup-3.29.4/test/form/samples/tree-shake-default-exports/unusedFunction.js000066400000000000000000000002041450520414700272350ustar00rootroot00000000000000/* header 2 */ /* leading removed */ export default function () { console.log( 'unused' ); }; // trailing removed /* footer 2 */ rollup-3.29.4/test/form/samples/tree-shake-default-exports/unusedSideEffect.js000066400000000000000000000002151450520414700274530ustar00rootroot00000000000000/* header 3 */ /* leading retained */ export default /*#__KEEP__*/ console.log( 'side-effect' ) || 43; // trailing retained /* footer 3 */ rollup-3.29.4/test/form/samples/tree-shake-default-exports/unusedSideEffectObject1.js000066400000000000000000000002131450520414700306610ustar00rootroot00000000000000/* header 7 */ /* leading retained */ export default { effect: console.log( 'side-effect' ) || 43 } // trailing retained /* footer 7 */ rollup-3.29.4/test/form/samples/tree-shake-default-exports/unusedSideEffectObject2.js000066400000000000000000000002141450520414700306630ustar00rootroot00000000000000/* header 8 */ /* leading retained */ export default { effect: console.log( 'side-effect' ) || 43 }; // trailing retained /* footer 8 */ rollup-3.29.4/test/form/samples/tree-shake-default-exports/used.js000066400000000000000000000001371450520414700251710ustar00rootroot00000000000000/* header 4 */ /* leading retained */ export default 42; // trailing retained /* footer 4 */ rollup-3.29.4/test/form/samples/tree-shake-default-exports/usedFunction.js000066400000000000000000000002371450520414700267000ustar00rootroot00000000000000/* header 5 */ /* leading retained */ export /* default */ // default default function () { console.log( 'unnamed' ); } // trailing retained /* footer 5 */ rollup-3.29.4/test/form/samples/tree-shake-default-exports/usedNamedFunction.js000066400000000000000000000002261450520414700276430ustar00rootroot00000000000000/* header 6 */ /* leading retained */ export default function usedNamedFunction () { console.log( 'named' ); } // trailing retained /* footer 6 */ rollup-3.29.4/test/form/samples/tree-shake-global-variables/000077500000000000000000000000001450520414700237525ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-global-variables/_config.js000066400000000000000000000001711450520414700257130ustar00rootroot00000000000000module.exports = defineTest({ description: 'retain Set, Map, WeakSet and WeakMap which called with array arguments' }); rollup-3.29.4/test/form/samples/tree-shake-global-variables/_expected.js000066400000000000000000000002051450520414700262450ustar00rootroot00000000000000new Set([f()]); //retained new WeakSet([f()]); //retained new Map([['a', f()]]); //retained new WeakMap([[f(), 'a']]); //retained rollup-3.29.4/test/form/samples/tree-shake-global-variables/main.js000066400000000000000000000004251450520414700252350ustar00rootroot00000000000000new Set([f()]); //retained new Set(['a']); new Set(); new WeakSet([f()]); //retained new WeakSet([{}]); new WeakSet(); new Map([['a', f()]]); //retained new Map([['a', 'a']]); new Map(); new WeakMap([[f(), 'a']]); //retained new WeakMap([[{}, 'a']]); new WeakMap(); rollup-3.29.4/test/form/samples/tree-shake-if-statements/000077500000000000000000000000001450520414700233275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-if-statements/_config.js000066400000000000000000000001621450520414700252700ustar00rootroot00000000000000module.exports = defineTest({ description: 'tree-shake if-statements with a condition that can be evaluated' }); rollup-3.29.4/test/form/samples/tree-shake-if-statements/_expected.js000066400000000000000000000010021450520414700256160ustar00rootroot00000000000000if (console.log(1) || unknown) ; { console.log('kept'); } { console.log('kept'); } var a; { console.log('kept'); } console.log(a); var b; { console.log('kept'); } console.log(b); if (console.log('effect'), true) { console.log('kept'); } if (console.log('effect'), true) { console.log('kept'); } { console.log('kept'); } var c; console.log(c); var d; { console.log('kept'); } console.log(d); if (console.log('effect'), false) ; if (console.log('effect'), false) ; else { console.log('kept'); } rollup-3.29.4/test/form/samples/tree-shake-if-statements/main.js000066400000000000000000000017661450520414700246230ustar00rootroot00000000000000if (console.log(1) || unknown) { const x = 1; } else { const x = 2; } if (true) { console.log('kept'); } if (true) { console.log('kept'); } else { console.log('removed'); } if (true) { console.log('kept'); } else { console.log('removed'); var a; } console.log(a); function noEffect(){} if (noEffect(), true) { console.log('kept'); } else { console.log('removed'); var b; } console.log(b); if (console.log('effect'), true) { console.log('kept'); } if (console.log('effect'), true) { console.log('kept'); } else { console.log('removed'); } // removed completely if (false) { console.log('removed'); } if (false) { console.log('removed'); } else { console.log('kept'); } if (false) { console.log('removed'); var c; } console.log(c); if (false) { console.log('removed'); var d; } else { console.log('kept'); } console.log(d); if (console.log('effect'), false) { console.log('removed'); } if (console.log('effect'), false) { console.log('removed'); } else { console.log('kept'); } rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/000077500000000000000000000000001450520414700245365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/_config.js000066400000000000000000000001411450520414700264740ustar00rootroot00000000000000module.exports = defineTest({ description: 'tree-shake unused parts of logical expressions' }); rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/_expected/000077500000000000000000000000001450520414700264765ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/_expected/amd.js000066400000000000000000000003471450520414700276010ustar00rootroot00000000000000define((function () { 'use strict'; function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); })); rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/_expected/cjs.js000066400000000000000000000003011450520414700276050ustar00rootroot00000000000000'use strict'; function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/_expected/es.js000066400000000000000000000002621450520414700274430ustar00rootroot00000000000000function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/_expected/iife.js000066400000000000000000000003421450520414700277470ustar00rootroot00000000000000(function () { 'use strict'; function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); })(); rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/_expected/system.js000066400000000000000000000004661450520414700303660ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); }) }; })); rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/_expected/umd.js000066400000000000000000000005051450520414700276210ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); })); rollup-3.29.4/test/form/samples/tree-shake-logical-expressions/main.js000066400000000000000000000004611450520414700260210ustar00rootroot00000000000000function getStringA() { return 'A'; } console.log(true && getStringA()); function getStringB() { return 'B'; } console.log(false && getStringB()); function getStringC() { return 'C'; } console.log(true || getStringC()); function getStringD() { return 'D'; } console.log(false || getStringD()); rollup-3.29.4/test/form/samples/tree-shake-object-with-sideeffctful-getter/000077500000000000000000000000001450520414700267145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-object-with-sideeffctful-getter/_config.js000066400000000000000000000001601450520414700306530ustar00rootroot00000000000000module.exports = { description: 'retain functions that accept a object with a getter that has side effects' }; rollup-3.29.4/test/form/samples/tree-shake-object-with-sideeffctful-getter/_expected.js000066400000000000000000000002631450520414700312130ustar00rootroot00000000000000let effects = 0; const objWithEffect = { get foo() { effects++; return 'foo'; } }; Object.values(objWithEffect); Object.entries(objWithEffect); assert.equal(effects, 2); rollup-3.29.4/test/form/samples/tree-shake-object-with-sideeffctful-getter/main.js000066400000000000000000000006511450520414700302000ustar00rootroot00000000000000let effects = 0; const objWithEffect = { get foo() { effects++; return 'foo'; } }; const objWithoutEffect1 = { get foo() { return 'foo'; } }; const objWithoutEffect2 = { foo: 'foo' }; Object.values(objWithEffect); Object.entries(objWithEffect); Object.values(objWithoutEffect1); Object.entries(objWithoutEffect1); Object.values(objWithoutEffect2); Object.entries(objWithoutEffect2); assert.equal(effects, 2); rollup-3.29.4/test/form/samples/tree-shake-optional-chaining-literal/000077500000000000000000000000001450520414700256015ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-optional-chaining-literal/_config.js000066400000000000000000000001571450520414700275460ustar00rootroot00000000000000module.exports = defineTest({ description: 'tree-shake expressions optional chaining with literal values' }); rollup-3.29.4/test/form/samples/tree-shake-optional-chaining-literal/_expected.js000066400000000000000000000001101450520414700300670ustar00rootroot00000000000000// remains exist?.foo?.(); if (exist?.z) { console.log("remains"); } rollup-3.29.4/test/form/samples/tree-shake-optional-chaining-literal/main.js000066400000000000000000000005151450520414700270640ustar00rootroot00000000000000undefined?.foo(); undefined?.foo?.bar?.(); undefined?.(); if (undefined?.foo) { console.log("shaked"); } if (undefined?.foo?.bar || false) { console.log("shaked"); } (undefined || null)?.foo(); (undefined ?? null ?? undefined?.bar)?.foo(); null?.bar(); // remains exist?.foo?.(); if (exist?.z) { console.log("remains") } rollup-3.29.4/test/form/samples/tree-shake-pure-optional-chaining/000077500000000000000000000000001450520414700251205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/tree-shake-pure-optional-chaining/_config.js000066400000000000000000000001571450520414700270650ustar00rootroot00000000000000module.exports = defineTest({ description: 'tree-shake pure call expressions involving optional chaining' }); rollup-3.29.4/test/form/samples/tree-shake-pure-optional-chaining/_expected.js000066400000000000000000000000441450520414700274140ustar00rootroot00000000000000foo.bar(); foo?.bar(); foo.bar?.(); rollup-3.29.4/test/form/samples/tree-shake-pure-optional-chaining/main.js000066400000000000000000000001571450520414700264050ustar00rootroot00000000000000foo.bar(); foo?.bar(); foo.bar?.(); /*#__PURE__*/foo.bar(); /*#__PURE__*/foo?.bar(); /*#__PURE__*/foo.bar?.(); rollup-3.29.4/test/form/samples/treeshake-classes-with-fields/000077500000000000000000000000001450520414700243415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-classes-with-fields/_config.js000066400000000000000000000001371450520414700263040ustar00rootroot00000000000000module.exports = defineTest({ description: 'treeshakes classes with class fields (#3564)' }); rollup-3.29.4/test/form/samples/treeshake-classes-with-fields/_expected.js000066400000000000000000000004321450520414700266360ustar00rootroot00000000000000class StaticFieldWithValueEffect { static field = console.log('retained') || 'field'; } class ComputedFieldWithKeyEffect { [console.log('retained') || 'field'] = 'retained'; } class StaticComputedFieldWithKeyEffect { static [console.log('retained') || 'field'] = 'retained'; } rollup-3.29.4/test/form/samples/treeshake-classes-with-fields/main.js000066400000000000000000000010241450520414700256200ustar00rootroot00000000000000class Field { field; } class StaticField { static field; } class FieldWithValueEffect { field = console.log('ignored') || 'field'; } class StaticFieldWithValueEffect { static field = console.log('retained') || 'field'; } class ComputedField { ['field'] = 'ignored'; } class StaticComputedField { static ['field'] = 'ignored'; } class ComputedFieldWithKeyEffect { [console.log('retained') || 'field'] = 'retained'; } class StaticComputedFieldWithKeyEffect { static [console.log('retained') || 'field'] = 'retained'; } rollup-3.29.4/test/form/samples/treeshake-deterministic-dynamic-import/000077500000000000000000000000001450520414700262645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-deterministic-dynamic-import/_config.js000066400000000000000000000015641450520414700302340ustar00rootroot00000000000000module.exports = { description: 'treeshakes dynamic imports when the target is deterministic', options: { output: { inlineDynamicImports: true }, external: ['external'], plugins: [ { resolveId(id) { if (/(bail|effect)-(\d+).js$/.test(id)) { return id; } return null; }, load(id) { const match = /(bail|effect)-(\d+).js$/.exec(id); if (match) { if (match[1] === 'bail') return { code: [ `export default '@included-bail-${match[2]}'`, `export const named${match[2]} = 'bail${match[2]}';` ].join('\n') }; else if (match[1] === 'effect') { return { code: [ 'export function fn() { /* @tree-shaken */ }', `console.log('@included-effect-${match[2]}');` ].join('\n') }; } } return null; } } ] } }; rollup-3.29.4/test/form/samples/treeshake-deterministic-dynamic-import/_expected.js000066400000000000000000000122651450520414700305700ustar00rootroot00000000000000import * as external from 'external'; function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } async function entry() { // simple const { foo1: foo } = await Promise.resolve().then(function () { return sub1; }); await Promise.resolve().then(function () { return sub1; }); (await Promise.resolve().then(function () { return sub2; })).bar2(); await Promise.resolve().then(function () { return sub2; }); await Promise.resolve().then(function () { return sub2; }); Promise.resolve().then(function () { return sub2; }).then(({ baz2 }) => baz2); Promise.resolve().then(function () { return sub2; }).then(function({ reexported }) { }); // external with unknown namespace await Promise.resolve().then(function () { return sub4; }); // side-effect only Promise.resolve().then(function () { return effect1; }); await Promise.resolve().then(function () { return effect2; }); Promise.resolve().then(function () { return effect3; }).then(function() { }); Promise.resolve().then(function () { return effect4; }).then(); Promise.resolve().then(function () { return effect5; }).catch(() => {}); Promise.resolve().then(function () { return effect6; }).finally(() => {}); // bail out await Promise.resolve().then(function () { return bail1$1; }); Promise.resolve().then(function () { return bail1$1; }); // this make it bail out await Promise.resolve().then(function () { return bail2$1; }) (await Promise.resolve().then(function () { return bail3$1; }))[foo]; await Promise.resolve().then(function () { return bail4$1; }).name4; // access on promise, not on export Promise.resolve().then(function () { return bail5$1; }).then(foo); await Promise.resolve().then(function () { return bail6$1; }).then(function({ named6, ...args }) { }); [ Promise.resolve().then(function () { return bail7$1; }), Promise.resolve().then(function () { return bail8$1; }), ]; await Promise.resolve().then(function () { return bail9$1; }); Promise.resolve().then(function () { return bail10$1; }).then(({ [foo]: bar }) => {}); } function foo1() { return 'foo1'; } console.log('side-effect1'); var sub1 = /*#__PURE__*/Object.freeze({ __proto__: null, foo1: foo1 }); function foo3() { return 'foo3'; } function bar3() { return 'bar3'; } console.log('side-effect3'); function foo2() { return 'foo2'; } function bar2() { return 'bar2'; } function baz2() { return 'baz2'; } var sub2 = /*#__PURE__*/Object.freeze({ __proto__: null, bar2: bar2, bar3: bar3, baz2: baz2, foo2: foo2, foo3: foo3, reexported: bar3 }); const foo4 = 3; var sub4 = /*#__PURE__*/_mergeNamespaces({ __proto__: null, foo4: foo4 }, [external]); console.log('@included-effect-1'); var effect1 = /*#__PURE__*/Object.freeze({ __proto__: null }); console.log('@included-effect-2'); var effect2 = /*#__PURE__*/Object.freeze({ __proto__: null }); console.log('@included-effect-3'); var effect3 = /*#__PURE__*/Object.freeze({ __proto__: null }); console.log('@included-effect-4'); var effect4 = /*#__PURE__*/Object.freeze({ __proto__: null }); console.log('@included-effect-5'); var effect5 = /*#__PURE__*/Object.freeze({ __proto__: null }); console.log('@included-effect-6'); var effect6 = /*#__PURE__*/Object.freeze({ __proto__: null }); var bail1 = '@included-bail-1'; const named1 = 'bail1'; var bail1$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail1, named1: named1 }); var bail2 = '@included-bail-2'; const named2 = 'bail2'; var bail2$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail2, named2: named2 }); var bail3 = '@included-bail-3'; const named3 = 'bail3'; var bail3$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail3, named3: named3 }); var bail4 = '@included-bail-4'; const named4 = 'bail4'; var bail4$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail4, named4: named4 }); var bail5 = '@included-bail-5'; const named5 = 'bail5'; var bail5$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail5, named5: named5 }); var bail6 = '@included-bail-6'; const named6 = 'bail6'; var bail6$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail6, named6: named6 }); var bail7 = '@included-bail-7'; const named7 = 'bail7'; var bail7$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail7, named7: named7 }); var bail8 = '@included-bail-8'; const named8 = 'bail8'; var bail8$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail8, named8: named8 }); var bail9 = '@included-bail-9'; const named9 = 'bail9'; var bail9$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail9, named9: named9 }); var bail10 = '@included-bail-10'; const named10 = 'bail10'; var bail10$1 = /*#__PURE__*/Object.freeze({ __proto__: null, default: bail10, named10: named10 }); export { entry }; rollup-3.29.4/test/form/samples/treeshake-deterministic-dynamic-import/main.js000066400000000000000000000024641450520414700275540ustar00rootroot00000000000000export async function entry() { // simple const { foo1: foo } = await import('./sub1.js'); const { doesNotExists } = await import('./sub1.js'); // multiple ;(await import('./sub2.js')).bar2() const { foo2 } = await import('./sub2.js'); const { foo3 } = await import('./sub2.js'); import('./sub2.js').then(({ baz2 }) => baz2) import('./sub2.js').then(function({ reexported }) { reexported }) // external with unknown namespace const { foo4, x } = await import('./sub4'); // side-effect only import('./effect-1.js') await import('./effect-2.js') import('./effect-3.js').then(function() { }) import('./effect-4.js').then() import('./effect-5.js').catch(() => {}) import('./effect-6.js').finally(() => {}) // bail out const { named1 } = await import('./bail-1.js'); const promise = import('./bail-1.js') // this make it bail out const { ...named2 } = await import('./bail-2.js') (await import('./bail-3.js'))[foo] await import('./bail-4.js').name4 // access on promise, not on export import('./bail-5.js').then(foo) await import('./bail-6.js').then(function({ named6, ...args }) { }) const promises = [ import('./bail-7.js'), import('./bail-8.js'), ] const { [foo]: bar } = await import('./bail-9.js') import('./bail-10.js').then(({ [foo]: bar }) => {}) } rollup-3.29.4/test/form/samples/treeshake-deterministic-dynamic-import/sub1.js000066400000000000000000000002251450520414700274730ustar00rootroot00000000000000export function foo1() { return 'foo1'; } export function bar1() { return 'bar1'; // this should be tree-shaken } console.log('side-effect1'); rollup-3.29.4/test/form/samples/treeshake-deterministic-dynamic-import/sub2.js000066400000000000000000000004351450520414700274770ustar00rootroot00000000000000export function foo2() { return 'foo2'; } export function bar2() { return 'bar2'; } export function baz2() { return 'baz2'; } export function qux2() { return 'qux2'; // this should be tree-shaken } export { bar3 as reexported } from './sub3.js' export * from './sub3.js'; rollup-3.29.4/test/form/samples/treeshake-deterministic-dynamic-import/sub3.js000066400000000000000000000003011450520414700274700ustar00rootroot00000000000000export function foo3() { return 'foo3'; } export function bar3() { return 'bar3'; } export function baz3() { return 'baz3'; // this should be tree-shaken } console.log('side-effect3') rollup-3.29.4/test/form/samples/treeshake-deterministic-dynamic-import/sub4.js000066400000000000000000000001111450520414700274700ustar00rootroot00000000000000export const foo4 = 3; export const bar4 = 4; export * from 'external'; rollup-3.29.4/test/form/samples/treeshake-excess-arguments/000077500000000000000000000000001450520414700237645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-excess-arguments/argument-side-effects/000077500000000000000000000000001450520414700301455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-excess-arguments/argument-side-effects/_config.js000066400000000000000000000001331450520414700321040ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains arguments that have side-effects' }); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/argument-side-effects/_expected.js000066400000000000000000000002131450520414700324370ustar00rootroot00000000000000function sideEffects() { console.log('print message'); return true; } function hola(a, b) { console.log(a); } hola(1, sideEffects()); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/argument-side-effects/main.js000066400000000000000000000002131450520414700314230ustar00rootroot00000000000000function sideEffects() { console.log('print message'); return true; } function hola(a, b) { console.log(a); } hola(1, sideEffects()); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/arguments-variable/000077500000000000000000000000001450520414700275545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-excess-arguments/arguments-variable/_config.js000066400000000000000000000001731450520414700315170ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not remove arguments from call when arguments variables is accessed' }); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/arguments-variable/_expected.js000066400000000000000000000004411450520414700320510ustar00rootroot00000000000000function useArguments1() { console.log(arguments.length); } function useArguments2(existing) { console.log(existing, arguments[1]); } const needed11 = 1; const needed12 = 2; useArguments1(needed11, needed12); const needed21 = 1; const needed22 = 2; useArguments2(needed21, needed22); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/arguments-variable/main.js000066400000000000000000000004411450520414700310350ustar00rootroot00000000000000function useArguments1() { console.log(arguments.length); } function useArguments2(existing) { console.log(existing, arguments[1]); } const needed11 = 1; const needed12 = 2; useArguments1(needed11, needed12); const needed21 = 1; const needed22 = 2; useArguments2(needed21, needed22); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/arrow-function-arguments/000077500000000000000000000000001450520414700307445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-excess-arguments/arrow-function-arguments/_config.js000066400000000000000000000001531450520414700327050ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes unneeded arguments from calls to arrow functions' }); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/arrow-function-arguments/_expected.js000066400000000000000000000004751450520414700332500ustar00rootroot00000000000000const noParams = () => console.log(); const someUsedParams = (p1, p2, p3) => console.log(p1, p3); noParams(); const needed21 = 1; const needed22 = 2; const needed23 = 3; someUsedParams(needed21, needed22, needed23); someUsedParams(needed21, needed22, (needed23)); (someUsedParams)(needed21, needed22, needed23 ); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/arrow-function-arguments/main.js000066400000000000000000000006221450520414700322260ustar00rootroot00000000000000const noParams = () => console.log(); const someUsedParams = (p1, p2, p3) => console.log(p1, p3); const unneeded1 = 1; noParams(unneeded1); const unneeded2 = 1; const needed21 = 1; const needed22 = 2; const needed23 = 3; someUsedParams(needed21, needed22, needed23, unneeded2); someUsedParams(needed21, needed22, (needed23), unneeded2); (someUsedParams)(needed21, needed22, needed23 , unneeded2); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/function-arguments/000077500000000000000000000000001450520414700276145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-excess-arguments/function-arguments/_config.js000066400000000000000000000001451450520414700315560ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes unneeded arguments from calls to functions' }); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/function-arguments/_expected.js000066400000000000000000000012131450520414700321070ustar00rootroot00000000000000function noParams() { console.log(); } function someUsedParams(p1, p2, p3) { console.log(p1, p3); } noParams(); const needed21 = 1; const needed22 = 2; const needed23 = 3; someUsedParams(needed21, needed22, needed23); const noParamsExp = function() { console.log(); }; const someUsedParamsExp = function(p1, p2, p3) { console.log(p1, p3); }; noParamsExp(); const needed41 = 1; const needed42 = 2; const needed43 = 3; someUsedParamsExp(needed41, needed42, needed43); (function() { console.log(); }()); const needed61 = 1; const needed62 = 2; const needed63 = 3; (function(p1, p2, p3) { console.log(p1, p3); } (needed61, needed62, needed63)); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/function-arguments/main.js000066400000000000000000000015571450520414700311060ustar00rootroot00000000000000function noParams() { console.log(); } function someUsedParams(p1, p2, p3) { console.log(p1, p3); } const unneeded1 = 1; noParams(unneeded1); const unneeded21 = 1; const unneeded22 = 1; const needed21 = 1; const needed22 = 2; const needed23 = 3; someUsedParams(needed21, needed22, needed23, unneeded21, unneeded22); const noParamsExp = function() { console.log(); }; const someUsedParamsExp = function(p1, p2, p3) { console.log(p1, p3); }; const unneeded3 = 1; noParamsExp(unneeded3); const unneeded4 = 1; const needed41 = 1; const needed42 = 2; const needed43 = 3; someUsedParamsExp(needed41, needed42, needed43, unneeded4); const unneeded5 = 1; (function() { console.log(); }(unneeded5)); const unneeded6 = 1; const needed61 = 1; const needed62 = 2; const needed63 = 3; (function(p1, p2, p3) { console.log(p1, p3); } (needed61, needed62, needed63, unneeded6)); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/namespace-members/000077500000000000000000000000001450520414700273505ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-excess-arguments/namespace-members/_config.js000066400000000000000000000001531450520414700313110ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes unneeded arguments across namespace member calls' }); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/namespace-members/_expected.js000066400000000000000000000003331450520414700316450ustar00rootroot00000000000000const noParams = () => console.log(); const someUsedParams = (p1, p2, p3) => console.log(p1, p3); noParams(); const needed21 = 1; const needed22 = 2; const needed23 = 3; someUsedParams(needed21, needed22, needed23); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/namespace-members/main.js000066400000000000000000000003421450520414700306310ustar00rootroot00000000000000import * as ns from './namespace'; const unneeded1 = 1; ns.noParams(unneeded1); const unneeded2 = 1; const needed21 = 1; const needed22 = 2; const needed23 = 3; ns.someUsedParams(needed21, needed22, needed23, unneeded2); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/namespace-members/namespace.js000066400000000000000000000001601450520414700316370ustar00rootroot00000000000000export const noParams = () => console.log(); export const someUsedParams = (p1, p2, p3) => console.log(p1, p3); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/patterns/000077500000000000000000000000001450520414700256245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-excess-arguments/patterns/_config.js000066400000000000000000000001571450520414700275710ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes unneeded arguments from calls when patterns are used' }); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/patterns/_expected.js000066400000000000000000000002121450520414700301150ustar00rootroot00000000000000function usePatterns([a, b, ...c], d) { console.log(a, b, c, d); } const needed1 = 1; const needed2 = 2; usePatterns(needed1, needed2); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/patterns/main.js000066400000000000000000000002501450520414700271030ustar00rootroot00000000000000function usePatterns([a, b, ...c], d) { console.log(a, b, c, d); } const needed1 = 1; const needed2 = 2; const unneeded = 1; usePatterns(needed1, needed2, unneeded); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/rest-element/000077500000000000000000000000001450520414700263705ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-excess-arguments/rest-element/_config.js000066400000000000000000000001651450520414700303340ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not remove arguments from calls when rest parameters are used' }); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/rest-element/_expected.js000066400000000000000000000004611450520414700306670ustar00rootroot00000000000000function useRest1(...rest) { console.log(rest.length); } function useRest2(existing, ...rest) { console.log(existing, rest[1]); } const needed11 = 1; const needed12 = 2; useRest1(needed11, needed12); const needed21 = 1; const needed22 = 2; const needed23 = 4; useRest2(needed21, needed22, needed23); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/rest-element/main.js000066400000000000000000000004611450520414700276530ustar00rootroot00000000000000function useRest1(...rest) { console.log(rest.length); } function useRest2(existing, ...rest) { console.log(existing, rest[1]); } const needed11 = 1; const needed12 = 2; useRest1(needed11, needed12); const needed21 = 1; const needed22 = 2; const needed23 = 4; useRest2(needed21, needed22, needed23); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/unused-parameters/000077500000000000000000000000001450520414700274305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-excess-arguments/unused-parameters/_config.js000066400000000000000000000001511450520414700313670ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes arguments that correspond to unused parameters' }); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/unused-parameters/_expected.js000066400000000000000000000004321450520414700317250ustar00rootroot00000000000000function test(a, b = globalThis.unknown(), c) {} test(1, 2); function noEffect() {} test(1, 2, noEffect(), globalThis.unknown()); const testArr = (a, b = globalThis.unknown(), c) => {}; testArr(1, 2); function noEffectArr() {} testArr(1, 2, noEffectArr(), globalThis.unknown()); rollup-3.29.4/test/form/samples/treeshake-excess-arguments/unused-parameters/main.js000066400000000000000000000005611450520414700307140ustar00rootroot00000000000000function test(a, b = globalThis.unknown(), c) {} const someStuff = {x: 1}; test(1, 2, 3, someStuff); function noEffect() {} test(1, 2, noEffect(), globalThis.unknown()); const testArr = (a, b = globalThis.unknown(), c) => {} const someStuffArr = {x: 1}; testArr(1, 2, 3, someStuffArr); function noEffectArr() {} testArr(1, 2, noEffectArr(), globalThis.unknown()); rollup-3.29.4/test/form/samples/treeshake-import-meta-props/000077500000000000000000000000001450520414700240665ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-import-meta-props/_config.js000066400000000000000000000001651450520414700260320ustar00rootroot00000000000000module.exports = defineTest({ description: 'also does not include format globals when tree-shaking import meta' }); rollup-3.29.4/test/form/samples/treeshake-import-meta-props/_expected/000077500000000000000000000000001450520414700260265ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-import-meta-props/_expected/amd.js000066400000000000000000000001011450520414700271150ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/treeshake-import-meta-props/_expected/cjs.js000066400000000000000000000000441450520414700271410ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-3.29.4/test/form/samples/treeshake-import-meta-props/_expected/es.js000066400000000000000000000000251450520414700267700ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/form/samples/treeshake-import-meta-props/_expected/iife.js000066400000000000000000000000741450520414700273010ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-3.29.4/test/form/samples/treeshake-import-meta-props/_expected/system.js000066400000000000000000000001761450520414700277140ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/form/samples/treeshake-import-meta-props/_expected/umd.js000066400000000000000000000002371450520414700271530ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/treeshake-import-meta-props/main.js000066400000000000000000000001731450520414700253510ustar00rootroot00000000000000const removed1 = import.meta; const removed2 = import.meta.url; const removed3 = import.meta.unknown; console.log('main'); rollup-3.29.4/test/form/samples/treeshake-import-meta/000077500000000000000000000000001450520414700227255ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-import-meta/_config.js000066400000000000000000000001341450520414700246650ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports tree-shaking for meta properties' }); rollup-3.29.4/test/form/samples/treeshake-import-meta/_expected.js000066400000000000000000000000211450520414700252140ustar00rootroot00000000000000import.meta.a.b; rollup-3.29.4/test/form/samples/treeshake-import-meta/main.js000066400000000000000000000002101450520414700242000ustar00rootroot00000000000000const removed1 = import.meta; const removed2 = import.meta.url; const removed3 = import.meta.unknown; const retained = import.meta.a.b; rollup-3.29.4/test/form/samples/treeshake-json/000077500000000000000000000000001450520414700214405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-json/_config.js000066400000000000000000000002431450520414700234010ustar00rootroot00000000000000const json = require('@rollup/plugin-json').default; module.exports = defineTest({ description: 'removes unusued json keys', options: { plugins: [json()] } }); rollup-3.29.4/test/form/samples/treeshake-json/_expected.js000066400000000000000000000000401450520414700237300ustar00rootroot00000000000000{ console.log('production'); } rollup-3.29.4/test/form/samples/treeshake-json/config.json000066400000000000000000000001321450520414700235740ustar00rootroot00000000000000{ "unused": "unused string", "production": true, "nested": { "specialConfig": 1 } } rollup-3.29.4/test/form/samples/treeshake-json/main.js000066400000000000000000000003111450520414700227150ustar00rootroot00000000000000import { production, nested } from './config.json'; if (production) { console.log('production'); } else { console.log('development'); } if (nested.specialConfig !== 1) { console.log('removed'); } rollup-3.29.4/test/form/samples/treeshake-namespace-access/000077500000000000000000000000001450520414700236625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-namespace-access/_config.js000066400000000000000000000002161450520414700256230ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not count namespace property access as side-effect', options: { external: 'external' } }); rollup-3.29.4/test/form/samples/treeshake-namespace-access/_expected/000077500000000000000000000000001450520414700256225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-namespace-access/_expected/amd.js000066400000000000000000000001271450520414700267210ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/treeshake-namespace-access/_expected/cjs.js000066400000000000000000000000721450520414700267360ustar00rootroot00000000000000'use strict'; require('external'); console.log('main'); rollup-3.29.4/test/form/samples/treeshake-namespace-access/_expected/es.js000066400000000000000000000000511450520414700265630ustar00rootroot00000000000000import 'external'; console.log('main'); rollup-3.29.4/test/form/samples/treeshake-namespace-access/_expected/iife.js000066400000000000000000000000741450520414700270750ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-3.29.4/test/form/samples/treeshake-namespace-access/_expected/system.js000066400000000000000000000002331450520414700275020ustar00rootroot00000000000000System.register(['external'], (function () { 'use strict'; return { setters: [null], execute: (function () { console.log('main'); }) }; })); rollup-3.29.4/test/form/samples/treeshake-namespace-access/_expected/umd.js000066400000000000000000000002551450520414700267470ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['external'], factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-3.29.4/test/form/samples/treeshake-namespace-access/main.js000066400000000000000000000001311450520414700251370ustar00rootroot00000000000000import * as external from 'external'; const unused = external.foo; console.log('main'); rollup-3.29.4/test/form/samples/treeshake-presets/000077500000000000000000000000001450520414700221545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-presets/preset-with-override/000077500000000000000000000000001450520414700262445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-presets/preset-with-override/_config.js000066400000000000000000000015571450520414700302160ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'allows using the "preset" option with overrides', options: { treeshake: { preset: 'smallest', unknownGlobalSideEffects: true }, plugins: [ { name: 'test-plugin', buildStart(options) { if (!options.treeshake) { throw new Error('Treeshaking options not found'); } assert.strictEqual(options.treeshake.correctVarValueBeforeDeclaration, false); assert.strictEqual(options.treeshake.propertyReadSideEffects, false); assert.strictEqual(options.treeshake.tryCatchDeoptimization, false); assert.strictEqual(options.treeshake.unknownGlobalSideEffects, true); assert.strictEqual( options.treeshake.moduleSideEffects(path.join(__dirname, 'dep.js'), false), false ); } } ] } }); rollup-3.29.4/test/form/samples/treeshake-presets/preset-with-override/_expected.js000066400000000000000000000002631450520414700305430ustar00rootroot00000000000000console.log('main'); unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-presets/preset-with-override/dep.js000066400000000000000000000000241450520414700273460ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/form/samples/treeshake-presets/preset-with-override/main.js000066400000000000000000000004431450520414700275270ustar00rootroot00000000000000import './dep.js'; console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-presets/recommended/000077500000000000000000000000001450520414700244365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-presets/recommended/_config.js000066400000000000000000000014631450520414700264040ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'handles treeshake preset "recommended"', options: { treeshake: 'recommended', plugins: [ { name: 'test-plugin', buildStart(options) { if (!options.treeshake) { throw new Error('Treeshaking options not found'); } assert.strictEqual(options.treeshake.correctVarValueBeforeDeclaration, false); assert.strictEqual(options.treeshake.propertyReadSideEffects, true); assert.strictEqual(options.treeshake.tryCatchDeoptimization, true); assert.strictEqual(options.treeshake.unknownGlobalSideEffects, false); assert.strictEqual( options.treeshake.moduleSideEffects(path.join(__dirname, 'dep.js'), false), true ); } } ] } }); rollup-3.29.4/test/form/samples/treeshake-presets/recommended/_expected.js000066400000000000000000000004241450520414700267340ustar00rootroot00000000000000console.log('dep'); console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-presets/recommended/dep.js000066400000000000000000000000241450520414700255400ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/form/samples/treeshake-presets/recommended/main.js000066400000000000000000000004431450520414700257210ustar00rootroot00000000000000import './dep.js'; console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-presets/safest/000077500000000000000000000000001450520414700234415ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-presets/safest/_config.js000066400000000000000000000014401450520414700254020ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'handles treeshake preset "safest"', options: { treeshake: 'safest', plugins: [ { name: 'test', buildStart(options) { if (!options.treeshake) { throw new Error('Treeshaking options not found'); } assert.strictEqual(options.treeshake.correctVarValueBeforeDeclaration, true); assert.strictEqual(options.treeshake.propertyReadSideEffects, true); assert.strictEqual(options.treeshake.tryCatchDeoptimization, true); assert.strictEqual(options.treeshake.unknownGlobalSideEffects, true); assert.strictEqual( options.treeshake.moduleSideEffects(path.join(__dirname, 'dep.js'), false), true ); } } ] } }); rollup-3.29.4/test/form/samples/treeshake-presets/safest/_expected.js000066400000000000000000000004441450520414700257410ustar00rootroot00000000000000console.log('dep'); console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-presets/safest/dep.js000066400000000000000000000000241450520414700245430ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/form/samples/treeshake-presets/safest/main.js000066400000000000000000000004431450520414700247240ustar00rootroot00000000000000import './dep.js'; console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-presets/smallest/000077500000000000000000000000001450520414700240005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-presets/smallest/_config.js000066400000000000000000000014511450520414700257430ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'handles treeshake preset "smallest"', options: { treeshake: 'smallest', plugins: [ { name: 'test', buildStart(options) { if (!options.treeshake) { throw new Error('Treeshaking options not found'); } assert.strictEqual(options.treeshake.correctVarValueBeforeDeclaration, false); assert.strictEqual(options.treeshake.propertyReadSideEffects, false); assert.strictEqual(options.treeshake.tryCatchDeoptimization, false); assert.strictEqual(options.treeshake.unknownGlobalSideEffects, false); assert.strictEqual( options.treeshake.moduleSideEffects(path.join(__dirname, 'dep.js'), false), false ); } } ] } }); rollup-3.29.4/test/form/samples/treeshake-presets/smallest/_expected.js000066400000000000000000000002431450520414700262750ustar00rootroot00000000000000console.log('main'); let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-presets/smallest/dep.js000066400000000000000000000000241450520414700251020ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/form/samples/treeshake-presets/smallest/main.js000066400000000000000000000004431450520414700252630ustar00rootroot00000000000000import './dep.js'; console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-presets/true/000077500000000000000000000000001450520414700231335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-presets/true/_config.js000066400000000000000000000014261450520414700251000ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'handles treeshake preset true', options: { treeshake: true, plugins: [ { name: 'test', buildStart(options) { if (!options.treeshake) { throw new Error('Treeshaking is not enabled'); } assert.strictEqual(options.treeshake.correctVarValueBeforeDeclaration, false); assert.strictEqual(options.treeshake.propertyReadSideEffects, true); assert.strictEqual(options.treeshake.tryCatchDeoptimization, true); assert.strictEqual(options.treeshake.unknownGlobalSideEffects, true); assert.strictEqual( options.treeshake.moduleSideEffects(path.join(__dirname, 'dep.js'), false), true ); } } ] } }); rollup-3.29.4/test/form/samples/treeshake-presets/true/_expected.js000066400000000000000000000004441450520414700254330ustar00rootroot00000000000000console.log('dep'); console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-presets/true/dep.js000066400000000000000000000000241450520414700242350ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/form/samples/treeshake-presets/true/main.js000066400000000000000000000004431450520414700244160ustar00rootroot00000000000000import './dep.js'; console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-3.29.4/test/form/samples/treeshake-sequence-expressions/000077500000000000000000000000001450520414700246575ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/treeshake-sequence-expressions/_config.js000066400000000000000000000001641450520414700266220ustar00rootroot00000000000000module.exports = defineTest({ description: 'removes the last element of a sequence expression if it is unused' }); rollup-3.29.4/test/form/samples/treeshake-sequence-expressions/_expected.js000066400000000000000000000001371450520414700271560ustar00rootroot00000000000000console.log(1); console.log(2); console.log(3); const x = (console.log(2), 3); console.log(x); rollup-3.29.4/test/form/samples/treeshake-sequence-expressions/main.js000066400000000000000000000001751450520414700261440ustar00rootroot000000000000001, 2, 3; console.log(1), 2, 3; 1, console.log(2), 3; 1, 2, console.log(3); const x = (1, console.log(2), 3); console.log(x); rollup-3.29.4/test/form/samples/try-statement-deoptimization/000077500000000000000000000000001450520414700243735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/try-statement-deoptimization/deactivate-via-option/000077500000000000000000000000001450520414700305675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/try-statement-deoptimization/deactivate-via-option/_config.js000066400000000000000000000002461450520414700325330ustar00rootroot00000000000000module.exports = defineTest({ description: 'deactivates try-catch-deoptimization via option', options: { treeshake: { tryCatchDeoptimization: false } } }); rollup-3.29.4/test/form/samples/try-statement-deoptimization/deactivate-via-option/_expected.js000066400000000000000000000003421450520414700330640ustar00rootroot00000000000000function mutate(foo) { foo.bar = 1; } const mutated = {}; function test(callback) { try { callback(); mutate(mutated); } catch {} } test(() => { }); try {} finally { console.log('retained'); } export { mutated }; rollup-3.29.4/test/form/samples/try-statement-deoptimization/deactivate-via-option/main.js000066400000000000000000000005741450520414700320570ustar00rootroot00000000000000function callGlobal() { Object.create(null); } function mutate(foo) { foo.bar = 1; } export const mutated = {}; function test(callback) { try { Object.create(null); callback(); callGlobal(); mutate(mutated); } catch {} } test(() => { Object.create(null); }); try { const x = 1; } catch { console.log('removed'); } try {} finally { console.log('retained'); } rollup-3.29.4/test/form/samples/try-statement-deoptimization/direct-inclusion/000077500000000000000000000000001450520414700276465ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/try-statement-deoptimization/direct-inclusion/_config.js000066400000000000000000000001501450520414700316040ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains side-effect-free code in try-statement-blocks' }); rollup-3.29.4/test/form/samples/try-statement-deoptimization/direct-inclusion/_expected.js000066400000000000000000000002201450520414700321360ustar00rootroot00000000000000try {} catch {} finally { console.log('retained'); } // this will be retained try { Object.create(null); // this will be retained } catch {} rollup-3.29.4/test/form/samples/try-statement-deoptimization/direct-inclusion/main.js000066400000000000000000000005431450520414700311320ustar00rootroot00000000000000Object.create(null); // this will be removed try {} catch {} finally {} // this will be removed try {} catch { console.log('removed'); } // this will be removed try {} catch {} finally { Object.create(null); // this will be removed console.log('retained'); } // this will be retained try { Object.create(null); // this will be retained } catch {} rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-parameters/000077500000000000000000000000001450520414700300365ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-parameters/_config.js000066400000000000000000000001771450520414700320050ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains side-effect-free code in parameters called from try-statement-blocks' }); rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-parameters/_expected.js000066400000000000000000000003231450520414700323320ustar00rootroot00000000000000function properlyTreeshaken() { } function tryIt(other, callback) { try { callback(); } catch {} } tryIt(properlyTreeshaken, properlyTreeshaken); tryIt( () => { }, () => { Object.create(null); } ); rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-parameters/main.js000066400000000000000000000004001450520414700313120ustar00rootroot00000000000000function properlyTreeshaken() { Object.create(null); } function tryIt(other, callback) { try { callback(); } catch {} } tryIt(properlyTreeshaken, properlyTreeshaken); tryIt( () => { Object.create(null); }, () => { Object.create(null); } ); rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-pattern-parameters/000077500000000000000000000000001450520414700315115ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-pattern-parameters/_config.js000066400000000000000000000002111450520414700334450ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains side-effect-free code in pattern parameters called from try-statement-blocks' }); rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-pattern-parameters/_expected.js000066400000000000000000000003111450520414700340020ustar00rootroot00000000000000function properlyTreeshaken() { } function tryIt({ callback }) { try { callback(); } catch {} } tryIt({ callback: properlyTreeshaken }); tryIt({ callback: () => { Object.create(null); } }); rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-pattern-parameters/main.js000066400000000000000000000003371450520414700327760ustar00rootroot00000000000000function properlyTreeshaken() { Object.create(null); } function tryIt({ callback }) { try { callback(); } catch {} } tryIt({ callback: properlyTreeshaken }); tryIt({ callback: () => { Object.create(null); } }); rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-variables/000077500000000000000000000000001450520414700276435ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-variables/_config.js000066400000000000000000000002061450520414700316030ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not retain side-effect-free code in functions called from try-statement-blocks' }); rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-variables/_expected.js000066400000000000000000000001131450520414700321340ustar00rootroot00000000000000function properlyTreeshaken() { } try { properlyTreeshaken(); } catch {} rollup-3.29.4/test/form/samples/try-statement-deoptimization/follow-variables/main.js000066400000000000000000000001411450520414700311210ustar00rootroot00000000000000function properlyTreeshaken() { Object.create(null); } try { properlyTreeshaken(); } catch {} rollup-3.29.4/test/form/samples/try-statement-deoptimization/include-via-outside-variable/000077500000000000000000000000001450520414700320305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/try-statement-deoptimization/include-via-outside-variable/_config.js000066400000000000000000000001631450520414700337720ustar00rootroot00000000000000module.exports = defineTest({ description: 'works when the try-statement is included via an outside variable' }); _expected.js000066400000000000000000000001131450520414700342420ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/try-statement-deoptimization/include-via-outside-variableconsole.log(myVar); try { var myVar = 3; console.log(myVar); } catch {} rollup-3.29.4/test/form/samples/try-statement-deoptimization/include-via-outside-variable/main.js000066400000000000000000000001131450520414700333050ustar00rootroot00000000000000console.log(myVar); try { var myVar = 3; console.log(myVar); } catch {} rollup-3.29.4/test/form/samples/try-statement-deoptimization/supports-core-js/000077500000000000000000000000001450520414700276325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/try-statement-deoptimization/supports-core-js/_config.js000066400000000000000000000001351450520414700315730ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports core-js feature detection (#2869)' }); rollup-3.29.4/test/form/samples/try-statement-deoptimization/supports-core-js/_expected.js000066400000000000000000000003741450520414700321340ustar00rootroot00000000000000function fails(exec) { try { return !!exec(); } catch (e) { return true; } } var MAX_UINT32 = 0xffffffff; var SUPPORTS_Y = !fails(function() { RegExp(MAX_UINT32, 'y'); }); if (SUPPORTS_Y) { console.log('yes'); } else { console.log('no'); } rollup-3.29.4/test/form/samples/try-statement-deoptimization/supports-core-js/main.js000066400000000000000000000003741450520414700311200ustar00rootroot00000000000000function fails(exec) { try { return !!exec(); } catch (e) { return true; } } var MAX_UINT32 = 0xffffffff; var SUPPORTS_Y = !fails(function() { RegExp(MAX_UINT32, 'y'); }); if (SUPPORTS_Y) { console.log('yes'); } else { console.log('no'); } rollup-3.29.4/test/form/samples/typeof-side-effect/000077500000000000000000000000001450520414700222005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/typeof-side-effect/_config.js000066400000000000000000000001471450520414700241440ustar00rootroot00000000000000module.exports = defineTest({ description: 'using typeof is does not trigger global side-effects' }); rollup-3.29.4/test/form/samples/typeof-side-effect/_expected.js000066400000000000000000000000641450520414700244760ustar00rootroot00000000000000if (typeof unknownValue.property !== 'undefined') ; rollup-3.29.4/test/form/samples/typeof-side-effect/main.js000066400000000000000000000002031450520414700234550ustar00rootroot00000000000000if (typeof unknownValue !== 'undefined') { /* removed */ } if (typeof unknownValue.property !== 'undefined') { /* retained */ } rollup-3.29.4/test/form/samples/umd-noconflict-extend/000077500000000000000000000000001450520414700227245ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/umd-noconflict-extend/_config.js000066400000000000000000000003031450520414700246620ustar00rootroot00000000000000module.exports = defineTest({ description: 'exports noConflict method for default umd when requested', options: { output: { extend: true, noConflict: true, name: 'FooBar' } } }); rollup-3.29.4/test/form/samples/umd-noconflict-extend/_expected/000077500000000000000000000000001450520414700246645ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/umd-noconflict-extend/_expected/amd.js000066400000000000000000000003751450520414700257700ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; })); rollup-3.29.4/test/form/samples/umd-noconflict-extend/_expected/cjs.js000066400000000000000000000003051450520414700257770ustar00rootroot00000000000000'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; rollup-3.29.4/test/form/samples/umd-noconflict-extend/_expected/es.js000066400000000000000000000002131450520414700256250ustar00rootroot00000000000000function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; export { doThings, number, setting }; rollup-3.29.4/test/form/samples/umd-noconflict-extend/_expected/iife.js000066400000000000000000000004121450520414700261330ustar00rootroot00000000000000(function (exports) { 'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; })(this.FooBar = this.FooBar || {}); rollup-3.29.4/test/form/samples/umd-noconflict-extend/_expected/system.js000066400000000000000000000004641450520414700265520ustar00rootroot00000000000000System.register('FooBar', [], (function (exports) { 'use strict'; return { execute: (function () { exports('doThings', doThings); function doThings() { console.log( 'doing things...' ); } const number = exports('number', 42); var setting = exports('setting', 'no'); }) }; })); rollup-3.29.4/test/form/samples/umd-noconflict-extend/_expected/umd.js000066400000000000000000000013141450520414700260060ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { var current = global.FooBar; var exports = global.FooBar = global.FooBar || {}; factory(exports); exports.noConflict = function () { global.FooBar = current; return exports; }; })()); })(this, (function (exports) { 'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; })); rollup-3.29.4/test/form/samples/umd-noconflict-extend/main.js000066400000000000000000000001711450520414700242050ustar00rootroot00000000000000export function doThings() { console.log( 'doing things...' ); } export const number = 42; export var setting = 'no'; rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/000077500000000000000000000000001450520414700235355ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/_config.js000066400000000000000000000003011450520414700254710ustar00rootroot00000000000000module.exports = defineTest({ description: 'exports noConflict method for default umd when requested', options: { output: { noConflict: true, name: 'my.name.spaced.module' } } }); rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/_expected/000077500000000000000000000000001450520414700254755ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/_expected/amd.js000066400000000000000000000003751450520414700266010ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; })); rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/_expected/cjs.js000066400000000000000000000003051450520414700266100ustar00rootroot00000000000000'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/_expected/es.js000066400000000000000000000002131450520414700264360ustar00rootroot00000000000000function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; export { doThings, number, setting }; rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/_expected/iife.js000066400000000000000000000006111450520414700267450ustar00rootroot00000000000000this.my = this.my || {}; this.my.name = this.my.name || {}; this.my.name.spaced = this.my.name.spaced || {}; this.my.name.spaced.module = (function (exports) { 'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; return exports; })({}); rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/_expected/system.js000066400000000000000000000005031450520414700273550ustar00rootroot00000000000000System.register('my.name.spaced.module', [], (function (exports) { 'use strict'; return { execute: (function () { exports('doThings', doThings); function doThings() { console.log( 'doing things...' ); } const number = exports('number', 42); var setting = exports('setting', 'no'); }) }; })); rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/_expected/umd.js000066400000000000000000000016331450520414700266230ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { var current = global.my && global.my.name && global.my.name.spaced && global.my.name.spaced.module; var exports = (global.my = global.my || {}, global.my.name = global.my.name || {}, global.my.name.spaced = global.my.name.spaced || {}, global.my.name.spaced.module = {}); factory(exports); exports.noConflict = function () { global.my.name.spaced.module = current; return exports; }; })()); })(this, (function (exports) { 'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; })); rollup-3.29.4/test/form/samples/umd-noconflict-namespaced/main.js000066400000000000000000000001711450520414700250160ustar00rootroot00000000000000export function doThings() { console.log( 'doing things...' ); } export const number = 42; export var setting = 'no'; rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/000077500000000000000000000000001450520414700235535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/_config.js000066400000000000000000000002531450520414700255150ustar00rootroot00000000000000module.exports = defineTest({ description: 'exports noConflict even when there are no exports', options: { output: { noConflict: true, name: 'FooBar' } } }); rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/_expected/000077500000000000000000000000001450520414700255135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/_expected/amd.js000066400000000000000000000001071450520414700266100ustar00rootroot00000000000000define((function () { 'use strict'; console.log('no exports'); })); rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/_expected/cjs.js000066400000000000000000000000521450520414700266250ustar00rootroot00000000000000'use strict'; console.log('no exports'); rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/_expected/es.js000066400000000000000000000000331450520414700264540ustar00rootroot00000000000000console.log('no exports'); rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/_expected/iife.js000066400000000000000000000001021450520414700267560ustar00rootroot00000000000000(function () { 'use strict'; console.log('no exports'); })(); rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/_expected/system.js000066400000000000000000000002161450520414700273740ustar00rootroot00000000000000System.register('FooBar', [], (function () { 'use strict'; return { execute: (function () { console.log('no exports'); }) }; })); rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/_expected/umd.js000066400000000000000000000010311450520414700266310ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { var current = global.FooBar; var exports = global.FooBar = {}; factory(exports); exports.noConflict = function () { global.FooBar = current; return exports; }; })()); })(this, (function (exports) { 'use strict'; console.log('no exports'); })); rollup-3.29.4/test/form/samples/umd-noconflict-no-exports/main.js000066400000000000000000000000331450520414700250310ustar00rootroot00000000000000console.log('no exports'); rollup-3.29.4/test/form/samples/umd-noconflict/000077500000000000000000000000001450520414700214375ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/umd-noconflict/_config.js000066400000000000000000000002621450520414700234010ustar00rootroot00000000000000module.exports = defineTest({ description: 'exports noConflict method for default umd when requested', options: { output: { noConflict: true, name: 'FooBar' } } }); rollup-3.29.4/test/form/samples/umd-noconflict/_expected/000077500000000000000000000000001450520414700233775ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/umd-noconflict/_expected/amd.js000066400000000000000000000003751450520414700245030ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; })); rollup-3.29.4/test/form/samples/umd-noconflict/_expected/cjs.js000066400000000000000000000003051450520414700245120ustar00rootroot00000000000000'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; rollup-3.29.4/test/form/samples/umd-noconflict/_expected/es.js000066400000000000000000000002131450520414700243400ustar00rootroot00000000000000function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; export { doThings, number, setting }; rollup-3.29.4/test/form/samples/umd-noconflict/_expected/iife.js000066400000000000000000000004141450520414700246500ustar00rootroot00000000000000var FooBar = (function (exports) { 'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; return exports; })({}); rollup-3.29.4/test/form/samples/umd-noconflict/_expected/system.js000066400000000000000000000004641450520414700252650ustar00rootroot00000000000000System.register('FooBar', [], (function (exports) { 'use strict'; return { execute: (function () { exports('doThings', doThings); function doThings() { console.log( 'doing things...' ); } const number = exports('number', 42); var setting = exports('setting', 'no'); }) }; })); rollup-3.29.4/test/form/samples/umd-noconflict/_expected/umd.js000066400000000000000000000012731450520414700245250ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { var current = global.FooBar; var exports = global.FooBar = {}; factory(exports); exports.noConflict = function () { global.FooBar = current; return exports; }; })()); })(this, (function (exports) { 'use strict'; function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; })); rollup-3.29.4/test/form/samples/umd-noconflict/main.js000066400000000000000000000001711450520414700227200ustar00rootroot00000000000000export function doThings() { console.log( 'doing things...' ); } export const number = 42; export var setting = 'no'; rollup-3.29.4/test/form/samples/unary-expressions/000077500000000000000000000000001450520414700222345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unary-expressions/_config.js000066400000000000000000000001301450520414700241700ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles unary expression side-effects' }); rollup-3.29.4/test/form/samples/unary-expressions/_expected.js000066400000000000000000000004421450520414700245320ustar00rootroot00000000000000if ((!true).unknown) { console.log('retained'); } else { console.log('retained'); } console.log('retained 1'); console.log('retained 2'); console.log('retained 3'); if (delete 1) console.log('retained 4'); console.log('retained 5'); console.log('retained 6'); console.log('retained 7'); rollup-3.29.4/test/form/samples/unary-expressions/main.js000066400000000000000000000006241450520414700235200ustar00rootroot00000000000000if ((!true).unknown) { console.log('retained'); } else { console.log('retained'); } if (!false) console.log('retained 1'); if (+'1' === 1) console.log('retained 2'); if (-1 + 2 === 1) console.log('retained 3'); if (delete 1) console.log('retained 4'); if (typeof 1 === 'number') console.log('retained 5'); if (void 1 === undefined) console.log('retained 6'); if (~1 === -2) console.log('retained 7'); rollup-3.29.4/test/form/samples/undefined-default-export/000077500000000000000000000000001450520414700234205ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/undefined-default-export/_config.js000066400000000000000000000001261450520414700253610ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles default exporting undefined' }); rollup-3.29.4/test/form/samples/undefined-default-export/_expected.js000066400000000000000000000000711450520414700257140ustar00rootroot00000000000000var dep = undefined; console.log(dep); export { dep }; rollup-3.29.4/test/form/samples/undefined-default-export/dep.js000066400000000000000000000000321450520414700245210ustar00rootroot00000000000000export default undefined; rollup-3.29.4/test/form/samples/undefined-default-export/main.js000066400000000000000000000000761450520414700247050ustar00rootroot00000000000000import dep from './dep.js'; console.log(dep); export { dep }; rollup-3.29.4/test/form/samples/undefined-var/000077500000000000000000000000001450520414700212455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/undefined-var/_config.js000066400000000000000000000001311450520414700232020ustar00rootroot00000000000000module.exports = defineTest({ description: 'treeshakes undefined variable literals' }); rollup-3.29.4/test/form/samples/undefined-var/_expected.js000066400000000000000000000002021450520414700235350ustar00rootroot00000000000000var z; console.log('retained'); console.log('retained'); if (z) console.log('retained'); else console.log('retained'); z = 1; rollup-3.29.4/test/form/samples/undefined-var/main.js000066400000000000000000000003441450520414700225300ustar00rootroot00000000000000var x; var y = undefined; var z; if (x) console.log('removed'); else console.log('retained'); if (y) console.log('removed'); else console.log('retained'); if (z) console.log('retained'); else console.log('retained'); z = 1; rollup-3.29.4/test/form/samples/unknown-token-effects/000077500000000000000000000000001450520414700227505ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unknown-token-effects/_config.js000066400000000000000000000007421450520414700247150ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not tree-shake unknown tokens', options: { acornInjectPlugins: Parser => class extends Parser { parseExprAtom(referenceDestructuringErrors) { if (this.type.keyword === 'do') { this.eat(this.type); const node = this.startNode(); node.body = this.parseBlock(); return this.finishNode(node, 'DoExpression'); } return super.parseExprAtom(referenceDestructuringErrors); } } } }); rollup-3.29.4/test/form/samples/unknown-token-effects/_expected.js000066400000000000000000000010351450520414700252450ustar00rootroot00000000000000(do { () => console.log('retained'); }()); (do { null; }.y); (do { ({ y: () => console.log('retained') }); }.y()); (do { ({ set y(value) { console.log(value); } }); }.y = 'retained'); const functionUsedInExpr = () => 1; const objectUsedInExpr = { value: 2 }; const valueUsedInExpr = 3; const exprValue = do { if (unknownCondition1) { functionUsedInExpr(); } else if (unknownCondition2) { objectUsedInExpr.value; } else if (unknownCondition3) { valueUsedInExpr; } else { 'direct value'; } }; export { exprValue }; rollup-3.29.4/test/form/samples/unknown-token-effects/main.js000066400000000000000000000010141450520414700242260ustar00rootroot00000000000000(do { () => console.log('retained'); }()); (do { null; }.y); (do { ({ y: () => console.log('retained') }); }.y()); (do { ({ set y(value) { console.log(value); } }); }.y = 'retained'); const functionUsedInExpr = () => 1; const objectUsedInExpr = { value: 2 }; const valueUsedInExpr = 3; export const exprValue = do { if (unknownCondition1) { functionUsedInExpr(); } else if (unknownCondition2) { objectUsedInExpr.value; } else if (unknownCondition3) { valueUsedInExpr; } else { 'direct value' } }; rollup-3.29.4/test/form/samples/unmodified-default-exports-function-argument/000077500000000000000000000000001450520414700274305ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unmodified-default-exports-function-argument/_config.js000066400000000000000000000001561450520414700313740ustar00rootroot00000000000000module.exports = defineTest({ description: 'passing unbound default export to function cannot rebind it' }); rollup-3.29.4/test/form/samples/unmodified-default-exports-function-argument/_expected.js000066400000000000000000000002211450520414700317210ustar00rootroot00000000000000var foo = function () { return 42; }; function bar () { return contrivedExample( foo ); } var answer = foo(); bar(); console.log( answer ); rollup-3.29.4/test/form/samples/unmodified-default-exports-function-argument/foo.js000066400000000000000000000001711450520414700305500ustar00rootroot00000000000000var foo = function () { return 42; }; export default foo; export function bar () { return contrivedExample( foo ); } rollup-3.29.4/test/form/samples/unmodified-default-exports-function-argument/main.js000066400000000000000000000001521450520414700307100ustar00rootroot00000000000000import foo, { bar } from './foo'; var answer = foo(); var somethingElse = bar(); console.log( answer ); rollup-3.29.4/test/form/samples/unmodified-default-exports/000077500000000000000000000000001450520414700237655ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unmodified-default-exports/_config.js000066400000000000000000000002061450520414700257250ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not treat property assignment as rebinding for sake of unbound default exports' }); rollup-3.29.4/test/form/samples/unmodified-default-exports/_expected.js000066400000000000000000000002271450520414700262640ustar00rootroot00000000000000var Foo = function () { console.log( 'side effect' ); this.isFoo = true; }; Foo.prototype = { answer: function () { return 42; } }; new Foo(); rollup-3.29.4/test/form/samples/unmodified-default-exports/foo.js000066400000000000000000000002401450520414700251020ustar00rootroot00000000000000var Foo = function () { console.log( 'side effect' ); this.isFoo = true; }; export default Foo; Foo.prototype = { answer: function () { return 42; } }; rollup-3.29.4/test/form/samples/unmodified-default-exports/main.js000066400000000000000000000000571450520414700252510ustar00rootroot00000000000000import Foo from './foo'; var foo = new Foo(); rollup-3.29.4/test/form/samples/unused-called-import/000077500000000000000000000000001450520414700225535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-called-import/_config.js000066400000000000000000000001401450520414700245100ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not include called-in-unused-code import' }); rollup-3.29.4/test/form/samples/unused-called-import/_expected/000077500000000000000000000000001450520414700245135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-called-import/_expected/amd.js000066400000000000000000000001551450520414700256130ustar00rootroot00000000000000define((function () { 'use strict'; function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); })); rollup-3.29.4/test/form/samples/unused-called-import/_expected/cjs.js000066400000000000000000000001171450520414700256270ustar00rootroot00000000000000'use strict'; function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); rollup-3.29.4/test/form/samples/unused-called-import/_expected/es.js000066400000000000000000000001001450520414700254470ustar00rootroot00000000000000function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); rollup-3.29.4/test/form/samples/unused-called-import/_expected/iife.js000066400000000000000000000001501450520414700257610ustar00rootroot00000000000000(function () { 'use strict'; function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); })(); rollup-3.29.4/test/form/samples/unused-called-import/_expected/system.js000066400000000000000000000002541450520414700263760ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); }) }; })); rollup-3.29.4/test/form/samples/unused-called-import/_expected/umd.js000066400000000000000000000003131450520414700256330ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); })); rollup-3.29.4/test/form/samples/unused-called-import/dead.js000066400000000000000000000000551450520414700240060ustar00rootroot00000000000000export default function() { return 'dead'; } rollup-3.29.4/test/form/samples/unused-called-import/foo.js000066400000000000000000000001761450520414700237000ustar00rootroot00000000000000import dead from './dead'; export default function() { return 'foo'; } export function foodead() { return 'foo' + dead(); } rollup-3.29.4/test/form/samples/unused-called-import/main.js000066400000000000000000000000671450520414700240400ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 'foo' ); rollup-3.29.4/test/form/samples/unused-called-with-side-effects/000077500000000000000000000000001450520414700245535ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-called-with-side-effects/_config.js000066400000000000000000000001401450520414700265100ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not include called-in-unused-code import' }); rollup-3.29.4/test/form/samples/unused-called-with-side-effects/_expected/000077500000000000000000000000001450520414700265135ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-called-with-side-effects/_expected/amd.js000066400000000000000000000001641450520414700276130ustar00rootroot00000000000000define((function () { 'use strict'; function foo() { return 'foo' } assert.equal( foo(), 'foo' ); })); rollup-3.29.4/test/form/samples/unused-called-with-side-effects/_expected/cjs.js000066400000000000000000000001201450520414700276210ustar00rootroot00000000000000'use strict'; function foo() { return 'foo' } assert.equal( foo(), 'foo' ); rollup-3.29.4/test/form/samples/unused-called-with-side-effects/_expected/es.js000066400000000000000000000001011450520414700274500ustar00rootroot00000000000000function foo() { return 'foo' } assert.equal( foo(), 'foo' ); rollup-3.29.4/test/form/samples/unused-called-with-side-effects/_expected/iife.js000066400000000000000000000001601450520414700277620ustar00rootroot00000000000000(function () { 'use strict'; function foo() { return 'foo' } assert.equal( foo(), 'foo' ); })(); rollup-3.29.4/test/form/samples/unused-called-with-side-effects/_expected/system.js000066400000000000000000000003061450520414700303740ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo() { return 'foo' } assert.equal( foo(), 'foo' ); }) }; })); rollup-3.29.4/test/form/samples/unused-called-with-side-effects/_expected/umd.js000066400000000000000000000003241450520414700276350ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo() { return 'foo' } assert.equal( foo(), 'foo' ); })); rollup-3.29.4/test/form/samples/unused-called-with-side-effects/main.js000066400000000000000000000002131450520414700260310ustar00rootroot00000000000000function foo() { return 'foo' } function bar() { dead(); } function dead() { console.log('dead'); } assert.equal( foo(), 'foo' ); rollup-3.29.4/test/form/samples/unused-default-exports/000077500000000000000000000000001450520414700231455ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-default-exports/_config.js000066400000000000000000000001431450520414700251050ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not name unused-but-included default export' }); rollup-3.29.4/test/form/samples/unused-default-exports/_expected/000077500000000000000000000000001450520414700251055ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-default-exports/_expected/amd.js000066400000000000000000000002641450520414700262060ustar00rootroot00000000000000define((function () { 'use strict'; var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); })); rollup-3.29.4/test/form/samples/unused-default-exports/_expected/cjs.js000066400000000000000000000002211450520414700262150ustar00rootroot00000000000000'use strict'; var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); rollup-3.29.4/test/form/samples/unused-default-exports/_expected/es.js000066400000000000000000000002021450520414700260440ustar00rootroot00000000000000var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); rollup-3.29.4/test/form/samples/unused-default-exports/_expected/iife.js000066400000000000000000000002571450520414700263630ustar00rootroot00000000000000(function () { 'use strict'; var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); })(); rollup-3.29.4/test/form/samples/unused-default-exports/_expected/system.js000066400000000000000000000003751450520414700267740ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); }) }; })); rollup-3.29.4/test/form/samples/unused-default-exports/_expected/umd.js000066400000000000000000000004221450520414700262260ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); })); rollup-3.29.4/test/form/samples/unused-default-exports/foo.js000066400000000000000000000001711450520414700242650ustar00rootroot00000000000000export var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } export default mutate( foo ); rollup-3.29.4/test/form/samples/unused-default-exports/main.js000066400000000000000000000000731450520414700244270ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo.value, 2 ); rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/000077500000000000000000000000001450520414700260675ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/_config.js000066400000000000000000000001501450520414700300250ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly remove unused function and class expressions' }); rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/_expected/000077500000000000000000000000001450520414700300275ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/_expected/amd.js000066400000000000000000000001371450520414700311270ustar00rootroot00000000000000define((function () { 'use strict'; function foo() { console.log("foo"); } foo(); })); rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/_expected/cjs.js000066400000000000000000000000771450520414700311500ustar00rootroot00000000000000'use strict'; function foo() { console.log("foo"); } foo(); rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/_expected/es.js000066400000000000000000000000601450520414700307700ustar00rootroot00000000000000function foo() { console.log("foo"); } foo(); rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/_expected/iife.js000066400000000000000000000001321450520414700312750ustar00rootroot00000000000000(function () { 'use strict'; function foo() { console.log("foo"); } foo(); })(); rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/_expected/system.js000066400000000000000000000002421450520414700317070ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo() { console.log("foo"); } foo(); }) }; })); rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/_expected/umd.js000066400000000000000000000002751450520414700311560ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo() { console.log("foo"); } foo(); })); rollup-3.29.4/test/form/samples/unused-function-and-class-expressions/main.js000066400000000000000000000006611450520414700273540ustar00rootroot00000000000000(function UnusedFunctionExpression() {}); (class UnusedClassExpression {}); var UnusedClassExpression = class UnusedClassExpression {}; var unusedVar; let unusedLet; const unusedConst = 1; function foo() { (function UnusedFunctionExpression() {}); (class UnusedClassExpression {}); var UnusedClassExpression = class UnusedClassExpression {}; var unusedVar; let unusedLet; const unusedConst = 1; console.log("foo"); } foo(); rollup-3.29.4/test/form/samples/unused-import/000077500000000000000000000000001450520414700213315ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-import/_config.js000066400000000000000000000002621450520414700232730ustar00rootroot00000000000000module.exports = defineTest({ description: 'excludes unused imports ([#595])', options: { external: ['external'], output: { globals: { external: 'external' } } } }); rollup-3.29.4/test/form/samples/unused-import/_expected/000077500000000000000000000000001450520414700232715ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-import/_expected/amd.js000066400000000000000000000001021450520414700243610ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; })); rollup-3.29.4/test/form/samples/unused-import/_expected/cjs.js000066400000000000000000000000451450520414700244050ustar00rootroot00000000000000'use strict'; require('external'); rollup-3.29.4/test/form/samples/unused-import/_expected/es.js000066400000000000000000000000231450520414700242310ustar00rootroot00000000000000import 'external'; rollup-3.29.4/test/form/samples/unused-import/_expected/iife.js000066400000000000000000000000471450520414700245440ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-3.29.4/test/form/samples/unused-import/_expected/system.js000066400000000000000000000002041450520414700251470ustar00rootroot00000000000000System.register(['external'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-3.29.4/test/form/samples/unused-import/_expected/umd.js000066400000000000000000000002301450520414700244070ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['external'], factory) : factory(); })((function () { 'use strict'; })); rollup-3.29.4/test/form/samples/unused-import/main.js000066400000000000000000000000721450520414700226120ustar00rootroot00000000000000import 'external'; function alsoUnused () { unused(); } rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/000077500000000000000000000000001450520414700253335ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/_config.js000066400000000000000000000001461450520414700272760ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not include unused inner functions and classes' }); rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/_expected/000077500000000000000000000000001450520414700272735ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/_expected/amd.js000066400000000000000000000006411450520414700303730ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log("outer bar"); } function Baz() { function bar () { console.log("inner bar"); } function bog () { console.log("inner bog"); } return bar(), bog; } bar(); var f = Baz(); f(); function getClass () { class MyClass {} return MyClass; } console.log( getClass().name ); })); rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/_expected/cjs.js000066400000000000000000000005151450520414700304110ustar00rootroot00000000000000'use strict'; function bar () { console.log("outer bar"); } function Baz() { function bar () { console.log("inner bar"); } function bog () { console.log("inner bog"); } return bar(), bog; } bar(); var f = Baz(); f(); function getClass () { class MyClass {} return MyClass; } console.log( getClass().name ); rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/_expected/es.js000066400000000000000000000004761450520414700302470ustar00rootroot00000000000000function bar () { console.log("outer bar"); } function Baz() { function bar () { console.log("inner bar"); } function bog () { console.log("inner bog"); } return bar(), bog; } bar(); var f = Baz(); f(); function getClass () { class MyClass {} return MyClass; } console.log( getClass().name ); rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/_expected/iife.js000066400000000000000000000006371450520414700305530ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log("outer bar"); } function Baz() { function bar () { console.log("inner bar"); } function bog () { console.log("inner bog"); } return bar(), bog; } bar(); var f = Baz(); f(); function getClass () { class MyClass {} return MyClass; } console.log( getClass().name ); })(); rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/_expected/system.js000066400000000000000000000011411450520414700311520ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log("outer bar"); } function Baz() { function bar () { console.log("inner bar"); } function bog () { console.log("inner bog"); } return bar(), bog; } bar(); var f = Baz(); f(); function getClass () { class MyClass {} return MyClass; } console.log( getClass().name ); }) }; })); rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/_expected/umd.js000066400000000000000000000010051450520414700304120ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log("outer bar"); } function Baz() { function bar () { console.log("inner bar"); } function bog () { console.log("inner bog"); } return bar(), bog; } bar(); var f = Baz(); f(); function getClass () { class MyClass {} return MyClass; } console.log( getClass().name ); })); rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/main.js000066400000000000000000000004101450520414700266100ustar00rootroot00000000000000import { foo, bar, bog, boo, baz } from './stuff'; bar(); var f = baz(); f(); function getClass () { class MyClass {} class UnusedInnerClass1 {} return MyClass; class UnusedInnerClass2 {} } class UnusedClass {} console.log( getClass().name ); rollup-3.29.4/test/form/samples/unused-inner-functions-and-classes/stuff.js000066400000000000000000000007401450520414700270210ustar00rootroot00000000000000export function foo () { console.log("outer foo"); } export function bar () { console.log("outer bar"); } export function bog () { console.log("outer bog"); } export function boo () { console.log("outer boo"); } function Baz() { function foo () { console.log("inner foo"); } function bar () { console.log("inner bar"); } function bog () { console.log("inner bog"); } function boo () { console.log("inner boo"); } return bar(), bog; } export { Baz as baz }; rollup-3.29.4/test/form/samples/unused-var/000077500000000000000000000000001450520414700206075ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-var/_config.js000066400000000000000000000001171450520414700225500ustar00rootroot00000000000000module.exports = defineTest({ description: 'omits unused var declaration' }); rollup-3.29.4/test/form/samples/unused-var/_expected/000077500000000000000000000000001450520414700225475ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/unused-var/_expected/amd.js000066400000000000000000000001231450520414700236420ustar00rootroot00000000000000define((function () { 'use strict'; var foo = 'lol'; console.log( foo ); })); rollup-3.29.4/test/form/samples/unused-var/_expected/cjs.js000066400000000000000000000000651450520414700236650ustar00rootroot00000000000000'use strict'; var foo = 'lol'; console.log( foo ); rollup-3.29.4/test/form/samples/unused-var/_expected/es.js000066400000000000000000000000461450520414700235140ustar00rootroot00000000000000var foo = 'lol'; console.log( foo ); rollup-3.29.4/test/form/samples/unused-var/_expected/iife.js000066400000000000000000000001161450520414700240170ustar00rootroot00000000000000(function () { 'use strict'; var foo = 'lol'; console.log( foo ); })(); rollup-3.29.4/test/form/samples/unused-var/_expected/system.js000066400000000000000000000002221450520414700244250ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = 'lol'; console.log( foo ); }) }; })); rollup-3.29.4/test/form/samples/unused-var/_expected/umd.js000066400000000000000000000002611450520414700236710ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = 'lol'; console.log( foo ); })); rollup-3.29.4/test/form/samples/unused-var/foo.js000066400000000000000000000001121450520414700217220ustar00rootroot00000000000000var foo = 'lol'; var bar = 'wut'; var baz = bar || foo; export { foo }; rollup-3.29.4/test/form/samples/unused-var/main.js000066400000000000000000000000641450520414700220710ustar00rootroot00000000000000import { foo } from './foo.js'; console.log( foo ); rollup-3.29.4/test/form/samples/update-expression-side-effects/000077500000000000000000000000001450520414700245345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/update-expression-side-effects/_config.js000066400000000000000000000001531450520414700264750ustar00rootroot00000000000000module.exports = defineTest({ description: 'detect side-effects when dealing with update expressions' }); rollup-3.29.4/test/form/samples/update-expression-side-effects/_expected/000077500000000000000000000000001450520414700264745ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/update-expression-side-effects/_expected/amd.js000066400000000000000000000003051450520414700275710ustar00rootroot00000000000000define((function () { 'use strict'; const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; })); rollup-3.29.4/test/form/samples/update-expression-side-effects/_expected/cjs.js000066400000000000000000000002401450520414700276050ustar00rootroot00000000000000'use strict'; const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; rollup-3.29.4/test/form/samples/update-expression-side-effects/_expected/es.js000066400000000000000000000002211450520414700274340ustar00rootroot00000000000000const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; rollup-3.29.4/test/form/samples/update-expression-side-effects/_expected/iife.js000066400000000000000000000003001450520414700277370ustar00rootroot00000000000000(function () { 'use strict'; const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; })(); rollup-3.29.4/test/form/samples/update-expression-side-effects/_expected/system.js000066400000000000000000000004221450520414700303540ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; }) }; })); rollup-3.29.4/test/form/samples/update-expression-side-effects/_expected/umd.js000066400000000000000000000004431450520414700276200ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; })); rollup-3.29.4/test/form/samples/update-expression-side-effects/main.js000066400000000000000000000002211450520414700260110ustar00rootroot00000000000000const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; rollup-3.29.4/test/form/samples/updating-assignments/000077500000000000000000000000001450520414700226625ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/updating-assignments/_config.js000066400000000000000000000002161450520414700246230ustar00rootroot00000000000000module.exports = defineTest({ description: 'Correctly handles assignment operators on exports', options: { output: { name: 'bundle' } } }); rollup-3.29.4/test/form/samples/updating-assignments/_expected/000077500000000000000000000000001450520414700246225ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/updating-assignments/_expected/amd.js000066400000000000000000000004601450520414700257210ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; exports.x = 1; exports.x = 2; exports.x += 1; exports.x -= 1; exports.x *= 2; exports.x /= 2; exports.x %= 2; exports.x **= 2; exports.x <<= 1; exports.x >>= 1; exports.x >>>= 1; exports.x &= 3; exports.x ^= 2; exports.x |= 2; })); rollup-3.29.4/test/form/samples/updating-assignments/_expected/cjs.js000066400000000000000000000003621450520414700257400ustar00rootroot00000000000000'use strict'; exports.x = 1; exports.x = 2; exports.x += 1; exports.x -= 1; exports.x *= 2; exports.x /= 2; exports.x %= 2; exports.x **= 2; exports.x <<= 1; exports.x >>= 1; exports.x >>>= 1; exports.x &= 3; exports.x ^= 2; exports.x |= 2; rollup-3.29.4/test/form/samples/updating-assignments/_expected/es.js000066400000000000000000000002061450520414700255650ustar00rootroot00000000000000let x = 1; x = 2; x += 1; x -= 1; x *= 2; x /= 2; x %= 2; x **= 2; x <<= 1; x >>= 1; x >>>= 1; x &= 3; x ^= 2; x |= 2; export { x }; rollup-3.29.4/test/form/samples/updating-assignments/_expected/iife.js000066400000000000000000000004771450520414700261040ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; exports.x = 1; exports.x = 2; exports.x += 1; exports.x -= 1; exports.x *= 2; exports.x /= 2; exports.x %= 2; exports.x **= 2; exports.x <<= 1; exports.x >>= 1; exports.x >>>= 1; exports.x &= 3; exports.x ^= 2; exports.x |= 2; return exports; })({}); rollup-3.29.4/test/form/samples/updating-assignments/_expected/system.js000066400000000000000000000007341450520414700265100ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { let x = exports('x', 1); exports('x', x = 2); exports('x', x += 1); exports('x', x -= 1); exports('x', x *= 2); exports('x', x /= 2); exports('x', x %= 2); exports('x', x **= 2); exports('x', x <<= 1); exports('x', x >>= 1); exports('x', x >>>= 1); exports('x', x &= 3); exports('x', x ^= 2); exports('x', x |= 2); }) }; })); rollup-3.29.4/test/form/samples/updating-assignments/_expected/umd.js000066400000000000000000000011151450520414700257430ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); })(this, (function (exports) { 'use strict'; exports.x = 1; exports.x = 2; exports.x += 1; exports.x -= 1; exports.x *= 2; exports.x /= 2; exports.x %= 2; exports.x **= 2; exports.x <<= 1; exports.x >>= 1; exports.x >>>= 1; exports.x &= 3; exports.x ^= 2; exports.x |= 2; })); rollup-3.29.4/test/form/samples/updating-assignments/main.js000066400000000000000000000001761450520414700241500ustar00rootroot00000000000000export let x = 1; x = 2; x += 1; x -= 1; x *= 2; x /= 2; x %= 2; x **= 2; x <<= 1; x >>= 1; x >>>= 1; x &= 3; x ^= 2; x |= 2; rollup-3.29.4/test/form/samples/url-external/000077500000000000000000000000001450520414700211405ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/url-external/_config.js000066400000000000000000000003321450520414700231000ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports URL externals', options: { external: ['https://external.com/external.js'], output: { globals: { 'https://external.com/external.js': 'external' } } } }); rollup-3.29.4/test/form/samples/url-external/_expected/000077500000000000000000000000001450520414700231005ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/url-external/_expected/amd.js000066400000000000000000000001611450520414700241750ustar00rootroot00000000000000define(['https://external.com/external.js'], (function (external) { 'use strict'; console.log(external); })); rollup-3.29.4/test/form/samples/url-external/_expected/cjs.js000066400000000000000000000001431450520414700242130ustar00rootroot00000000000000'use strict'; var external = require('https://external.com/external.js'); console.log(external); rollup-3.29.4/test/form/samples/url-external/_expected/es.js000066400000000000000000000001211450520414700240370ustar00rootroot00000000000000import external from 'https://external.com/external.js'; console.log(external); rollup-3.29.4/test/form/samples/url-external/_expected/iife.js000066400000000000000000000001161450520414700243500ustar00rootroot00000000000000(function (external) { 'use strict'; console.log(external); })(external); rollup-3.29.4/test/form/samples/url-external/_expected/system.js000066400000000000000000000003651450520414700247660ustar00rootroot00000000000000System.register(['https://external.com/external.js'], (function () { 'use strict'; var external; return { setters: [function (module) { external = module.default; }], execute: (function () { console.log(external); }) }; })); rollup-3.29.4/test/form/samples/url-external/_expected/umd.js000066400000000000000000000006571450520414700242330ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('https://external.com/external.js')) : typeof define === 'function' && define.amd ? define(['https://external.com/external.js'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.external)); })(this, (function (external) { 'use strict'; console.log(external); })); rollup-3.29.4/test/form/samples/url-external/main.js000066400000000000000000000001201450520414700224130ustar00rootroot00000000000000import external from 'https://external.com/external.js'; console.log(external);rollup-3.29.4/test/form/samples/use-class-name-in-static-block/000077500000000000000000000000001450520414700243145ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/use-class-name-in-static-block/_config.js000066400000000000000000000001621450520414700262550ustar00rootroot00000000000000module.exports = defineTest({ description: 'use the original class name instead of renderName in class body' }); rollup-3.29.4/test/form/samples/use-class-name-in-static-block/_expected/000077500000000000000000000000001450520414700262545ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/use-class-name-in-static-block/_expected/amd.js000066400000000000000000000010251450520414700273510ustar00rootroot00000000000000define((function () { 'use strict'; let Test$1 = class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test1'; static { assert.ok(Test.test); new Test(); } }; class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test2'; static { assert.ok(Test.test); new Test(); } } assert.ok(Test$1.test); assert.ok(Test.test); })); rollup-3.29.4/test/form/samples/use-class-name-in-static-block/_expected/cjs.js000066400000000000000000000007331450520414700273740ustar00rootroot00000000000000'use strict'; let Test$1 = class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test1'; static { assert.ok(Test.test); new Test(); } }; class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test2'; static { assert.ok(Test.test); new Test(); } } assert.ok(Test$1.test); assert.ok(Test.test); rollup-3.29.4/test/form/samples/use-class-name-in-static-block/_expected/es.js000066400000000000000000000007141450520414700272230ustar00rootroot00000000000000let Test$1 = class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test1'; static { assert.ok(Test.test); new Test(); } }; class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test2'; static { assert.ok(Test.test); new Test(); } } assert.ok(Test$1.test); assert.ok(Test.test); rollup-3.29.4/test/form/samples/use-class-name-in-static-block/_expected/iife.js000066400000000000000000000010201450520414700275170ustar00rootroot00000000000000(function () { 'use strict'; let Test$1 = class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test1'; static { assert.ok(Test.test); new Test(); } }; class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test2'; static { assert.ok(Test.test); new Test(); } } assert.ok(Test$1.test); assert.ok(Test.test); })(); rollup-3.29.4/test/form/samples/use-class-name-in-static-block/_expected/system.js000066400000000000000000000012141450520414700301340ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { let Test$1 = class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test1'; static { assert.ok(Test.test); new Test(); } }; class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test2'; static { assert.ok(Test.test); new Test(); } } assert.ok(Test$1.test); assert.ok(Test.test); }) }; })); rollup-3.29.4/test/form/samples/use-class-name-in-static-block/_expected/umd.js000066400000000000000000000011631450520414700274000ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; let Test$1 = class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test1'; static { assert.ok(Test.test); new Test(); } }; class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test2'; static { assert.ok(Test.test); new Test(); } } assert.ok(Test$1.test); assert.ok(Test.test); })); rollup-3.29.4/test/form/samples/use-class-name-in-static-block/main.js000066400000000000000000000001751450520414700256010ustar00rootroot00000000000000import { Test } from './test1.js'; import { Test as Test2 } from './test2.js'; assert.ok(Test.test); assert.ok(Test2.test); rollup-3.29.4/test/form/samples/use-class-name-in-static-block/test1.js000066400000000000000000000003161450520414700257120ustar00rootroot00000000000000export class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test1'; static { assert.ok(Test.test); new Test(); } } rollup-3.29.4/test/form/samples/use-class-name-in-static-block/test2.js000066400000000000000000000003161450520414700257130ustar00rootroot00000000000000export class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test2'; static { assert.ok(Test.test); new Test(); } } rollup-3.29.4/test/form/samples/use-global-map-for-export-name/000077500000000000000000000000001450520414700243445ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/use-global-map-for-export-name/_config.js000066400000000000000000000003061450520414700263050ustar00rootroot00000000000000module.exports = defineTest({ description: 'applies globals to output name', options: { output: { name: 'leaflet.terminator', globals: { leaflet: 'L' } }, external: ['leaflet'] } }); rollup-3.29.4/test/form/samples/use-global-map-for-export-name/_expected/000077500000000000000000000000001450520414700263045ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/use-global-map-for-export-name/_expected/amd.js000066400000000000000000000001411450520414700273770ustar00rootroot00000000000000define(['leaflet'], (function (L) { 'use strict'; L.terminator = function(options) { }; })); rollup-3.29.4/test/form/samples/use-global-map-for-export-name/_expected/cjs.js000066400000000000000000000001221450520414700274140ustar00rootroot00000000000000'use strict'; var L = require('leaflet'); L.terminator = function(options) { }; rollup-3.29.4/test/form/samples/use-global-map-for-export-name/_expected/es.js000066400000000000000000000001001450520414700272400ustar00rootroot00000000000000import L from 'leaflet'; L.terminator = function(options) { }; rollup-3.29.4/test/form/samples/use-global-map-for-export-name/_expected/iife.js000066400000000000000000000001201450520414700275470ustar00rootroot00000000000000(function (L) { 'use strict'; L.terminator = function(options) { }; })(L); rollup-3.29.4/test/form/samples/use-global-map-for-export-name/_expected/system.js000066400000000000000000000003661450520414700301730ustar00rootroot00000000000000System.register('leaflet.terminator', ['leaflet'], (function () { 'use strict'; var L; return { setters: [function (module) { L = module.default; }], execute: (function () { L.terminator = function(options) { }; }) }; })); rollup-3.29.4/test/form/samples/use-global-map-for-export-name/_expected/umd.js000066400000000000000000000005771450520414700274400ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('leaflet')) : typeof define === 'function' && define.amd ? define(['leaflet'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.L)); })(this, (function (L) { 'use strict'; L.terminator = function(options) { }; })); rollup-3.29.4/test/form/samples/use-global-map-for-export-name/main.js000066400000000000000000000001001450520414700256150ustar00rootroot00000000000000import L from 'leaflet'; L.terminator = function(options) { }; rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/000077500000000000000000000000001450520414700275345ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/_config.js000066400000000000000000000001741450520414700315000ustar00rootroot00000000000000module.exports = defineTest({ description: 'whitespace around the "." in member expressions does not mess up renaming' }); rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/_expected/000077500000000000000000000000001450520414700314745ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/_expected/amd.js000066400000000000000000000001401450520414700325660ustar00rootroot00000000000000define((function () { 'use strict'; function yar() { console.log('yar?'); } yar(); })); rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/_expected/cjs.js000066400000000000000000000001001450520414700326000ustar00rootroot00000000000000'use strict'; function yar() { console.log('yar?'); } yar(); rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/_expected/es.js000066400000000000000000000000611450520414700324360ustar00rootroot00000000000000function yar() { console.log('yar?'); } yar(); rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/_expected/iife.js000066400000000000000000000001331450520414700327430ustar00rootroot00000000000000(function () { 'use strict'; function yar() { console.log('yar?'); } yar(); })(); rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/_expected/system.js000066400000000000000000000002431450520414700333550ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function yar() { console.log('yar?'); } yar(); }) }; })); rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/_expected/umd.js000066400000000000000000000002761450520414700326240ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function yar() { console.log('yar?'); } yar(); })); rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/foo.js000066400000000000000000000000601450520414700306510ustar00rootroot00000000000000export function yar() { console.log('yar?'); } rollup-3.29.4/test/form/samples/whitespace-around-namespace-member-expression/main.js000066400000000000000000000000551450520414700310160ustar00rootroot00000000000000import * as foo from './foo.js'; foo .yar(); rollup-3.29.4/test/form/samples/wrap-simplified-expressions/000077500000000000000000000000001450520414700241725ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/wrap-simplified-expressions/_config.js000066400000000000000000000001651450520414700261360ustar00rootroot00000000000000module.exports = defineTest({ description: 'wraps simplified expressions that have become callees if necessary' }); rollup-3.29.4/test/form/samples/wrap-simplified-expressions/_expected/000077500000000000000000000000001450520414700261325ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/wrap-simplified-expressions/_expected/amd.js000066400000000000000000000011521450520414700272300ustar00rootroot00000000000000define((function () { 'use strict'; const wrapper = { foo() { console.log(this); } }; // Indirectly called member expressions set the callee's context to global "this" (0, wrapper.foo)(); (0, wrapper.foo )(); (0, wrapper.foo)(); ((0, wrapper.foo))(); ((0, wrapper.foo ))(); ((0, wrapper.foo))(); // Only callees of call expressions should be wrapped console.log(wrapper.foo); // Indirectly invoked eval is executed in the global scope function testEval() { console.log((0, eval)('this')); console.log((0, eval )('this')); console.log((0, eval)('this')); } testEval.call('test'); })); rollup-3.29.4/test/form/samples/wrap-simplified-expressions/_expected/cjs.js000066400000000000000000000010711450520414700272460ustar00rootroot00000000000000'use strict'; const wrapper = { foo() { console.log(this); } }; // Indirectly called member expressions set the callee's context to global "this" (0, wrapper.foo)(); (0, wrapper.foo )(); (0, wrapper.foo)(); ((0, wrapper.foo))(); ((0, wrapper.foo ))(); ((0, wrapper.foo))(); // Only callees of call expressions should be wrapped console.log(wrapper.foo); // Indirectly invoked eval is executed in the global scope function testEval() { console.log((0, eval)('this')); console.log((0, eval )('this')); console.log((0, eval)('this')); } testEval.call('test'); rollup-3.29.4/test/form/samples/wrap-simplified-expressions/_expected/es.js000066400000000000000000000010521450520414700270750ustar00rootroot00000000000000const wrapper = { foo() { console.log(this); } }; // Indirectly called member expressions set the callee's context to global "this" (0, wrapper.foo)(); (0, wrapper.foo )(); (0, wrapper.foo)(); ((0, wrapper.foo))(); ((0, wrapper.foo ))(); ((0, wrapper.foo))(); // Only callees of call expressions should be wrapped console.log(wrapper.foo); // Indirectly invoked eval is executed in the global scope function testEval() { console.log((0, eval)('this')); console.log((0, eval )('this')); console.log((0, eval)('this')); } testEval.call('test'); rollup-3.29.4/test/form/samples/wrap-simplified-expressions/_expected/iife.js000066400000000000000000000011451450520414700274050ustar00rootroot00000000000000(function () { 'use strict'; const wrapper = { foo() { console.log(this); } }; // Indirectly called member expressions set the callee's context to global "this" (0, wrapper.foo)(); (0, wrapper.foo )(); (0, wrapper.foo)(); ((0, wrapper.foo))(); ((0, wrapper.foo ))(); ((0, wrapper.foo))(); // Only callees of call expressions should be wrapped console.log(wrapper.foo); // Indirectly invoked eval is executed in the global scope function testEval() { console.log((0, eval)('this')); console.log((0, eval )('this')); console.log((0, eval)('this')); } testEval.call('test'); })(); rollup-3.29.4/test/form/samples/wrap-simplified-expressions/_expected/system.js000066400000000000000000000013171450520414700300160ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const wrapper = { foo() { console.log(this); } }; // Indirectly called member expressions set the callee's context to global "this" (0, wrapper.foo)(); (0, wrapper.foo )(); (0, wrapper.foo)(); ((0, wrapper.foo))(); ((0, wrapper.foo ))(); ((0, wrapper.foo))(); // Only callees of call expressions should be wrapped console.log(wrapper.foo); // Indirectly invoked eval is executed in the global scope function testEval() { console.log((0, eval)('this')); console.log((0, eval )('this')); console.log((0, eval)('this')); } testEval.call('test'); }) }; })); rollup-3.29.4/test/form/samples/wrap-simplified-expressions/_expected/umd.js000066400000000000000000000013101450520414700272500ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const wrapper = { foo() { console.log(this); } }; // Indirectly called member expressions set the callee's context to global "this" (0, wrapper.foo)(); (0, wrapper.foo )(); (0, wrapper.foo)(); ((0, wrapper.foo))(); ((0, wrapper.foo ))(); ((0, wrapper.foo))(); // Only callees of call expressions should be wrapped console.log(wrapper.foo); // Indirectly invoked eval is executed in the global scope function testEval() { console.log((0, eval)('this')); console.log((0, eval )('this')); console.log((0, eval)('this')); } testEval.call('test'); })); rollup-3.29.4/test/form/samples/wrap-simplified-expressions/main.js000066400000000000000000000012001450520414700254450ustar00rootroot00000000000000const wrapper = { foo() { console.log(this); } }; // Indirectly called member expressions set the callee's context to global "this" (true && wrapper.foo)(); (true ? wrapper.foo : null)(); (1, 2, wrapper.foo)(); (true && (true && wrapper.foo))(); (true && (true ? wrapper.foo : null))(); (true && (1, 2, wrapper.foo))(); // Only callees of call expressions should be wrapped console.log(true && wrapper.foo); // Indirectly invoked eval is executed in the global scope function testEval() { console.log((true && eval)('this')); console.log((true ? eval : null)('this')); console.log((1, 2, eval)('this')); } testEval.call('test'); rollup-3.29.4/test/form/samples/yield-expression/000077500000000000000000000000001450520414700220215ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/yield-expression/missing-space/000077500000000000000000000000001450520414700245635ustar00rootroot00000000000000rollup-3.29.4/test/form/samples/yield-expression/missing-space/_config.js000066400000000000000000000001601450520414700265220ustar00rootroot00000000000000module.exports = defineTest({ description: 'Inserts space when simplifying yield expression without space' }); rollup-3.29.4/test/form/samples/yield-expression/missing-space/_expected.js000066400000000000000000000001201450520414700270520ustar00rootroot00000000000000function* test() { yield null; } for (const x of test()) { console.log(x); } rollup-3.29.4/test/form/samples/yield-expression/missing-space/main.js000066400000000000000000000001231450520414700260410ustar00rootroot00000000000000function* test() { yield!1||null; } for (const x of test()) { console.log(x); } rollup-3.29.4/test/form/tsconfig.json000066400000000000000000000001701450520414700175570ustar00rootroot00000000000000{ "extends": "../tsconfig.base.json", "include": [ "**/_config.js", "./index.js", "./define.d.ts" ] } rollup-3.29.4/test/function/000077500000000000000000000000001450520414700157345ustar00rootroot00000000000000rollup-3.29.4/test/function/define.d.ts000066400000000000000000000002161450520414700177570ustar00rootroot00000000000000import type { TestConfigFunction } from '../types'; declare global { function defineTest(config: TestConfigFunction): TestConfigFunction; } rollup-3.29.4/test/function/index.js000066400000000000000000000134371450520414700174110ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); /** * @type {import('../../src/rollup/types')} Rollup */ // @ts-expect-error not included in types const rollup = require('../../dist/rollup'); const { compareError, compareLogs, runTestSuiteWithSamples } = require('../utils.js'); function requireWithContext(code, context, exports) { const module = { exports }; const contextWithExports = { ...context, module, exports }; const contextKeys = Object.keys(contextWithExports); const contextValues = contextKeys.map(key => contextWithExports[key]); try { const function_ = new Function(contextKeys, code); function_.apply({}, contextValues); } catch (error) { error.exports = module.exports; throw error; } return contextWithExports.module.exports; } function runCodeSplitTest(codeMap, entryId, configContext) { const exportsMap = Object.create(null); const requireFromOutputVia = importer => importee => { const outputId = path.posix.join(path.posix.dirname(importer), importee); if (outputId in exportsMap) { return exportsMap[outputId]; } const code = codeMap[outputId]; return code === undefined ? require(importee) : (exportsMap[outputId] = requireWithContext( code, { require: requireFromOutputVia(outputId), ...context }, (exportsMap[outputId] = {}) )); }; const context = { assert, ...configContext }; let exports; try { exports = requireFromOutputVia(entryId)(entryId); } catch (error) { return { error, exports: error.exports }; } return { exports }; } runTestSuiteWithSamples( 'function', path.join(__dirname, 'samples'), /** * @param {import('../types').TestConfigFunction} config */ (directory, config) => { (config.skip ? it.skip : config.solo ? it.only : it)( path.basename(directory) + ': ' + config.description, async () => { if (config.show) console.group(path.basename(directory)); if (config.before) { await config.before(); } process.chdir(directory); const logs = []; const warnings = []; return rollup .rollup({ input: path.join(directory, 'main.js'), onLog: (level, log) => { logs.push({ level, ...log }); if (level === 'warn') { warnings.push(log); } }, strictDeprecations: true, ...config.options }) .then(bundle => { let unintendedError; if (config.error) { throw new Error('Expected an error while rolling up'); } let result; return bundle .generate({ exports: 'auto', format: 'cjs', ...(config.options || {}).output }) .then(({ output }) => { if (config.generateError) { unintendedError = new Error('Expected an error while generating output'); } result = output; }) .catch(error => { if (config.generateError) { compareError(error, config.generateError); } else { throw error; } }) .then(() => { if (unintendedError) throw unintendedError; if (config.error || config.generateError) return; const codeMap = result.reduce((codeMap, chunk) => { codeMap[chunk.fileName] = chunk.code; return codeMap; }, {}); if (config.code) { config.code(result.length === 1 ? result[0].code : codeMap); } const entryId = result.length === 1 ? result[0].fileName : 'main.js'; if (!codeMap.hasOwnProperty(entryId)) { throw new Error( `Could not find entry "${entryId}" in generated output.\nChunks:\n${Object.keys( codeMap ).join('\n')}` ); } const { exports, error } = runCodeSplitTest(codeMap, entryId, config.context); if (config.runtimeError) { if (error) { config.runtimeError(error); } else { unintendedError = new Error('Expected an error while executing output'); } } else if (error) { unintendedError = error; } return Promise.resolve() .then(() => { if (config.exports && !unintendedError) { return config.exports(exports); } }) .then(() => { if (config.bundle && !unintendedError) { return config.bundle(bundle); } }) .catch(error_ => { if (config.runtimeError) { config.runtimeError(error_); } else { unintendedError = error_; } }) .then(() => { if (config.show || unintendedError) { for (const chunk of result) { console.group(chunk.fileName); console.log(chunk.code); console.groupEnd(); console.log(); } } if (config.logs) { if (config.warnings) { throw new Error('Cannot use both "logs" and "warnings" in a test'); } compareLogs(logs, config.logs); } else if (config.warnings) { if (Array.isArray(config.warnings)) { compareLogs(warnings, config.warnings); } else { config.warnings(warnings); } } else if (warnings.length > 0) { throw new Error( `Got unexpected warnings:\n${warnings .map(warning => warning.message) .join('\n')}` ); } if (config.show) console.groupEnd(); if (unintendedError) throw unintendedError; if (config.after) { return config.after(); } }); }); }) .catch(error => { if (config.error) { compareError(error, config.error); } else { throw error; } if (config.after) { return config.after(); } }); } ); } ); rollup-3.29.4/test/function/samples/000077500000000000000000000000001450520414700174005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/access-instance-prop/000077500000000000000000000000001450520414700234215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/access-instance-prop/_config.js000066400000000000000000000001541450520414700253630ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects getters when accessing properties of an instance' }); rollup-3.29.4/test/function/samples/access-instance-prop/main.js000066400000000000000000000002021450520414700246750ustar00rootroot00000000000000let effect = false; var b = { get a() { effect = true; } }; function X() {} X.prototype = b; new X().a; assert.ok(effect); rollup-3.29.4/test/function/samples/add-watch-file-generate/000077500000000000000000000000001450520414700237415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/add-watch-file-generate/_config.js000066400000000000000000000007331450520414700257060ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'throws when adding watch files during generate', options: { plugins: { name: 'test-plugin', renderStart() { this.addWatchFile(path.join(__dirname, 'watched.js')); } } }, generateError: { code: 'PLUGIN_ERROR', hook: 'renderStart', message: 'Cannot call "addWatchFile" after the build has finished.', plugin: 'test-plugin', pluginCode: 'INVALID_ROLLUP_PHASE' } }); rollup-3.29.4/test/function/samples/add-watch-file-generate/main.js000066400000000000000000000000411450520414700252160ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/add-watch-file-generate/watched.js000066400000000000000000000000001450520414700257040ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/adds-json-hint-for-missing-export-if-is-json-file/000077500000000000000000000000001450520414700306655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/adds-json-hint-for-missing-export-if-is-json-file/_config.js000066400000000000000000000014271450520414700326330ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_ARRAY_JSON = path.join(__dirname, 'array.json'); module.exports = defineTest({ description: 'should provide json hint when importing a no export json file', error: { binding: 'default', code: 'MISSING_EXPORT', exporter: ID_ARRAY_JSON, id: ID_MAIN, url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module', pos: 7, loc: { column: 7, file: ID_MAIN, line: 1 }, frame: ` 1: import theArray from './array.json'; ^ 2: export default theArray; `, watchFiles: [ID_ARRAY_JSON, ID_MAIN], message: '"default" is not exported by "array.json", imported by "main.js". (Note that you need @rollup/plugin-json to import JSON files)' } }); rollup-3.29.4/test/function/samples/adds-json-hint-for-missing-export-if-is-json-file/array.json000066400000000000000000000000171450520414700326740ustar00rootroot00000000000000["foo", "bar"] rollup-3.29.4/test/function/samples/adds-json-hint-for-missing-export-if-is-json-file/main.js000066400000000000000000000000761450520414700321520ustar00rootroot00000000000000import theArray from './array.json'; export default theArray; rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-b/000077500000000000000000000000001450520414700252715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-b/_config.js000066400000000000000000000001201450520414700272240ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds semi-colons if necessary' }); rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-b/foo.js000066400000000000000000000000221450520414700264040ustar00rootroot00000000000000assert.ok( true ) rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-b/main.js000066400000000000000000000000531450520414700265510ustar00rootroot00000000000000import './foo.js'; (function bar() {})(); rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-c/000077500000000000000000000000001450520414700252725ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-c/_config.js000066400000000000000000000001201450520414700272250ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds semi-colons if necessary' }); rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-c/foo.js000066400000000000000000000000531450520414700264110ustar00rootroot00000000000000export default function () { return 42; } rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-c/main.js000066400000000000000000000001451450520414700265540ustar00rootroot00000000000000import foo from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo(), 42 ); rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-d/000077500000000000000000000000001450520414700252735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-d/_config.js000066400000000000000000000001201450520414700272260ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds semi-colons if necessary' }); rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-d/foo.js000066400000000000000000000000221450520414700264060ustar00rootroot00000000000000export default 42 rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary-d/main.js000066400000000000000000000001431450520414700265530ustar00rootroot00000000000000import foo from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo, 42 ); rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary/000077500000000000000000000000001450520414700250525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary/_config.js000066400000000000000000000001201450520414700270050ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds semi-colons if necessary' }); rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary/foo.js000066400000000000000000000000551450520414700261730ustar00rootroot00000000000000export var foo = function () { return 42; } rollup-3.29.4/test/function/samples/adds-semicolons-if-necessary/main.js000066400000000000000000000001511450520414700263310ustar00rootroot00000000000000import { foo } from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo(), 42 ); rollup-3.29.4/test/function/samples/adds-timings-to-bundle-when-codesplitting/000077500000000000000000000000001450520414700274575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/adds-timings-to-bundle-when-codesplitting/_config.js000066400000000000000000000012501450520414700314170ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Adds timing information to bundle when bundling with perf=true', options: { input: ['main.js', 'main2.js'], perf: true }, bundle(bundle) { const timings = bundle.getTimings(); const timers = Object.keys(timings); assert.ok(timers.includes('# BUILD'), '# BUILD time is not measured.'); assert.ok(timers.includes('# GENERATE'), '# GENERATE time is not measured.'); for (const timer of timers) { assert.equal(typeof timings[timer][0], 'number'); assert.equal(typeof timings[timer][1], 'number'); assert.ok(timings[timer][0] >= 0, 'Timer is not non-negative.'); } } }); rollup-3.29.4/test/function/samples/adds-timings-to-bundle-when-codesplitting/main.js000066400000000000000000000000231450520414700307340ustar00rootroot00000000000000export default 41; rollup-3.29.4/test/function/samples/adds-timings-to-bundle-when-codesplitting/main2.js000066400000000000000000000000231450520414700310160ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/adds-timings-to-bundle/000077500000000000000000000000001450520414700236525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/adds-timings-to-bundle/_config.js000066400000000000000000000012061450520414700256130ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Adds timing information to bundle when bundling with perf=true', options: { perf: true }, bundle(bundle) { const timings = bundle.getTimings(); const timers = Object.keys(timings); assert.ok(timers.includes('# BUILD'), '# BUILD time is not measured.'); assert.ok(timers.includes('# GENERATE'), '# GENERATE time is not measured.'); for (const timer of timers) { assert.equal(typeof timings[timer][0], 'number'); assert.equal(typeof timings[timer][1], 'number'); assert.ok(timings[timer][0] >= 0, 'Timer is not non-negative.'); } } }); rollup-3.29.4/test/function/samples/adds-timings-to-bundle/main.js000066400000000000000000000000231450520414700251270ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/aliased-not-exported-twice/000077500000000000000000000000001450520414700245415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/aliased-not-exported-twice/_config.js000066400000000000000000000004731450520414700265070ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not export aliased binding under original name (#438)', exports(exports) { assert.equal(exports.number, 0); assert.equal(exports.incr(), 1); assert.equal(exports.number, 1); assert.ok(!('count' in exports)); } }); rollup-3.29.4/test/function/samples/aliased-not-exported-twice/foo.js000066400000000000000000000001041450520414700256550ustar00rootroot00000000000000export var count = 0; export function incr () { return ++count; } rollup-3.29.4/test/function/samples/aliased-not-exported-twice/main.js000066400000000000000000000000621450520414700260210ustar00rootroot00000000000000export { count as number, incr } from './foo.js'; rollup-3.29.4/test/function/samples/allow-reserved/000077500000000000000000000000001450520414700223335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/allow-reserved/_config.js000066400000000000000000000002341450520414700242740ustar00rootroot00000000000000module.exports = defineTest({ description: 'allow reserved identifiers via custom acorn options', options: { acorn: { allowReserved: true } } }); rollup-3.29.4/test/function/samples/allow-reserved/main.js000066400000000000000000000001011450520414700236050ustar00rootroot00000000000000var x = function await() { return 42; }; assert.equal(x(), 42); rollup-3.29.4/test/function/samples/allow-undefined-as-parameter/000077500000000000000000000000001450520414700250345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/allow-undefined-as-parameter/_config.js000066400000000000000000000002031450520414700267710ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not make assumptions about its value when using undefined as a parameter name' }); rollup-3.29.4/test/function/samples/allow-undefined-as-parameter/main.js000066400000000000000000000002151450520414700263140ustar00rootroot00000000000000function foo(undefined) { if (!undefined) { throw new Error('Parameter was not tracked properly') } assert.ok(undefined); } foo(true); rollup-3.29.4/test/function/samples/allows-external-modules-from-nested-module/000077500000000000000000000000001450520414700276735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/allows-external-modules-from-nested-module/_config.js000066400000000000000000000002151450520414700316330ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports external modules from nested internal modules', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/allows-external-modules-from-nested-module/foo.js000066400000000000000000000001631450520414700310140ustar00rootroot00000000000000import { relative } from 'path'; var path = 'a/b/c'; var path2 = 'a/c/b'; export default relative( path, path2 );rollup-3.29.4/test/function/samples/allows-external-modules-from-nested-module/main.js000066400000000000000000000003551450520414700311600ustar00rootroot00000000000000import { relative, normalize } from 'path'; import foo from './foo'; var path = 'foo/bar/baz'; var path2 = 'foo/baz/bar'; assert.equal( relative( path, path2 ), normalize('../../baz/bar') ); assert.equal( foo, normalize('../../c/b') );rollup-3.29.4/test/function/samples/allows-unknown-binary-operators/000077500000000000000000000000001450520414700256745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/allows-unknown-binary-operators/_config.js000066400000000000000000000001221450520414700276310ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows unknown binary operators' }); rollup-3.29.4/test/function/samples/allows-unknown-binary-operators/main.js000066400000000000000000000000551450520414700271560ustar00rootroot00000000000000export default { minInt24x: - (2 ** 23) }; rollup-3.29.4/test/function/samples/already-deshadowed-import/000077500000000000000000000000001450520414700244365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/already-deshadowed-import/_config.js000066400000000000000000000006551450520414700264060ustar00rootroot00000000000000const path = require('node:path'); const ID_BOB = path.join(__dirname, 'bob.js'); const ID_ALICE = path.join(__dirname, 'alice.js'); module.exports = defineTest({ description: 'handle already module import names correctly if they are have already been deshadowed', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_BOB, ID_ALICE, ID_BOB], message: 'Circular dependency: bob.js -> alice.js -> bob.js' } ] }); rollup-3.29.4/test/function/samples/already-deshadowed-import/alice.js000066400000000000000000000001131450520414700260440ustar00rootroot00000000000000import * as Bob from "./bob"; export function foo() { return "alice"; } rollup-3.29.4/test/function/samples/already-deshadowed-import/bob.js000066400000000000000000000001141450520414700255320ustar00rootroot00000000000000import * as Alice from "./alice"; export function foo() { return "bob"; } rollup-3.29.4/test/function/samples/already-deshadowed-import/main.js000066400000000000000000000003521450520414700257200ustar00rootroot00000000000000import * as Bob from "./bob"; import * as Alice from "./alice"; function g() { var foo = Bob.foo(); return foo; } function f() { var foo = Alice.foo(); return foo; } assert.equal(f(), "alice"); assert.equal(g(), "bob"); rollup-3.29.4/test/function/samples/amd-auto-id-id/000077500000000000000000000000001450520414700220735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/amd-auto-id-id/_config.js000066400000000000000000000010021450520414700240260ustar00rootroot00000000000000// @ts-check module.exports = defineTest({ description: 'throws when using both the amd.autoId and the amd.id option', options: { output: { dir: 'dist', amd: { // @ts-expect-error expected error autoId: 'a', id: 'a' } } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.amd.id" - this option cannot be used together with "output.amd.autoId"/"output.amd.basePath".', url: 'https://rollupjs.org/configuration-options/#output-amd-id' } }); rollup-3.29.4/test/function/samples/amd-auto-id-id/main.js000066400000000000000000000000231450520414700233500ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/amd-base-path-id/000077500000000000000000000000001450520414700223755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/amd-base-path-id/_config.js000066400000000000000000000010061450520414700243340ustar00rootroot00000000000000// @ts-check module.exports = defineTest({ description: 'throws when using both the amd.basePath and the amd.id option', options: { output: { dir: 'dist', amd: { // @ts-expect-error expected error basePath: 'a', id: 'a' } } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.amd.id" - this option cannot be used together with "output.amd.autoId"/"output.amd.basePath".', url: 'https://rollupjs.org/configuration-options/#output-amd-id' } }); rollup-3.29.4/test/function/samples/amd-base-path-id/main.js000066400000000000000000000000231450520414700236520ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/amd-base-path/000077500000000000000000000000001450520414700220035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/amd-base-path/_config.js000066400000000000000000000007011450520414700237430ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when using only amd.basePath option', options: { output: { dir: 'dist', amd: { // @ts-expect-error expected error basePath: 'a' } } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.amd.basePath" - this option only works with "output.amd.autoId".', url: 'https://rollupjs.org/configuration-options/#output-amd-basepath' } }); rollup-3.29.4/test/function/samples/amd-base-path/main.js000066400000000000000000000000231450520414700232600ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/arbitrary-module-namespace-identifiers/000077500000000000000000000000001450520414700271175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/arbitrary-module-namespace-identifiers/_config.js000066400000000000000000000001421450520414700310560ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports arbitrary module namespace identifiers' }); rollup-3.29.4/test/function/samples/arbitrary-module-namespace-identifiers/foo.js000066400000000000000000000000541450520414700302370ustar00rootroot00000000000000const foo = 42; export { foo as ' 😆 ' }; rollup-3.29.4/test/function/samples/arbitrary-module-namespace-identifiers/main.js000066400000000000000000000001171450520414700304000ustar00rootroot00000000000000import { ' 🙄 ' as foo } from './reexport.js'; assert.strictEqual(foo, 42); rollup-3.29.4/test/function/samples/arbitrary-module-namespace-identifiers/reexport.js000066400000000000000000000000611450520414700313220ustar00rootroot00000000000000export { ' 😆 ' as ' 🙄 ' } from './foo.js'; rollup-3.29.4/test/function/samples/argument-deoptimization/000077500000000000000000000000001450520414700242575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/global-calls/000077500000000000000000000000001450520414700266135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/global-calls/_config.js000066400000000000000000000002441450520414700305550ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks argument mutations of calls to globals', options: { treeshake: { tryCatchDeoptimization: false } } }); rollup-3.29.4/test/function/samples/argument-deoptimization/global-calls/main.js000066400000000000000000000006011450520414700300720ustar00rootroot00000000000000let errored = false; try { const a = {}; Object.freeze(a); a.notAllowed = 1; } catch (error) { errored = true; } assert.ok(errored); const b = { mutated: false }; Object.defineProperty(b, 'mutated', { value: true }); assert.ok(b.mutated ? true : false); const c = { mutated: false }; Object.defineProperties(c, { mutated: { value: true } }); assert.ok(c.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-access-mutation/000077500000000000000000000000001450520414700313345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-access-mutation/_config.js000066400000000000000000000001501450520414700332720ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of function parameters when accessed' }); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-access-mutation/main.js000066400000000000000000000002671450520414700326230ustar00rootroot00000000000000const obj = { get mutator() { this.mutated = true; }, mutated: false }; function updateObj(target) { target.mutator; } updateObj(obj); assert.ok(obj.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-call-mutation/000077500000000000000000000000001450520414700310065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-call-mutation/_config.js000066400000000000000000000001461450520414700327510ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of function parameters when called' }); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-call-mutation/main.js000066400000000000000000000002651450520414700322730ustar00rootroot00000000000000const obj = { mutator() { this.mutated = true; }, mutated: false }; function updateObj(target) { target.mutator(); } updateObj(obj); assert.ok(obj.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-deep-access-mutation/000077500000000000000000000000001450520414700322475ustar00rootroot00000000000000_config.js000066400000000000000000000001501450520414700341260ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-deep-access-mutationmodule.exports = defineTest({ description: 'tracks mutations of function parameters when accessed' }); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-deep-access-mutation/main.js000066400000000000000000000003271450520414700335330ustar00rootroot00000000000000const obj = { nested: { get mutator() { this.mutated = true; }, mutated: false } }; function updateObj(target) { target.nested.mutator; } updateObj(obj); assert.ok(obj.nested.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-mutation-destructured/000077500000000000000000000000001450520414700326105ustar00rootroot00000000000000_config.js000066400000000000000000000001471450520414700344750ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-mutation-destructuredmodule.exports = defineTest({ description: 'tracks mutations of destructured function parameters' }); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-mutation-destructured/main.js000066400000000000000000000002501450520414700340670ustar00rootroot00000000000000const obj = { nested: { mutated: false } }; function updateObj({ nested }) { nested.mutated = true; } updateObj(obj); assert.ok(obj.nested.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-mutation-spread/000077500000000000000000000000001450520414700313515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-mutation-spread/_config.js000066400000000000000000000001671450520414700333170ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of function parameters picked up by spread operator' }); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-mutation-spread/main.js000066400000000000000000000004161450520414700326340ustar00rootroot00000000000000const obj1 = { mutated: false }; const obj2 = { mutated: false }; function updateObj(...args) { args[0].mutated = true; args[1].mutated = true; } updateObj(obj1, obj2); assert.ok(obj1.mutated ? true : false, 'obj1'); assert.ok(obj2.mutated ? true : false, 'obj2'); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-mutation/000077500000000000000000000000001450520414700300755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-mutation/_config.js000066400000000000000000000001321450520414700320330ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of function parameters' }); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-mutation/main.js000066400000000000000000000002211450520414700313520ustar00rootroot00000000000000const obj = { mutated: false }; function updateObj(target) { target.mutated = true; } updateObj(obj); assert.ok(obj.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-variable-merge/000077500000000000000000000000001450520414700311175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-variable-merge/_config.js000066400000000000000000000001501450520414700330550ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly merges parameters and variable declarations' }); rollup-3.29.4/test/function/samples/argument-deoptimization/parameter-variable-merge/main.js000066400000000000000000000001771450520414700324060ustar00rootroot00000000000000function test(foo) { var foo; var foo; assert.ok(foo ? true : false); return foo; } assert.ok(test(true) ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/return-function-known/000077500000000000000000000000001450520414700305535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/return-function-known/_config.js000066400000000000000000000001661450520414700325200ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of function parameters by known returned functions' }); rollup-3.29.4/test/function/samples/argument-deoptimization/return-function-known/main.js000066400000000000000000000002461450520414700320370ustar00rootroot00000000000000const obj = { mutated: false }; function updateObj() { return target => { target.mutated = true; }; } updateObj()(obj); assert.ok(obj.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/return-function-unknown/000077500000000000000000000000001450520414700311165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/return-function-unknown/_config.js000066400000000000000000000001661450520414700330630ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of function parameters by known returned functions' }); rollup-3.29.4/test/function/samples/argument-deoptimization/return-function-unknown/main.js000066400000000000000000000002601450520414700323760ustar00rootroot00000000000000const obj = { mutated: false }; global.handler = () => target => { target.mutated = true; delete global.handler; }; handler()(obj); assert.ok(obj.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/unknown-global-assignment/000077500000000000000000000000001450520414700313625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/unknown-global-assignment/_config.js000066400000000000000000000001451450520414700333240ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of assignments to unknown globals' }); rollup-3.29.4/test/function/samples/argument-deoptimization/unknown-global-assignment/main.js000066400000000000000000000002621450520414700326440ustar00rootroot00000000000000globalThis.obj = { set target(value) { value.mutated = true; } }; const assigned = { mutated: false }; obj.target = assigned; assert.ok(assigned.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-deoptimization/unknown-global-call/000077500000000000000000000000001450520414700301255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-deoptimization/unknown-global-call/_config.js000066400000000000000000000001501450520414700320630ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks argument mutations of calls to unknown globals' }); rollup-3.29.4/test/function/samples/argument-deoptimization/unknown-global-call/main.js000066400000000000000000000002051450520414700314040ustar00rootroot00000000000000globalThis.fn = arg => { arg.mutated = true; }; const obj = { mutated: false }; fn(obj); assert.ok(obj.mutated ? true : false); rollup-3.29.4/test/function/samples/argument-treeshaking-parameter-conflict/000077500000000000000000000000001450520414700273015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/argument-treeshaking-parameter-conflict/_config.js000066400000000000000000000001661450520414700312460ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not cause conflicts when deconflicting non-included parameters' }); rollup-3.29.4/test/function/samples/argument-treeshaking-parameter-conflict/dep.js000066400000000000000000000000731450520414700304070ustar00rootroot00000000000000export let value = 0; export const mutate = () => value++; rollup-3.29.4/test/function/samples/argument-treeshaking-parameter-conflict/main.js000066400000000000000000000001731450520414700305640ustar00rootroot00000000000000import * as dep from './dep'; function test(mutate) { dep.mutate('hello'); } test(); assert.strictEqual(dep.value, 1); rollup-3.29.4/test/function/samples/array-double-spread/000077500000000000000000000000001450520414700232425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/array-double-spread/_config.js000066400000000000000000000001371450520414700252050ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly deoptimizes when there is no proto' }); rollup-3.29.4/test/function/samples/array-double-spread/main.js000066400000000000000000000007241450520414700245270ustar00rootroot00000000000000const a = [false, , true]; const b = [false, , true, ...a, false, , true, ...a]; let count = 0; b[0] ? count+= 10: count++; b[1] ? count+= 10: count++; b[2] ? count+= 10: count++; b[3] ? count+= 10: count++; b[4] ? count+= 10: count++; b[5] ? count+= 10: count++; b[6] ? count+= 10: count++; b[7] ? count+= 10: count++; b[8] ? count+= 10: count++; b[9] ? count+= 10: count++; b[10] ? count+= 10: count++; b[11] ? count+= 10: count++; assert.strictEqual(count, 48); rollup-3.29.4/test/function/samples/array-from-side-effect/000077500000000000000000000000001450520414700236335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/array-from-side-effect/_config.js000066400000000000000000000002721450520414700255760ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Observes side-effects in Array.from', exports(exports) { assert.strictEqual(exports.x, 7); } }); rollup-3.29.4/test/function/samples/array-from-side-effect/main.js000066400000000000000000000001131450520414700251100ustar00rootroot00000000000000export let x = 1; const list = [1, 2, 3]; Array.from(list, v => (x += v)); rollup-3.29.4/test/function/samples/array-getter/000077500000000000000000000000001450520414700220065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/array-getter/_config.js000066400000000000000000000001241450520414700237450ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles getters defined on arrays' }); rollup-3.29.4/test/function/samples/array-getter/main.js000066400000000000000000000002631450520414700232710ustar00rootroot00000000000000let flag = false; const array = []; Object.defineProperty(array, 'prop', { get() { flag = true; } }); array.prop; if (!flag) { throw new Error('Mutation not detected'); } rollup-3.29.4/test/function/samples/array-mutation/000077500000000000000000000000001450520414700223545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/array-mutation/_config.js000066400000000000000000000001111450520414700243070ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks array mutations' }); rollup-3.29.4/test/function/samples/array-mutation/main.js000066400000000000000000000001221450520414700236310ustar00rootroot00000000000000const array = []; array.push(true); assert.strictEqual(array[0] || false, true); rollup-3.29.4/test/function/samples/asi-prevention-with-comment-like-strings/000077500000000000000000000000001450520414700273655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/asi-prevention-with-comment-like-strings/_config.js000066400000000000000000000002231450520414700313240ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not hang when scanning for line-breaks in ASI prevention and there are comment-like strings' }); rollup-3.29.4/test/function/samples/asi-prevention-with-comment-like-strings/main.js000066400000000000000000000001221450520414700306420ustar00rootroot00000000000000function test() { return true ? '/*' : '//' } assert.strictEqual(test(), '/*'); rollup-3.29.4/test/function/samples/assign-namespace-to-var/000077500000000000000000000000001450520414700240245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assign-namespace-to-var/_config.js000066400000000000000000000003301450520414700257620ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows a namespace to be assigned to a variable', warnings: [ { code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "main".', names: ['main'] } ] }); rollup-3.29.4/test/function/samples/assign-namespace-to-var/b.js000066400000000000000000000000751450520414700246050ustar00rootroot00000000000000export function foo () { return 10; } export var bar = 20; rollup-3.29.4/test/function/samples/assign-namespace-to-var/main.js000066400000000000000000000001001450520414700252750ustar00rootroot00000000000000import * as b from './b'; var val = b.foo(); var val2 = b.bar; rollup-3.29.4/test/function/samples/assignment-deoptimization/000077500000000000000000000000001450520414700246055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-deoptimization/assignee-is-deoptimized/000077500000000000000000000000001450520414700313275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-deoptimization/assignee-is-deoptimized/_config.js000066400000000000000000000001311450520414700332640ustar00rootroot00000000000000module.exports = defineTest({ description: 'makes sure the assignee is deoptimized' }); rollup-3.29.4/test/function/samples/assignment-deoptimization/assignee-is-deoptimized/main.js000066400000000000000000000002501450520414700326060ustar00rootroot00000000000000const flags = { updated: false }; let toBeUpdated = {}; toBeUpdated = flags; toBeUpdated.updated = true; if (!flags.updated) throw new Error('Update was not tracked'); rollup-3.29.4/test/function/samples/assignment-deoptimization/assignment-target-is-deoptimized/000077500000000000000000000000001450520414700331655ustar00rootroot00000000000000_config.js000066400000000000000000000001421450520414700350450ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-deoptimization/assignment-target-is-deoptimizedmodule.exports = defineTest({ description: 'makes sure the assignment target is deoptimized' }); main.js000066400000000000000000000001361450520414700343700ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-deoptimization/assignment-target-is-deoptimizedlet updated = false; updated = true; if (!updated) throw new Error('Update was not tracked'); rollup-3.29.4/test/function/samples/assignment-deoptimization/nested-assignment/000077500000000000000000000000001450520414700302355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-deoptimization/nested-assignment/_config.js000066400000000000000000000001761450520414700322030ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks assigments nested in expressions that are included for other reasons' }); rollup-3.29.4/test/function/samples/assignment-deoptimization/nested-assignment/main.js000066400000000000000000000001671450520414700315230ustar00rootroot00000000000000let updated = false; assert.ok(!updated) || (updated = true); if (!updated) throw new Error('Update was not tracked'); rollup-3.29.4/test/function/samples/assignment-deoptimization/try-catch-inclusion/000077500000000000000000000000001450520414700305045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-deoptimization/try-catch-inclusion/_config.js000066400000000000000000000001521450520414700324440ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks assigments included via try-catch-deoptimization' }); rollup-3.29.4/test/function/samples/assignment-deoptimization/try-catch-inclusion/main.js000066400000000000000000000001671450520414700317720ustar00rootroot00000000000000let updated = false; try { updated = true; } catch (err) {} if (!updated) throw new Error('Update was not tracked'); rollup-3.29.4/test/function/samples/assignment-patterns/000077500000000000000000000000001450520414700234065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-patterns/_config.js000066400000000000000000000001601450520414700253450ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows reassigments to default parameters that shadow imports' }); rollup-3.29.4/test/function/samples/assignment-patterns/main.js000066400000000000000000000007061450520414700246730ustar00rootroot00000000000000import { bar, baz, x, items, p, q, r, s } from './other'; function foo ( bar = 1, { baz } = { baz: 2 }, [[[,x = 3] = []] = []] = [], ...items ) { bar += 1; baz += 1; x += 1; let { p, q } = { p: 4, q: 5 }; let [ r, s ] = [ 6, 7 ]; p++; q += 1; r = 7; s = 6; return bar + baz + x + items.length + p + q + r + s; } assert.equal( foo(), 33 ); assert.equal( foo( 2 ), 34 ); assert.equal( foo( 2, { baz: 3 }, [[[99,10]]], 'a', 'b', 'c' ), 45 ); rollup-3.29.4/test/function/samples/assignment-patterns/other.js000066400000000000000000000003001450520414700250560ustar00rootroot00000000000000export const bar = 'bar'; export const baz = 'baz'; export const x = 'x'; export const items = 'items'; export const p = 'p'; export const q = 'q'; export const r = 'r'; export const s = 's'; rollup-3.29.4/test/function/samples/assignment-to-exports-b/000077500000000000000000000000001450520414700241115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-to-exports-b/_config.js000066400000000000000000000003011450520414700260450ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports are rewritten inside a variable init', exports: exports => { assert.equal(exports.b, 42); } }); rollup-3.29.4/test/function/samples/assignment-to-exports-b/main.js000066400000000000000000000001701450520414700253710ustar00rootroot00000000000000var a = { prop: 42 }; var b = a.prop; function set ( new_a, new_b ) { a = new_a; b = new_b; } export { a, b, set }; rollup-3.29.4/test/function/samples/assignment-to-exports/000077500000000000000000000000001450520414700236725ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-to-exports/_config.js000066400000000000000000000003441450520414700256350ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports are kept up-to-date', exports(exports) { assert.equal(exports.count, 0); exports.incr(); assert.equal(exports.count, 1); } }); rollup-3.29.4/test/function/samples/assignment-to-exports/main.js000066400000000000000000000001001450520414700251430ustar00rootroot00000000000000export var count = 0; export function incr () { count += 1; } rollup-3.29.4/test/function/samples/assignment-to-re-exports-conflict/000077500000000000000000000000001450520414700260755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-to-re-exports-conflict/_config.js000066400000000000000000000003471450520414700300430ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 're-exports are kept up-to-date', exports(exports) { assert.equal(exports.count, 0); exports.incr(); assert.equal(exports.count, 1); } }); rollup-3.29.4/test/function/samples/assignment-to-re-exports-conflict/count.js000066400000000000000000000001761450520414700275670ustar00rootroot00000000000000export var count = 0; export function conflict () { var foo = 0, count = 42; } export function incr () { count += 1; } rollup-3.29.4/test/function/samples/assignment-to-re-exports-conflict/main.js000066400000000000000000000000571450520414700273610ustar00rootroot00000000000000export {count, incr, conflict} from './count'; rollup-3.29.4/test/function/samples/assignment-to-re-exports/000077500000000000000000000000001450520414700242765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/assignment-to-re-exports/_config.js000066400000000000000000000003471450520414700262440ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 're-exports are kept up-to-date', exports(exports) { assert.equal(exports.count, 0); exports.incr(); assert.equal(exports.count, 1); } }); rollup-3.29.4/test/function/samples/assignment-to-re-exports/count.js000066400000000000000000000001001450520414700257530ustar00rootroot00000000000000export var count = 0; export function incr () { count += 1; } rollup-3.29.4/test/function/samples/assignment-to-re-exports/main.js000066400000000000000000000000451450520414700255570ustar00rootroot00000000000000export {count, incr} from './count'; rollup-3.29.4/test/function/samples/associate-arrow-function-parameter-mutations/000077500000000000000000000000001450520414700303255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-arrow-function-parameter-mutations/_config.js000066400000000000000000000003641450520414700322720ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates arrow function parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.baz, 'present'); } }); rollup-3.29.4/test/function/samples/associate-arrow-function-parameter-mutations/main.js000066400000000000000000000002761450520414700316140ustar00rootroot00000000000000const foo = { noEffect: () => {} }; const bar = {}; const addEffect = obj => { obj.noEffect = () => { bar.baz = 'present'; }; }; addEffect( foo ); foo.noEffect(); export default bar; rollup-3.29.4/test/function/samples/associate-arrow-function-return-values/000077500000000000000000000000001450520414700271405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-arrow-function-return-values/_config.js000066400000000000000000000003251450520414700311020ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates function return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-arrow-function-return-values/main.js000066400000000000000000000002721450520414700304230ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const getFoo = () => foo; getFoo().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-es5-constructor-parameter-mutations/000077500000000000000000000000001450520414700304275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-es5-constructor-parameter-mutations/_config.js000066400000000000000000000003321450520414700323670ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates ES5 constructor parameters with their call arguments', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-es5-constructor-parameter-mutations/main.js000066400000000000000000000003471450520414700317150ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function AssignExported ( obj ) { obj.mightBeExported = exported; } const bar = new AssignExported( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-es6-constructor-parameter-mutations/000077500000000000000000000000001450520414700304305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-es6-constructor-parameter-mutations/_config.js000066400000000000000000000003321450520414700323700ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates ES5 constructor parameters with their call arguments', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-es6-constructor-parameter-mutations/main.js000066400000000000000000000003671450520414700317200ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; class AssignExported { constructor ( obj ) { obj.mightBeExported = exported; } } const bar = new AssignExported( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-function-parameter-mutations-2/000077500000000000000000000000001450520414700273345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-function-parameter-mutations-2/_config.js000066400000000000000000000003541450520414700313000ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates function parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-function-parameter-mutations-2/main.js000066400000000000000000000003271450520414700306200ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function assignExported ( obj ) { obj.mightBeExported = exported; } assignExported( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-function-parameter-mutations/000077500000000000000000000000001450520414700271755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-function-parameter-mutations/_config.js000066400000000000000000000003541450520414700311410ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates function parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.baz, 'present'); } }); rollup-3.29.4/test/function/samples/associate-function-parameter-mutations/main.js000066400000000000000000000002771450520414700304650ustar00rootroot00000000000000const foo = { noEffect: () => {} }; const bar = {}; function addEffect ( obj ) { obj.noEffect = () => { bar.baz = 'present'; }; } addEffect( foo ); foo.noEffect(); export default bar; rollup-3.29.4/test/function/samples/associate-function-return-values-2/000077500000000000000000000000001450520414700261475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-function-return-values-2/_config.js000066400000000000000000000003211450520414700301050ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates function return values with regard to calls', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-function-return-values-2/main.js000066400000000000000000000004111450520414700274250ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function getAssignExported () { return function assignExported ( obj ) { obj.mightBeExported = exported; }; } getAssignExported()( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-function-return-values-3/000077500000000000000000000000001450520414700261505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-function-return-values-3/_config.js000066400000000000000000000003221450520414700301070ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates function return values of returned functions', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-function-return-values-3/main.js000066400000000000000000000003221450520414700274270ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function getGetFoo () { return () => foo; } getGetFoo()().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-function-return-values-4/000077500000000000000000000000001450520414700261515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-function-return-values-4/_config.js000066400000000000000000000003021450520414700301060ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Handles empty return statements (#1702)', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-function-return-values-4/main.js000066400000000000000000000004551450520414700274370ustar00rootroot00000000000000const foo = {mightBeExported: {}}; const exported = {}; function getFooOrUndefined() { if (Math.random() < 0.5) { return; } return foo; } const returnedFoo = getFooOrUndefined() || foo; returnedFoo.mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-function-return-values-5/000077500000000000000000000000001450520414700261525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-function-return-values-5/_config.js000066400000000000000000000003121450520414700301100ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates value mutations across return values', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-function-return-values-5/main.js000066400000000000000000000002661450520414700274400ustar00rootroot00000000000000const foo = {value: false}; const exported = {}; function getFoo() { return foo; } getFoo().value = true; if (foo.value) { exported.bar = 'present' } export default exported; rollup-3.29.4/test/function/samples/associate-function-return-values-across-other-expressions/000077500000000000000000000000001450520414700327775ustar00rootroot00000000000000_config.js000066400000000000000000000003251450520414700346620ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-function-return-values-across-other-expressionsconst assert = require('node:assert'); module.exports = defineTest({ description: 'Associates function return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }); main.js000066400000000000000000000003661450520414700342070ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-function-return-values-across-other-expressionsconst foo = { mightBeExported: {} }; const exported = {}; function getFoo () { return foo; } (Math.random() < 0.5 ? true && getFoo : false || getFoo)().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-function-return-values/000077500000000000000000000000001450520414700260105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-function-return-values/_config.js000066400000000000000000000003251450520414700277520ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates function return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-function-return-values/main.js000066400000000000000000000003041450520414700272670ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function getFoo () { return foo; } getFoo().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-getter-return-values-2/000077500000000000000000000000001450520414700256145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-getter-return-values-2/_config.js000066400000000000000000000003171450520414700275570ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates getter return values with regard to calls', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-getter-return-values-2/main.js000066400000000000000000000003501450520414700270740ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const fooContainer = { get getFoo () {return () => foo;} }; fooContainer.getFoo().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-getter-return-values/000077500000000000000000000000001450520414700254555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-getter-return-values/_config.js000066400000000000000000000003231450520414700274150ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates getter return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-getter-return-values/main.js000066400000000000000000000003321450520414700267350ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const fooContainer = { get foo () {return foo;} }; fooContainer.foo.mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-method-parameter-mutations-2/000077500000000000000000000000001450520414700267675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-method-parameter-mutations-2/_config.js000066400000000000000000000003521450520414700307310ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates method parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-method-parameter-mutations-2/main.js000066400000000000000000000004271450520414700302540ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function Bar () {} Bar.prototype.assignExported = function ( obj ) { obj.mightBeExported = exported; }; const bar = new Bar(); bar.assignExported( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-method-parameter-mutations/000077500000000000000000000000001450520414700266305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-method-parameter-mutations/_config.js000066400000000000000000000003521450520414700305720ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates method parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.baz, 'present'); } }); rollup-3.29.4/test/function/samples/associate-method-parameter-mutations/main.js000066400000000000000000000003771450520414700301210ustar00rootroot00000000000000const foo = { noEffect: () => {} }; const bar = {}; function Baz () {} Baz.prototype.addEffect = function ( obj ) { obj.noEffect = () => { bar.baz = 'present'; }; }; const baz = new Baz(); baz.addEffect( foo ); foo.noEffect(); export default bar; rollup-3.29.4/test/function/samples/associate-object-expression-parameter-mutations/000077500000000000000000000000001450520414700310135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-object-expression-parameter-mutations/_config.js000066400000000000000000000003431450520414700327550ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates object expression member parameters with their call arguments', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-object-expression-parameter-mutations/main.js000066400000000000000000000003571450520414700323020ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const assigner = { assignExported ( obj ) { obj.mightBeExported = exported; } }; assigner.assignExported( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-object-expression-return-values/000077500000000000000000000000001450520414700276265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-object-expression-return-values/_config.js000066400000000000000000000003431450520414700315700ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates object expression member parameters with their call arguments', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-object-expression-return-values/main.js000066400000000000000000000003341450520414700311100ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const assigner = { getFoo () { return foo; } }; assigner.getFoo().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-parameter-mutations-across-other-expressions/000077500000000000000000000000001450520414700323415ustar00rootroot00000000000000_config.js000066400000000000000000000003431450520414700342240ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-parameter-mutations-across-other-expressionsconst assert = require('node:assert'); module.exports = defineTest({ description: 'Associates parameters with their call arguments across other expressions', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-parameter-mutations-across-other-expressions/main.js000066400000000000000000000004211450520414700336200ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function assignExported ( obj ) { obj.mightBeExported = exported; } (Math.random() < 0.5 ? true && assignExported : false || assignExported)( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/associate-setter-parameters/000077500000000000000000000000001450520414700250205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/associate-setter-parameters/_config.js000066400000000000000000000003231450520414700267600ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Associates getter return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }); rollup-3.29.4/test/function/samples/associate-setter-parameters/main.js000066400000000000000000000004021450520414700262760ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const fooContainer = { set addMightBeExported ( obj ) { obj.mightBeExported = exported; } }; fooContainer.addMightBeExported = foo; foo.mightBeExported.bar = 'present'; export default exported; rollup-3.29.4/test/function/samples/async-function-return/000077500000000000000000000000001450520414700236555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/async-function-return/_config.js000066400000000000000000000001441450520414700256160ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses the correct return value for async functions' }); rollup-3.29.4/test/function/samples/async-function-return/main.js000066400000000000000000000004141450520414700251360ustar00rootroot00000000000000const foo = async function () { return false; }; const fooResult = foo(); assert.strictEqual(fooResult ? 'retained' : 'ignored', 'retained'); const bar = async () => false; const barResult = bar(); assert.strictEqual(barResult ? 'retained' : 'ignored', 'retained'); rollup-3.29.4/test/function/samples/avoid-exports-dot-asterisk/000077500000000000000000000000001450520414700246135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/avoid-exports-dot-asterisk/_config.js000066400000000000000000000002641450520414700265570ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoid return or set module.exports to dot-asterisk style', options: { external: () => true, output: { format: 'cjs' } } }); rollup-3.29.4/test/function/samples/avoid-exports-dot-asterisk/main.js000066400000000000000000000000721450520414700260740ustar00rootroot00000000000000import * as path from 'path'; export { path as default }; rollup-3.29.4/test/function/samples/avoid-variable-be-empty/000077500000000000000000000000001450520414700240055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/avoid-variable-be-empty/_config.js000066400000000000000000000004611450520414700257500ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoid variable from empty module name be empty', options: { input: '', plugins: [ { name: 'test-plugin', resolveId() { return ''; }, load() { return 'export default 0;'; } } ], output: { format: 'cjs' } } }); rollup-3.29.4/test/function/samples/aync-options/000077500000000000000000000000001450520414700220235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/aync-options/_config.js000066400000000000000000000011631450520414700237660ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles async plugin options', options: { preserveEntrySignatures: false, plugins: [ { name: 'test-plugin1', options(options) { assert.strictEqual(options.preserveEntrySignatures, false); return Promise.resolve({ ...options, preserveEntrySignatures: 'strict' }); } }, { name: 'test-plugin2', options(options) { assert.strictEqual(options.preserveEntrySignatures, 'strict'); return Promise.resolve(null); } } ] }, exports(exports) { assert.strictEqual(exports.foo, 1); } }); rollup-3.29.4/test/function/samples/aync-options/main.js000066400000000000000000000000261450520414700233030ustar00rootroot00000000000000export const foo = 1; rollup-3.29.4/test/function/samples/banner-and-footer/000077500000000000000000000000001450520414700227015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/banner-and-footer/_config.js000066400000000000000000000014621450520414700246460ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds a banner/footer', options: { output: { banner: '/* this is a banner */', footer: () => Promise.resolve('/* this is a footer */') }, plugins: [ { name: 'test-plugin1', banner: '/* first banner */', footer() { return '/* first footer */'; } }, { name: 'test-plugin2', banner() { return '/* second banner */'; }, footer: '/* second footer */' }, { name: 'test-plugin3', banner() { return Promise.reject(new Error('Could not generate banner.')); }, footer: '/* 3rd footer */' } ] }, generateError: { code: 'ADDON_ERROR', message: 'Could not retrieve "banner". Check configuration of plugin "test-plugin3".\n' + '\tError Message: Could not generate banner.' } }); rollup-3.29.4/test/function/samples/banner-and-footer/main.js000066400000000000000000000000361450520414700241620ustar00rootroot00000000000000console.log( 'hello world' ); rollup-3.29.4/test/function/samples/bindings/000077500000000000000000000000001450520414700211755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/bindings/_config.js000066400000000000000000000002621450520414700231370ustar00rootroot00000000000000module.exports = defineTest({ description: 'maintains live bindings' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/bindings rollup-3.29.4/test/function/samples/bindings/foo.js000066400000000000000000000000741450520414700223170ustar00rootroot00000000000000export var count = 0; export function incr() { count++; } rollup-3.29.4/test/function/samples/bindings/main.js000066400000000000000000000001361450520414700224570ustar00rootroot00000000000000import { count, incr } from './foo'; assert.equal(count, 0); incr(); assert.equal(count, 1); rollup-3.29.4/test/function/samples/braceless-arrow-function-returning-function/000077500000000000000000000000001450520414700301545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/braceless-arrow-function-returning-function/_config.js000066400000000000000000000001551450520414700321170ustar00rootroot00000000000000module.exports = defineTest({ description: 'arrow function without braces returning a function (#1032)' }); rollup-3.29.4/test/function/samples/braceless-arrow-function-returning-function/main.js000066400000000000000000000003311450520414700314330ustar00rootroot00000000000000const f = (a) => (b) => { return a * b } function ff (a) { return f(a) } assert.equal( ff(2)(3), 6 ); const g = (a) => { return (b) => { return a - b } } function gg (a) { return g(a) } assert.equal( gg(2)(3), -1 ); rollup-3.29.4/test/function/samples/break-label/000077500000000000000000000000001450520414700215415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/break-label/_config.js000066400000000000000000000003301450520414700234770ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'do not deconflict break label (#2773)', exports(exports) { assert.deepStrictEqual(exports, { value: 'original', n: 1 }); } }); rollup-3.29.4/test/function/samples/break-label/main.js000066400000000000000000000001521450520414700230210ustar00rootroot00000000000000export { n } from './module_1'; export { value } from './module_2'; import { n } from './module_2'; n(); rollup-3.29.4/test/function/samples/break-label/module_1.js000066400000000000000000000000221450520414700235760ustar00rootroot00000000000000export var n = 1; rollup-3.29.4/test/function/samples/break-label/module_2.js000066400000000000000000000001621450520414700236040ustar00rootroot00000000000000export let value = 'original'; export function n() { n: if (value === 1) { break n; value = 'changed'; } } rollup-3.29.4/test/function/samples/build-promise-chain/000077500000000000000000000000001450520414700232335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/build-promise-chain/_config.js000066400000000000000000000001431450520414700251730ustar00rootroot00000000000000module.exports = defineTest({ description: 'Does not fail when iteratively chaining promises' }); rollup-3.29.4/test/function/samples/build-promise-chain/main.js000066400000000000000000000001401450520414700245100ustar00rootroot00000000000000let promise = Promise.resolve(); promise = promise.then( () => {} ); promise.then( () => {} ); rollup-3.29.4/test/function/samples/builtin-prototypes/000077500000000000000000000000001450520414700232745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/builtin-prototypes/argument-side-effects/000077500000000000000000000000001450520414700274555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/builtin-prototypes/argument-side-effects/_config.js000066400000000000000000000001521450520414700314150ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects side-effects in chained string method arguments' }); rollup-3.29.4/test/function/samples/builtin-prototypes/argument-side-effects/main.js000066400000000000000000000002511450520414700307350ustar00rootroot00000000000000function getData() { var data = []; 'abc'.trim().replace('b', function() { data.push('replaced'); }); return data; } assert.deepEqual(getData(), ['replaced']); rollup-3.29.4/test/function/samples/builtin-prototypes/truthiness/000077500000000000000000000000001450520414700255045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/builtin-prototypes/truthiness/_config.js000066400000000000000000000001371450520414700274470ustar00rootroot00000000000000module.exports = defineTest({ description: 'regards builtin methods as truthy in objects' }); rollup-3.29.4/test/function/samples/builtin-prototypes/truthiness/main.js000066400000000000000000000002221450520414700267620ustar00rootroot00000000000000if (!{}.hasOwnProperty) { throw new Error('Prototype method evaluated as falsy'); } assert.strictEqual({}.hasOwnProperty ? true : false, true); rollup-3.29.4/test/function/samples/bundle-facade-order/000077500000000000000000000000001450520414700231635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/bundle-facade-order/_config.js000066400000000000000000000013711450520414700251270ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'respects the order of entry points when there are additional facades for chunks', options: { input: { main: 'main', 'main-alias': 'main', other: 'other' }, plugins: { name: 'test-plugin', generateBundle(options, bundle) { assert.deepStrictEqual( Object.keys(bundle).map(id => [id, bundle[id].code]), [ ['main.js', "'use strict';\n\nvar main = 'main1';\n\nmodule.exports = main;\n"], ['other.js', "'use strict';\n\nvar other = 'main2';\n\nmodule.exports = other;\n"], [ 'main-alias.js', "'use strict';\n\nvar main = require('./main.js');\n\n\n\nmodule.exports = main;\n" ] ] ); } } } }); rollup-3.29.4/test/function/samples/bundle-facade-order/main.js000066400000000000000000000000301450520414700244360ustar00rootroot00000000000000export default 'main1'; rollup-3.29.4/test/function/samples/bundle-facade-order/other.js000066400000000000000000000000301450520414700246330ustar00rootroot00000000000000export default 'main2'; rollup-3.29.4/test/function/samples/call-external-function/000077500000000000000000000000001450520414700237565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/call-external-function/_config.js000066400000000000000000000003101450520414700257120ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles call of aliased external function (#957)', warnings() {}, context: { require(id) { if (id === 'foo') { return () => 42; } } } }); rollup-3.29.4/test/function/samples/call-external-function/foo.js000066400000000000000000000000531450520414700250750ustar00rootroot00000000000000import foo from 'foo'; export default foo; rollup-3.29.4/test/function/samples/call-external-function/main.js000066400000000000000000000001111450520414700252310ustar00rootroot00000000000000import foo_ from './foo.js'; var foo = foo_; assert.equal( foo(), 42 ); rollup-3.29.4/test/function/samples/call-marked-pure-with-plugin-parse-ast/000077500000000000000000000000001450520414700266675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/call-marked-pure-with-plugin-parse-ast/_config.js000066400000000000000000000014411450520414700306310ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'external function calls marked with pure comment do not have effects and should be removed even if parsed by PluginContext.parse method', options: { external: ['socks'], plugins: [ { transform(code) { const comments = []; const ast = this.parse(code, { onComment: comments }); if (comments.length != 5 || comments.some(({ value }) => !value.includes('PURE'))) { throw new Error('failed to get comments'); } return { ast, code, map: null }; } } ] }, context: { require(id) { if (id === 'socks') { return () => { throw new Error('Not all socks were removed.'); }; } } }, code(code) { assert.ok(code.search(/socks\(\)/) === -1); } }); rollup-3.29.4/test/function/samples/call-marked-pure-with-plugin-parse-ast/main.js000066400000000000000000000002221450520414700301450ustar00rootroot00000000000000import socks from 'socks'; /*#__PURE__*/ socks(); /* #__PURE__*/ socks(); /*#__PURE__ */ socks(); /* #__PURE__ */ socks(); // #__PURE__ socks(); rollup-3.29.4/test/function/samples/call-marked-pure/000077500000000000000000000000001450520414700225255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/call-marked-pure/_config.js000066400000000000000000000006261450520414700244730ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'external function calls marked with pure comment do not have effects', options: { external: ['socks'] }, context: { require(id) { if (id === 'socks') { return () => { throw new Error('Not all socks were removed.'); }; } } }, code(code) { assert.ok(code.search(/socks\(\)/) === -1); } }); rollup-3.29.4/test/function/samples/call-marked-pure/main.js000066400000000000000000000002221450520414700240030ustar00rootroot00000000000000import socks from 'socks'; /*#__PURE__*/ socks(); /* #__PURE__*/ socks(); /*#__PURE__ */ socks(); /* #__PURE__ */ socks(); // #__PURE__ socks(); rollup-3.29.4/test/function/samples/call-non-function-default-exports/000077500000000000000000000000001450520414700260525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/call-non-function-default-exports/_config.js000066400000000000000000000001251450520414700300120ustar00rootroot00000000000000module.exports = defineTest({ description: 'calls non-function default exports' }); rollup-3.29.4/test/function/samples/call-non-function-default-exports/foo.js000066400000000000000000000002001450520414700271630ustar00rootroot00000000000000function x () { global.answer = 'x'; } function y () { global.answer = 'y'; } export default Math.random() < 0.5 ? x : y; rollup-3.29.4/test/function/samples/call-non-function-default-exports/main.js000066400000000000000000000001171450520414700273330ustar00rootroot00000000000000import foo from './foo.js'; foo(); assert.ok( /[xy]/.test( global.answer ) ); rollup-3.29.4/test/function/samples/can-import-self-treeshake/000077500000000000000000000000001450520414700243515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/can-import-self-treeshake/_config.js000066400000000000000000000006051450520414700263140ustar00rootroot00000000000000const path = require('node:path'); const ID_LIB = path.join(__dirname, 'lib.js'); module.exports = defineTest({ description: 'direct self import', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_LIB, ID_LIB], message: 'Circular dependency: lib.js -> lib.js' }, { code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "main".', names: ['main'] } ] }); rollup-3.29.4/test/function/samples/can-import-self-treeshake/lib.js000066400000000000000000000001271450520414700254550ustar00rootroot00000000000000import * as lib from './lib'; export const op = x => x * x; export const run = () => 4;rollup-3.29.4/test/function/samples/can-import-self-treeshake/main.js000066400000000000000000000000461450520414700256330ustar00rootroot00000000000000import { run } from './lib.js'; run();rollup-3.29.4/test/function/samples/can-import-self/000077500000000000000000000000001450520414700224005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/can-import-self/_config.js000066400000000000000000000006221450520414700243420ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_LIB = path.join(__dirname, 'lib.js'); module.exports = defineTest({ description: 'a module importing its own bindings', exports(exports) { assert.equal(exports.result, 4); }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_LIB, ID_LIB], message: 'Circular dependency: lib.js -> lib.js' } ] }); rollup-3.29.4/test/function/samples/can-import-self/lib.js000066400000000000000000000001411450520414700235000ustar00rootroot00000000000000import * as lib from './lib'; export const op = x => x * x; export const run = () => lib.op( 2 );rollup-3.29.4/test/function/samples/can-import-self/main.js000066400000000000000000000000741450520414700236630ustar00rootroot00000000000000import { run } from './lib.js'; export const result = run();rollup-3.29.4/test/function/samples/cannot-call-external-namespace/000077500000000000000000000000001450520414700253455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cannot-call-external-namespace/_config.js000066400000000000000000000005411450520414700273070ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'warns if code calls an external namespace', options: { external: ['fs'] }, warnings(warnings) { assert.deepStrictEqual(warnings.map(String), [ 'main.js (4:1) Cannot call a namespace ("foo").', 'main.js (8:1) Cannot call a namespace ("foo").' ]); } }); rollup-3.29.4/test/function/samples/cannot-call-external-namespace/main.js000066400000000000000000000001271450520414700266270ustar00rootroot00000000000000import * as foo from 'fs'; try { foo(); } catch (e) {} try { foo``; } catch (e) {} rollup-3.29.4/test/function/samples/cannot-call-internal-namespace/000077500000000000000000000000001450520414700253375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cannot-call-internal-namespace/_config.js000066400000000000000000000004761450520414700273100ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'warns if code calls an internal namespace', warnings(warnings) { assert.deepStrictEqual(warnings.map(String), [ 'main.js (4:1) Cannot call a namespace ("foo").', 'main.js (8:1) Cannot call a namespace ("foo").' ]); } }); rollup-3.29.4/test/function/samples/cannot-call-internal-namespace/foo.js000066400000000000000000000000241450520414700264540ustar00rootroot00000000000000export const a = 1; rollup-3.29.4/test/function/samples/cannot-call-internal-namespace/main.js000066400000000000000000000001251450520414700266170ustar00rootroot00000000000000import * as foo from './foo.js'; try { foo(); } catch {} try { foo``; } catch {} rollup-3.29.4/test/function/samples/cannot-resolve-sourcemap-warning/000077500000000000000000000000001450520414700257765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cannot-resolve-sourcemap-warning/_config.js000066400000000000000000000020441450520414700277400ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'handles when a sourcemap cannot be resolved in a warning', options: { plugins: { name: 'test-plugin', transform() { return { code: 'export default this', map: { mappings: '' } }; } } }, warnings: [ { cause: { message: "Can't resolve original location of error." }, code: 'SOURCEMAP_ERROR', id: ID_MAIN, loc: { column: 15, file: ID_MAIN, line: 1 }, message: "Error when using sourcemap for reporting an error: Can't resolve original location of error.", pos: 15 }, { code: 'THIS_IS_UNDEFINED', frame: ` 1: export default this ^ `, id: ID_MAIN, loc: { column: 15, file: ID_MAIN, line: 1 }, message: "The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten", pos: 15, url: 'https://rollupjs.org/troubleshooting/#error-this-is-undefined' } ] }); rollup-3.29.4/test/function/samples/cannot-resolve-sourcemap-warning/main.js000066400000000000000000000000411450520414700272530ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/catch-block-scope/000077500000000000000000000000001450520414700226615ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/catch-block-scope/_config.js000066400000000000000000000001251450520414700246210ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses correct scope in catch blocks' }); rollup-3.29.4/test/function/samples/catch-block-scope/main.js000066400000000000000000000004321450520414700241420ustar00rootroot00000000000000try { throw 'FAIL'; } catch (t) { var t = 'PASS'; assert.strictEqual(t, 'PASS'); } let a = 1; let def = 'PASS2'; try { throw ['FAIL2', 'PASS1']; } catch ({ [a]: b, 3: d = def }) { let a = 0, def = 'FAIL3'; assert.strictEqual(b, 'PASS1'); assert.strictEqual(d, 'PASS2'); } rollup-3.29.4/test/function/samples/catch-dynamic-import-failure/000077500000000000000000000000001450520414700250415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/catch-dynamic-import-failure/_config.js000066400000000000000000000010441450520414700270020ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows catching failed dynamic imports', options: { input: ['main', 'exists-default'], external: ['does-not-exist'] }, exports(exports) { return exports.then(result => { assert.strictEqual(result[0].message, 'exists-named'); assert.strictEqual(result[1].message, 'exists-default'); const expectedError = "Cannot find package 'does-not-exist'"; assert.strictEqual(result[2].message.slice(0, expectedError.length), expectedError); }); } }); rollup-3.29.4/test/function/samples/catch-dynamic-import-failure/exists-default.js000066400000000000000000000000661450520414700303420ustar00rootroot00000000000000export default 42; throw new Error('exists-default'); rollup-3.29.4/test/function/samples/catch-dynamic-import-failure/exists-named.js000066400000000000000000000000721450520414700277770ustar00rootroot00000000000000export const value = 42; throw new Error('exists-named'); rollup-3.29.4/test/function/samples/catch-dynamic-import-failure/main.js000066400000000000000000000002571450520414700263270ustar00rootroot00000000000000export default Promise.all([ import('./exists-named.js').catch(err => err), import('./exists-default.js').catch(err => err), import('does-not-exist').catch(err => err) ]); rollup-3.29.4/test/function/samples/catch-scope-shadowing/000077500000000000000000000000001450520414700235525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/catch-scope-shadowing/_config.js000066400000000000000000000001521450520414700255120ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly associates shadowed variables in catch scopes' }); rollup-3.29.4/test/function/samples/catch-scope-shadowing/main.js000066400000000000000000000004611450520414700250350ustar00rootroot00000000000000var e = 'failed1', x = 'value'; (function () { try { // empty } catch (e) { var e = 'failed2'; } assert.strictEqual(e, undefined); assert.strictEqual(x, undefined); x = 'failed3'; return; try { not_reached(); } catch (x) { var x = 'failed4'; } })(); assert.strictEqual(x, 'value'); rollup-3.29.4/test/function/samples/catch-scope-variables/000077500000000000000000000000001450520414700235375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/catch-scope-variables/_config.js000066400000000000000000000001401450520414700254740ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles variable declarations in catch scopes' }); rollup-3.29.4/test/function/samples/catch-scope-variables/main.js000066400000000000000000000004431450520414700250220ustar00rootroot00000000000000var outsideVar = 'outside'; let outsideLet = 'outside'; try { throw new Error(); } catch (e) { var outsideVar = 'inside'; let outsideLet = 'inside'; var insideVar = 'inside'; } assert.equal(outsideVar, 'inside'); assert.equal(outsideLet, 'outside'); assert.equal(insideVar, 'inside'); rollup-3.29.4/test/function/samples/chained-mutable-array-methods/000077500000000000000000000000001450520414700251775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/chained-mutable-array-methods/_config.js000066400000000000000000000004001450520414700271330ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'recognizes side-effects when applying mutable array methods to chained array methods (#3555)', exports(exports) { assert.deepStrictEqual(exports.a, ['PASS']); } }); rollup-3.29.4/test/function/samples/chained-mutable-array-methods/main.js000066400000000000000000000001521450520414700264570ustar00rootroot00000000000000function f(x) { return (x ? [] : ['FAIL']).map(o => o); } export const a = f(0); a.splice(0, 1, 'PASS'); rollup-3.29.4/test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/000077500000000000000000000000001450520414700321675ustar00rootroot00000000000000_config.js000066400000000000000000000016741450520414700340620ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/check-exports-exportedBindings-as-a-supplementary-testconst assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_MODULE = path.join(__dirname, 'module.js'); const ID_MODULE_2 = path.join(__dirname, 'module2.js'); const expectedResult = { [ID_MAIN]: { exports: ['moduleAlias', '*'], exportedBindings: { '.': [], './module.js': ['moduleAlias', '*'] } }, [ID_MODULE]: { exports: ['default', 'module', '*'], exportedBindings: { '.': ['default', 'module'], './module2.js': ['*'] } }, [ID_MODULE_2]: { exports: ['module2'], exportedBindings: { '.': ['module2'] } } }; module.exports = defineTest({ description: 'check exports and exportedBindings in moduleParsed as a supplementary test', options: { plugins: { name: 'test-plugin', moduleParsed(moduleInfo) { const { exports, exportedBindings, id } = moduleInfo; assert.deepStrictEqual({ exports, exportedBindings }, expectedResult[id]); } } } }); rollup-3.29.4/test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/main.js000066400000000000000000000001431450520414700334470ustar00rootroot00000000000000export * from './module.js'; export { module as moduleAlias } from './module.js'; assert.ok(true); rollup-3.29.4/test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/module.js000066400000000000000000000001111450520414700340030ustar00rootroot00000000000000export * from './module2.js'; export default 1; export const module = 1; module2.js000066400000000000000000000000321450520414700340100ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/check-exports-exportedBindings-as-a-supplementary-testexport const module2 = 1; rollup-3.29.4/test/function/samples/check-resolve-for-entry/000077500000000000000000000000001450520414700240555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/check-resolve-for-entry/_config.js000066400000000000000000000004221450520414700260150ustar00rootroot00000000000000module.exports = defineTest({ description: 'checks that entry is resolved', options: { input: 'not/a/path/that/actually/really/exists' }, error: { code: 'UNRESOLVED_ENTRY', message: 'Could not resolve entry module "not/a/path/that/actually/really/exists".' } }); rollup-3.29.4/test/function/samples/chunk-external-dependency-execution-order/000077500000000000000000000000001450520414700275565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/chunk-external-dependency-execution-order/_config.js000066400000000000000000000007421450520414700315230ustar00rootroot00000000000000const assert = require('node:assert'); const executionOrder = []; module.exports = defineTest({ description: 'Uses correct execution order when several modules in a chunk have external dependencies', context: { executionOrder, require(id) { executionOrder.push(id); return {}; } }, options: { external: ['external-first', 'external-second'] }, exports() { assert.deepStrictEqual(executionOrder, ['external-first', 'external-second', 'dep', 'main']); } }); rollup-3.29.4/test/function/samples/chunk-external-dependency-execution-order/dep.js000066400000000000000000000000661450520414700306660ustar00rootroot00000000000000import 'external-second'; executionOrder.push('dep'); rollup-3.29.4/test/function/samples/chunk-external-dependency-execution-order/main.js000066400000000000000000000001111450520414700310310ustar00rootroot00000000000000import 'external-first'; import './dep.js'; executionOrder.push('main'); rollup-3.29.4/test/function/samples/chunking-duplicate-reexport/000077500000000000000000000000001450520414700250245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/chunking-duplicate-reexport/_config.js000066400000000000000000000005011450520414700267620ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles duplicate reexports when using dynamic imports', exports(exports) { return exports.then(result => assert.deepStrictEqual(result, [ { __proto__: null, answer: 42 }, { __proto__: null, answer: 42 } ]) ); } }); rollup-3.29.4/test/function/samples/chunking-duplicate-reexport/chunk1.js000066400000000000000000000000431450520414700265500ustar00rootroot00000000000000export { answer } from './lib.js'; rollup-3.29.4/test/function/samples/chunking-duplicate-reexport/chunk2.js000066400000000000000000000000431450520414700265510ustar00rootroot00000000000000export { answer } from './lib.js'; rollup-3.29.4/test/function/samples/chunking-duplicate-reexport/lib.js000066400000000000000000000000321450520414700261230ustar00rootroot00000000000000export const answer = 42; rollup-3.29.4/test/function/samples/chunking-duplicate-reexport/main.js000066400000000000000000000001141450520414700263020ustar00rootroot00000000000000export default Promise.all([import('./chunk1.js'), import('./chunk2.js')]); rollup-3.29.4/test/function/samples/circular-default-exports/000077500000000000000000000000001450520414700243305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/circular-default-exports/_config.js000066400000000000000000000004631450520414700262750ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'handles circular default exports', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_MAIN], message: 'Circular dependency: main.js -> main.js' } ] }); rollup-3.29.4/test/function/samples/circular-default-exports/main.js000066400000000000000000000000621450520414700256100ustar00rootroot00000000000000import foo from './main.js'; export default foo; rollup-3.29.4/test/function/samples/circular-missed-reexports-2/000077500000000000000000000000001450520414700246565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/circular-missed-reexports-2/_config.js000066400000000000000000000011051450520414700266150ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEP1 = path.join(__dirname, 'dep1.js'); const ID_DEP2 = path.join(__dirname, 'dep2.js'); module.exports = defineTest({ description: 'handles circular reexports', exports(exports) { assert.strictEqual(exports.exists, 42); }, error: { code: 'CIRCULAR_REEXPORT', exporter: ID_DEP1, message: '"doesNotExist" cannot be exported from "dep1.js" as it is a reexport that references itself.', watchFiles: [ID_DEP1, ID_DEP2, ID_MAIN] } }); rollup-3.29.4/test/function/samples/circular-missed-reexports-2/dep1.js000066400000000000000000000000521450520414700260420ustar00rootroot00000000000000export { doesNotExist } from './dep2.js'; rollup-3.29.4/test/function/samples/circular-missed-reexports-2/dep2.js000066400000000000000000000000521450520414700260430ustar00rootroot00000000000000export { doesNotExist } from './dep1.js'; rollup-3.29.4/test/function/samples/circular-missed-reexports-2/main.js000066400000000000000000000000521450520414700261350ustar00rootroot00000000000000export { doesNotExist } from './dep1.js'; rollup-3.29.4/test/function/samples/circular-missed-reexports/000077500000000000000000000000001450520414700245175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/circular-missed-reexports/_config.js000066400000000000000000000033221450520414700264610ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEP1 = path.join(__dirname, 'dep1.js'); const ID_DEP2 = path.join(__dirname, 'dep2.js'); module.exports = defineTest({ description: 'handles circular reexports', exports(exports) { assert.strictEqual(exports.exists, 42); }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_DEP1, ID_DEP2, ID_DEP1], message: 'Circular dependency: dep1.js -> dep2.js -> dep1.js' }, { code: 'CIRCULAR_DEPENDENCY', ids: [ID_DEP1, ID_DEP1], message: 'Circular dependency: dep1.js -> dep1.js' }, { binding: 'doesNotExist', code: 'MISSING_EXPORT', id: ID_MAIN, message: '"doesNotExist" is not exported by "dep1.js", imported by "main.js".', exporter: ID_DEP1, pos: 17, loc: { file: ID_MAIN, line: 1, column: 17 }, frame: ` 1: import { exists, doesNotExist } from './dep1.js'; ^ 2: export { exists };`, url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module' }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_DEP1, id: ID_MAIN, message: 'Export "exists4" of module "dep1.js" was reexported through module "dep2.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "main.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.', reexporter: ID_DEP2 } ] }); rollup-3.29.4/test/function/samples/circular-missed-reexports/dep1.js000066400000000000000000000003051450520414700257040ustar00rootroot00000000000000export * from './dep2.js'; export { exists1 as exists } from './dep2.js'; export { exists3 as exists2 } from './dep1.js'; export { exists4 as exists3 } from './dep2.js'; export const exists4 = 42; rollup-3.29.4/test/function/samples/circular-missed-reexports/dep2.js000066400000000000000000000001131450520414700257020ustar00rootroot00000000000000export * from './dep1.js'; export { exists2 as exists1 } from './dep1.js'; rollup-3.29.4/test/function/samples/circular-missed-reexports/main.js000066400000000000000000000001051450520414700257750ustar00rootroot00000000000000import { exists, doesNotExist } from './dep1.js'; export { exists }; rollup-3.29.4/test/function/samples/circular-namespace-reexport-manual-chunks/000077500000000000000000000000001450520414700275505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/circular-namespace-reexport-manual-chunks/_config.js000066400000000000000000000067061450520414700315230ustar00rootroot00000000000000const path = require('node:path'); const ID_INDEX = path.join(__dirname, 'index.js'); const ID_TYPES = path.join(__dirname, 'types.js'); const ID_FORMATTERS = path.join(__dirname, 'formatters.js'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'correctly handles namespace reexports with circular dependencies when using manual chunks', options: { output: { manualChunks(id) { return path.basename(id); } } }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_INDEX, ID_TYPES, ID_INDEX], message: 'Circular dependency: index.js -> types.js -> index.js' }, { code: 'CIRCULAR_DEPENDENCY', ids: [ID_INDEX, ID_FORMATTERS, ID_INDEX], message: 'Circular dependency: index.js -> formatters.js -> index.js' }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_TYPES, id: ID_FORMATTERS, message: 'Export "LANGUAGES" of module "types.js" was reexported through module "index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "formatters.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.', reexporter: ID_INDEX }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_FORMATTERS, id: ID_MAIN, message: 'Export "*" of module "formatters.js" was reexported through module "index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "main.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.', reexporter: ID_INDEX }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_FORMATTERS, id: ID_MAIN, message: 'Export "*" of module "formatters.js" was reexported through module "index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "main.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.', reexporter: ID_INDEX }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_FORMATTERS, id: ID_TYPES, message: 'Export "*" of module "formatters.js" was reexported through module "index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "types.js" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.', reexporter: ID_INDEX }, { code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "index.js".', names: ['index.js'] } ] }); rollup-3.29.4/test/function/samples/circular-namespace-reexport-manual-chunks/formatters.js000066400000000000000000000001201450520414700322650ustar00rootroot00000000000000import { LANGUAGES } from './index.js'; export const format = () => LANGUAGES; rollup-3.29.4/test/function/samples/circular-namespace-reexport-manual-chunks/index.js000066400000000000000000000001301450520414700312070ustar00rootroot00000000000000export { LANGUAGES } from './types.js'; export * as formatters from './formatters.js'; rollup-3.29.4/test/function/samples/circular-namespace-reexport-manual-chunks/main.js000066400000000000000000000001031450520414700310240ustar00rootroot00000000000000import { formatters } from './index.js' export default formatters; rollup-3.29.4/test/function/samples/circular-namespace-reexport-manual-chunks/types.js000066400000000000000000000001231450520414700312460ustar00rootroot00000000000000import { formatters } from './index.js' export const LANGUAGES = () => formatters; rollup-3.29.4/test/function/samples/circular-namespace-reexport-preserve-modules/000077500000000000000000000000001450520414700303035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/circular-namespace-reexport-preserve-modules/_config.js000066400000000000000000000064771450520414700322630ustar00rootroot00000000000000const path = require('node:path'); const ID_INDEX = path.join(__dirname, 'index.js'); const ID_TYPES = path.join(__dirname, 'types.js'); const ID_FORMATTERS = path.join(__dirname, 'formatters.js'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'correctly handles namespace reexports with circular dependencies when preserving modules', options: { output: { preserveModules: true } }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_INDEX, ID_TYPES, ID_INDEX], message: 'Circular dependency: index.js -> types.js -> index.js' }, { code: 'CIRCULAR_DEPENDENCY', ids: [ID_INDEX, ID_FORMATTERS, ID_INDEX], message: 'Circular dependency: index.js -> formatters.js -> index.js' }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_FORMATTERS, id: ID_MAIN, message: 'Export "*" of module "formatters.js" was reexported through module "index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "main.js" to point directly to the exporting module or do not use "output.preserveModules" to ensure these modules end up in the same chunk.', reexporter: ID_INDEX }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_FORMATTERS, id: ID_MAIN, message: 'Export "*" of module "formatters.js" was reexported through module "index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "main.js" to point directly to the exporting module or do not use "output.preserveModules" to ensure these modules end up in the same chunk.', reexporter: ID_INDEX }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_FORMATTERS, id: ID_TYPES, message: 'Export "*" of module "formatters.js" was reexported through module "index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "types.js" to point directly to the exporting module or do not use "output.preserveModules" to ensure these modules end up in the same chunk.', reexporter: ID_INDEX }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_TYPES, id: ID_FORMATTERS, message: 'Export "LANGUAGES" of module "types.js" was reexported through module "index.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "formatters.js" to point directly to the exporting module or do not use "output.preserveModules" to ensure these modules end up in the same chunk.', reexporter: ID_INDEX } ] }); rollup-3.29.4/test/function/samples/circular-namespace-reexport-preserve-modules/formatters.js000066400000000000000000000001201450520414700330200ustar00rootroot00000000000000import { LANGUAGES } from './index.js'; export const format = () => LANGUAGES; rollup-3.29.4/test/function/samples/circular-namespace-reexport-preserve-modules/index.js000066400000000000000000000001301450520414700317420ustar00rootroot00000000000000export { LANGUAGES } from './types.js'; export * as formatters from './formatters.js'; rollup-3.29.4/test/function/samples/circular-namespace-reexport-preserve-modules/main.js000066400000000000000000000001031450520414700315570ustar00rootroot00000000000000import { formatters } from './index.js' export default formatters; rollup-3.29.4/test/function/samples/circular-namespace-reexport-preserve-modules/types.js000066400000000000000000000001231450520414700320010ustar00rootroot00000000000000import { formatters } from './index.js' export const LANGUAGES = () => formatters; rollup-3.29.4/test/function/samples/circular-preserve-modules/000077500000000000000000000000001450520414700245035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/circular-preserve-modules/_config.js000066400000000000000000000036501450520414700264510ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FIRST = path.join(__dirname, 'first.js'); const ID_SECOND = path.join(__dirname, 'second.js'); module.exports = defineTest({ description: 'correctly handles circular dependencies when preserving modules', options: { output: { preserveModules: true } }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_FIRST, ID_MAIN], message: 'Circular dependency: main.js -> first.js -> main.js' }, { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_SECOND, ID_MAIN], message: 'Circular dependency: main.js -> second.js -> main.js' }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_SECOND, id: ID_FIRST, message: 'Export "second" of module "second.js" was reexported through module "main.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "first.js" to point directly to the exporting module or do not use "output.preserveModules" to ensure these modules end up in the same chunk.', reexporter: ID_MAIN }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_FIRST, id: ID_SECOND, message: 'Export "first" of module "first.js" was reexported through module "main.js" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "second.js" to point directly to the exporting module or do not use "output.preserveModules" to ensure these modules end up in the same chunk.', reexporter: ID_MAIN } ] }); rollup-3.29.4/test/function/samples/circular-preserve-modules/first.js000066400000000000000000000001511450520414700261650ustar00rootroot00000000000000import { second } from './main.js'; export const first = 'first'; export const getSecond = () => second; rollup-3.29.4/test/function/samples/circular-preserve-modules/main.js000066400000000000000000000003371450520414700257700ustar00rootroot00000000000000import { getSecond } from './first'; import { second, getFirst } from './second'; export { first } from './first.js'; export { second }; assert.strictEqual(getFirst(), 'first'); assert.strictEqual(getSecond(), 'second'); rollup-3.29.4/test/function/samples/circular-preserve-modules/second.js000066400000000000000000000001501450520414700263100ustar00rootroot00000000000000import { first } from './main.js'; export const second = 'second'; export const getFirst = () => first; rollup-3.29.4/test/function/samples/circular-reexport/000077500000000000000000000000001450520414700230525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/circular-reexport/_config.js000066400000000000000000000005541450520414700250200ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'throws proper error for circular reexports', error: { code: 'CIRCULAR_REEXPORT', exporter: ID_MAIN, message: '"foo" cannot be exported from "main.js" as it is a reexport that references itself.', watchFiles: [ID_MAIN] } }); rollup-3.29.4/test/function/samples/circular-reexport/main.js000066400000000000000000000000621450520414700243320ustar00rootroot00000000000000import { foo } from './main.js'; export { foo }; rollup-3.29.4/test/function/samples/class-method-getter-properties/000077500000000000000000000000001450520414700254455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-method-getter-properties/_config.js000066400000000000000000000001321450520414700274030ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects getters added to class methods' }); rollup-3.29.4/test/function/samples/class-method-getter-properties/main.js000066400000000000000000000010641450520414700267300ustar00rootroot00000000000000let effect = false; class TestSuper { constructor() { } static bar() {} } class Test extends TestSuper { constructor() { super(); } static foo() {} } const setEffect = { get() { effect = true; }, }; const addGetters = obj => { Object.defineProperty(obj, 'x', setEffect); Object.defineProperty(obj.foo, 'x', setEffect); Object.defineProperty(obj.bar, 'x', setEffect); }; const checkEffect = () => { assert.ok(effect); effect = false; }; addGetters(Test); Test.x; checkEffect(); Test.foo.x; checkEffect(); TestSuper.bar.x; checkEffect(); rollup-3.29.4/test/function/samples/class-method-mutation/000077500000000000000000000000001450520414700236215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-method-mutation/_config.js000066400000000000000000000001241450520414700255600ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of class methods' }); rollup-3.29.4/test/function/samples/class-method-mutation/main.js000066400000000000000000000002651450520414700251060ustar00rootroot00000000000000let effect = false; class Foo { method() {} } const foo = new Foo(); Object.defineProperty(foo.method, 'effect', { get() { effect = true; } }); Foo.prototype.method.effect; rollup-3.29.4/test/function/samples/class-method-mutations/000077500000000000000000000000001450520414700240045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-method-mutations/_config.js000066400000000000000000000004231450520414700257450ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'includes variable mutations in class methods if tree-shaking is disabled', options: { treeshake: false }, async exports({ promise }) { assert.strictEqual(await promise, 'ok'); } }); rollup-3.29.4/test/function/samples/class-method-mutations/main.js000066400000000000000000000003171450520414700252670ustar00rootroot00000000000000class LookupService { updateLookupById() { return new Promise((resolve) => { let result; result = 'ok'; resolve(result); }); } } export const promise = new LookupService().updateLookupById();rollup-3.29.4/test/function/samples/class-method-returns/000077500000000000000000000000001450520414700234635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-method-returns/_config.js000066400000000000000000000001351450520414700254240ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes return values of class methods' }); rollup-3.29.4/test/function/samples/class-method-returns/main.js000066400000000000000000000010451450520414700247450ustar00rootroot00000000000000const a = { mutated: false }; const b = { mutated: false }; const c = { mutated: false }; const d = { mutated: false }; class Foo { static staticProp = () => a; static staticMethod() { return b; } prop = () => c; method() { return d; } } Foo.staticProp().mutated = true; assert.ok(a.mutated ? true : false); Foo.staticMethod().mutated = true; assert.ok(b.mutated ? true : false); const foo = new Foo(); foo.prop().mutated = true; assert.ok(c.mutated ? true : false); foo.method().mutated = true; assert.ok(d.mutated ? true : false); rollup-3.29.4/test/function/samples/class-methods-not-renamed/000077500000000000000000000000001450520414700243555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-methods-not-renamed/_config.js000066400000000000000000000002011450520414700263100ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not rename class methods incorrectly', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/class-methods-not-renamed/foo.js000066400000000000000000000002721450520414700254770ustar00rootroot00000000000000import { bar } from 'path'; // path, so the test doesn't fail for unrelated reasons... export default class Foo { bar () { if ( Math.random() < 0 ) return bar(); return true; } } rollup-3.29.4/test/function/samples/class-methods-not-renamed/main.js000066400000000000000000000000701450520414700256340ustar00rootroot00000000000000import Foo from './foo'; assert.ok( new Foo().bar() ); rollup-3.29.4/test/function/samples/class-name-conflict-2/000077500000000000000000000000001450520414700233615ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-name-conflict-2/_config.js000066400000000000000000000001501450520414700253170ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not shadow variables when preserving class names' }); rollup-3.29.4/test/function/samples/class-name-conflict-2/bar.js000066400000000000000000000000521450520414700244600ustar00rootroot00000000000000export class bar { static base = true; } rollup-3.29.4/test/function/samples/class-name-conflict-2/declaration.js000066400000000000000000000002541450520414700262050ustar00rootroot00000000000000import { foo as foo$ } from './foo.js'; { class foo extends foo$ { static test() { assert.ok(foo.base); } } assert.strictEqual(foo.name, 'foo'); foo.test(); } rollup-3.29.4/test/function/samples/class-name-conflict-2/expression.js000066400000000000000000000002631450520414700261170ustar00rootroot00000000000000import { bar as bar$ } from './bar.js'; { let bar = class extends bar$ { static test() { assert.ok(bar.base); } }; assert.strictEqual(bar.name, 'bar'); bar.test(); } rollup-3.29.4/test/function/samples/class-name-conflict-2/foo.js000066400000000000000000000000521450520414700244770ustar00rootroot00000000000000export class foo { static base = true; } rollup-3.29.4/test/function/samples/class-name-conflict-2/main.js000066400000000000000000000000571450520414700246450ustar00rootroot00000000000000import './expression'; import './declaration'; rollup-3.29.4/test/function/samples/class-name-conflict-3/000077500000000000000000000000001450520414700233625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-name-conflict-3/_config.js000066400000000000000000000001501450520414700253200ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not shadow variables when preserving class names' }); rollup-3.29.4/test/function/samples/class-name-conflict-3/foo.js000066400000000000000000000000341450520414700245000ustar00rootroot00000000000000export default class Foo {} rollup-3.29.4/test/function/samples/class-name-conflict-3/main.js000066400000000000000000000003471450520414700246500ustar00rootroot00000000000000import Bar from './foo'; const wrapper = () => { class Foo extends Bar { static assertName() { assert.strictEqual(this.name, 'Foo'); assert.strictEqual(super.name, 'Foo'); } } return Foo; }; wrapper().assertName(); rollup-3.29.4/test/function/samples/class-name-conflict-4/000077500000000000000000000000001450520414700233635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-name-conflict-4/_config.js000066400000000000000000000001501450520414700253210ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not shadow variables when preserving class names' }); rollup-3.29.4/test/function/samples/class-name-conflict-4/foo.js000066400000000000000000000000761450520414700245070ustar00rootroot00000000000000var Foo = class {}; export default Foo; Foo = 'reassigned'; rollup-3.29.4/test/function/samples/class-name-conflict-4/main.js000066400000000000000000000003541450520414700246470ustar00rootroot00000000000000import Bar from './reexport'; const wrapper = () => { class Foo extends Bar { static assertName() { assert.strictEqual(this.name, 'Foo'); assert.strictEqual(super.name, 'Foo'); } } return Foo; }; wrapper().assertName(); rollup-3.29.4/test/function/samples/class-name-conflict-4/reexport.js000066400000000000000000000000551450520414700255710ustar00rootroot00000000000000import Foo from './foo'; export default Foo; rollup-3.29.4/test/function/samples/class-name-conflict/000077500000000000000000000000001450520414700232225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-name-conflict/_config.js000066400000000000000000000001451450520414700251640ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves class names even if the class is renamed' }); rollup-3.29.4/test/function/samples/class-name-conflict/declaration1.js000066400000000000000000000000631450520414700261250ustar00rootroot00000000000000class foo {} assert.strictEqual(foo.name, 'foo'); rollup-3.29.4/test/function/samples/class-name-conflict/declaration2.js000066400000000000000000000000631450520414700261260ustar00rootroot00000000000000class foo {} assert.strictEqual(foo.name, 'foo'); rollup-3.29.4/test/function/samples/class-name-conflict/expression1.js000066400000000000000000000000721450520414700260370ustar00rootroot00000000000000let foo = class {}; assert.strictEqual(foo.name, 'foo'); rollup-3.29.4/test/function/samples/class-name-conflict/expression2.js000066400000000000000000000000721450520414700260400ustar00rootroot00000000000000let foo = class {}; assert.strictEqual(foo.name, 'foo'); rollup-3.29.4/test/function/samples/class-name-conflict/main.js000066400000000000000000000001421450520414700245010ustar00rootroot00000000000000import './expression1'; import './declaration1'; import './expression2'; import './declaration2'; rollup-3.29.4/test/function/samples/class-prop-returns/000077500000000000000000000000001450520414700231635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/class-prop-returns/_config.js000066400000000000000000000006121450520414700251240ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not remove calls to props without value', exports({ callProp, callStaticProp }) { let hasError = false; try { callStaticProp(); } catch { hasError = true; } assert.ok(hasError); hasError = false; try { callProp(); } catch { hasError = true; } assert.ok(hasError); } }); rollup-3.29.4/test/function/samples/class-prop-returns/main.js000066400000000000000000000003021450520414700244400ustar00rootroot00000000000000class Foo { static staticProp; prop; } export const callStaticProp = () => Foo.staticProp() || false; export const callProp = () => { const foo = new Foo(); return foo.prop() || false; }; rollup-3.29.4/test/function/samples/code-splitting-export-default-from-entry/000077500000000000000000000000001450520414700273665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/code-splitting-export-default-from-entry/_config.js000066400000000000000000000004041450520414700313260ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'correctly imports the default from an entry point', options: { input: ['main', 'dep'] }, exports(exports) { assert.deepStrictEqual(exports, { value: 42 }); } }); rollup-3.29.4/test/function/samples/code-splitting-export-default-from-entry/dep.js000066400000000000000000000000231450520414700304670ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/code-splitting-export-default-from-entry/main.js000066400000000000000000000000501450520414700306430ustar00rootroot00000000000000export {default as value} from './dep'; rollup-3.29.4/test/function/samples/compact-multiple-imports/000077500000000000000000000000001450520414700243525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/compact-multiple-imports/_config.js000066400000000000000000000004431450520414700263150ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly handles empty external imports in compact mode', context: { require(id) { return { value: id[id.length - 1] }; } }, options: { external(id) { return id.startsWith('external'); }, output: { compact: true } } }); rollup-3.29.4/test/function/samples/compact-multiple-imports/main.js000066400000000000000000000002721450520414700256350ustar00rootroot00000000000000import 'external-1'; import 'external-2'; import {value as a} from 'external-3'; import {value as b} from 'external-4'; import 'external-5'; assert.equal(a, '3'); assert.equal(b, '4'); rollup-3.29.4/test/function/samples/compact/000077500000000000000000000000001450520414700210265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/compact/_config.js000066400000000000000000000007241450520414700227730ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'compact output with compact: true', options: { external: ['external'], output: { compact: true, generatedCode: { symbols: true } } }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_MAIN], message: 'Circular dependency: main.js -> main.js' } ], context: { require() { return 42; } } }); rollup-3.29.4/test/function/samples/compact/main.js000066400000000000000000000003711450520414700223110ustar00rootroot00000000000000import x from 'external'; import * as self from './main.js'; assert.equal(self && self['de' + 'fault'](), 42); export default function foo() { return x; } import('./main.js').then(self => { assert.equal(self && self['de' + 'fault'](), 42); }); rollup-3.29.4/test/function/samples/conditional-catch/000077500000000000000000000000001450520414700227635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/conditional-catch/_config.js000066400000000000000000000001331450520414700247220ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles conditional catch blocks (#3869)' }); rollup-3.29.4/test/function/samples/conditional-catch/main.js000066400000000000000000000003001450520414700242360ustar00rootroot00000000000000function g() { var result; g: { try { break g; } catch (_) {} return; } try { throw 'Expected'; } catch (e) { result = e; } assert.strictEqual(result, 'Expected'); } g(); rollup-3.29.4/test/function/samples/conditional-definition/000077500000000000000000000000001450520414700240315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/conditional-definition/_config.js000066400000000000000000000001541450520414700257730ustar00rootroot00000000000000module.exports = defineTest({ description: 'avoids infinite loop when testing conditional definitions' }); rollup-3.29.4/test/function/samples/conditional-definition/env.js000066400000000000000000000002441450520414700251570ustar00rootroot00000000000000var env; if ( typeof window !== 'undefined' ) { env = function () { return 'browser'; }; } else { env = function () { return 'node'; }; } export { env }; rollup-3.29.4/test/function/samples/conditional-definition/main.js000066400000000000000000000002251450520414700253120ustar00rootroot00000000000000import { env } from './env'; assert.equal( env(), 'node' ); assert.equal( env(), 'node' ); // to check that the env Declaration is only tested once rollup-3.29.4/test/function/samples/conditionals-deoptimization/000077500000000000000000000000001450520414700251235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/conditionals-deoptimization/_config.js000066400000000000000000000005061450520414700270660ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles deoptimization of conditionals', exports(exports) { assert.deepStrictEqual(exports, { cond1a: true, cond1b: true, cond2a: true, cond2b: true, log1a: true, log1b: true, log2a: true, log2b: true }); } }); rollup-3.29.4/test/function/samples/conditionals-deoptimization/main.js000066400000000000000000000013641450520414700264110ustar00rootroot00000000000000export let cond1a = false; export let cond1b = false; export let cond2a = false; export let cond2b = false; export let log1a = false; export let log1b = false; export let log2a = false; export let log2b = false; let flag = false; checkConditional1(); checkConditional2(); checkLogical1(); checkLogical2(); flag = true; checkConditional1(); checkConditional2(); checkLogical1(); checkLogical2(); function checkConditional1() { if (flag ? true : false) cond1a = true; else cond1b = true; } function checkConditional2() { if (!flag ? true : false) cond2a = true; else cond2b = true; } function checkLogical1() { if (flag && true) log1a = true; else log1b = true; } function checkLogical2() { if (!flag && true) log2a = true; else log2b = true; } rollup-3.29.4/test/function/samples/configure-external-module-b/000077500000000000000000000000001450520414700247035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/configure-external-module-b/_config.js000066400000000000000000000004401450520414700266430ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows external module to be configured (b)', options: { external: ['path'] }, exports() { // @ts-expect-error missing types assert.equal(require('node:path').resolve.configured, 'yes'); } }); rollup-3.29.4/test/function/samples/configure-external-module-b/main.js000066400000000000000000000000751450520414700261670ustar00rootroot00000000000000import { resolve } from 'path'; resolve.configured = 'yes'; rollup-3.29.4/test/function/samples/configure-external-module/000077500000000000000000000000001450520414700244645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/configure-external-module/_config.js000066400000000000000000000003701450520414700264260ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows external module to be configured', options: { external: ['path'] }, exports() { assert.equal(require('node:path').resolve.configured, 'yes'); } }); rollup-3.29.4/test/function/samples/configure-external-module/main.js000066400000000000000000000001001450520414700257350ustar00rootroot00000000000000import * as path from 'path'; path.resolve.configured = 'yes'; rollup-3.29.4/test/function/samples/configure-relative-external-module/000077500000000000000000000000001450520414700262755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/configure-relative-external-module/_config.js000066400000000000000000000006741450520414700302460ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const mockedValue = { val: 'A value' }; module.exports = defineTest({ description: 'allows a nonexistent relative module to be configured as external', options: { external: [path.join(__dirname, './nonexistent-relative-dependency.js')] }, context: { require() { return mockedValue; } }, exports() { assert.equal(mockedValue.wasAltered, true); } }); rollup-3.29.4/test/function/samples/configure-relative-external-module/main.js000066400000000000000000000001401450520414700275520ustar00rootroot00000000000000import relativeDep from './nonexistent-relative-dependency.js'; relativeDep.wasAltered = true; rollup-3.29.4/test/function/samples/conflicting-reexports/000077500000000000000000000000001450520414700237305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/conflicting-reexports/named-import-external/000077500000000000000000000000001450520414700301445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/conflicting-reexports/named-import-external/_config.js000066400000000000000000000015201450520414700321040ustar00rootroot00000000000000const path = require('node:path'); const ID_REEXPORT = path.join(__dirname, 'reexport.js'); module.exports = defineTest({ description: 'warns when a conflicting binding is imported via a named import from external namespaces', warnings: [ { binding: 'foo', code: 'AMBIGUOUS_EXTERNAL_NAMESPACES', ids: ['first', 'second'], message: 'Ambiguous external namespace resolution: "reexport.js" re-exports "foo" from one of the external modules "first" and "second", guessing "first".', reexporter: ID_REEXPORT }, { code: 'UNUSED_EXTERNAL_IMPORT', exporter: 'second', ids: [ID_REEXPORT], message: '"foo" is imported from external module "second" but never used in "reexport.js".', names: ['foo'] } ], options: { external: ['first', 'second'] }, context: { require(id) { return { foo: id }; } } }); rollup-3.29.4/test/function/samples/conflicting-reexports/named-import-external/main.js000066400000000000000000000001101450520414700314160ustar00rootroot00000000000000import { foo } from './reexport.js'; assert.strictEqual(foo, 'first'); rollup-3.29.4/test/function/samples/conflicting-reexports/named-import-external/reexport.js000066400000000000000000000000571450520414700323540ustar00rootroot00000000000000export * from 'first'; export * from 'second'; rollup-3.29.4/test/function/samples/conflicting-reexports/named-import/000077500000000000000000000000001450520414700263245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/conflicting-reexports/named-import/_config.js000066400000000000000000000015341450520414700302710ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_REEXPORT = path.join(__dirname, 'reexport.js'); const ID_FIRST = path.join(__dirname, 'first.js'); const ID_SECOND = path.join(__dirname, 'second.js'); module.exports = defineTest({ description: 'throws when a conflicting binding is imported via a named import', error: { binding: 'foo', code: 'MISSING_EXPORT', exporter: ID_REEXPORT, id: ID_MAIN, url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module', pos: 9, loc: { column: 9, file: ID_MAIN, line: 1 }, frame: ` 1: import { foo } from './reexport.js'; ^ 2: 3: assert.strictEqual(foo, 1);`, watchFiles: [ID_FIRST, ID_MAIN, ID_REEXPORT, ID_SECOND], message: '"foo" is not exported by "reexport.js", imported by "main.js".' } }); rollup-3.29.4/test/function/samples/conflicting-reexports/named-import/first.js000066400000000000000000000000261450520414700300070ustar00rootroot00000000000000export const foo = 1; rollup-3.29.4/test/function/samples/conflicting-reexports/named-import/main.js000066400000000000000000000001021450520414700275770ustar00rootroot00000000000000import { foo } from './reexport.js'; assert.strictEqual(foo, 1); rollup-3.29.4/test/function/samples/conflicting-reexports/named-import/reexport.js000066400000000000000000000000711450520414700305300ustar00rootroot00000000000000export * from './first.js'; export * from './second.js'; rollup-3.29.4/test/function/samples/conflicting-reexports/named-import/second.js000066400000000000000000000000261450520414700301330ustar00rootroot00000000000000export const foo = 2; rollup-3.29.4/test/function/samples/conflicting-reexports/namespace-import/000077500000000000000000000000001450520414700271745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/conflicting-reexports/namespace-import/_config.js000066400000000000000000000021721450520414700311400ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FIRST = path.join(__dirname, 'first.js'); const ID_SECOND = path.join(__dirname, 'second.js'); const ID_REEXPORT = path.join(__dirname, 'reexport.js'); module.exports = defineTest({ description: 'warns when a conflicting binding is imported via a namespace import', warnings: [ { binding: 'foo', code: 'NAMESPACE_CONFLICT', ids: [ID_FIRST, ID_SECOND], message: 'Conflicting namespaces: "reexport.js" re-exports "foo" from one of the modules "first.js" and "second.js" (will be ignored).', reexporter: ID_REEXPORT }, { binding: 'foo', code: 'MISSING_EXPORT', exporter: ID_REEXPORT, id: ID_MAIN, message: '"foo" is not exported by "reexport.js", imported by "main.js".', url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module', pos: 125, loc: { column: 22, file: ID_MAIN, line: 4 }, frame: ` 2: 3: assert.deepStrictEqual(ns, { __proto__: null, bar: 1, baz: 2 }); 4: assert.strictEqual(ns.foo, undefined) ^` } ] }); rollup-3.29.4/test/function/samples/conflicting-reexports/namespace-import/first.js000066400000000000000000000000541450520414700306600ustar00rootroot00000000000000export const foo = 1; export const bar = 1; rollup-3.29.4/test/function/samples/conflicting-reexports/namespace-import/main.js000066400000000000000000000002141450520414700304530ustar00rootroot00000000000000import * as ns from './reexport.js'; assert.deepStrictEqual(ns, { __proto__: null, bar: 1, baz: 2 }); assert.strictEqual(ns.foo, undefined)rollup-3.29.4/test/function/samples/conflicting-reexports/namespace-import/reexport.js000066400000000000000000000000711450520414700314000ustar00rootroot00000000000000export * from './first.js'; export * from './second.js'; rollup-3.29.4/test/function/samples/conflicting-reexports/namespace-import/second.js000066400000000000000000000000541450520414700310040ustar00rootroot00000000000000export const foo = 2; export const baz = 2; rollup-3.29.4/test/function/samples/conflicting-reexports/same-binding/000077500000000000000000000000001450520414700262655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/conflicting-reexports/same-binding/_config.js000066400000000000000000000001711450520414700302260ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not fail when the same binding is reexported from different files' }); rollup-3.29.4/test/function/samples/conflicting-reexports/same-binding/first.js000066400000000000000000000000431450520414700277470ustar00rootroot00000000000000export { foo } from './shared.js'; rollup-3.29.4/test/function/samples/conflicting-reexports/same-binding/main.js000066400000000000000000000001021450520414700275400ustar00rootroot00000000000000import { foo } from './reexport.js'; assert.strictEqual(foo, 1); rollup-3.29.4/test/function/samples/conflicting-reexports/same-binding/reexport.js000066400000000000000000000000711450520414700304710ustar00rootroot00000000000000export * from './first.js'; export * from './second.js'; rollup-3.29.4/test/function/samples/conflicting-reexports/same-binding/second.js000066400000000000000000000000431450520414700300730ustar00rootroot00000000000000export { foo } from './shared.js'; rollup-3.29.4/test/function/samples/conflicting-reexports/same-binding/shared.js000066400000000000000000000000261450520414700300670ustar00rootroot00000000000000export const foo = 1; rollup-3.29.4/test/function/samples/confused-default-identifier/000077500000000000000000000000001450520414700247505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/confused-default-identifier/_config.js000066400000000000000000000003071450520414700267120ustar00rootroot00000000000000module.exports = defineTest({ description: 'Rollup should not get confused and allow "default" as an identifier name', warnings() {} // suppress }); // https://github.com/rollup/rollup/issues/215 rollup-3.29.4/test/function/samples/confused-default-identifier/foo.js000066400000000000000000000000441450520414700260670ustar00rootroot00000000000000export default function Foo () { } rollup-3.29.4/test/function/samples/confused-default-identifier/main.js000066400000000000000000000001361450520414700262320ustar00rootroot00000000000000// export export {default as Foo} from './foo'; export default function () { // whatever } rollup-3.29.4/test/function/samples/consistent-renaming-b/000077500000000000000000000000001450520414700236065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming-b/_config.js000066400000000000000000000001151450520414700255450ustar00rootroot00000000000000module.exports = defineTest({ description: 'consistent renaming test b' }); rollup-3.29.4/test/function/samples/consistent-renaming-b/altdir/000077500000000000000000000000001450520414700250655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming-b/altdir/two.js000066400000000000000000000001261450520414700262330ustar00rootroot00000000000000function two () { // imported as _two by subdir/two.js return 2; } export { two }; rollup-3.29.4/test/function/samples/consistent-renaming-b/main.js000066400000000000000000000001651450520414700250720ustar00rootroot00000000000000import one from './subdir/one'; import Two from './subdir/two'; assert.equal( one(), 1 ); assert.equal( Two(), 2 ); rollup-3.29.4/test/function/samples/consistent-renaming-b/subdir/000077500000000000000000000000001450520414700250765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming-b/subdir/one.js000066400000000000000000000001341450520414700262130ustar00rootroot00000000000000import { two } from '../altdir/two'; export default function one () { return two() - 1; } rollup-3.29.4/test/function/samples/consistent-renaming-b/subdir/two.js000066400000000000000000000002001450520414700262350ustar00rootroot00000000000000import { two as _two } from '../altdir/two'; export default function two () { // imported as Two by main.js return _two(); } rollup-3.29.4/test/function/samples/consistent-renaming-c/000077500000000000000000000000001450520414700236075ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming-c/-internal.js000066400000000000000000000001061450520414700260330ustar00rootroot00000000000000/*** -internal.js */ function two () { return 99; } export { two }; rollup-3.29.4/test/function/samples/consistent-renaming-c/_config.js000066400000000000000000000001151450520414700255460ustar00rootroot00000000000000module.exports = defineTest({ description: 'consistent renaming test c' }); rollup-3.29.4/test/function/samples/consistent-renaming-c/main.js000066400000000000000000000002061450520414700250670ustar00rootroot00000000000000import One from './one'; import two from './two'; assert.equal( One(), 1 ); assert.equal( two(), 2 ); assert.equal( One.two(), 99 ); rollup-3.29.4/test/function/samples/consistent-renaming-c/one.js000066400000000000000000000002371450520414700247300ustar00rootroot00000000000000import three from './one/three'; import Two from './one/two'; export default function One () { return 1; } One.three = three; /*** one.js */ One.two = Two;rollup-3.29.4/test/function/samples/consistent-renaming-c/one/000077500000000000000000000000001450520414700243705ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming-c/one/three.js000066400000000000000000000001361450520414700260350ustar00rootroot00000000000000import { two } from '../-internal'; export default function three () { return 1 + two(); } rollup-3.29.4/test/function/samples/consistent-renaming-c/one/two.js000066400000000000000000000001641450520414700255400ustar00rootroot00000000000000import { two as _two } from '../-internal'; /*** one/two.js */ export default function two () { return _two(); } rollup-3.29.4/test/function/samples/consistent-renaming-c/two.js000066400000000000000000000001271450520414700247560ustar00rootroot00000000000000import One from './one'; /*** two.js */ export default function two () { return 2; } rollup-3.29.4/test/function/samples/consistent-renaming-d/000077500000000000000000000000001450520414700236105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming-d/Baz.js000066400000000000000000000000751450520414700246640ustar00rootroot00000000000000function Baz () { this.isBaz = true; } export default Baz; rollup-3.29.4/test/function/samples/consistent-renaming-d/_config.js000066400000000000000000000001151450520414700255470ustar00rootroot00000000000000module.exports = defineTest({ description: 'consistent renaming test d' }); rollup-3.29.4/test/function/samples/consistent-renaming-d/bar.js000066400000000000000000000002761450520414700247170ustar00rootroot00000000000000import Baz from './Baz'; import Foo from './foo'; function Bar () { this.inheritsFromBaz = this.isBaz; } Bar.prototype = new Baz(); export default function bar() { return new Bar(); } rollup-3.29.4/test/function/samples/consistent-renaming-d/foo.js000066400000000000000000000001171450520414700247300ustar00rootroot00000000000000import baz from './foo/baz'; export default function Foo () {} Foo.baz = baz;rollup-3.29.4/test/function/samples/consistent-renaming-d/foo/000077500000000000000000000000001450520414700243735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming-d/foo/baz.js000066400000000000000000000001221450520414700255000ustar00rootroot00000000000000import Baz from '../Baz'; export default function baz () { return new Baz(); } rollup-3.29.4/test/function/samples/consistent-renaming-d/main.js000066400000000000000000000002041450520414700250660ustar00rootroot00000000000000import Foo from './foo'; import bar from './bar'; var baz = Foo.baz(); assert.ok( baz.isBaz ); assert.ok( bar().inheritsFromBaz ); rollup-3.29.4/test/function/samples/consistent-renaming-e/000077500000000000000000000000001450520414700236115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming-e/_config.js000066400000000000000000000001151450520414700255500ustar00rootroot00000000000000module.exports = defineTest({ description: 'consistent renaming test e' }); rollup-3.29.4/test/function/samples/consistent-renaming-e/a.js000066400000000000000000000002011450520414700243600ustar00rootroot00000000000000import { b } from './utils'; function c () { console.log( 'main/c' ); } export default function a () { return 'EH? ' + b(); } rollup-3.29.4/test/function/samples/consistent-renaming-e/b.js000066400000000000000000000001261450520414700243670ustar00rootroot00000000000000function c () { console.log( 'a/c' ); } export default function b () { return 42; } rollup-3.29.4/test/function/samples/consistent-renaming-e/main.js000066400000000000000000000001431450520414700250710ustar00rootroot00000000000000import a from './a'; import b from './b'; assert.equal( a(), 'EH? BEE' ); assert.equal( b(), 42 );rollup-3.29.4/test/function/samples/consistent-renaming-e/utils.js000066400000000000000000000000471450520414700253100ustar00rootroot00000000000000export function b () { return 'BEE'; }rollup-3.29.4/test/function/samples/consistent-renaming-f/000077500000000000000000000000001450520414700236125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming-f/_config.js000066400000000000000000000001151450520414700255510ustar00rootroot00000000000000module.exports = defineTest({ description: 'consistent renaming test f' }); rollup-3.29.4/test/function/samples/consistent-renaming-f/bar.js000066400000000000000000000000701450520414700247110ustar00rootroot00000000000000export default function foo() { return 'consistent'; } rollup-3.29.4/test/function/samples/consistent-renaming-f/main.js000066400000000000000000000002011450520414700250650ustar00rootroot00000000000000import bar from './bar'; function test( foo ) { assert.equal(foo, 1); return bar(); } assert.equal( test(1), 'consistent' ); rollup-3.29.4/test/function/samples/consistent-renaming/000077500000000000000000000000001450520414700233675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistent-renaming/_config.js000066400000000000000000000001131450520414700253240ustar00rootroot00000000000000module.exports = defineTest({ description: 'consistent renaming test' }); rollup-3.29.4/test/function/samples/consistent-renaming/main.js000066400000000000000000000003221450520414700246460ustar00rootroot00000000000000import { one as oneRenamed } from './one'; import { two } from './two'; import { three as threeRenamed } from './three'; assert.equal( oneRenamed, 1 ); assert.equal( two, 2 ); assert.equal( threeRenamed, 3 ); rollup-3.29.4/test/function/samples/consistent-renaming/one.js000066400000000000000000000000231450520414700245010ustar00rootroot00000000000000export var one = 1;rollup-3.29.4/test/function/samples/consistent-renaming/three.js000066400000000000000000000000251450520414700250310ustar00rootroot00000000000000export var three = 3;rollup-3.29.4/test/function/samples/consistent-renaming/two.js000066400000000000000000000001601450520414700245330ustar00rootroot00000000000000import { one as _one } from './one'; import { three as _three } from './three'; export var two = _three - _one;rollup-3.29.4/test/function/samples/consistently-renames-destructured-parameters/000077500000000000000000000000001450520414700304425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/consistently-renames-destructured-parameters/_config.js000066400000000000000000000001471450520414700324060ustar00rootroot00000000000000module.exports = defineTest({ description: 'destructured parameters are properly renamed (#2418)' }); rollup-3.29.4/test/function/samples/consistently-renames-destructured-parameters/main.js000066400000000000000000000011641450520414700317260ustar00rootroot00000000000000import { name } from './module_1.js'; function withoutDefault({ name: name}) { return name; } function withDefault({ name: name = 10} = {}) { return name; } function shorthandWithoutDefault({ name}) { return name; } function shorthandWithDefault({ name = 10 } = {}) { return name; } assert.equal(name(), 'important to trigger renaming'); assert.equal(withoutDefault({ name: 20 }), 20); assert.equal(withDefault({ name: 20 }), 20); assert.equal(withDefault(), 10); assert.equal(shorthandWithoutDefault({ name: 20 }), 20); assert.equal(shorthandWithDefault({ name: 20 }), 20); assert.equal(shorthandWithDefault(), 10); rollup-3.29.4/test/function/samples/consistently-renames-destructured-parameters/module_1.js000066400000000000000000000001041450520414700325000ustar00rootroot00000000000000export function name() { return 'important to trigger renaming'; } rollup-3.29.4/test/function/samples/context-resolve-skipself/000077500000000000000000000000001450520414700243575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/context-resolve-skipself/_config.js000066400000000000000000000020211450520414700263140ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'allows a plugin to skip its own resolveId hook when using this.resolve', options: { plugins: [ { resolveId(id) { if (id === 'resolutions') { return id; } if (id.startsWith('test')) { return 'own-resolution'; } }, load(id) { if (id === 'resolutions') { const importer = path.join(__dirname, 'main.js'); return Promise.all([ this.resolve('test', importer).then(result => ({ id: result.id, text: 'all' })), this.resolve('test', importer, { skipSelf: false }).then(result => ({ id: result.id, text: 'unskipped' })), this.resolve('test', importer, { skipSelf: true }).then(result => ({ id: result.id, text: 'skipped' })) ]).then(result => `export default ${JSON.stringify(result)};`); } } }, { resolveId(id) { if (id.startsWith('test')) { return 'other-resolution'; } } } ] } }); rollup-3.29.4/test/function/samples/context-resolve-skipself/existing.js000066400000000000000000000000311450520414700265410ustar00rootroot00000000000000console.log('existing'); rollup-3.29.4/test/function/samples/context-resolve-skipself/main.js000066400000000000000000000003441450520414700256420ustar00rootroot00000000000000import resolutions from 'resolutions'; assert.deepStrictEqual(resolutions, [ { id: 'own-resolution', text: 'all' }, { id: 'own-resolution', text: 'unskipped' }, { id: 'other-resolution', text: 'skipped' } ]); rollup-3.29.4/test/function/samples/context-resolve/000077500000000000000000000000001450520414700225415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/context-resolve/_config.js000066400000000000000000000071121450520414700245040ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const tests = [ { source: './existing', expected: { id: path.join(__dirname, 'existing.js'), assertions: {}, external: false, meta: {}, resolvedBy: 'rollup', moduleSideEffects: true, syntheticNamedExports: false } }, { source: './missing-relative', expected: null }, { source: 'missing-absolute', expected: null }, { source: './marked-directly-external-relative', expected: { id: path.join(__dirname, 'marked-directly-external-relative'), assertions: {}, external: true, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } }, { source: './marked-external-relative', expected: { id: path.join(__dirname, 'marked-external-relative'), assertions: {}, external: true, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } }, { source: 'marked-external-absolute', expected: { id: 'marked-external-absolute', assertions: {}, external: true, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } }, { source: 'resolved-name', expected: { id: 'resolved:resolved-name', assertions: {}, external: false, meta: {}, moduleSideEffects: true, resolvedBy: 'at position 2', syntheticNamedExports: false } }, { source: 'resolved-false', expected: { id: 'resolved-false', assertions: {}, external: true, meta: {}, resolvedBy: 'rollup', moduleSideEffects: true, syntheticNamedExports: false } }, { source: 'resolved-object', expected: { id: 'resolved:resolved-object', assertions: {}, external: false, meta: {}, moduleSideEffects: true, resolvedBy: 'at position 2', syntheticNamedExports: false } }, { source: 'resolved-object-non-external', expected: { id: 'resolved:resolved-object-non-external', assertions: {}, external: false, meta: {}, moduleSideEffects: true, resolvedBy: 'at position 2', syntheticNamedExports: false } }, { source: 'resolved-object-external', expected: { id: 'resolved:resolved-object-external', assertions: {}, external: true, meta: {}, moduleSideEffects: true, resolvedBy: 'at position 2', syntheticNamedExports: false } } ]; module.exports = defineTest({ description: 'returns the correct results for the context resolve helper', options: { external: [ 'marked-external-absolute', './marked-directly-external-relative', path.join(__dirname, 'marked-external-relative') ], plugins: [ { resolveId(id) { if (id === 'resolutions') { return id; } }, load(id) { if (id === 'resolutions') { return Promise.all( tests.map(({ source, expected }) => this.resolve(source, path.join(__dirname, 'main.js')).then(resolution => assert.deepStrictEqual(resolution, expected) ) ) ).then(result => `export default ${result.length}`); } } }, { resolveId(id) { switch (id) { case 'resolved-name': { return 'resolved:resolved-name'; } case 'resolved-false': { return false; } case 'resolved-object': { return { id: 'resolved:resolved-object' }; } case 'resolved-object-non-external': { return { id: 'resolved:resolved-object-non-external', external: false }; } case 'resolved-object-external': { return { id: 'resolved:resolved-object-external', external: true }; } } } } ] } }); rollup-3.29.4/test/function/samples/context-resolve/existing.js000066400000000000000000000000311450520414700247230ustar00rootroot00000000000000console.log('existing'); rollup-3.29.4/test/function/samples/context-resolve/main.js000066400000000000000000000001141450520414700240170ustar00rootroot00000000000000import resolutions from 'resolutions'; assert.strictEqual(resolutions,11); rollup-3.29.4/test/function/samples/correct-var-before-declaration-deopt/000077500000000000000000000000001450520414700264635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/correct-var-before-declaration-deopt/_config.js000066400000000000000000000001401450520414700304200ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds necessary deoptimizations when using var' }); rollup-3.29.4/test/function/samples/correct-var-before-declaration-deopt/main.js000066400000000000000000000003001450520414700277360ustar00rootroot00000000000000const obj = { flag: false }; var foo = obj; foo.flag = true; assert.ok(obj.flag ? true : false, 'init deoptimization'); assert.ok(bar ? false : true, 'value deoptimization'); var bar = true; rollup-3.29.4/test/function/samples/create-undefined-export-property-compact/000077500000000000000000000000001450520414700274275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/create-undefined-export-property-compact/_config.js000066400000000000000000000011461450520414700313730ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'creates an export as an exports property even if is has no initializer', options: { output: { compact: true } }, exports(exports) { assert.strictEqual(exports.foo, undefined); assert.strictEqual(exports.bar, undefined); assert.strictEqual(exports.baz, undefined); assert.ok(exports.hasOwnProperty('foo')); assert.ok(exports.hasOwnProperty('bar')); assert.ok(exports.hasOwnProperty('baz')); exports.defineFooBar(); assert.strictEqual(exports.foo, 'defined'); assert.strictEqual(exports.bar, 'defined'); } }); rollup-3.29.4/test/function/samples/create-undefined-export-property-compact/main.js000066400000000000000000000001661450520414700307140ustar00rootroot00000000000000export let foo; export let bar, quux = 3, baz; export function defineFooBar() { foo = 'defined'; bar = 'defined'; } rollup-3.29.4/test/function/samples/create-undefined-export-property/000077500000000000000000000000001450520414700260035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/create-undefined-export-property/_config.js000066400000000000000000000010751450520414700277500ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'creates an export as an exports property even if is has no initializer', exports(exports) { assert.strictEqual(exports.foo, undefined); assert.strictEqual(exports.bar, undefined); assert.strictEqual(exports.baz, undefined); assert.ok(exports.hasOwnProperty('foo')); assert.ok(exports.hasOwnProperty('bar')); assert.ok(exports.hasOwnProperty('baz')); exports.defineFooBar(); assert.strictEqual(exports.foo, 'defined'); assert.strictEqual(exports.bar, 'defined'); } }); rollup-3.29.4/test/function/samples/create-undefined-export-property/main.js000066400000000000000000000001661450520414700272700ustar00rootroot00000000000000export let foo; export let bar, quux = 3, baz; export function defineFooBar() { foo = 'defined'; bar = 'defined'; } rollup-3.29.4/test/function/samples/cross-chunk-live-binding-compact/000077500000000000000000000000001450520414700256305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cross-chunk-live-binding-compact/_config.js000066400000000000000000000007421450520414700275750ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles cross-chunk live-bindings in compact mode', options: { input: ['main.js', 'named.js', 'star.js'], output: { compact: true } }, exports(exports) { assert.equal(exports.named, 0, 'named'); exports.incrementNamed(); assert.equal(exports.named, 1, 'named'); assert.equal(exports.star, 0, 'star'); exports.incrementStar(); assert.equal(exports.star, 1, 'star'); } }); rollup-3.29.4/test/function/samples/cross-chunk-live-binding-compact/main.js000066400000000000000000000001171450520414700271110ustar00rootroot00000000000000export { named, incrementNamed } from './named.js'; export * from './star.js'; rollup-3.29.4/test/function/samples/cross-chunk-live-binding-compact/named.js000066400000000000000000000001031450520414700272440ustar00rootroot00000000000000export let named = 0; export const incrementNamed = () => named++; rollup-3.29.4/test/function/samples/cross-chunk-live-binding-compact/star.js000066400000000000000000000001001450520414700271260ustar00rootroot00000000000000export let star = 0; export const incrementStar = () => star++; rollup-3.29.4/test/function/samples/cross-chunk-live-binding/000077500000000000000000000000001450520414700242045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cross-chunk-live-binding/_config.js000066400000000000000000000006601450520414700261500ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles cross-chunk live-bindings', options: { input: ['main.js', 'named.js', 'star.js'] }, exports(exports) { assert.equal(exports.named, 0, 'named'); exports.incrementNamed(); assert.equal(exports.named, 1, 'named'); assert.equal(exports.star, 0, 'star'); exports.incrementStar(); assert.equal(exports.star, 1, 'star'); } }); rollup-3.29.4/test/function/samples/cross-chunk-live-binding/main.js000066400000000000000000000001171450520414700254650ustar00rootroot00000000000000export { named, incrementNamed } from './named.js'; export * from './star.js'; rollup-3.29.4/test/function/samples/cross-chunk-live-binding/named.js000066400000000000000000000001031450520414700256200ustar00rootroot00000000000000export let named = 0; export const incrementNamed = () => named++; rollup-3.29.4/test/function/samples/cross-chunk-live-binding/star.js000066400000000000000000000001001450520414700255020ustar00rootroot00000000000000export let star = 0; export const incrementStar = () => star++; rollup-3.29.4/test/function/samples/custom-external-module-options/000077500000000000000000000000001450520414700255065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-external-module-options/_config.js000066400000000000000000000010231450520414700274440ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'supports adding custom options to external modules', options: { plugins: [ { name: 'test-plugin', async resolveId(id) { if (id === 'external') { return { id, external: true, meta: { 'test-plugin': { resolved: true } } }; } } }, { name: 'wrap-up', buildEnd() { assert.deepStrictEqual(this.getModuleInfo('external').meta, { 'test-plugin': { resolved: true } }); } } ] } }); rollup-3.29.4/test/function/samples/custom-external-module-options/main.js000066400000000000000000000000231450520414700267630ustar00rootroot00000000000000import 'external'; rollup-3.29.4/test/function/samples/custom-external-resolver-async/000077500000000000000000000000001450520414700255045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-external-resolver-async/_config.js000066400000000000000000000006501450520414700274470ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'uses a custom external path resolver (asynchronous)', options: { plugins: [ { resolveId(id, importer) { if (importer && id[0] !== '.') return Promise.resolve(path.join(__dirname, 'js_modules', id + '.js')); } } ] }, exports(exports) { assert.ok(exports.success); } }); rollup-3.29.4/test/function/samples/custom-external-resolver-async/js_modules/000077500000000000000000000000001450520414700276505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-external-resolver-async/js_modules/external.js000066400000000000000000000000451450520414700320270ustar00rootroot00000000000000export default { isExternal: true }; rollup-3.29.4/test/function/samples/custom-external-resolver-async/main.js000066400000000000000000000001231450520414700267620ustar00rootroot00000000000000import external from 'external'; export default { success: external.isExternal }; rollup-3.29.4/test/function/samples/custom-external-resolver-sync/000077500000000000000000000000001450520414700253435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-external-resolver-sync/_config.js000066400000000000000000000006201450520414700273030ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'uses a custom external path resolver (synchronous)', options: { plugins: [ { resolveId(id, importer) { if (importer && id[0] !== '.') return path.join(__dirname, 'js_modules', id + '.js'); } } ] }, exports(exports) { assert.ok(exports.success); } }); rollup-3.29.4/test/function/samples/custom-external-resolver-sync/js_modules/000077500000000000000000000000001450520414700275075ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-external-resolver-sync/js_modules/external.js000066400000000000000000000000451450520414700316660ustar00rootroot00000000000000export default { isExternal: true }; rollup-3.29.4/test/function/samples/custom-external-resolver-sync/main.js000066400000000000000000000001231450520414700266210ustar00rootroot00000000000000import external from 'external'; export default { success: external.isExternal }; rollup-3.29.4/test/function/samples/custom-iterator-2/000077500000000000000000000000001450520414700227005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-iterator-2/_config.js000066400000000000000000000001251450520414700246400ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles manually defined iterators' }); rollup-3.29.4/test/function/samples/custom-iterator-2/main.js000066400000000000000000000004751450520414700241700ustar00rootroot00000000000000var obj = { x: false }; var p = { [Symbol.iterator]() { var first = true; return { next() { return first ? { done: (first = false), value: obj } : { done: true, value: null }; } }; } }; [...p][0].x = true; if (!obj.x) { throw new Error('x was not reassigned'); } rollup-3.29.4/test/function/samples/custom-iterator/000077500000000000000000000000001450520414700225415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-iterator/_config.js000066400000000000000000000001251450520414700245010ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles manually defined iterators' }); rollup-3.29.4/test/function/samples/custom-iterator/main.js000066400000000000000000000002371450520414700240250ustar00rootroot00000000000000var obj = { x: false }; var p = { *[Symbol.iterator]() { yield obj; } }; [...p][0].x = true; if (!obj.x) { throw new Error('x was not reassigned'); } rollup-3.29.4/test/function/samples/custom-loaders/000077500000000000000000000000001450520414700223415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-loaders/_config.js000066400000000000000000000006471450520414700243120ustar00rootroot00000000000000const { readFileSync } = require('node:fs'); module.exports = defineTest({ description: 'uses custom loaders, falling back to default', options: { plugins: [ { load(id) { if (/foo\.js/.test(id)) { return readFileSync(id, 'utf8').replace('@', 1); } } }, { load(id) { if (/bar\.js/.test(id)) { return readFileSync(id, 'utf8').replace('@', 2); } } } ] } }); rollup-3.29.4/test/function/samples/custom-loaders/bar.js000066400000000000000000000000241450520414700234370ustar00rootroot00000000000000export default '@'; rollup-3.29.4/test/function/samples/custom-loaders/baz.js000066400000000000000000000000241450520414700234470ustar00rootroot00000000000000export default '@'; rollup-3.29.4/test/function/samples/custom-loaders/foo.js000066400000000000000000000000241450520414700234560ustar00rootroot00000000000000export default '@'; rollup-3.29.4/test/function/samples/custom-loaders/main.js000066400000000000000000000002321450520414700236200ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; import baz from './baz'; assert.equal( foo, '1' ); assert.equal( bar, '2' ); assert.equal( baz, '@' ); rollup-3.29.4/test/function/samples/custom-module-options/000077500000000000000000000000001450520414700236665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-module-options/_config.js000066400000000000000000000035611450520414700256350ustar00rootroot00000000000000const assert = require('node:assert'); // @ts-expect-error file outside root const { getObject } = require('../../../utils'); function getTestPlugin(index) { const pluginName = `test-${index}`; return { name: pluginName, async resolveId(id) { if (id.includes(`resolve${index}`)) { return { id, meta: { [pluginName]: { resolved: index } } }; } }, load(id) { if (id.includes(`load${index}`)) { return { code: "throw new Error('should be replaced');", meta: { [pluginName]: { loaded: index } } }; } }, transform(code, id) { if (id.includes(`transform${index}`)) { const { meta } = this.getModuleInfo(id); return { code: `export const value = ${JSON.stringify(meta)};`, meta: { [pluginName]: { transformed: index } } }; } } }; } module.exports = defineTest({ description: 'supports adding custom options to modules', options: { plugins: [ getTestPlugin(1), getTestPlugin(2), getTestPlugin(3), { name: 'wrap-up', buildEnd() { assert.deepStrictEqual( getObject( [...this.getModuleIds()] .filter(id => id.includes('resolve')) .map(id => [id, this.getModuleInfo(id).meta]) ), { 'resolve1-load2-transform3': { 'test-1': { resolved: 1 }, 'test-2': { loaded: 2 }, 'test-3': { transformed: 3 } }, 'resolve2-load2-transform3': { 'test-2': { loaded: 2 }, 'test-3': { transformed: 3 } }, 'resolve3-load3-transform1-transform3': { 'test-3': { transformed: 3 }, 'test-1': { transformed: 1 } } } ); } } ] }, exports(exports) { assert.deepStrictEqual(exports, { value1: { 'test-1': { resolved: 1 }, 'test-2': { loaded: 2 } }, value2: { 'test-2': { loaded: 2 } }, value3: { 'test-3': { loaded: 3 }, 'test-1': { transformed: 1 } } }); } }); rollup-3.29.4/test/function/samples/custom-module-options/main.js000066400000000000000000000003021450520414700251430ustar00rootroot00000000000000export { value as value1 } from 'resolve1-load2-transform3'; export { value as value2 } from 'resolve2-load2-transform3'; export { value as value3 } from 'resolve3-load3-transform1-transform3'; rollup-3.29.4/test/function/samples/custom-path-resolver-async/000077500000000000000000000000001450520414700246165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-path-resolver-async/_config.js000066400000000000000000000007701450520414700265640ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'uses a custom path resolver (asynchronous)', options: { plugins: [ { resolveId(importee) { if (path.normalize(importee) === path.join(__dirname, 'main.js')) return importee; return Promise.resolve(importee === 'foo' ? path.join(__dirname, 'bar.js') : false); } } ] }, exports(exports) { assert.strictEqual(exports.path, require('node:path')); } }); rollup-3.29.4/test/function/samples/custom-path-resolver-async/bar.js000066400000000000000000000000251450520414700257150ustar00rootroot00000000000000export default 'bar';rollup-3.29.4/test/function/samples/custom-path-resolver-async/main.js000066400000000000000000000001361450520414700261000ustar00rootroot00000000000000import foo from 'foo'; import path from 'path'; assert.equal( foo, 'bar' ); export { path };rollup-3.29.4/test/function/samples/custom-path-resolver-on-entry/000077500000000000000000000000001450520414700252545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-path-resolver-on-entry/_config.js000066400000000000000000000014111450520414700272130ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync } = require('node:fs'); const path = require('node:path'); const cachedModules = { '@main.js': 'import foo from "./foo"; export default foo();' }; module.exports = defineTest({ description: 'applies custom resolver to entry point', options: { plugins: [ { resolveId(importee, importer) { if (importer === undefined) { return '@' + path.relative(__dirname, importee); } if (importer[0] === '@') { return path.join(__dirname, importee) + '.js'; } }, load(moduleId) { if (moduleId[0] === '@') { return cachedModules[moduleId]; } return readFileSync(moduleId, 'utf8'); } } ] }, exports(exports) { assert.equal(exports, 42); } }); rollup-3.29.4/test/function/samples/custom-path-resolver-on-entry/bar.js000066400000000000000000000000531450520414700263540ustar00rootroot00000000000000export default function () { return 21; } rollup-3.29.4/test/function/samples/custom-path-resolver-on-entry/foo.js000066400000000000000000000001141450520414700263710ustar00rootroot00000000000000import bar from './bar'; export default function () { return bar() * 2; } rollup-3.29.4/test/function/samples/custom-path-resolver-plural-b/000077500000000000000000000000001450520414700252175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-path-resolver-plural-b/_config.js000066400000000000000000000006331450520414700271630ustar00rootroot00000000000000module.exports = defineTest({ description: 'resolver error is not caught', options: { plugins: [ { resolveId() { throw new Error('nope'); }, load(id) { if (id === 'main') return 'assert.ok( false );'; } }, { resolveId() { return 'main'; } } ] }, error: { code: 'PLUGIN_ERROR', hook: 'resolveId', message: 'nope', plugin: 'at position 1' } }); rollup-3.29.4/test/function/samples/custom-path-resolver-plural/000077500000000000000000000000001450520414700250005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-path-resolver-plural/_config.js000066400000000000000000000010701450520414700267400ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'uses custom path resolvers (plural)', options: { plugins: [ { resolveId(importee) { if (importee[0] === '@') return path.join(__dirname, 'globals-' + importee.slice(1).toLowerCase() + '.js'); }, load(id) { if (id === '') return ''; } }, { resolveId(importee) { if (importee[0] === '!') return ''; } } ] }, exports(exports) { assert.strictEqual(exports.res, 0); } }); rollup-3.29.4/test/function/samples/custom-path-resolver-plural/globals-math.js000066400000000000000000000000661450520414700277120ustar00rootroot00000000000000export var sin = Math.sin; export var cos = Math.cos; rollup-3.29.4/test/function/samples/custom-path-resolver-plural/main.js000066400000000000000000000001111450520414700262530ustar00rootroot00000000000000import { sin } from '@Math'; import '!path'; export var res = sin( 0 ); rollup-3.29.4/test/function/samples/custom-path-resolver-sync/000077500000000000000000000000001450520414700244555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-path-resolver-sync/_config.js000066400000000000000000000007641450520414700264260ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'uses a custom path resolver (synchronous)', options: { plugins: [ { resolveId(importee) { if (path.normalize(importee) === path.join(__dirname, 'main.js')) return importee; if (importee === 'foo') return path.join(__dirname, 'bar.js'); return false; } } ] }, exports(exports) { assert.strictEqual(exports.path, require('node:path')); } }); rollup-3.29.4/test/function/samples/custom-path-resolver-sync/bar.js000066400000000000000000000000251450520414700255540ustar00rootroot00000000000000export default 'bar';rollup-3.29.4/test/function/samples/custom-path-resolver-sync/main.js000066400000000000000000000001361450520414700257370ustar00rootroot00000000000000import foo from 'foo'; import path from 'path'; assert.equal( foo, 'bar' ); export { path };rollup-3.29.4/test/function/samples/custom-resolve-options/000077500000000000000000000000001450520414700240605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/custom-resolve-options/_config.js000066400000000000000000000016001450520414700260170ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'supports custom resolve options', options: { plugins: [ { name: 'first-plugin', async transform() { const [{ id: first }, { id: second }] = await Promise.all([ this.resolve('./main.js'), this.resolve('./main.js', undefined, { custom: { second: { actualId: 'the-actual-id' } } }) ]); return `export const first = ${JSON.stringify(first)}; export const second = ${JSON.stringify(second)};`; } }, { name: 'second-plugin', resolveId(source, importer, { custom }) { if (custom && custom.second) { return custom.second.actualId; } } } ] }, exports(exports) { assert.deepStrictEqual(exports, { first: path.join(__dirname, 'main.js'), second: 'the-actual-id' }); } }); rollup-3.29.4/test/function/samples/custom-resolve-options/main.js000066400000000000000000000000411450520414700253350ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/cycles-default-anonymous-function-hoisted/000077500000000000000000000000001450520414700276125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cycles-default-anonymous-function-hoisted/_config.js000066400000000000000000000005451450520414700315600ustar00rootroot00000000000000const path = require('node:path'); const ID_F = path.join(__dirname, 'f.js'); const ID_G = path.join(__dirname, 'g.js'); module.exports = defineTest({ description: 'Anonymous function declarations are hoisted', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_F, ID_G, ID_F], message: 'Circular dependency: f.js -> g.js -> f.js' } ] }); rollup-3.29.4/test/function/samples/cycles-default-anonymous-function-hoisted/f.js000066400000000000000000000001571450520414700304000ustar00rootroot00000000000000import g from "./g.js"; export default function (fn) { return function (str) { return str || g(fn.name); } } rollup-3.29.4/test/function/samples/cycles-default-anonymous-function-hoisted/g.js000066400000000000000000000001231450520414700303720ustar00rootroot00000000000000import f from "./f.js"; export default f(function fn(str) { return str + str; });rollup-3.29.4/test/function/samples/cycles-default-anonymous-function-hoisted/main.js000066400000000000000000000001121450520414700310660ustar00rootroot00000000000000import f from "./f.js"; import g from "./g.js"; assert.equal(g(), "fn"); rollup-3.29.4/test/function/samples/cycles-defaults/000077500000000000000000000000001450520414700224675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cycles-defaults/_config.js000066400000000000000000000007111450520414700244300ustar00rootroot00000000000000const path = require('node:path'); const ID_A = path.join(__dirname, 'a.js'); const ID_B = path.join(__dirname, 'b.js'); module.exports = defineTest({ description: 'cycles work with default exports', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_A, ID_B, ID_A], message: 'Circular dependency: a.js -> b.js -> a.js' } ] }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/cycles-defaults rollup-3.29.4/test/function/samples/cycles-defaults/a.js000066400000000000000000000001101450520414700232350ustar00rootroot00000000000000import b from './b'; export default { a: 1, get b() { return b.b; } }; rollup-3.29.4/test/function/samples/cycles-defaults/b.js000066400000000000000000000001101450520414700232360ustar00rootroot00000000000000import a from './a'; export default { b: 2, get a() { return a.a; } }; rollup-3.29.4/test/function/samples/cycles-defaults/main.js000066400000000000000000000002131450520414700237450ustar00rootroot00000000000000import a from './a'; import b from './b'; assert.equal( a.a, 1 ); assert.equal( a.b, 2 ); assert.equal( b.a, 1 ); assert.equal( b.b, 2 ); rollup-3.29.4/test/function/samples/cycles-export-star/000077500000000000000000000000001450520414700231505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cycles-export-star/_config.js000066400000000000000000000010301450520414700251040ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_A = path.join(__dirname, 'a.js'); const ID_B = path.join(__dirname, 'b.js'); module.exports = defineTest({ description: 'does not stack overflow on `export * from X` cycles', code(code) { assert.equal( code, `'use strict';\n\nfunction b() {\n\treturn 'b';\n}\n\nassert.equal(b(), 'b');\n` ); }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_A, ID_B, ID_A], message: 'Circular dependency: a.js -> b.js -> a.js' } ] }); rollup-3.29.4/test/function/samples/cycles-export-star/a.js000066400000000000000000000000761450520414700237310ustar00rootroot00000000000000export * from './b.js'; export function a() { return 'a'; } rollup-3.29.4/test/function/samples/cycles-export-star/b.js000066400000000000000000000000761450520414700237320ustar00rootroot00000000000000export * from './a.js'; export function b() { return 'b'; } rollup-3.29.4/test/function/samples/cycles-export-star/main.js000066400000000000000000000000651450520414700244330ustar00rootroot00000000000000import { b } from './a.js'; assert.equal(b(), 'b'); rollup-3.29.4/test/function/samples/cycles-immediate/000077500000000000000000000000001450520414700226165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cycles-immediate/_config.js000066400000000000000000000007771450520414700245730ustar00rootroot00000000000000const path = require('node:path'); const ID_EVENS = path.join(__dirname, 'evens.js'); const ID_ODDS = path.join(__dirname, 'odds.js'); module.exports = defineTest({ description: 'handles cycles where imports are immediately used', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_EVENS, ID_ODDS, ID_EVENS], message: 'Circular dependency: evens.js -> odds.js -> evens.js' } ] }); // Test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/cycles-immediate rollup-3.29.4/test/function/samples/cycles-immediate/evens.js000066400000000000000000000006401450520414700242740ustar00rootroot00000000000000import { nextOdd } from './odds'; /** * We go through these gymnastics to eager-bind to nextOdd. This is done to * ensure that both this module and the 'odds' module eagerly use something * from the other. */ export var nextEven = (function() { return function(n) { var no = nextOdd(n); return (no === n + 2) ? no - 1 : no; }; })(nextOdd); export function isEven(n) { return n % 2 === 0; } rollup-3.29.4/test/function/samples/cycles-immediate/main.js000066400000000000000000000016561450520414700241100ustar00rootroot00000000000000import { nextEven, isEven } from './evens'; import { nextOdd, isOdd } from './odds'; /** * The 'evens' and 'odds' modules are configured in such a way that they both * have two exported functions: isEven, nextEven, isOdd, and nextOdd. Normally * these four functions could be in any order regardless of which depends on * which because of JavaScript function hoisting. * * For the purposes of our test we need to prevent function hoisting, so it has * been arranged that two of them will be function expressions assigned to * variables. Specifically, isOdd and nextEven both eagerly evaluate their * dependencies (i.e. isEven and nextOdd). This allows us to test that exported * function declarations are available before what would be a module's * "execute" step, per the spec. */ assert.equal(nextEven(1), 2); assert.equal(nextOdd(1), 3); assert.ok(isOdd(1)); assert.ok(!isOdd(0)); assert.ok(isEven(0)); assert.ok(!isEven(1)); rollup-3.29.4/test/function/samples/cycles-immediate/odds.js000066400000000000000000000006001450520414700241010ustar00rootroot00000000000000import { isEven } from './evens'; export function nextOdd(n) { return isEven(n) ? n + 1 : n + 2; } /** * We go through these gymnastics to eager-bind to isEven. This is done to * ensure that both this module and the 'evens' module eagerly use something * from the other. */ export var isOdd = (function(isEven) { return function(n) { return !isEven(n); }; })(isEven); rollup-3.29.4/test/function/samples/cycles-pathological-2/000077500000000000000000000000001450520414700234655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cycles-pathological-2/_config.js000066400000000000000000000014221450520414700254260ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_B = path.join(__dirname, 'b.js'); const ID_C = path.join(__dirname, 'c.js'); const ID_D = path.join(__dirname, 'd.js'); module.exports = defineTest({ description: 'resolves even more pathological cyclical dependencies gracefully', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_B, ID_MAIN], message: 'Circular dependency: main.js -> b.js -> main.js' }, { code: 'CIRCULAR_DEPENDENCY', ids: [ID_B, ID_D, ID_C, ID_B], message: 'Circular dependency: b.js -> d.js -> c.js -> b.js' }, { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_B, ID_D, ID_C, ID_MAIN], message: 'Circular dependency: main.js -> b.js -> d.js -> c.js -> main.js' } ] }); rollup-3.29.4/test/function/samples/cycles-pathological-2/b.js000066400000000000000000000002521450520414700242430ustar00rootroot00000000000000import { a, av } from './main'; import { d, dv } from './d'; import { c, cv } from './c'; export function b() { a(av); d(dv); c(cv); } export var bv = av + dv + cv; rollup-3.29.4/test/function/samples/cycles-pathological-2/c.js000066400000000000000000000002001450520414700242350ustar00rootroot00000000000000import { b, bv } from './b'; import { a, av } from './main'; export function c() { a(av); b(bv); } export var cv = av + bv; rollup-3.29.4/test/function/samples/cycles-pathological-2/d.js000066400000000000000000000001231450520414700242420ustar00rootroot00000000000000import { c, cv } from './c'; export function d() { c(cv); } export var dv = cv; rollup-3.29.4/test/function/samples/cycles-pathological-2/main.js000066400000000000000000000002471450520414700247520ustar00rootroot00000000000000import { b, bv } from './b'; import { d, dv } from './d'; import { c, cv } from './c'; export function a() { b(bv); d(dv); c(cv); } export var av = bv + dv + cv; rollup-3.29.4/test/function/samples/cycles-stack-overflow/000077500000000000000000000000001450520414700236265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cycles-stack-overflow/_config.js000066400000000000000000000010461450520414700255710ustar00rootroot00000000000000const path = require('node:path'); const ID_B = path.join(__dirname, 'b.js'); const ID_C = path.join(__dirname, 'c.js'); const ID_D = path.join(__dirname, 'd.js'); module.exports = defineTest({ description: 'does not stack overflow on crazy cyclical dependencies', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_C, ID_D, ID_B, ID_C], message: 'Circular dependency: c.js -> d.js -> b.js -> c.js' }, { code: 'CIRCULAR_DEPENDENCY', ids: [ID_C, ID_D, ID_C], message: 'Circular dependency: c.js -> d.js -> c.js' } ] }); rollup-3.29.4/test/function/samples/cycles-stack-overflow/b.js000066400000000000000000000002111450520414700243770ustar00rootroot00000000000000import { C } from './c.js'; export function B () {}; B.prototype = { c: function () { return function () { new C(); }; }() }; rollup-3.29.4/test/function/samples/cycles-stack-overflow/c.js000066400000000000000000000002301450520414700244010ustar00rootroot00000000000000import { D } from './d.js'; export function C () { this.x = 'x'; } C.prototype = { d: function () { return function () { new D(); }; }() }; rollup-3.29.4/test/function/samples/cycles-stack-overflow/d.js000066400000000000000000000002451450520414700244100ustar00rootroot00000000000000import { B } from './b.js'; import { C } from './c.js'; export function D () {}; D.prototype = { c: function () { return function () { new C(); }; }() }; rollup-3.29.4/test/function/samples/cycles-stack-overflow/main.js000066400000000000000000000000751450520414700251120ustar00rootroot00000000000000import { C } from './c.js'; assert.equal( new C().x, 'x' ); rollup-3.29.4/test/function/samples/cyclic-assignments/000077500000000000000000000000001450520414700231775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/cyclic-assignments/_config.js000066400000000000000000000001271450520414700251410ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not fail for cyclic assignments' }); rollup-3.29.4/test/function/samples/cyclic-assignments/main.js000066400000000000000000000002111450520414700244530ustar00rootroot00000000000000let a = { foo: () => {}, bar: () => () => {} }; let b = a; a = b; a.foo = () => {}; a.foo(); b = b; b.bar = () => () => {}; b.bar()(); rollup-3.29.4/test/function/samples/deconflict-deconflicted/000077500000000000000000000000001450520414700241335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-deconflicted/_config.js000066400000000000000000000001741450520414700260770ustar00rootroot00000000000000module.exports = defineTest({ description: 'also deconflict variables which already appear to be deconflicted (#2683)' }); rollup-3.29.4/test/function/samples/deconflict-deconflicted/dep.js000066400000000000000000000001121450520414700252330ustar00rootroot00000000000000var value = '1'; export function x(value$1) { return value$1 + value; } rollup-3.29.4/test/function/samples/deconflict-deconflicted/main.js000066400000000000000000000001011450520414700254050ustar00rootroot00000000000000import { x } from './dep.js'; assert.equal(x('name'), 'name1'); rollup-3.29.4/test/function/samples/deconflict-default-exported-named-function/000077500000000000000000000000001450520414700276715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-default-exported-named-function/_config.js000066400000000000000000000001631450520414700316330ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflict default exported named function and class expressions' }); rollup-3.29.4/test/function/samples/deconflict-default-exported-named-function/classDeclaration1.js000066400000000000000000000001251450520414700335610ustar00rootroot00000000000000export default class test { constructor() { this.name = 'classDeclaration1'; } } rollup-3.29.4/test/function/samples/deconflict-default-exported-named-function/classDeclaration2.js000066400000000000000000000001251450520414700335620ustar00rootroot00000000000000export default class test { constructor() { this.name = 'classDeclaration2'; } } rollup-3.29.4/test/function/samples/deconflict-default-exported-named-function/classExpression1.js000066400000000000000000000001261450520414700334740ustar00rootroot00000000000000export default (class test { constructor() { this.name = 'classExpression1'; } }) rollup-3.29.4/test/function/samples/deconflict-default-exported-named-function/classExpression2.js000066400000000000000000000001261450520414700334750ustar00rootroot00000000000000export default (class test { constructor() { this.name = 'classExpression2'; } }) functionDeclaration1.js000066400000000000000000000001041450520414700342170ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-default-exported-named-functionexport default function test() { return 'functionDeclaration1'; }; functionDeclaration2.js000066400000000000000000000001041450520414700342200ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-default-exported-named-functionexport default function test() { return 'functionDeclaration2'; }; functionExpression1.js000066400000000000000000000001051450520414700341320ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-default-exported-named-functionexport default (function test() { return 'functionExpression1'; }); functionExpression2.js000066400000000000000000000001051450520414700341330ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-default-exported-named-functionexport default (function test() { return 'functionExpression2'; }); rollup-3.29.4/test/function/samples/deconflict-default-exported-named-function/main.js000066400000000000000000000017671450520414700311660ustar00rootroot00000000000000import ClassDeclaration1 from './classDeclaration1'; import ClassDeclaration2 from './classDeclaration2'; import ClassExpression1 from './classExpression1'; import ClassExpression2 from './classExpression2'; import functionDeclaration1 from './functionDeclaration1'; import functionDeclaration2 from './functionDeclaration2'; import functionExpression1 from './functionExpression1'; import functionExpression2 from './functionExpression2'; import { test } from './named.js'; assert.equal(test(), 'named'); assert.equal(functionDeclaration1(), 'functionDeclaration1'); assert.equal(functionDeclaration2(), 'functionDeclaration2'); assert.equal(functionExpression1(), 'functionExpression1'); assert.equal(functionExpression2(), 'functionExpression2'); assert.equal((new ClassDeclaration1()).name, 'classDeclaration1'); assert.equal((new ClassDeclaration2()).name, 'classDeclaration2'); assert.equal((new ClassExpression1()).name, 'classExpression1'); assert.equal((new ClassExpression2()).name, 'classExpression2'); rollup-3.29.4/test/function/samples/deconflict-default-exported-named-function/named.js000066400000000000000000000000651450520414700313140ustar00rootroot00000000000000export const test = function() { return 'named'; }; rollup-3.29.4/test/function/samples/deconflict-ids/000077500000000000000000000000001450520414700222675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-ids/_config.js000066400000000000000000000001151450520414700242260ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts reassigned ids' }); rollup-3.29.4/test/function/samples/deconflict-ids/conflict1.js000066400000000000000000000001051450520414700245030ustar00rootroot00000000000000function foo(){ throw new Error('Wrong foo function referenced.') } rollup-3.29.4/test/function/samples/deconflict-ids/conflict2.js000066400000000000000000000001051450520414700245040ustar00rootroot00000000000000function foo(){ throw new Error('Wrong foo function referenced.') } rollup-3.29.4/test/function/samples/deconflict-ids/main.js000066400000000000000000000001511450520414700235460ustar00rootroot00000000000000import './conflict1.js'; import foo from './used.js'; import './conflict2.js'; assert.equal(foo(1), 2); rollup-3.29.4/test/function/samples/deconflict-ids/used.js000066400000000000000000000001561450520414700235670ustar00rootroot00000000000000export default function foo() { foo = function(x){ return x + 1; }; return foo.apply(this, arguments); } rollup-3.29.4/test/function/samples/deconflict-parameter-defaults/000077500000000000000000000000001450520414700252755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-parameter-defaults/_config.js000066400000000000000000000001601450520414700272340ustar00rootroot00000000000000module.exports = defineTest({ description: 'consistently deconflict variable names for parameter defaults' }); rollup-3.29.4/test/function/samples/deconflict-parameter-defaults/main.js000066400000000000000000000011561450520414700265620ustar00rootroot00000000000000import './other.js'; var a = 'main'; function paramDefault(a, b = a) { assert.equal(b, 'param', 'main-param-b'); } paramDefault('param'); function outsideDefault(b = a) { assert.equal(b, 'main', 'main-outside-b'); } outsideDefault(); function paramDefaultRedeclare(a, b = a) { var a; assert.equal(a, 'param', 'main-param-redeclare-a'); assert.equal(b, 'param', 'main-param-redeclare-b'); } paramDefaultRedeclare('param'); function outsideDefaultRedeclare(b = a) { var a; assert.equal(a, undefined, 'main-outside-redeclare-a'); assert.equal(b, 'main', 'main-outside-redeclare-a'); } outsideDefaultRedeclare(); rollup-3.29.4/test/function/samples/deconflict-parameter-defaults/other.js000066400000000000000000000011411450520414700267510ustar00rootroot00000000000000var a = 'other'; function paramDefault(a, b = a) { assert.equal(b, 'param', 'other-param-b'); } paramDefault('param'); function outsideDefault(b = a) { assert.equal(b, 'other', 'other-outside-b'); } outsideDefault(); function paramDefaultRedeclare(a, b = a) { var a; assert.equal(a, 'param', 'other-param-redeclare-a'); assert.equal(b, 'param', 'other-param-redeclare-b'); } paramDefaultRedeclare('param'); function outsideDefaultRedeclare(b = a) { var a; assert.equal(a, undefined, 'other-outside-redeclare-a'); assert.equal(b, 'other', 'other-outside-redeclare-a'); } outsideDefaultRedeclare(); rollup-3.29.4/test/function/samples/deconflict-synthetic-named-export-cross-chunk/000077500000000000000000000000001450520414700303605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-synthetic-named-export-cross-chunk/_config.js000066400000000000000000000006141450520414700323230ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'deconflicts synthetic named exports across chunks', options: { input: ['main', 'foo'], preserveEntrySignatures: 'allow-extension', plugins: [ { transform(code) { return { code, syntheticNamedExports: 'bar' }; } } ] }, exports(exports) { assert.strictEqual(exports(2), 4); } }); rollup-3.29.4/test/function/samples/deconflict-synthetic-named-export-cross-chunk/foo.js000066400000000000000000000000531450520414700314770ustar00rootroot00000000000000export const bar = { double: x => x * x }; rollup-3.29.4/test/function/samples/deconflict-synthetic-named-export-cross-chunk/main.js000066400000000000000000000001331450520414700316370ustar00rootroot00000000000000import { double } from './foo.js'; export default function (foo) { return double(foo); } rollup-3.29.4/test/function/samples/deconflict-synthetic-named-export/000077500000000000000000000000001450520414700261235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflict-synthetic-named-export/_config.js000066400000000000000000000004661450520414700300730ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'deconflicts synthetic named exports', options: { plugins: [ { transform(code) { return { code, syntheticNamedExports: 'foo' }; } } ] }, exports(exports) { assert.strictEqual(exports(2), 4); } }); rollup-3.29.4/test/function/samples/deconflict-synthetic-named-export/foo.js000066400000000000000000000000531450520414700272420ustar00rootroot00000000000000export const foo = { double: x => x * x }; rollup-3.29.4/test/function/samples/deconflict-synthetic-named-export/main.js000066400000000000000000000001331450520414700274020ustar00rootroot00000000000000import { double } from './foo.js'; export default function (foo) { return double(foo); } rollup-3.29.4/test/function/samples/deconflicts-classes/000077500000000000000000000000001450520414700233305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflicts-classes/_config.js000066400000000000000000000001201450520414700252630ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts top-level classes' }); rollup-3.29.4/test/function/samples/deconflicts-classes/a.js000066400000000000000000000000561450520414700241070ustar00rootroot00000000000000var Foo = function Foo () {}; export { Foo }; rollup-3.29.4/test/function/samples/deconflicts-classes/b.js000066400000000000000000000000361450520414700241060ustar00rootroot00000000000000class Foo {}; export { Foo }; rollup-3.29.4/test/function/samples/deconflicts-classes/main.js000066400000000000000000000001401450520414700246050ustar00rootroot00000000000000import { Foo as A } from './a.js'; import { Foo as B } from './b.js'; assert.notEqual( A, B ); rollup-3.29.4/test/function/samples/deconflicts-exports-2/000077500000000000000000000000001450520414700235365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflicts-exports-2/_config.js000066400000000000000000000003061450520414700254770ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'renames nested variables named "exports" if necessary', exports(exports) { assert.equal(exports.x, 2); } }); rollup-3.29.4/test/function/samples/deconflicts-exports-2/main.js000066400000000000000000000003151450520414700250170ustar00rootroot00000000000000function nested() { var exports = { x: 99 }; exports.x++; assert.equal(exports.x, 100); assert.equal(x, 1); x++; assert.equal(exports.x, 100); assert.equal(x, 2); } export var x = 1; nested(); rollup-3.29.4/test/function/samples/deconflicts-exports-3/000077500000000000000000000000001450520414700235375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflicts-exports-3/_config.js000066400000000000000000000002741450520414700255040ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'renames variables named "module" if necessary', exports(exports) { assert.equal(exports, 1); } }); rollup-3.29.4/test/function/samples/deconflicts-exports-3/main.js000066400000000000000000000001251450520414700250170ustar00rootroot00000000000000var module = { exports: 99 }; assert.equal(module.exports, 99); export default 1; rollup-3.29.4/test/function/samples/deconflicts-exports/000077500000000000000000000000001450520414700233775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflicts-exports/_config.js000066400000000000000000000004261450520414700253430ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'renames variables named "exports" if necessary', exports(exports) { assert.deepEqual(Object.keys(exports), ['a', 'b']); assert.equal(exports.a, 'A'); assert.equal(exports.b, 42); } }); rollup-3.29.4/test/function/samples/deconflicts-exports/main.js000066400000000000000000000002211450520414700246540ustar00rootroot00000000000000var exports = { number: 21 }; export var a = 'A'; export var b = exports.number * 2; assert.deepEqual( Object.keys( exports ), [ 'number' ]); rollup-3.29.4/test/function/samples/deconflicts-external-imports/000077500000000000000000000000001450520414700252105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflicts-external-imports/_config.js000066400000000000000000000003131450520414700271470ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts external imports', context: { require(id) { return function () { return id; }; } }, options: { external: ['foo', 'bar'] } }); rollup-3.29.4/test/function/samples/deconflicts-external-imports/a.js000066400000000000000000000001261450520414700257650ustar00rootroot00000000000000import foo from 'foo'; export default function () { assert.equal( foo(), 'foo' ); } rollup-3.29.4/test/function/samples/deconflicts-external-imports/b.js000066400000000000000000000001261450520414700257660ustar00rootroot00000000000000import foo from 'bar'; export default function () { assert.equal( foo(), 'bar' ); } rollup-3.29.4/test/function/samples/deconflicts-external-imports/main.js000066400000000000000000000000651450520414700264730ustar00rootroot00000000000000import a from './a'; import b from './b'; a(); b(); rollup-3.29.4/test/function/samples/deconflicts-generated-default-names/000077500000000000000000000000001450520414700263545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflicts-generated-default-names/_config.js000066400000000000000000000001351450520414700303150ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts generated default export names' }); rollup-3.29.4/test/function/samples/deconflicts-generated-default-names/foo.js000066400000000000000000000002061450520414700274730ustar00rootroot00000000000000export default notActuallyFoo; function notActuallyFoo () { return 'not ' + foo(); } function foo () { return 'actually foo'; } rollup-3.29.4/test/function/samples/deconflicts-generated-default-names/main.js000066400000000000000000000001051450520414700276320ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 'not actually foo' ); rollup-3.29.4/test/function/samples/deconflicts-globals/000077500000000000000000000000001450520414700233165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflicts-globals/_config.js000066400000000000000000000001421450520414700252550ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts names that are assumed to be global' }); rollup-3.29.4/test/function/samples/deconflicts-globals/bar.js000066400000000000000000000001471450520414700244220ustar00rootroot00000000000000import foo from './foo'; export default function() { assert.equal( foo(), 'foo' ); return Number; } rollup-3.29.4/test/function/samples/deconflicts-globals/foo.js000066400000000000000000000001061450520414700244340ustar00rootroot00000000000000export var Number = 42; export default function() { return 'foo'; } rollup-3.29.4/test/function/samples/deconflicts-globals/main.js000066400000000000000000000001701450520414700245760ustar00rootroot00000000000000import { Number } from './foo'; import bar from './bar'; assert.equal( Number, 42 ); assert.notEqual( bar(), Number ); rollup-3.29.4/test/function/samples/deconflicts-interop/000077500000000000000000000000001450520414700233535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconflicts-interop/_config.js000066400000000000000000000011411450520414700253120ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts the interop function', options: { external(id) { return id.startsWith('external'); }, output: { interop(id) { switch (id) { case 'external1': case 'external2': { return 'auto'; } case 'external3': { return 'default'; } case 'external4': { return 'defaultOnly'; } default: { throw new Error(`Unexpected require "${id}"`); } } } } }, context: { require: () => Object.defineProperty({ foo: 'foo', default: 'bar' }, '__esModule', { value: true }) } }); rollup-3.29.4/test/function/samples/deconflicts-interop/main.js000066400000000000000000000014531450520414700246400ustar00rootroot00000000000000import external1 from 'external1'; import * as external2 from 'external2'; import * as external3 from 'external3'; import * as external4 from 'external4'; const _interopDefault = null; const _interopNamespace = null; const _interopNamespaceDefault = null; const _interopNamespaceDefaultOnly = null; assert.strictEqual(_interopDefault, null); assert.strictEqual(_interopNamespace, null); assert.strictEqual(_interopNamespaceDefault, null); assert.strictEqual(_interopNamespaceDefaultOnly, null); assert.strictEqual(external1, 'bar'); assert.deepStrictEqual(external2, { default: 'bar', foo: 'foo' }); assert.deepStrictEqual(external3, { __proto__: null, default: { default: 'bar', foo: 'foo' }, foo: 'foo' }); assert.deepStrictEqual(external4, { __proto__: null, default: { default: 'bar', foo: 'foo' } }); rollup-3.29.4/test/function/samples/deconstructed-exported-vars/000077500000000000000000000000001450520414700250475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deconstructed-exported-vars/_config.js000066400000000000000000000003751450520414700270160ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows destructuring in exported variable declarations, synthetic or otherwise', exports(exports) { assert.equal(exports.a, 1); assert.equal(exports.d, 4); } }); rollup-3.29.4/test/function/samples/deconstructed-exported-vars/main.js000066400000000000000000000002061450520414700263270ustar00rootroot00000000000000let { a, b } = c(), [ d, e ] = f(); function c () { return { a: 1, b: 2 }; } function f () { return [ 4, 5 ]; } export { a, d }; rollup-3.29.4/test/function/samples/default-export-as-is-bound/000077500000000000000000000000001450520414700244625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-export-as-is-bound/_config.js000066400000000000000000000001261450520414700264230ustar00rootroot00000000000000module.exports = defineTest({ description: 'does bind export as default (#1078)' }); rollup-3.29.4/test/function/samples/default-export-as-is-bound/foo.js000066400000000000000000000001121450520414700255750ustar00rootroot00000000000000var a = 42; export function change() { a++; } export { a as default }; rollup-3.29.4/test/function/samples/default-export-as-is-bound/main.js000066400000000000000000000002251450520414700257430ustar00rootroot00000000000000import a from './foo'; import { change } from './foo'; assert.equal( a, 42 ); change(); assert.equal( a, 43, 'export as default should be bound' ); rollup-3.29.4/test/function/samples/default-export-before-declaration/000077500000000000000000000000001450520414700260665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-export-before-declaration/_config.js000066400000000000000000000003221450520414700300250ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles default exports before a variable is declared', exports(exports) { assert.strictEqual(exports, undefined); } }); rollup-3.29.4/test/function/samples/default-export-before-declaration/main.js000066400000000000000000000000441450520414700273460ustar00rootroot00000000000000export default foo; var foo = true; rollup-3.29.4/test/function/samples/default-export-is-not-bound-b/000077500000000000000000000000001450520414700250765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-export-is-not-bound-b/_config.js000066400000000000000000000003231450520414700270360ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not move default export statement above earlier statements', exports(exports) { assert.equal(exports.bar, 42); } }); rollup-3.29.4/test/function/samples/default-export-is-not-bound-b/foo.js000066400000000000000000000001721450520414700262170ustar00rootroot00000000000000var Foo = function () { this.bar = bar(); } export default Foo; Foo = 'something else'; function bar() { return 42; } rollup-3.29.4/test/function/samples/default-export-is-not-bound-b/main.js000066400000000000000000000000641450520414700263600ustar00rootroot00000000000000import Foo from './foo'; export default new Foo(); rollup-3.29.4/test/function/samples/default-export-is-not-bound/000077500000000000000000000000001450520414700246575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-export-is-not-bound/_config.js000066400000000000000000000002761450520414700266260ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not bind default exports' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-default rollup-3.29.4/test/function/samples/default-export-is-not-bound/foo.js000066400000000000000000000004351450520414700260020ustar00rootroot00000000000000var a = 42; export function change() { a++; } export default a; // Any replacement for the `export default` above needs to happen in the same // location. It cannot be done, say, at the end of the file. Otherwise the new // value of `a` will be used and will be incorrect. a = 0; rollup-3.29.4/test/function/samples/default-export-is-not-bound/main.js000066400000000000000000000002261450520414700261410ustar00rootroot00000000000000import a from './foo'; import { change } from './foo'; assert.equal( a, 42 ); change(); assert.equal( a, 42, 'default export should not be bound' ); rollup-3.29.4/test/function/samples/default-export-with-null-prototype/000077500000000000000000000000001450520414700263275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-export-with-null-prototype/_config.js000066400000000000000000000005141450520414700302710ustar00rootroot00000000000000module.exports = defineTest({ description: 'default exports of objects with null prototypes are supported', options: { external: ['foo'], output: { format: 'iife', globals: { foo: 'foo' } }, plugins: [ { renderChunk: code => ` const foo = { __proto__: null, bar: 42 }; ${code} ` } ] } }); rollup-3.29.4/test/function/samples/default-export-with-null-prototype/main.js000066400000000000000000000000631450520414700276100ustar00rootroot00000000000000import foo from 'foo'; assert.equal(foo.bar, 42); rollup-3.29.4/test/function/samples/default-exported-global/000077500000000000000000000000001450520414700241125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-exported-global/_config.js000066400000000000000000000003351450520414700260550ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Tracks updates of default exported globals', exports(exports) { assert.deepStrictEqual(exports, { original: 1, updated: 2 }); } }); rollup-3.29.4/test/function/samples/default-exported-global/lib.js000066400000000000000000000001741450520414700252200ustar00rootroot00000000000000global.myGlobal = 1; export default myGlobal; global.myGlobal = 2; export const updated = myGlobal; delete global.myGlobal; rollup-3.29.4/test/function/samples/default-exported-global/main.js000066400000000000000000000000661450520414700253760ustar00rootroot00000000000000export { default as original, updated } from './lib'; rollup-3.29.4/test/function/samples/default-exports-in-parens-class-with-id/000077500000000000000000000000001450520414700270665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-exports-in-parens-class-with-id/_config.js000066400000000000000000000001521450520414700310260ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles default class with id exports wrapped in parens' }); rollup-3.29.4/test/function/samples/default-exports-in-parens-class-with-id/foo.js000066400000000000000000000000351450520414700302050ustar00rootroot00000000000000export default (class A {}); rollup-3.29.4/test/function/samples/default-exports-in-parens-class-with-id/main.js000066400000000000000000000001221450520414700303430ustar00rootroot00000000000000import Foo from './foo.js'; var obj = new Foo(); assert.ok( obj instanceof Foo ); rollup-3.29.4/test/function/samples/default-exports-in-parens-class-without-id/000077500000000000000000000000001450520414700276165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-exports-in-parens-class-without-id/_config.js000066400000000000000000000001551450520414700315610ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles default class without id exports wrapped in parens' }); rollup-3.29.4/test/function/samples/default-exports-in-parens-class-without-id/foo.js000066400000000000000000000000331450520414700307330ustar00rootroot00000000000000export default (class {}); rollup-3.29.4/test/function/samples/default-exports-in-parens-class-without-id/main.js000066400000000000000000000001221450520414700310730ustar00rootroot00000000000000import Foo from './foo.js'; var obj = new Foo(); assert.ok( obj instanceof Foo ); rollup-3.29.4/test/function/samples/default-exports-in-parens-function-with-id/000077500000000000000000000000001450520414700276065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-exports-in-parens-function-with-id/_config.js000066400000000000000000000001551450520414700315510ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles default function with id exports wrapped in parens' }); rollup-3.29.4/test/function/samples/default-exports-in-parens-function-with-id/foo.js000066400000000000000000000001011450520414700307170ustar00rootroot00000000000000export default (function transform() { global.answer = 42; }); rollup-3.29.4/test/function/samples/default-exports-in-parens-function-with-id/main.js000066400000000000000000000001061450520414700310650ustar00rootroot00000000000000import foo from './foo.js'; foo(); assert.equal( global.answer, 42 ); rollup-3.29.4/test/function/samples/default-exports-in-parens-function-without-id/000077500000000000000000000000001450520414700303365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-exports-in-parens-function-without-id/_config.js000066400000000000000000000001601450520414700322750ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles default function without id exports wrapped in parens' }); rollup-3.29.4/test/function/samples/default-exports-in-parens-function-without-id/foo.js000066400000000000000000000000701450520414700314540ustar00rootroot00000000000000export default (function () { global.answer = 42; }); rollup-3.29.4/test/function/samples/default-exports-in-parens-function-without-id/main.js000066400000000000000000000001061450520414700316150ustar00rootroot00000000000000import foo from './foo.js'; foo(); assert.equal( global.answer, 42 ); rollup-3.29.4/test/function/samples/default-function-export-conflict/000077500000000000000000000000001450520414700257655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-function-export-conflict/_config.js000066400000000000000000000001271450520414700277270ustar00rootroot00000000000000module.exports = defineTest({ description: 'default export of anonymous function' }); rollup-3.29.4/test/function/samples/default-function-export-conflict/foo.js000066400000000000000000000001161450520414700271040ustar00rootroot00000000000000function foo() { return 42; } export default function () { return foo(); } rollup-3.29.4/test/function/samples/default-function-export-conflict/main.js000066400000000000000000000000651450520414700272500ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 42 ); rollup-3.29.4/test/function/samples/default-not-reexported/000077500000000000000000000000001450520414700240015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/default-not-reexported/_config.js000066400000000000000000000013431450520414700257440ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); const ID_BAR = path.join(__dirname, 'bar.js'); module.exports = defineTest({ description: 'default export is not re-exported with export *', error: { binding: 'default', code: 'MISSING_EXPORT', exporter: ID_FOO, message: '"default" is not exported by "foo.js", imported by "main.js".', id: ID_MAIN, pos: 7, watchFiles: [ID_BAR, ID_FOO, ID_MAIN], loc: { file: ID_MAIN, line: 1, column: 7 }, frame: ` 1: import def from './foo.js'; ^ 2: 3: console.log( def ); `, url: `https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module` } }); rollup-3.29.4/test/function/samples/default-not-reexported/bar.js000066400000000000000000000001051450520414700250770ustar00rootroot00000000000000export const named = 42; export default 'should not be re-exported'; rollup-3.29.4/test/function/samples/default-not-reexported/foo.js000066400000000000000000000000321450520414700251150ustar00rootroot00000000000000export * from './bar.js'; rollup-3.29.4/test/function/samples/default-not-reexported/main.js000066400000000000000000000000611450520414700252600ustar00rootroot00000000000000import def from './foo.js'; console.log( def ); rollup-3.29.4/test/function/samples/delete/000077500000000000000000000000001450520414700206425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/delete/_config.js000066400000000000000000000001421450520414700226010ustar00rootroot00000000000000module.exports = defineTest({ description: '`delete` operator at the top level is preserved' }); rollup-3.29.4/test/function/samples/delete/main.js000066400000000000000000000001361450520414700221240ustar00rootroot00000000000000var a = { b: 1 }; assert.strictEqual(a.b, 1); delete a.b; assert.strictEqual(a.b, undefined); rollup-3.29.4/test/function/samples/deoptimize-assumes-getters/000077500000000000000000000000001450520414700247025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-assumes-getters/_config.js000066400000000000000000000001571450520414700266470ustar00rootroot00000000000000module.exports = defineTest({ description: 'assume full deoptimization may inject side-effectful getters' }); rollup-3.29.4/test/function/samples/deoptimize-assumes-getters/main.js000066400000000000000000000002711450520414700261640ustar00rootroot00000000000000const obj = {}; addGetter(obj); let mutated = false; obj.prop; assert.ok(mutated); function addGetter(o) { Object.defineProperty(o, 'prop', { get() { mutated = true; } }); } rollup-3.29.4/test/function/samples/deoptimize-cached-prop/000077500000000000000000000000001450520414700237345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-cached-prop/_config.js000066400000000000000000000001671450520414700257020ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes cached properties and return values if necessary (#3264)' }); rollup-3.29.4/test/function/samples/deoptimize-cached-prop/main.js000066400000000000000000000005431450520414700252200ustar00rootroot00000000000000const obj1 = {}; let prop = 'x'; updateProp(); obj1[prop] = true; assert.strictEqual(obj1.y ? 'WORKING' : 'BUG', 'WORKING'); function updateProp() { prop = 'y'; } const obj2 = {}; obj2[getResult().prop] = 1; assert.equal(obj2.foo ? 'WORKING' : 'BUG', 'WORKING'); function getResult() { const result = {}; result.prop = 'foo'; return result; } rollup-3.29.4/test/function/samples/deoptimize-call-expression-reassignments/000077500000000000000000000000001450520414700275375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-call-expression-reassignments/_config.js000066400000000000000000000002201450520414700314730ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes call expressions of conditional expressions if their return value is reassigned' }); rollup-3.29.4/test/function/samples/deoptimize-call-expression-reassignments/main.js000066400000000000000000000006001450520414700310150ustar00rootroot00000000000000let foo = false; const obj = {}; reassignFoo(); (foo ? function() { return obj; } : function() { return {}; })().x = true; (foo ? () => obj : () => ({}))().y = true; if (!obj.x) { throw new Error('function reassignment was not tracked'); } if (!obj.y) { throw new Error('arrow function reassignment was not tracked'); } function reassignFoo() { foo = true; } rollup-3.29.4/test/function/samples/deoptimize-call-expressions/000077500000000000000000000000001450520414700250425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-call-expressions/_config.js000066400000000000000000000002151450520414700270020ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes call expressions conditional expressions if their return value is reassigned' }); rollup-3.29.4/test/function/samples/deoptimize-call-expressions/main.js000066400000000000000000000004601450520414700263240ustar00rootroot00000000000000let foo = false; reassignFoo(); if ((foo ? () => false : () => true)()) { throw new Error('Literal reassignment was not tracked'); } if ((foo ? () => () => false : () => () => true)()()) { throw new Error('Return expression reassignment was not tracked'); } function reassignFoo() { foo = true; } rollup-3.29.4/test/function/samples/deoptimize-class/000077500000000000000000000000001450520414700226545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-class/_config.js000066400000000000000000000001441450520414700246150ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles deoptimization of static class properties' }); rollup-3.29.4/test/function/samples/deoptimize-class/main.js000066400000000000000000000006641450520414700241440ustar00rootroot00000000000000let trueProp = 'old'; let falseProp = 'new'; function getClass() { return class { static [trueProp]() { return true; } static [falseProp]() { return false; } }; } if (!getClass().old()) throw new Error('old missing'); if (getClass().new()) throw new Error('new present'); trueProp = 'new'; falseProp = 'old'; if (getClass().old()) throw new Error('old present'); if (!getClass().new()) throw new Error('new missing'); rollup-3.29.4/test/function/samples/deoptimize-computed-class-keys/000077500000000000000000000000001450520414700254435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-computed-class-keys/_config.js000066400000000000000000000001331450520414700274020ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes computed class property keys' }); rollup-3.29.4/test/function/samples/deoptimize-computed-class-keys/main.js000066400000000000000000000003461450520414700267300ustar00rootroot00000000000000var key1 = 'x'; var key2 = 'y'; changeKeys(); class Foo { static [key1] = true; static [key2] = false; } assert.strictEqual(Foo.x, false); assert.strictEqual(Foo.y, true); function changeKeys() { key1 = 'y'; key2 = 'x'; } rollup-3.29.4/test/function/samples/deoptimize-computed-keys/000077500000000000000000000000001450520414700243405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-computed-keys/_config.js000066400000000000000000000001341450520414700263000ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes computed object property keys' }); rollup-3.29.4/test/function/samples/deoptimize-computed-keys/main.js000066400000000000000000000003171450520414700256230ustar00rootroot00000000000000var key1 = 'x' var key2 = 'y' changeKeys(); var foo = { [key1]: true, [key2]: false }; assert.strictEqual(foo.x, false); assert.strictEqual(foo.y, true); function changeKeys() { key1 = 'y' key2 = 'x' }rollup-3.29.4/test/function/samples/deoptimize-conditional-expression-reassignments/000077500000000000000000000000001450520414700311275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-conditional-expression-reassignments/_config.js000066400000000000000000000001561450520414700330730ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks reassignments of deoptimized conditional expressions' }); rollup-3.29.4/test/function/samples/deoptimize-conditional-expression-reassignments/main.js000066400000000000000000000003471450520414700324150ustar00rootroot00000000000000let obj1 = { x: false }, obj2 = { x: false }; let foo = false; reassignFoo(); (foo ? obj1 : obj2).x = true; if (!obj1.x || obj2.x) { throw new Error('Reassignment was not tracked'); } function reassignFoo() { foo = true; } rollup-3.29.4/test/function/samples/deoptimize-conditional-expressions/000077500000000000000000000000001450520414700264325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-conditional-expressions/_config.js000066400000000000000000000001621450520414700303730ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps conditional expressions if their test value is reassigned' }); rollup-3.29.4/test/function/samples/deoptimize-conditional-expressions/main.js000066400000000000000000000004261450520414700277160ustar00rootroot00000000000000let foo = false; reassignFoo(); if (!(foo ? true : false)) { throw new Error('Literal reassignment was not tracked'); } if (!(foo ? () => true : () => false)()) { throw new Error('Return expression reassignment was not tracked'); } function reassignFoo() { foo = true; } rollup-3.29.4/test/function/samples/deoptimize-logical-expression-reassignments/000077500000000000000000000000001450520414700302365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-logical-expression-reassignments/_config.js000066400000000000000000000001521450520414700321760ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks reassignments of deoptimized logical expressions' }); rollup-3.29.4/test/function/samples/deoptimize-logical-expression-reassignments/main.js000066400000000000000000000002761450520414700315250ustar00rootroot00000000000000let obj = { x: false }; let foo = false; reassignFoo(); (foo && obj).x = true; if (!obj.x) { throw new Error('Reassignment was not tracked'); } function reassignFoo() { foo = true; } rollup-3.29.4/test/function/samples/deoptimize-logical-expressions/000077500000000000000000000000001450520414700255415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-logical-expressions/_config.js000066400000000000000000000001541450520414700275030ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps logical expressions if the first part is reassigned' }); rollup-3.29.4/test/function/samples/deoptimize-logical-expressions/main.js000066400000000000000000000004061450520414700270230ustar00rootroot00000000000000let foo = false; reassignFoo(); if (!(foo && true)) { throw new Error('Literal reassignment was not tracked'); } if (!(foo || (() => false))()) { throw new Error('Return value reassignment was not tracked'); } function reassignFoo() { foo = () => true; } rollup-3.29.4/test/function/samples/deoptimize-loop-element/000077500000000000000000000000001450520414700241475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-loop-element/_config.js000066400000000000000000000001451450520414700261110ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes the loop element when it is reassigned' }); rollup-3.29.4/test/function/samples/deoptimize-loop-element/main.js000066400000000000000000000001711450520414700254300ustar00rootroot00000000000000const foo = [{ value: 1 }]; for (const item of foo) { item.value = 0; } assert.ok(foo[0].value === 0 ? true : false); rollup-3.29.4/test/function/samples/deoptimize-member-expressions/000077500000000000000000000000001450520414700253765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-member-expressions/_config.js000066400000000000000000000001631450520414700273400ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps accesses to computed properties if their key is reassigned' }); rollup-3.29.4/test/function/samples/deoptimize-member-expressions/main.js000066400000000000000000000005211450520414700266560ustar00rootroot00000000000000let foo = 'foo', bar = 'bar'; const obj = { foo: true, bar: () => false, baz: () => true }; reassign(); if (obj[foo]) { throw new Error('Literal reassignment was not tracked'); } if (!obj[bar]()) { throw new Error('Return expression reassignment was not tracked'); } function reassign() { foo = 'reassigned'; bar = 'baz'; } rollup-3.29.4/test/function/samples/deoptimize-missing-namespace-members/000077500000000000000000000000001450520414700266025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-missing-namespace-members/_config.js000066400000000000000000000003311450520414700305410ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles deoptimization of non-existing namespace members', exports(exports) { assert.strictEqual(exports.bar, undefined); } }); rollup-3.29.4/test/function/samples/deoptimize-missing-namespace-members/main.js000066400000000000000000000001221450520414700300570ustar00rootroot00000000000000import * as ns from './other.js'; const foo = 'foo'; export const bar = ns[foo]; rollup-3.29.4/test/function/samples/deoptimize-missing-namespace-members/other.js000066400000000000000000000000001450520414700302470ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-object-expressions-2/000077500000000000000000000000001450520414700255345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-object-expressions-2/_config.js000066400000000000000000000001601450520414700274730ustar00rootroot00000000000000module.exports = defineTest({ description: 'track deoptimizations of computed properties of empty objects' }); rollup-3.29.4/test/function/samples/deoptimize-object-expressions-2/main.js000066400000000000000000000002231450520414700270130ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-3.29.4/test/function/samples/deoptimize-object-expressions/000077500000000000000000000000001450520414700253755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-object-expressions/_config.js000066400000000000000000000001371450520414700273400ustar00rootroot00000000000000module.exports = defineTest({ description: 'track deoptimizations of computed properties' }); rollup-3.29.4/test/function/samples/deoptimize-object-expressions/main.js000066400000000000000000000003061450520414700266560ustar00rootroot00000000000000let foo = false; reassign(); const obj = { x: false, [foo ? 'x' : 'y']: true }; if (!obj.x || obj.y) { throw new Error('Reassignment was not tracked'); } function reassign() { foo = true; } rollup-3.29.4/test/function/samples/deoptimize-object/000077500000000000000000000000001450520414700230155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-object/_config.js000066400000000000000000000001361450520414700247570ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles deoptimization of object properties' }); rollup-3.29.4/test/function/samples/deoptimize-object/main.js000066400000000000000000000004371450520414700243030ustar00rootroot00000000000000let prop = 'old'; function getObj() { return { [prop]: true }; } if (!getObj().old) throw new Error('old missing'); if (getObj().new) throw new Error('new present'); prop = 'new'; if (getObj().old) throw new Error('old present'); if (!getObj().new) throw new Error('new missing'); rollup-3.29.4/test/function/samples/deoptimize-request-treeshaking-pass/000077500000000000000000000000001450520414700265055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-request-treeshaking-pass/_config.js000066400000000000000000000004141450520414700304460ustar00rootroot00000000000000const assert = require('node:assert'); const result = { value: 0 }; module.exports = defineTest({ description: 'makes sure to request additional passes when a variable is deoptimized', context: { result }, exports() { assert.strictEqual(result.value, 2); } }); rollup-3.29.4/test/function/samples/deoptimize-request-treeshaking-pass/main.js000066400000000000000000000003341450520414700277670ustar00rootroot00000000000000function heisenbug() { var a = false; function f(b) { if (a) a === b.c ? result.value++ : result.value--; a = b.c; } function g() {} function h() { f({ c: g }); } h(); h(); } heisenbug(); heisenbug(); rollup-3.29.4/test/function/samples/deoptimize-this-parameters/000077500000000000000000000000001450520414700246575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-this-parameters/_config.js000066400000000000000000000001341450520414700266170ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles deoptimization of this parameters' }); rollup-3.29.4/test/function/samples/deoptimize-this-parameters/main.js000066400000000000000000000005451450520414700261450ustar00rootroot00000000000000const obj = { flag: false, otherFlag: false, otherProp() { this.otherFlag = true; }, prop() { this.flag = true; this.otherProp(); } }; const otherObj = { prop: obj.prop, otherProp: obj.otherProp }; obj.prop(); otherObj.prop(); if (!obj.flag) throw new Error('first flag missing'); if (!otherObj.flag) throw new Error('second flag missing'); rollup-3.29.4/test/function/samples/deoptimize-via-arguments/000077500000000000000000000000001450520414700243315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deoptimize-via-arguments/_config.js000066400000000000000000000001411450520414700262670ustar00rootroot00000000000000module.exports = { description: 'deoptimize call parameters when arguments variable is used' }; rollup-3.29.4/test/function/samples/deoptimize-via-arguments/main.js000066400000000000000000000003271450520414700256150ustar00rootroot00000000000000function mutate(a) { arguments[0].x = true; arguments[1].x = true; } var obj1 = { x: false }; var obj2 = { x: false }; mutate(obj1, obj2); assert.ok(obj1.x ? true : false); assert.ok(obj2.x ? true : false); rollup-3.29.4/test/function/samples/deprecated/000077500000000000000000000000001450520414700215005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/compact/000077500000000000000000000000001450520414700231265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/compact/_config.js000066400000000000000000000013501450520414700250670ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'compact output with compact: true', options: { strictDeprecations: false, external: ['external'], output: { compact: true, namespaceToStringTag: true } }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_MAIN], message: 'Circular dependency: main.js -> main.js' }, { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ], context: { require() { return 42; } } }); rollup-3.29.4/test/function/samples/deprecated/compact/main.js000066400000000000000000000003711450520414700244110ustar00rootroot00000000000000import x from 'external'; import * as self from './main.js'; assert.equal(self && self['de' + 'fault'](), 42); export default function foo() { return x; } import('./main.js').then(self => { assert.equal(self && self['de' + 'fault'](), 42); }); rollup-3.29.4/test/function/samples/deprecated/dynamic-import-duplicates/000077500000000000000000000000001450520414700265675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/dynamic-import-duplicates/_config.js000066400000000000000000000010721450520414700305310ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Dynamic import inlining', options: { strictDeprecations: false, inlineDynamicImports: true }, exports(exports) { assert.equal(exports.x, 41); return exports.promise.then(y => { assert.equal(y, 42); }); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' } ] }); rollup-3.29.4/test/function/samples/deprecated/dynamic-import-duplicates/foo.js000066400000000000000000000000221450520414700277020ustar00rootroot00000000000000export var x = 42;rollup-3.29.4/test/function/samples/deprecated/dynamic-import-duplicates/main.js000066400000000000000000000002001450520414700300410ustar00rootroot00000000000000export var x = 41; export var promise = Promise.all([import('./foo'), import('./foo')]).then(foos => { return foos[0].x; }); rollup-3.29.4/test/function/samples/deprecated/dynamic-import-inlining/000077500000000000000000000000001450520414700262415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/dynamic-import-inlining/_config.js000066400000000000000000000010721450520414700302030ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Dynamic import inlining', options: { strictDeprecations: false, inlineDynamicImports: true }, exports(exports) { assert.equal(exports.x, 41); return exports.promise.then(y => { assert.equal(y, 42); }); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' } ] }); rollup-3.29.4/test/function/samples/deprecated/dynamic-import-inlining/foo.js000066400000000000000000000000221450520414700273540ustar00rootroot00000000000000export var x = 42;rollup-3.29.4/test/function/samples/deprecated/dynamic-import-inlining/main.js000066400000000000000000000001331450520414700275200ustar00rootroot00000000000000export var x = 41; export var promise = import('./foo').then(foo => { return foo.x; }); rollup-3.29.4/test/function/samples/deprecated/dynamic-import-name-warn/000077500000000000000000000000001450520414700263175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/dynamic-import-name-warn/_config.js000066400000000000000000000021501450520414700302570ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'warns when specifying a custom importer function for formats other than "es"', context: { require(path) { assert.equal(path, './foo.js'); return 42; } }, options: { strictDeprecations: false, input: 'main.js', plugins: { resolveDynamicImport() { return false; } }, output: { dynamicImportFunction: 'myImporter', format: 'cjs', dynamicImportInCjs: false } }, exports(exports) { return exports.fromFoo.then(value => assert.deepStrictEqual(value, { __proto__: null, default: 42 }) ); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.', url: 'https://rollupjs.org/plugin-development/#renderdynamicimport' }, { code: 'INVALID_OPTION', message: 'Invalid value for option "output.dynamicImportFunction" - this option is ignored for formats other than "es".', url: 'https://rollupjs.org/configuration-options/#output-dynamicimportfunction' } ] }); rollup-3.29.4/test/function/samples/deprecated/dynamic-import-name-warn/main.js000066400000000000000000000000531450520414700275770ustar00rootroot00000000000000export const fromFoo = import('./foo.js'); rollup-3.29.4/test/function/samples/deprecated/dynamic-import-name/000077500000000000000000000000001450520414700253525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/dynamic-import-name/_config.js000066400000000000000000000013611450520414700273150ustar00rootroot00000000000000const assert = require('node:assert'); let imported = false; module.exports = defineTest({ description: 'allows specifying a custom importer function', context: { myImporter(path) { assert.equal(path, './foo.js'); imported = true; } }, options: { strictDeprecations: false, input: 'main.js', plugins: { resolveDynamicImport() { return false; } }, output: { dynamicImportFunction: 'myImporter', format: 'es' } }, exports() { assert.ok(imported); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.', url: 'https://rollupjs.org/plugin-development/#renderdynamicimport' } ] }); rollup-3.29.4/test/function/samples/deprecated/dynamic-import-name/main.js000066400000000000000000000000241450520414700266300ustar00rootroot00000000000000import('./foo.js'); rollup-3.29.4/test/function/samples/deprecated/inline-dynamic-imports-bundle/000077500000000000000000000000001450520414700273425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js000066400000000000000000000013301450520414700313010ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'ignores non-bundled modules when inlining dynamic imports', options: { strictDeprecations: false, inlineDynamicImports: true, plugins: { generateBundle(options, bundle) { assert.deepStrictEqual(Object.keys(bundle['main.js'].modules), [ path.join(__dirname, 'lib.js'), path.join(__dirname, 'main.js') ]); } } }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' } ] }); rollup-3.29.4/test/function/samples/deprecated/inline-dynamic-imports-bundle/lib.js000066400000000000000000000000271450520414700304450ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/function/samples/deprecated/inline-dynamic-imports-bundle/main.js000066400000000000000000000000441450520414700306220ustar00rootroot00000000000000export { foo } from './reexporter'; rollup-3.29.4/test/function/samples/deprecated/inline-dynamic-imports-bundle/reexporter.js000066400000000000000000000000351450520414700320750ustar00rootroot00000000000000export { foo } from './lib'; rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-manual/000077500000000000000000000000001450520414700266755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-manual/_config.js000066400000000000000000000010041450520414700306320ustar00rootroot00000000000000module.exports = defineTest({ description: 'Manual chunks are not supported when inlining dynamic imports', options: { strictDeprecations: false, input: ['main.js'], inlineDynamicImports: true, manualChunks: { lib: ['lib.js'] } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.manualChunks" - this option is not supported for "output.inlineDynamicImports".', url: 'https://rollupjs.org/configuration-options/#output-manualchunks' }, warnings: [] }); rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-manual/lib.js000066400000000000000000000000311450520414700277730ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-manual/main.js000066400000000000000000000000741450520414700301600ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-multiple-array/000077500000000000000000000000001450520414700303675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js000066400000000000000000000010261450520414700323300ustar00rootroot00000000000000module.exports = defineTest({ description: 'Having multiple inputs in an array is not supported when inlining dynamic imports', options: { strictDeprecations: false, input: ['main.js', 'lib.js'], inlineDynamicImports: true }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.inlineDynamicImports" - multiple inputs are not supported when "output.inlineDynamicImports" is true.', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' }, warnings: [] }); rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-multiple-array/lib.js000066400000000000000000000000311450520414700314650ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-multiple-array/main.js000066400000000000000000000000741450520414700316520ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-multiple-object/000077500000000000000000000000001450520414700305175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js000066400000000000000000000013061450520414700324610ustar00rootroot00000000000000module.exports = defineTest({ description: 'Having multiple inputs in an object is not supported when inlining dynamic imports', options: { strictDeprecations: false, input: { main: 'main.js', lib: 'lib.js' }, inlineDynamicImports: true }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.inlineDynamicImports" - multiple inputs are not supported when "output.inlineDynamicImports" is true.', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.' } ] }); rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-multiple-object/lib.js000066400000000000000000000000311450520414700316150ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/deprecated/inline-imports-with-multiple-object/main.js000066400000000000000000000000741450520414700320020ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-3.29.4/test/function/samples/deprecated/manual-chunks-conflict/000077500000000000000000000000001450520414700260455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/manual-chunks-conflict/_config.js000066400000000000000000000006171450520414700300130ustar00rootroot00000000000000module.exports = defineTest({ description: 'Throws for conflicts between manual chunks', options: { strictDeprecations: false, input: ['main.js'], output: { manualChunks: { dep1: ['dep.js'], dep2: ['dep.js'] } } }, generateError: { code: 'INVALID_CHUNK', message: 'Cannot assign "dep.js" to the "dep2" chunk as it is already in the "dep1" chunk.' }, warnings: [] }); rollup-3.29.4/test/function/samples/deprecated/manual-chunks-conflict/dep.js000066400000000000000000000000241450520414700271470ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/function/samples/deprecated/manual-chunks-conflict/main.js000066400000000000000000000000231450520414700273220ustar00rootroot00000000000000import './dep.js'; rollup-3.29.4/test/function/samples/deprecated/manual-chunks-info/000077500000000000000000000000001450520414700251775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/manual-chunks-info/_config.js000066400000000000000000000210051450520414700271370ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { getObject } = require('../../../../utils'); function getId(name) { return path.join(__dirname, `${name}.js`); } module.exports = defineTest({ description: 'provides additional chunk information to a manualChunks function', options: { strictDeprecations: false, external: 'external', output: { manualChunks(id, { getModuleIds, getModuleInfo }) { assert.deepStrictEqual( getObject( [...getModuleIds()].map(id => [id, JSON.parse(JSON.stringify(getModuleInfo(id)))]) ), { [getId('dynamic')]: { id: getId('dynamic'), assertions: {}, ast: { type: 'Program', start: 0, end: 88, body: [ { type: 'ExportNamedDeclaration', start: 0, end: 42, declaration: { type: 'VariableDeclaration', start: 7, end: 42, declarations: [ { type: 'VariableDeclarator', start: 13, end: 41, id: { type: 'Identifier', start: 13, end: 20, name: 'promise' }, init: { type: 'ImportExpression', start: 23, end: 41, source: { type: 'Literal', start: 30, end: 40, value: 'external', raw: "'external'" } } } ], kind: 'const' }, specifiers: [], source: null }, { type: 'ExportNamedDeclaration', start: 43, end: 87, declaration: null, specifiers: [ { type: 'ExportSpecifier', start: 52, end: 71, local: { type: 'Identifier', start: 52, end: 59, name: 'default' }, exported: { type: 'Identifier', start: 63, end: 71, name: 'internal' } } ], source: { type: 'Literal', start: 79, end: 86, value: './lib', raw: "'./lib'" } } ], sourceType: 'module' }, code: "export const promise = import('external');\nexport { default as internal } from './lib';\n", dynamicallyImportedIdResolutions: [ { assertions: {}, external: true, id: 'external', meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], dynamicallyImportedIds: ['external'], dynamicImporters: [getId('main')], exports: ['promise', 'internal'], exportedBindings: { '.': ['promise'], './lib': ['internal'] }, hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: getId('lib'), meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [getId('lib')], importers: [], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }, [getId('lib')]: { id: getId('lib'), assertions: {}, ast: { type: 'Program', start: 0, end: 19, body: [ { type: 'ExportDefaultDeclaration', start: 0, end: 18, declaration: { type: 'Literal', start: 15, end: 17, value: 42, raw: '42' } } ], sourceType: 'module' }, code: 'export default 42;\n', dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': ['default'] }, exports: ['default'], hasDefaultExport: true, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [getId('dynamic'), getId('main')], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }, [getId('main')]: { id: getId('main'), assertions: {}, ast: { type: 'Program', start: 0, end: 123, body: [ { type: 'ExportNamedDeclaration', start: 0, end: 43, declaration: { type: 'VariableDeclaration', start: 7, end: 43, declarations: [ { type: 'VariableDeclarator', start: 13, end: 42, id: { type: 'Identifier', start: 13, end: 20, name: 'promise' }, init: { type: 'ImportExpression', start: 23, end: 42, source: { type: 'Literal', start: 30, end: 41, value: './dynamic', raw: "'./dynamic'" } } } ], kind: 'const' }, specifiers: [], source: null }, { type: 'ExportNamedDeclaration', start: 44, end: 85, declaration: null, specifiers: [ { type: 'ExportSpecifier', start: 53, end: 69, local: { type: 'Identifier', start: 53, end: 60, name: 'default' }, exported: { type: 'Identifier', start: 64, end: 69, name: 'value' } } ], source: { type: 'Literal', start: 77, end: 84, value: './lib', raw: "'./lib'" } }, { type: 'ExportNamedDeclaration', start: 86, end: 122, declaration: null, specifiers: [ { type: 'ExportSpecifier', start: 95, end: 103, local: { type: 'Identifier', start: 95, end: 103, name: 'external' }, exported: { type: 'Identifier', start: 95, end: 103, name: 'external' } } ], source: { type: 'Literal', start: 111, end: 121, value: 'external', raw: "'external'" } } ], sourceType: 'module' }, code: "export const promise = import('./dynamic');\nexport { default as value } from './lib';\nexport { external } from 'external';\n", dynamicallyImportedIdResolutions: [ { assertions: {}, external: false, id: getId('dynamic'), meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], dynamicallyImportedIds: [getId('dynamic')], dynamicImporters: [], exportedBindings: { '.': ['promise'], './lib': ['value'], external: ['external'] }, exports: ['promise', 'value', 'external'], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: getId('lib'), meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }, { assertions: {}, external: true, id: 'external', meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [getId('lib'), 'external'], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }, external: { id: 'external', assertions: {}, ast: null, code: null, dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [getId('dynamic')], exportedBindings: null, exports: null, hasDefaultExport: null, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [getId('main')], isEntry: false, isExternal: true, isIncluded: null, meta: {}, syntheticNamedExports: false } } ); } } }, warnings: [] }); rollup-3.29.4/test/function/samples/deprecated/manual-chunks-info/dynamic.js000066400000000000000000000001301450520414700271530ustar00rootroot00000000000000export const promise = import('external'); export { default as internal } from './lib'; rollup-3.29.4/test/function/samples/deprecated/manual-chunks-info/lib.js000066400000000000000000000000231450520414700262760ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/deprecated/manual-chunks-info/main.js000066400000000000000000000001731450520414700264620ustar00rootroot00000000000000export const promise = import('./dynamic'); export { default as value } from './lib'; export { external } from 'external'; rollup-3.29.4/test/function/samples/deprecated/manual-chunks-preserve-modules/000077500000000000000000000000001450520414700275455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js000066400000000000000000000007621450520414700315140ustar00rootroot00000000000000module.exports = defineTest({ description: 'Assigning manual chunks fails when preserving modules', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, manualChunks: { lib: ['lib.js'] } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.manualChunks" - this option is not supported for "output.preserveModules".', url: 'https://rollupjs.org/configuration-options/#output-manualchunks' }, warnings: [] }); rollup-3.29.4/test/function/samples/deprecated/manual-chunks-preserve-modules/lib.js000066400000000000000000000000311450520414700306430ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/deprecated/manual-chunks-preserve-modules/main.js000066400000000000000000000000711450520414700310250ustar00rootroot00000000000000import { value } from './lib'; assert.equal(value, 42); rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/000077500000000000000000000000001450520414700260705ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/infinity/000077500000000000000000000000001450520414700277215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/infinity/1.js000066400000000000000000000000251450520414700304140ustar00rootroot00000000000000export const x1 = 1; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/infinity/2.js000066400000000000000000000000251450520414700304150ustar00rootroot00000000000000export const x2 = 2; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/infinity/3.js000066400000000000000000000000251450520414700304160ustar00rootroot00000000000000export const x3 = 3; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/infinity/4.js000066400000000000000000000000251450520414700304170ustar00rootroot00000000000000export const x4 = 4; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/infinity/5.js000066400000000000000000000000251450520414700304200ustar00rootroot00000000000000export const x5 = 5; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/infinity/_config.js000066400000000000000000000017221450520414700316650ustar00rootroot00000000000000const assert = require('node:assert'); const { promises: fs } = require('node:fs'); const { wait } = require('../../../../../utils'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = defineTest({ description: 'maxParallelFileReads set to infinity', options: { strictDeprecations: false, maxParallelFileReads: 0 }, before() { fs.readFile = async (path, options) => { currentReads++; maxReads = Math.max(maxReads, currentReads); const content = await fsReadFile(path, options); await wait(50); currentReads--; return content; }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 5, 'Wrong number of parallel file reads: ' + maxReads); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', url: 'https://rollupjs.org/configuration-options/#maxparallelfileops' } ] }); rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/infinity/main.js000066400000000000000000000001511450520414700312000ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/set/000077500000000000000000000000001450520414700266635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/set/1.js000066400000000000000000000000251450520414700273560ustar00rootroot00000000000000export const x1 = 1; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/set/2.js000066400000000000000000000000251450520414700273570ustar00rootroot00000000000000export const x2 = 2; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/set/3.js000066400000000000000000000000251450520414700273600ustar00rootroot00000000000000export const x3 = 3; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/set/4.js000066400000000000000000000000251450520414700273610ustar00rootroot00000000000000export const x4 = 4; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/set/5.js000066400000000000000000000000251450520414700273620ustar00rootroot00000000000000export const x5 = 5; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/set/_config.js000066400000000000000000000017131450520414700306270ustar00rootroot00000000000000const assert = require('node:assert'); const { promises: fs } = require('node:fs'); const { wait } = require('../../../../../utils'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = defineTest({ description: 'maxParallelFileReads set to 3', options: { strictDeprecations: false, maxParallelFileReads: 3 }, before() { fs.readFile = async (path, options) => { currentReads++; maxReads = Math.max(maxReads, currentReads); const content = await fsReadFile(path, options); await wait(50); currentReads--; return content; }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', url: 'https://rollupjs.org/configuration-options/#maxparallelfileops' } ] }); rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/set/main.js000066400000000000000000000001511450520414700301420ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/000077500000000000000000000000001450520414700303375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/1.js000066400000000000000000000000251450520414700310320ustar00rootroot00000000000000export const x1 = 1; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/2.js000066400000000000000000000000251450520414700310330ustar00rootroot00000000000000export const x2 = 2; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/3.js000066400000000000000000000000251450520414700310340ustar00rootroot00000000000000export const x3 = 3; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/4.js000066400000000000000000000000251450520414700310350ustar00rootroot00000000000000export const x4 = 4; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/5.js000066400000000000000000000000251450520414700310360ustar00rootroot00000000000000export const x5 = 5; rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/_config.js000066400000000000000000000020441450520414700323010ustar00rootroot00000000000000const assert = require('node:assert'); const { promises: fs } = require('node:fs'); const { wait } = require('../../../../../utils'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = defineTest({ description: 'maxParallelFileReads with plugin', options: { strictDeprecations: false, maxParallelFileReads: 3, plugins: [ { load(id) { return fs.readFile(id, 'utf8'); } } ] }, before() { fs.readFile = async (path, options) => { currentReads++; maxReads = Math.max(maxReads, currentReads); const content = await fsReadFile(path, options); await wait(50); currentReads--; return content; }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', url: 'https://rollupjs.org/configuration-options/#maxparallelfileops' } ] }); rollup-3.29.4/test/function/samples/deprecated/max-parallel-file-reads/with-plugin/main.js000066400000000000000000000001511450520414700316160ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-3.29.4/test/function/samples/deprecated/name-conflict-symbol/000077500000000000000000000000001450520414700255225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/name-conflict-symbol/_config.js000066400000000000000000000011731450520414700274660ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'avoids name conflicts with local variables named Symbol', options: { strictDeprecations: false, output: { namespaceToStringTag: true } }, exports(exports) { assert.strictEqual(exports.Symbol, null); assert.strictEqual(exports.toString(), '[object Module]'); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/name-conflict-symbol/main.js000066400000000000000000000000341450520414700270010ustar00rootroot00000000000000export const Symbol = null; rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/000077500000000000000000000000001450520414700253035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/000077500000000000000000000000001450520414700326035ustar00rootroot00000000000000_config.js000066400000000000000000000014441450520414700344710ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-modeconst assert = require('node:assert'); module.exports = defineTest({ description: 'adds Symbol.toStringTag property to dynamic imports of entry chunks with default export mode', options: { strictDeprecations: false, input: ['main', 'foo'], output: { namespaceToStringTag: true } }, async exports(exports) { const foo = await exports; assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(foo.default, 42); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/foo.js000066400000000000000000000000231450520414700337170ustar00rootroot00000000000000export default 42; main.js000066400000000000000000000000401450520414700340000ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-modeexport default import('./foo'); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/dynamic-import/000077500000000000000000000000001450520414700302375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/dynamic-import/_config.js000066400000000000000000000017241450520414700322050ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'adds Symbol.toStringTag property to dynamic imports', options: { strictDeprecations: false, output: { namespaceToStringTag: true } }, async exports(exports) { const namespace = await exports; assert.strictEqual(Object.prototype.toString.call(namespace), '[object Module]'); assert.strictEqual(namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(namespace.bar, 42); const copied = { ...namespace }; assert.deepStrictEqual(copied, { bar: 42 }); assert.strictEqual(Object.prototype.toString.call(copied), '[object Object]'); assert.strictEqual(copied[Symbol.toStringTag], undefined); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/dynamic-import/foo.js000066400000000000000000000000271450520414700313570ustar00rootroot00000000000000export const bar = 42; rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/dynamic-import/main.js000066400000000000000000000000401450520414700315130ustar00rootroot00000000000000export default import('./foo'); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/entry-default/000077500000000000000000000000001450520414700300665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/entry-default/_config.js000066400000000000000000000013721450520414700320330ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not add Symbol.toStringTag property to entry chunks with default export mode', options: { strictDeprecations: false, output: { namespaceToStringTag: true, exports: 'default' } }, exports(exports) { assert.strictEqual(exports[Symbol.toStringTag], undefined); assert.strictEqual(Object.prototype.toString.call(exports), '[object Object]'); assert.strictEqual(exports.foo, 42); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/entry-default/main.js000066400000000000000000000000341450520414700313450ustar00rootroot00000000000000export default { foo: 42 }; rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/entry-named/000077500000000000000000000000001450520414700275265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/entry-named/_config.js000066400000000000000000000017101450520414700314670ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'adds Symbol.toStringTag property to entry chunks with named exports', options: { strictDeprecations: false, output: { namespaceToStringTag: true, exports: 'named' } }, exports(exports) { assert.strictEqual(Object.prototype.toString.call(exports), '[object Module]'); assert.strictEqual(exports[Symbol.toStringTag], 'Module'); assert.strictEqual(exports.foo, 42); const copied = { ...exports }; assert.deepStrictEqual(copied, { foo: 42 }); assert.strictEqual(Object.prototype.toString.call(copied), '[object Object]'); assert.strictEqual(copied[Symbol.toStringTag], undefined); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/entry-named/main.js000066400000000000000000000000271450520414700310070ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/external-namespaces/000077500000000000000000000000001450520414700312425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/external-namespaces/_config.js000066400000000000000000000016001450520414700332010ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to external namespaces', options: { strictDeprecations: false, external(id) { return id.startsWith('external'); }, output: { namespaceToStringTag: true, interop(id) { switch (id) { case 'external-auto': { return 'auto'; } case 'external-default': { return 'default'; } case 'external-defaultOnly': { return 'defaultOnly'; } default: { throw new Error(`Unexpected require "${id}"`); } } } } }, context: { require() { return { foo: 42 }; } }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/external-namespaces/main.js000066400000000000000000000014201450520414700325210ustar00rootroot00000000000000import * as externalAuto from 'external-auto'; import * as externalDefault from 'external-default'; import * as externalDefaultOnly from 'external-defaultOnly'; assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); assert.strictEqual(externalAuto.foo, 42); assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); assert.strictEqual(externalDefault.foo, 42); assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/inlined-namespace/000077500000000000000000000000001450520414700306575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/inlined-namespace/_config.js000066400000000000000000000007211450520414700326210ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to inlined namespaces', options: { strictDeprecations: false, output: { namespaceToStringTag: true } }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/inlined-namespace/foo.js000066400000000000000000000000271450520414700317770ustar00rootroot00000000000000export const bar = 42; rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/inlined-namespace/main.js000066400000000000000000000003031450520414700321350ustar00rootroot00000000000000import * as foo from './foo'; assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(foo.bar, 42); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/000077500000000000000000000000001450520414700330215ustar00rootroot00000000000000_config.js000066400000000000000000000012071450520414700347040ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/interop-property-descriptormodule.exports = defineTest({ description: 'generated interop namespaces should have correct Symbol.toStringTag', context: { require() { return { answer: 42 }; } }, options: { strictDeprecations: false, external(id) { return id.includes('external'); }, output: { namespaceToStringTag: true, interop(id) { return id.split('-')[1]; } } }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/dep.js000066400000000000000000000001001450520414700341160ustar00rootroot00000000000000export * from 'external-default'; export const extra = 'extra'; main.js000066400000000000000000000014761450520414700342340ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/interop-property-descriptorimport * as nsDefault from 'external-default'; import * as nsDefaultOnly from 'external-defaultOnly'; import * as nsMerged from './dep.js'; function verifyNamespace(ns, expected) { assert.deepStrictEqual(Object.getOwnPropertyDescriptor(ns, Symbol.toStringTag), { value: 'Module', configurable: false, enumerable: false, writable: false }); const assigned = Object.assign({}, ns); const spreaded = { ...ns }; assert.deepStrictEqual(assigned, expected); assert.strictEqual(assigned[Symbol.toStringTag], undefined); assert.deepStrictEqual(spreaded, expected); assert.strictEqual(spreaded[Symbol.toStringTag], undefined); } verifyNamespace(nsDefault, { answer: 42, default: { answer: 42 } }); verifyNamespace(nsDefaultOnly, { default: { answer: 42 } }); verifyNamespace(nsMerged, { answer: 42, extra: 'extra' }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/property-descriptor/000077500000000000000000000000001450520414700313435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/property-descriptor/_config.js000066400000000000000000000007551450520414700333140ustar00rootroot00000000000000module.exports = defineTest({ description: 'namespace export should have @@toStringTag with correct property descriptors #4336', options: { strictDeprecations: false, output: { namespaceToStringTag: true } }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/property-descriptor/foo.js000066400000000000000000000000321450520414700324570ustar00rootroot00000000000000export const foo = 'bar'; rollup-3.29.4/test/function/samples/deprecated/namespace-tostring/property-descriptor/main.js000066400000000000000000000012051450520414700326230ustar00rootroot00000000000000import * as ns from './foo.js'; const { assign, getOwnPropertyDescriptor } = Object; const { configurable, enumerable, value, writable } = getOwnPropertyDescriptor( ns, Symbol.toStringTag ); assert.strictEqual(value, 'Module', 'value'); assert.strictEqual(configurable, false, 'configurable'); assert.strictEqual(enumerable, false, 'enumerable'); assert.strictEqual(writable, false, 'writable'); const a = assign({}, ns); const b = { ...ns }; assert.deepStrictEqual(a, { foo: 'bar' }); assert.strictEqual(a[Symbol.toStringTag], undefined); assert.deepStrictEqual(b, { foo: 'bar' }); assert.strictEqual(b[Symbol.toStringTag], undefined); rollup-3.29.4/test/function/samples/deprecated/nested-inlined-dynamic-import-1/000077500000000000000000000000001450520414700274725ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js000066400000000000000000000011341450520414700314330ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'deconflicts variables when nested dynamic imports are inlined via inlineDynamicImports', options: { strictDeprecations: false, inlineDynamicImports: true }, exports(exports) { return exports().then(result => assert.strictEqual(result, 43)); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' } ] }); rollup-3.29.4/test/function/samples/deprecated/nested-inlined-dynamic-import-1/foo.js000066400000000000000000000000311450520414700306050ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/deprecated/nested-inlined-dynamic-import-1/main.js000066400000000000000000000001411450520414700307500ustar00rootroot00000000000000export default () => { const foo = 1; return import('./foo.js').then(ns => ns.value + foo); }; rollup-3.29.4/test/function/samples/deprecated/plugin-module-ids/000077500000000000000000000000001450520414700250365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/plugin-module-ids/_config.js000066400000000000000000000015161450520414700270030ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); let rendered = false; module.exports = defineTest({ description: 'provides all module ids on the plugin context', options: { strictDeprecations: false, external: ['path'], plugins: { renderStart() { rendered = true; assert.deepStrictEqual([...this.moduleIds].sort(), [ path.join(__dirname, 'foo.js'), path.join(__dirname, 'main.js'), 'path' ]); } } }, bundle() { assert.ok(rendered); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'Accessing "this.moduleIds" on the plugin context by plugin at position 1 is deprecated. The "this.getModuleIds" plugin context function should be used instead.', plugin: 'at position 1', url: 'https://rollupjs.org/plugin-development/#this-getmoduleids' } ] }); rollup-3.29.4/test/function/samples/deprecated/plugin-module-ids/foo.js000066400000000000000000000001021450520414700261500ustar00rootroot00000000000000import path from 'path'; export const foo = path.resolve('foo'); rollup-3.29.4/test/function/samples/deprecated/plugin-module-ids/main.js000066400000000000000000000001041450520414700263130ustar00rootroot00000000000000export { foo } from './foo.js'; export const path = import('path'); rollup-3.29.4/test/function/samples/deprecated/preserveModules/000077500000000000000000000000001450520414700246645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/000077500000000000000000000000001450520414700312575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/_config.js000066400000000000000000000007631450520414700332270ustar00rootroot00000000000000module.exports = defineTest({ description: 'Inlining dynamic imports is not supported when preserving modules', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, inlineDynamicImports: true }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.inlineDynamicImports" - this option is not supported for "output.preserveModules".', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' } }); rollup-3.29.4/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/lib.js000066400000000000000000000000311450520414700323550ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/main.js000066400000000000000000000000741450520414700325420ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/000077500000000000000000000000001450520414700321755ustar00rootroot00000000000000_config.js000066400000000000000000000007441450520414700340650ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-default-export-modemodule.exports = defineTest({ description: 'throws when using default export mode with named exports', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, output: { exports: 'default' } }, generateError: { code: 'INVALID_EXPORT_OPTION', message: '"default" was specified for "output.exports", but entry module "lib.js" has the following exports: "value"', url: 'https://rollupjs.org/configuration-options/#output-exports' } }); rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/lib.js000066400000000000000000000000311450520414700332730ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/main.js000066400000000000000000000001161450520414700334550ustar00rootroot00000000000000import { value } from './lib.js'; assert.equal(value, 42); export default 43; rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/000077500000000000000000000000001450520414700340765ustar00rootroot00000000000000_config.js000066400000000000000000000007631450520414700357670ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signaturesmodule.exports = defineTest({ description: 'throws when setting preserveEntrySignatures to false', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, preserveEntrySignatures: false }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "preserveEntrySignatures" - setting this option to false is not supported for "output.preserveModules".', url: 'https://rollupjs.org/configuration-options/#preserveentrysignatures' } }); main.js000066400000000000000000000000311450520414700352730ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signaturesexport const value = 42; rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/000077500000000000000000000000001450520414700315105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/_config.js000066400000000000000000000007331450520414700334550ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when using none export mode with named exports', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, output: { exports: 'none' } }, generateError: { code: 'INVALID_EXPORT_OPTION', message: '"none" was specified for "output.exports", but entry module "lib.js" has the following exports: "value"', url: 'https://rollupjs.org/configuration-options/#output-exports' } }); rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/lib.js000066400000000000000000000000311450520414700326060ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/main.js000066400000000000000000000000741450520414700327730ustar00rootroot00000000000000import { value } from './lib.js'; assert.equal(value, 42); rollup-3.29.4/test/function/samples/deprecated/preserveModules/manual-chunks/000077500000000000000000000000001450520414700274325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/manual-chunks/_config.js000066400000000000000000000007661450520414700314050ustar00rootroot00000000000000module.exports = defineTest({ description: 'Assigning manual chunks fails when preserving modules', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, output: { manualChunks: { lib: ['lib.js'] } } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.manualChunks" - this option is not supported for "output.preserveModules".', url: 'https://rollupjs.org/configuration-options/#output-manualchunks' } }); rollup-3.29.4/test/function/samples/deprecated/preserveModules/manual-chunks/lib.js000066400000000000000000000000311450520414700305300ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/deprecated/preserveModules/manual-chunks/main.js000066400000000000000000000000711450520414700307120ustar00rootroot00000000000000import { value } from './lib'; assert.equal(value, 42); rollup-3.29.4/test/function/samples/deprecated/preserveModules/mixed-exports/000077500000000000000000000000001450520414700274745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js000066400000000000000000000025021450520414700314350ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_LIB1 = path.join(__dirname, 'lib1.js'); module.exports = defineTest({ description: 'warns for mixed exports in all chunks when preserving modules', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', url: 'https://rollupjs.org/configuration-options/#output-preservemodules' }, { code: 'MIXED_EXPORTS', id: ID_MAIN, message: 'Entry module "main.js" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.', url: 'https://rollupjs.org/configuration-options/#output-exports' }, { code: 'MIXED_EXPORTS', id: ID_LIB1, message: 'Entry module "lib1.js" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.', url: 'https://rollupjs.org/configuration-options/#output-exports' } ] }); rollup-3.29.4/test/function/samples/deprecated/preserveModules/mixed-exports/lib1.js000066400000000000000000000000551450520414700306610ustar00rootroot00000000000000export const value1 = 42; export default 42; rollup-3.29.4/test/function/samples/deprecated/preserveModules/mixed-exports/lib2.js000066400000000000000000000000231450520414700306550ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/deprecated/preserveModules/mixed-exports/lib3.js000066400000000000000000000000321450520414700306560ustar00rootroot00000000000000export const value3 = 42; rollup-3.29.4/test/function/samples/deprecated/preserveModules/mixed-exports/main.js000066400000000000000000000003651450520414700307620ustar00rootroot00000000000000import lib1, { value1 } from './lib1'; import lib2 from './lib2'; import { value3 } from './lib3'; assert.equal(lib1, 42); assert.equal(value1, 42); assert.equal(lib2, 42); assert.equal(value3, 42); export const value = 42; export default 42; rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/000077500000000000000000000000001450520414700316175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js000066400000000000000000000021331450520414700335600ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Generates actual files for virtual modules when preserving modules', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, plugins: [ { resolveId(id) { if (id === '\0virtualModule.js') return id; }, load(id) { if (id !== '\0virtualModule.js') return null; return 'export const virtual = "Virtual!";\n'; }, transform(code, id) { if (id === '\0virtualModule.js') return null; return 'import {virtual} from "\0virtualModule.js";\n' + code; } } ] }, bundle(bundle) { return bundle.generate({ format: 'es' }).then(generated => assert.deepEqual( generated.output.map(chunk => chunk.fileName), ['main.js', '_virtual/_virtualModule.js', '_virtual/_virtualModule2.js'] ) ); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', url: 'https://rollupjs.org/configuration-options/#output-preservemodules' } ] }); rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_virtual/000077500000000000000000000000001450520414700334445ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000001101450520414700367060ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_virtualexport const notSoVirtual = 'real'; assert.equal(virtual, 'Virtual!'); rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/main.js000066400000000000000000000002021450520414700330730ustar00rootroot00000000000000import { notSoVirtual } from './_virtual/_virtualModule'; assert.equal(virtual, 'Virtual!'); assert.equal(notSoVirtual, 'real'); rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules/000077500000000000000000000000001450520414700300205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules/_config.js000066400000000000000000000020761450520414700317670ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Generates actual files for virtual modules when preserving modules', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, plugins: [ { resolveId(id) { if (id === '\0virtualModule') return id; }, load(id) { if (id !== '\0virtualModule') return null; return 'export const virtual = "Virtual!";\n'; }, transform(code, id) { if (id === '\0virtualModule') return null; return 'import {virtual} from "\0virtualModule";\n' + code; } } ] }, bundle(bundle) { return bundle.generate({ format: 'es' }).then(generated => assert.deepEqual( generated.output.map(chunk => chunk.fileName), ['main.js', '_virtual/_virtualModule.js', 'lib/lib.js'] ) ); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', url: 'https://rollupjs.org/configuration-options/#output-preservemodules' } ] }); rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules/lib/000077500000000000000000000000001450520414700305665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules/lib/lib.js000066400000000000000000000000431450520414700316670ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); rollup-3.29.4/test/function/samples/deprecated/preserveModules/virtual-modules/main.js000066400000000000000000000000731450520414700313020ustar00rootroot00000000000000import './lib/lib.js'; assert.equal(virtual, 'Virtual!'); rollup-3.29.4/test/function/samples/deprecated/reexport-ns/000077500000000000000000000000001450520414700237665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/reexport-ns/_config.js000066400000000000000000000012671450520414700257360ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'external namespace reexport', options: { strictDeprecations: false, external: ['external'], output: { namespaceToStringTag: true } }, exports(exports) { assert.strictEqual(typeof exports.maths, 'object'); assert.strictEqual(exports[Symbol.toStringTag], 'Module'); assert.strictEqual(exports.maths.external, true); }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } ] }); rollup-3.29.4/test/function/samples/deprecated/reexport-ns/main.js000066400000000000000000000000741450520414700252510ustar00rootroot00000000000000import * as maths from './maths.js'; export default maths; rollup-3.29.4/test/function/samples/deprecated/reexport-ns/maths.js000066400000000000000000000000601450520414700254340ustar00rootroot00000000000000export { default as maths } from './square.js'; rollup-3.29.4/test/function/samples/deprecated/reexport-ns/square.js000066400000000000000000000000611450520414700256210ustar00rootroot00000000000000import * as m from 'external'; export default m; rollup-3.29.4/test/function/samples/deprecated/resolve-id-external/000077500000000000000000000000001450520414700253715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/resolve-id-external/_config.js000066400000000000000000000056011450520414700273350ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const sideEffects = []; const { getObject } = require('../../../../utils'); module.exports = defineTest({ description: 'does not include modules without used exports if moduleSideEffect is false', context: { require(id) { sideEffects.push(id); return { value: id }; } }, exports() { assert.deepStrictEqual(sideEffects, [ 'sideeffects-false-usereffects-false-used-import', 'sideeffects-null-usereffects-false-used-import', 'sideeffects-true-usereffects-false', 'sideeffects-true-usereffects-false-unused-import', 'sideeffects-true-usereffects-false-used-import', 'sideeffects-false-usereffects-true-used-import', 'sideeffects-null-usereffects-true', 'sideeffects-null-usereffects-true-unused-import', 'sideeffects-null-usereffects-true-used-import', 'sideeffects-true-usereffects-true', 'sideeffects-true-usereffects-true-unused-import', 'sideeffects-true-usereffects-true-used-import' ]); }, options: { strictDeprecations: false, treeshake: { moduleSideEffects(id) { if (id.includes('main')) return true; return JSON.parse(id.split('-')[3]); } }, plugins: { name: 'test-plugin', resolveId(id) { if (!path.isAbsolute(id)) { return { id, external: true, moduleSideEffects: JSON.parse(id.split('-')[1]) }; } }, buildEnd() { assert.deepStrictEqual( getObject( [...this.getModuleIds()] .filter(id => !path.isAbsolute(id)) .map(id => [id, this.getModuleInfo(id).hasModuleSideEffects]) ), { 'sideeffects-false-usereffects-false': false, 'sideeffects-false-usereffects-false-unused-import': false, 'sideeffects-false-usereffects-false-used-import': false, 'sideeffects-false-usereffects-true': false, 'sideeffects-false-usereffects-true-unused-import': false, 'sideeffects-false-usereffects-true-used-import': false, 'sideeffects-null-usereffects-false': false, 'sideeffects-null-usereffects-false-unused-import': false, 'sideeffects-null-usereffects-false-used-import': false, 'sideeffects-null-usereffects-true': true, 'sideeffects-null-usereffects-true-unused-import': true, 'sideeffects-null-usereffects-true-used-import': true, 'sideeffects-true-usereffects-false': true, 'sideeffects-true-usereffects-false-unused-import': true, 'sideeffects-true-usereffects-false-used-import': true, 'sideeffects-true-usereffects-true': true, 'sideeffects-true-usereffects-true-unused-import': true, 'sideeffects-true-usereffects-true-used-import': true } ); } } }, warnings(warnings) { for (const warning of warnings) { if (warning.code !== 'UNUSED_EXTERNAL_IMPORT' && warning.code !== 'DEPRECATED_FEATURE') { throw new Error(`Unexpected warning code "${warning.code}"`); } } } }); rollup-3.29.4/test/function/samples/deprecated/resolve-id-external/main.js000066400000000000000000000026211450520414700266540ustar00rootroot00000000000000import 'sideeffects-false-usereffects-false'; import { value as unusedValue1 } from 'sideeffects-false-usereffects-false-unused-import'; import { value as usedValue1 } from 'sideeffects-false-usereffects-false-used-import'; import 'sideeffects-null-usereffects-false'; import { value as unusedValue2 } from 'sideeffects-null-usereffects-false-unused-import'; import { value as usedValue2 } from 'sideeffects-null-usereffects-false-used-import'; import 'sideeffects-true-usereffects-false'; import { value as unusedValue3 } from 'sideeffects-true-usereffects-false-unused-import'; import { value as usedValue3 } from 'sideeffects-true-usereffects-false-used-import'; import 'sideeffects-false-usereffects-true'; import { value as unusedValue4 } from 'sideeffects-false-usereffects-true-unused-import'; import { value as usedValue4 } from 'sideeffects-false-usereffects-true-used-import'; import 'sideeffects-null-usereffects-true'; import { value as unusedValue5 } from 'sideeffects-null-usereffects-true-unused-import'; import { value as usedValue5 } from 'sideeffects-null-usereffects-true-used-import'; import 'sideeffects-true-usereffects-true'; import { value as unusedValue6 } from 'sideeffects-true-usereffects-true-unused-import'; import { value as usedValue6 } from 'sideeffects-true-usereffects-true-used-import'; export const values = [usedValue1, usedValue2, usedValue3, usedValue4, usedValue5, usedValue6]; rollup-3.29.4/test/function/samples/deprecated/resolve-id/000077500000000000000000000000001450520414700235515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecated/resolve-id/_config.js000066400000000000000000000061471450520414700255230ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { getObject } = require('../../../../utils'); const sideEffects = []; module.exports = defineTest({ description: 'does not include modules without used exports if moduleSideEffect is false', context: { sideEffects }, exports() { assert.deepStrictEqual(sideEffects, [ 'sideeffects-false-usereffects-false-used-import', 'sideeffects-null-usereffects-false-used-import', 'sideeffects-true-usereffects-false', 'sideeffects-true-usereffects-false-unused-import', 'sideeffects-true-usereffects-false-used-import', 'sideeffects-false-usereffects-true-used-import', 'sideeffects-null-usereffects-true', 'sideeffects-null-usereffects-true-unused-import', 'sideeffects-null-usereffects-true-used-import', 'sideeffects-true-usereffects-true', 'sideeffects-true-usereffects-true-unused-import', 'sideeffects-true-usereffects-true-used-import' ]); }, options: { strictDeprecations: false, treeshake: { moduleSideEffects(id) { if (id.includes('main')) return true; return JSON.parse(id.split('-')[3]); } }, plugins: { name: 'test-plugin', resolveId(id) { if (!path.isAbsolute(id)) { return { id, external: false, moduleSideEffects: JSON.parse(id.split('-')[1]) }; } }, load(id) { if (!path.isAbsolute(id)) { const sideEffects = JSON.parse(id.split('-')[1]); const userEffects = JSON.parse(id.split('-')[3]); assert.strictEqual( this.getModuleInfo(id).hasModuleSideEffects, typeof sideEffects === 'boolean' ? sideEffects : userEffects ); return `export const value = '${id}'; sideEffects.push(value);`; } }, buildEnd() { assert.deepStrictEqual( getObject( [...this.getModuleIds()] .filter(id => !path.isAbsolute(id)) .map(id => [id, this.getModuleInfo(id).hasModuleSideEffects]) ), { 'sideeffects-false-usereffects-false': false, 'sideeffects-false-usereffects-false-unused-import': false, 'sideeffects-false-usereffects-false-used-import': false, 'sideeffects-false-usereffects-true': false, 'sideeffects-false-usereffects-true-unused-import': false, 'sideeffects-false-usereffects-true-used-import': false, 'sideeffects-null-usereffects-false': false, 'sideeffects-null-usereffects-false-unused-import': false, 'sideeffects-null-usereffects-false-used-import': false, 'sideeffects-null-usereffects-true': true, 'sideeffects-null-usereffects-true-unused-import': true, 'sideeffects-null-usereffects-true-used-import': true, 'sideeffects-true-usereffects-false': true, 'sideeffects-true-usereffects-false-unused-import': true, 'sideeffects-true-usereffects-false-used-import': true, 'sideeffects-true-usereffects-true': true, 'sideeffects-true-usereffects-true-unused-import': true, 'sideeffects-true-usereffects-true-used-import': true } ); } } }, warnings(warnings) { for (const warning of warnings) { assert.strictEqual(warning.code, 'DEPRECATED_FEATURE'); } } }); rollup-3.29.4/test/function/samples/deprecated/resolve-id/main.js000066400000000000000000000026211450520414700250340ustar00rootroot00000000000000import 'sideeffects-false-usereffects-false'; import { value as unusedValue1 } from 'sideeffects-false-usereffects-false-unused-import'; import { value as usedValue1 } from 'sideeffects-false-usereffects-false-used-import'; import 'sideeffects-null-usereffects-false'; import { value as unusedValue2 } from 'sideeffects-null-usereffects-false-unused-import'; import { value as usedValue2 } from 'sideeffects-null-usereffects-false-used-import'; import 'sideeffects-true-usereffects-false'; import { value as unusedValue3 } from 'sideeffects-true-usereffects-false-unused-import'; import { value as usedValue3 } from 'sideeffects-true-usereffects-false-used-import'; import 'sideeffects-false-usereffects-true'; import { value as unusedValue4 } from 'sideeffects-false-usereffects-true-unused-import'; import { value as usedValue4 } from 'sideeffects-false-usereffects-true-used-import'; import 'sideeffects-null-usereffects-true'; import { value as unusedValue5 } from 'sideeffects-null-usereffects-true-unused-import'; import { value as usedValue5 } from 'sideeffects-null-usereffects-true-used-import'; import 'sideeffects-true-usereffects-true'; import { value as unusedValue6 } from 'sideeffects-true-usereffects-true-unused-import'; import { value as usedValue6 } from 'sideeffects-true-usereffects-true-used-import'; export const values = [usedValue1, usedValue2, usedValue3, usedValue4, usedValue5, usedValue6]; rollup-3.29.4/test/function/samples/deprecations/000077500000000000000000000000001450520414700220605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/dynamicImportFunction/000077500000000000000000000000001450520414700264055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/dynamicImportFunction/_config.js000066400000000000000000000006471450520414700303560ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks the "output.dynamicImportFunction" option as deprecated', options: { output: { dynamicImportFunction: 'foo' } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.', url: 'https://rollupjs.org/plugin-development/#renderdynamicimport' } }); rollup-3.29.4/test/function/samples/deprecations/dynamicImportFunction/main.js000066400000000000000000000000211450520414700276600ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/000077500000000000000000000000001450520414700322605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/_config.js000066400000000000000000000010371450520414700342230ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks the "output.experimentalDeepDynamicChunkOptimization" option as deprecated', options: { output: { experimentalDeepDynamicChunkOptimization: true } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'The "output.experimentalDeepDynamicChunkOptimization" option is deprecated as Rollup always runs the full chunking algorithm now. The option should be removed.', url: 'https://rollupjs.org/configuration-options/#output-experimentaldeepdynamicchunkoptimization' } }); rollup-3.29.4/test/function/samples/deprecations/experimentalDeepDynamicChunkOptimization/main.js000066400000000000000000000000211450520414700335330ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/deprecations/hasModuleSideEffects/000077500000000000000000000000001450520414700261065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/hasModuleSideEffects/_config.js000066400000000000000000000013461450520414700300540ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'warns that accessing "ModuleInfo.hasModuleSideEffects" is deprecated', options: { strictDeprecations: true, plugins: [ { name: 'test', moduleParsed({ hasModuleSideEffects }) { assert.ok(hasModuleSideEffects); } } ] }, error: { code: 'PLUGIN_ERROR', hook: 'moduleParsed', message: 'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', plugin: 'test', pluginCode: 'DEPRECATED_FEATURE', url: 'https://rollupjs.org/plugin-development/#this-getmoduleinfo', watchFiles: [path.join(__dirname, 'main.js')] } }); rollup-3.29.4/test/function/samples/deprecations/hasModuleSideEffects/main.js000066400000000000000000000000211450520414700273610ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/deprecations/inlineDynamicImports/000077500000000000000000000000001450520414700262215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/inlineDynamicImports/_config.js000066400000000000000000000006201450520414700301610ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks the "inlineDynamicImports" input option as deprecated', options: { inlineDynamicImports: true }, error: { code: 'DEPRECATED_FEATURE', message: 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' } }); rollup-3.29.4/test/function/samples/deprecations/inlineDynamicImports/main.js000066400000000000000000000000231450520414700274760ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/deprecations/manualChunks/000077500000000000000000000000001450520414700245115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/manualChunks/_config.js000066400000000000000000000005761450520414700264630ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks the "manualChunks" input option as deprecated', options: { manualChunks() { return 'manual'; } }, error: { code: 'DEPRECATED_FEATURE', message: 'The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', url: 'https://rollupjs.org/configuration-options/#output-manualchunks' } }); rollup-3.29.4/test/function/samples/deprecations/manualChunks/main.js000066400000000000000000000000231450520414700257660ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/deprecations/maxParallelFileReads/000077500000000000000000000000001450520414700261015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/maxParallelFileReads/_config.js000066400000000000000000000005651450520414700300510ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks the "maxParallelFileReads" option as deprecated', options: { maxParallelFileReads: 3 }, error: { code: 'DEPRECATED_FEATURE', message: 'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', url: 'https://rollupjs.org/configuration-options/#maxparallelfileops' } }); rollup-3.29.4/test/function/samples/deprecations/maxParallelFileReads/main.js000066400000000000000000000000211450520414700273540ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/deprecations/namespaceToStringTag/000077500000000000000000000000001450520414700261425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/namespaceToStringTag/_config.js000066400000000000000000000006631450520414700301110ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks the "output.namespaceToStringTag" option as deprecated', options: { output: { namespaceToStringTag: true } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-symbols' } }); rollup-3.29.4/test/function/samples/deprecations/namespaceToStringTag/main.js000066400000000000000000000000211450520414700274150ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/deprecations/plugin-module-ids/000077500000000000000000000000001450520414700254165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/plugin-module-ids/_config.js000066400000000000000000000011151450520414700273560ustar00rootroot00000000000000module.exports = defineTest({ description: 'provides all module ids on the plugin context', options: { external: ['path'], plugins: { name: 'test', renderStart() { console.log([...this.moduleIds]); } } }, generateError: { code: 'PLUGIN_ERROR', hook: 'renderStart', message: 'Accessing "this.moduleIds" on the plugin context by plugin test is deprecated. The "this.getModuleIds" plugin context function should be used instead.', plugin: 'test', pluginCode: 'DEPRECATED_FEATURE', url: 'https://rollupjs.org/plugin-development/#this-getmoduleids' } }); rollup-3.29.4/test/function/samples/deprecations/plugin-module-ids/foo.js000066400000000000000000000001021450520414700265300ustar00rootroot00000000000000import path from 'path'; export const foo = path.resolve('foo'); rollup-3.29.4/test/function/samples/deprecations/plugin-module-ids/main.js000066400000000000000000000000401450520414700266720ustar00rootroot00000000000000export { foo } from './foo.js'; rollup-3.29.4/test/function/samples/deprecations/prefer-const/000077500000000000000000000000001450520414700244675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/prefer-const/_config.js000066400000000000000000000006441450520414700264350ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks the "output.preferConst" option as deprecated', options: { output: { preferConst: true } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode-constbindings' } }); rollup-3.29.4/test/function/samples/deprecations/prefer-const/main.js000066400000000000000000000000231450520414700257440ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/deprecations/preserveModules/000077500000000000000000000000001450520414700252445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deprecations/preserveModules/_config.js000066400000000000000000000005671450520414700272160ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks the "preserveModules" input option as deprecated', options: { preserveModules: true }, error: { code: 'DEPRECATED_FEATURE', message: 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', url: 'https://rollupjs.org/configuration-options/#output-preservemodules' } }); rollup-3.29.4/test/function/samples/deprecations/preserveModules/main.js000066400000000000000000000000231450520414700265210ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/deshadow-respect-existing/000077500000000000000000000000001450520414700244715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deshadow-respect-existing/_config.js000066400000000000000000000003361450520414700264350ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'respect existing variable names when deshadowing', exports(exports) { assert.equal(exports.getValue(), 'mainmainmainmaindep'); } }); rollup-3.29.4/test/function/samples/deshadow-respect-existing/dep.js000066400000000000000000000000371450520414700255770ustar00rootroot00000000000000export const conflict = 'dep'; rollup-3.29.4/test/function/samples/deshadow-respect-existing/main.js000066400000000000000000000003671450520414700257610ustar00rootroot00000000000000import * as dep from './dep.js'; export function getValue() { const conflict = 'main'; const conflict1 = 'main'; const conflict$1 = 'main'; const conflict$$1 = 'main'; return conflict + conflict1 + conflict$1 + conflict$$1 + dep.conflict; } rollup-3.29.4/test/function/samples/deshadow-top-level-declaration/000077500000000000000000000000001450520414700253665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deshadow-top-level-declaration/_config.js000066400000000000000000000001231450520414700273240ustar00rootroot00000000000000module.exports = defineTest({ description: 'deshadows top-level declarations' }); rollup-3.29.4/test/function/samples/deshadow-top-level-declaration/a.js000066400000000000000000000000161450520414700261410ustar00rootroot00000000000000import './x'; rollup-3.29.4/test/function/samples/deshadow-top-level-declaration/b.js000066400000000000000000000001221450520414700261400ustar00rootroot00000000000000import { foo as _foo } from './foo'; export default function foo () { _foo(); } rollup-3.29.4/test/function/samples/deshadow-top-level-declaration/foo.js000066400000000000000000000000441450520414700265050ustar00rootroot00000000000000function foo () {} export { foo }; rollup-3.29.4/test/function/samples/deshadow-top-level-declaration/main.js000066400000000000000000000001321450520414700266440ustar00rootroot00000000000000import './foo'; import './a'; import b from './b'; assert.equal( typeof b, 'function' ); rollup-3.29.4/test/function/samples/deshadow-top-level-declaration/x.js000066400000000000000000000000701450520414700261700ustar00rootroot00000000000000import { foo } from './foo'; function x () { foo(); } rollup-3.29.4/test/function/samples/deshadowed-destructured-parameter/000077500000000000000000000000001450520414700262005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deshadowed-destructured-parameter/_config.js000066400000000000000000000001571450520414700301450ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly deshadows destructured function parameters (#1008)' }); rollup-3.29.4/test/function/samples/deshadowed-destructured-parameter/main.js000066400000000000000000000001541450520414700274620ustar00rootroot00000000000000import { x } from './x.js'; let y; function foo ({ x = 42 }) { y = x; } foo({}); assert.equal( y, 42 ); rollup-3.29.4/test/function/samples/deshadowed-destructured-parameter/x.js000066400000000000000000000000331450520414700270010ustar00rootroot00000000000000export var x = 'whatever'; rollup-3.29.4/test/function/samples/deshadowed-namespaced-external-import-ignored/000077500000000000000000000000001450520414700303625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deshadowed-namespaced-external-import-ignored/_config.js000066400000000000000000000003301450520414700323200ustar00rootroot00000000000000module.exports = defineTest({ description: '#1547', options: { external: ['external'] }, context: { require: id => { if (id === 'external') return { foo: () => 42 }; throw new Error('huh?'); } } }); rollup-3.29.4/test/function/samples/deshadowed-namespaced-external-import-ignored/foo.js000066400000000000000000000000561450520414700315040ustar00rootroot00000000000000import * as ns from 'external'; export { ns };rollup-3.29.4/test/function/samples/deshadowed-namespaced-external-import-ignored/main.js000066400000000000000000000001721450520414700316440ustar00rootroot00000000000000import { ns } from './foo.js'; assert.equal((() => { function foo() { return ns.foo(); } return foo(); })(), 42); rollup-3.29.4/test/function/samples/deshadowed-namespaced-external-import-ignored/ns.js000066400000000000000000000000451450520414700313370ustar00rootroot00000000000000export function foo() { return 42; }rollup-3.29.4/test/function/samples/deshadowed-namespaced-import-renamed/000077500000000000000000000000001450520414700265265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deshadowed-namespaced-import-renamed/_config.js000066400000000000000000000000701450520414700304650ustar00rootroot00000000000000module.exports = defineTest({ description: '#1550' }); rollup-3.29.4/test/function/samples/deshadowed-namespaced-import-renamed/foo.js000066400000000000000000000000301450520414700276400ustar00rootroot00000000000000export * from './ns.js';rollup-3.29.4/test/function/samples/deshadowed-namespaced-import-renamed/main.js000066400000000000000000000002031450520414700300030ustar00rootroot00000000000000import { foo as doFoo } from './foo.js'; assert.equal((() => { function foo() { return doFoo(); } return foo(); })(), 42); rollup-3.29.4/test/function/samples/deshadowed-namespaced-import-renamed/ns.js000066400000000000000000000000451450520414700275030ustar00rootroot00000000000000export function foo() { return 42; }rollup-3.29.4/test/function/samples/deshadowed-namespaced-import/000077500000000000000000000000001450520414700251155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deshadowed-namespaced-import/_config.js000066400000000000000000000000701450520414700270540ustar00rootroot00000000000000module.exports = defineTest({ description: '#1488' }); rollup-3.29.4/test/function/samples/deshadowed-namespaced-import/foo.js000066400000000000000000000000551450520414700262360ustar00rootroot00000000000000import * as ns from './ns.js'; export { ns };rollup-3.29.4/test/function/samples/deshadowed-namespaced-import/main.js000066400000000000000000000001721450520414700263770ustar00rootroot00000000000000import { ns } from './foo.js'; assert.equal((() => { function foo() { return ns.foo(); } return foo(); })(), 42); rollup-3.29.4/test/function/samples/deshadowed-namespaced-import/ns.js000066400000000000000000000000451450520414700260720ustar00rootroot00000000000000export function foo() { return 42; }rollup-3.29.4/test/function/samples/deshadowed-shorthand-property/000077500000000000000000000000001450520414700253615ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deshadowed-shorthand-property/_config.js000066400000000000000000000001651450520414700273250ustar00rootroot00000000000000module.exports = defineTest({ description: 'shorthand properties referencing deshadowed variables are expanded' }); rollup-3.29.4/test/function/samples/deshadowed-shorthand-property/foo.js000066400000000000000000000000621450520414700265000ustar00rootroot00000000000000export default function answer () { return 42; } rollup-3.29.4/test/function/samples/deshadowed-shorthand-property/main.js000066400000000000000000000001711450520414700266420ustar00rootroot00000000000000import foo from './foo.js'; function x () { var answer = foo(); return { answer }; } assert.equal( x().answer, 42 ); rollup-3.29.4/test/function/samples/deshadows-function-expression-id/000077500000000000000000000000001450520414700257735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/deshadows-function-expression-id/_config.js000066400000000000000000000001331450520414700277320ustar00rootroot00000000000000module.exports = defineTest({ description: 'deshadows function expression ID (#1176)' }); rollup-3.29.4/test/function/samples/deshadows-function-expression-id/foo.js000066400000000000000000000000541450520414700271130ustar00rootroot00000000000000export function foo () { return 'works'; } rollup-3.29.4/test/function/samples/deshadows-function-expression-id/main.js000066400000000000000000000002501450520414700272520ustar00rootroot00000000000000import { foo as _foo } from './foo.js'; function Thing () {}; Thing.prototype.foo = function foo () { return _foo(); }; assert.equal( new Thing().foo(), 'works' ); rollup-3.29.4/test/function/samples/destructuring-loop/000077500000000000000000000000001450520414700232515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/destructuring-loop/_config.js000066400000000000000000000001401450520414700252060ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles loops with destructuring declarations' }); rollup-3.29.4/test/function/samples/destructuring-loop/main.js000066400000000000000000000003011450520414700245250ustar00rootroot00000000000000let result; for (const [foo] of [['foo']]) { result = foo; } assert.strictEqual(result, 'foo'); for (const { bar } of [{ bar: 'bar' }]) { result = bar; } assert.strictEqual(result, 'bar'); rollup-3.29.4/test/function/samples/disappearing-exported-value/000077500000000000000000000000001450520414700250105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/disappearing-exported-value/_config.js000066400000000000000000000003661450520414700267570ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exported values do not mysteriously disappear (#484)', exports(exports) { assert.equal(exports.exportedAnswer, 42); assert.equal(exports.foo(), 42); } }); rollup-3.29.4/test/function/samples/disappearing-exported-value/answer.js000066400000000000000000000000441450520414700266430ustar00rootroot00000000000000var answer = 42; export { answer }; rollup-3.29.4/test/function/samples/disappearing-exported-value/main.js000066400000000000000000000003001450520414700262630ustar00rootroot00000000000000import { answer as importedAnswer } from './answer.js'; export { answer as exportedAnswer } from './answer.js'; export function foo () { var value; value = importedAnswer; return value; } rollup-3.29.4/test/function/samples/do-while-conditional-break/000077500000000000000000000000001450520414700244735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/do-while-conditional-break/_config.js000066400000000000000000000001711450520414700264340ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles conditional breaks in do-while loops with unconditional return' }); rollup-3.29.4/test/function/samples/do-while-conditional-break/main.js000066400000000000000000000002661450520414700257610ustar00rootroot00000000000000function test(condition) { do { if (condition) { break; } return false; } while (true); return true; } assert.equal(test(false), false); assert.equal(test(true), true); rollup-3.29.4/test/function/samples/does-not-deconflict-undefined/000077500000000000000000000000001450520414700251775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/does-not-deconflict-undefined/_config.js000066400000000000000000000001141450520414700271350ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not rename undefined' }); rollup-3.29.4/test/function/samples/does-not-deconflict-undefined/foo.js000066400000000000000000000000361450520414700263170ustar00rootroot00000000000000export const foo = undefined; rollup-3.29.4/test/function/samples/does-not-deconflict-undefined/main.js000066400000000000000000000000771450520414700264650ustar00rootroot00000000000000import { foo } from './foo.js'; assert.equal(foo, undefined); rollup-3.29.4/test/function/samples/does-not-fail-for-arguments-test/000077500000000000000000000000001450520414700256055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/does-not-fail-for-arguments-test/_config.js000066400000000000000000000001631450520414700275470ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not fail when non-integer arguments properties are accessed' }); rollup-3.29.4/test/function/samples/does-not-fail-for-arguments-test/main.js000066400000000000000000000001331450520414700270640ustar00rootroot00000000000000var hasArgsEnumBug = (function() { return arguments.propertyIsEnumerable('length'); }()); rollup-3.29.4/test/function/samples/does-not-hang-on-missing-module/000077500000000000000000000000001450520414700254075ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/does-not-hang-on-missing-module/_config.js000066400000000000000000000013331450520414700273510ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'does not hang on missing module (#53)', warnings: [ { code: 'UNRESOLVED_IMPORT', exporter: 'unlessYouCreatedThisFileForSomeReason', id: ID_MAIN, message: '"unlessYouCreatedThisFileForSomeReason" is imported by "main.js", but could not be resolved – treating it as an external dependency.', url: 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency' } ], runtimeError(error) { assert.equal( error.message.split('\n')[0], "Cannot find module 'unlessYouCreatedThisFileForSomeReason'" ); } }); rollup-3.29.4/test/function/samples/does-not-hang-on-missing-module/main.js000066400000000000000000000001221450520414700266640ustar00rootroot00000000000000import doesNotExist from 'unlessYouCreatedThisFileForSomeReason'; doesNotExist(); rollup-3.29.4/test/function/samples/does-not-mangle-entry-point/000077500000000000000000000000001450520414700246575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/does-not-mangle-entry-point/_config.js000066400000000000000000000006441450520414700266250ustar00rootroot00000000000000const assert = require('node:assert'); const modules = { 'x\\y': 'export default 42;', 'x/y': 'export default 24;' }; module.exports = defineTest({ description: 'does not mangle input', options: { input: 'x\\y', plugins: [ { resolveId(importee) { return importee; }, load(moduleId) { return modules[moduleId]; } } ] }, exports(exports) { assert.equal(exports, 42); } }); rollup-3.29.4/test/function/samples/double-default-export/000077500000000000000000000000001450520414700236135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/double-default-export/_config.js000066400000000000000000000011541450520414700255560ustar00rootroot00000000000000const path = require('node:path'); const ID_FOO = path.join(__dirname, 'foo.js'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'throws on double default exports', error: { cause: { loc: { column: 7, line: 2 }, message: "Duplicate export 'default' (2:7)", pos: 25, raisedAt: 34 }, code: 'PARSE_ERROR', message: `Duplicate export 'default'`, id: ID_FOO, pos: 25, watchFiles: [ID_FOO, ID_MAIN], loc: { file: ID_FOO, line: 2, column: 7 }, frame: ` 1: export default 1; 2: export default 2; ^ ` } }); rollup-3.29.4/test/function/samples/double-default-export/foo.js000066400000000000000000000000441450520414700247320ustar00rootroot00000000000000export default 1; export default 2; rollup-3.29.4/test/function/samples/double-default-export/main.js000066400000000000000000000000601450520414700250710ustar00rootroot00000000000000import foo from './foo.js'; console.log( foo ); rollup-3.29.4/test/function/samples/double-named-export/000077500000000000000000000000001450520414700232535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/double-named-export/_config.js000066400000000000000000000011661450520414700252210ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'throws on duplicate named exports', error: { cause: { loc: { column: 9, line: 3 }, message: "Duplicate export 'foo' (3:9)", pos: 38, raisedAt: 43 }, code: 'PARSE_ERROR', message: `Duplicate export 'foo'`, id: ID_FOO, pos: 38, watchFiles: [ID_FOO, ID_MAIN], loc: { file: ID_FOO, line: 3, column: 9 }, frame: ` 1: var foo = 1; 2: export { foo }; 3: export { foo }; ^ ` } }); rollup-3.29.4/test/function/samples/double-named-export/foo.js000066400000000000000000000000551450520414700243740ustar00rootroot00000000000000var foo = 1; export { foo }; export { foo }; rollup-3.29.4/test/function/samples/double-named-export/main.js000066400000000000000000000000641450520414700245350ustar00rootroot00000000000000import { foo } from './foo.js'; console.log( foo ); rollup-3.29.4/test/function/samples/double-named-reexport/000077500000000000000000000000001450520414700236025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/double-named-reexport/_config.js000066400000000000000000000012061450520414700255430ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'throws on duplicate named exports', error: { cause: { loc: { column: 9, line: 3 }, message: "Duplicate export 'foo' (3:9)", pos: 38, raisedAt: 43 }, code: 'PARSE_ERROR', message: `Duplicate export 'foo'`, id: ID_FOO, pos: 38, watchFiles: [ID_FOO, ID_MAIN], loc: { file: ID_FOO, line: 3, column: 9 }, frame: ` 1: var foo = 1; 2: export { foo }; 3: export { foo } from './bar.js'; ^ ` } }); rollup-3.29.4/test/function/samples/double-named-reexport/bar.js000066400000000000000000000000241450520414700247000ustar00rootroot00000000000000export var foo = 2; rollup-3.29.4/test/function/samples/double-named-reexport/foo.js000066400000000000000000000000751450520414700247250ustar00rootroot00000000000000var foo = 1; export { foo }; export { foo } from './bar.js'; rollup-3.29.4/test/function/samples/double-named-reexport/main.js000066400000000000000000000000641450520414700250640ustar00rootroot00000000000000import { foo } from './foo.js'; console.log( foo ); rollup-3.29.4/test/function/samples/double-namespace-reexport/000077500000000000000000000000001450520414700244525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/double-namespace-reexport/_config.js000066400000000000000000000005151450520414700264150ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles chained namespace reexports from externals', options: { external: 'external' }, context: { require(id) { assert.strictEqual(id, 'external'); return { foo: 42 }; } }, exports({ foo }) { assert.strictEqual(foo, 42); } }); rollup-3.29.4/test/function/samples/double-namespace-reexport/first.js000066400000000000000000000000351450520414700261350ustar00rootroot00000000000000export * from './second.js'; rollup-3.29.4/test/function/samples/double-namespace-reexport/main.js000066400000000000000000000000421450520414700257300ustar00rootroot00000000000000export { foo } from './first.js'; rollup-3.29.4/test/function/samples/double-namespace-reexport/second.js000066400000000000000000000000321450520414700262560ustar00rootroot00000000000000export * from 'external'; rollup-3.29.4/test/function/samples/duplicate-import-fails/000077500000000000000000000000001450520414700237565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/duplicate-import-fails/_config.js000066400000000000000000000013701450520414700257210ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'disallows duplicate imports', error: { cause: { loc: { column: 9, line: 2 }, message: "Identifier 'a' has already been declared (2:9)", pos: 36, raisedAt: 39 }, code: 'PARSE_ERROR', message: `Identifier 'a' has already been declared`, id: ID_MAIN, pos: 36, watchFiles: [ID_MAIN], loc: { file: ID_MAIN, line: 2, column: 9 }, frame: ` 1: import { a } from './foo'; 2: import { a } from './foo'; ^ 3: 4: assert.equal(a, 1); ` } }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/duplicate-import-fails rollup-3.29.4/test/function/samples/duplicate-import-fails/foo.js000066400000000000000000000000221450520414700250710ustar00rootroot00000000000000export var a = 1; rollup-3.29.4/test/function/samples/duplicate-import-fails/main.js000066400000000000000000000001131450520414700252330ustar00rootroot00000000000000import { a } from './foo'; import { a } from './foo'; assert.equal(a, 1); rollup-3.29.4/test/function/samples/duplicate-import-specifier-fails/000077500000000000000000000000001450520414700257255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/duplicate-import-specifier-fails/_config.js000066400000000000000000000013561450520414700276740ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'disallows duplicate import specifiers', error: { cause: { loc: { column: 12, line: 1 }, message: "Identifier 'a' has already been declared (1:12)", pos: 12, raisedAt: 15 }, code: 'PARSE_ERROR', message: `Identifier 'a' has already been declared`, id: ID_MAIN, pos: 12, watchFiles: [ID_MAIN], loc: { file: ID_MAIN, line: 1, column: 12 }, frame: ` 1: import { a, a } from './foo'; ^ 2: assert.equal(a, 1); ` } }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/duplicate-import-specifier-fails rollup-3.29.4/test/function/samples/duplicate-import-specifier-fails/foo.js000066400000000000000000000000221450520414700270400ustar00rootroot00000000000000export var a = 1; rollup-3.29.4/test/function/samples/duplicate-import-specifier-fails/main.js000066400000000000000000000000621450520414700272050ustar00rootroot00000000000000import { a, a } from './foo'; assert.equal(a, 1); rollup-3.29.4/test/function/samples/duplicate-input-entry/000077500000000000000000000000001450520414700236465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/duplicate-input-entry/_config.js000066400000000000000000000004221450520414700256060ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles duplicate entry modules when using the object form', options: { input: ['entry', 'entry.js'] }, exports(exports) { assert.deepStrictEqual(exports, { entry: 'main' }); } }); rollup-3.29.4/test/function/samples/duplicate-input-entry/entry.js000066400000000000000000000000331450520414700253410ustar00rootroot00000000000000export var entry = 'main'; rollup-3.29.4/test/function/samples/dynamic-import-default-mode-facade/000077500000000000000000000000001450520414700261015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-default-mode-facade/_config.js000066400000000000000000000005151450520414700300440ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles dynamic imports from facades using default export mode', options: { input: ['main', 'foo', 'bar'] }, exports(exports) { return exports.then(exported => assert.deepStrictEqual(exported, { __proto__: null, default: 4 }) ); } }); rollup-3.29.4/test/function/samples/dynamic-import-default-mode-facade/bar.js000066400000000000000000000001361450520414700272030ustar00rootroot00000000000000import foo from './foo.js'; import square from './square.js'; export default square(3) + foo; rollup-3.29.4/test/function/samples/dynamic-import-default-mode-facade/foo.js000066400000000000000000000000741450520414700272230ustar00rootroot00000000000000import square from './square.js'; export default square(2); rollup-3.29.4/test/function/samples/dynamic-import-default-mode-facade/main.js000066400000000000000000000000431450520414700273600ustar00rootroot00000000000000export default import('./foo.js'); rollup-3.29.4/test/function/samples/dynamic-import-default-mode-facade/square.js000066400000000000000000000000331450520414700277330ustar00rootroot00000000000000export default x => x * x; rollup-3.29.4/test/function/samples/dynamic-import-duplicates/000077500000000000000000000000001450520414700244675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-duplicates/_config.js000066400000000000000000000004451450520414700264340ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Dynamic import inlining', options: { output: { inlineDynamicImports: true } }, exports(exports) { assert.equal(exports.x, 41); return exports.promise.then(y => { assert.equal(y, 42); }); } }); rollup-3.29.4/test/function/samples/dynamic-import-duplicates/foo.js000066400000000000000000000000221450520414700256020ustar00rootroot00000000000000export var x = 42;rollup-3.29.4/test/function/samples/dynamic-import-duplicates/main.js000066400000000000000000000002001450520414700257410ustar00rootroot00000000000000export var x = 41; export var promise = Promise.all([import('./foo'), import('./foo')]).then(foos => { return foos[0].x; }); rollup-3.29.4/test/function/samples/dynamic-import-existing/000077500000000000000000000000001450520414700241645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-existing/_config.js000066400000000000000000000004621450520414700261300ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Dynamic import inlining when resolution id is a module in the bundle', exports(exports) { assert.equal(exports.y, 42); return Promise.resolve(exports.promise).then(value => { assert.equal(value, 84); }); } }); rollup-3.29.4/test/function/samples/dynamic-import-existing/foo.js000066400000000000000000000001331450520414700253020ustar00rootroot00000000000000export var x = 42; export var promise = import('./main').then(m => { return m.y * 2; }); rollup-3.29.4/test/function/samples/dynamic-import-existing/main.js000066400000000000000000000000511450520414700254420ustar00rootroot00000000000000export { x as y, promise } from './foo'; rollup-3.29.4/test/function/samples/dynamic-import-expression/000077500000000000000000000000001450520414700245315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-expression/_config.js000066400000000000000000000015701450520414700264760ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Dynamic import expression replacement', options: { plugins: [ { resolveDynamicImport(specifier) { if ( typeof specifier !== 'string' && // string literal concatenation specifier.type === 'BinaryExpression' && specifier.operator === '+' && specifier.left.type === 'Literal' && specifier.right.type === 'Literal' && typeof specifier.left.value === 'string' && typeof specifier.right.value === 'string' ) { return '"' + specifier.left.value + specifier.right.value + '"'; } } } ], output: { dynamicImportInCjs: false } }, exports(exports) { const expectedError = "Cannot find module 'x/y'"; return exports.catch(error => assert.strictEqual(error.message.slice(0, expectedError.length), expectedError) ); } }); rollup-3.29.4/test/function/samples/dynamic-import-expression/main.js000066400000000000000000000000431450520414700260100ustar00rootroot00000000000000export default import('x/' + 'y'); rollup-3.29.4/test/function/samples/dynamic-import-inlining/000077500000000000000000000000001450520414700241415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-inlining/_config.js000066400000000000000000000004451450520414700261060ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Dynamic import inlining', options: { output: { inlineDynamicImports: true } }, exports(exports) { assert.equal(exports.x, 41); return exports.promise.then(y => { assert.equal(y, 42); }); } }); rollup-3.29.4/test/function/samples/dynamic-import-inlining/foo.js000066400000000000000000000000221450520414700252540ustar00rootroot00000000000000export var x = 42;rollup-3.29.4/test/function/samples/dynamic-import-inlining/main.js000066400000000000000000000001331450520414700254200ustar00rootroot00000000000000export var x = 41; export var promise = import('./foo').then(foo => { return foo.x; }); rollup-3.29.4/test/function/samples/dynamic-import-not-found/000077500000000000000000000000001450520414700242435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-not-found/_config.js000066400000000000000000000010571450520414700262100ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'warns if a dynamic import is not found', context: { require(id) { if (id === 'mod') { return {}; } } }, warnings: [ { code: 'UNRESOLVED_IMPORT', exporter: 'mod', id: ID_MAIN, message: '"mod" is imported by "main.js", but could not be resolved – treating it as an external dependency.', url: 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency' } ] }); rollup-3.29.4/test/function/samples/dynamic-import-not-found/main.js000066400000000000000000000000171450520414700255230ustar00rootroot00000000000000import('mod'); rollup-3.29.4/test/function/samples/dynamic-import-only-default/000077500000000000000000000000001450520414700247355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-only-default/_config.js000066400000000000000000000006021450520414700266750ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'correctly imports dynamic namespaces with only a default export from entry- and non-entry-point chunks', options: { input: ['main', 'entry'] }, exports(exports) { return exports.then(result => assert.deepStrictEqual(result, [{ __proto__: null, default: 42 }, { default: 42 }]) ); } }); rollup-3.29.4/test/function/samples/dynamic-import-only-default/entry.js000066400000000000000000000000231450520414700264270ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/dynamic-import-only-default/main.js000066400000000000000000000001121450520414700262110ustar00rootroot00000000000000export default Promise.all([import('./entry.js'), import('./other.js')]); rollup-3.29.4/test/function/samples/dynamic-import-only-default/other.js000066400000000000000000000000231450520414700264070ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/dynamic-import-relative-not-found/000077500000000000000000000000001450520414700260545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-relative-not-found/_config.js000066400000000000000000000005261450520414700300210ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'throws if a dynamic relative import is not found', error: { code: 'UNRESOLVED_IMPORT', exporter: './mod', id: ID_MAIN, message: 'Could not resolve "./mod" from "main.js"', watchFiles: [ID_MAIN] } }); rollup-3.29.4/test/function/samples/dynamic-import-relative-not-found/main.js000066400000000000000000000000211450520414700273270ustar00rootroot00000000000000import('./mod'); rollup-3.29.4/test/function/samples/dynamic-import-rewriting/000077500000000000000000000000001450520414700243445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-rewriting/_config.js000066400000000000000000000007121450520414700263060ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Dynamic import string specifier resolving', options: { external: ['asdf'], plugins: [ { resolveDynamicImport() { return 'asdf'; } } ] }, exports(exports) { const expectedError = "Cannot find package 'asdf'"; return exports.promise.catch(error => assert.strictEqual(error.message.slice(0, expectedError.length), expectedError) ); } }); rollup-3.29.4/test/function/samples/dynamic-import-rewriting/foo.js000066400000000000000000000000721450520414700254640ustar00rootroot00000000000000export var x = 42; export var promise = import('./asdf'); rollup-3.29.4/test/function/samples/dynamic-import-rewriting/main.js000066400000000000000000000000511450520414700256220ustar00rootroot00000000000000export { x as y, promise } from './foo'; rollup-3.29.4/test/function/samples/dynamic-import-this-arrow/000077500000000000000000000000001450520414700244315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-this-arrow/_config.js000066400000000000000000000011721450520414700263740ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'uses correct "this" in dynamic imports when using arrow functions', context: { require(id) { switch (id) { case 'input': { return { outputPath: 'output' }; } case 'output': { return { foo: 42 }; } default: { throw new Error(`Unexpected require "${id}"`); } } } }, exports({ promise }) { return promise.then(({ foo }) => assert.strictEqual(foo, 42)); }, options: { external: ['input', 'output'], output: { generatedCode: { arrowFunctions: true }, dynamicImportInCjs: false } } }); rollup-3.29.4/test/function/samples/dynamic-import-this-arrow/main.js000066400000000000000000000003251450520414700257130ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } export const promise = new Importer().getImport(); rollup-3.29.4/test/function/samples/dynamic-import-this-function/000077500000000000000000000000001450520414700251245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-import-this-function/_config.js000066400000000000000000000011771450520414700270740ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'uses correct "this" in dynamic imports when not using arrow functions', context: { require(id) { switch (id) { case 'input': { return { outputPath: 'output' }; } case 'output': { return { foo: 42 }; } default: { throw new Error(`Unexpected require "${id}"`); } } } }, exports({ promise }) { return promise.then(({ foo }) => assert.strictEqual(foo, 42)); }, options: { external: ['input', 'output'], output: { generatedCode: { arrowFunctions: false }, dynamicImportInCjs: false } } }); rollup-3.29.4/test/function/samples/dynamic-import-this-function/main.js000066400000000000000000000003251450520414700264060ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } export const promise = new Importer().getImport(); rollup-3.29.4/test/function/samples/dynamic-imports-shared-exports/000077500000000000000000000000001450520414700254655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-imports-shared-exports/_config.js000066400000000000000000000003171450520414700274300ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows sharing imports between dynamic chunks', options: { preserveEntrySignatures: 'allow-extension' }, exports(exports) { return exports.promise; } }); rollup-3.29.4/test/function/samples/dynamic-imports-shared-exports/dynamic1.js000066400000000000000000000003501450520414700275260ustar00rootroot00000000000000import { sharedDynamic } from './sharedDynamic.js'; assert.ok(sharedDynamic); export const promise = import('./dynamic2.js').then(ns => assert.deepStrictEqual(ns, { sharedDynamic: true }) ); export { shared } from './shared.js'; rollup-3.29.4/test/function/samples/dynamic-imports-shared-exports/dynamic2.js000066400000000000000000000000641450520414700275310ustar00rootroot00000000000000export { sharedDynamic } from './sharedDynamic.js'; rollup-3.29.4/test/function/samples/dynamic-imports-shared-exports/main.js000066400000000000000000000003171450520414700267500ustar00rootroot00000000000000import { shared } from './shared.js'; assert.ok(shared); export const promise = import('./dynamic1.js').then(({ promise, ...ns }) => { assert.deepStrictEqual(ns, { shared: true }); return ns.promise; }); rollup-3.29.4/test/function/samples/dynamic-imports-shared-exports/shared.js000066400000000000000000000000341450520414700272660ustar00rootroot00000000000000export const shared = true; rollup-3.29.4/test/function/samples/dynamic-imports-shared-exports/sharedDynamic.js000066400000000000000000000000431450520414700305730ustar00rootroot00000000000000export const sharedDynamic = true; rollup-3.29.4/test/function/samples/dynamic-namespace-lookup/000077500000000000000000000000001450520414700242655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/dynamic-namespace-lookup/_config.js000066400000000000000000000001711450520414700262260ustar00rootroot00000000000000module.exports = defineTest({ description: 'does namespace optimization when possible, but not for dynamic lookups' }); rollup-3.29.4/test/function/samples/dynamic-namespace-lookup/foo.js000066400000000000000000000000601450520414700254020ustar00rootroot00000000000000export var bar = 'bar'; export var baz = 'baz'; rollup-3.29.4/test/function/samples/dynamic-namespace-lookup/main.js000066400000000000000000000002251450520414700255460ustar00rootroot00000000000000import * as foo from './foo'; var bar = 'baz'; assert.equal( foo.bar, 'bar' ); assert.equal( foo.baz, 'baz' ); assert.equal( foo[ bar ], 'baz' ); rollup-3.29.4/test/function/samples/emit-chunk-hash/000077500000000000000000000000001450520414700223655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-chunk-hash/_config.js000066400000000000000000000007451450520414700243350ustar00rootroot00000000000000const assert = require('node:assert'); let referenceId; module.exports = defineTest({ description: 'gives access to the hashed filed name via this.getFileName in generateBundle', options: { input: 'main', output: { chunkFileNames: '[name]-[hash].js' }, plugins: { buildStart() { referenceId = this.emitFile({ type: 'chunk', id: 'emitted' }); }, generateBundle() { assert.strictEqual(this.getFileName(referenceId), 'emitted-38bdd9b2.js'); } } } }); rollup-3.29.4/test/function/samples/emit-chunk-hash/emitted.js000066400000000000000000000000211450520414700243470ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/emit-chunk-hash/main.js000066400000000000000000000000211450520414700236400ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/emit-chunk-manual-asset-source/000077500000000000000000000000001450520414700253325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-chunk-manual-asset-source/_config.js000066400000000000000000000012651450520414700273000ustar00rootroot00000000000000const assert = require('node:assert'); let referenceId; module.exports = defineTest({ description: 'supports setting asset sources as side effect of the manual chunks option', options: { output: { manualChunks: { foo: ['manual.js'] }, assetFileNames: '[name]-[hash][extname]' }, plugins: { transform(code, id) { if (id.endsWith('manual.js')) { referenceId = this.emitFile({ type: 'asset', name: 'emitted.txt' }); } }, moduleParsed({ id }) { if (id.endsWith('manual.js')) { this.setAssetSource(referenceId, 'emitted'); } }, generateBundle() { assert.strictEqual(this.getFileName(referenceId), 'emitted-f57bfbce.txt'); } } } }); rollup-3.29.4/test/function/samples/emit-chunk-manual-asset-source/main.js000066400000000000000000000000211450520414700266050ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/emit-chunk-manual-asset-source/manual.js000066400000000000000000000000211450520414700271360ustar00rootroot00000000000000import './main'; rollup-3.29.4/test/function/samples/emit-chunk-manual/000077500000000000000000000000001450520414700227175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-chunk-manual/_config.js000066400000000000000000000011061450520414700246570ustar00rootroot00000000000000const assert = require('node:assert'); let referenceId; module.exports = defineTest({ description: 'supports emitting chunks as side effect of the manual chunks option', options: { output: { manualChunks: { foo: ['manual.js'] }, assetFileNames: '[name]-[hash][extname]' }, plugins: { transform(code, id) { if (id.endsWith('manual.js')) { referenceId = this.emitFile({ type: 'asset', name: 'emitted.txt', source: 'emitted' }); } }, generateBundle() { assert.strictEqual(this.getFileName(referenceId), 'emitted-f57bfbce.txt'); } } } }); rollup-3.29.4/test/function/samples/emit-chunk-manual/main.js000066400000000000000000000000211450520414700241720ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/emit-chunk-manual/manual.js000066400000000000000000000000211450520414700245230ustar00rootroot00000000000000import './main'; rollup-3.29.4/test/function/samples/emit-file/000077500000000000000000000000001450520414700212535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid/000077500000000000000000000000001450520414700253145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid/_config.js000066400000000000000000000010071450520414700272540ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when setting an empty asset source', options: { plugins: { name: 'test-plugin', buildStart() { const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); this.setAssetSource(assetId, null); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Could not set source for asset "test.ext", asset source needs to be a string, Uint8Array or Buffer.', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid/main.js000066400000000000000000000000451450520414700265750ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid2/000077500000000000000000000000001450520414700253765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid2/_config.js000066400000000000000000000010131450520414700273330ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when setting an empty asset source', options: { plugins: { name: 'test-plugin', buildStart() { const assetId = this.emitFile({ type: 'asset', fileName: 'test.ext' }); this.setAssetSource(assetId, null); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Could not set source for asset "test.ext", asset source needs to be a string, Uint8Array or Buffer.', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid2/main.js000066400000000000000000000000451450520414700266570ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid3/000077500000000000000000000000001450520414700253775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid3/_config.js000066400000000000000000000007651450520414700273510ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when setting an empty asset source', options: { plugins: { name: 'test-plugin', buildStart() { const assetId = this.emitFile({ type: 'asset' }); this.setAssetSource(assetId, null); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Could not set source for asset "6b86b273", asset source needs to be a string, Uint8Array or Buffer.', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid3/main.js000066400000000000000000000000451450520414700266600ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid4/000077500000000000000000000000001450520414700254005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid4/_config.js000066400000000000000000000007101450520414700273400ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when setting an empty asset source', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'asset', source: null }); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Could not set source for unnamed asset, asset source needs to be a string, Uint8Array or Buffer.', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/asset-source-invalid4/main.js000066400000000000000000000000451450520414700266610ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing/000077500000000000000000000000001450520414700253375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-missing/_config.js000066400000000000000000000005361450520414700273050ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when not setting the asset source', options: { plugins: { name: 'test-plugin', load() { this.emitFile({ type: 'asset', name: 'test.ext' }); } } }, generateError: { code: 'ASSET_SOURCE_MISSING', message: 'Plugin error creating asset "test.ext" - no asset source set.' } }); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing/main.js000066400000000000000000000000451450520414700266200ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing2/000077500000000000000000000000001450520414700254215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-missing2/_config.js000066400000000000000000000005141450520414700273630ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when not setting the asset source', options: { plugins: { name: 'test-plugin', load() { this.emitFile({ type: 'asset' }); } } }, generateError: { code: 'ASSET_SOURCE_MISSING', message: 'Plugin error creating asset "6b86b273" - no asset source set.' } }); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing2/main.js000066400000000000000000000000451450520414700267020ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing3/000077500000000000000000000000001450520414700254225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-missing3/_config.js000066400000000000000000000013661450520414700273720ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when accessing the file name before the asset source is set', options: { plugins: { name: 'test-plugin', buildStart() { const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); this.getFileName(assetId); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Plugin error - Unable to get file name for asset "test.ext". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.', plugin: 'test-plugin', pluginCode: 'ASSET_NOT_FINALISED' } }); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing3/main.js000066400000000000000000000000451450520414700267030ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing4/000077500000000000000000000000001450520414700254235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-missing4/_config.js000066400000000000000000000013441450520414700273670ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when accessing the file name before the asset source is set', options: { plugins: { name: 'test-plugin', buildStart() { const assetId = this.emitFile({ type: 'asset' }); this.getFileName(assetId); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Plugin error - Unable to get file name for asset "6b86b273". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.', plugin: 'test-plugin', pluginCode: 'ASSET_NOT_FINALISED' } }); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing4/main.js000066400000000000000000000000451450520414700267040ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing5/000077500000000000000000000000001450520414700254245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/asset-source-missing5/_config.js000066400000000000000000000013041450520414700273640ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when not setting the asset source and accessing the asset URL', options: { plugins: { name: 'test-plugin', load() { return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'asset', name: 'test.ext' })};`; } } }, generateError: { code: 'ASSET_NOT_FINALISED', message: 'Plugin error - Unable to get file name for asset "test.ext". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.' } }); rollup-3.29.4/test/function/samples/emit-file/asset-source-missing5/main.js000066400000000000000000000000451450520414700267050ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/000077500000000000000000000000001450520414700304015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/_config.js000066400000000000000000000012141450520414700323410ustar00rootroot00000000000000let chunkId; module.exports = defineTest({ description: 'Throws when accessing the filename before it has been generated in buildEnd', options: { input: 'main.js', plugins: { name: 'test-plugin', buildStart() { chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); }, buildEnd() { this.getFileName(chunkId); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildEnd', message: 'Plugin error - Unable to get file name for emitted chunk "chunk.js". You can only get file names once chunks have been generated after the "renderStart" hook.', plugin: 'test-plugin', pluginCode: 'CHUNK_NOT_GENERATED' } }); rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/chunk.js000066400000000000000000000000261450520414700320450ustar00rootroot00000000000000console.log('chunk'); rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/main.js000066400000000000000000000000251450520414700316600ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available-renderStart/000077500000000000000000000000001450520414700311505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available-renderStart/_config.js000066400000000000000000000012351450520414700331130ustar00rootroot00000000000000let chunkId; module.exports = defineTest({ description: 'Throws when accessing the filename before it has been generated in renderStart', options: { input: 'main.js', plugins: { name: 'test-plugin', buildStart() { chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); }, renderStart() { this.getFileName(chunkId); } } }, generateError: { code: 'PLUGIN_ERROR', hook: 'renderStart', message: 'Plugin error - Unable to get file name for emitted chunk "chunk.js". You can only get file names once chunks have been generated after the "renderStart" hook.', plugin: 'test-plugin', pluginCode: 'CHUNK_NOT_GENERATED' } }); rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available-renderStart/chunk.js000066400000000000000000000000261450520414700326140ustar00rootroot00000000000000console.log('chunk'); rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available-renderStart/main.js000066400000000000000000000000251450520414700324270ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available/000077500000000000000000000000001450520414700266555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available/_config.js000066400000000000000000000011441450520414700306170ustar00rootroot00000000000000module.exports = defineTest({ description: 'Throws when accessing the filename before it has been generated', options: { input: 'main.js', plugins: { name: 'test-plugin', buildStart() { const chunkId = this.emitFile({ type: 'chunk', id: 'chunk.js' }); this.getFileName(chunkId); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Plugin error - Unable to get file name for emitted chunk "chunk.js". You can only get file names once chunks have been generated after the "renderStart" hook.', plugin: 'test-plugin', pluginCode: 'CHUNK_NOT_GENERATED' } }); rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available/chunk.js000066400000000000000000000000261450520414700303210ustar00rootroot00000000000000console.log('chunk'); rollup-3.29.4/test/function/samples/emit-file/chunk-filename-not-available/main.js000066400000000000000000000000251450520414700301340ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/function/samples/emit-file/chunk-not-found/000077500000000000000000000000001450520414700242725ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/chunk-not-found/_config.js000066400000000000000000000007001450520414700262310ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'Throws if an emitted entry chunk cannot be resolved', options: { input: 'main.js', plugins: { buildStart() { this.emitFile({ type: 'chunk', id: 'not-found.js' }); } } }, error: { code: 'UNRESOLVED_ENTRY', watchFiles: [ID_MAIN], message: 'Could not resolve entry module "not-found.js".' } }); rollup-3.29.4/test/function/samples/emit-file/chunk-not-found/main.js000066400000000000000000000000251450520414700255510ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/function/samples/emit-file/emit-from-output-options/000077500000000000000000000000001450520414700262015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/emit-from-output-options/_config.js000066400000000000000000000010111450520414700301340ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when trying to emit files from the outputOptions hook', options: { input: 'main', plugins: { outputOptions() { this.emitFile({ type: 'asset', source: 'asset' }); } } }, generateError: { code: 'PLUGIN_ERROR', hook: 'outputOptions', message: 'Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.', plugin: 'at position 1', pluginCode: 'CANNOT_EMIT_FROM_OPTIONS_HOOK' } }); rollup-3.29.4/test/function/samples/emit-file/emit-from-output-options/main.js000066400000000000000000000000251450520414700274600ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/function/samples/emit-file/emit-same-file/000077500000000000000000000000001450520414700240515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/emit-same-file/_config.js000066400000000000000000000015211450520414700260120ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns if multiple files with the same name are emitted', options: { input: 'main.js', plugins: [ { buildStart() { this.emitFile({ type: 'asset', fileName: 'buildStart', source: 'abc' }); }, generateBundle() { this.emitFile({ type: 'asset', fileName: 'buildStart', source: 'abc' }); this.emitFile({ type: 'asset', fileName: 'generateBundle', source: 'abc' }); this.emitFile({ type: 'asset', fileName: 'generateBundle', source: 'abc' }); } } ] }, warnings: [ { code: 'FILE_NAME_CONFLICT', message: 'The emitted file "buildStart" overwrites a previously emitted file of the same name.' }, { code: 'FILE_NAME_CONFLICT', message: 'The emitted file "generateBundle" overwrites a previously emitted file of the same name.' } ] }); rollup-3.29.4/test/function/samples/emit-file/emit-same-file/main.js000066400000000000000000000000421450520414700253270ustar00rootroot00000000000000export function hi() { return 2 } rollup-3.29.4/test/function/samples/emit-file/file-references-in-bundle/000077500000000000000000000000001450520414700261645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/file-references-in-bundle/My%2FFile.js000066400000000000000000000000251450520414700301410ustar00rootroot00000000000000console.log('Hey!'); rollup-3.29.4/test/function/samples/emit-file/file-references-in-bundle/_config.js000066400000000000000000000023061450520414700301270ustar00rootroot00000000000000const assert = require('node:assert'); const { pathToFileURL } = require('node:url'); module.exports = defineTest({ description: 'lists referenced files in the bundle', options: { input: 'main', plugins: { transform() { return `export const asset = import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'asset', name: 'asset.txt', source: 'asset' })};\nexport const chunk = import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'chunk', id: 'ref.js' })};\nexport const urlEncoding = import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'chunk', id: 'My%2FFile.js' })}`; }, generateBundle(options, bundle) { assert.deepStrictEqual(bundle['main.js'].referencedFiles, [ 'assets/asset.txt', 'chunks/ref.js', 'chunks/My%2FFile.js' ]); } }, output: { assetFileNames: 'assets/[name][extname]', chunkFileNames: 'chunks/[name].js' } }, context: { __dirname: 'dir' }, exports(exports) { const directoryURL = pathToFileURL('dir'); assert.deepStrictEqual(exports, { asset: `${directoryURL}/assets/asset.txt`, chunk: `${directoryURL}/chunks/ref.js`, urlEncoding: `${directoryURL}/chunks/My%252FFile.js` }); } }); rollup-3.29.4/test/function/samples/emit-file/file-references-in-bundle/main.js000066400000000000000000000000411450520414700274410ustar00rootroot00000000000000throw new Error('not executed'); rollup-3.29.4/test/function/samples/emit-file/file-references-in-bundle/ref.js000066400000000000000000000000261450520414700272740ustar00rootroot00000000000000console.log('Hello'); rollup-3.29.4/test/function/samples/emit-file/invalid-asset-name/000077500000000000000000000000001450520414700247345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/invalid-asset-name/_config.js000066400000000000000000000010111450520414700266670ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid asset names', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'asset', name: '/test.ext', source: 'content' }); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "/test.ext".', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/invalid-asset-name/main.js000066400000000000000000000000451450520414700262150ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/invalid-asset-name3/000077500000000000000000000000001450520414700250175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/invalid-asset-name3/_config.js000066400000000000000000000010601450520414700267560ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid asset names with absolute path on Windows OS', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'asset', name: 'F:\\test.ext', source: 'content' }); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "F:\\test.ext".', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/invalid-asset-name3/main.js000066400000000000000000000000451450520414700263000ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/invalid-chunk-id/000077500000000000000000000000001450520414700244015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/invalid-chunk-id/_config.js000066400000000000000000000006221450520414700263430ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid chunk ids', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: null }); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Emitted chunks need to have a valid string id, received "null"', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/invalid-chunk-id/main.js000066400000000000000000000000451450520414700256620ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/invalid-file-type/000077500000000000000000000000001450520414700245755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/invalid-file-type/_config.js000066400000000000000000000006471450520414700265460ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid file types', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'unknown' }); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Emitted files must be of type "asset", "chunk" or "prebuilt-chunk", received "unknown".', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/invalid-file-type/main.js000066400000000000000000000000451450520414700260560ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/invalid-prebuilt-chunk-filename/000077500000000000000000000000001450520414700274115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/invalid-prebuilt-chunk-filename/_config.js000066400000000000000000000010321450520414700313470ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid prebuilt chunks filename', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'prebuilt-chunk', code: 'console.log("my-chunk")' }); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "undefined".', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/invalid-prebuilt-chunk-filename/main.js000066400000000000000000000000451450520414700306720ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/invalid-prebuit-chunk-code/000077500000000000000000000000001450520414700263675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/invalid-prebuit-chunk-code/_config.js000066400000000000000000000007241450520414700303340ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid prebuilt chunks code', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'prebuilt-chunk', fileName: 'my-chunk.js' }); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Emitted prebuilt chunks need to have a valid string code, received "undefined".', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/invalid-prebuit-chunk-code/main.js000066400000000000000000000000451450520414700276500ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/invalid-reference-id/000077500000000000000000000000001450520414700252275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/invalid-reference-id/_config.js000066400000000000000000000005371450520414700271760ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid reference ids', options: { plugins: { name: 'test-plugin', load() { return `export default import.meta.ROLLUP_FILE_URL_invalid;`; } } }, generateError: { code: 'FILE_NOT_FOUND', message: 'Plugin error - Unable to get file name for unknown file "invalid".' } }); rollup-3.29.4/test/function/samples/emit-file/invalid-reference-id/main.js000066400000000000000000000000451450520414700265100ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/invalid-set-asset-source-id/000077500000000000000000000000001450520414700264775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/invalid-set-asset-source-id/_config.js000066400000000000000000000006261450520414700304450ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid asset ids', options: { plugins: { name: 'test-plugin', buildStart() { this.setAssetSource('invalid', 'content'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Plugin error - Unable to set the source for unknown asset "invalid".', plugin: 'test-plugin', pluginCode: 'ASSET_NOT_FOUND' } }); rollup-3.29.4/test/function/samples/emit-file/invalid-set-asset-source-id/main.js000066400000000000000000000000451450520414700277600ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/modules-loaded/000077500000000000000000000000001450520414700241515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/modules-loaded/_config.js000066400000000000000000000007111450520414700261120ustar00rootroot00000000000000module.exports = defineTest({ description: 'Throws when adding a chunk after the modules have finished loading', options: { input: 'main.js', plugins: { name: 'test-plugin', buildEnd() { this.emitFile({ type: 'chunk', id: 'chunk.js' }); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildEnd', message: 'Cannot emit chunks after module loading has finished.', plugin: 'test-plugin', pluginCode: 'INVALID_ROLLUP_PHASE' } }); rollup-3.29.4/test/function/samples/emit-file/modules-loaded/chunk.js000066400000000000000000000000411450520414700256120ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/emit-file/modules-loaded/main.js000066400000000000000000000000251450520414700254300ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/function/samples/emit-file/no-input/000077500000000000000000000000001450520414700230245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/no-input/_config.js000066400000000000000000000004221450520414700247640ustar00rootroot00000000000000module.exports = defineTest({ description: 'It is not necessary to provide an input if a dynamic entry is emitted', options: { input: undefined, plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'chunk.js' }); } } } }); rollup-3.29.4/test/function/samples/emit-file/no-input/chunk.js000066400000000000000000000000261450520414700244700ustar00rootroot00000000000000assert.equal(42, 42); rollup-3.29.4/test/function/samples/emit-file/prebuilt-chunk/000077500000000000000000000000001450520414700242075ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/prebuilt-chunk/_config.js000066400000000000000000000036771450520414700261660ustar00rootroot00000000000000const assert = require('node:assert'); const prebuiltChunk1ConsumedProperties = { fileName: 'my-chunk.js', code: 'exports.foo = "foo"', exports: ['foo'] }; const prebuiltChunk2ConsumedProperties = { fileName: 'my-chunk2.js', code: 'assert.ok(true)' }; module.exports = defineTest({ description: 'get right prebuilt chunks', options: { plugins: [ { resolveId(id) { if ( [ prebuiltChunk1ConsumedProperties.fileName, prebuiltChunk2ConsumedProperties.fileName ].includes(id) ) { return { id, external: true }; } }, buildStart() { const referenceId = this.emitFile({ type: 'prebuilt-chunk', ...prebuiltChunk1ConsumedProperties }); assert.strictEqual( this.getFileName(referenceId), prebuiltChunk1ConsumedProperties.fileName ); }, generateBundle(_, bundle) { const defaultProps = { dynamicImports: [], facadeModuleId: null, implicitlyLoadedBefore: [], importedBindings: {}, imports: [], isDynamicEntry: false, isEntry: false, isImplicitEntry: false, moduleIds: [], modules: {}, referencedFiles: [], type: 'chunk' }; const { fileName } = prebuiltChunk1ConsumedProperties; assert.deepStrictEqual(bundle[fileName], { ...defaultProps, ...prebuiltChunk1ConsumedProperties, name: fileName, map: null, sourcemapFileName: null, preliminaryFileName: 'my-chunk.js' }); this.emitFile({ type: 'prebuilt-chunk', ...prebuiltChunk2ConsumedProperties }); const { fileName: fileName2 } = prebuiltChunk2ConsumedProperties; assert.deepStrictEqual(bundle[fileName2], { ...defaultProps, ...prebuiltChunk2ConsumedProperties, name: fileName2, exports: [], map: null, sourcemapFileName: null, preliminaryFileName: 'my-chunk2.js' }); } } ] } }); rollup-3.29.4/test/function/samples/emit-file/prebuilt-chunk/main.js000066400000000000000000000001241450520414700254660ustar00rootroot00000000000000import { foo } from 'my-chunk.js'; import 'my-chunk2.js'; assert.equal(foo, 'foo'); rollup-3.29.4/test/function/samples/emit-file/set-asset-source-chunk/000077500000000000000000000000001450520414700255675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/set-asset-source-chunk/_config.js000066400000000000000000000010151450520414700275260ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when trying to set the asset source of a chunk', options: { plugins: { name: 'test-plugin', buildStart() { const referenceId = this.emitFile({ type: 'chunk', id: 'chunk' }); this.setAssetSource(referenceId, 'hello world'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Asset sources can only be set for emitted assets but "6c87f683" is an emitted chunk.', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }); rollup-3.29.4/test/function/samples/emit-file/set-asset-source-chunk/chunk.js000066400000000000000000000000451450520414700272340ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/set-asset-source-chunk/main.js000066400000000000000000000000451450520414700270500ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/set-asset-source-transform/000077500000000000000000000000001450520414700264725ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/set-asset-source-transform/_config.js000066400000000000000000000013211450520414700304310ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'throws when setting the asset source in the transform hook', options: { plugins: { name: 'test-plugin', transform(code) { const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); this.setAssetSource(assetId, 'asdf'); return code; } } }, error: { code: 'PLUGIN_ERROR', hook: 'transform', id: path.join(__dirname, 'main.js'), message: 'setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.', plugin: 'test-plugin', pluginCode: 'INVALID_SETASSETSOURCE', watchFiles: [path.join(__dirname, 'main.js')] } }); rollup-3.29.4/test/function/samples/emit-file/set-asset-source-transform/main.js000066400000000000000000000000451450520414700277530ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/set-asset-source-twice/000077500000000000000000000000001450520414700255725ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/set-asset-source-twice/_config.js000066400000000000000000000010361450520414700275340ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when setting the asset source twice', options: { plugins: { name: 'test-plugin', buildEnd() { const assetId = this.emitFile({ type: 'asset', name: 'test.ext' }); this.setAssetSource(assetId, 'hello world'); this.setAssetSource(assetId, 'another'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildEnd', message: 'Unable to set the source for asset "test.ext", source already set.', plugin: 'test-plugin', pluginCode: 'ASSET_SOURCE_ALREADY_SET' } }); rollup-3.29.4/test/function/samples/emit-file/set-asset-source-twice/main.js000066400000000000000000000000451450520414700270530ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/set-asset-source-twice2/000077500000000000000000000000001450520414700256545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/set-asset-source-twice2/_config.js000066400000000000000000000010141450520414700276120ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when setting the asset source twice', options: { plugins: { name: 'test-plugin', buildEnd() { const assetId = this.emitFile({ type: 'asset' }); this.setAssetSource(assetId, 'hello world'); this.setAssetSource(assetId, 'another'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildEnd', message: 'Unable to set the source for asset "6b86b273", source already set.', plugin: 'test-plugin', pluginCode: 'ASSET_SOURCE_ALREADY_SET' } }); rollup-3.29.4/test/function/samples/emit-file/set-asset-source-twice2/main.js000066400000000000000000000000451450520414700271350ustar00rootroot00000000000000throw new Error('should not build'); rollup-3.29.4/test/function/samples/emit-file/set-source-in-output-options/000077500000000000000000000000001450520414700267775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/emit-file/set-source-in-output-options/_config.js000066400000000000000000000011341450520414700307400ustar00rootroot00000000000000let referenceId; module.exports = defineTest({ description: 'throws when trying to set file sources in the outputOptions hook', options: { input: 'main', plugins: { buildStart() { referenceId = this.emitFile({ type: 'asset' }); }, outputOptions() { this.setAssetSource(referenceId, 'not allowed'); } } }, generateError: { code: 'PLUGIN_ERROR', hook: 'outputOptions', message: 'Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.', plugin: 'at position 1', pluginCode: 'CANNOT_EMIT_FROM_OPTIONS_HOOK' } }); rollup-3.29.4/test/function/samples/emit-file/set-source-in-output-options/buildStart1.js000066400000000000000000000000341450520414700315300ustar00rootroot00000000000000console.log('buildStart1'); rollup-3.29.4/test/function/samples/emit-file/set-source-in-output-options/buildStart2.js000066400000000000000000000000341450520414700315310ustar00rootroot00000000000000console.log('buildStart2'); rollup-3.29.4/test/function/samples/emit-file/set-source-in-output-options/main.js000066400000000000000000000000251450520414700302560ustar00rootroot00000000000000console.log('main'); rollup-3.29.4/test/function/samples/empty-imports-have-side-effects/000077500000000000000000000000001450520414700255115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/empty-imports-have-side-effects/_config.js000066400000000000000000000001441450520414700274520ustar00rootroot00000000000000module.exports = defineTest({ description: 'empty imports are assumed to contain side-effects' }); rollup-3.29.4/test/function/samples/empty-imports-have-side-effects/foo.js000066400000000000000000000000241450520414700266260ustar00rootroot00000000000000global.answer = 42; rollup-3.29.4/test/function/samples/empty-imports-have-side-effects/main.js000066400000000000000000000000641450520414700267730ustar00rootroot00000000000000import './foo'; assert.equal( global.answer, 42 ); rollup-3.29.4/test/function/samples/empty-string-as-module-name/000077500000000000000000000000001450520414700246445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/empty-string-as-module-name/_config.js000066400000000000000000000004241450520414700266060ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows using empty string as a valid module name', options: { external: () => false, plugins: [ { resolveId(importee, importer) { if (importee === '') { return importer + '#.js'; } } } ] } }); rollup-3.29.4/test/function/samples/empty-string-as-module-name/main.js000066400000000000000000000001021450520414700261170ustar00rootroot00000000000000import { importee } from ''; assert.strictEqual(importee, 'xxx'); rollup-3.29.4/test/function/samples/empty-string-as-module-name/main.js#.js000066400000000000000000000000351450520414700266020ustar00rootroot00000000000000export var importee = 'xxx'; rollup-3.29.4/test/function/samples/enforce-plugin-order/000077500000000000000000000000001450520414700234265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/enforce-plugin-order/_config.js000066400000000000000000000037211450520414700253730ustar00rootroot00000000000000const assert = require('node:assert'); const fs = require('node:fs'); const path = require('node:path'); const acorn = require('acorn'); const ID_MAIN = path.join(__dirname, 'main.js'); const code = fs.readFileSync(ID_MAIN, 'utf8'); const hooks = [ 'augmentChunkHash', 'buildEnd', 'buildStart', 'generateBundle', 'load', 'moduleParsed', 'options', 'outputOptions', 'renderDynamicImport', 'renderChunk', 'renderStart', 'resolveDynamicImport', 'resolveFileUrl', 'resolveId', 'resolveImportMeta', 'shouldTransformCachedModule', 'transform' ]; const calledHooks = {}; for (const hook of hooks) { calledHooks[hook] = []; } const plugins = [ { name: 'emitter', resolveId(source) { if (source === 'dep') { return source; } }, load(source) { if (source === 'dep') { return `assert.okt(import.meta.url);\nassert.ok(import.meta.ROLLUP_FILE_URL_${this.emitFile( { type: 'asset', source: 'test' } )});`; } } } ]; addPlugin(null); addPlugin('pre'); addPlugin('post'); addPlugin('post'); addPlugin('pre'); addPlugin(); function addPlugin(order) { const name = `${order}-${plugins.length}`; const plugin = { name }; for (const hook of hooks) { plugin[hook] = { order, handler() { if (!calledHooks[hook].includes(name)) { calledHooks[hook].push(name); } } }; } plugins.push(plugin); } module.exports = defineTest({ description: 'allows to enforce plugin hook order', options: { plugins, cache: { modules: [ { id: ID_MAIN, ast: acorn.parse(code, { ecmaVersion: 2020, sourceType: 'module' }), code, dependencies: [], dynamicDependencies: [], originalCode: code, resolvedIds: {}, sourcemapChain: [], transformDependencies: [] } ] } }, exports() { for (const hook of hooks) { assert.deepStrictEqual( calledHooks[hook], ['pre-2', 'pre-5', 'null-1', 'undefined-6', 'post-3', 'post-4'], hook ); } } }); rollup-3.29.4/test/function/samples/enforce-plugin-order/main.js000066400000000000000000000000171450520414700247060ustar00rootroot00000000000000import('dep'); rollup-3.29.4/test/function/samples/enforce-sequential-plugin-order/000077500000000000000000000000001450520414700255765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/enforce-sequential-plugin-order/_config.js000066400000000000000000000036641450520414700275510ustar00rootroot00000000000000const assert = require('node:assert'); const { wait } = require('../../../utils'); const hooks = [ 'banner', 'buildEnd', 'buildStart', 'footer', 'intro', 'moduleParsed', 'outro', 'renderStart' ]; const calledHooks = {}; const activeHooks = {}; for (const hook of hooks) { calledHooks[hook] = []; activeHooks[hook] = new Set(); } const plugins = []; addPlugin(null, true); addPlugin('pre', false); addPlugin('post', false); addPlugin('post', false); addPlugin('pre', false); addPlugin(undefined, true); addPlugin(null, false); addPlugin('pre', true); addPlugin('post', true); addPlugin('post', true); addPlugin('pre', true); addPlugin(undefined, false); function addPlugin(order, sequential) { const name = `${order}-${sequential ? 'seq-' : ''}${plugins.length + 1}`; const plugin = { name }; for (const hook of hooks) { plugin[hook] = { order, async handler() { const active = activeHooks[hook]; if (!calledHooks[hook].includes(name)) { calledHooks[hook].push(sequential ? name : [name, [...active]]); } if (sequential && active.size > 0) { throw new Error(`Detected parallel hook runs in ${hook}.`); } active.add(name); // A setTimeout always takes longer than any chain of immediately // resolved promises await wait(0); active.delete(name); }, sequential }; } plugins.push(plugin); } module.exports = defineTest({ description: 'allows to enforce sequential plugin hook order for parallel plugin hooks', options: { plugins }, exports() { for (const hook of hooks) { assert.deepStrictEqual( calledHooks[hook], [ ['pre-2', []], ['pre-5', ['pre-2']], 'pre-seq-8', 'pre-seq-11', 'null-seq-1', 'undefined-seq-6', ['null-7', []], ['undefined-12', ['null-7']], ['post-3', ['null-7', 'undefined-12']], ['post-4', ['null-7', 'undefined-12', 'post-3']], 'post-seq-9', 'post-seq-10' ], hook ); } } }); rollup-3.29.4/test/function/samples/enforce-sequential-plugin-order/main.js000066400000000000000000000000211450520414700270510ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/error-after-transform-should-throw-correct-location/000077500000000000000000000000001450520414700315435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/error-after-transform-should-throw-correct-location/_config.js000066400000000000000000000017751450520414700335170ustar00rootroot00000000000000const path = require('node:path'); const MagicString = require('magic-string'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_EMPTY = path.join(__dirname, 'empty.js'); module.exports = defineTest({ description: 'error after transform should throw with correct location of file', options: { plugins: [ { transform(source) { const s = new MagicString(source); s.prepend("import _assign from 'object-assign';\n"); return { code: s.toString(), map: s.generateMap({ hires: true }) }; } } ] }, error: { binding: 'default', code: 'MISSING_EXPORT', exporter: ID_EMPTY, id: ID_MAIN, url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module', pos: 44, loc: { column: 7, file: ID_MAIN, line: 1 }, frame: ` 1: import a from './empty.js'; ^ 2: 3: Object.assign({}, a); `, watchFiles: [ID_EMPTY, ID_MAIN], message: '"default" is not exported by "empty.js", imported by "main.js".' } }); rollup-3.29.4/test/function/samples/error-after-transform-should-throw-correct-location/empty.js000066400000000000000000000000001450520414700332250ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/error-after-transform-should-throw-correct-location/main.js000066400000000000000000000000631450520414700330240ustar00rootroot00000000000000import a from './empty.js'; Object.assign({}, a); rollup-3.29.4/test/function/samples/error-missing-umd-name/000077500000000000000000000000001450520414700237015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/error-missing-umd-name/_config.js000066400000000000000000000006661450520414700256530ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws an error if no name is provided for a UMD bundle', options: { output: { format: 'umd' } }, generateError: { code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.', url: 'https://rollupjs.org/configuration-options/#output-name' } }); rollup-3.29.4/test/function/samples/error-missing-umd-name/main.js000066400000000000000000000000251450520414700251600ustar00rootroot00000000000000export const x = 42; rollup-3.29.4/test/function/samples/error-parse-json/000077500000000000000000000000001450520414700226105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/error-parse-json/_config.js000066400000000000000000000013441450520414700245540ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_JSON = path.join(__dirname, 'file.json'); module.exports = defineTest({ description: 'throws with an extended error message when failing to parse a file with ".json" extension', error: { cause: { pos: 10, loc: { line: 2, column: 8 }, raisedAt: 11, message: 'Unexpected token (2:8)' }, code: 'PARSE_ERROR', id: ID_JSON, pos: 10, loc: { column: 8, file: ID_JSON, line: 2 }, frame: ` 1: { 2: "JSON": "is not really JavaScript" ^ 3: } `, watchFiles: [ID_JSON, ID_MAIN], message: 'Unexpected token (Note that you need @rollup/plugin-json to import JSON files)' } }); rollup-3.29.4/test/function/samples/error-parse-json/file.json000066400000000000000000000000511450520414700244160ustar00rootroot00000000000000{ "JSON": "is not really JavaScript" } rollup-3.29.4/test/function/samples/error-parse-json/main.js000066400000000000000000000000641450520414700240720ustar00rootroot00000000000000import json from './file.json'; console.log(json); rollup-3.29.4/test/function/samples/error-parse-unknown-extension/000077500000000000000000000000001450520414700253505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/error-parse-unknown-extension/_config.js000066400000000000000000000013311450520414700273100ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_CSS = path.join(__dirname, 'file.css'); module.exports = defineTest({ description: 'throws with an extended error message when failing to parse a file without .(m)js extension', error: { cause: { pos: 0, loc: { line: 1, column: 0 }, raisedAt: 1, message: 'Unexpected token (1:0)' }, code: 'PARSE_ERROR', id: ID_CSS, pos: 0, loc: { column: 0, file: ID_CSS, line: 1 }, frame: ` 1: .special-class { ^ 2: color: black; 3: } `, watchFiles: [ID_CSS, ID_MAIN], message: 'Unexpected token (Note that you need plugins to import files that are not JavaScript)' } }); rollup-3.29.4/test/function/samples/error-parse-unknown-extension/file.css000066400000000000000000000000451450520414700270000ustar00rootroot00000000000000.special-class { color: black; } rollup-3.29.4/test/function/samples/error-parse-unknown-extension/main.js000066400000000000000000000000611450520414700266270ustar00rootroot00000000000000import css from './file.css'; console.log(css); rollup-3.29.4/test/function/samples/es5-class-called-without-new/000077500000000000000000000000001450520414700247115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/es5-class-called-without-new/_config.js000066400000000000000000000002001450520414700266430ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not swallow type errors when running constructor functions without "new"' }); rollup-3.29.4/test/function/samples/es5-class-called-without-new/foo.js000066400000000000000000000001371450520414700260330ustar00rootroot00000000000000export function Foo ( x ) { this.value = x; } export function Bar ( x ) { this.value = x; } rollup-3.29.4/test/function/samples/es5-class-called-without-new/main.js000066400000000000000000000002251450520414700261720ustar00rootroot00000000000000import { Foo, Bar } from './foo'; assert.equal( new Foo(5).value, 5 ); assert.throws(() => Bar(5), /^TypeError: Cannot set propert.*'value'.*$/ ); rollup-3.29.4/test/function/samples/escape-arguments/000077500000000000000000000000001450520414700226435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/escape-arguments/_config.js000066400000000000000000000004101450520414700246000ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not use "arguments" as a placeholder variable for a default export', exports(exports) { assert.deepStrictEqual(exports, { foo: { __proto__: null, default: 42 } }); } }); rollup-3.29.4/test/function/samples/escape-arguments/arguments.js000066400000000000000000000000231450520414700252010ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/escape-arguments/main.js000066400000000000000000000000471450520414700241260ustar00rootroot00000000000000export * as foo from './arguments.js'; rollup-3.29.4/test/function/samples/export-all-from-external/000077500000000000000000000000001450520414700242505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-all-from-external/_config.js000066400000000000000000000002121450520414700262050ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows `export *` from external module, internally', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/export-all-from-external/main.js000066400000000000000000000002101450520414700255230ustar00rootroot00000000000000import { dirname, isRelative } from './path-plus.js'; assert.equal( dirname( 'foo/bar' ), 'foo' ); assert.ok( isRelative( './foo' ) ); rollup-3.29.4/test/function/samples/export-all-from-external/path-plus.js000066400000000000000000000001301450520414700265150ustar00rootroot00000000000000export * from 'path'; export function isRelative ( path ) { return path[0] === '.'; } rollup-3.29.4/test/function/samples/export-all-multiple/000077500000000000000000000000001450520414700233205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-all-multiple/_config.js000066400000000000000000000001261450520414700252610ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows multiple export * statements' }); rollup-3.29.4/test/function/samples/export-all-multiple/bar.js000066400000000000000000000000241450520414700244160ustar00rootroot00000000000000export var BAR = 2; rollup-3.29.4/test/function/samples/export-all-multiple/foo.js000066400000000000000000000000241450520414700244350ustar00rootroot00000000000000export var FOO = 1; rollup-3.29.4/test/function/samples/export-all-multiple/main.js000066400000000000000000000000641450520414700246020ustar00rootroot00000000000000export * from './foo.js'; export * from './bar.js'; rollup-3.29.4/test/function/samples/export-all/000077500000000000000000000000001450520414700214675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-all/_config.js000066400000000000000000000001021450520414700234220ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows export *' }); rollup-3.29.4/test/function/samples/export-all/main.js000066400000000000000000000000721450520414700227500ustar00rootroot00000000000000import { wat } from './wat'; assert.equal( wat(), 4711 ); rollup-3.29.4/test/function/samples/export-all/wat-impl.js000066400000000000000000000000501450520414700235520ustar00rootroot00000000000000export function wat () { return 4711; } rollup-3.29.4/test/function/samples/export-all/wat.js000066400000000000000000000000341450520414700226150ustar00rootroot00000000000000export * from './wat-impl'; rollup-3.29.4/test/function/samples/export-and-import-reference-share-var/000077500000000000000000000000001450520414700266135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-and-import-reference-share-var/_config.js000066400000000000000000000003501450520414700305530ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows export and import reference to share name', exports(exports) { assert.equal(exports.b, 9); } }); // adapted from es6-module-transpiler rollup-3.29.4/test/function/samples/export-and-import-reference-share-var/foo.js000066400000000000000000000000461450520414700277340ustar00rootroot00000000000000export var a = 1; assert.equal(a, 1); rollup-3.29.4/test/function/samples/export-and-import-reference-share-var/main.js000066400000000000000000000005641450520414700301020ustar00rootroot00000000000000import { a } from './foo'; // This variable declaration is going to be altered because `b` needs to be // re-written. We need to make sure that the `a` re-writing and the unaffected // `c` declarator are not being clobbered by that alteration. var a_ = a, b = 9, c = 'c'; assert.equal(a, 1); assert.equal(a_, 1); assert.equal(b, 9); assert.equal(c, 'c'); export { b }; rollup-3.29.4/test/function/samples/export-as/000077500000000000000000000000001450520414700213225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-as/_config.js000066400000000000000000000001131450520414700232570ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows export { x as y }' }); rollup-3.29.4/test/function/samples/export-as/foo.js000066400000000000000000000000371450520414700224430ustar00rootroot00000000000000var x = 42; export { x as y }; rollup-3.29.4/test/function/samples/export-as/main.js000066400000000000000000000000621450520414700226020ustar00rootroot00000000000000import { y } from './foo'; assert.equal( y, 42 ); rollup-3.29.4/test/function/samples/export-deconflicted-names/000077500000000000000000000000001450520414700244435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-deconflicted-names/_config.js000066400000000000000000000002751450520414700264110ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'correctly exports deconflicted names', exports(exports) { assert.equal(exports.bar(), 'bar'); } }); rollup-3.29.4/test/function/samples/export-deconflicted-names/bar.js000066400000000000000000000000611450520414700255420ustar00rootroot00000000000000export default function bar () { return 'bar'; }rollup-3.29.4/test/function/samples/export-deconflicted-names/baz.js000066400000000000000000000001011450520414700255450ustar00rootroot00000000000000var bar = 'baz'; export default function baz () { return bar; }rollup-3.29.4/test/function/samples/export-deconflicted-names/foo.js000066400000000000000000000001011450520414700255540ustar00rootroot00000000000000var bar = 'foo'; export default function foo () { return bar; }rollup-3.29.4/test/function/samples/export-deconflicted-names/main.js000066400000000000000000000001331450520414700257220ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; import baz from './baz'; export { bar };rollup-3.29.4/test/function/samples/export-default-anonymous-function/000077500000000000000000000000001450520414700262145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-default-anonymous-function/_config.js000066400000000000000000000006711450520414700301620ustar00rootroot00000000000000const { readFileSync } = require('node:fs'); const path = require('node:path'); module.exports = defineTest({ description: 'exports an anonymous function with custom ID resolver', // yeah, this is a real edge case options: { plugins: [ { resolveId(importee) { return path.basename(importee).replace(/\..+/, ''); }, load(id) { return readFileSync(path.join(__dirname, id + '.js'), 'utf8'); } } ] } }); rollup-3.29.4/test/function/samples/export-default-anonymous-function/answer.js000066400000000000000000000000231450520414700300440ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/export-default-anonymous-function/main.js000066400000000000000000000001521450520414700274740ustar00rootroot00000000000000import answer from './answer'; export default function () { console.log( 'the answer is ' + answer ); } rollup-3.29.4/test/function/samples/export-default-as-b/000077500000000000000000000000001450520414700231635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-default-as-b/_config.js000066400000000000000000000001431450520414700251230ustar00rootroot00000000000000module.exports = defineTest({ description: 'exports default-as-named from sibling module (b)' }); rollup-3.29.4/test/function/samples/export-default-as-b/bar.js000066400000000000000000000000501450520414700242600ustar00rootroot00000000000000export { default as baz } from './baz'; rollup-3.29.4/test/function/samples/export-default-as-b/baz.js000066400000000000000000000000261450520414700242730ustar00rootroot00000000000000export default 'BAZ'; rollup-3.29.4/test/function/samples/export-default-as-b/main.js000066400000000000000000000000721450520414700244440ustar00rootroot00000000000000import { baz } from './bar'; assert.equal( baz, 'BAZ' ); rollup-3.29.4/test/function/samples/export-default-as-c/000077500000000000000000000000001450520414700231645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-default-as-c/_config.js000066400000000000000000000003211450520414700251220ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports default-as-named from sibling module (c)', exports(exports) { assert.equal(exports.namespace.baz, 'BAZ'); } }); rollup-3.29.4/test/function/samples/export-default-as-c/baz.js000066400000000000000000000000261450520414700242740ustar00rootroot00000000000000export default 'BAZ'; rollup-3.29.4/test/function/samples/export-default-as-c/main.js000066400000000000000000000001501450520414700244420ustar00rootroot00000000000000import * as namespace from './namespace'; assert.equal( namespace.baz, 'BAZ' ); export { namespace }; rollup-3.29.4/test/function/samples/export-default-as-c/namespace.js000066400000000000000000000000501450520414700254510ustar00rootroot00000000000000export { default as baz } from './baz'; rollup-3.29.4/test/function/samples/export-default-as/000077500000000000000000000000001450520414700227445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-default-as/_config.js000066400000000000000000000003031450520414700247020ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports default-as-named from sibling module', exports(exports) { assert.equal(exports.foo, 'FOO'); } }); rollup-3.29.4/test/function/samples/export-default-as/foo.js000066400000000000000000000000261450520414700240630ustar00rootroot00000000000000export default 'FOO'; rollup-3.29.4/test/function/samples/export-default-as/main.js000066400000000000000000000000501450520414700242210ustar00rootroot00000000000000export { default as foo } from './foo'; rollup-3.29.4/test/function/samples/export-default-exported-id/000077500000000000000000000000001450520414700245655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-default-exported-id/_config.js000066400000000000000000000004311450520414700265250ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports an id that is also a default export', options: { output: { exports: 'named' } }, exports(exports) { assert.ok(new exports.default().ok); assert.ok(new exports.Image().ok); } }); rollup-3.29.4/test/function/samples/export-default-exported-id/main.js000066400000000000000000000001271450520414700260470ustar00rootroot00000000000000export default class Image { constructor() { this.ok = true; } } export { Image } rollup-3.29.4/test/function/samples/export-default-expression/000077500000000000000000000000001450520414700245405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-default-expression/_config.js000066400000000000000000000002711450520414700265020ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports a default value as module.exports', exports(exports) { assert.equal(exports, 42); } }); rollup-3.29.4/test/function/samples/export-default-expression/main.js000066400000000000000000000000231450520414700260150ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/export-default-from-external/000077500000000000000000000000001450520414700251245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-default-from-external/_config.js000066400000000000000000000004111450520414700270620ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'ensures external modules have correct names', options: { external: ['path'] }, exports(exports) { assert.equal(exports, path.sep); } }); rollup-3.29.4/test/function/samples/export-default-from-external/main.js000066400000000000000000000000601450520414700264020ustar00rootroot00000000000000import { sep } from 'path'; export default sep; rollup-3.29.4/test/function/samples/export-default-named-function/000077500000000000000000000000001450520414700252505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-default-named-function/_config.js000066400000000000000000000002621450520414700272120ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports a default named function', exports(exports) { assert.equal(exports(), 42); } }); rollup-3.29.4/test/function/samples/export-default-named-function/main.js000066400000000000000000000000601450520414700265260ustar00rootroot00000000000000export default function foo () { return 42; }; rollup-3.29.4/test/function/samples/export-default-no-space/000077500000000000000000000000001450520414700240465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-default-no-space/_config.js000066400000000000000000000003171450520414700260110ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles default exports with no space before declaration', exports: exports => { assert.deepEqual(exports, {}); } }); rollup-3.29.4/test/function/samples/export-default-no-space/main.js000066400000000000000000000000221450520414700253220ustar00rootroot00000000000000export default{}; rollup-3.29.4/test/function/samples/export-destruction/000077500000000000000000000000001450520414700232625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-destruction/_config.js000066400000000000000000000004431450520414700252250ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handle destruction patterns in export declarations', exports(exports) { assert.deepEqual(Object.keys(exports), ['baz', 'quux']); assert.equal(exports.baz, 5); assert.equal(exports.quux, 17); } }); rollup-3.29.4/test/function/samples/export-destruction/main.js000066400000000000000000000002351450520414700245440ustar00rootroot00000000000000var foo = { bar: { baz: 5 } }; var arr = [ { quux: 'wrong' }, { quux: 17 } ]; export var { bar: { baz } } = foo; export var [ /* skip */, { quux } ] = arr; rollup-3.29.4/test/function/samples/export-from-default-renamed/000077500000000000000000000000001450520414700247155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-default-renamed/_config.js000066400000000000000000000001521450520414700266550ustar00rootroot00000000000000module.exports = defineTest({ description: 'export from works with multiple renamed default exports' }); rollup-3.29.4/test/function/samples/export-from-default-renamed/a.js000066400000000000000000000000241450520414700254670ustar00rootroot00000000000000export default 'a'; rollup-3.29.4/test/function/samples/export-from-default-renamed/b.js000066400000000000000000000000241450520414700254700ustar00rootroot00000000000000export default 'b'; rollup-3.29.4/test/function/samples/export-from-default-renamed/foo.js000066400000000000000000000001101450520414700260260ustar00rootroot00000000000000export { default as a } from './a'; export { default as b } from './b'; rollup-3.29.4/test/function/samples/export-from-default-renamed/main.js000066400000000000000000000001161450520414700261750ustar00rootroot00000000000000import { a, b } from './foo'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); rollup-3.29.4/test/function/samples/export-from-default/000077500000000000000000000000001450520414700233045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-default/_config.js000066400000000000000000000003141450520414700252440ustar00rootroot00000000000000module.exports = defineTest({ description: 'export from works with default exports' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-from-default rollup-3.29.4/test/function/samples/export-from-default/first.js000066400000000000000000000000221450520414700247630ustar00rootroot00000000000000export default 1; rollup-3.29.4/test/function/samples/export-from-default/main.js000066400000000000000000000000561450520414700245670ustar00rootroot00000000000000import a from './second'; assert.equal(a, 1); rollup-3.29.4/test/function/samples/export-from-default/second.js000066400000000000000000000000431450520414700251120ustar00rootroot00000000000000export { default } from './first'; rollup-3.29.4/test/function/samples/export-from-external/000077500000000000000000000000001450520414700235025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-external/_config.js000066400000000000000000000005021450520414700254410ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'exports directly from an external module', options: { external: ['path'] }, exports(exports) { assert.equal(exports.sep, path.sep); } }); // https://github.com/esperantojs/esperanto/issues/161 rollup-3.29.4/test/function/samples/export-from-external/main.js000066400000000000000000000000341450520414700247610ustar00rootroot00000000000000export { sep } from 'path'; rollup-3.29.4/test/function/samples/export-from-internal-module/000077500000000000000000000000001450520414700247575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-internal-module/_config.js000066400000000000000000000002631450520414700267220ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports from an internal module', exports(exports) { assert.equal(exports.foo, 42); } }); rollup-3.29.4/test/function/samples/export-from-internal-module/foo.js000066400000000000000000000000241450520414700260740ustar00rootroot00000000000000export var foo = 42;rollup-3.29.4/test/function/samples/export-from-internal-module/main.js000066400000000000000000000000341450520414700262360ustar00rootroot00000000000000export { foo } from './foo';rollup-3.29.4/test/function/samples/export-from-multiple-no-default-conflict/000077500000000000000000000000001450520414700273465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-multiple-no-default-conflict/_config.js000066400000000000000000000004251450520414700313110ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'export from does not cause erroneous warning if multiple modules export default', warnings: [], exports: exports => { assert.deepEqual(exports, { foo: 'foo', bar: 'bar' }); } }); rollup-3.29.4/test/function/samples/export-from-multiple-no-default-conflict/a.js000066400000000000000000000000531450520414700301220ustar00rootroot00000000000000export default 1; export const foo = 'foo';rollup-3.29.4/test/function/samples/export-from-multiple-no-default-conflict/b.js000066400000000000000000000000531450520414700301230ustar00rootroot00000000000000export default 2; export const bar = 'bar';rollup-3.29.4/test/function/samples/export-from-multiple-no-default-conflict/main.js000066400000000000000000000000601450520414700306240ustar00rootroot00000000000000export * from './a.js'; export * from './b.js'; rollup-3.29.4/test/function/samples/export-from-no-local-binding-var/000077500000000000000000000000001450520414700255625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-no-local-binding-var/_config.js000066400000000000000000000003301450520414700275200ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'export from does not create a local binding', runtimeError(error) { assert.ok(/foo is not defined/.test(error.message)); } }); rollup-3.29.4/test/function/samples/export-from-no-local-binding-var/foo.js000066400000000000000000000000351450520414700267010ustar00rootroot00000000000000export default function() {} rollup-3.29.4/test/function/samples/export-from-no-local-binding-var/main.js000066400000000000000000000001621450520414700270430ustar00rootroot00000000000000export {default as foo} from './foo'; export var foo1 = foo(); // This should fail as foo lacks a local binding. rollup-3.29.4/test/function/samples/export-from-no-local-binding/000077500000000000000000000000001450520414700247745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-no-local-binding/_config.js000066400000000000000000000003111450520414700267310ustar00rootroot00000000000000module.exports = defineTest({ description: 'export from does not create a local binding' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-from rollup-3.29.4/test/function/samples/export-from-no-local-binding/first.js000066400000000000000000000000221450520414700264530ustar00rootroot00000000000000export var a = 1; rollup-3.29.4/test/function/samples/export-from-no-local-binding/main.js000066400000000000000000000000621450520414700262540ustar00rootroot00000000000000import { a } from './second'; assert.equal(a, 1); rollup-3.29.4/test/function/samples/export-from-no-local-binding/second.js000066400000000000000000000002521450520414700266040ustar00rootroot00000000000000export { a } from './first'; // This `a` reference should not be re-written because this export is not // creating a local binding. assert.equal(typeof a, 'undefined'); rollup-3.29.4/test/function/samples/export-from-renamed/000077500000000000000000000000001450520414700232735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-renamed/_config.js000066400000000000000000000003231450520414700252330ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows export { x as y } from ...', exports(exports) { assert.equal(exports.y, 42); assert.ok(!('x' in exports)); } }); rollup-3.29.4/test/function/samples/export-from-renamed/foo.js000066400000000000000000000000231450520414700244070ustar00rootroot00000000000000export var x = 42; rollup-3.29.4/test/function/samples/export-from-renamed/main.js000066400000000000000000000000401450520414700245470ustar00rootroot00000000000000export { x as y } from './foo'; rollup-3.29.4/test/function/samples/export-from-with-definition-conflict/000077500000000000000000000000001450520414700265605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-with-definition-conflict/_config.js000066400000000000000000000005321450520414700305220ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'ignores conflict between local definitions and export from declaration', exports(exports) { assert.equal(exports.foo, 'a-bar'); assert.equal(exports.bar, 'a-foo'); assert.equal(exports.baz, 'a-baz'); } }); // https://github.com/rollup/rollup/issues/16 rollup-3.29.4/test/function/samples/export-from-with-definition-conflict/a.js000066400000000000000000000001161450520414700273340ustar00rootroot00000000000000export var foo = 'a-foo'; export var bar = 'a-bar'; export var baz = 'a-baz'; rollup-3.29.4/test/function/samples/export-from-with-definition-conflict/main.js000066400000000000000000000003231450520414700300400ustar00rootroot00000000000000var foo = 'local-foo'; var baz = 'local-baz'; export { foo as bar } from './a'; export { bar as foo } from './a'; export { baz } from './a'; assert.equal( foo, 'local-foo' ); assert.equal( baz, 'local-baz' ); rollup-3.29.4/test/function/samples/export-from-with-import-conflict/000077500000000000000000000000001450520414700257425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-from-with-import-conflict/_config.js000066400000000000000000000005331450520414700277050ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'ignores conflict between import declaration and export from declaration', exports(exports) { assert.equal(exports.foo, 'a-bar'); assert.equal(exports.bar, 'a-foo'); assert.equal(exports.baz, 'a-baz'); } }); // https://github.com/rollup/rollup/issues/16 rollup-3.29.4/test/function/samples/export-from-with-import-conflict/a.js000066400000000000000000000001161450520414700265160ustar00rootroot00000000000000export var foo = 'a-foo'; export var bar = 'a-bar'; export var baz = 'a-baz'; rollup-3.29.4/test/function/samples/export-from-with-import-conflict/b.js000066400000000000000000000000641450520414700265210ustar00rootroot00000000000000export var foo = 'b-foo'; export var baz = 'b-baz'; rollup-3.29.4/test/function/samples/export-from-with-import-conflict/main.js000066400000000000000000000002751450520414700272300ustar00rootroot00000000000000import { foo, baz } from './b'; export { foo as bar } from './a'; export { bar as foo } from './a'; export { baz } from './a'; assert.equal( foo, 'b-foo' ); assert.equal( baz, 'b-baz' ); rollup-3.29.4/test/function/samples/export-global/000077500000000000000000000000001450520414700221575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-global/_config.js000066400000000000000000000007201450520414700241200ustar00rootroot00000000000000const assert = require('node:assert'); // This used to be "any global variables in scope can be re-exported" // This, however, is actually not allowed by the spec and acorn, // see https://github.com/acornjs/acorn/issues/806 // Consider reverting this change should this become an acorn option module.exports = defineTest({ description: '"variables corresponding to globals can be exported"', exports(exports) { assert.equal(exports.Buffer, Buffer); } }); rollup-3.29.4/test/function/samples/export-global/main.js000066400000000000000000000000711450520414700234370ustar00rootroot00000000000000const MyBuffer = Buffer; export { MyBuffer as Buffer }; rollup-3.29.4/test/function/samples/export-not-at-top-level-fails/000077500000000000000000000000001450520414700251225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-not-at-top-level-fails/_config.js000066400000000000000000000011601450520414700270620ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'disallows non-top-level exports', error: { cause: { pos: 19, loc: { line: 2, column: 2 }, raisedAt: 25, message: "'import' and 'export' may only appear at the top level (2:2)" }, code: 'PARSE_ERROR', id: ID_MAIN, pos: 19, loc: { column: 2, file: ID_MAIN, line: 2 }, frame: ` 1: function foo() { 2: export { foo }; ^ 3: } `, watchFiles: [ID_MAIN], message: "'import' and 'export' may only appear at the top level" } }); rollup-3.29.4/test/function/samples/export-not-at-top-level-fails/main.js000066400000000000000000000000451450520414700264030ustar00rootroot00000000000000function foo() { export { foo }; } rollup-3.29.4/test/function/samples/export-two-ways-default-b/000077500000000000000000000000001450520414700243525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-two-ways-default-b/_config.js000066400000000000000000000002651450520414700263170ustar00rootroot00000000000000module.exports = defineTest({ description: 'side-effects are preserved if subject is exported in multiple ways, even if default export has no direct link to original (#733)' }); rollup-3.29.4/test/function/samples/export-two-ways-default-b/bar.js000066400000000000000000000001431450520414700254520ustar00rootroot00000000000000import { X } from './x.js'; X.prototype.bar = function () { this.didBar = true; return this; }; rollup-3.29.4/test/function/samples/export-two-ways-default-b/foo.js000066400000000000000000000001771450520414700255000ustar00rootroot00000000000000export function X () {} X.prototype.foo = function () { this.didFoo = true; return this; }; export default ( false || X ); rollup-3.29.4/test/function/samples/export-two-ways-default-b/main.js000066400000000000000000000002061450520414700256320ustar00rootroot00000000000000import { x } from './x.js'; import './bar.js'; var result = x().foo().bar(); assert.ok( result.didFoo ); assert.ok( result.didBar ); rollup-3.29.4/test/function/samples/export-two-ways-default-b/x.js000066400000000000000000000001621450520414700251560ustar00rootroot00000000000000export { default as X } from './foo.js'; import { X } from './foo.js'; export function x () { return new X(); } rollup-3.29.4/test/function/samples/export-two-ways-default/000077500000000000000000000000001450520414700241335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-two-ways-default/_config.js000066400000000000000000000001741450520414700260770ustar00rootroot00000000000000module.exports = defineTest({ description: 'side-effects are preserved if subject is exported in multiple ways (#733)' }); rollup-3.29.4/test/function/samples/export-two-ways-default/bar.js000066400000000000000000000001431450520414700252330ustar00rootroot00000000000000import { X } from './x.js'; X.prototype.bar = function () { this.didBar = true; return this; }; rollup-3.29.4/test/function/samples/export-two-ways-default/foo.js000066400000000000000000000001621450520414700252530ustar00rootroot00000000000000export function X () {} X.prototype.foo = function () { this.didFoo = true; return this; }; export default X; rollup-3.29.4/test/function/samples/export-two-ways-default/main.js000066400000000000000000000002061450520414700254130ustar00rootroot00000000000000import { x } from './x.js'; import './bar.js'; var result = x().foo().bar(); assert.ok( result.didFoo ); assert.ok( result.didBar ); rollup-3.29.4/test/function/samples/export-two-ways-default/x.js000066400000000000000000000001621450520414700247370ustar00rootroot00000000000000export { default as X } from './foo.js'; import { X } from './foo.js'; export function x () { return new X(); } rollup-3.29.4/test/function/samples/export-two-ways-function/000077500000000000000000000000001450520414700243345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-two-ways-function/_config.js000066400000000000000000000003621450520414700262770ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports the same function more than one way (#648)', exports(exports) { assert.equal(exports.foo, exports.bar); assert.equal(exports.foo(), 42); } }); rollup-3.29.4/test/function/samples/export-two-ways-function/main.js000066400000000000000000000001131450520414700256110ustar00rootroot00000000000000var bar; bar = foo; function foo () { return 42; } export { foo, bar }; rollup-3.29.4/test/function/samples/export-two-ways/000077500000000000000000000000001450520414700225115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-two-ways/_config.js000066400000000000000000000003671450520414700244610ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports the same binding more than one way', exports(exports) { assert.equal(exports.a, 2); assert.equal(exports.b, 2); assert.equal(exports.c, 2); } }); rollup-3.29.4/test/function/samples/export-two-ways/foo.js000066400000000000000000000000351450520414700236300ustar00rootroot00000000000000export var foo = 1; foo = 2; rollup-3.29.4/test/function/samples/export-two-ways/main.js000066400000000000000000000001351450520414700237720ustar00rootroot00000000000000import { foo } from './foo'; export { foo as a }; export { foo as b }; export { foo as c }; rollup-3.29.4/test/function/samples/export-type-mismatch-b/000077500000000000000000000000001450520414700237225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-type-mismatch-b/_config.js000066400000000000000000000006221450520414700256640ustar00rootroot00000000000000module.exports = defineTest({ description: 'export type must be auto, default, named or none', options: { output: { exports: 'blah' } }, generateError: { code: 'INVALID_EXPORT_OPTION', url: 'https://rollupjs.org/configuration-options/#output-exports', message: '"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "blah".' } }); rollup-3.29.4/test/function/samples/export-type-mismatch-b/main.js000066400000000000000000000000231450520414700251770ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/export-type-mismatch-c/000077500000000000000000000000001450520414700237235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-type-mismatch-c/_config.js000066400000000000000000000006211450520414700256640ustar00rootroot00000000000000module.exports = defineTest({ description: 'cannot have named exports if explicit export type is default', options: { output: { exports: 'none' } }, generateError: { code: 'INVALID_EXPORT_OPTION', message: '"none" was specified for "output.exports", but entry module "main.js" has the following exports: "default"', url: 'https://rollupjs.org/configuration-options/#output-exports' } }); rollup-3.29.4/test/function/samples/export-type-mismatch-c/main.js000066400000000000000000000000231450520414700252000ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/export-type-mismatch/000077500000000000000000000000001450520414700235035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/export-type-mismatch/_config.js000066400000000000000000000006231450520414700254460ustar00rootroot00000000000000module.exports = defineTest({ description: 'cannot have named exports if explicit export type is default', options: { output: { exports: 'default' } }, generateError: { code: 'INVALID_EXPORT_OPTION', message: '"default" was specified for "output.exports", but entry module "main.js" has the following exports: "foo"', url: 'https://rollupjs.org/configuration-options/#output-exports' } }); rollup-3.29.4/test/function/samples/export-type-mismatch/main.js000066400000000000000000000000251450520414700247620ustar00rootroot00000000000000export var foo = 42; rollup-3.29.4/test/function/samples/exports-flag-allowed-in-options/000077500000000000000000000000001450520414700255355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/exports-flag-allowed-in-options/_config.js000066400000000000000000000004211450520414700274740ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports flag is passed through to bundle options', options: { output: { exports: 'named' } }, exports(exports) { assert.equal(exports.y, 42); assert.ok(!('x' in exports)); } }); rollup-3.29.4/test/function/samples/exports-flag-allowed-in-options/foo.js000066400000000000000000000000231450520414700266510ustar00rootroot00000000000000export var x = 42; rollup-3.29.4/test/function/samples/exports-flag-allowed-in-options/main.js000066400000000000000000000000401450520414700270110ustar00rootroot00000000000000export { x as y } from './foo'; rollup-3.29.4/test/function/samples/exports-named-values/000077500000000000000000000000001450520414700234635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/exports-named-values/_config.js000066400000000000000000000003101450520414700254170ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'exports named values from the bundle entry module', exports(exports) { assert.equal(exports.answer, 42); } }); rollup-3.29.4/test/function/samples/exports-named-values/main.js000066400000000000000000000000271450520414700247440ustar00rootroot00000000000000export var answer = 42;rollup-3.29.4/test/function/samples/external-alias-parent/000077500000000000000000000000001450520414700236005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-alias-parent/_config.js000066400000000000000000000014031450520414700255400ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'includes an external module included dynamically by an alias', options: { input: path.join(__dirname, 'first', 'main.js'), external(id, parentId, isResolved) { if (isResolved === false || !parentId) return false; return parentId.endsWith('main.js') ? id === 'lodash' : id === 'underscore'; }, // Define a simple alias plugin for underscore plugins: [ { resolveId(id, parentId) { if (id === 'underscore' && parentId && parentId.endsWith('main.js')) { return 'lodash'; } } } ] }, context: { require(required) { assert(required === 'lodash' || required === 'underscore'); return 1; } } }); rollup-3.29.4/test/function/samples/external-alias-parent/first/000077500000000000000000000000001450520414700247275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-alias-parent/first/main.js000066400000000000000000000002671450520414700262160ustar00rootroot00000000000000import _ from 'underscore'; import first from './module'; export default function ( inputs ) { if ( !_.isArray( inputs ) ) { return inputs; } return first.square( inputs ); }; rollup-3.29.4/test/function/samples/external-alias-parent/first/module.js000066400000000000000000000002111450520414700265440ustar00rootroot00000000000000import _ from 'underscore'; export default function square ( inputs ) { return _.map( inputs, function ( x ) { return x * x; }); }; rollup-3.29.4/test/function/samples/external-alias/000077500000000000000000000000001450520414700223115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-alias/_config.js000066400000000000000000000010271450520414700242530ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'includes an external module included dynamically by an alias', options: { input: path.join(__dirname, 'first', 'main.js'), external: ['lodash'], // Define a simple alias plugin for underscore plugins: [ { resolveId(id) { if (id === 'underscore') { return 'lodash'; } } } ] }, context: { require(required) { assert.equal(required, 'lodash'); return 1; } } }); rollup-3.29.4/test/function/samples/external-alias/first/000077500000000000000000000000001450520414700234405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-alias/first/main.js000066400000000000000000000002671450520414700247270ustar00rootroot00000000000000import _ from 'underscore'; import first from './module'; export default function ( inputs ) { if ( !_.isArray( inputs ) ) { return inputs; } return first.square( inputs ); }; rollup-3.29.4/test/function/samples/external-alias/first/module.js000066400000000000000000000002111450520414700252550ustar00rootroot00000000000000import _ from 'underscore'; export default function square ( inputs ) { return _.map( inputs, function ( x ) { return x * x; }); }; rollup-3.29.4/test/function/samples/external-conflict/000077500000000000000000000000001450520414700230215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-conflict/_config.js000066400000000000000000000011271450520414700247640ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'external paths from custom resolver remain external (#633)', options: { external: (_id, parent) => parent === 'dep', plugins: [ { resolveId(id) { if (id === 'dep') return id; }, load(id) { if (id === 'dep') return `import 'dep'`; } } ] }, error: { code: 'INVALID_EXTERNAL_ID', watchFiles: [ID_MAIN, 'dep'], message: '"dep" is imported as an external by "dep", but is already an existing non-external module id.' } }); rollup-3.29.4/test/function/samples/external-conflict/main.js000066400000000000000000000000151450520414700242770ustar00rootroot00000000000000import 'dep';rollup-3.29.4/test/function/samples/external-directory-import/000077500000000000000000000000001450520414700245345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-directory-import/_config.js000066400000000000000000000002661450520414700265020ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles using ../ as external import (#4349)', options: { external() { return true; } }, context: { require: id => id } }); rollup-3.29.4/test/function/samples/external-directory-import/main.js000066400000000000000000000005531450520414700260210ustar00rootroot00000000000000import foo1 from './'; import foo2 from '../'; import foo3 from '.'; import foo4 from '..'; import foo5 from './index.js'; import foo6 from '../index.js'; assert.strictEqual(foo1, '.'); assert.strictEqual(foo2, '..'); assert.strictEqual(foo3, '.'); assert.strictEqual(foo4, '..'); assert.strictEqual(foo5, './index.js'); assert.strictEqual(foo6, '../index.js'); rollup-3.29.4/test/function/samples/external-dynamic-import-live-binding-compact/000077500000000000000000000000001450520414700301455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-dynamic-import-live-binding-compact/_config.js000066400000000000000000000034141450520414700321110ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'supports external dynamic imports with live bindings in compact mode', options: { external() { return true; }, output: { compact: true, interop: 'auto', dynamicImportInCjs: false } }, context: { require(id) { switch (id) { case 'dep-0': { return; } case 'dep-1': { return () => 42; } case 'dep-2': { const exp = { value: 1, default: 2, update() { exp.value = 3; exp.default = 4; } }; Object.defineProperty(exp, '__esModule', { value: true }); return exp; } case 'dep-3': { let value = 1; const exp = { get value() { return value; }, otherValue: 2, update() { value = 3; exp.otherValue = 4; } }; return exp; } default: { throw new Error(`Unexpected id ${id}.`); } } } }, exports(exports) { return exports.then(results => { assert.deepStrictEqual(results[0], { __proto__: null, default: undefined }); assert.strictEqual(results[1].default(), 42); assert.strictEqual(results[2].value, 1); assert.strictEqual(results[2].default, 2); results[2].update(); assert.strictEqual(results[2].value, 3); assert.strictEqual(results[2].default, 4); assert.strictEqual(results[3].value, 1); assert.strictEqual(results[3].otherValue, 2); assert.strictEqual(results[3].default.value, 1); assert.strictEqual(results[3].default.otherValue, 2); results[3].update(); assert.strictEqual(results[3].value, 3); assert.strictEqual(results[3].otherValue, 4); assert.strictEqual(results[3].default.value, 3); assert.strictEqual(results[3].default.otherValue, 4); }); } }); rollup-3.29.4/test/function/samples/external-dynamic-import-live-binding-compact/main.js000066400000000000000000000001511450520414700314240ustar00rootroot00000000000000export default Promise.all([ import('dep-0'), import('dep-1'), import('dep-2'), import('dep-3'), ]); rollup-3.29.4/test/function/samples/external-dynamic-import-live-binding/000077500000000000000000000000001450520414700265215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-dynamic-import-live-binding/_config.js000066400000000000000000000033421450520414700304650ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'supports external dynamic imports with live bindings', options: { external() { return true; }, output: { interop: 'auto', dynamicImportInCjs: false } }, context: { require(id) { switch (id) { case 'dep-0': { return; } case 'dep-1': { return () => 42; } case 'dep-2': { const exp = { value: 1, default: 2, update() { exp.value = 3; exp.default = 4; } }; Object.defineProperty(exp, '__esModule', { value: true }); return exp; } case 'dep-3': { let value = 1; const exp = { get value() { return value; }, otherValue: 2, update() { value = 3; exp.otherValue = 4; } }; return exp; } default: { throw new Error(`Unexpected id ${id}.`); } } } }, exports(exports) { return exports.then(results => { assert.deepStrictEqual(results[0], { __proto__: null, default: undefined }); assert.strictEqual(results[1].default(), 42); assert.strictEqual(results[2].value, 1); assert.strictEqual(results[2].default, 2); results[2].update(); assert.strictEqual(results[2].value, 3); assert.strictEqual(results[2].default, 4); assert.strictEqual(results[3].value, 1); assert.strictEqual(results[3].otherValue, 2); assert.strictEqual(results[3].default.value, 1); assert.strictEqual(results[3].default.otherValue, 2); results[3].update(); assert.strictEqual(results[3].value, 3); assert.strictEqual(results[3].otherValue, 4); assert.strictEqual(results[3].default.value, 3); assert.strictEqual(results[3].default.otherValue, 4); }); } }); rollup-3.29.4/test/function/samples/external-dynamic-import-live-binding/main.js000066400000000000000000000001511450520414700300000ustar00rootroot00000000000000export default Promise.all([ import('dep-0'), import('dep-1'), import('dep-2'), import('dep-3'), ]); rollup-3.29.4/test/function/samples/external-entry-point-object/000077500000000000000000000000001450520414700247545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-entry-point-object/_config.js000066400000000000000000000004731450520414700267220ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for entry points that are resolved as an external object by plugins', options: { plugins: { resolveId(id) { return { id, external: true }; } } }, error: { code: 'UNRESOLVED_ENTRY', message: 'Entry module "main.js" cannot be external.' } }); rollup-3.29.4/test/function/samples/external-entry-point-object/foo.js000066400000000000000000000000551450520414700260750ustar00rootroot00000000000000export var foo = function () { return 42; } rollup-3.29.4/test/function/samples/external-entry-point-object/main.js000066400000000000000000000001511450520414700262330ustar00rootroot00000000000000import { foo } from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo(), 42 ); rollup-3.29.4/test/function/samples/external-entry-point/000077500000000000000000000000001450520414700235105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-entry-point/_config.js000066400000000000000000000004331450520414700254520ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for entry points that are resolved as false by plugins', options: { plugins: { resolveId() { return false; } } }, error: { code: 'UNRESOLVED_ENTRY', message: 'Entry module "main.js" cannot be external.' } }); rollup-3.29.4/test/function/samples/external-entry-point/foo.js000066400000000000000000000000551450520414700246310ustar00rootroot00000000000000export var foo = function () { return 42; } rollup-3.29.4/test/function/samples/external-entry-point/main.js000066400000000000000000000001511450520414700247670ustar00rootroot00000000000000import { foo } from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo(), 42 ); rollup-3.29.4/test/function/samples/external-function-always-true/000077500000000000000000000000001450520414700253205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-function-always-true/_config.js000066400000000000000000000003501450520414700272600ustar00rootroot00000000000000module.exports = defineTest({ description: 'Does not call external for entry point', options: { external(id, parentId) { if (!parentId) throw new Error('Should not call external for entry point.'); return true; } } }); rollup-3.29.4/test/function/samples/external-function-always-true/main.js000066400000000000000000000001001450520414700265710ustar00rootroot00000000000000import ext from 'external'; assert.equal( ext.external, true ); rollup-3.29.4/test/function/samples/external-function/000077500000000000000000000000001450520414700230455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-function/_config.js000066400000000000000000000003701450520414700250070ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows external option to be a function (#522)', options: { external: id => id === 'external' }, context: { require: id => { if (id === 'external') return 42; return require(id); } } }); rollup-3.29.4/test/function/samples/external-function/main.js000066400000000000000000000000651450520414700243300ustar00rootroot00000000000000import ext from 'external'; assert.equal( ext, 42 ); rollup-3.29.4/test/function/samples/external-ids-not-resolved/000077500000000000000000000000001450520414700244165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-ids-not-resolved/_config.js000066400000000000000000000004551450520414700263640ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not attempt to resolve external IDs', options: { external: ['external'], plugins: [ { resolveId(importee) { if (importee === 'external') { throw new Error('Attempted to resolve external module ID'); } } } ] } }); rollup-3.29.4/test/function/samples/external-ids-not-resolved/main.js000066400000000000000000000000671450520414700257030ustar00rootroot00000000000000import foo from 'external'; assert.ok( foo.external ); rollup-3.29.4/test/function/samples/external-ignore-reserved-null-marker/000077500000000000000000000000001450520414700265475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-ignore-reserved-null-marker/_config.js000066400000000000000000000012211450520414700305050ustar00rootroot00000000000000module.exports = defineTest({ description: 'external function ignores \\0 started ids', options: { external(id) { if (id.startsWith('\0')) { throw new Error('\\0 started ids should not be tested as external'); } return true; }, plugins: [ { resolveId(importee) { if (importee === '\0external') { return importee; } }, load(id) { if (id.slice(-7) === 'main.js') { return 'import external from "\0external";assert.equal(external, 1);'; } if (id === '\0external') { return 'export default 1'; } throw new Error('Unexpected id to be loaded: ' + id); } } ] } }); rollup-3.29.4/test/function/samples/external-ignore-reserved-null-marker/main.js000066400000000000000000000000771450520414700300350ustar00rootroot00000000000000import external from '\0external'; assert.equal(external, 1); rollup-3.29.4/test/function/samples/external-live-binding-compact/000077500000000000000000000000001450520414700252135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-live-binding-compact/_config.js000066400000000000000000000015421450520414700271570ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles external live-bindings', options: { external: ['named', 'star'], output: { compact: true } }, context: { require(id) { switch (id) { case 'named': { const exports = { named: 0, incrementNamed() { exports.named++; } }; return exports; } case 'star': { const exports = { star: 0, incrementStar() { exports.star++; } }; return exports; } default: { throw new Error(`Unexpected id ${id}`); } } } }, exports(exports) { assert.equal(exports.named, 0, 'named'); exports.incrementNamed(); assert.equal(exports.named, 1, 'named'); assert.equal(exports.star, 0, 'star'); exports.incrementStar(); assert.equal(exports.star, 1, 'star'); } }); rollup-3.29.4/test/function/samples/external-live-binding-compact/main.js000066400000000000000000000001051450520414700264710ustar00rootroot00000000000000export { named, incrementNamed } from 'named'; export * from 'star'; rollup-3.29.4/test/function/samples/external-live-binding/000077500000000000000000000000001450520414700235675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-live-binding/_config.js000066400000000000000000000024171450520414700255350ustar00rootroot00000000000000const assert = require('node:assert'); let named; let star; let defaulted; module.exports = defineTest({ description: 'handles external live-bindings', options: { external: ['named', 'star', 'defaulted'], output: { interop: 'compat' } }, context: { require(id) { switch (id) { case 'named': { named = { named: 1 }; return named; } case 'star': { star = { star: 1, // "export * from" does not forward default exports default: 'star-ignored' }; Object.defineProperty(star, '__esModule', { value: true }); return star; } case 'defaulted': { defaulted = { default: 1 }; Object.defineProperty(defaulted, '__esModule', { value: true }); return defaulted; } default: { throw new Error(`Unexpected id ${id}.`); } } } }, exports(exports) { assert.equal(exports.named, 1, 'named'); named.named++; assert.equal(exports.named, 2, 'named'); assert.equal(exports.star, 1, 'star'); star.star++; assert.equal(exports.star, 2, 'star'); assert.equal(exports.defaulted, 1, 'default'); defaulted.default++; assert.equal(exports.defaulted, 2, 'default'); // make sure the default is not reexported assert.equal(exports.default, undefined); } }); rollup-3.29.4/test/function/samples/external-live-binding/main.js000066400000000000000000000001471450520414700250530ustar00rootroot00000000000000export { named } from 'named'; export { default as defaulted } from 'defaulted'; export * from 'star'; rollup-3.29.4/test/function/samples/external-normalization/000077500000000000000000000000001450520414700241065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-normalization/_config.js000066400000000000000000000006221450520414700260500ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'external paths from custom resolver remain external (#633)', options: { external: ['path'], plugins: [ { resolveId: id => { if (id == './dep.js') return 'path'; return id; } } ] }, exports: exports => { assert.equal(exports, path.resolve); } }); rollup-3.29.4/test/function/samples/external-normalization/main.js000066400000000000000000000000741450520414700253710ustar00rootroot00000000000000import { resolve } from './dep.js'; export default resolve; rollup-3.29.4/test/function/samples/external-regex-array/000077500000000000000000000000001450520414700234465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-regex-array/_config.js000066400000000000000000000004441450520414700254120ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows external option to be an array of regex and strings', options: { external: [/external/, 'other'] }, context: { require: id => { if (id === 'external') return 42; if (id === 'other') return 17; return require(id); } } }); rollup-3.29.4/test/function/samples/external-regex-array/main.js000066400000000000000000000001531450520414700247270ustar00rootroot00000000000000import ext from 'external'; import other from 'other'; assert.equal( ext, 42 ); assert.equal( other, 17 ); rollup-3.29.4/test/function/samples/external-regex/000077500000000000000000000000001450520414700223325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-regex/_config.js000066400000000000000000000003411450520414700242720ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows external option to be a regex', options: { external: /external/ }, context: { require: id => { if (id === 'external') return 42; return require(id); } } }); rollup-3.29.4/test/function/samples/external-regex/main.js000066400000000000000000000000651450520414700236150ustar00rootroot00000000000000import ext from 'external'; assert.equal( ext, 42 ); rollup-3.29.4/test/function/samples/external-resolve-false/000077500000000000000000000000001450520414700237675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-resolve-false/_config.js000066400000000000000000000005671450520414700257410ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'includes an external module with a false resolve return', options: { input: 'main.js', plugins: [ { resolveId(id) { if (id === './external') return false; } } ] }, context: { require(required) { assert.equal(required, './external'); return 1; } } }); rollup-3.29.4/test/function/samples/external-resolve-false/main.js000066400000000000000000000000241450520414700252450ustar00rootroot00000000000000import './external';rollup-3.29.4/test/function/samples/external-resolved/000077500000000000000000000000001450520414700230435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/external-resolved/_config.js000066400000000000000000000022011450520414700250000ustar00rootroot00000000000000const assert = require('node:assert'); const testedIds = []; module.exports = defineTest({ description: 'passes both unresolved and resolved ids to the external option', context: { require() { return true; } }, exports(exports) { assert.deepStrictEqual(exports, { resolvedExternal: true, resolvedObject: true, resolvedObjectExternal: true, resolvedString: true }); assert.deepStrictEqual(testedIds, [ 'resolve-string', 'resolve-external', 'resolve-object', 'resolve-object-external', 'resolved-string', 'resolved-object' ]); }, options: { external(id) { testedIds.push(id); return id.startsWith('resolved'); }, plugins: { name: 'test-plugin', resolveId(source) { switch (source) { case 'resolve-string': { return 'resolved-string'; } case 'resolve-external': { return false; } case 'resolve-object': { return { id: 'resolved-object', external: false }; } case 'resolve-object-external': { return { id: 'resolved-object-external', external: true }; } default: { return null; } } } } } }); rollup-3.29.4/test/function/samples/external-resolved/main.js000066400000000000000000000003751450520414700243320ustar00rootroot00000000000000export {default as resolvedString} from 'resolve-string'; export {default as resolvedExternal} from 'resolve-external'; export {default as resolvedObject} from 'resolve-object'; export {default as resolvedObjectExternal} from 'resolve-object-external'; rollup-3.29.4/test/function/samples/externally-reassigned-default-exports/000077500000000000000000000000001450520414700270355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/externally-reassigned-default-exports/_config.js000066400000000000000000000004771450520414700310070ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'calls to externally reassigned methods of default exports must be retained', exports(exports) { let triggered = false; exports.reassigned = function () { triggered = true; }; exports.test(); assert.ok(triggered); } }); rollup-3.29.4/test/function/samples/externally-reassigned-default-exports/main.js000066400000000000000000000001311450520414700303120ustar00rootroot00000000000000const obj = { reassigned() {}, test() { obj.reassigned(); } }; export default obj; rollup-3.29.4/test/function/samples/externally-reassigned-globals/000077500000000000000000000000001450520414700253325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/externally-reassigned-globals/_config.js000066400000000000000000000007401450520414700272750ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'calls to externally reassigned global methods must be retained', exports(exports) { let triggered1 = false; let triggered2 = false; global.obj1.reassigned = function () { triggered1 = true; }; global.obj2.reassigned = function () { triggered2 = true; }; exports.test(); delete global.obj1; delete global.obj2; assert.ok(triggered1); assert.ok(triggered2); } }); rollup-3.29.4/test/function/samples/externally-reassigned-globals/main.js000066400000000000000000000002501450520414700266110ustar00rootroot00000000000000const obj1 = { reassigned() {} }; global.obj1 = obj1; global.obj2 = { reassigned() {} }; export function test() { obj1.reassigned(); global.obj2.reassigned(); } rollup-3.29.4/test/function/samples/externally-reassigned-named-exports/000077500000000000000000000000001450520414700264755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/externally-reassigned-named-exports/_config.js000066400000000000000000000006761450520414700304500ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'calls to externally reassigned methods of named exports must be retained', exports(exports) { let triggered1 = false; let triggered2 = false; exports.obj1.reassigned = function () { triggered1 = true; }; exports.obj2.reassigned = function () { triggered2 = true; }; exports.test(); assert.ok(triggered1); assert.ok(triggered2); } }); rollup-3.29.4/test/function/samples/externally-reassigned-named-exports/main.js000066400000000000000000000002431450520414700277560ustar00rootroot00000000000000export const obj1 = { reassigned() {} }; const obj2 = { reassigned() {} }; export { obj2 }; export function test() { obj1.reassigned(); obj2.reassigned(); } rollup-3.29.4/test/function/samples/externally-reassigned-named-reexports/000077500000000000000000000000001450520414700270245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/externally-reassigned-named-reexports/_config.js000066400000000000000000000005031450520414700307640ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'calls to externally reassigned methods of named reexports must be retained', exports(exports) { let triggered = false; exports.obj.reassigned = function () { triggered = true; }; exports.test(); assert.ok(triggered); } }); rollup-3.29.4/test/function/samples/externally-reassigned-named-reexports/foo.js000066400000000000000000000000511450520414700301410ustar00rootroot00000000000000export const obj = { reassigned() {} }; rollup-3.29.4/test/function/samples/externally-reassigned-named-reexports/main.js000066400000000000000000000001601450520414700303030ustar00rootroot00000000000000export { obj } from './foo.js'; import { obj } from './foo.js'; export function test() { obj.reassigned(); } rollup-3.29.4/test/function/samples/externally-reassigned-star-reexports/000077500000000000000000000000001450520414700267115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/externally-reassigned-star-reexports/_config.js000066400000000000000000000005071450520414700306550ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'calls to externally reassigned methods of namespace reexports must be retained', exports(exports) { let triggered = false; exports.obj.reassigned = function () { triggered = true; }; exports.test(); assert.ok(triggered); } }); rollup-3.29.4/test/function/samples/externally-reassigned-star-reexports/foo.js000066400000000000000000000000511450520414700300260ustar00rootroot00000000000000export const obj = { reassigned() {} }; rollup-3.29.4/test/function/samples/externally-reassigned-star-reexports/main.js000066400000000000000000000001521450520414700301710ustar00rootroot00000000000000export * from './foo.js'; import { obj } from './foo.js'; export function test() { obj.reassigned(); } rollup-3.29.4/test/function/samples/facade-reexports/000077500000000000000000000000001450520414700226345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/facade-reexports/_config.js000066400000000000000000000007321450520414700246000ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles reexports when creating a facade chunk and transitive dependencies are not hoisted', options: { input: ['main', 'other'], external: 'external', output: { hoistTransitiveImports: false } }, async exports(exports) { assert.strictEqual(exports.other, 'other'); assert.strictEqual(exports.external, true); assert.strictEqual(await exports.dynamic(), 'liblib'); } }); rollup-3.29.4/test/function/samples/facade-reexports/dynamic.js000066400000000000000000000000701450520414700246130ustar00rootroot00000000000000import { lib } from './lib'; export const dynamic = lib;rollup-3.29.4/test/function/samples/facade-reexports/lib.js000066400000000000000000000000321450520414700237330ustar00rootroot00000000000000export const lib = 'lib'; rollup-3.29.4/test/function/samples/facade-reexports/main.js000066400000000000000000000002721450520414700241170ustar00rootroot00000000000000import { lib } from './lib'; export const dynamic = () => import('./dynamic').then(({ dynamic }) => dynamic + lib); export { other } from './other'; export { external } from 'external'; rollup-3.29.4/test/function/samples/facade-reexports/other.js000066400000000000000000000000341450520414700243100ustar00rootroot00000000000000export const other = 'other'rollup-3.29.4/test/function/samples/file-and-dir/000077500000000000000000000000001450520414700216335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/file-and-dir/_config.js000066400000000000000000000006661450520414700236050ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when using both the file and the dir option', options: { output: { file: 'bundle.js', dir: 'dist' } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.dir" - you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.', url: 'https://rollupjs.org/configuration-options/#output-dir' } }); rollup-3.29.4/test/function/samples/file-and-dir/foo.js000066400000000000000000000000231450520414700227470ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/file-and-dir/main.js000066400000000000000000000000511450520414700231110ustar00rootroot00000000000000export default () => import('./foo.js'); rollup-3.29.4/test/function/samples/for-in-accessors/000077500000000000000000000000001450520414700225555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/for-in-accessors/_config.js000066400000000000000000000001551450520414700245200ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes "this" for accessors triggered by for-in loops' }); rollup-3.29.4/test/function/samples/for-in-accessors/main.js000066400000000000000000000002141450520414700240340ustar00rootroot00000000000000const obj = { setter: false, set foo(value) { this.setter = true; } }; for (obj.foo in {x:1}); assert.ok(obj.setter ? true : false); rollup-3.29.4/test/function/samples/for-in-loop-head-dependencies/000077500000000000000000000000001450520414700250645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/for-in-loop-head-dependencies/_config.js000066400000000000000000000001641450520414700270270ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses parent scope for right-hand-side in for-in statement (#1480)' }); rollup-3.29.4/test/function/samples/for-in-loop-head-dependencies/main.js000066400000000000000000000002221450520414700263420ustar00rootroot00000000000000function foo() { return ['x']; } const result = []; for (let i in foo()) { const foo = i; result.push(foo); } assert.deepEqual(result, [0]);rollup-3.29.4/test/function/samples/for-loop-head-dependencies/000077500000000000000000000000001450520414700244605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/for-loop-head-dependencies/_config.js000066400000000000000000000001361450520414700264220ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses correct scope in for statement (#1538)' }); rollup-3.29.4/test/function/samples/for-loop-head-dependencies/main.js000066400000000000000000000002721450520414700257430ustar00rootroot00000000000000function foo() { return ['x', 'y']; } const result = []; for (let a = foo(), i = 0; i < a.length; ++i) { const foo = a[i]; result.push(foo); } assert.deepEqual(result, ['x', 'y']);rollup-3.29.4/test/function/samples/for-loop-parameter/000077500000000000000000000000001450520414700231135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/for-loop-parameter/_config.js000066400000000000000000000004221450520414700250530ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'includes for-loop parameters', exports({ checkObject, checkArray }) { assert.strictEqual(checkObject({ foo: 1 }), 1, 'object'); assert.strictEqual(checkArray([2]), 2, 'array'); } }); rollup-3.29.4/test/function/samples/for-loop-parameter/main.js000066400000000000000000000004611450520414700243760ustar00rootroot00000000000000export function checkObject(p) { return getFromObjectInLoop(p); } export function checkArray(p) { return getFromArrayInLoop(p); } function getFromObjectInLoop(path) { for (let { foo } = path;;) { return foo; } } function getFromArrayInLoop(path) { for (let [ foo ] = path;;) { return foo; } }rollup-3.29.4/test/function/samples/for-loops-as-assignments/000077500000000000000000000000001450520414700242525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/for-loops-as-assignments/_config.js000066400000000000000000000001621450520414700262130ustar00rootroot00000000000000module.exports = defineTest({ description: 'make sure for loops are counted as variable assignments (#2199)' }); rollup-3.29.4/test/function/samples/for-loops-as-assignments/main.js000066400000000000000000000004351450520414700255360ustar00rootroot00000000000000let x = false; let iteratedForIn = false; for (x in {key: true}) { if (x === 'key') { iteratedForIn = true; } } assert.ok(iteratedForIn); let y = false; let iteratedForOf = false; for (y of ['key']) { if (y === 'key') { iteratedForOf = true; } } assert.ok(iteratedForOf); rollup-3.29.4/test/function/samples/for-of-accessors/000077500000000000000000000000001450520414700225535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/for-of-accessors/_config.js000066400000000000000000000001551450520414700245160ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes "this" for accessors triggered by for-of loops' }); rollup-3.29.4/test/function/samples/for-of-accessors/main.js000066400000000000000000000002121450520414700240300ustar00rootroot00000000000000const obj = { setter: false, set foo(value) { this.setter = true; } }; for (obj.foo of [1]); assert.ok(obj.setter ? true : false); rollup-3.29.4/test/function/samples/for-of-loop-head-dependencies/000077500000000000000000000000001450520414700250625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/for-of-loop-head-dependencies/_config.js000066400000000000000000000001641450520414700270250ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses parent scope for right-hand-side in for-of statement (#1539)' }); rollup-3.29.4/test/function/samples/for-of-loop-head-dependencies/main.js000066400000000000000000000002361450520414700263450ustar00rootroot00000000000000function foo() { return ['x', 'y']; } const result = []; for (const i of foo()) { const foo = i; result.push(i); } assert.deepEqual(result, ['x', 'y']);rollup-3.29.4/test/function/samples/for-of-with-in-operator/000077500000000000000000000000001450520414700237765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/for-of-with-in-operator/_config.js000066400000000000000000000001711450520414700257370ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles using the in operator in the iterator of a for-of loop (#2337)' }); rollup-3.29.4/test/function/samples/for-of-with-in-operator/main.js000066400000000000000000000001351450520414700252570ustar00rootroot00000000000000for (const foo of [{}]) { if ('x' in foo) { throw new Error('There should be no x'); } } rollup-3.29.4/test/function/samples/function-asm-directive/000077500000000000000000000000001450520414700237575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/function-asm-directive/_config.js000066400000000000000000000003271450520414700257230ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: "shouldn't delete use asm from the start of a function body", code(code) { assert.notEqual(code.indexOf('use asm'), -1); } }); rollup-3.29.4/test/function/samples/function-asm-directive/main.js000066400000000000000000000000651450520414700252420ustar00rootroot00000000000000export function a() { "use asm"; return 1; }rollup-3.29.4/test/function/samples/function-directive-not-first/000077500000000000000000000000001450520414700251245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/function-directive-not-first/_config.js000066400000000000000000000003371450520414700270710ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'should delete use asm from function body if it is not the first expression', code(code) { assert.ok(!code.includes('use asm')); } }); rollup-3.29.4/test/function/samples/function-directive-not-first/main.js000066400000000000000000000001051450520414700264020ustar00rootroot00000000000000export function a() { const x = 1; "use asm"; return x; }rollup-3.29.4/test/function/samples/function-expressions-simplified-to-statement/000077500000000000000000000000001450520414700303525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/function-expressions-simplified-to-statement/_config.js000066400000000000000000000001741450520414700323160ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly handles function expressions which are simplified to statements' }); rollup-3.29.4/test/function/samples/function-expressions-simplified-to-statement/main.js000066400000000000000000000014341450520414700316360ustar00rootroot00000000000000var value; // conditional expression function foo(){ value = 'foo'; } true ? function foo(x){ value = x; }("consequent") : 2; assert.strictEqual(value, 'consequent'); foo("incorrect"); assert.strictEqual(value, 'foo'); false ? null: function foo(x){ value = x; }("alternate"); assert.strictEqual(value, 'alternate'); // logical expression function bar(){ value = 'bar'; } true && function bar(x){ value = x; }("and"); assert.strictEqual(value, 'and'); bar("incorrect"); assert.strictEqual(value, 'bar'); false || function bar(x){ value = x; }("or"); assert.strictEqual(value, 'or'); // sequence expression function baz(){ value = 'baz'; } 0, function baz(x){ value = x; }("comma"); assert.strictEqual(value, 'comma'); baz("incorrect"); assert.strictEqual(value, 'baz'); rollup-3.29.4/test/function/samples/function-getter-side-effects/000077500000000000000000000000001450520414700250545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/function-getter-side-effects/_config.js000066400000000000000000000001301450520414700270100ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects getters created on functions' }); rollup-3.29.4/test/function/samples/function-getter-side-effects/main.js000066400000000000000000000010541450520414700263360ustar00rootroot00000000000000let funDeclEffect = false; function funDecl() {} Object.defineProperty(funDecl, 'foo', { get() { funDeclEffect = true; }}); funDecl.foo; assert.ok(funDeclEffect, 'function declaration'); let funExpEffect = false; const funExp = function () {}; Object.defineProperty(funExp, 'foo', { get() { funExpEffect = true }}); funExp.foo; assert.ok(funExpEffect, 'function expression'); let arrowEffect = false; const arrow = function () {}; Object.defineProperty(arrow, 'foo', { get() { arrowEffect = true }}); arrow.foo; assert.ok(arrowEffect, 'arrow function'); rollup-3.29.4/test/function/samples/function-side-effects/000077500000000000000000000000001450520414700235645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/function-side-effects/_config.js000066400000000000000000000001411450520414700255220ustar00rootroot00000000000000module.exports = defineTest({ description: 'assumes functions may mutate objects passed in' }); rollup-3.29.4/test/function/samples/function-side-effects/main.js000066400000000000000000000000751450520414700250500ustar00rootroot00000000000000import object from './object'; assert.ok( object.mutated ); rollup-3.29.4/test/function/samples/function-side-effects/mutate.js000066400000000000000000000001051450520414700254150ustar00rootroot00000000000000export default function mutate ( object ) { object.mutated = true; }rollup-3.29.4/test/function/samples/function-side-effects/object.js000066400000000000000000000001321450520414700253640ustar00rootroot00000000000000import mutate from './mutate'; var object = {}; mutate( object ); export default object;rollup-3.29.4/test/function/samples/function-use-strict-directive-removed/000077500000000000000000000000001450520414700267405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/function-use-strict-directive-removed/_config.js000066400000000000000000000003131450520414700306770ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'should delete use strict from function body', code(code) { assert.equal(code.lastIndexOf('use strict'), 1); } }); rollup-3.29.4/test/function/samples/function-use-strict-directive-removed/main.js000066400000000000000000000001101450520414700302120ustar00rootroot00000000000000export function a() { "use strict"; const x = 1; return x; }rollup-3.29.4/test/function/samples/functions-renamed-correctly/000077500000000000000000000000001450520414700250255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/functions-renamed-correctly/_config.js000066400000000000000000000001341450520414700267650ustar00rootroot00000000000000module.exports = defineTest({ description: 'renames function expression IDs correctly' }); rollup-3.29.4/test/function/samples/functions-renamed-correctly/after.js000066400000000000000000000000731450520414700264640ustar00rootroot00000000000000function x () { return 'after'; } export { x as after }; rollup-3.29.4/test/function/samples/functions-renamed-correctly/before.js000066400000000000000000000000751450520414700266270ustar00rootroot00000000000000function x () { return 'before'; } export { x as before }; rollup-3.29.4/test/function/samples/functions-renamed-correctly/factorial.js000066400000000000000000000001731450520414700273300ustar00rootroot00000000000000var x = (function () { return function x ( num ) { return num <= 2 ? num : num * x( num - 1 ); }; })(); export { x }; rollup-3.29.4/test/function/samples/functions-renamed-correctly/main.js000066400000000000000000000002761450520414700263140ustar00rootroot00000000000000import { before } from './before'; import { x } from './factorial'; import { after } from './after'; before(); // before and after ensure x is renamed assert.equal( x( 5 ), 120 ); after(); rollup-3.29.4/test/function/samples/generate-bundle-mutation/000077500000000000000000000000001450520414700242775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/generate-bundle-mutation/_config.js000066400000000000000000000004471450520414700262460ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles adding or deleting symbols in generateBundle', options: { plugins: [ { name: 'test', generateBundle(options, bundle) { const myKey = Symbol('test'); bundle[myKey] = 42; delete bundle[myKey]; } } ] } }); rollup-3.29.4/test/function/samples/generate-bundle-mutation/main.js000066400000000000000000000000211450520414700255520ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/globally-called-modifying-function/000077500000000000000000000000001450520414700262355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/globally-called-modifying-function/_config.js000066400000000000000000000002061450520414700301750ustar00rootroot00000000000000module.exports = defineTest({ description: 'globally called function should be included if it modifies an exported value (#112)' }); rollup-3.29.4/test/function/samples/globally-called-modifying-function/main.js000066400000000000000000000000741450520414700275200ustar00rootroot00000000000000import value from './module.js'; assert.equal( value, 3 ); rollup-3.29.4/test/function/samples/globally-called-modifying-function/module.js000066400000000000000000000002401450520414700300540ustar00rootroot00000000000000var value = 1; function change () { value = 2; } function changeAgain () { value += 1; } change(); if ( true ) { changeAgain(); } export default value; rollup-3.29.4/test/function/samples/handle-calling-uncallable/000077500000000000000000000000001450520414700243425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handle-calling-uncallable/_config.js000066400000000000000000000001651450520414700263060ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not give cryptic error when calling uncallable things (#1257)' }); rollup-3.29.4/test/function/samples/handle-calling-uncallable/foo.js000066400000000000000000000000531450520414700254610ustar00rootroot00000000000000function foo() {} export default { foo }; rollup-3.29.4/test/function/samples/handle-calling-uncallable/main.js000066400000000000000000000001341450520414700256220ustar00rootroot00000000000000import foo from './foo.js'; assert.throws( function () { foo(); }, /is not a function/ ); rollup-3.29.4/test/function/samples/handle-labels-inside-functions/000077500000000000000000000000001450520414700253525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handle-labels-inside-functions/_config.js000066400000000000000000000001511450520414700273110ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not fail when using labels inside functions (#1706)' }); rollup-3.29.4/test/function/samples/handle-labels-inside-functions/main.js000066400000000000000000000002451450520414700266350ustar00rootroot00000000000000function loopWithLabel () { label2: { while ( true ) { if ( Math.random() < 0.5 ) { break label2; } assert.equal(42, 42); } } } loopWithLabel(); rollup-3.29.4/test/function/samples/handle-missing-export-source/000077500000000000000000000000001450520414700251175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handle-missing-export-source/_config.js000066400000000000000000000006211450520414700270600ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not fail if a pre-generated AST is omitting the source property of an unused named export (#3210)', options: { plugins: { transform(code, id) { if (id.endsWith('foo.js')) { const ast = this.parse(code); delete ast.body.find(node => node.type === 'ExportNamedDeclaration').source; return { code, ast }; } } } } }); rollup-3.29.4/test/function/samples/handle-missing-export-source/foo.js000066400000000000000000000000321450520414700262330ustar00rootroot00000000000000export const unused = 42; rollup-3.29.4/test/function/samples/handle-missing-export-source/main.js000066400000000000000000000000531450520414700263770ustar00rootroot00000000000000import './foo.js'; export const foo = 42; rollup-3.29.4/test/function/samples/handle-object-rest-spread-patterns/000077500000000000000000000000001450520414700261645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handle-object-rest-spread-patterns/_config.js000066400000000000000000000001571450520414700301310ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles properties created by an object rest spread operator' }); rollup-3.29.4/test/function/samples/handle-object-rest-spread-patterns/main.js000066400000000000000000000005631450520414700274520ustar00rootroot00000000000000const obj1 = {foo: false}; const obj2 = {foo: false}; const {a, ...b} = {a: obj1, c: obj2 }; if (a.foo) { throw new Error('"a" was not properly declared'); } a.foo = true; if (!obj1.foo) { throw new Error('"a" was not tracked'); } if (b.c.foo) { throw new Error('"b.c" was not tracked'); } b.c.foo = true; if (!obj2.foo) { throw new Error('"b" was not tracked'); } rollup-3.29.4/test/function/samples/handle-object-rest-spread-properties/000077500000000000000000000000001450520414700265205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handle-object-rest-spread-properties/_config.js000066400000000000000000000001571450520414700304650ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles properties created by an object rest spread operator' }); rollup-3.29.4/test/function/samples/handle-object-rest-spread-properties/main.js000066400000000000000000000002021450520414700277740ustar00rootroot00000000000000const a = { result: true }; const b = { ...a }; if (!b.result) { throw new Error('Spread properties were not recognized'); } rollup-3.29.4/test/function/samples/handle-object-rest-spread-reassigments/000077500000000000000000000000001450520414700270305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handle-object-rest-spread-reassigments/_config.js000066400000000000000000000001571450520414700307750ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles properties created by an object rest spread operator' }); rollup-3.29.4/test/function/samples/handle-object-rest-spread-reassigments/main.js000066400000000000000000000004341450520414700303130ustar00rootroot00000000000000const obj1 = { foo: false, bar: { baz: false } }; const obj2 = { ...obj1 }; obj2.foo = true; if (obj1.foo) { throw new Error('obj1.foo was wrongly reassigned'); } obj2.bar.baz = true; if (!obj1.bar.baz) { throw new Error('reassigment of obj1.bar.baz was not tracked'); } rollup-3.29.4/test/function/samples/handle-statically-resolvable-if-statements/000077500000000000000000000000001450520414700277175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handle-statically-resolvable-if-statements/_config.js000066400000000000000000000003271450520414700316630ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles statically resolvable "if" statements (#2134)', context: { value: 1 }, exports({ x }) { assert.equal(x, 1); } }); rollup-3.29.4/test/function/samples/handle-statically-resolvable-if-statements/main.js000066400000000000000000000001201450520414700311720ustar00rootroot00000000000000export let x = 0; if (value === 1) { x = 1; } else if (12 !== 12) { x = 2; } rollup-3.29.4/test/function/samples/handles-double-declarations/000077500000000000000000000000001450520414700247345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handles-double-declarations/_config.js000066400000000000000000000001751450520414700267010ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not fail for double declarations with initializers from other modules' }); rollup-3.29.4/test/function/samples/handles-double-declarations/foobar.js000066400000000000000000000001001450520414700265310ustar00rootroot00000000000000export var foo = { foo: true }; export var bar = { bar: true }; rollup-3.29.4/test/function/samples/handles-double-declarations/main.js000066400000000000000000000001341450520414700262140ustar00rootroot00000000000000import { foo, bar } from './foobar.js'; var baz = foo; var baz = bar; assert.ok(baz.bar); rollup-3.29.4/test/function/samples/handles-empty-string-sourcemap-mappings/000077500000000000000000000000001450520414700272665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handles-empty-string-sourcemap-mappings/_config.js000066400000000000000000000004721450520414700312330ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles transforms that return sourcemap with empty mappings', options: { plugins: [ { transform(code) { return { code, map: { mappings: '' } }; } } ], // ensure source maps are generated output: { sourcemap: true } } }); rollup-3.29.4/test/function/samples/handles-empty-string-sourcemap-mappings/main.js000066400000000000000000000000231450520414700305430ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/handles-stringified-sourcemaps/000077500000000000000000000000001450520414700255025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/handles-stringified-sourcemaps/_config.js000066400000000000000000000006061450520414700274460ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles transforms that return stringified source maps (#377)', options: { plugins: [ { transform(code) { return { code, // just stringify an otherwise acceptable source map map: JSON.stringify({ mappings: '' }) }; } } ], // ensure source maps are generated output: { sourcemap: true } } }); rollup-3.29.4/test/function/samples/handles-stringified-sourcemaps/main.js000066400000000000000000000000231450520414700267570ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/has-default-export/000077500000000000000000000000001450520414700231145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/has-default-export/_config.js000066400000000000000000000024531450520414700250620ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'reports if a module has a default export', options: { plugins: [ { async buildStart() { const ID_MAIN = path.join(__dirname, 'main.js'); const loadMain = this.load({ id: ID_MAIN }); assert.strictEqual(this.getModuleInfo(ID_MAIN).hasDefaultExport, null); assert.strictEqual((await loadMain).hasDefaultExport, false); assert.strictEqual( (await this.load({ id: path.join(__dirname, 'direct.js') })).hasDefaultExport, true, 'direct' ); assert.strictEqual( (await this.load({ id: path.join(__dirname, 'indirect.js') })).hasDefaultExport, true, 'indirect' ); assert.strictEqual( (await this.load({ id: path.join(__dirname, 'reexport1.js') })).hasDefaultExport, true, 'reexport' ); assert.strictEqual( (await this.load({ id: path.join(__dirname, 'reexport2.js') })).hasDefaultExport, true, 'renamed reexport' ); }, load(id) { assert.strictEqual(this.getModuleInfo(id).hasDefaultExport, null, `load ${id}`); }, transform(code, id) { assert.strictEqual(this.getModuleInfo(id).hasDefaultExport, null, `transform ${id}`); } } ] } }); rollup-3.29.4/test/function/samples/has-default-export/direct.js000066400000000000000000000000311450520414700247160ustar00rootroot00000000000000export default 'direct'; rollup-3.29.4/test/function/samples/has-default-export/indirect.js000066400000000000000000000000751450520414700252550ustar00rootroot00000000000000const indirect = 'indirect'; export { indirect as default }; rollup-3.29.4/test/function/samples/has-default-export/main.js000066400000000000000000000004711450520414700244000ustar00rootroot00000000000000import direct from './direct.js'; import indirect from './indirect.js'; import reexport1 from './reexport1.js'; import reexport2 from './reexport2.js'; assert.strictEqual(direct, 'direct'); assert.strictEqual(indirect, 'indirect'); assert.strictEqual(reexport1, 'default'); assert.strictEqual(reexport2, 'foo'); rollup-3.29.4/test/function/samples/has-default-export/other.js000066400000000000000000000000641450520414700245730ustar00rootroot00000000000000export default 'default'; export const foo = 'foo'; rollup-3.29.4/test/function/samples/has-default-export/reexport1.js000066400000000000000000000000461450520414700254030ustar00rootroot00000000000000export { default } from './other.js'; rollup-3.29.4/test/function/samples/has-default-export/reexport2.js000066400000000000000000000000551450520414700254040ustar00rootroot00000000000000export { foo as default } from './other.js'; rollup-3.29.4/test/function/samples/has-modules-array/000077500000000000000000000000001450520414700227355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/has-modules-array/_config.js000066400000000000000000000007121450520414700246770ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'user-facing bundle has modules array', bundle(bundle) { assert.ok(bundle.cache.modules); assert.equal(bundle.cache.modules.length, 2); assert.equal(path.relative(bundle.cache.modules[0].id, path.join(__dirname, 'foo.js')), ''); assert.equal(path.relative(bundle.cache.modules[1].id, path.join(__dirname, 'main.js')), ''); } }); rollup-3.29.4/test/function/samples/has-modules-array/foo.js000066400000000000000000000000231450520414700240510ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/has-modules-array/main.js000066400000000000000000000000621450520414700242150ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo, 42 ); rollup-3.29.4/test/function/samples/hashing/000077500000000000000000000000001450520414700210215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/hashing/length-at-non-hash/000077500000000000000000000000001450520414700244155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/hashing/length-at-non-hash/_config.js000066400000000000000000000004731450520414700263630ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when configuring a length for placeholder other than "hash"', options: { output: { chunkFileNames: '[name:3].js' } }, generateError: { code: 'VALIDATION_ERROR', message: '"[name:3]" is not a valid placeholder in the "output.chunkFileNames" pattern.' } }); rollup-3.29.4/test/function/samples/hashing/length-at-non-hash/foo.js000066400000000000000000000000531450520414700255340ustar00rootroot00000000000000throw new Error('should not be executed'); rollup-3.29.4/test/function/samples/hashing/length-at-non-hash/main.js000066400000000000000000000000241450520414700256730ustar00rootroot00000000000000import('./foo.js'); rollup-3.29.4/test/function/samples/hashing/maximum-hash-size/000077500000000000000000000000001450520414700243675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/hashing/maximum-hash-size/_config.js000066400000000000000000000004771450520414700263410ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when the maximum hash size is exceeded', options: { output: { chunkFileNames: '[hash:65].js' } }, generateError: { code: 'VALIDATION_ERROR', message: 'Hashes cannot be longer than 64 characters, received 65. Check the "output.chunkFileNames" option.' } }); rollup-3.29.4/test/function/samples/hashing/maximum-hash-size/foo.js000066400000000000000000000000531450520414700255060ustar00rootroot00000000000000throw new Error('should not be executed'); rollup-3.29.4/test/function/samples/hashing/maximum-hash-size/main.js000066400000000000000000000000241450520414700256450ustar00rootroot00000000000000import('./foo.js'); rollup-3.29.4/test/function/samples/hashing/minimum-hash-size/000077500000000000000000000000001450520414700243655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/hashing/minimum-hash-size/_config.js000066400000000000000000000005601450520414700263300ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when the maximum hash size is exceeded', options: { output: { chunkFileNames: '[hash:3].js' } }, generateError: { code: 'VALIDATION_ERROR', message: 'To generate hashes for this number of chunks (currently 1), you need a minimum hash size of 6, received 3. Check the "output.chunkFileNames" option.' } }); rollup-3.29.4/test/function/samples/hashing/minimum-hash-size/foo.js000066400000000000000000000000531450520414700255040ustar00rootroot00000000000000throw new Error('should not be executed'); rollup-3.29.4/test/function/samples/hashing/minimum-hash-size/main.js000066400000000000000000000000241450520414700256430ustar00rootroot00000000000000import('./foo.js'); rollup-3.29.4/test/function/samples/hidden-directories/000077500000000000000000000000001450520414700231455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/hidden-directories/.foo/000077500000000000000000000000001450520414700240065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/hidden-directories/.foo/bar.js000066400000000000000000000000231450520414700251030ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/hidden-directories/_config.js000066400000000000000000000001551450520414700251100ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows imports from directories with leading "." character' }); rollup-3.29.4/test/function/samples/hidden-directories/main.js000066400000000000000000000000701450520414700244240ustar00rootroot00000000000000import bar from './.foo/bar'; assert.equal( bar, 42 ); rollup-3.29.4/test/function/samples/hoisted-variable-if-else/000077500000000000000000000000001450520414700241445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/hoisted-variable-if-else/_config.js000066400000000000000000000005701450520414700261100ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles hoisted variables in chained if statements', exports(exports) { exports.test(true); assert.strictEqual(exports.result, 'first'); exports.test(false); assert.strictEqual(exports.result, 'third'); exports.test('loop'); assert.strictEqual(exports.result, 'fourth'); } }); rollup-3.29.4/test/function/samples/hoisted-variable-if-else/main.js000066400000000000000000000004631450520414700254310ustar00rootroot00000000000000export let result; export function test(value) { if (value) { v = 'first'; result = v; } else if (false) { var v, w; result = 'second'; } else { v = 'third'; result = v; } for (var foo of value === 'loop' ? ['foo'] : []) if (false) var x; else { x = 'fourth'; result = x; } } rollup-3.29.4/test/function/samples/identifiers-in-template-literals/000077500000000000000000000000001450520414700257375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/identifiers-in-template-literals/_config.js000066400000000000000000000001521450520414700276770ustar00rootroot00000000000000module.exports = defineTest({ description: 'identifiers in template literals are rendered correctly' }); rollup-3.29.4/test/function/samples/identifiers-in-template-literals/a.js000066400000000000000000000001271450520414700265150ustar00rootroot00000000000000function x ( keypath ) { return 'a'; } export default function a () { return x(); } rollup-3.29.4/test/function/samples/identifiers-in-template-literals/b.js000066400000000000000000000001311450520414700265110ustar00rootroot00000000000000function x ( name ) { return 'b'; } export default function b () { return `${x()}`; } rollup-3.29.4/test/function/samples/identifiers-in-template-literals/main.js000066400000000000000000000001451450520414700272210ustar00rootroot00000000000000import a from './a.js'; import b from './b.js'; assert.equal( a(), 'a' ); assert.equal( b(), 'b' ); rollup-3.29.4/test/function/samples/if-statement-insert-whitespace/000077500000000000000000000000001450520414700254345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/if-statement-insert-whitespace/_config.js000066400000000000000000000003211450520414700273720ustar00rootroot00000000000000module.exports = defineTest({ description: 'inserts necessary white-space when simplifying if-statements (#3419)', options: { external: 'external' }, context: { require() { return false; } } }); rollup-3.29.4/test/function/samples/if-statement-insert-whitespace/main.js000066400000000000000000000002531450520414700267160ustar00rootroot00000000000000let works = false; const makeItWork = () => works = true; import value from 'external'; if (value) {} else"production"!=="local"?makeItWork():void 0; assert.ok(works); rollup-3.29.4/test/function/samples/if-statement-with-assignment/000077500000000000000000000000001450520414700251175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/if-statement-with-assignment/_config.js000066400000000000000000000001431450520414700270570ustar00rootroot00000000000000module.exports = defineTest({ description: 'update assignments to names are preserved (#930)' }); rollup-3.29.4/test/function/samples/if-statement-with-assignment/main.js000066400000000000000000000001621450520414700264000ustar00rootroot00000000000000var result = 0; if ( Math.random() <= 1 ) { if ( Math.random() <= 1 ) result += 1; } assert.equal( result, 1 ); rollup-3.29.4/test/function/samples/if-statement-with-false-condition/000077500000000000000000000000001450520414700260255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/if-statement-with-false-condition/_config.js000066400000000000000000000001601450520414700277640ustar00rootroot00000000000000module.exports = defineTest({ description: 'if statements with false condition do not break render (#973)' }); rollup-3.29.4/test/function/samples/if-statement-with-false-condition/main.js000066400000000000000000000010711450520414700273060ustar00rootroot00000000000000export function whileIf(x) { while (x) if (false) // replaced with {} x = 0; } export function whileBlockIf(x) { while (x) { if (false) // removed x = 0; } } export function ifWhile(x) { if (x) while (false) // not optimized x = 0; } export function ifFalseElse(x) { if (false) { // removed } else { // kept } } export function elseIfFalse(x) { if (x) { // kept } else if (false) { // replaced with {} } } export function elseIfFalseElse(x) { if (x) { // kept } else if (false) { // removed } else { // kept } } rollup-3.29.4/test/function/samples/if-statement-with-update/000077500000000000000000000000001450520414700242315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/if-statement-with-update/_config.js000066400000000000000000000001301450520414700261650ustar00rootroot00000000000000module.exports = defineTest({ description: 'updates to names are preserved (#930)' }); rollup-3.29.4/test/function/samples/if-statement-with-update/main.js000066400000000000000000000001571450520414700255160ustar00rootroot00000000000000var result = 0; if ( Math.random() <= 1 ) { if ( Math.random() <= 1 ) ++result; } assert.equal( result, 1 ); rollup-3.29.4/test/function/samples/iife-code-splitting/000077500000000000000000000000001450520414700232375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/iife-code-splitting/_config.js000066400000000000000000000006271450520414700252060ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when generating multiple chunks for an IIFE build', options: { output: { format: 'iife' } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value "iife" for option "output.format" - UMD and IIFE output formats are not supported for code-splitting builds.', url: 'https://rollupjs.org/configuration-options/#output-format' } }); rollup-3.29.4/test/function/samples/iife-code-splitting/foo.js000066400000000000000000000000231450520414700243530ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/iife-code-splitting/main.js000066400000000000000000000000511450520414700245150ustar00rootroot00000000000000export default () => import('./foo.js'); rollup-3.29.4/test/function/samples/iife-comments/000077500000000000000000000000001450520414700221375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/iife-comments/_config.js000066400000000000000000000002601450520414700240770ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not wrongly append comments', exports(exports) { assert.equal(exports, 42); } }); rollup-3.29.4/test/function/samples/iife-comments/main.js000066400000000000000000000002521450520414700234200ustar00rootroot00000000000000function noop () {} (function () { noop( '1' ) // line comment after statement /* BLOCK COMMENT */ noop( '2' ); // standalone comment })(); export default 42; rollup-3.29.4/test/function/samples/implicit-dependencies/000077500000000000000000000000001450520414700236365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/000077500000000000000000000000001450520414700325615ustar00rootroot00000000000000_config.js000066400000000000000000000015001450520414700344400ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effectsconst path = require('node:path'); module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk is fully tree-shaken', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: ['dependant'] }); } } }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', message: 'Module "dependant.js" that should be implicitly loaded before "dep.js" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.', watchFiles: [ path.join(__dirname, 'dep.js'), path.join(__dirname, 'dependant.js'), path.join(__dirname, 'main.js') ] } }); rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/dep.js000066400000000000000000000000261450520414700336650ustar00rootroot00000000000000export default 'dep'; dependant.js000066400000000000000000000000651450520414700350030ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effectsconst unused = 'unused'; export default 'dependant'; main.js000066400000000000000000000000551450520414700337640ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effectsimport './dependant'; export default 'main'; rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/000077500000000000000000000000001450520414700331155ustar00rootroot00000000000000_config.js000066400000000000000000000020311450520414700347740ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedconst path = require('node:path'); module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk is only linked to the module graph via a tree-shaken dynamic import', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep1.js', implicitlyLoadedAfterOneOf: ['dependant'] }); this.emitFile({ type: 'chunk', id: 'dep2.js', implicitlyLoadedAfterOneOf: ['dependant'] }); } } }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', message: 'Module "dependant.js" that should be implicitly loaded before "dep1.js" and "dep2.js" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.', watchFiles: [ path.join(__dirname, 'dep1.js'), path.join(__dirname, 'dep2.js'), path.join(__dirname, 'dependant.js'), path.join(__dirname, 'main.js') ] } }); dep1.js000066400000000000000000000000261450520414700342230ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedexport default 'dep'; dep2.js000066400000000000000000000000261450520414700342240ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedexport default 'dep'; dependant.js000066400000000000000000000000341450520414700353330ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedexport default 'dependant'; main.js000066400000000000000000000001021450520414700343110ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedexport default 'main'; if (false) { import('./dependant.js'); } rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/000077500000000000000000000000001450520414700310435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js000066400000000000000000000022271450520414700330100ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk is not part of the module graph', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep1.js', implicitlyLoadedAfterOneOf: ['dependant'] }); this.emitFile({ type: 'chunk', id: 'dep2.js', implicitlyLoadedAfterOneOf: ['dependant'] }); this.emitFile({ type: 'chunk', id: 'dep3.js', implicitlyLoadedAfterOneOf: ['dependant'] }); } } }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', message: 'Module "dependant.js" that should be implicitly loaded before "dep1.js", "dep2.js" and "dep3.js" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.', watchFiles: [ path.join(__dirname, 'dep1.js'), path.join(__dirname, 'dep2.js'), path.join(__dirname, 'dep3.js'), path.join(__dirname, 'dependant.js'), path.join(__dirname, 'main.js') ] } }); rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/dep1.js000066400000000000000000000000261450520414700322300ustar00rootroot00000000000000export default 'dep'; rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/dep2.js000066400000000000000000000000261450520414700322310ustar00rootroot00000000000000export default 'dep'; rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/dep3.js000066400000000000000000000000261450520414700322320ustar00rootroot00000000000000export default 'dep'; rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/dependant.js000066400000000000000000000000341450520414700333400ustar00rootroot00000000000000export default 'dependant'; rollup-3.29.4/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/main.js000066400000000000000000000000271450520414700323240ustar00rootroot00000000000000export default 'main'; rollup-3.29.4/test/function/samples/implicit-dependencies/external-dependant/000077500000000000000000000000001450520414700274205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/external-dependant/_config.js000066400000000000000000000011351450520414700313620ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk does not exist', options: { plugins: { name: 'test-plugin', buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: ['does-not-exist'] }); } } }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', message: 'Module "does-not-exist" that should be implicitly loaded before "dep.js" could not be resolved.', watchFiles: [path.join(__dirname, 'dep.js'), path.join(__dirname, 'main.js')] } }); rollup-3.29.4/test/function/samples/implicit-dependencies/external-dependant/dep.js000066400000000000000000000000261450520414700305240ustar00rootroot00000000000000export default 'dep'; rollup-3.29.4/test/function/samples/implicit-dependencies/external-dependant/main.js000066400000000000000000000000271450520414700307010ustar00rootroot00000000000000export default 'main'; rollup-3.29.4/test/function/samples/implicit-dependencies/missing-dependant/000077500000000000000000000000001450520414700272475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/implicit-dependencies/missing-dependant/_config.js000066400000000000000000000012321450520414700312070ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'throws when a module that is loaded before an emitted chunk is external', options: { plugins: { name: 'test-plugin', resolveId(id) { if (id === 'external') { return false; } }, buildStart() { this.emitFile({ type: 'chunk', id: 'dep.js', implicitlyLoadedAfterOneOf: ['external'] }); } } }, error: { code: 'MISSING_IMPLICIT_DEPENDANT', message: 'Module "external" that should be implicitly loaded before "dep.js" cannot be external.', watchFiles: [path.join(__dirname, 'dep.js'), path.join(__dirname, 'main.js')] } }); rollup-3.29.4/test/function/samples/implicit-dependencies/missing-dependant/dep.js000066400000000000000000000000261450520414700303530ustar00rootroot00000000000000export default 'dep'; rollup-3.29.4/test/function/samples/implicit-dependencies/missing-dependant/main.js000066400000000000000000000000271450520414700305300ustar00rootroot00000000000000export default 'main'; rollup-3.29.4/test/function/samples/import-as/000077500000000000000000000000001450520414700213135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-as/_config.js000066400000000000000000000002751450520414700232610ustar00rootroot00000000000000module.exports = defineTest({ description: 'renames named and default imports' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/import-as rollup-3.29.4/test/function/samples/import-as/foo.js000066400000000000000000000001301450520414700224260ustar00rootroot00000000000000/* jshint esnext:true */ export var a = 'a'; export var b = 'b'; export default 'DEF'; rollup-3.29.4/test/function/samples/import-as/main.js000066400000000000000000000001771450520414700226020ustar00rootroot00000000000000import { a as b, b as a, default as def } from './foo'; assert.equal(b, 'a'); assert.equal(a, 'b'); assert.equal(def, 'DEF'); rollup-3.29.4/test/function/samples/import-assertions/000077500000000000000000000000001450520414700231025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-assertions/plugin-assertions-this-resolve/000077500000000000000000000000001450520414700312125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-assertions/plugin-assertions-this-resolve/_config.js000066400000000000000000000021421450520414700331530ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows plugins to provide assertions for this.resolve', options: { plugins: [ { name: 'first', async resolveId() { assert.deepStrictEqual( await this.resolve('external', undefined, { skipSelf: true, assertions: { a: 'c', b: 'd' } }), { assertions: { a: 'changed', b: 'changed' }, external: true, id: 'external', meta: {}, moduleSideEffects: true, resolvedBy: 'third', syntheticNamedExports: false } ); } }, { name: 'second', async resolveId(source, importer, { assertions }) { if (source === 'external') { return this.resolve(source, importer, { assertions, skipSelf: true }); } } }, { name: 'third', async resolveId(source, importer, { assertions }) { if (source === 'external') { return { id: source, external: true, assertions: Object.fromEntries(Object.keys(assertions).map(key => [key, 'changed'])) }; } } } ] } }); rollup-3.29.4/test/function/samples/import-assertions/plugin-assertions-this-resolve/main.js000066400000000000000000000000211450520414700324650ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/import-assertions/warn-assertion-conflicts/000077500000000000000000000000001450520414700300405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-assertions/warn-assertion-conflicts/_config.js000066400000000000000000000044271450520414700320110ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'warns for conflicting import assertions', options: { external: id => id.startsWith('external') }, warnings: [ { code: 'INCONSISTENT_IMPORT_ASSERTIONS', frame: ` 1: import './other.js'; 2: import 'external' assert { type: 'foo' }; 3: import 'external' assert { type: 'bar' }; ^ 4: import 'external'; 5: import('external', { assert: { type: 'baz' } });`, id: ID_MAIN, loc: { column: 0, file: ID_MAIN, line: 3 }, message: 'Module "main.js" tried to import "external" with "type": "bar" assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.', pos: 63 }, { code: 'INCONSISTENT_IMPORT_ASSERTIONS', frame: ` 2: import 'external' assert { type: 'foo' }; 3: import 'external' assert { type: 'bar' }; 4: import 'external'; ^ 5: import('external', { assert: { type: 'baz' } }); 6: import './dep.js' assert { type: 'foo' };`, id: ID_MAIN, loc: { column: 0, file: ID_MAIN, line: 4 }, message: 'Module "main.js" tried to import "external" with no assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.', pos: 105 }, { code: 'INCONSISTENT_IMPORT_ASSERTIONS', message: 'Module "main.js" tried to import "external" with "type": "baz" assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.' }, { code: 'INCONSISTENT_IMPORT_ASSERTIONS', message: 'Module "other.js" tried to import "external" with "type": "quuz" assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.' }, { code: 'INCONSISTENT_IMPORT_ASSERTIONS', message: 'Module "other.js" tried to import "dep.js" with "type": "bar" assertions, but it was already imported elsewhere with "type": "foo" assertions. Please ensure that import assertions for the same module are always consistent.' } ] }); rollup-3.29.4/test/function/samples/import-assertions/warn-assertion-conflicts/dep.js000066400000000000000000000000001450520414700311340ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-assertions/warn-assertion-conflicts/main.js000066400000000000000000000003271450520414700313240ustar00rootroot00000000000000import './other.js'; import 'external' assert { type: 'foo' }; import 'external' assert { type: 'bar' }; import 'external'; import('external', { assert: { type: 'baz' } }); import './dep.js' assert { type: 'foo' }; rollup-3.29.4/test/function/samples/import-assertions/warn-assertion-conflicts/other.js000066400000000000000000000001251450520414700315150ustar00rootroot00000000000000import 'external' assert { type: 'quuz' }; import './dep.js' assert { type: 'bar' }; rollup-3.29.4/test/function/samples/import-binding/000077500000000000000000000000001450520414700223225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-binding/_config.js000066400000000000000000000001011450520414700242540ustar00rootroot00000000000000module.exports = defineTest({ description: 'import binding' }); rollup-3.29.4/test/function/samples/import-binding/foo.js000066400000000000000000000000351450520414700234410ustar00rootroot00000000000000var foo = 42; export { foo };rollup-3.29.4/test/function/samples/import-binding/main.js000066400000000000000000000000651450520414700236050ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo, 42 );rollup-3.29.4/test/function/samples/import-chain-as/000077500000000000000000000000001450520414700223735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-chain-as/_config.js000066400000000000000000000001161450520414700243330ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports as- chained exports' }); rollup-3.29.4/test/function/samples/import-chain-as/first.js000066400000000000000000000000271450520414700240570ustar00rootroot00000000000000export var value = 42; rollup-3.29.4/test/function/samples/import-chain-as/main.js000066400000000000000000000002021450520414700236470ustar00rootroot00000000000000import * as second from './second'; assert.equal( second.first.value, 42 ); assert.deepEqual( second, { first: { value: 42 } }); rollup-3.29.4/test/function/samples/import-chain-as/second.js000066400000000000000000000000641450520414700242040ustar00rootroot00000000000000import * as first from './first'; export { first }; rollup-3.29.4/test/function/samples/import-chain/000077500000000000000000000000001450520414700217725ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-chain/_config.js000066400000000000000000000002661450520414700237400ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports chained exports' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/import-chain rollup-3.29.4/test/function/samples/import-chain/first.js000066400000000000000000000000271450520414700234560ustar00rootroot00000000000000export var value = 42; rollup-3.29.4/test/function/samples/import-chain/main.js000066400000000000000000000000731450520414700232540ustar00rootroot00000000000000import { value } from './second'; assert.equal(value, 42); rollup-3.29.4/test/function/samples/import-chain/second.js000066400000000000000000000000631450520414700236020ustar00rootroot00000000000000import { value } from './first'; export { value }; rollup-3.29.4/test/function/samples/import-default-and-named-function/000077500000000000000000000000001450520414700260015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-default-and-named-function/_config.js000066400000000000000000000003451450520414700277450ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports default and named exports in same declaration' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-default-named-function rollup-3.29.4/test/function/samples/import-default-and-named-function/foo.js000066400000000000000000000001351450520414700271210ustar00rootroot00000000000000export default function foo() { return 1; } export function callsFoo() { return foo(); }rollup-3.29.4/test/function/samples/import-default-and-named-function/main.js000066400000000000000000000001511450520414700272600ustar00rootroot00000000000000import foo, { callsFoo } from './foo'; assert.strictEqual(foo(), 1); assert.strictEqual(callsFoo(), 1); rollup-3.29.4/test/function/samples/import-default-as-named/000077500000000000000000000000001450520414700240175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-default-as-named/_config.js000066400000000000000000000003141450520414700257570ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a default export by a name' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-default-function rollup-3.29.4/test/function/samples/import-default-as-named/foo.js000066400000000000000000000000531450520414700251360ustar00rootroot00000000000000export default function () { return 1; } rollup-3.29.4/test/function/samples/import-default-as-named/main.js000066400000000000000000000001631450520414700253010ustar00rootroot00000000000000import fn1 from './foo'; import { default as fn2 } from './foo'; assert.equal(fn1(), 1); assert.equal(fn2(), 1); rollup-3.29.4/test/function/samples/import-default-as-other/000077500000000000000000000000001450520414700240545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-default-as-other/_config.js000066400000000000000000000001331450520414700260130ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a default import by another name' }); rollup-3.29.4/test/function/samples/import-default-as-other/foo.js000066400000000000000000000000561450520414700251760ustar00rootroot00000000000000export default function foo () { return 42; }rollup-3.29.4/test/function/samples/import-default-as-other/main.js000066400000000000000000000000631450520414700253350ustar00rootroot00000000000000import bar from './foo'; assert.equal( bar(), 42 );rollup-3.29.4/test/function/samples/import-default-class/000077500000000000000000000000001450520414700234375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-default-class/_config.js000066400000000000000000000002761450520414700254060ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a default class' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-default-class rollup-3.29.4/test/function/samples/import-default-class/main.js000066400000000000000000000001621450520414700247200ustar00rootroot00000000000000import Point from './point'; assert.strictEqual(new Point(1, 2).x, 1); assert.strictEqual(new Point(1, 2).y, 2); rollup-3.29.4/test/function/samples/import-default-class/point.js000066400000000000000000000001311450520414700251210ustar00rootroot00000000000000export default class Point { constructor(x, y) { this.x = x; this.y = y; } } rollup-3.29.4/test/function/samples/import-default-expression/000077500000000000000000000000001450520414700245315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-default-expression/_config.js000066400000000000000000000001171450520414700264720ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a default expression' }); rollup-3.29.4/test/function/samples/import-default-expression/foo.js000066400000000000000000000000261450520414700256500ustar00rootroot00000000000000export default 40 + 2;rollup-3.29.4/test/function/samples/import-default-expression/main.js000066400000000000000000000000611450520414700260100ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo, 42 );rollup-3.29.4/test/function/samples/import-default-from-external/000077500000000000000000000000001450520414700251155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-default-from-external/_config.js000066400000000000000000000001741450520414700270610ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports default from external module', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/import-default-from-external/main.js000066400000000000000000000003221450520414700263740ustar00rootroot00000000000000// would be a namespace import in real life, obvs import path from 'path'; var path1 = 'foo/bar/baz'; var path2 = 'foo/baz/bar'; assert.equal( path.relative( path1, path2 ), path.normalize('../../baz/bar') );rollup-3.29.4/test/function/samples/import-default-function/000077500000000000000000000000001450520414700241575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-default-function/_config.js000066400000000000000000000001151450520414700261160ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a default function' }); rollup-3.29.4/test/function/samples/import-default-function/foo.js000066400000000000000000000000561450520414700253010ustar00rootroot00000000000000export default function foo () { return 42; }rollup-3.29.4/test/function/samples/import-default-function/main.js000066400000000000000000000000631450520414700254400ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 42 );rollup-3.29.4/test/function/samples/import-dependency-in-other-module/000077500000000000000000000000001450520414700260345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-dependency-in-other-module/_config.js000066400000000000000000000001361450520414700277760ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a dependency from a separate module' }); rollup-3.29.4/test/function/samples/import-dependency-in-other-module/bar.js000066400000000000000000000000221450520414700271300ustar00rootroot00000000000000export default 40;rollup-3.29.4/test/function/samples/import-dependency-in-other-module/foo.js000066400000000000000000000001051450520414700271510ustar00rootroot00000000000000import bar from './bar'; export function foo () { return bar + 2; }rollup-3.29.4/test/function/samples/import-dependency-in-other-module/main.js000066400000000000000000000000671450520414700273210ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo(), 42 );rollup-3.29.4/test/function/samples/import-dependency-in-same-module/000077500000000000000000000000001450520414700256405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-dependency-in-same-module/_config.js000066400000000000000000000001341450520414700276000ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a dependency from the same module' }); rollup-3.29.4/test/function/samples/import-dependency-in-same-module/foo.js000066400000000000000000000000721450520414700267600ustar00rootroot00000000000000var bar = 40; export function foo () { return bar + 2; }rollup-3.29.4/test/function/samples/import-dependency-in-same-module/main.js000066400000000000000000000000671450520414700271250ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo(), 42 );rollup-3.29.4/test/function/samples/import-empty-from-external/000077500000000000000000000000001450520414700246275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-empty-from-external/_config.js000066400000000000000000000005361450520414700265750ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports external module for side effects', context: { // override require here, making "foo" appear as a global module require(name) { if (name === 'foo') { // @ts-expect-error test file return require('./foo'); } return require(name); } }, options: { external: ['foo'] } }); rollup-3.29.4/test/function/samples/import-empty-from-external/foo.js000066400000000000000000000000241450520414700257440ustar00rootroot00000000000000global.answer = 42; rollup-3.29.4/test/function/samples/import-empty-from-external/main.js000066400000000000000000000000621450520414700261070ustar00rootroot00000000000000import 'foo'; assert.equal( global.answer, 42 ); rollup-3.29.4/test/function/samples/import-meta-url-b/000077500000000000000000000000001450520414700226555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-meta-url-b/_config.js000066400000000000000000000004741450520414700246240ustar00rootroot00000000000000const assert = require('node:assert'); const source = 'example.com/main.js'; module.exports = defineTest({ description: 'Access document.currentScript at the top level', context: { document: { currentScript: { src: source } } }, exports(exports) { assert.strictEqual(exports(), source); } }); rollup-3.29.4/test/function/samples/import-meta-url-b/main.js000066400000000000000000000002341450520414700241360ustar00rootroot00000000000000export default function getUrl() { document.currentScript = { src: '' }; const url = import.meta.url; assert.ok(import.meta.abc || true); return url; } rollup-3.29.4/test/function/samples/import-meta-url/000077500000000000000000000000001450520414700224365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-meta-url/_config.js000066400000000000000000000005511450520414700244010ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const URL = require('node:url').URL; module.exports = defineTest({ description: 'resolves import.meta.url', context: { __filename: path.join(__dirname, 'main.js') }, exports(exports) { assert.strictEqual(exports, new URL('file:' + path.join(__dirname, 'main.js')).href); } }); rollup-3.29.4/test/function/samples/import-meta-url/main.js000066400000000000000000000000401450520414700237120ustar00rootroot00000000000000export default import.meta.url; rollup-3.29.4/test/function/samples/import-named-class/000077500000000000000000000000001450520414700230775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-named-class/_config.js000066400000000000000000000002721450520414700250420ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a named class' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-named-class rollup-3.29.4/test/function/samples/import-named-class/foo.js000066400000000000000000000000351450520414700242160ustar00rootroot00000000000000class Foo {} export { Foo }; rollup-3.29.4/test/function/samples/import-named-class/main.js000066400000000000000000000001161450520414700243570ustar00rootroot00000000000000import { Foo } from './foo'; assert.strictEqual(new Foo().constructor, Foo); rollup-3.29.4/test/function/samples/import-named-from-external/000077500000000000000000000000001450520414700245555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-named-from-external/_config.js000066400000000000000000000001751450520414700265220ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports names from an external module', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/import-named-from-external/main.js000066400000000000000000000002471450520414700260420ustar00rootroot00000000000000import { relative, normalize } from 'path'; var path = 'foo/bar/baz'; var path2 = 'foo/baz/bar'; assert.equal( relative( path, path2 ), normalize('../../baz/bar') );rollup-3.29.4/test/function/samples/import-named-function-as-other/000077500000000000000000000000001450520414700253375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-named-function-as-other/_config.js000066400000000000000000000001331450520414700272760ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a named function by another name' }); rollup-3.29.4/test/function/samples/import-named-function-as-other/foo.js000066400000000000000000000000461450520414700264600ustar00rootroot00000000000000export function foo () { return 42; }rollup-3.29.4/test/function/samples/import-named-function-as-other/main.js000066400000000000000000000000761450520414700266240ustar00rootroot00000000000000import { foo as bar } from './foo'; assert.equal( bar(), 42 );rollup-3.29.4/test/function/samples/import-named-function/000077500000000000000000000000001450520414700236175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-named-function/_config.js000066400000000000000000000001131450520414700255540ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a named function' }); rollup-3.29.4/test/function/samples/import-named-function/foo.js000066400000000000000000000000461450520414700247400ustar00rootroot00000000000000export function foo () { return 42; }rollup-3.29.4/test/function/samples/import-named-function/main.js000066400000000000000000000000671450520414700251040ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo(), 42 );rollup-3.29.4/test/function/samples/import-nameless-class-expression/000077500000000000000000000000001450520414700260175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-nameless-class-expression/_config.js000066400000000000000000000003151450520414700277600ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a nameless class expression' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-class-expression rollup-3.29.4/test/function/samples/import-nameless-class-expression/foo.js000066400000000000000000000000311450520414700271320ustar00rootroot00000000000000export default class {}; rollup-3.29.4/test/function/samples/import-nameless-class-expression/main.js000066400000000000000000000001121450520414700272730ustar00rootroot00000000000000import Foo from './foo'; assert.strictEqual(new Foo().constructor, Foo); rollup-3.29.4/test/function/samples/import-namespace-from-external-module-renamed/000077500000000000000000000000001450520414700303215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-namespace-from-external-module-renamed/_config.js000066400000000000000000000002221450520414700322570ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a namespace from an external module and renames it', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/import-namespace-from-external-module-renamed/main.js000066400000000000000000000002651450520414700316060ustar00rootroot00000000000000import * as node_path from 'path'; var path1 = 'foo/bar/baz'; var path2 = 'foo/baz/bar'; assert.equal( node_path.relative( path1, path2 ), node_path.normalize('../../baz/bar') ); rollup-3.29.4/test/function/samples/import-namespace-from-external-module/000077500000000000000000000000001450520414700267105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-namespace-from-external-module/_config.js000066400000000000000000000002031450520414700306450ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a namespace from an external module', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/import-namespace-from-external-module/main.js000066400000000000000000000002451450520414700301730ustar00rootroot00000000000000import * as path from 'path'; var path1 = 'foo/bar/baz'; var path2 = 'foo/baz/bar'; assert.equal( path.relative( path1, path2 ), path.normalize('../../baz/bar') );rollup-3.29.4/test/function/samples/import-namespace-from-internal-module-renamed/000077500000000000000000000000001450520414700303135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-namespace-from-internal-module-renamed/_config.js000066400000000000000000000001331450520414700322520ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly exports x as y inside a bundle' }); rollup-3.29.4/test/function/samples/import-namespace-from-internal-module-renamed/foo.js000066400000000000000000000000401450520414700314260ustar00rootroot00000000000000var x = 42; export { x as y }; rollup-3.29.4/test/function/samples/import-namespace-from-internal-module-renamed/main.js000066400000000000000000000000721450520414700315740ustar00rootroot00000000000000import * as foo from './foo'; assert.equal( foo.y, 42 ); rollup-3.29.4/test/function/samples/import-namespace-from-internal-module/000077500000000000000000000000001450520414700267025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-namespace-from-internal-module/_config.js000066400000000000000000000003101450520414700306360ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a namespace from an internal module' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/namespaces rollup-3.29.4/test/function/samples/import-namespace-from-internal-module/foo.js000066400000000000000000000000761450520414700300260ustar00rootroot00000000000000export var a = 'a'; export var b = 'b'; export default 'DEF'; rollup-3.29.4/test/function/samples/import-namespace-from-internal-module/main.js000066400000000000000000000003511450520414700301630ustar00rootroot00000000000000import * as foo from './foo'; assert.equal(foo['default'], 'DEF'); assert.equal(foo.b, 'b'); assert.equal(foo.a, 'a'); var keys = []; for (var key in foo) { keys.push(key); } assert.deepEqual(keys.sort(), ['a', 'b', 'default']); rollup-3.29.4/test/function/samples/import-not-at-top-level-fails/000077500000000000000000000000001450520414700251135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-not-at-top-level-fails/_config.js000066400000000000000000000011741450520414700270600ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'disallows non-top-level imports', error: { cause: { pos: 19, loc: { line: 2, column: 2 }, raisedAt: 25, message: "'import' and 'export' may only appear at the top level (2:2)" }, code: 'PARSE_ERROR', id: ID_MAIN, pos: 19, loc: { column: 2, file: ID_MAIN, line: 2 }, frame: ` 1: function foo() { 2: import foo from './foo.js'; ^ 3: } `, watchFiles: [ID_MAIN], message: "'import' and 'export' may only appear at the top level" } }); rollup-3.29.4/test/function/samples/import-not-at-top-level-fails/main.js000066400000000000000000000000611450520414700263720ustar00rootroot00000000000000function foo() { import foo from './foo.js'; } rollup-3.29.4/test/function/samples/import-of-unexported-fails/000077500000000000000000000000001450520414700246035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-of-unexported-fails/_config.js000066400000000000000000000012641450520414700265500ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_EMPTY = path.join(__dirname, 'empty.js'); module.exports = defineTest({ description: 'marking an imported, but unexported, identifier should throw', error: { binding: 'default', code: 'MISSING_EXPORT', exporter: ID_EMPTY, id: ID_MAIN, url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module', pos: 7, loc: { column: 7, file: ID_MAIN, line: 1 }, frame: ` 1: import a from './empty.js'; ^ 2: 3: a(); `, watchFiles: [ID_EMPTY, ID_MAIN], message: '"default" is not exported by "empty.js", imported by "main.js".' } }); rollup-3.29.4/test/function/samples/import-of-unexported-fails/empty.js000066400000000000000000000000001450520414700262650ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-of-unexported-fails/main.js000066400000000000000000000000421450520414700260610ustar00rootroot00000000000000import a from './empty.js'; a(); rollup-3.29.4/test/function/samples/import-var-declaration/000077500000000000000000000000001450520414700237635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/import-var-declaration/_config.js000066400000000000000000000001211450520414700257170ustar00rootroot00000000000000module.exports = defineTest({ description: 'imports a variable declaration' }); rollup-3.29.4/test/function/samples/import-var-declaration/foo.js000066400000000000000000000000241450520414700251000ustar00rootroot00000000000000export var foo = 42;rollup-3.29.4/test/function/samples/import-var-declaration/main.js000066400000000000000000000000651450520414700252460ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo, 42 );rollup-3.29.4/test/function/samples/imports-are-deconflicted-b/000077500000000000000000000000001450520414700245025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/imports-are-deconflicted-b/_config.js000066400000000000000000000001631450520414700264440ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts imports (redux)', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/imports-are-deconflicted-b/bar.js000066400000000000000000000001571450520414700256070ustar00rootroot00000000000000import foo from 'path'; export default function () { return foo.relative( 'foo/bar/baz', 'foo/baz/bar' ); }; rollup-3.29.4/test/function/samples/imports-are-deconflicted-b/foo.js000066400000000000000000000000411450520414700256160ustar00rootroot00000000000000var z = 'foo'; export default z; rollup-3.29.4/test/function/samples/imports-are-deconflicted-b/main.js000066400000000000000000000002441450520414700257640ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; import { normalize } from 'path'; assert.equal( foo, 'foo' ); assert.equal( bar(), normalize('../../baz/bar') ); rollup-3.29.4/test/function/samples/imports-are-deconflicted-c/000077500000000000000000000000001450520414700245035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/imports-are-deconflicted-c/_config.js000066400000000000000000000001151450520414700264420ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts imports, again' }); rollup-3.29.4/test/function/samples/imports-are-deconflicted-c/bar.js000066400000000000000000000000401450520414700255770ustar00rootroot00000000000000export default { isBar: true }; rollup-3.29.4/test/function/samples/imports-are-deconflicted-c/foo.js000066400000000000000000000000641450520414700256240ustar00rootroot00000000000000import foo from './bar'; export default foo.isBar; rollup-3.29.4/test/function/samples/imports-are-deconflicted-c/main.js000066400000000000000000000000541450520414700257640ustar00rootroot00000000000000import foo from './foo'; assert.ok( foo ); rollup-3.29.4/test/function/samples/imports-are-deconflicted/000077500000000000000000000000001450520414700242635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/imports-are-deconflicted/_config.js000066400000000000000000000001531450520414700262240ustar00rootroot00000000000000module.exports = defineTest({ description: 'deconflicts imports', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/imports-are-deconflicted/bar.js000066400000000000000000000001571450520414700253700ustar00rootroot00000000000000import foo from 'path'; export default function () { return foo.relative( 'foo/bar/baz', 'foo/baz/bar' ); }; rollup-3.29.4/test/function/samples/imports-are-deconflicted/foo.js000066400000000000000000000000261450520414700254020ustar00rootroot00000000000000export default 'foo'; rollup-3.29.4/test/function/samples/imports-are-deconflicted/main.js000066400000000000000000000002441450520414700255450ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; import { normalize } from 'path'; assert.equal( foo, 'foo' ); assert.equal( bar(), normalize('../../baz/bar') ); rollup-3.29.4/test/function/samples/includes-internally-used-default-export/000077500000000000000000000000001450520414700272645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/includes-internally-used-default-export/_config.js000066400000000000000000000001511450520414700312230ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes default exports that are only used internally' }); rollup-3.29.4/test/function/samples/includes-internally-used-default-export/main.js000066400000000000000000000000711450520414700305440ustar00rootroot00000000000000import { b } from './module.js'; assert.equal(b(), 15); rollup-3.29.4/test/function/samples/includes-internally-used-default-export/module.js000066400000000000000000000001261450520414700311060ustar00rootroot00000000000000export default function a() { return 5; } export function b() { return a() + 10; } rollup-3.29.4/test/function/samples/includes-reassignments/000077500000000000000000000000001450520414700240665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/includes-reassignments/_config.js000066400000000000000000000001551450520414700260310ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes reassignments that are ignored on an initial pass' }); rollup-3.29.4/test/function/samples/includes-reassignments/foo.js000066400000000000000000000001601450520414700252040ustar00rootroot00000000000000var answer, getAnswer; getAnswer = function () { return 42; }; answer = getAnswer(); export default answer; rollup-3.29.4/test/function/samples/includes-reassignments/main.js000066400000000000000000000000741450520414700253510ustar00rootroot00000000000000import answer from './foo.js'; assert.equal( answer, 42 ); rollup-3.29.4/test/function/samples/includes-superclass/000077500000000000000000000000001450520414700233705ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/includes-superclass/_config.js000066400000000000000000000001151450520414700253270ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes superclass (#932)' }); rollup-3.29.4/test/function/samples/includes-superclass/base.js000066400000000000000000000000621450520414700246360ustar00rootroot00000000000000export class Base { foo () { return true; } } rollup-3.29.4/test/function/samples/includes-superclass/main.js000066400000000000000000000001621450520414700246510ustar00rootroot00000000000000import { Thing } from './thing'; const thing = new Thing(); assert.ok( thing.foo() ); assert.ok( thing.bar() ); rollup-3.29.4/test/function/samples/includes-superclass/thing.js000066400000000000000000000001431450520414700250350ustar00rootroot00000000000000import { Base } from './base.js'; export class Thing extends Base { bar () { return true; } } rollup-3.29.4/test/function/samples/inline-dynamic-imports-bundle/000077500000000000000000000000001450520414700252425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/inline-dynamic-imports-bundle/_config.js000066400000000000000000000007031450520414700272040ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'ignores non-bundled modules when inlining dynamic imports', options: { output: { inlineDynamicImports: true }, plugins: { generateBundle(options, bundle) { assert.deepStrictEqual(Object.keys(bundle['main.js'].modules), [ path.join(__dirname, 'lib.js'), path.join(__dirname, 'main.js') ]); } } } }); rollup-3.29.4/test/function/samples/inline-dynamic-imports-bundle/lib.js000066400000000000000000000000271450520414700263450ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/function/samples/inline-dynamic-imports-bundle/main.js000066400000000000000000000000441450520414700265220ustar00rootroot00000000000000export { foo } from './reexporter'; rollup-3.29.4/test/function/samples/inline-dynamic-imports-bundle/reexporter.js000066400000000000000000000000351450520414700277750ustar00rootroot00000000000000export { foo } from './lib'; rollup-3.29.4/test/function/samples/inline-dynamic-no-treeshake/000077500000000000000000000000001450520414700246635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/inline-dynamic-no-treeshake/_config.js000066400000000000000000000012601450520414700266240ustar00rootroot00000000000000const MAGIC_ENTRY = 'main'; module.exports = defineTest({ description: 'handles inlining dynamic imports when treeshaking is disabled for modules (#4098)', options: { input: MAGIC_ENTRY, output: { inlineDynamicImports: true }, plugins: [ { name: 'magic-modules', buildStart() { this.emitFile({ type: 'chunk', id: './dep.js' }); }, async resolveId(source) { if (source === MAGIC_ENTRY) { return { id: source, moduleSideEffects: 'no-treeshake' }; } return null; }, async load(id) { if (id !== MAGIC_ENTRY) return null; return `import {foo} from './reexport.js';assert.strictEqual(foo, 1);`; } } ] } }); rollup-3.29.4/test/function/samples/inline-dynamic-no-treeshake/dep.js000066400000000000000000000000261450520414700257670ustar00rootroot00000000000000export const foo = 1; rollup-3.29.4/test/function/samples/inline-dynamic-no-treeshake/reexport.js000066400000000000000000000000321450520414700270640ustar00rootroot00000000000000export * from './dep.js'; rollup-3.29.4/test/function/samples/inline-imports-with-manual/000077500000000000000000000000001450520414700245755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/inline-imports-with-manual/_config.js000066400000000000000000000007541450520414700265450ustar00rootroot00000000000000module.exports = defineTest({ description: 'Manual chunks are not supported when inlining dynamic imports', options: { input: ['main.js'], output: { inlineDynamicImports: true, manualChunks: { lib: ['lib.js'] } } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.manualChunks" - this option is not supported for "output.inlineDynamicImports".', url: 'https://rollupjs.org/configuration-options/#output-manualchunks' } }); rollup-3.29.4/test/function/samples/inline-imports-with-manual/lib.js000066400000000000000000000000311450520414700256730ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/inline-imports-with-manual/main.js000066400000000000000000000000741450520414700260600ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-3.29.4/test/function/samples/inline-imports-with-multiple-array/000077500000000000000000000000001450520414700262675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/inline-imports-with-multiple-array/_config.js000066400000000000000000000007661450520414700302420ustar00rootroot00000000000000module.exports = defineTest({ description: 'Having multiple inputs in an array is not supported when inlining dynamic imports', options: { input: ['main.js', 'lib.js'], output: { inlineDynamicImports: true } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.inlineDynamicImports" - multiple inputs are not supported when "output.inlineDynamicImports" is true.', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' } }); rollup-3.29.4/test/function/samples/inline-imports-with-multiple-array/lib.js000066400000000000000000000000311450520414700273650ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/inline-imports-with-multiple-array/main.js000066400000000000000000000000741450520414700275520ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-3.29.4/test/function/samples/inline-imports-with-multiple-object/000077500000000000000000000000001450520414700264175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/inline-imports-with-multiple-object/_config.js000066400000000000000000000010041450520414700303540ustar00rootroot00000000000000module.exports = defineTest({ description: 'Having multiple inputs in an object is not supported when inlining dynamic imports', options: { input: { main: 'main.js', lib: 'lib.js' }, output: { inlineDynamicImports: true } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.inlineDynamicImports" - multiple inputs are not supported when "output.inlineDynamicImports" is true.', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' } }); rollup-3.29.4/test/function/samples/inline-imports-with-multiple-object/lib.js000066400000000000000000000000311450520414700275150ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/inline-imports-with-multiple-object/main.js000066400000000000000000000000741450520414700277020ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-3.29.4/test/function/samples/inlined-dynamic-namespace-compact/000077500000000000000000000000001450520414700260225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/inlined-dynamic-namespace-compact/_config.js000066400000000000000000000004351450520414700277660ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'properly resolves inlined dynamic namespaces in compact mode', options: { output: { compact: true } }, exports(exports) { return exports.then(result => assert.strictEqual(result, 42 * 3)); } }); rollup-3.29.4/test/function/samples/inlined-dynamic-namespace-compact/dynamic.js000066400000000000000000000001521450520414700300020ustar00rootroot00000000000000import value from './lib'; export default import('./other-dynamic').then(other => other.default + value); rollup-3.29.4/test/function/samples/inlined-dynamic-namespace-compact/lib.js000066400000000000000000000000231450520414700271210ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/inlined-dynamic-namespace-compact/main.js000066400000000000000000000000761450520414700273070ustar00rootroot00000000000000export default import('./dynamic.js').then(ns => ns.default); rollup-3.29.4/test/function/samples/inlined-dynamic-namespace-compact/other-dynamic.js000066400000000000000000000000661450520414700311250ustar00rootroot00000000000000import value from './lib'; export default value * 2; rollup-3.29.4/test/function/samples/input-name-validation/000077500000000000000000000000001450520414700236055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/input-name-validation/_config.js000066400000000000000000000005221450520414700255460ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for absolute paths as input names', options: { input: { '/test': 'main.js' } }, generateError: { code: 'VALIDATION_ERROR', message: 'Invalid substitution "/test" for placeholder "[name]" in "output.entryFileNames" pattern, can be neither absolute nor relative path.' } }); rollup-3.29.4/test/function/samples/input-name-validation/main.js000066400000000000000000000000411450520414700250620ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/input-name-validation2/000077500000000000000000000000001450520414700236675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/input-name-validation2/_config.js000066400000000000000000000005241450520414700256320ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for relative paths as input names', options: { input: { './test': 'main.js' } }, generateError: { code: 'VALIDATION_ERROR', message: 'Invalid substitution "./test" for placeholder "[name]" in "output.entryFileNames" pattern, can be neither absolute nor relative path.' } }); rollup-3.29.4/test/function/samples/input-name-validation2/main.js000066400000000000000000000000411450520414700251440ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/input-name-validation3/000077500000000000000000000000001450520414700236705ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/input-name-validation3/_config.js000066400000000000000000000005261450520414700256350ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for relative paths as input names', options: { input: { '../test': 'main.js' } }, generateError: { code: 'VALIDATION_ERROR', message: 'Invalid substitution "../test" for placeholder "[name]" in "output.entryFileNames" pattern, can be neither absolute nor relative path.' } }); rollup-3.29.4/test/function/samples/input-name-validation3/main.js000066400000000000000000000000411450520414700251450ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/instanceof/000077500000000000000000000000001450520414700215315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/instanceof/left-hand-effect/000077500000000000000000000000001450520414700246255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/instanceof/left-hand-effect/_config.js000066400000000000000000000001531450520414700265660ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains side effects in the left hand side of instanceof' }); rollup-3.29.4/test/function/samples/instanceof/left-hand-effect/main.js000066400000000000000000000002651450520414700261120ustar00rootroot00000000000000let effect = false; class Bar {} class Foo { constructor() { effect = true; } } if (new Foo() instanceof Bar) { assert.fail('Wrong instance relation'); } assert.ok(effect); rollup-3.29.4/test/function/samples/instanceof/right-hand-effect/000077500000000000000000000000001450520414700250105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/instanceof/right-hand-effect/_config.js000066400000000000000000000001541450520414700267520ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains side effects in the right hand side of instanceof' }); rollup-3.29.4/test/function/samples/instanceof/right-hand-effect/main.js000066400000000000000000000002461450520414700262740ustar00rootroot00000000000000let effect = false; class Foo {} if ( new Foo() instanceof class { [(effect = true)]() {} } ) { assert.fail('Wrong instance relation'); } assert.ok(effect); rollup-3.29.4/test/function/samples/instanceof/used-parameter/000077500000000000000000000000001450520414700244475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/instanceof/used-parameter/_config.js000066400000000000000000000001351450520414700264100ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains instanceof for function parameters' }); rollup-3.29.4/test/function/samples/instanceof/used-parameter/main.js000066400000000000000000000002521450520414700257300ustar00rootroot00000000000000let effect = false; class Foo {} function checkInstance(instance) { if (instance instanceof Foo) { effect = true; } } checkInstance(new Foo()); assert.ok(effect); rollup-3.29.4/test/function/samples/instanceof/used/000077500000000000000000000000001450520414700224715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/instanceof/used/_config.js000066400000000000000000000001231450520414700244270ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains instanceof if it is true' }); rollup-3.29.4/test/function/samples/instanceof/used/main.js000066400000000000000000000001461450520414700237540ustar00rootroot00000000000000class Foo {} if (!(new Foo() instanceof Foo)) { assert.fail('instanceof not resolved correctly'); } rollup-3.29.4/test/function/samples/inter-chunk-execution-order/000077500000000000000000000000001450520414700247415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/inter-chunk-execution-order/_config.js000066400000000000000000000005201450520414700267000ustar00rootroot00000000000000const assert = require('node:assert'); const execution = { index: 0 }; module.exports = defineTest({ description: 'sorts imports between chunks to closely match the actual execution order', context: { execution }, options: { input: ['main.js', 'chunk1.js', 'chunk2.js'] }, exports() { assert.equal(execution.index, 4); } }); rollup-3.29.4/test/function/samples/inter-chunk-execution-order/chunk1.js000066400000000000000000000000441450520414700264660ustar00rootroot00000000000000assert.equal(++execution.index, 1); rollup-3.29.4/test/function/samples/inter-chunk-execution-order/chunk2.js000066400000000000000000000000441450520414700264670ustar00rootroot00000000000000assert.equal(++execution.index, 2); rollup-3.29.4/test/function/samples/inter-chunk-execution-order/dep.js000066400000000000000000000000731450520414700260470ustar00rootroot00000000000000import './chunk2.js'; assert.equal(++execution.index, 3); rollup-3.29.4/test/function/samples/inter-chunk-execution-order/main.js000066400000000000000000000001161450520414700262210ustar00rootroot00000000000000import './chunk1.js'; import './dep.js'; assert.equal(++execution.index, 4); rollup-3.29.4/test/function/samples/internal-reexports-from-external/000077500000000000000000000000001450520414700260265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/internal-reexports-from-external/_config.js000066400000000000000000000015761450520414700300010ustar00rootroot00000000000000const assert = require('node:assert'); const fs = require('node:fs'); const path = require('node:path'); module.exports = defineTest({ description: 'supports namespaces with external star reexports', options: { external: ['fs', 'path'], plugins: { transform(code, id) { if (id.endsWith('override.js')) { return { code, syntheticNamedExports: true }; } return null; } } }, exports(exports) { assert.strictEqual(exports.fs.readFile, fs.readFile); assert.deepStrictEqual(Object.keys(exports.fs), Object.keys(fs)); assert.strictEqual(exports.fsOverride.readFile, 'override'); assert.strictEqual(exports.fsOverride.extra, 'extra'); assert.strictEqual(exports.fsOverride.synthetic, 'synthetic'); assert.strictEqual(exports.fsOverride.readFileSync, fs.readFileSync); assert.strictEqual(exports.fsOverride.dirname, path.dirname); } }); rollup-3.29.4/test/function/samples/internal-reexports-from-external/extra.js000066400000000000000000000000361450520414700275060ustar00rootroot00000000000000export const extra = 'extra'; rollup-3.29.4/test/function/samples/internal-reexports-from-external/main.js000066400000000000000000000001631450520414700273100ustar00rootroot00000000000000export * as fs from './reexport-external.js'; export * as fsOverride from './reexport-externals-with-override.js'; rollup-3.29.4/test/function/samples/internal-reexports-from-external/reexport-external.js000066400000000000000000000000241450520414700320500ustar00rootroot00000000000000export * from 'fs'; reexport-externals-with-override.js000066400000000000000000000002261450520414700347460ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/internal-reexports-from-externalexport * from 'fs'; export * from 'path'; export * from './extra.js'; export const readFile = 'override'; export default { synthetic: 'synthetic' }; rollup-3.29.4/test/function/samples/interop-auto-live-bindings/000077500000000000000000000000001450520414700245565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-auto-live-bindings/_config.js000066400000000000000000000022711450520414700265220ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = defineTest({ description: 'handles interop "auto" with live-bindings support', options: { external: id => id.startsWith('external') || id === 'update', output: { interop: 'auto', format: 'cjs' } }, context: { require(id) { switch (id) { case 'external-module': { return Object.defineProperty( { get default() { return fooModule; }, get barModule() { return barModule; } }, '__esModule', { value: true } ); } case 'external-cjs': { return { get barCjs() { return barCjs; } }; } case 'external-cjs-with-default': { return { get default() { return fooDefault; }, get barDefault() { return barDefault; } }; } case 'update': { return () => { fooModule = 'foo2'; barModule = 'bar2'; barCjs = 'bar2'; fooDefault = 'foo2'; barDefault = 'bar2'; }; } default: { throw new Error(`Unexpected import "${id}"`); } } } } }); rollup-3.29.4/test/function/samples/interop-auto-live-bindings/main.js000066400000000000000000000032401450520414700260370ustar00rootroot00000000000000import fooModule, { barModule } from 'external-module'; import * as bazModule from 'external-module'; import fooCjs, { barCjs } from 'external-cjs'; import * as bazCjs from 'external-cjs'; import fooDefault, { barDefault } from 'external-cjs-with-default'; import * as bazDefault from 'external-cjs-with-default'; import update from 'update'; assert.strictEqual(fooModule, 'foo', 'module'); assert.strictEqual(barModule, 'bar', 'module'); assert.deepStrictEqual(bazModule, { barModule: 'bar', default: 'foo' }, 'module'); assert.deepStrictEqual(fooCjs, { barCjs: 'bar' }, 'cjs'); assert.strictEqual(barCjs, 'bar', 'cjs'); assert.deepStrictEqual( bazCjs, { __proto__: null, barCjs: 'bar', default: { barCjs: 'bar' } }, 'cjs' ); assert.deepStrictEqual(fooDefault, { barDefault: 'bar', default: 'foo' }, 'default'); assert.strictEqual(barDefault, 'bar', 'default'); assert.deepStrictEqual( bazDefault, { __proto__: null, barDefault: 'bar', default: { barDefault: 'bar', default: 'foo' } }, 'default' ); update(); assert.strictEqual(fooModule, 'foo2', 'module'); assert.strictEqual(barModule, 'bar2', 'module'); assert.deepStrictEqual(bazModule, { barModule: 'bar2', default: 'foo2' }, 'module'); assert.deepStrictEqual(fooCjs, { barCjs: 'bar2' }, 'cjs'); assert.strictEqual(barCjs, 'bar2', 'cjs'); assert.deepStrictEqual( bazCjs, { __proto__: null, barCjs: 'bar2', default: { barCjs: 'bar2' } }, 'cjs' ); assert.deepStrictEqual(fooDefault, { barDefault: 'bar2', default: 'foo2' }, 'default'); assert.strictEqual(barDefault, 'bar2', 'default'); assert.deepStrictEqual( bazDefault, { __proto__: null, barDefault: 'bar2', default: { barDefault: 'bar2', default: 'foo2' } }, 'default' ); rollup-3.29.4/test/function/samples/interop-auto-no-live-bindings/000077500000000000000000000000001450520414700251705ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-auto-no-live-bindings/_config.js000066400000000000000000000016361450520414700271400ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles interop "auto" without live-bindings support', options: { external: id => id.startsWith('external') || id === 'update', output: { interop: 'auto', format: 'cjs', externalLiveBindings: false } }, context: { require(id) { switch (id) { case 'external-module': { return Object.defineProperty( { get default() { return 'foo'; }, get barModule() { return 'bar'; } }, '__esModule', { value: true } ); } case 'external-cjs': { return { get barCjs() { return 'bar'; } }; } case 'external-cjs-with-default': { return { get default() { return 'foo'; }, get barDefault() { return 'bar'; } }; } default: { throw new Error(`Unexpected import "${id}"`); } } } } }); rollup-3.29.4/test/function/samples/interop-auto-no-live-bindings/main.js000066400000000000000000000017221450520414700264540ustar00rootroot00000000000000import fooModule, { barModule } from 'external-module'; import * as bazModule from 'external-module'; import fooCjs, { barCjs } from 'external-cjs'; import * as bazCjs from 'external-cjs'; import fooDefault, { barDefault } from 'external-cjs-with-default'; import * as bazDefault from 'external-cjs-with-default'; assert.strictEqual(fooModule, 'foo', 'module'); assert.strictEqual(barModule, 'bar', 'module'); assert.deepStrictEqual(bazModule, { barModule: 'bar', default: 'foo' }, 'module'); assert.deepStrictEqual(fooCjs, { barCjs: 'bar' }, 'cjs'); assert.strictEqual(barCjs, 'bar', 'cjs'); assert.deepStrictEqual( bazCjs, { __proto__: null, barCjs: 'bar', default: { barCjs: 'bar' } }, 'cjs' ); assert.deepStrictEqual(fooDefault, { barDefault: 'bar', default: 'foo' }, 'default'); assert.strictEqual(barDefault, 'bar', 'default'); assert.deepStrictEqual( bazDefault, { __proto__: null, barDefault: 'bar', default: { barDefault: 'bar', default: 'foo' } }, 'default' ); rollup-3.29.4/test/function/samples/interop-default-conflict/000077500000000000000000000000001450520414700243015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-default-conflict/_config.js000066400000000000000000000014471450520414700262510ustar00rootroot00000000000000const assert = require('node:assert'); let bar = 'initial bar'; let defaultValue = 'initial foo'; module.exports = defineTest({ description: 'handles conflicts with added interop default variables and supports default live bindings', options: { external: 'external', output: { interop: 'compat' } }, context: { require() { return { get default() { return defaultValue; }, get bar() { return bar; }, __esModule: true }; } }, exports(exports) { assert.deepStrictEqual(exports, { foo: 'initial foo', bar: 'initial bar', foo__default: 1, external__default: 2 }); defaultValue = 'new foo'; bar = 'new bar'; assert.deepStrictEqual(exports, { foo: 'new foo', bar: 'new bar', foo__default: 1, external__default: 2 }); } }); rollup-3.29.4/test/function/samples/interop-default-conflict/main.js000066400000000000000000000002151450520414700255610ustar00rootroot00000000000000import foo, { bar } from 'external'; const foo__default = 1; const external__default = 2; export {foo, foo__default, external__default, bar} rollup-3.29.4/test/function/samples/interop-default-only-named-import/000077500000000000000000000000001450520414700260535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-default-only-named-import/_config.js000066400000000000000000000010651450520414700300170ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when using a named import with interop "defaultOnly"', options: { external: 'external', output: { interop: 'defaultOnly' } }, generateError: { code: 'UNEXPECTED_NAMED_IMPORT', exporter: 'external', url: 'https://rollupjs.org/configuration-options/#output-interop', message: 'The named export "foo" was imported from the external module "external" even though its interop type is "defaultOnly". Either remove or change this import or change the value of the "output.interop" option.' } }); rollup-3.29.4/test/function/samples/interop-default-only-named-import/main.js000066400000000000000000000000471450520414700273360ustar00rootroot00000000000000import { foo } from 'external'; foo(); rollup-3.29.4/test/function/samples/interop-default-only-named-namespace-reexport/000077500000000000000000000000001450520414700303435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-default-only-named-namespace-reexport/_config.js000066400000000000000000000005511450520414700323060ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows reexporting a namespace as a name when interop is "defaultOnly"', options: { external: 'external', output: { interop: 'defaultOnly' } }, exports(exports) { assert.deepStrictEqual(exports, { foo: { __proto__: null, default: { external: true } } }); } }); rollup-3.29.4/test/function/samples/interop-default-only-named-namespace-reexport/main.js000066400000000000000000000000411450520414700316200ustar00rootroot00000000000000export * as foo from 'external'; rollup-3.29.4/test/function/samples/interop-default-only-named-reexport/000077500000000000000000000000001450520414700264115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-default-only-named-reexport/_config.js000066400000000000000000000010741450520414700303550ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when reexporting a namespace with interop "defaultOnly"', options: { external: 'external', output: { interop: 'defaultOnly' } }, generateError: { code: 'UNEXPECTED_NAMED_IMPORT', exporter: 'external', url: 'https://rollupjs.org/configuration-options/#output-interop', message: 'The named export "foo" was reexported from the external module "external" even though its interop type is "defaultOnly". Either remove or change this reexport or change the value of the "output.interop" option.' } }); rollup-3.29.4/test/function/samples/interop-default-only-named-reexport/main.js000066400000000000000000000000401450520414700276650ustar00rootroot00000000000000export { foo } from 'external'; rollup-3.29.4/test/function/samples/interop-default-only-namespace-import/000077500000000000000000000000001450520414700267235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-default-only-namespace-import/_config.js000066400000000000000000000002771450520414700306730ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows importing a namespace when interop is "defaultOnly"', options: { external: 'external', output: { interop: 'defaultOnly' } } }); rollup-3.29.4/test/function/samples/interop-default-only-namespace-import/main.js000066400000000000000000000001601450520414700302020ustar00rootroot00000000000000import * as foo from 'external'; assert.deepStrictEqual(foo, { __proto__: null, default: { external: true } }); rollup-3.29.4/test/function/samples/interop-default-only-namespace-reexport/000077500000000000000000000000001450520414700272615ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-default-only-namespace-reexport/_config.js000066400000000000000000000012421450520414700312220ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns when reexporting a namespace with interop "defaultOnly"', options: { external: 'external', output: { interop: 'defaultOnly' } }, warnings: [ { code: 'UNEXPECTED_NAMED_IMPORT', exporter: 'external', message: 'There was a namespace "*" reexport from the external module "external" even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.', url: 'https://rollupjs.org/configuration-options/#output-interop' } ] }); rollup-3.29.4/test/function/samples/interop-default-only-namespace-reexport/main.js000066400000000000000000000000321450520414700305360ustar00rootroot00000000000000export * from 'external'; rollup-3.29.4/test/function/samples/interop-default-only/000077500000000000000000000000001450520414700234615ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-default-only/_config.js000066400000000000000000000022541450520414700254260ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = defineTest({ description: 'handles interop "defaultOnly"', options: { external: id => id.startsWith('external') || id === 'update', output: { interop: 'defaultOnly', format: 'cjs' } }, context: { require(id) { switch (id) { case 'external-module': { return Object.defineProperty( { get default() { return fooModule; }, get barModule() { return barModule; } }, '__esModule', { value: true } ); } case 'external-cjs': { return { get barCjs() { return barCjs; } }; } case 'external-cjs-with-default': { return { get default() { return fooDefault; }, get barDefault() { return barDefault; } }; } case 'update': { return () => { fooModule = 'foo2'; barModule = 'bar2'; barCjs = 'bar2'; fooDefault = 'foo2'; barDefault = 'bar2'; }; } default: { throw new Error(`Unexpected import "${id}"`); } } } } }); rollup-3.29.4/test/function/samples/interop-default-only/main.js000066400000000000000000000026271450520414700247520ustar00rootroot00000000000000import fooModule from 'external-module'; import * as bazModule from 'external-module'; import fooCjs from 'external-cjs'; import * as bazCjs from 'external-cjs'; import fooDefault from 'external-cjs-with-default'; import * as bazDefault from 'external-cjs-with-default'; import update from 'update'; assert.deepStrictEqual(fooModule, { barModule: 'bar', default: 'foo' }, 'module'); assert.deepStrictEqual( bazModule, { __proto__: null, default: { barModule: 'bar', default: 'foo' } }, 'module' ); assert.deepStrictEqual(fooCjs, { barCjs: 'bar' }, 'cjs'); assert.deepStrictEqual(bazCjs, { __proto__: null, default: { barCjs: 'bar' } }, 'cjs'); assert.deepStrictEqual(fooDefault, { barDefault: 'bar', default: 'foo' }, 'default'); assert.deepStrictEqual( bazDefault, { __proto__: null, default: { barDefault: 'bar', default: 'foo' } }, 'default' ); update(); assert.deepStrictEqual(fooModule, { barModule: 'bar2', default: 'foo2' }, 'module'); assert.deepStrictEqual( bazModule, { __proto__: null, default: { barModule: 'bar2', default: 'foo2' } }, 'module' ); assert.deepStrictEqual(fooCjs, { barCjs: 'bar2' }, 'cjs'); assert.deepStrictEqual(bazCjs, { __proto__: null, default: { barCjs: 'bar2' } }, 'cjs'); assert.deepStrictEqual(fooDefault, { barDefault: 'bar2', default: 'foo2' }, 'default'); assert.deepStrictEqual( bazDefault, { __proto__: null, default: { barDefault: 'bar2', default: 'foo2' } }, 'default' ); rollup-3.29.4/test/function/samples/interop-default/000077500000000000000000000000001450520414700225025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-default/_config.js000066400000000000000000000022771450520414700244540ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = defineTest({ description: 'handles interop "default" with live-bindings support', options: { external: id => id.startsWith('external') || id === 'update', output: { interop: 'default', format: 'cjs' } }, context: { require(id) { switch (id) { case 'external-module': { return Object.defineProperty( { get default() { return fooModule; }, get barModule() { return barModule; } }, '__esModule', { value: true } ); } case 'external-cjs': { return { get barCjs() { return barCjs; } }; } case 'external-cjs-with-default': { return { get default() { return fooDefault; }, get barDefault() { return barDefault; } }; } case 'update': { return () => { fooModule = 'foo2'; barModule = 'bar2'; barCjs = 'bar2'; fooDefault = 'foo2'; barDefault = 'bar2'; }; } default: { throw new Error(`Unexpected import "${id}"`); } } } } }); rollup-3.29.4/test/function/samples/interop-default/main.js000066400000000000000000000035221450520414700237660ustar00rootroot00000000000000import fooModule, { barModule } from 'external-module'; import * as bazModule from 'external-module'; import fooCjs, { barCjs } from 'external-cjs'; import * as bazCjs from 'external-cjs'; import fooDefault, { barDefault } from 'external-cjs-with-default'; import * as bazDefault from 'external-cjs-with-default'; import update from 'update'; assert.deepStrictEqual(fooModule, { barModule: 'bar', default: 'foo' }, 'module'); assert.strictEqual(barModule, 'bar', 'module'); assert.deepStrictEqual( bazModule, { __proto__: null, barModule: 'bar', default: { barModule: 'bar', default: 'foo' } }, 'module' ); assert.deepStrictEqual(fooCjs, { barCjs: 'bar' }, 'cjs'); assert.strictEqual(barCjs, 'bar', 'cjs'); assert.deepStrictEqual( bazCjs, { __proto__: null, barCjs: 'bar', default: { barCjs: 'bar' } }, 'cjs' ); assert.deepStrictEqual(fooDefault, { barDefault: 'bar', default: 'foo' }, 'default'); assert.strictEqual(barDefault, 'bar', 'default'); assert.deepStrictEqual( bazDefault, { __proto__: null, barDefault: 'bar', default: { barDefault: 'bar', default: 'foo' } }, 'default' ); update(); assert.deepStrictEqual(fooModule, { barModule: 'bar2', default: 'foo2' }, 'module'); assert.strictEqual(barModule, 'bar2', 'module'); assert.deepStrictEqual( bazModule, { __proto__: null, barModule: 'bar2', default: { barModule: 'bar2', default: 'foo2' } }, 'module' ); assert.deepStrictEqual(fooCjs, { barCjs: 'bar2' }, 'cjs'); assert.strictEqual(barCjs, 'bar2', 'cjs'); assert.deepStrictEqual( bazCjs, { __proto__: null, barCjs: 'bar2', default: { barCjs: 'bar2' } }, 'cjs' ); assert.deepStrictEqual(fooDefault, { barDefault: 'bar2', default: 'foo2' }, 'default'); assert.strictEqual(barDefault, 'bar2', 'default'); assert.deepStrictEqual( bazDefault, { __proto__: null, barDefault: 'bar2', default: { barDefault: 'bar2', default: 'foo2' } }, 'default' ); rollup-3.29.4/test/function/samples/interop-esmodule/000077500000000000000000000000001450520414700226735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/interop-esmodule/_config.js000066400000000000000000000023371450520414700246420ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = defineTest({ description: 'handles interop "esModule" with live-bindings support', options: { external: id => id.startsWith('external') || id === 'update', output: { interop: 'esModule', format: 'cjs' } }, context: { require(id) { switch (id) { case 'external-module': { return Object.defineProperty( { get default() { return fooModule; }, get barModule() { return barModule; } }, '__esModule', { value: true } ); } case 'external-cjs': { return { get barCjs() { return barCjs; } }; } case 'external-cjs-with-default': { return { get default() { return fooDefault; }, get barDefault() { return barDefault; } }; } case 'update': { return { default: () => { fooModule = 'foo2'; barModule = 'bar2'; barCjs = 'bar2'; fooDefault = 'foo2'; barDefault = 'bar2'; } }; } default: { throw new Error(`Unexpected import "${id}"`); } } } } }); rollup-3.29.4/test/function/samples/interop-esmodule/main.js000066400000000000000000000025741450520414700241650ustar00rootroot00000000000000import fooModule, { barModule } from 'external-module'; import * as bazModule from 'external-module'; import fooCjs, { barCjs } from 'external-cjs'; import * as bazCjs from 'external-cjs'; import fooDefault, { barDefault } from 'external-cjs-with-default'; import * as bazDefault from 'external-cjs-with-default'; import update from 'update'; assert.strictEqual(fooModule, 'foo', 'module'); assert.strictEqual(barModule, 'bar', 'module'); assert.deepStrictEqual(bazModule, { barModule: 'bar', default: 'foo' }, 'module'); assert.deepStrictEqual(fooCjs, undefined, 'cjs'); assert.strictEqual(barCjs, 'bar', 'cjs'); assert.deepStrictEqual(bazCjs, { barCjs: 'bar' }, 'cjs'); assert.deepStrictEqual(fooDefault, 'foo', 'default'); assert.strictEqual(barDefault, 'bar', 'default'); assert.deepStrictEqual(bazDefault, { barDefault: 'bar', default: 'foo' }, 'default'); update(); assert.strictEqual(fooModule, 'foo2', 'module'); assert.strictEqual(barModule, 'bar2', 'module'); assert.deepStrictEqual(bazModule, { barModule: 'bar2', default: 'foo2' }, 'module'); assert.deepStrictEqual(fooCjs, undefined, 'cjs'); assert.strictEqual(barCjs, 'bar2', 'cjs'); assert.deepStrictEqual(bazCjs, { barCjs: 'bar2' }, 'cjs'); assert.deepStrictEqual(fooDefault, 'foo2', 'default'); assert.strictEqual(barDefault, 'bar2', 'default'); assert.deepStrictEqual(bazDefault, { barDefault: 'bar2', default: 'foo2' }, 'default'); rollup-3.29.4/test/function/samples/invalid-addon-hook/000077500000000000000000000000001450520414700230475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-addon-hook/_config.js000066400000000000000000000007101450520414700250070ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when providing a non-string value for an addon hook', options: { plugins: { intro: 42 } }, generateError: { code: 'ADDON_ERROR', message: 'Could not retrieve "intro". Check configuration of plugin "at position 1".\n\tError Message: Error running plugin hook "intro" for plugin "at position 1", expected a string, a function hook or an object with a "handler" string or function.' } }); rollup-3.29.4/test/function/samples/invalid-addon-hook/foo.js000066400000000000000000000000231450520414700241630ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/invalid-addon-hook/main.js000066400000000000000000000000511450520414700243250ustar00rootroot00000000000000export default () => import('./foo.js'); rollup-3.29.4/test/function/samples/invalid-default-export-mode/000077500000000000000000000000001450520414700247115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-default-export-mode/_config.js000066400000000000000000000006221450520414700266530ustar00rootroot00000000000000module.exports = defineTest({ description: 'throw for invalid default export mode', options: { output: { exports: 'default' } }, generateError: { code: 'INVALID_EXPORT_OPTION', message: '"default" was specified for "output.exports", but entry module "main.js" has the following exports: "default" and "foo"', url: 'https://rollupjs.org/configuration-options/#output-exports' } }); rollup-3.29.4/test/function/samples/invalid-default-export-mode/main.js000066400000000000000000000000521450520414700261700ustar00rootroot00000000000000export default 42; export const foo = 43; rollup-3.29.4/test/function/samples/invalid-ignore-list-function/000077500000000000000000000000001450520414700251035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-ignore-list-function/_config.js000066400000000000000000000006571450520414700270550ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'throw descriptive error if sourcemapIgnoreList-function does not return a boolean', options: { output: { name: 'myModule', sourcemap: true, file: path.join(__dirname, 'main.js'), sourcemapIgnoreList: () => {} } }, generateError: { code: 'VALIDATION_ERROR', message: 'sourcemapIgnoreList function must return a boolean.' } }); rollup-3.29.4/test/function/samples/invalid-ignore-list-function/main.js000066400000000000000000000000231450520414700263600ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/invalid-interop/000077500000000000000000000000001450520414700225045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-interop/_config.js000066400000000000000000000006321450520414700244470ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid interop values', options: { external: 'external', output: { interop: 'true' } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value "true" for option "output.interop" - use one of "compat", "auto", "esModule", "default", "defaultOnly".', url: 'https://rollupjs.org/configuration-options/#output-interop' } }); rollup-3.29.4/test/function/samples/invalid-interop/main.js000066400000000000000000000000441450520414700237640ustar00rootroot00000000000000export { default } from 'external'; rollup-3.29.4/test/function/samples/invalid-pattern-replacement/000077500000000000000000000000001450520414700247765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-pattern-replacement/_config.js000066400000000000000000000004511450520414700267400ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid placeholders in patterns', options: { output: { entryFileNames: '[invalid].js' } }, generateError: { code: 'VALIDATION_ERROR', message: '"[invalid]" is not a valid placeholder in the "output.entryFileNames" pattern.' } }); rollup-3.29.4/test/function/samples/invalid-pattern-replacement/main.js000066400000000000000000000000411450520414700262530ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/invalid-pattern/000077500000000000000000000000001450520414700225015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-pattern/_config.js000066400000000000000000000006711450520414700244470ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid patterns', options: { output: { entryFileNames: '../main.js' } }, generateError: { code: 'VALIDATION_ERROR', message: 'Invalid pattern "../main.js" for "output.entryFileNames", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.' } }); rollup-3.29.4/test/function/samples/invalid-pattern/main.js000066400000000000000000000000001450520414700237510ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-property-assignments/000077500000000000000000000000001450520414700252415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-property-assignments/_config.js000066400000000000000000000004071450520414700272040ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes invalid property assignments', context: { globalOther: 'other' }, options: { treeshake: { propertyReadSideEffects: false, tryCatchDeoptimization: false, unknownGlobalSideEffects: false } } }); rollup-3.29.4/test/function/samples/invalid-property-assignments/main.js000066400000000000000000000012361450520414700265250ustar00rootroot00000000000000function assertThrows(callback, description) { let thrown = false; try { callback(); } catch (err) { thrown = true; } assert.ok(thrown, description); } assertThrows(() => { const obj = { first: { second: 0} }; obj[globalOther].second = 1; }, 'sub-property of unknown property'); assertThrows(() => { const obj = { first: { second: 0} }; delete obj.first; obj.first.second = 1; }, 'sub-property of reassigned property'); assertThrows(() => { const obj = {}; obj.first.second = 1; }, 'sub-property of missing property'); assertThrows(() => { const obj4 = { set first(value) {} }; obj4.first.second = 1; }, 'sub-property of property without getter'); rollup-3.29.4/test/function/samples/invalid-property-calls/000077500000000000000000000000001450520414700240045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-property-calls/_config.js000066400000000000000000000004271450520414700257510ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes invalid property calls', context: { globalFirst: 'first', globalOther: 'other' }, options: { treeshake: { propertyReadSideEffects: false, tryCatchDeoptimization: false, unknownGlobalSideEffects: false } } }); rollup-3.29.4/test/function/samples/invalid-property-calls/main.js000066400000000000000000000015161450520414700252710ustar00rootroot00000000000000function assertThrows(callback, description) { let thrown = false; try { callback(); } catch (err) { thrown = true; } assert.ok(thrown, description); } assertThrows(() => { const obj = { first: () => {} }; obj[globalOther](); }, 'unknown missing property'); assertThrows(() => { const obj = { first: () => {} }; delete obj[globalFirst]; obj.first(); }, 'known property that might be missing'); assertThrows(() => { const obj = { first: () => {} }; delete obj.first; obj.first.second(); }, 'known property that is missing'); assertThrows(() => { const obj = { set first(value) {} }; obj.first.second(); }, 'property without getter'); assertThrows(() => { const obj = {}; obj.hasOwnProperty.second('first'); }, 'sub-property of object method'); assertThrows(() => { const obj = {}; obj.first(); }, 'missing property'); rollup-3.29.4/test/function/samples/invalid-top-level-await/000077500000000000000000000000001450520414700240365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-top-level-await/_config.js000066400000000000000000000005521450520414700260020ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'throws for invalid top-level-await format', generateError: { code: 'INVALID_TLA_FORMAT', id: ID_MAIN, message: 'Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.' } }); rollup-3.29.4/test/function/samples/invalid-top-level-await/main.js000066400000000000000000000000311450520414700253120ustar00rootroot00000000000000await Promise.resolve(); rollup-3.29.4/test/function/samples/invalid-transform-source-function/000077500000000000000000000000001450520414700261605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/invalid-transform-source-function/_config.js000066400000000000000000000007001450520414700301170ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'throw descriptive error if sourcemapPathTransform-function does not return a string (#3484)', options: { output: { name: 'myModule', sourcemap: true, file: path.join(__dirname, 'main.js'), sourcemapPathTransform: () => {} } }, generateError: { code: 'VALIDATION_ERROR', message: 'sourcemapPathTransform function must return a string.' } }); rollup-3.29.4/test/function/samples/invalid-transform-source-function/main.js000066400000000000000000000000231450520414700274350ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/keep-cjs-dynamic-import/000077500000000000000000000000001450520414700240335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/keep-cjs-dynamic-import/_config.js000066400000000000000000000006371450520414700260030ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'keeps dynamic imports in CJS output by default', options: { external: ['external-esm'] }, async exports({ result }) { const expected = { __proto__: null, default: { external: true } }; Object.defineProperty(expected, Symbol.toStringTag, { value: 'Module' }); assert.deepStrictEqual(await result, expected); } }); rollup-3.29.4/test/function/samples/keep-cjs-dynamic-import/main.js000066400000000000000000000000561450520414700253160ustar00rootroot00000000000000export const result = import('external-esm'); rollup-3.29.4/test/function/samples/keep-used-imports-from-pure-external-modules/000077500000000000000000000000001450520414700301555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/keep-used-imports-from-pure-external-modules/_config.js000066400000000000000000000006371450520414700321250ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'imports from pure external modules that are used should not be omitted', options: { external: ['warning'], treeshake: { moduleSideEffects: 'no-external' } }, context: { require: id => { if (id === 'warning') return argument => assert.equal(argument, 'hi'); throw new Error('Unexpected import', id); } } }); rollup-3.29.4/test/function/samples/keep-used-imports-from-pure-external-modules/main.js000066400000000000000000000000571450520414700314410ustar00rootroot00000000000000import warning from 'warning'; warning('hi'); rollup-3.29.4/test/function/samples/labeled-statement-conditional-break/000077500000000000000000000000001450520414700263555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/labeled-statement-conditional-break/_config.js000066400000000000000000000001551450520414700303200ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles conditional control flow due to labeled statements' }); rollup-3.29.4/test/function/samples/labeled-statement-conditional-break/main.js000066400000000000000000000002451450520414700276400ustar00rootroot00000000000000let ok = false; function test() { a: { for (let i = 0; i < 2; i++) { if (i === 1) { break a; } } return; } ok = true; } test(); assert.ok(ok); rollup-3.29.4/test/function/samples/legal-import-modification/000077500000000000000000000000001450520414700244375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/legal-import-modification/_config.js000066400000000000000000000001541450520414700264010ustar00rootroot00000000000000module.exports = defineTest({ description: 'assigning to properties of imported bindings is permitted' }); rollup-3.29.4/test/function/samples/legal-import-modification/foo.js000066400000000000000000000000231450520414700255530ustar00rootroot00000000000000export default {}; rollup-3.29.4/test/function/samples/legal-import-modification/main.js000066400000000000000000000001041450520414700257140ustar00rootroot00000000000000import foo from './foo'; foo.modified = true; export default foo; rollup-3.29.4/test/function/samples/legal-suggested-names/000077500000000000000000000000001450520414700235555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/legal-suggested-names/_config.js000066400000000000000000000001271450520414700255170ustar00rootroot00000000000000module.exports = defineTest({ description: 'illegal name suggestions are ignored' }); rollup-3.29.4/test/function/samples/legal-suggested-names/bar.js000066400000000000000000000001551450520414700246600ustar00rootroot00000000000000import * as helpers from './helpers.js'; export default function bar ( a ) { return helpers.typeof( a ); } rollup-3.29.4/test/function/samples/legal-suggested-names/foo.js000066400000000000000000000001551450520414700246770ustar00rootroot00000000000000import * as helpers from './helpers.js'; export default function foo ( a ) { return helpers.typeof( a ); } rollup-3.29.4/test/function/samples/legal-suggested-names/helpers.js000066400000000000000000000001331450520414700255520ustar00rootroot00000000000000var _typeof = function ( thing ) { return typeof thing; }; export { _typeof as typeof }; rollup-3.29.4/test/function/samples/legal-suggested-names/main.js000066400000000000000000000004201450520414700250330ustar00rootroot00000000000000import * as helpers from './helpers.js'; import foo from './foo.js'; import bar from './bar.js'; assert.equal( helpers.typeof( foo ), 'function' ); assert.equal( helpers.typeof( bar ), 'function' ); assert.equal( foo( 1 ), 'number' ); assert.equal( bar( 2 ), 'number' ); rollup-3.29.4/test/function/samples/load-module-error/000077500000000000000000000000001450520414700227315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-module-error/buildEnd/000077500000000000000000000000001450520414700244575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-module-error/buildEnd/_config.js000066400000000000000000000004411450520414700264200ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', buildEnd() { this.error('nope'); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'buildEnd' } }); rollup-3.29.4/test/function/samples/load-module-error/buildEnd/main.js000066400000000000000000000000261450520414700257370ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/load-module-error/buildStart/000077500000000000000000000000001450520414700250465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-module-error/buildStart/_config.js000066400000000000000000000004451450520414700270130ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', buildStart() { this.error('nope'); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'buildStart' } }); rollup-3.29.4/test/function/samples/load-module-error/buildStart/main.js000066400000000000000000000000261450520414700263260ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/load-module-error/generateBundle/000077500000000000000000000000001450520414700256555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-module-error/generateBundle/_config.js000066400000000000000000000004651450520414700276240ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', generateBundle() { this.error('nope'); } } ] }, generateError: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'generateBundle' } }); rollup-3.29.4/test/function/samples/load-module-error/generateBundle/main.js000066400000000000000000000000261450520414700271350ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/load-module-error/load/000077500000000000000000000000001450520414700236505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-module-error/load/_config.js000066400000000000000000000010611450520414700256100ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'throws when a module cannot be loaded', options: { plugins: [ { name: 'test', resolveId(id) { if (id === 'broken') { return id; } }, load(id) { if (id === 'broken') { throw new Error("It's broken!"); } } } ] }, error: { code: 'PLUGIN_ERROR', hook: 'load', message: `Could not load broken (imported by main.js): It's broken!`, plugin: 'test', watchFiles: [path.join(__dirname, 'main.js'), 'broken'] } }); rollup-3.29.4/test/function/samples/load-module-error/load/main.js000066400000000000000000000000211450520414700251230ustar00rootroot00000000000000import 'broken'; rollup-3.29.4/test/function/samples/load-module-error/renderChunk/000077500000000000000000000000001450520414700252015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-module-error/renderChunk/_config.js000066400000000000000000000004571450520414700271510ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', renderChunk() { this.error('nope'); } } ] }, generateError: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'renderChunk' } }); rollup-3.29.4/test/function/samples/load-module-error/renderChunk/main.js000066400000000000000000000000261450520414700264610ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/load-module-error/renderStart/000077500000000000000000000000001450520414700252265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-module-error/renderStart/_config.js000066400000000000000000000004571450520414700271760ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', renderStart() { this.error('nope'); } } ] }, generateError: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'renderStart' } }); rollup-3.29.4/test/function/samples/load-module-error/renderStart/main.js000066400000000000000000000000261450520414700265060ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/load-module-error/resolveId/000077500000000000000000000000001450520414700246655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-module-error/resolveId/_config.js000066400000000000000000000004431450520414700266300ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', resolveId() { this.error('nope'); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'resolveId' } }); rollup-3.29.4/test/function/samples/load-module-error/resolveId/main.js000066400000000000000000000000261450520414700261450ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/load-module-error/transform/000077500000000000000000000000001450520414700247445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-module-error/transform/_config.js000066400000000000000000000011551450520414700267100ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'plugin transform hooks can use `this.error({...}, char)` (#1140)', options: { plugins: [ { name: 'test', transform() { this.error('nope', 22); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'transform', id: path.join(__dirname, 'main.js'), watchFiles: [path.join(__dirname, 'main.js')], pos: 22, loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 22 }, frame: ` 1: assert.equal( 21 * 2, TK ); ^ ` } }); rollup-3.29.4/test/function/samples/load-module-error/transform/main.js000066400000000000000000000000341450520414700262230ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-3.29.4/test/function/samples/load-resolve-dependencies/000077500000000000000000000000001450520414700244205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-resolve-dependencies/_config.js000066400000000000000000000075371450520414700263760ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_FIRST = path.join(__dirname, 'first.js'); const ID_SECOND = path.join(__dirname, 'second.js'); const ID_THIRD = path.join(__dirname, 'third.js'); const DYNAMIC_IMPORT_PROXY_PREFIX = '\0dynamic-import:'; const chunks = []; module.exports = defineTest({ description: 'allows to wait for dependency resolution in this.load to scan dependency trees', context: { chunks }, async exports(exports) { assert.deepStrictEqual(chunks, []); const { importSecond } = await exports.importFirst(); const expectedFirstChunk = [ID_FIRST, ID_SECOND, ID_THIRD]; assert.deepStrictEqual(chunks, [expectedFirstChunk]); await importSecond(); const expectedSecondChunk = [ID_SECOND, ID_THIRD]; assert.deepStrictEqual(chunks, [expectedFirstChunk, expectedSecondChunk]); }, options: { plugins: [ { name: 'add-chunk-log', async resolveDynamicImport(specifier, importer) { // Ignore non-static targets if (!(typeof specifier === 'string')) return; // Get the id and initial meta information of the import target const resolved = await this.resolve(specifier, importer); // Ignore external targets. Explicit externals have the "external" // property while unresolved imports are "null". if (resolved && !resolved.external) { // We trigger loading the module without waiting for it here // because meta information attached by resolveId hooks (that may // be contained in "resolved") is only attached to a module the // first time it is loaded. // That guarantees this meta information, that plugins like // commonjs may depend upon, is not lost even if we use "this.load" // with just the id in the load hook. this.load(resolved); return `${DYNAMIC_IMPORT_PROXY_PREFIX}${resolved.id}`; } }, async load(id) { // Ignore all files but our dynamic import proxies if (!id.startsWith('\0dynamic-import:')) return null; const actualId = id.slice(DYNAMIC_IMPORT_PROXY_PREFIX.length); // To allow loading modules in parallel while keeping complexity low, // we do not directly await each "this.load" call but put their // promises into an array where we await each entry via an async for // loop. const moduleInfoPromises = [this.load({ id: actualId, resolveDependencies: true })]; // We track each loaded dependency here so that we do not load a file // twice and also do not get stuck when there are circular // dependencies. const dependencies = new Set([actualId]); // "importedResolution" tracks the objects created via "resolveId". // Again we are using those instead of "importedIds" so that // important meta information is not lost. for await (const { importedIdResolutions } of moduleInfoPromises) { for (const resolved of importedIdResolutions) { if (!dependencies.has(resolved.id)) { dependencies.add(resolved.id); moduleInfoPromises.push(this.load({ ...resolved, resolveDependencies: true })); } } } let code = `chunks.push([${[...dependencies] .map(JSON.stringify) .join(', ')}]); export * from ${JSON.stringify(actualId)};`; // Namespace reexports do not reexport default exports, which is why // we reexport it manually if it exists if (this.getModuleInfo(actualId).hasDefaultExport) { code += `export { default } from ${JSON.stringify(actualId)};`; } return code; }, async resolveId() { // We delay resolution just slightly so that we can see the effect of // resolveDependencies return new Promise(resolve => setTimeout(() => resolve(null), 10)); } } ] }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_SECOND, ID_THIRD, ID_SECOND], message: 'Circular dependency: second.js -> third.js -> second.js' } ] }); rollup-3.29.4/test/function/samples/load-resolve-dependencies/first.js000066400000000000000000000001441450520414700261040ustar00rootroot00000000000000import './second.js'; import './third.js'; export const importSecond = () => import('./second.js'); rollup-3.29.4/test/function/samples/load-resolve-dependencies/main.js000066400000000000000000000000651450520414700257030ustar00rootroot00000000000000export const importFirst = () => import('./first.js')rollup-3.29.4/test/function/samples/load-resolve-dependencies/second.js000066400000000000000000000000251450520414700262260ustar00rootroot00000000000000import './third.js'; rollup-3.29.4/test/function/samples/load-resolve-dependencies/third.js000066400000000000000000000000261450520414700260660ustar00rootroot00000000000000import './second.js'; rollup-3.29.4/test/function/samples/load-returns-empty-string/000077500000000000000000000000001450520414700244575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-returns-empty-string/_config.js000066400000000000000000000005061450520414700264220ustar00rootroot00000000000000module.exports = defineTest({ description: 'loaders are permitted to return the empty string', options: { plugins: [ { load(id) { if (/foo\.js/.test(id)) { return ''; } } }, { load(id) { if (/bar\.js/.test(id)) { return { code: '', map: null }; } } } ] } }); rollup-3.29.4/test/function/samples/load-returns-empty-string/bar.js000066400000000000000000000000521450520414700255560ustar00rootroot00000000000000throw new Error('should not be reached'); rollup-3.29.4/test/function/samples/load-returns-empty-string/foo.js000066400000000000000000000000521450520414700255750ustar00rootroot00000000000000throw new Error('should not be reached'); rollup-3.29.4/test/function/samples/load-returns-empty-string/main.js000066400000000000000000000000651450520414700257420ustar00rootroot00000000000000import './foo.js'; import './bar.js'; assert(true); rollup-3.29.4/test/function/samples/load-returns-string-or-null/000077500000000000000000000000001450520414700247115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/load-returns-string-or-null/_config.js000066400000000000000000000007221450520414700266540ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'throws error if load returns something wacky', options: { plugins: [ { name: 'bad-plugin', load() { return 42; } } ] }, error: { code: 'BAD_LOADER', watchFiles: [ID_MAIN], message: 'Error loading "main.js": plugin load hook should return a string, a { code, map } object, or nothing/null.' } }); rollup-3.29.4/test/function/samples/load-returns-string-or-null/main.js000066400000000000000000000000521450520414700261700ustar00rootroot00000000000000throw new Error('should not be reached'); rollup-3.29.4/test/function/samples/logging/000077500000000000000000000000001450520414700210265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/handle-logs-in-plugins/000077500000000000000000000000001450520414700253065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/handle-logs-in-plugins/_config.js000066400000000000000000000132761450520414700272610ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const logs = []; module.exports = defineTest({ description: 'allows plugins to read and filter logs', options: { logLevel: 'debug', plugins: [ { name: 'first', buildStart() { this.info('passed to both plugins'); }, onLog(level, log) { logs.push(['first', level, log]); if (log.code === 'EVAL') { return false; } if (log.code === 'UNRESOLVED_IMPORT') { if (level !== 'warn') { throw new Error( 'UNRESOLVED_IMPORT log should not be passed back to the first plugin' ); } // This should not be passed back to the first plugin as we are // logging from the onLog hook return this.info(log); } } }, { name: 'second', onLog(level, log) { logs.push(['second', level, log]); if (log.code === 'EVAL') { throw new Error('EVAL log should not be passed to second plugin'); } if (log.code === 'UNRESOLVED_IMPORT') { if (level === 'debug') { throw new Error( 'UNRESOLVED_IMPORT log should not be passed back to the second plugin' ); } // As we do not filter, the original warn log should also be passed // to the second plugin if (level !== 'warn') { // This should not be passed to either the first or second plugin // as we are handling a log from the onLog hook of the first // plugin in the onLog hook of the second plugin return this.debug(log); } } } } ] }, after() { assert.deepStrictEqual(logs, [ [ 'first', 'info', { message: 'passed to both plugins', code: 'PLUGIN_LOG', plugin: 'first' } ], [ 'second', 'info', { message: 'passed to both plugins', code: 'PLUGIN_LOG', plugin: 'first' } ], [ 'first', 'warn', { code: 'THIS_IS_UNDEFINED', message: "The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten", url: 'https://rollupjs.org/troubleshooting/#error-this-is-undefined', id: ID_MAIN, pos: 24, loc: { column: 5, file: ID_MAIN, line: 2 }, frame: "1: import 'external';\n2: eval(this);\n ^" } ], [ 'second', 'warn', { code: 'THIS_IS_UNDEFINED', message: "The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten", url: 'https://rollupjs.org/troubleshooting/#error-this-is-undefined', id: ID_MAIN, pos: 24, loc: { column: 5, file: ID_MAIN, line: 2 }, frame: "1: import 'external';\n2: eval(this);\n ^" } ], [ 'first', 'warn', { code: 'UNRESOLVED_IMPORT', exporter: 'external', id: ID_MAIN, message: '"external" is imported by "main.js", but could not be resolved – treating it as an external dependency.', url: 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency' } ], [ 'second', 'info', { code: 'UNRESOLVED_IMPORT', exporter: 'external', id: ID_MAIN, message: '"external" is imported by "main.js", but could not be resolved – treating it as an external dependency.', url: 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency' } ], [ 'second', 'warn', { code: 'UNRESOLVED_IMPORT', exporter: 'external', id: ID_MAIN, message: '"external" is imported by "main.js", but could not be resolved – treating it as an external dependency.', url: 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency' } ], [ 'first', 'warn', { code: 'EVAL', id: ID_MAIN, message: 'Use of eval in "main.js" is strongly discouraged as it poses security risks and may cause issues with minification.', url: 'https://rollupjs.org/troubleshooting/#avoiding-eval', pos: 19, loc: { column: 0, file: ID_MAIN, line: 2 }, frame: "1: import 'external';\n2: eval(this);\n ^" } ] ]); }, logs: [ { level: 'debug', code: 'UNRESOLVED_IMPORT', exporter: 'external', id: ID_MAIN, message: '"external" is imported by "main.js", but could not be resolved – treating it as an external dependency.', url: 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency' }, { level: 'info', code: 'UNRESOLVED_IMPORT', exporter: 'external', id: ID_MAIN, message: '"external" is imported by "main.js", but could not be resolved – treating it as an external dependency.', url: 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency' }, { level: 'warn', code: 'UNRESOLVED_IMPORT', exporter: 'external', id: ID_MAIN, message: '"external" is imported by "main.js", but could not be resolved – treating it as an external dependency.', url: 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency' }, { level: 'warn', code: 'THIS_IS_UNDEFINED', message: "The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten", url: 'https://rollupjs.org/troubleshooting/#error-this-is-undefined', id: ID_MAIN, pos: 24, loc: { column: 5, file: ID_MAIN, line: 2 }, frame: ` 1: import 'external'; 2: eval(this); ^` }, { level: 'info', message: 'passed to both plugins', code: 'PLUGIN_LOG', plugin: 'first' } ] }); rollup-3.29.4/test/function/samples/logging/handle-logs-in-plugins/main.js000066400000000000000000000000371450520414700265700ustar00rootroot00000000000000import 'external'; eval(this); rollup-3.29.4/test/function/samples/logging/log-from-options/000077500000000000000000000000001450520414700242415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/log-from-options/_config.js000066400000000000000000000011501450520414700262000ustar00rootroot00000000000000module.exports = defineTest({ description: 'can log from the options hook', options: { logLevel: 'debug', plugins: [ { name: 'test', options() { this.debug('debug'); this.info('info'); this.warn('warn'); this.error('error'); } } ] }, logs: [ { level: 'debug', message: 'debug', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'info', message: 'info', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'warn', message: 'warn', code: 'PLUGIN_WARNING', plugin: 'test' } ], error: { code: 'PLUGIN_ERROR', hook: 'onLog', message: 'error', plugin: 'test' } }); rollup-3.29.4/test/function/samples/logging/log-from-options/main.js000066400000000000000000000000211450520414700255140ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/log-from-plugin-onlog-onwarn/000077500000000000000000000000001450520414700264625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/log-from-plugin-onlog-onwarn/_config.js000066400000000000000000000046251450520414700304330ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; module.exports = defineTest({ description: 'passes logs from plugins to onLog and onwarn', before() { console.debug = (...log) => logs.push(['debug', ...log]); console.info = (...log) => logs.push(['info', ...log]); console.warn = (...log) => logs.push(['warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ [ 'onLog', 'warn', { message: 'warnLog', pluginCode: 'PLUGIN_CODE', binding: 'foo', meta: { test: 'foo' }, code: 'PLUGIN_WARNING', plugin: 'test' } ], [ 'onLog', 'warn', { message: 'warnLog', code: 'PLUGIN_WARNING', pluginCode: 'PLUGIN_CODE', plugin: 'test' } ], [ 'onLog', 'warn', { message: 'warnLog', code: 'PLUGIN_WARNING', pluginCode: 'THE_CODE', plugin: 'test' } ], ['onLog', 'warn', { message: 'warnLog', code: 'PLUGIN_WARNING', plugin: 'test' }], ['onLog', 'warn', { message: 'warnString', code: 'PLUGIN_WARNING', plugin: 'test' }], [ 'onLog', 'info', { message: 'infoLog', pluginCode: 'PLUGIN_CODE', binding: 'foo', code: 'PLUGIN_LOG', plugin: 'test' } ], ['onLog', 'info', { message: 'infoString', code: 'PLUGIN_LOG', plugin: 'test' }], [ 'onLog', 'debug', { message: 'debugLog', pluginCode: 'PLUGIN_CODE', binding: 'foo', code: 'PLUGIN_LOG', plugin: 'test' } ], ['onLog', 'debug', { message: 'debugString', code: 'PLUGIN_LOG', plugin: 'test' }] ]); }, options: { logLevel: 'debug', onwarn(warning) { logs.push(['onwarn', warning]); }, onLog(level, log) { logs.push(['onLog', level, log]); }, plugins: [ { name: 'test', buildStart() { this.warn(() => ({ message: 'warnLog', pluginCode: 'PLUGIN_CODE', binding: 'foo', meta: { test: 'foo' } })); this.warn({ message: 'warnLog', code: 'THE_CODE', pluginCode: 'PLUGIN_CODE' }); this.warn({ message: 'warnLog', code: 'THE_CODE' }); this.warn({ message: 'warnLog' }); this.warn('warnString'); this.info({ message: 'infoLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.info('infoString'); this.debug({ message: 'debugLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.debug('debugString'); } } ] } }); rollup-3.29.4/test/function/samples/logging/log-from-plugin-onlog-onwarn/main.js000066400000000000000000000000211450520414700277350ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/log-from-plugin-onlog/000077500000000000000000000000001450520414700251605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/log-from-plugin-onlog/_config.js000066400000000000000000000033701450520414700271250ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; module.exports = defineTest({ description: 'passes logs from plugins to onLog', before() { console.debug = (...log) => logs.push(['debug', ...log]); console.info = (...log) => logs.push(['info', ...log]); console.warn = (...log) => logs.push(['warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ [ 'onLog', 'warn', { message: 'warnLog', pluginCode: 'PLUGIN_CODE', binding: 'foo', code: 'PLUGIN_WARNING', plugin: 'test' } ], ['onLog', 'warn', { message: 'warnString', code: 'PLUGIN_WARNING', plugin: 'test' }], [ 'onLog', 'info', { message: 'infoLog', pluginCode: 'PLUGIN_CODE', binding: 'foo', code: 'PLUGIN_LOG', plugin: 'test' } ], ['onLog', 'info', { message: 'infoString', code: 'PLUGIN_LOG', plugin: 'test' }], [ 'onLog', 'debug', { message: 'debugLog', pluginCode: 'PLUGIN_CODE', binding: 'foo', code: 'PLUGIN_LOG', plugin: 'test' } ], ['onLog', 'debug', { message: 'debugString', code: 'PLUGIN_LOG', plugin: 'test' }] ]); }, options: { logLevel: 'debug', onwarn: null, onLog(level, log) { logs.push(['onLog', level, log]); }, plugins: [ { name: 'test', buildStart() { this.warn({ message: 'warnLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.warn('warnString'); this.info({ message: 'infoLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.info('infoString'); this.debug({ message: 'debugLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.debug('debugString'); } } ] } }); rollup-3.29.4/test/function/samples/logging/log-from-plugin-onlog/main.js000066400000000000000000000000211450520414700264330ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/log-from-plugin-onwarn/000077500000000000000000000000001450520414700253465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/log-from-plugin-onwarn/_config.js000066400000000000000000000026051450520414700273130ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; module.exports = defineTest({ description: 'passes warn logs from plugins to onwarn', before() { console.debug = (...log) => logs.push(['debug', ...log]); console.info = (...log) => logs.push(['info', ...log]); console.warn = (...log) => logs.push(['warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ [ 'onwarn', { message: 'warnLog', pluginCode: 'PLUGIN_CODE', binding: 'foo', code: 'PLUGIN_WARNING', plugin: 'test' } ], ['onwarn', { message: 'warnString', code: 'PLUGIN_WARNING', plugin: 'test' }], ['info', '(test plugin) infoLog'], ['info', '(test plugin) infoString'], ['debug', '(test plugin) debugLog'], ['debug', '(test plugin) debugString'] ]); }, options: { logLevel: 'debug', onwarn(warning) { logs.push(['onwarn', warning]); }, onLog: null, plugins: [ { name: 'test', buildStart() { this.warn({ message: 'warnLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.warn('warnString'); this.info({ message: 'infoLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.info('infoString'); this.debug({ message: 'debugLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.debug('debugString'); } } ] } }); rollup-3.29.4/test/function/samples/logging/log-from-plugin-onwarn/main.js000066400000000000000000000000211450520414700266210ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-onlog-onwarn/000077500000000000000000000000001450520414700301535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-onlog-onwarn/_config.js000066400000000000000000000066031450520414700321220ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; module.exports = defineTest({ description: 'passes logs from plugins to onLog and onwarn', before() { console.debug = (...log) => logs.push(['debug', ...log]); console.info = (...log) => logs.push(['info', ...log]); console.warn = (...log) => logs.push(['warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ ['onLog', 'warn', { message: 'warnLog' }], ['onwarn', { message: 'warnLog' }], ['warn', 'warnLog'], [ 'onLog', 'warn', { message: 'warnLog', plugin: 'fooPlugin', loc: { file: 'fooFile', line: 1, column: 2 } } ], [ 'onwarn', { message: 'warnLog', plugin: 'fooPlugin', loc: { file: 'fooFile', line: 1, column: 2 } } ], ['warn', '(fooPlugin plugin) fooFile (1:2) warnLog'], ['onLog', 'warn', { message: 'warnLog=' }], ['onwarn', { message: 'warnLog=' }], ['onLog', 'warn', { message: 'warnLog+=' }], ['onwarn', { message: 'warnLog+=' }], ['warn', 'log was replaced'], ['onLog', 'warn', { message: 'warnLog-' }], ['onLog', 'warn', { message: 'warnLog+-' }], ['info', 'log was replaced'], ['onLog', 'info', { message: 'infoLog' }], ['info', 'infoLog'], ['onLog', 'debug', { message: 'debugLog' }], ['debug', 'debugLog'], ['onLog', 'warn', { message: 'warnWarn' }], ['onwarn', { message: 'warnWarn' }], ['warn', 'warnWarn'], ['onLog', 'warn', { message: 'warnWarn=' }], ['onwarn', { message: 'warnWarn=' }], ['onLog', 'warn', { message: 'warnWarn+=' }], ['onwarn', { message: 'warnWarn+=' }], ['warn', 'log was replaced'], ['onLog', 'warn', { message: 'warnWarn-' }], ['onLog', 'warn', { message: 'warnWarn+-' }], ['info', 'log was replaced'] ]); assert.strictEqual(logs[0][2].toString(), 'warnLog'); assert.strictEqual(logs[1][1].toString(), 'warnLog'); assert.strictEqual(logs[3][2].toString(), '(fooPlugin plugin) fooFile (1:2) warnLog'); assert.strictEqual(logs[4][1].toString(), '(fooPlugin plugin) fooFile (1:2) warnLog'); }, options: { logLevel: 'debug', onwarn(warning, handler) { logs.push(['onwarn', warning]); if (!warning.message.endsWith('=')) { handler(warning); } else if (warning.message.endsWith('+=')) { handler({ message: 'log was replaced' }); } }, onLog(level, log, handler) { logs.push(['onLog', level, log]); if (!log.message.endsWith('-')) { handler(level, log); } else if (log.message.endsWith('+-')) { handler('info', { message: 'log was replaced' }); } }, plugins: [ { name: 'test', buildStart(options) { options.onLog('warn', { message: 'warnLog' }); options.onLog('warn', { message: 'warnLog', plugin: 'fooPlugin', loc: { file: 'fooFile', line: 1, column: 2 } }); options.onLog('warn', { message: 'warnLog=' }); options.onLog('warn', { message: 'warnLog+=' }); options.onLog('warn', { message: 'warnLog-' }); options.onLog('warn', { message: 'warnLog+-' }); options.onLog('info', { message: 'infoLog' }); options.onLog('debug', { message: 'debugLog' }); options.onwarn({ message: 'warnWarn' }); options.onwarn({ message: 'warnWarn=' }); options.onwarn({ message: 'warnWarn+=' }); options.onwarn({ message: 'warnWarn-' }); options.onwarn({ message: 'warnWarn+-' }); } } ] } }); rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-onlog-onwarn/main.js000066400000000000000000000000211450520414700314260ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-onlog/000077500000000000000000000000001450520414700266515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-onlog/_config.js000066400000000000000000000051371450520414700306210ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; module.exports = defineTest({ description: 'passes logs from plugins to onLog', before() { console.debug = (...log) => logs.push(['debug', ...log]); console.info = (...log) => logs.push(['info', ...log]); console.warn = (...log) => logs.push(['warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ ['onLog', 'warn', { message: 'warnLog' }], ['warn', 'warnLog'], [ 'onLog', 'warn', { message: 'warnLog', plugin: 'fooPlugin', loc: { file: 'fooFile', line: 1, column: 2 } } ], ['warn', '(fooPlugin plugin) fooFile (1:2) warnLog'], ['onLog', 'warn', { message: 'warnLog-' }], ['onLog', 'warn', { message: 'warnLog+-' }], ['debug', 'log was replaced'], ['onLog', 'warn', { message: 'warnLog*-' }], ['info', 'log was replaced with string'], ['onLog', 'info', { message: 'infoLog' }], ['info', 'infoLog'], ['onLog', 'debug', { message: 'debugLog' }], ['debug', 'debugLog'], ['onLog', 'warn', { message: 'warnWarn' }], ['warn', 'warnWarn'], ['onLog', 'warn', { message: 'warnWarn-' }], ['onLog', 'warn', { message: 'warnWarn+-' }], ['debug', 'log was replaced'], ['onLog', 'warn', { message: 'warnWarn*-' }], ['info', 'log was replaced with string'] ]); assert.strictEqual(logs[0][2].toString(), 'warnLog'); assert.strictEqual(logs[2][2].toString(), '(fooPlugin plugin) fooFile (1:2) warnLog'); }, options: { logLevel: 'debug', onwarn: null, onLog(level, log, handler) { logs.push(['onLog', level, log]); if (!log.message.endsWith('-')) { handler(level, log); } else if (log.message.endsWith('+-')) { handler('debug', { message: 'log was replaced' }); } else if (log.message.endsWith('*-')) { handler('info', 'log was replaced with string'); } }, plugins: [ { name: 'test', buildStart(options) { options.onLog('warn', { message: 'warnLog' }); options.onLog('warn', { message: 'warnLog', plugin: 'fooPlugin', loc: { file: 'fooFile', line: 1, column: 2 } }); options.onLog('warn', { message: 'warnLog-' }); options.onLog('warn', { message: 'warnLog+-' }); options.onLog('warn', { message: 'warnLog*-' }); options.onLog('info', { message: 'infoLog' }); options.onLog('debug', { message: 'debugLog' }); options.onwarn({ message: 'warnWarn' }); options.onwarn({ message: 'warnWarn-' }); options.onwarn({ message: 'warnWarn+-' }); options.onwarn({ message: 'warnWarn*-' }); } } ] } }); rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-onlog/main.js000066400000000000000000000000211450520414700301240ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-onwarn/000077500000000000000000000000001450520414700270375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-onwarn/_config.js000066400000000000000000000046651450520414700310140ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; module.exports = defineTest({ description: 'passes warn logs from plugins to onwarn', before() { console.debug = (...log) => logs.push(['debug', ...log]); console.info = (...log) => logs.push(['info', ...log]); console.warn = (...log) => logs.push(['warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ ['onwarn', { message: 'warnLog' }], ['warn', 'warnLog'], [ 'onwarn', { message: 'warnLog', plugin: 'fooPlugin', loc: { file: 'fooFile', line: 1, column: 2 } } ], ['warn', '(fooPlugin plugin) fooFile (1:2) warnLog'], ['onwarn', { message: 'warnLog-' }], ['onwarn', { message: 'warnLog+-' }], ['warn', 'log was replaced'], ['onwarn', { message: 'warnLog*-' }], ['warn', 'log was replaced with string'], ['info', 'infoLog'], ['debug', 'debugLog'], ['onwarn', { message: 'warnWarn' }], ['warn', 'warnWarn'], ['onwarn', { message: 'warnWarn-' }], ['onwarn', { message: 'warnWarn+-' }], ['warn', 'log was replaced'], ['onwarn', { message: 'warnWarn*-' }], ['warn', 'log was replaced with string'] ]); assert.strictEqual(logs[0][1].toString(), 'warnLog'); assert.strictEqual(logs[2][1].toString(), '(fooPlugin plugin) fooFile (1:2) warnLog'); }, options: { logLevel: 'debug', onwarn(warning, handler) { logs.push(['onwarn', warning]); if (!warning.message.endsWith('-')) { handler(warning); } else if (warning.message.endsWith('+-')) { handler({ message: 'log was replaced' }); } else if (warning.message.endsWith('*-')) { handler('log was replaced with string'); } }, onLog: null, plugins: [ { name: 'test', buildStart(options) { options.onLog('warn', { message: 'warnLog' }); options.onLog('warn', { message: 'warnLog', plugin: 'fooPlugin', loc: { file: 'fooFile', line: 1, column: 2 } }); options.onLog('warn', { message: 'warnLog-' }); options.onLog('warn', { message: 'warnLog+-' }); options.onLog('warn', { message: 'warnLog*-' }); options.onLog('info', { message: 'infoLog' }); options.onLog('debug', { message: 'debugLog' }); options.onwarn({ message: 'warnWarn' }); options.onwarn({ message: 'warnWarn-' }); options.onwarn({ message: 'warnWarn+-' }); options.onwarn({ message: 'warnWarn*-' }); } } ] } }); rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-onwarn/main.js000066400000000000000000000000211450520414700303120ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-simple/000077500000000000000000000000001450520414700270245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-simple/_config.js000066400000000000000000000023311450520414700307650ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; const pluginLogs = []; module.exports = defineTest({ description: 'prints logs from plugins via input options if there are no handlers', before() { console.debug = (...log) => logs.push(['debug', ...log]); console.info = (...log) => logs.push(['info', ...log]); console.warn = (...log) => logs.push(['warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ ['warn', 'warnLog'], ['info', 'infoLog'], ['debug', 'debugLog'], ['warn', 'warnWarn'] ]); assert.deepStrictEqual(pluginLogs, [ ['warn', { message: 'warnLog' }], ['info', { message: 'infoLog' }], ['debug', { message: 'debugLog' }], ['warn', { message: 'warnWarn' }] ]); }, options: { logLevel: 'debug', onwarn: null, onLog: null, plugins: [ { name: 'test', buildStart(options) { options.onLog('warn', { message: 'warnLog' }); options.onLog('info', { message: 'infoLog' }); options.onLog('debug', { message: 'debugLog' }); options.onwarn({ message: 'warnWarn' }); }, onLog(level, log) { pluginLogs.push([level, log]); } } ] } }); rollup-3.29.4/test/function/samples/logging/log-from-plugin-options-simple/main.js000066400000000000000000000000211450520414700302770ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/log-from-plugin-simple/000077500000000000000000000000001450520414700253335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/log-from-plugin-simple/_config.js000066400000000000000000000023161450520414700272770ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; module.exports = defineTest({ description: 'prints logs from plugins via input options if there are no handlers', before() { console.debug = (...log) => logs.push(['debug', ...log]); console.info = (...log) => logs.push(['info', ...log]); console.warn = (...log) => logs.push(['warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ ['warn', '(test plugin) warnLog'], ['warn', '(test plugin) warnString'], ['info', '(test plugin) infoLog'], ['info', '(test plugin) infoString'], ['debug', '(test plugin) debugLog'], ['debug', '(test plugin) debugString'] ]); }, options: { logLevel: 'debug', onwarn: null, onLog: null, plugins: [ { name: 'test', buildStart() { this.warn({ message: 'warnLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.warn('warnString'); this.info({ message: 'infoLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.info('infoString'); this.debug({ message: 'debugLog', pluginCode: 'PLUGIN_CODE', binding: 'foo' }); this.debug('debugString'); } } ] } }); rollup-3.29.4/test/function/samples/logging/log-from-plugin-simple/main.js000066400000000000000000000000211450520414700266060ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/loglevel-debug/000077500000000000000000000000001450520414700237235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/loglevel-debug/_config.js000066400000000000000000000073071450520414700256740ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { debug, info, warn } = console; const ID_MAIN = path.join(__dirname, 'main.js'); const logs = []; let onLogHookTriggered = false; let onLogOptionTriggered = false; module.exports = defineTest({ description: 'shows all logs for logLevel:debug', before() { console.debug = (...log) => logs.push(['console-debug', ...log]); console.info = (...log) => logs.push(['console-info', ...log]); console.warn = (...log) => logs.push(['console-warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ ['debug', { message: 'onLog-debug' }], ['console-debug', 'onLogOption-debug'], ['console-info', 'onLogOption-info'], ['console-warn', 'onLogOption-warn'], ['info', { message: 'onLog-info' }], ['warn', { message: 'onLog-warn' }], ['debug', { message: 'options-debug', code: 'PLUGIN_LOG', plugin: 'test' }], ['info', { message: 'options-info', code: 'PLUGIN_LOG', plugin: 'test' }], ['warn', { message: 'options-warn', code: 'PLUGIN_WARNING', plugin: 'test' }], ['debug', { message: 'buildStart-debug', code: 'PLUGIN_LOG', plugin: 'test' }], ['info', { message: 'buildStart-info', code: 'PLUGIN_LOG', plugin: 'test' }], ['warn', { message: 'buildStart-warn', code: 'PLUGIN_WARNING', plugin: 'test' }], ['debug', { message: 'buildStart-options-debug' }], ['info', { message: 'buildStart-options-info' }], ['warn', { message: 'buildStart-options-warn' }], [ 'debug', { message: 'transform-debug', id: ID_MAIN, hook: 'transform', code: 'PLUGIN_LOG', plugin: 'test' } ], [ 'info', { message: 'transform-info', id: ID_MAIN, hook: 'transform', code: 'PLUGIN_LOG', plugin: 'test' } ], [ 'warn', { message: 'transform-warn', id: ID_MAIN, hook: 'transform', code: 'PLUGIN_WARNING', plugin: 'test' } ], [ 'warn', { code: 'EVAL', id: ID_MAIN, message: 'Use of eval in "main.js" is strongly discouraged as it poses security risks and may cause issues with minification.', url: 'https://rollupjs.org/troubleshooting/#avoiding-eval', pos: 0, loc: { column: 0, file: ID_MAIN, line: 1 }, frame: "1: eval('true');\n ^" } ] ]); }, options: { logLevel: 'debug', onLog(level, log, handler) { logs.push([level, log]); if (!onLogOptionTriggered) { onLogOptionTriggered = true; handler('debug', 'onLogOption-debug'); handler('info', 'onLogOption-info'); handler('warn', 'onLogOption-warn'); } }, plugins: [ { name: 'test', buildStart(options) { let triggered = ''; this.debug(() => { triggered += 'debug'; return 'buildStart-debug'; }); this.info(() => { triggered += 'info'; return 'buildStart-info'; }); this.warn(() => { triggered += 'warn'; return 'buildStart-warn'; }); assert.strictEqual(triggered, 'debuginfowarn'); options.onLog('debug', { message: 'buildStart-options-debug' }); options.onLog('info', { message: 'buildStart-options-info' }); options.onLog('warn', { message: 'buildStart-options-warn' }); }, onLog() { if (!onLogHookTriggered) { onLogHookTriggered = true; this.debug('onLog-debug'); this.info('onLog-info'); this.warn('onLog-warn'); } }, options() { this.debug('options-debug'); this.info('options-info'); this.warn('options-warn'); }, transform() { this.debug('transform-debug'); this.info('transform-info'); this.warn('transform-warn'); } } ] } }); rollup-3.29.4/test/function/samples/logging/loglevel-debug/main.js000066400000000000000000000000161450520414700252020ustar00rootroot00000000000000eval('true'); rollup-3.29.4/test/function/samples/logging/loglevel-info/000077500000000000000000000000001450520414700235705ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/loglevel-info/_config.js000066400000000000000000000063771450520414700255470ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { debug, info, warn } = console; const ID_MAIN = path.join(__dirname, 'main.js'); const logs = []; let onLogHookTriggered = false; let onLogOptionTriggered = false; module.exports = defineTest({ description: 'does not show debug logs for logLevel:info', before() { console.debug = (...log) => logs.push(['console-debug', ...log]); console.info = (...log) => logs.push(['console-info', ...log]); console.warn = (...log) => logs.push(['console-warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ ['info', { message: 'onLog-info' }], ['console-info', 'onLogOption-info'], ['console-warn', 'onLogOption-warn'], ['warn', { message: 'onLog-warn' }], ['info', { message: 'options-info', code: 'PLUGIN_LOG', plugin: 'test' }], ['warn', { message: 'options-warn', code: 'PLUGIN_WARNING', plugin: 'test' }], ['info', { message: 'buildStart-info', code: 'PLUGIN_LOG', plugin: 'test' }], ['warn', { message: 'buildStart-warn', code: 'PLUGIN_WARNING', plugin: 'test' }], ['info', { message: 'buildStart-options-info' }], ['warn', { message: 'buildStart-options-warn' }], [ 'info', { message: 'transform-info', id: ID_MAIN, hook: 'transform', code: 'PLUGIN_LOG', plugin: 'test' } ], [ 'warn', { message: 'transform-warn', id: ID_MAIN, hook: 'transform', code: 'PLUGIN_WARNING', plugin: 'test' } ], [ 'warn', { code: 'EVAL', id: ID_MAIN, message: 'Use of eval in "main.js" is strongly discouraged as it poses security risks and may cause issues with minification.', url: 'https://rollupjs.org/troubleshooting/#avoiding-eval', pos: 0, loc: { column: 0, file: ID_MAIN, line: 1 }, frame: "1: eval('true');\n ^" } ] ]); }, options: { logLevel: 'info', onLog(level, log, handler) { logs.push([level, log]); if (!onLogOptionTriggered) { onLogOptionTriggered = true; handler('debug', 'onLogOption-debug'); handler('info', 'onLogOption-info'); handler('warn', 'onLogOption-warn'); } }, plugins: [ { name: 'test', buildStart(options) { let triggered = ''; this.debug(() => { triggered += 'debug'; return 'buildStart-debug'; }); this.info(() => { triggered += 'info'; return 'buildStart-info'; }); this.warn(() => { triggered += 'warn'; return 'buildStart-warn'; }); assert.strictEqual(triggered, 'infowarn'); options.onLog('debug', { message: 'buildStart-options-debug' }); options.onLog('info', { message: 'buildStart-options-info' }); options.onLog('warn', { message: 'buildStart-options-warn' }); }, onLog() { if (!onLogHookTriggered) { onLogHookTriggered = true; this.debug('onLog-debug'); this.info('onLog-info'); this.warn('onLog-warn'); } }, options() { this.debug('options-debug'); this.info('options-info'); this.warn('options-warn'); }, transform() { this.debug('transform-debug'); this.info('transform-info'); this.warn('transform-warn'); } } ] } }); rollup-3.29.4/test/function/samples/logging/loglevel-info/main.js000066400000000000000000000000161450520414700250470ustar00rootroot00000000000000eval('true'); rollup-3.29.4/test/function/samples/logging/loglevel-silent/000077500000000000000000000000001450520414700241335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/loglevel-silent/_config.js000066400000000000000000000036071450520414700261030ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; let onLogHookTriggered = false; let onLogOptionTriggered = false; module.exports = defineTest({ description: 'does not show logs for logLevel:silent', before() { console.debug = (...log) => logs.push(['console-debug', ...log]); console.info = (...log) => logs.push(['console-info', ...log]); console.warn = (...log) => logs.push(['console-warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, []); }, options: { logLevel: 'silent', onLog(level, log, handler) { logs.push([level, log]); if (!onLogOptionTriggered) { onLogOptionTriggered = true; handler('debug', 'onLogOption-debug'); handler('info', 'onLogOption-info'); handler('warn', 'onLogOption-warn'); } }, plugins: [ { name: 'test', buildStart(options) { let triggered = ''; this.debug(() => { triggered += 'debug'; return 'buildStart-debug'; }); this.info(() => { triggered += 'info'; return 'buildStart-info'; }); this.warn(() => { triggered += 'warn'; return 'buildStart-warn'; }); assert.strictEqual(triggered, ''); options.onLog('debug', { message: 'buildStart-options-debug' }); options.onLog('info', { message: 'buildStart-options-info' }); options.onLog('warn', { message: 'buildStart-options-warn' }); }, onLog() { if (!onLogHookTriggered) { onLogHookTriggered = true; this.debug('onLog-debug'); this.info('onLog-info'); this.warn('onLog-warn'); } }, options() { this.debug('options-debug'); this.info('options-info'); this.warn('options-warn'); }, transform() { this.debug('transform-debug'); this.info('transform-info'); this.warn('transform-warn'); } } ] } }); rollup-3.29.4/test/function/samples/logging/loglevel-silent/main.js000066400000000000000000000000161450520414700254120ustar00rootroot00000000000000eval('true'); rollup-3.29.4/test/function/samples/logging/loglevel-warn/000077500000000000000000000000001450520414700236045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/loglevel-warn/_config.js000066400000000000000000000054731450520414700255570ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { debug, info, warn } = console; const ID_MAIN = path.join(__dirname, 'main.js'); const logs = []; let onLogHookTriggered = false; let onLogOptionTriggered = false; module.exports = defineTest({ description: 'only shows warning logs for logLevel:warn', before() { console.debug = (...log) => logs.push(['console-debug', ...log]); console.info = (...log) => logs.push(['console-info', ...log]); console.warn = (...log) => logs.push(['console-warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, [ ['warn', { message: 'onLog-warn' }], ['console-warn', 'onLogOption-warn'], ['warn', { message: 'options-warn', code: 'PLUGIN_WARNING', plugin: 'test' }], ['warn', { message: 'buildStart-warn', code: 'PLUGIN_WARNING', plugin: 'test' }], ['warn', { message: 'buildStart-options-warn' }], [ 'warn', { message: 'transform-warn', id: ID_MAIN, hook: 'transform', code: 'PLUGIN_WARNING', plugin: 'test' } ], [ 'warn', { code: 'EVAL', id: ID_MAIN, message: 'Use of eval in "main.js" is strongly discouraged as it poses security risks and may cause issues with minification.', url: 'https://rollupjs.org/troubleshooting/#avoiding-eval', pos: 0, loc: { column: 0, file: ID_MAIN, line: 1 }, frame: "1: eval('true');\n ^" } ] ]); }, options: { logLevel: 'warn', onLog(level, log, handler) { logs.push([level, log]); if (!onLogOptionTriggered) { onLogOptionTriggered = true; handler('debug', 'onLogOption-debug'); handler('info', 'onLogOption-info'); handler('warn', 'onLogOption-warn'); } }, plugins: [ { name: 'test', buildStart(options) { let triggered = ''; this.debug(() => { triggered += 'debug'; return 'buildStart-debug'; }); this.info(() => { triggered += 'info'; return 'buildStart-info'; }); this.warn(() => { triggered += 'warn'; return 'buildStart-warn'; }); assert.strictEqual(triggered, 'warn'); options.onLog('debug', { message: 'buildStart-options-debug' }); options.onLog('info', { message: 'buildStart-options-info' }); options.onLog('warn', { message: 'buildStart-options-warn' }); }, onLog() { if (!onLogHookTriggered) { onLogHookTriggered = true; this.debug('onLog-debug'); this.info('onLog-info'); this.warn('onLog-warn'); } }, options() { this.debug('options-debug'); this.info('options-info'); this.warn('options-warn'); }, transform() { this.debug('transform-debug'); this.info('transform-info'); this.warn('transform-warn'); } } ] } }); rollup-3.29.4/test/function/samples/logging/loglevel-warn/main.js000066400000000000000000000000161450520414700250630ustar00rootroot00000000000000eval('true'); rollup-3.29.4/test/function/samples/logging/no-log-with-position/000077500000000000000000000000001450520414700250345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/no-log-with-position/_config.js000066400000000000000000000045161450520414700270040ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not support passing a position to this.warn/info/debug outside the transform hook', options: { logLevel: 'debug', plugins: [ { name: 'test', buildStart() { this.warn('log-message1', 20); this.warn('log-message1', { line: 2, column: 1 }); this.info('log-message1', 20); this.info('log-message1', { line: 2, column: 1 }); this.debug('log-message1', 20); this.debug('log-message1', { line: 2, column: 1 }); } } ] }, logs: [ { level: 'warn', code: 'INVALID_LOG_POSITION', message: 'Plugin "test" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.' }, { level: 'warn', code: 'INVALID_LOG_POSITION', message: 'Plugin "test" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.' }, { level: 'warn', code: 'INVALID_LOG_POSITION', message: 'Plugin "test" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.' }, { level: 'warn', code: 'INVALID_LOG_POSITION', message: 'Plugin "test" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.' }, { level: 'warn', code: 'INVALID_LOG_POSITION', message: 'Plugin "test" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.' }, { level: 'warn', code: 'INVALID_LOG_POSITION', message: 'Plugin "test" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.' }, { level: 'warn', message: 'log-message1', code: 'PLUGIN_WARNING', plugin: 'test' }, { level: 'warn', message: 'log-message1', code: 'PLUGIN_WARNING', plugin: 'test' }, { level: 'info', message: 'log-message1', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'info', message: 'log-message1', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'debug', message: 'log-message1', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'debug', message: 'log-message1', code: 'PLUGIN_LOG', plugin: 'test' } ] }); rollup-3.29.4/test/function/samples/logging/no-log-with-position/main.js000066400000000000000000000000631450520414700263150ustar00rootroot00000000000000assert.ok(true); assert.ok(true); assert.ok(true); rollup-3.29.4/test/function/samples/logging/plugin-order/000077500000000000000000000000001450520414700234355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/plugin-order/_config.js000066400000000000000000000026341450520414700254040ustar00rootroot00000000000000const assert = require('node:assert'); const logs = []; module.exports = defineTest({ description: 'allows to order plugins when logging', options: { logLevel: 'debug', plugins: [ { name: 'first', buildStart() { this.info('first'); this.info('second'); this.info('third'); }, onLog(level, log) { logs.push(['first', level, log]); if (log.message === 'first') { return false; } } }, { name: 'second', onLog: { order: 'pre', handler(level, log) { logs.push(['second', level, log]); if (log.message === 'second') { return false; } } } }, { name: 'third', onLog: { order: 'post', handler(level, log) { logs.push(['third', level, log]); if (log.message === 'third') { return false; } } } } ] }, after() { assert.deepStrictEqual(logs, [ ['second', 'info', { message: 'first', code: 'PLUGIN_LOG', plugin: 'first' }], ['first', 'info', { message: 'first', code: 'PLUGIN_LOG', plugin: 'first' }], ['second', 'info', { message: 'second', code: 'PLUGIN_LOG', plugin: 'first' }], ['second', 'info', { message: 'third', code: 'PLUGIN_LOG', plugin: 'first' }], ['first', 'info', { message: 'third', code: 'PLUGIN_LOG', plugin: 'first' }], ['third', 'info', { message: 'third', code: 'PLUGIN_LOG', plugin: 'first' }] ]); }, logs: [] }); rollup-3.29.4/test/function/samples/logging/plugin-order/main.js000066400000000000000000000000211450520414700247100ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/promote-log-to-error/000077500000000000000000000000001450520414700250415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/promote-log-to-error/_config.js000066400000000000000000000015561450520414700270120ustar00rootroot00000000000000const assert = require('node:assert'); const { debug, info, warn } = console; const logs = []; module.exports = defineTest({ description: 'allows turning logs into errors', before() { console.debug = (...log) => logs.push(['debug', ...log]); console.info = (...log) => logs.push(['info', ...log]); console.warn = (...log) => logs.push(['warn', ...log]); }, after() { Object.assign(console, { debug, info, warn }); assert.deepStrictEqual(logs, []); }, options: { onwarn: null, onLog(_level, log, handler) { handler('error', log); }, plugins: [ { name: 'test', buildStart() { this.info({ message: 'info becomes error', code: 'EXTRA_CODE', binding: 'foo' }); } } ] }, error: { binding: 'foo', code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'info becomes error', plugin: 'test', pluginCode: 'EXTRA_CODE' } }); rollup-3.29.4/test/function/samples/logging/promote-log-to-error/main.js000066400000000000000000000000211450520414700263140ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/this-error-onlog/000077500000000000000000000000001450520414700242405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/this-error-onlog/_config.js000066400000000000000000000006611450520414700262050ustar00rootroot00000000000000module.exports = defineTest({ description: 'can turn logs into errors via this.error in the onLog hook', options: { plugins: [ { name: 'test', buildStart() { this.warn({ message: 'test log', code: 'THE_CODE' }); }, onLog(level, log) { this.error(log); } } ] }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'test log', plugin: 'test', pluginCode: 'THE_CODE' } }); rollup-3.29.4/test/function/samples/logging/this-error-onlog/main.js000066400000000000000000000000211450520414700255130ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/logging/transform-log-with-position/000077500000000000000000000000001450520414700264335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/logging/transform-log-with-position/_config.js000066400000000000000000000070051450520414700303770ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'allows passing a position to this.warn/info/debug in the transform hook', options: { logLevel: 'debug', plugins: [ { name: 'test', transform() { this.warn('warn-message1', 20); this.warn('warn-message2', { line: 2, column: 1 }); this.warn({ message: 'warn-message3', pos: { line: 2, column: 2 } }, 20); this.info('info-message1', 20); this.info('info-message2', { line: 2, column: 1 }); this.info({ message: 'info-message3', pos: { line: 2, column: 2 } }, 20); this.debug('debug-message1', 20); this.debug('debug-message2', { line: 2, column: 1 }); this.debug({ message: 'debug-message3', pos: { line: 2, column: 2 } }, 20); } } ] }, logs: [ { level: 'warn', message: 'warn-message1', pos: 20, loc: { column: 3, file: ID_MAIN, line: 2 }, frame: ` 1: assert.ok(true); 2: assert.ok(true); ^ 3: assert.ok(true);`, id: ID_MAIN, hook: 'transform', code: 'PLUGIN_WARNING', plugin: 'test' }, { level: 'info', message: 'info-message1', pos: 20, loc: { column: 3, file: ID_MAIN, line: 2 }, frame: ` 1: assert.ok(true); 2: assert.ok(true); ^ 3: assert.ok(true);`, id: ID_MAIN, hook: 'transform', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'debug', message: 'debug-message1', pos: 20, loc: { column: 3, file: ID_MAIN, line: 2 }, frame: ` 1: assert.ok(true); 2: assert.ok(true); ^ 3: assert.ok(true);`, id: ID_MAIN, hook: 'transform', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'warn', message: 'warn-message2', loc: { column: 1, file: ID_MAIN, line: 2 }, frame: ` 1: assert.ok(true); 2: assert.ok(true); ^ 3: assert.ok(true);`, id: ID_MAIN, hook: 'transform', code: 'PLUGIN_WARNING', plugin: 'test' }, { level: 'info', message: 'info-message2', loc: { column: 1, file: ID_MAIN, line: 2 }, frame: ` 1: assert.ok(true); 2: assert.ok(true); ^ 3: assert.ok(true);`, id: ID_MAIN, hook: 'transform', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'debug', message: 'debug-message2', loc: { column: 1, file: ID_MAIN, line: 2 }, frame: ` 1: assert.ok(true); 2: assert.ok(true); ^ 3: assert.ok(true);`, id: ID_MAIN, hook: 'transform', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'warn', message: 'warn-message3', pos: 20, loc: { column: 3, file: ID_MAIN, line: 2 }, frame: ` 1: assert.ok(true); 2: assert.ok(true); ^ 3: assert.ok(true);`, id: ID_MAIN, hook: 'transform', code: 'PLUGIN_WARNING', plugin: 'test' }, { level: 'info', message: 'info-message3', pos: 20, loc: { column: 3, file: ID_MAIN, line: 2 }, frame: ` 1: assert.ok(true); 2: assert.ok(true); ^ 3: assert.ok(true);`, id: ID_MAIN, hook: 'transform', code: 'PLUGIN_LOG', plugin: 'test' }, { level: 'debug', message: 'debug-message3', pos: 20, loc: { column: 3, file: ID_MAIN, line: 2 }, frame: ` 1: assert.ok(true); 2: assert.ok(true); ^ 3: assert.ok(true);`, id: ID_MAIN, hook: 'transform', code: 'PLUGIN_LOG', plugin: 'test' } ] }); rollup-3.29.4/test/function/samples/logging/transform-log-with-position/main.js000066400000000000000000000000631450520414700277140ustar00rootroot00000000000000assert.ok(true); assert.ok(true); assert.ok(true); rollup-3.29.4/test/function/samples/long-path-deopt/000077500000000000000000000000001450520414700224025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/long-path-deopt/_config.js000066400000000000000000000001601450520414700243410ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes getting return expression for long property paths' }); rollup-3.29.4/test/function/samples/long-path-deopt/main.js000066400000000000000000000005131450520414700236630ustar00rootroot00000000000000let effect = false; const obj = { a: { b: { c: { d: { e: { f: { g: { h: { i: { j: { k: () => ({ effect: () => (effect = true) }) } } } } } } } } } } }; obj.a.b.c.d.e.f.g.h.i.j.k().effect(); assert.ok(effect); rollup-3.29.4/test/function/samples/manual-chunks-conflict/000077500000000000000000000000001450520414700237455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/manual-chunks-conflict/_config.js000066400000000000000000000005431450520414700257110ustar00rootroot00000000000000module.exports = defineTest({ description: 'Throws for conflicts between manual chunks', options: { input: ['main.js'], output: { manualChunks: { dep1: ['dep.js'], dep2: ['dep.js'] } } }, generateError: { code: 'INVALID_CHUNK', message: 'Cannot assign "dep.js" to the "dep2" chunk as it is already in the "dep1" chunk.' } }); rollup-3.29.4/test/function/samples/manual-chunks-conflict/dep.js000066400000000000000000000000241450520414700250470ustar00rootroot00000000000000console.log('dep'); rollup-3.29.4/test/function/samples/manual-chunks-conflict/main.js000066400000000000000000000000231450520414700252220ustar00rootroot00000000000000import './dep.js'; rollup-3.29.4/test/function/samples/manual-chunks-include-external-modules/000077500000000000000000000000001450520414700270555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/manual-chunks-include-external-modules/_config.js000066400000000000000000000013311450520414700310150ustar00rootroot00000000000000const path = require('node:path'); const externalModule = path.join(__dirname, 'external.js'); module.exports = defineTest({ description: "throws for manualChunks' modules that are resolved as an external module by plugins", options: { output: { manualChunks: { external: [externalModule] } }, plugins: [ { resolveId(id) { if (id.endsWith('external.js')) { return { id: externalModule, external: true }; } } } ] }, generateError: { code: 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', message: `"${externalModule}" cannot be included in manualChunks because it is resolved as an external module by the "external" option or plugins.` } }); rollup-3.29.4/test/function/samples/manual-chunks-include-external-modules/external.js000066400000000000000000000000211450520414700312260ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/manual-chunks-include-external-modules/main.js000066400000000000000000000000301450520414700303300ustar00rootroot00000000000000import './external.js'; rollup-3.29.4/test/function/samples/manual-chunks-include-external-modules3/000077500000000000000000000000001450520414700271405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/manual-chunks-include-external-modules3/_config.js000066400000000000000000000014371450520414700311070ustar00rootroot00000000000000const path = require('node:path'); const externalModule = path.join(__dirname, 'external.js'); module.exports = defineTest({ description: "throws an error EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES for manualChunks' modules that are resolved as an external module by the 'external' option", options: { external: id => { if (id.endsWith('external.js')) { return true; } }, output: { manualChunks: { external: [externalModule] } } }, generateError: { code: 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', message: `${externalModule} is resolved as a module now, but it was an external module before. Please check whether there are conflicts in your Rollup options "external" and "manualChunks", manualChunks cannot include external modules.` } }); rollup-3.29.4/test/function/samples/manual-chunks-include-external-modules3/external.js000066400000000000000000000000211450520414700313110ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/manual-chunks-include-external-modules3/main.js000066400000000000000000000000301450520414700304130ustar00rootroot00000000000000import './external.js'; rollup-3.29.4/test/function/samples/manual-chunks-info/000077500000000000000000000000001450520414700230775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/manual-chunks-info/_config.js000066400000000000000000000210141450520414700250370ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { getObject } = require('../../../utils'); function getId(name) { return path.join(__dirname, `${name}.js`); } module.exports = defineTest({ description: 'provides additional chunk information to a manualChunks function', options: { external: 'external', output: { manualChunks(id, { getModuleIds, getModuleInfo }) { assert.deepStrictEqual( getObject( [...getModuleIds()] .sort() .map(id => [id, JSON.parse(JSON.stringify(getModuleInfo(id)))]) ), { [getId('dynamic')]: { id: getId('dynamic'), assertions: {}, ast: { type: 'Program', start: 0, end: 88, body: [ { type: 'ExportNamedDeclaration', start: 0, end: 42, declaration: { type: 'VariableDeclaration', start: 7, end: 42, declarations: [ { type: 'VariableDeclarator', start: 13, end: 41, id: { type: 'Identifier', start: 13, end: 20, name: 'promise' }, init: { type: 'ImportExpression', start: 23, end: 41, source: { type: 'Literal', start: 30, end: 40, value: 'external', raw: "'external'" } } } ], kind: 'const' }, specifiers: [], source: null }, { type: 'ExportNamedDeclaration', start: 43, end: 87, declaration: null, specifiers: [ { type: 'ExportSpecifier', start: 52, end: 71, local: { type: 'Identifier', start: 52, end: 59, name: 'default' }, exported: { type: 'Identifier', start: 63, end: 71, name: 'internal' } } ], source: { type: 'Literal', start: 79, end: 86, value: './lib', raw: "'./lib'" } } ], sourceType: 'module' }, code: "export const promise = import('external');\nexport { default as internal } from './lib';\n", dynamicallyImportedIdResolutions: [ { assertions: {}, external: true, id: 'external', meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], dynamicallyImportedIds: ['external'], dynamicImporters: [getId('main')], exportedBindings: { '.': ['promise'], './lib': ['internal'] }, exports: ['promise', 'internal'], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: getId('lib'), meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [getId('lib')], importers: [], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }, [getId('lib')]: { id: getId('lib'), assertions: {}, ast: { type: 'Program', start: 0, end: 19, body: [ { type: 'ExportDefaultDeclaration', start: 0, end: 18, declaration: { type: 'Literal', start: 15, end: 17, value: 42, raw: '42' } } ], sourceType: 'module' }, code: 'export default 42;\n', dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': ['default'] }, exports: ['default'], hasDefaultExport: true, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [getId('dynamic'), getId('main')], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }, [getId('main')]: { id: getId('main'), assertions: {}, ast: { type: 'Program', start: 0, end: 123, body: [ { type: 'ExportNamedDeclaration', start: 0, end: 43, declaration: { type: 'VariableDeclaration', start: 7, end: 43, declarations: [ { type: 'VariableDeclarator', start: 13, end: 42, id: { type: 'Identifier', start: 13, end: 20, name: 'promise' }, init: { type: 'ImportExpression', start: 23, end: 42, source: { type: 'Literal', start: 30, end: 41, value: './dynamic', raw: "'./dynamic'" } } } ], kind: 'const' }, specifiers: [], source: null }, { type: 'ExportNamedDeclaration', start: 44, end: 85, declaration: null, specifiers: [ { type: 'ExportSpecifier', start: 53, end: 69, local: { type: 'Identifier', start: 53, end: 60, name: 'default' }, exported: { type: 'Identifier', start: 64, end: 69, name: 'value' } } ], source: { type: 'Literal', start: 77, end: 84, value: './lib', raw: "'./lib'" } }, { type: 'ExportNamedDeclaration', start: 86, end: 122, declaration: null, specifiers: [ { type: 'ExportSpecifier', start: 95, end: 103, local: { type: 'Identifier', start: 95, end: 103, name: 'external' }, exported: { type: 'Identifier', start: 95, end: 103, name: 'external' } } ], source: { type: 'Literal', start: 111, end: 121, value: 'external', raw: "'external'" } } ], sourceType: 'module' }, code: "export const promise = import('./dynamic');\nexport { default as value } from './lib';\nexport { external } from 'external';\n", dynamicallyImportedIdResolutions: [ { assertions: {}, external: false, id: getId('dynamic'), meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], dynamicallyImportedIds: [getId('dynamic')], dynamicImporters: [], exportedBindings: { '.': ['promise'], './lib': ['value'], external: ['external'] }, exports: ['promise', 'value', 'external'], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: getId('lib'), meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }, { assertions: {}, external: true, id: 'external', meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [getId('lib'), 'external'], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }, external: { id: 'external', assertions: {}, ast: null, code: null, dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [getId('dynamic')], exportedBindings: null, exports: null, hasDefaultExport: null, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [getId('main')], isEntry: false, isExternal: true, isIncluded: null, meta: {}, syntheticNamedExports: false } } ); } } } }); rollup-3.29.4/test/function/samples/manual-chunks-info/dynamic.js000066400000000000000000000001301450520414700250530ustar00rootroot00000000000000export const promise = import('external'); export { default as internal } from './lib'; rollup-3.29.4/test/function/samples/manual-chunks-info/lib.js000066400000000000000000000000231450520414700241760ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/manual-chunks-info/main.js000066400000000000000000000001731450520414700243620ustar00rootroot00000000000000export const promise = import('./dynamic'); export { default as value } from './lib'; export { external } from 'external'; rollup-3.29.4/test/function/samples/mark-namespace-members/000077500000000000000000000000001450520414700237145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/mark-namespace-members/_config.js000066400000000000000000000001121450520414700256500ustar00rootroot00000000000000module.exports = defineTest({ description: 'marks namespace members' }); rollup-3.29.4/test/function/samples/mark-namespace-members/bar.js000066400000000000000000000000651450520414700250170ustar00rootroot00000000000000function bar () { return 42; } export default bar; rollup-3.29.4/test/function/samples/mark-namespace-members/foo.js000066400000000000000000000000501450520414700250300ustar00rootroot00000000000000export { default as bar } from './bar'; rollup-3.29.4/test/function/samples/mark-namespace-members/main.js000066400000000000000000000001301450520414700251700ustar00rootroot00000000000000import * as foo from './foo'; var member = 'bar'; assert.equal( foo[ member ](), 42 ); rollup-3.29.4/test/function/samples/max-parallel-file-operations/000077500000000000000000000000001450520414700250555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/max-parallel-file-operations/default/000077500000000000000000000000001450520414700265015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/max-parallel-file-operations/default/1.js000066400000000000000000000000251450520414700271740ustar00rootroot00000000000000export const x1 = 1; rollup-3.29.4/test/function/samples/max-parallel-file-operations/default/2.js000066400000000000000000000000251450520414700271750ustar00rootroot00000000000000export const x2 = 2; rollup-3.29.4/test/function/samples/max-parallel-file-operations/default/3.js000066400000000000000000000000251450520414700271760ustar00rootroot00000000000000export const x3 = 3; rollup-3.29.4/test/function/samples/max-parallel-file-operations/default/4.js000066400000000000000000000000251450520414700271770ustar00rootroot00000000000000export const x4 = 4; rollup-3.29.4/test/function/samples/max-parallel-file-operations/default/5.js000066400000000000000000000000251450520414700272000ustar00rootroot00000000000000export const x5 = 5; rollup-3.29.4/test/function/samples/max-parallel-file-operations/default/_config.js000066400000000000000000000012141450520414700304410ustar00rootroot00000000000000const assert = require('node:assert'); const { promises: fs } = require('node:fs'); const { wait } = require('../../../../utils'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = defineTest({ description: 'maxParallelFileOps not set', before() { fs.readFile = async (path, options) => { currentReads++; maxReads = Math.max(maxReads, currentReads); const content = await fsReadFile(path, options); await wait(50); currentReads--; return content; }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 5, 'Wrong number of parallel file reads: ' + maxReads); } }); rollup-3.29.4/test/function/samples/max-parallel-file-operations/default/main.js000066400000000000000000000001511450520414700277600ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-3.29.4/test/function/samples/max-parallel-file-operations/error/000077500000000000000000000000001450520414700262065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/max-parallel-file-operations/error/_config.js000066400000000000000000000013131450520414700301460ustar00rootroot00000000000000const { promises: fs } = require('node:fs'); const { join } = require('node:path'); const { loader } = require('../../../../utils.js'); const fsReadFile = fs.readFile; module.exports = defineTest({ description: 'maxParallelFileOps: fileRead error is forwarded', options: { input: 'main', plugins: loader({ main: `import {foo} from './dep';` }) }, before() { fs.readFile = (path, options) => { if (path.endsWith('dep.js')) { throw new Error('broken'); } fsReadFile(path, options); }; }, after() { fs.readFile = fsReadFile; }, error: { message: `Could not load ${join(__dirname, 'dep.js')} (imported by main): broken`, watchFiles: [join(__dirname, 'dep.js'), 'main'] } }); rollup-3.29.4/test/function/samples/max-parallel-file-operations/error/dep.js000066400000000000000000000000001450520414700273020ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/max-parallel-file-operations/infinity/000077500000000000000000000000001450520414700267065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/max-parallel-file-operations/infinity/1.js000066400000000000000000000000251450520414700274010ustar00rootroot00000000000000export const x1 = 1; rollup-3.29.4/test/function/samples/max-parallel-file-operations/infinity/2.js000066400000000000000000000000251450520414700274020ustar00rootroot00000000000000export const x2 = 2; rollup-3.29.4/test/function/samples/max-parallel-file-operations/infinity/3.js000066400000000000000000000000251450520414700274030ustar00rootroot00000000000000export const x3 = 3; rollup-3.29.4/test/function/samples/max-parallel-file-operations/infinity/4.js000066400000000000000000000000251450520414700274040ustar00rootroot00000000000000export const x4 = 4; rollup-3.29.4/test/function/samples/max-parallel-file-operations/infinity/5.js000066400000000000000000000000251450520414700274050ustar00rootroot00000000000000export const x5 = 5; rollup-3.29.4/test/function/samples/max-parallel-file-operations/infinity/_config.js000066400000000000000000000012741450520414700306540ustar00rootroot00000000000000const assert = require('node:assert'); const { promises: fs } = require('node:fs'); const { wait } = require('../../../../utils'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = defineTest({ description: 'maxParallelFileOps set to infinity', options: { maxParallelFileOps: 0 }, before() { fs.readFile = async (path, options) => { currentReads++; maxReads = Math.max(maxReads, currentReads); const content = await fsReadFile(path, options); await wait(50); currentReads--; return content; }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 5, 'Wrong number of parallel file reads: ' + maxReads); } }); rollup-3.29.4/test/function/samples/max-parallel-file-operations/infinity/main.js000066400000000000000000000001511450520414700301650ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-3.29.4/test/function/samples/max-parallel-file-operations/set/000077500000000000000000000000001450520414700256505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/max-parallel-file-operations/set/1.js000066400000000000000000000000251450520414700263430ustar00rootroot00000000000000export const x1 = 1; rollup-3.29.4/test/function/samples/max-parallel-file-operations/set/2.js000066400000000000000000000000251450520414700263440ustar00rootroot00000000000000export const x2 = 2; rollup-3.29.4/test/function/samples/max-parallel-file-operations/set/3.js000066400000000000000000000000251450520414700263450ustar00rootroot00000000000000export const x3 = 3; rollup-3.29.4/test/function/samples/max-parallel-file-operations/set/4.js000066400000000000000000000000251450520414700263460ustar00rootroot00000000000000export const x4 = 4; rollup-3.29.4/test/function/samples/max-parallel-file-operations/set/5.js000066400000000000000000000000251450520414700263470ustar00rootroot00000000000000export const x5 = 5; rollup-3.29.4/test/function/samples/max-parallel-file-operations/set/_config.js000066400000000000000000000012651450520414700276160ustar00rootroot00000000000000const assert = require('node:assert'); const { promises: fs } = require('node:fs'); const { wait } = require('../../../../utils'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = defineTest({ description: 'maxParallelFileOps set to 3', options: { maxParallelFileOps: 3 }, before() { fs.readFile = async (path, options) => { currentReads++; maxReads = Math.max(maxReads, currentReads); const content = await fsReadFile(path, options); await wait(50); currentReads--; return content; }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads); } }); rollup-3.29.4/test/function/samples/max-parallel-file-operations/set/main.js000066400000000000000000000001511450520414700271270ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-3.29.4/test/function/samples/max-parallel-file-operations/with-plugin/000077500000000000000000000000001450520414700273245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/max-parallel-file-operations/with-plugin/1.js000066400000000000000000000000251450520414700300170ustar00rootroot00000000000000export const x1 = 1; rollup-3.29.4/test/function/samples/max-parallel-file-operations/with-plugin/2.js000066400000000000000000000000251450520414700300200ustar00rootroot00000000000000export const x2 = 2; rollup-3.29.4/test/function/samples/max-parallel-file-operations/with-plugin/3.js000066400000000000000000000000251450520414700300210ustar00rootroot00000000000000export const x3 = 3; rollup-3.29.4/test/function/samples/max-parallel-file-operations/with-plugin/4.js000066400000000000000000000000251450520414700300220ustar00rootroot00000000000000export const x4 = 4; rollup-3.29.4/test/function/samples/max-parallel-file-operations/with-plugin/5.js000066400000000000000000000000251450520414700300230ustar00rootroot00000000000000export const x5 = 5; rollup-3.29.4/test/function/samples/max-parallel-file-operations/with-plugin/_config.js000066400000000000000000000014161450520414700312700ustar00rootroot00000000000000const assert = require('node:assert'); const { promises: fs } = require('node:fs'); const { wait } = require('../../../../utils'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = defineTest({ description: 'maxParallelFileOps with plugin', options: { maxParallelFileOps: 3, plugins: [ { load(id) { return fs.readFile(id, 'utf8'); } } ] }, before() { fs.readFile = async (path, options) => { currentReads++; maxReads = Math.max(maxReads, currentReads); const content = await fsReadFile(path, options); await wait(50); currentReads--; return content; }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads); } }); rollup-3.29.4/test/function/samples/max-parallel-file-operations/with-plugin/main.js000066400000000000000000000001511450520414700306030ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-3.29.4/test/function/samples/member-expression-assignment-in-function/000077500000000000000000000000001450520414700274415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/member-expression-assignment-in-function/_config.js000066400000000000000000000005561450520414700314110ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'detect side effect in member expression assignment when not top level', code(code) { assert.ok(code.includes('function set(key, value) { foo[key] = value; }'), code); assert.ok(code.includes('set("bar", 2);'), code); assert.ok(code.includes('set("qux", 3);'), code); } }); rollup-3.29.4/test/function/samples/member-expression-assignment-in-function/main.js000066400000000000000000000002171450520414700307230ustar00rootroot00000000000000var foo = {}; function set(key, value) { foo[key] = value; } set("bar", 2); set("qux", 3); assert.deepStrictEqual(foo, { bar: 2, qux: 3 }); rollup-3.29.4/test/function/samples/merged-namespace-live-bindings/000077500000000000000000000000001450520414700253255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/merged-namespace-live-bindings/_config.js000066400000000000000000000006571450520414700272770ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects getters when accessing properties of an instance', context: { require(id) { if (id === 'external') { let external = 'original'; return { get external() { return external; }, updateExternal() { external = 'updated'; } }; } throw new Error(`Unexpected import "${id}".`); } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/merged-namespace-live-bindings/internal.js000066400000000000000000000001701450520414700274750ustar00rootroot00000000000000export let internal = 'original'; export const updateInternal = () => (internal = 'updated'); export default 'ignored'; rollup-3.29.4/test/function/samples/merged-namespace-live-bindings/main.js000066400000000000000000000005541450520414700266130ustar00rootroot00000000000000import * as ns from './reexport'; const checkNamespace = ns => { assert.strictEqual(ns.internal, 'original', 'internal'); ns.updateInternal(); assert.strictEqual(ns.internal, 'updated', 'internal'); assert.strictEqual(ns.external, 'original', 'external'); ns.updateExternal(); assert.strictEqual(ns.external, 'updated', 'external'); }; checkNamespace(ns); rollup-3.29.4/test/function/samples/merged-namespace-live-bindings/reexport.js000066400000000000000000000000661450520414700275350ustar00rootroot00000000000000export * from './internal'; export * from 'external'; rollup-3.29.4/test/function/samples/method-call-mutates-this/000077500000000000000000000000001450520414700242165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/method-call-mutates-this/_config.js000066400000000000000000000001371450520414700261610ustar00rootroot00000000000000module.exports = defineTest({ description: 'method calls are assumed to mutate the owner' }); rollup-3.29.4/test/function/samples/method-call-mutates-this/foo.js000066400000000000000000000003241450520414700253360ustar00rootroot00000000000000var obj = { set: function ( key, value ) { this[ key ] = value; }, get: function ( key ) { return this[ key ]; } }; obj.set( 'answer', 42 ); export default function ( key ) { return obj.get( key ); } rollup-3.29.4/test/function/samples/method-call-mutates-this/main.js000066400000000000000000000000771450520414700255040ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo( 'answer' ), 42 ); rollup-3.29.4/test/function/samples/method-call-side-effects/000077500000000000000000000000001450520414700241305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/method-call-side-effects/_config.js000066400000000000000000000001511450520414700260670ustar00rootroot00000000000000module.exports = defineTest({ description: 'assumes methods may mutate objects passed in, and self' }); rollup-3.29.4/test/function/samples/method-call-side-effects/main.js000066400000000000000000000001761450520414700254160ustar00rootroot00000000000000import object from './object'; import thing from './thing'; assert.ok( object.mutated ); assert.ok( thing.methodWasCalled ); rollup-3.29.4/test/function/samples/method-call-side-effects/object.js000066400000000000000000000001361450520414700257340ustar00rootroot00000000000000import thing from './thing'; var object = {}; thing.mutate( object ); export default object;rollup-3.29.4/test/function/samples/method-call-side-effects/thing.js000066400000000000000000000002071450520414700255760ustar00rootroot00000000000000export default { mutate: function ( object ) { object.mutated = true; this.methodWasCalled = true; }, methodWasCalled: false };rollup-3.29.4/test/function/samples/missing-export-preserve-modules/000077500000000000000000000000001450520414700256675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/missing-export-preserve-modules/_config.js000066400000000000000000000006411450520414700276320ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'supports shimming missing exports when preserving modules', options: { shimMissingExports: true, output: { preserveModules: true } }, warnings: [ { binding: 'bar', code: 'SHIMMED_EXPORT', exporter: path.join(__dirname, 'foo.js'), message: 'Missing export "bar" has been shimmed in module "foo.js".' } ] }); rollup-3.29.4/test/function/samples/missing-export-preserve-modules/foo.js000066400000000000000000000000321450520414700270030ustar00rootroot00000000000000export const foo = 'foo'; rollup-3.29.4/test/function/samples/missing-export-preserve-modules/main.js000066400000000000000000000001011450520414700271410ustar00rootroot00000000000000import { bar } from './foo'; assert.strictEqual(bar, undefined); rollup-3.29.4/test/function/samples/missing-spaces-after-simplification/000077500000000000000000000000001450520414700264345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/missing-spaces-after-simplification/_config.js000066400000000000000000000003321450520414700303740ustar00rootroot00000000000000module.exports = defineTest({ description: 'handle situations where the simplification of an expression can lead to issues due to missing white-space', options: { treeshake: { tryCatchDeoptimization: false } } }); rollup-3.29.4/test/function/samples/missing-spaces-after-simplification/main.js000066400000000000000000000006661450520414700277260ustar00rootroot00000000000000let result = ''; const a = { a: true }; for (const key in!0?a:a) result += key; const b = ['b']; for (const value of!0?b:b) result += value; const c = 'c'; function testReturn() { return!0?c:c; } result += testReturn(); const d = 'd'; function* testYield() { yield!0?d:d; } for (const value of testYield()) result += value; const e = 'e'; try { throw!0?e:e; } catch (err) { result += err; } assert.strictEqual(result, 'abcde'); rollup-3.29.4/test/function/samples/mixed-external-paths/000077500000000000000000000000001450520414700234435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/mixed-external-paths/_config.js000066400000000000000000000006031450520414700254040ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows using the path option selectively', options: { external: ['dep-a', 'dep-b'], output: { paths: { 'dep-a': 'secret-dep' } } }, context: { require(id) { if (id === 'secret-dep') { return 'secret'; } if (id === 'dep-b') { return 'b'; } throw new Error(`Unexpected dependency ${id}`); } } }); rollup-3.29.4/test/function/samples/mixed-external-paths/main.js000066400000000000000000000001401450520414700247200ustar00rootroot00000000000000import a from 'dep-a'; import b from 'dep-b'; assert.equal(a, 'secret'); assert.equal(b, 'b'); rollup-3.29.4/test/function/samples/modify-assumed-global/000077500000000000000000000000001450520414700235645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-assumed-global/_config.js000066400000000000000000000004061450520414700255260ustar00rootroot00000000000000const assert = require('node:assert'); const Math = {}; module.exports = defineTest({ description: 'side-effects to assumed globals are included', context: { Math }, exports() { assert.equal(Math.square(3), 9); assert.equal(Math.cube(3), 27); } }); rollup-3.29.4/test/function/samples/modify-assumed-global/main.js000066400000000000000000000001021450520414700250370ustar00rootroot00000000000000import { square } from './math'; assert.equal( square( 2 ), 4 ); rollup-3.29.4/test/function/samples/modify-assumed-global/math.js000066400000000000000000000002441450520414700250530ustar00rootroot00000000000000function square ( x ) { return x * x; } function cube ( x ) { return x * x * x; } Math.square = square; if ( true ) { Math.cube = cube; } export { square }; rollup-3.29.4/test/function/samples/modify-meta/000077500000000000000000000000001450520414700216135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-meta/_config.js000066400000000000000000000032371450520414700235620ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); let initialMeta; module.exports = defineTest({ description: 'allows to freely modify moduleInfo.meta and maintain object identity', options: { plugins: [ { name: 'first', buildStart() { this.load({ id: ID_MAIN }); initialMeta = this.getModuleInfo(ID_MAIN).meta; initialMeta.buildStart = true; }, load(id) { assert.strictEqual(id, ID_MAIN); const meta = this.getModuleInfo(ID_MAIN).meta; assert.deepStrictEqual(meta, { buildStart: true }, 'load'); assert.strictEqual(meta, initialMeta); meta.load1a = true; return { code: `assert.ok(true);`, meta: { load1b: true } }; }, transform(code, id) { assert.strictEqual(id, ID_MAIN); const meta = this.getModuleInfo(ID_MAIN).meta; assert.deepStrictEqual( meta, { buildStart: true, load1a: true, load1b: true }, 'transform' ); assert.strictEqual(meta, initialMeta); meta.transform1a = true; return { code: `assert.ok(true);`, meta: { transform1b: true } }; }, buildEnd(error) { if (error) { throw error; } const meta = this.getModuleInfo(ID_MAIN).meta; assert.deepStrictEqual( meta, { buildStart: true, load1a: true, load1b: true, transform1a: true, transform1b: true, transform2: true }, 'buildEnd' ); } }, { name: 'second', transform(code, id) { assert.strictEqual(id, ID_MAIN); return { code: `assert.ok(true);`, meta: { transform2: true } }; } } ] } }); rollup-3.29.4/test/function/samples/modify-meta/main.js000066400000000000000000000000211450520414700230660ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/modify-object-via-this-a/000077500000000000000000000000001450520414700240735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-object-via-this-a/_config.js000066400000000000000000000001301450520414700260270ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks object modification via "this"' }); rollup-3.29.4/test/function/samples/modify-object-via-this-a/main.js000066400000000000000000000002161450520414700253540ustar00rootroot00000000000000const obj = { modify() { this.modified = true; } }; obj.modify(); assert.strictEqual(obj.modified ? 'MODIFIED' : 'BROKEN', 'MODIFIED'); rollup-3.29.4/test/function/samples/modify-object-via-this-b/000077500000000000000000000000001450520414700240745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-object-via-this-b/_config.js000066400000000000000000000001301450520414700260300ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks object modification via "this"' }); rollup-3.29.4/test/function/samples/modify-object-via-this-b/main.js000066400000000000000000000002301450520414700253510ustar00rootroot00000000000000const obj = {}; function modify() { this.modified = true; } modify.call(obj); assert.strictEqual(obj.modified ? 'MODIFIED' : 'BROKEN', 'MODIFIED'); rollup-3.29.4/test/function/samples/modify-object-via-this-c/000077500000000000000000000000001450520414700240755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-object-via-this-c/_config.js000066400000000000000000000001301450520414700260310ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks object modification via "this"' }); rollup-3.29.4/test/function/samples/modify-object-via-this-c/main.js000066400000000000000000000002521450520414700253560ustar00rootroot00000000000000const obj = {}; obj.modify = modify; function modify() { this.modified = true; } obj.modify(); assert.strictEqual(obj.modified ? 'MODIFIED' : 'BROKEN', 'MODIFIED'); rollup-3.29.4/test/function/samples/modify-object-via-this-d/000077500000000000000000000000001450520414700240765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-object-via-this-d/_config.js000066400000000000000000000001301450520414700260320ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks object modification via "this"' }); rollup-3.29.4/test/function/samples/modify-object-via-this-d/main.js000066400000000000000000000002701450520414700253570ustar00rootroot00000000000000const obj = { modify() {} }; obj.modify = modify; function modify() { this.modified = true; } obj.modify(); assert.strictEqual(obj.modified ? 'MODIFIED' : 'BROKEN', 'MODIFIED'); rollup-3.29.4/test/function/samples/modify-this-via-getter/000077500000000000000000000000001450520414700237015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/deoptimized-props-with-getter/000077500000000000000000000000001450520414700316205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/deoptimized-props-with-getter/_config.js000066400000000000000000000002761450520414700335670ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles fully deoptimized objects', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/modify-this-via-getter/deoptimized-props-with-getter/main.js000066400000000000000000000003301450520414700330760ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { flag: false }; Object.defineProperty(obj, unknown, { get() { this.flag = true; } }); obj.prop; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-getter/getter-in-assignment/000077500000000000000000000000001450520414700277455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/getter-in-assignment/_config.js000066400000000000000000000001551450520414700317100ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles known getters that are triggered via an assignment' }); rollup-3.29.4/test/function/samples/modify-this-via-getter/getter-in-assignment/main.js000066400000000000000000000002601450520414700312250ustar00rootroot00000000000000const obj = { flag: false, get prop() { this.flag = true; return 1; }, set prop(v) {} }; obj.prop += 1; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-getter/getters-on-this/000077500000000000000000000000001450520414700267355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/getters-on-this/_config.js000066400000000000000000000001241450520414700306740ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles calling getters on "this"' }); rollup-3.29.4/test/function/samples/modify-this-via-getter/getters-on-this/main.js000066400000000000000000000010631450520414700302170ustar00rootroot00000000000000const obj = { flag1: false, flag2: false, flag3: false, flag4: false, prop1() { this.flag1 = true; this.prop2(); }, prop2() { this.flag2 = true; this.prop3; }, get prop3() { this.flag3 = true; this.prop4 = true; }, set prop4(value) { this.flag4 = value; } }; obj.prop1(); if (!obj.flag1) { throw new Error('mutation 1 not detected'); } if (!obj.flag2) { throw new Error('mutation 2 not detected'); } if (!obj.flag3) { throw new Error('mutation 3 not detected'); } if (!obj.flag4) { throw new Error('mutation 4 not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-getter/known-getter/000077500000000000000000000000001450520414700263255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/known-getter/_config.js000066400000000000000000000001331450520414700302640ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles known getters that modify "this"' }); rollup-3.29.4/test/function/samples/modify-this-via-getter/known-getter/main.js000066400000000000000000000002161450520414700276060ustar00rootroot00000000000000const obj = { flag: false, get prop() { this.flag = true; } }; obj.prop; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-getter/known-super-prop/000077500000000000000000000000001450520414700271475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/known-super-prop/_config.js000066400000000000000000000001701450520414700311070ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles getters that modify "this" on prototypes for known properties' }); rollup-3.29.4/test/function/samples/modify-this-via-getter/known-super-prop/main.js000066400000000000000000000002701450520414700304300ustar00rootroot00000000000000class proto { static flag = false; static get prop() { this.flag = true; } } class obj extends proto {} obj.prop; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-prop-getter/000077500000000000000000000000001450520414700276465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-prop-getter/_config.js000066400000000000000000000003071450520414700316100ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles unknown getters that modify "this"', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-prop-getter/main.js000066400000000000000000000002701450520414700311270ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { get [unknown]() { this.flag = true; }, flag: false }; obj.prop; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-prop-unknown-access/000077500000000000000000000000001450520414700313125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-prop-unknown-access/_config.js000066400000000000000000000003431450520414700332540ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles unknown getters that modify "this" for unknown property access', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-prop-unknown-access/main.js000066400000000000000000000002741450520414700325770ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { get [unknown]() { this.flag = true; }, flag: false }; obj[unknown]; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-property-access/000077500000000000000000000000001450520414700305215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-property-access/_config.js000066400000000000000000000003331450520414700324620ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles getters that modify "this" for unknown property access', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-property-access/main.js000066400000000000000000000002671450520414700320100ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { flag: false, get prop() { this.flag = true; } }; obj[unknown]; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-super-prop/000077500000000000000000000000001450520414700275125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-super-prop/_config.js000066400000000000000000000003441450520414700314550ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles getters that modify "this" on prototypes for unknown properties', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/modify-this-via-getter/unknown-super-prop/main.js000066400000000000000000000003411450520414700307720ustar00rootroot00000000000000import { unknown } from 'external'; class proto { static flag = false; static get prop() { this.flag = true; } } class obj extends proto {} obj[unknown]; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-setter/000077500000000000000000000000001450520414700237155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-setter/deoptimized-props-with-setter/000077500000000000000000000000001450520414700316505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-setter/deoptimized-props-with-setter/_config.js000066400000000000000000000002761450520414700336170ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles fully deoptimized objects', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/modify-this-via-setter/deoptimized-props-with-setter/main.js000066400000000000000000000003451450520414700331340ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { flag: false }; Object.defineProperty(obj, unknown, { set(value) { this.flag = value; } }); obj.prop = true; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-setter/known-setter/000077500000000000000000000000001450520414700263555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-setter/known-setter/_config.js000066400000000000000000000001331450520414700303140ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles known setters that modify "this"' }); rollup-3.29.4/test/function/samples/modify-this-via-setter/known-setter/main.js000066400000000000000000000002331450520414700276350ustar00rootroot00000000000000const obj = { flag: false, set prop(value) { this.flag = value; } }; obj.prop = true; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-setter/known-super-prop/000077500000000000000000000000001450520414700271635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-setter/known-super-prop/_config.js000066400000000000000000000001701450520414700311230ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles setters that modify "this" on prototypes for known properties' }); rollup-3.29.4/test/function/samples/modify-this-via-setter/known-super-prop/main.js000066400000000000000000000003051450520414700304430ustar00rootroot00000000000000class proto { static flag = false; static set prop(value) { this.flag = value; } } class obj extends proto {} obj.prop = true; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-setter/unknown-prop-setter/000077500000000000000000000000001450520414700276765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-setter/unknown-prop-setter/_config.js000066400000000000000000000003071450520414700316400ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles unknown setters that modify "this"', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/modify-this-via-setter/unknown-prop-setter/main.js000066400000000000000000000003051450520414700311560ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { set [unknown](value) { this.flag = value; }, flag: false }; obj.prop = true; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-setter/unknown-prop-unknown-access/000077500000000000000000000000001450520414700313265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-setter/unknown-prop-unknown-access/_config.js000066400000000000000000000003431450520414700332700ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles unknown setters that modify "this" for unknown property access', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/modify-this-via-setter/unknown-prop-unknown-access/main.js000066400000000000000000000003111450520414700326030ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { set [unknown](value) { this.flag = value; }, flag: false }; obj[unknown] = true; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/modify-this-via-setter/unknown-super-prop/000077500000000000000000000000001450520414700275265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/modify-this-via-setter/unknown-super-prop/_config.js000066400000000000000000000003441450520414700314710ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles setters that modify "this" on prototypes for unknown properties', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/modify-this-via-setter/unknown-super-prop/main.js000066400000000000000000000003561450520414700310140ustar00rootroot00000000000000import { unknown } from 'external'; class proto { static flag = false; static set prop(value) { this.flag = value; } } class obj extends proto {} obj[unknown] = true; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-3.29.4/test/function/samples/module-level-directive/000077500000000000000000000000001450520414700237465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-level-directive/_config.js000066400000000000000000000007761450520414700257220ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'module level directives should produce warnings', warnings: [ { code: 'MODULE_LEVEL_DIRECTIVE', id: ID_MAIN, message: 'Module level directives cause errors when bundled, "use asm" in "main.js" was ignored.', pos: 0, loc: { column: 0, file: ID_MAIN, line: 1 }, frame: ` 1: "use asm"; ^ 2: 3: export default 1;` } ] }); rollup-3.29.4/test/function/samples/module-level-directive/main.js000066400000000000000000000000351450520414700252260ustar00rootroot00000000000000"use asm"; export default 1;rollup-3.29.4/test/function/samples/module-parsed-hook/000077500000000000000000000000001450520414700230775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-parsed-hook/_config.js000066400000000000000000000065251450520414700250510ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const parsedModules = []; const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = defineTest({ description: 'calls the moduleParsedHook once a module is parsed', options: { plugins: { name: 'test-plugin', moduleParsed(moduleInfo) { parsedModules.push(moduleInfo); }, buildEnd() { assert.deepStrictEqual(JSON.parse(JSON.stringify(parsedModules)), [ { id: ID_MAIN, assertions: {}, ast: { type: 'Program', start: 0, end: 34, body: [ { type: 'ExportNamedDeclaration', start: 0, end: 33, declaration: null, specifiers: [ { type: 'ExportSpecifier', start: 9, end: 14, local: { type: 'Identifier', start: 9, end: 14, name: 'value' }, exported: { type: 'Identifier', start: 9, end: 14, name: 'value' } } ], source: { type: 'Literal', start: 22, end: 32, value: './dep.js', raw: "'./dep.js'" } } ], sourceType: 'module' }, code: "export { value } from './dep.js';\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': [], './dep.js': ['value'] }, exports: ['value'], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: ID_DEP, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_DEP], importers: [], isEntry: true, isExternal: false, isIncluded: false, meta: {}, syntheticNamedExports: false }, { id: ID_DEP, assertions: {}, ast: { type: 'Program', start: 0, end: 25, body: [ { type: 'ExportNamedDeclaration', start: 0, end: 24, declaration: { type: 'VariableDeclaration', start: 7, end: 24, declarations: [ { type: 'VariableDeclarator', start: 13, end: 23, id: { type: 'Identifier', start: 13, end: 18, name: 'value' }, init: { type: 'Literal', start: 21, end: 23, value: 42, raw: '42' } } ], kind: 'const' }, specifiers: [], source: null } ], sourceType: 'module' }, code: 'export const value = 42;\n', dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': ['value'] }, exports: ['value'], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [ID_MAIN], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false } ]); } } } }); rollup-3.29.4/test/function/samples/module-parsed-hook/dep.js000066400000000000000000000000311450520414700241770ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/module-parsed-hook/main.js000066400000000000000000000000421450520414700243550ustar00rootroot00000000000000export { value } from './dep.js'; rollup-3.29.4/test/function/samples/module-parsed-imported-ids/000077500000000000000000000000001450520414700245375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-parsed-imported-ids/_config.js000066400000000000000000000020501450520414700264760ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'provides full importedIds and dynamicallyImportedIds in the moduleParsed hook', options: { plugins: [ { load(id) { const { dynamicallyImportedIds, importedIds } = this.getModuleInfo(id); assert.deepStrictEqual(importedIds, []); assert.deepStrictEqual(dynamicallyImportedIds, []); }, transform(code, id) { const { dynamicallyImportedIds, importedIds } = this.getModuleInfo(id); assert.deepStrictEqual(importedIds, []); assert.deepStrictEqual(dynamicallyImportedIds, []); }, moduleParsed({ dynamicallyImportedIds, id, importedIds }) { if (id.endsWith('main.js')) { assert.deepStrictEqual(importedIds, [path.join(__dirname, 'static.js')]); assert.deepStrictEqual(dynamicallyImportedIds, [path.join(__dirname, 'dynamic.js')]); } else { assert.deepStrictEqual(importedIds, []); assert.deepStrictEqual(dynamicallyImportedIds, []); } } } ] } }); rollup-3.29.4/test/function/samples/module-parsed-imported-ids/dynamic.js000066400000000000000000000000361450520414700265200ustar00rootroot00000000000000export const bar = 'dynamic'; rollup-3.29.4/test/function/samples/module-parsed-imported-ids/main.js000066400000000000000000000001311450520414700260140ustar00rootroot00000000000000import { foo } from './static.js'; export const result = [foo, import('./dynamic.js')]; rollup-3.29.4/test/function/samples/module-parsed-imported-ids/static.js000066400000000000000000000000351450520414700263620ustar00rootroot00000000000000export const foo = 'static'; rollup-3.29.4/test/function/samples/module-side-effect-reexport/000077500000000000000000000000001450520414700247075ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effect-reexport/_config.js000066400000000000000000000004541450520414700266540ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes side effects of re-exporters unless they have moduleSideEffects: false', options: { plugins: [ { name: 'ignore-side-effects', transform(_code, id) { return { moduleSideEffects: id.endsWith('effect.js') }; } } ] } }); rollup-3.29.4/test/function/samples/module-side-effect-reexport/foo.js000066400000000000000000000000311450520414700260220ustar00rootroot00000000000000export const foo = true; rollup-3.29.4/test/function/samples/module-side-effect-reexport/index.js000066400000000000000000000001041450520414700263470ustar00rootroot00000000000000export { foo } from './reexport-effect'; global.indexEffect = true; rollup-3.29.4/test/function/samples/module-side-effect-reexport/main.js000066400000000000000000000005071450520414700261730ustar00rootroot00000000000000import { foo } from './index'; assert.ok(foo, 'foo'); // effects in reexporters without side effects are ignored assert.equal(global.indexEffect, undefined, 'indexEffect'); // effects in reexporters with side effects are retained assert.ok(global.reexportEffect, 'reexportEffect'); // cleanup delete global.reexportEffect; rollup-3.29.4/test/function/samples/module-side-effect-reexport/reexport-effect.js000066400000000000000000000000731450520414700303470ustar00rootroot00000000000000export { foo } from './foo'; global.reexportEffect = true; rollup-3.29.4/test/function/samples/module-side-effects/000077500000000000000000000000001450520414700232245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/array/000077500000000000000000000000001450520414700243425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/array/_config.js000066400000000000000000000025101450520414700263020ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const sideEffects = []; module.exports = defineTest({ description: 'supports setting module side effects via an array', context: { require(id) { sideEffects.push(id); return { value: id }; }, sideEffects }, exports() { assert.deepStrictEqual(sideEffects, [ 'pluginsideeffects-null-external-listed', 'pluginsideeffects-true-external-listed', 'pluginsideeffects-true', 'pluginsideeffects-null-listed', 'pluginsideeffects-true-listed' ]); }, options: { external: [ 'pluginsideeffects-null-external', 'pluginsideeffects-true-external', 'pluginsideeffects-null-external-listed', 'pluginsideeffects-true-external-listed' ], treeshake: { moduleSideEffects: [ 'pluginsideeffects-null-listed', 'pluginsideeffects-true-listed', 'pluginsideeffects-null-external-listed', 'pluginsideeffects-true-external-listed' ] }, plugins: { name: 'test-plugin', resolveId(id) { if (!path.isAbsolute(id)) { const moduleSideEffects = JSON.parse(id.split('-')[1]); if (moduleSideEffects) { return { id, moduleSideEffects }; } return id; } }, load(id) { if (!path.isAbsolute(id)) { return `export const value = '${id}'; sideEffects.push(value);`; } } } } }); rollup-3.29.4/test/function/samples/module-side-effects/array/main.js000066400000000000000000000005101450520414700256200ustar00rootroot00000000000000import 'pluginsideeffects-null'; import 'pluginsideeffects-true'; import 'pluginsideeffects-null-external'; import 'pluginsideeffects-true-external'; import 'pluginsideeffects-null-listed'; import 'pluginsideeffects-true-listed'; import 'pluginsideeffects-null-external-listed'; import 'pluginsideeffects-true-external-listed'; rollup-3.29.4/test/function/samples/module-side-effects/external-false/000077500000000000000000000000001450520414700261365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/external-false/_config.js000066400000000000000000000026011450520414700300770ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const sideEffects = []; module.exports = defineTest({ description: 'supports setting module side effects to false for external modules', context: { require(id) { sideEffects.push(id); return { value: id }; }, sideEffects }, exports() { assert.deepStrictEqual(sideEffects, ['pluginsideeffects-true', 'internal']); }, options: { treeshake: { moduleSideEffects: 'no-external' }, plugins: { name: 'test-plugin', resolveId(id) { if (!path.isAbsolute(id)) { if (id === 'internal') { return id; } if (id === 'implicit-external') { return null; } const moduleSideEffects = JSON.parse(id.split('-')[1]); if (moduleSideEffects) { return { id, moduleSideEffects, external: true }; } return { id, external: true }; } }, load(id) { if (!path.isAbsolute(id)) { return `export const value = '${id}'; sideEffects.push(value);`; } } } }, warnings: [ { code: 'UNRESOLVED_IMPORT', exporter: 'implicit-external', id: ID_MAIN, message: '"implicit-external" is imported by "main.js", but could not be resolved – treating it as an external dependency.', url: 'https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency' } ] }); rollup-3.29.4/test/function/samples/module-side-effects/external-false/main.js000066400000000000000000000001621450520414700274170ustar00rootroot00000000000000import 'pluginsideeffects-false'; import 'pluginsideeffects-true'; import 'internal'; import 'implicit-external'; rollup-3.29.4/test/function/samples/module-side-effects/global-false/000077500000000000000000000000001450520414700255545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/global-false/_config.js000066400000000000000000000015471450520414700275250ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const sideEffects = []; module.exports = defineTest({ description: 'supports setting module side effects to false for all modules', context: { require(id) { sideEffects.push(id); return { value: id }; }, sideEffects }, exports() { assert.deepStrictEqual(sideEffects, ['pluginsideeffects-true']); }, options: { external: ['external'], treeshake: { moduleSideEffects: false }, plugins: { name: 'test-plugin', resolveId(id) { if (!path.isAbsolute(id)) { const moduleSideEffects = JSON.parse(id.split('-')[1]); if (moduleSideEffects) { return { id, moduleSideEffects }; } return id; } }, load(id) { if (!path.isAbsolute(id)) { return `export const value = '${id}'; sideEffects.push(value);`; } } } } }); rollup-3.29.4/test/function/samples/module-side-effects/global-false/main.js000066400000000000000000000001251450520414700270340ustar00rootroot00000000000000import 'pluginsideeffects-null'; import 'pluginsideeffects-true'; import 'external'; rollup-3.29.4/test/function/samples/module-side-effects/invalid-option/000077500000000000000000000000001450520414700261605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/invalid-option/_config.js000066400000000000000000000006301450520414700301210ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns for invalid options', options: { treeshake: { moduleSideEffects: 'what-is-this?' } }, error: { code: 'INVALID_OPTION', message: 'Invalid value for option "treeshake.moduleSideEffects" - please use one of false, "no-external", a function or an array.', url: 'https://rollupjs.org/configuration-options/#treeshake-modulesideeffects' } }); rollup-3.29.4/test/function/samples/module-side-effects/invalid-option/main.js000066400000000000000000000000311450520414700274340ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/module-side-effects/load/000077500000000000000000000000001450520414700241435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/load/_config.js000066400000000000000000000017031450520414700261060ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const sideEffects = []; module.exports = defineTest({ description: 'handles setting moduleSideEffects in the load hook', context: { sideEffects }, exports() { assert.deepStrictEqual(sideEffects, [ 'sideeffects-null-load-null', 'sideeffects-true-load-null', 'sideeffects-false-load-true', 'sideeffects-null-load-true', 'sideeffects-true-load-true' ]); }, options: { treeshake: { moduleSideEffects(id) { if (id.includes('main')) return true; return JSON.parse(id.split('-')[1]); } }, plugins: { name: 'test-plugin', resolveId(id) { if (!path.isAbsolute(id)) { return id; } }, load(id) { if (!path.isAbsolute(id)) { const moduleSideEffects = JSON.parse(id.split('-')[3]); return { code: `export const value = '${id}'; sideEffects.push(value);`, moduleSideEffects }; } } } } }); rollup-3.29.4/test/function/samples/module-side-effects/load/main.js000066400000000000000000000005231450520414700254250ustar00rootroot00000000000000import 'sideeffects-false-load-false'; import 'sideeffects-null-load-false'; import 'sideeffects-true-load-false'; import 'sideeffects-false-load-null'; import 'sideeffects-null-load-null'; import 'sideeffects-true-load-null'; import 'sideeffects-false-load-true'; import 'sideeffects-null-load-true'; import 'sideeffects-true-load-true'; rollup-3.29.4/test/function/samples/module-side-effects/reexport-from-external/000077500000000000000000000000001450520414700276555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/reexport-from-external/_config.js000066400000000000000000000006651450520414700316260ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles reexporting external values when module side-effects are false', context: { require(id) { return { value: id }; } }, exports(exports) { assert.deepStrictEqual(exports, { external: 'external', value: 'externalStar' }); }, options: { external() { return true; }, treeshake: { moduleSideEffects: false } } }); rollup-3.29.4/test/function/samples/module-side-effects/reexport-from-external/main.js000066400000000000000000000001141450520414700311330ustar00rootroot00000000000000export { value as external } from 'external'; export * from 'externalStar'; rollup-3.29.4/test/function/samples/module-side-effects/reexports/000077500000000000000000000000001450520414700252575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/reexports/_config.js000066400000000000000000000005171450520414700272240ustar00rootroot00000000000000const assert = require('node:assert'); const sideEffects = []; module.exports = defineTest({ description: 'handles reexporting values when module side-effects are false', context: { sideEffects }, exports() { assert.deepStrictEqual(sideEffects, ['dep1']); }, options: { treeshake: { moduleSideEffects: false } } }); rollup-3.29.4/test/function/samples/module-side-effects/reexports/dep1.js000066400000000000000000000000701450520414700264430ustar00rootroot00000000000000sideEffects.push('dep1'); export const value = 'dep1'; rollup-3.29.4/test/function/samples/module-side-effects/reexports/dep2.js000066400000000000000000000000701450520414700264440ustar00rootroot00000000000000sideEffects.push('dep2'); export const value = 'dep2'; rollup-3.29.4/test/function/samples/module-side-effects/reexports/lib.js000066400000000000000000000001651450520414700263650ustar00rootroot00000000000000sideEffects.push('main'); export { value as value1 } from './dep1.js'; export { value as value2 } from './dep2.js'; rollup-3.29.4/test/function/samples/module-side-effects/reexports/main.js000066400000000000000000000000431450520414700265360ustar00rootroot00000000000000export { value1 } from './lib.js'; rollup-3.29.4/test/function/samples/module-side-effects/resolve-id-external/000077500000000000000000000000001450520414700271155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/resolve-id-external/_config.js000066400000000000000000000054471450520414700310710ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); /** * @type {string[]} */ const sideEffects = []; const { getObject } = require('../../../../utils'); module.exports = defineTest({ description: 'does not include modules without used exports if moduleSideEffect is false', context: { require(id) { sideEffects.push(id); return { value: id }; } }, exports() { assert.deepStrictEqual(sideEffects, [ 'sideeffects-false-usereffects-false-used-import', 'sideeffects-null-usereffects-false-used-import', 'sideeffects-true-usereffects-false', 'sideeffects-true-usereffects-false-unused-import', 'sideeffects-true-usereffects-false-used-import', 'sideeffects-false-usereffects-true-used-import', 'sideeffects-null-usereffects-true', 'sideeffects-null-usereffects-true-unused-import', 'sideeffects-null-usereffects-true-used-import', 'sideeffects-true-usereffects-true', 'sideeffects-true-usereffects-true-unused-import', 'sideeffects-true-usereffects-true-used-import' ]); }, options: { treeshake: { moduleSideEffects(id) { if (id.includes('main')) return true; return JSON.parse(id.split('-')[3]); } }, plugins: { name: 'test-plugin', resolveId(id) { if (!path.isAbsolute(id)) { return { id, external: true, moduleSideEffects: JSON.parse(id.split('-')[1]) }; } }, buildEnd() { assert.deepStrictEqual( getObject( [...this.getModuleIds()] .filter(id => !path.isAbsolute(id)) .sort() .map(id => [id, this.getModuleInfo(id).moduleSideEffects]) ), { 'sideeffects-false-usereffects-false': false, 'sideeffects-false-usereffects-false-unused-import': false, 'sideeffects-false-usereffects-false-used-import': false, 'sideeffects-false-usereffects-true': false, 'sideeffects-false-usereffects-true-unused-import': false, 'sideeffects-false-usereffects-true-used-import': false, 'sideeffects-null-usereffects-false': false, 'sideeffects-null-usereffects-false-unused-import': false, 'sideeffects-null-usereffects-false-used-import': false, 'sideeffects-null-usereffects-true': true, 'sideeffects-null-usereffects-true-unused-import': true, 'sideeffects-null-usereffects-true-used-import': true, 'sideeffects-true-usereffects-false': true, 'sideeffects-true-usereffects-false-unused-import': true, 'sideeffects-true-usereffects-false-used-import': true, 'sideeffects-true-usereffects-true': true, 'sideeffects-true-usereffects-true-unused-import': true, 'sideeffects-true-usereffects-true-used-import': true } ); } } }, warnings(warnings) { for (const warning of warnings) { assert.strictEqual(warning.code, 'UNUSED_EXTERNAL_IMPORT'); } } }); rollup-3.29.4/test/function/samples/module-side-effects/resolve-id-external/main.js000066400000000000000000000026211450520414700304000ustar00rootroot00000000000000import 'sideeffects-false-usereffects-false'; import { value as unusedValue1 } from 'sideeffects-false-usereffects-false-unused-import'; import { value as usedValue1 } from 'sideeffects-false-usereffects-false-used-import'; import 'sideeffects-null-usereffects-false'; import { value as unusedValue2 } from 'sideeffects-null-usereffects-false-unused-import'; import { value as usedValue2 } from 'sideeffects-null-usereffects-false-used-import'; import 'sideeffects-true-usereffects-false'; import { value as unusedValue3 } from 'sideeffects-true-usereffects-false-unused-import'; import { value as usedValue3 } from 'sideeffects-true-usereffects-false-used-import'; import 'sideeffects-false-usereffects-true'; import { value as unusedValue4 } from 'sideeffects-false-usereffects-true-unused-import'; import { value as usedValue4 } from 'sideeffects-false-usereffects-true-used-import'; import 'sideeffects-null-usereffects-true'; import { value as unusedValue5 } from 'sideeffects-null-usereffects-true-unused-import'; import { value as usedValue5 } from 'sideeffects-null-usereffects-true-used-import'; import 'sideeffects-true-usereffects-true'; import { value as unusedValue6 } from 'sideeffects-true-usereffects-true-unused-import'; import { value as usedValue6 } from 'sideeffects-true-usereffects-true-used-import'; export const values = [usedValue1, usedValue2, usedValue3, usedValue4, usedValue5, usedValue6]; rollup-3.29.4/test/function/samples/module-side-effects/resolve-id/000077500000000000000000000000001450520414700252755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/resolve-id/_config.js000066400000000000000000000057261450520414700272510ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { getObject } = require('../../../../utils'); const sideEffects = []; module.exports = defineTest({ description: 'does not include modules without used exports if moduleSideEffect is false', context: { sideEffects }, exports() { assert.deepStrictEqual(sideEffects, [ 'sideeffects-false-usereffects-false-used-import', 'sideeffects-null-usereffects-false-used-import', 'sideeffects-true-usereffects-false', 'sideeffects-true-usereffects-false-unused-import', 'sideeffects-true-usereffects-false-used-import', 'sideeffects-false-usereffects-true-used-import', 'sideeffects-null-usereffects-true', 'sideeffects-null-usereffects-true-unused-import', 'sideeffects-null-usereffects-true-used-import', 'sideeffects-true-usereffects-true', 'sideeffects-true-usereffects-true-unused-import', 'sideeffects-true-usereffects-true-used-import' ]); }, options: { treeshake: { moduleSideEffects(id) { if (id.includes('main')) return true; return JSON.parse(id.split('-')[3]); } }, plugins: { name: 'test-plugin', resolveId(id) { if (!path.isAbsolute(id)) { return { id, external: false, moduleSideEffects: JSON.parse(id.split('-')[1]) }; } }, load(id) { if (!path.isAbsolute(id)) { const sideEffects = JSON.parse(id.split('-')[1]); const userEffects = JSON.parse(id.split('-')[3]); assert.strictEqual( this.getModuleInfo(id).moduleSideEffects, typeof sideEffects === 'boolean' ? sideEffects : userEffects ); return `export const value = '${id}'; sideEffects.push(value);`; } }, buildEnd() { assert.deepStrictEqual( getObject( [...this.getModuleIds()] .filter(id => !path.isAbsolute(id)) .sort() .map(id => [id, this.getModuleInfo(id).moduleSideEffects]) ), { 'sideeffects-false-usereffects-false': false, 'sideeffects-false-usereffects-false-unused-import': false, 'sideeffects-false-usereffects-false-used-import': false, 'sideeffects-false-usereffects-true': false, 'sideeffects-false-usereffects-true-unused-import': false, 'sideeffects-false-usereffects-true-used-import': false, 'sideeffects-null-usereffects-false': false, 'sideeffects-null-usereffects-false-unused-import': false, 'sideeffects-null-usereffects-false-used-import': false, 'sideeffects-null-usereffects-true': true, 'sideeffects-null-usereffects-true-unused-import': true, 'sideeffects-null-usereffects-true-used-import': true, 'sideeffects-true-usereffects-false': true, 'sideeffects-true-usereffects-false-unused-import': true, 'sideeffects-true-usereffects-false-used-import': true, 'sideeffects-true-usereffects-true': true, 'sideeffects-true-usereffects-true-unused-import': true, 'sideeffects-true-usereffects-true-used-import': true } ); } } } }); rollup-3.29.4/test/function/samples/module-side-effects/resolve-id/main.js000066400000000000000000000026211450520414700265600ustar00rootroot00000000000000import 'sideeffects-false-usereffects-false'; import { value as unusedValue1 } from 'sideeffects-false-usereffects-false-unused-import'; import { value as usedValue1 } from 'sideeffects-false-usereffects-false-used-import'; import 'sideeffects-null-usereffects-false'; import { value as unusedValue2 } from 'sideeffects-null-usereffects-false-unused-import'; import { value as usedValue2 } from 'sideeffects-null-usereffects-false-used-import'; import 'sideeffects-true-usereffects-false'; import { value as unusedValue3 } from 'sideeffects-true-usereffects-false-unused-import'; import { value as usedValue3 } from 'sideeffects-true-usereffects-false-used-import'; import 'sideeffects-false-usereffects-true'; import { value as unusedValue4 } from 'sideeffects-false-usereffects-true-unused-import'; import { value as usedValue4 } from 'sideeffects-false-usereffects-true-used-import'; import 'sideeffects-null-usereffects-true'; import { value as unusedValue5 } from 'sideeffects-null-usereffects-true-unused-import'; import { value as usedValue5 } from 'sideeffects-null-usereffects-true-used-import'; import 'sideeffects-true-usereffects-true'; import { value as unusedValue6 } from 'sideeffects-true-usereffects-true-unused-import'; import { value as usedValue6 } from 'sideeffects-true-usereffects-true-used-import'; export const values = [usedValue1, usedValue2, usedValue3, usedValue4, usedValue5, usedValue6]; rollup-3.29.4/test/function/samples/module-side-effects/transform/000077500000000000000000000000001450520414700252375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/transform/_config.js000066400000000000000000000032121450520414700271770ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const sideEffects = []; module.exports = defineTest({ description: 'handles setting moduleSideEffects in the transform hook', context: { sideEffects }, exports() { assert.deepStrictEqual(sideEffects, [ 'sideeffects-null-1-null-2-null', 'sideeffects-true-1-null-2-null', 'sideeffects-false-1-true-2-null', 'sideeffects-null-1-true-2-null', 'sideeffects-true-1-true-2-null', 'sideeffects-false-1-false-2-true', 'sideeffects-null-1-false-2-true', 'sideeffects-true-1-false-2-true', 'sideeffects-false-1-null-2-true', 'sideeffects-null-1-null-2-true', 'sideeffects-true-1-null-2-true', 'sideeffects-false-1-true-2-true', 'sideeffects-null-1-true-2-true', 'sideeffects-true-1-true-2-true' ]); }, options: { treeshake: { moduleSideEffects(id) { if (id.includes('main')) return true; return JSON.parse(id.split('-')[1]); } }, plugins: [ { name: 'test-plugin-1', resolveId(id) { if (!path.isAbsolute(id)) { return id; } }, load(id) { if (!path.isAbsolute(id)) { return `export const value = '${id}'; sideEffects.push(value);`; } }, transform(code, id) { if (!path.isAbsolute(id)) { const moduleSideEffects = JSON.parse(id.split('-')[3]); return { code, moduleSideEffects }; } } }, { name: 'test-plugin-2', transform(code, id) { if (!path.isAbsolute(id)) { const moduleSideEffects = JSON.parse(id.split('-')[5]); return { code, moduleSideEffects }; } } } ] } }); rollup-3.29.4/test/function/samples/module-side-effects/transform/main.js000066400000000000000000000021601450520414700265200ustar00rootroot00000000000000import 'sideeffects-false-1-false-2-false'; import 'sideeffects-null-1-false-2-false'; import 'sideeffects-true-1-false-2-false'; import 'sideeffects-false-1-null-2-false'; import 'sideeffects-null-1-null-2-false'; import 'sideeffects-true-1-null-2-false'; import 'sideeffects-false-1-true-2-false'; import 'sideeffects-null-1-true-2-false'; import 'sideeffects-true-1-true-2-false'; import 'sideeffects-false-1-false-2-null'; import 'sideeffects-null-1-false-2-null'; import 'sideeffects-true-1-false-2-null'; import 'sideeffects-false-1-null-2-null'; import 'sideeffects-null-1-null-2-null'; import 'sideeffects-true-1-null-2-null'; import 'sideeffects-false-1-true-2-null'; import 'sideeffects-null-1-true-2-null'; import 'sideeffects-true-1-true-2-null'; import 'sideeffects-false-1-false-2-true'; import 'sideeffects-null-1-false-2-true'; import 'sideeffects-true-1-false-2-true'; import 'sideeffects-false-1-null-2-true'; import 'sideeffects-null-1-null-2-true'; import 'sideeffects-true-1-null-2-true'; import 'sideeffects-false-1-true-2-true'; import 'sideeffects-null-1-true-2-true'; import 'sideeffects-true-1-true-2-true'; rollup-3.29.4/test/function/samples/module-side-effects/writable/000077500000000000000000000000001450520414700250355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-side-effects/writable/_config.js000066400000000000000000000054511450520414700270040ustar00rootroot00000000000000// We prefix the polyfill with \0 to tell other plugins not to try to load or // transform it const POLYFILL_ID = '\0polyfill'; const PROXY_SUFFIX = '?inject-polyfill-proxy'; module.exports = defineTest({ description: 'ModuleInfo.moduleSideEffects should be writable during build time', options: { treeshake: { moduleSideEffects: false }, plugins: [ { name: 'inject-polyfill', async resolveId(source, importer, options) { if (source === POLYFILL_ID) { // It is important that side effects are always respected for // polyfills, otherwise using treeshake.moduleSideEffects: false // may prevent the polyfill from being included. return { id: POLYFILL_ID, moduleSideEffects: true }; } if (options.isEntry) { // Determine what the actual entry would have been. We need // "skipSelf" to avoid an infinite loop. const resolution = await this.resolve(source, importer, { skipSelf: true, ...options }); // If it cannot be resolved or is external, just return it so that // Rollup can display an error if (!resolution || resolution.external) return resolution; // In the load hook of the proxy, need to know if the entry has a // default export. In the load hook, however, we no longer have the // full "resolution" object that may contain meta-data from other // plugins that is only added on first load. Therefore we trigger // loading here. const moduleInfo = await this.load(resolution); // We need to make sure side effects in the original entry point // are respected even for treeshake.moduleSideEffects: false moduleInfo.moduleSideEffects = true; // It is important that the new entry does not start with \0 and // has the same directory as the original one to not mess up // relative external import generation. Also keeping the name and // just adding a "?query" to the end ensures that preserveModules // will generate the original entry name for this entry. return `${resolution.id}${PROXY_SUFFIX}`; } return null; }, load(id) { if (id === POLYFILL_ID) { return 'global.polyfilled = true;'; } if (id.endsWith(PROXY_SUFFIX)) { const entryId = id.slice(0, -PROXY_SUFFIX.length); // We know its ModuleInfo is reliable because we awaited this.load // in resolveId const { hasDefaultExport } = this.getModuleInfo(entryId); let code = `import ${JSON.stringify(POLYFILL_ID)};` + `export * from ${JSON.stringify(entryId)};`; // Namespace reexports do not reexport default, so we need special // handling here if (hasDefaultExport) { code += `export { default } from ${JSON.stringify(entryId)};`; } return code; } return null; } } ] } }); rollup-3.29.4/test/function/samples/module-side-effects/writable/foo.js000066400000000000000000000000261450520414700261540ustar00rootroot00000000000000export default 'foo'; rollup-3.29.4/test/function/samples/module-side-effects/writable/main.js000066400000000000000000000001141450520414700263130ustar00rootroot00000000000000assert.ok(global.polyfilled, 'polyfill working'); delete global.polyfilled; rollup-3.29.4/test/function/samples/module-sort-order/000077500000000000000000000000001450520414700227635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-sort-order/_config.js000066400000000000000000000001561450520414700247270ustar00rootroot00000000000000module.exports = defineTest({ description: 'module sorter is not confused by top-level call expressions' }); rollup-3.29.4/test/function/samples/module-sort-order/a.js000066400000000000000000000003001450520414700235320ustar00rootroot00000000000000import { b } from './b'; import z from './z'; z(); var p = { q: function () { b.nope(); } }; (function () { var p = { q: function () { b.nope(); } }; })(); export default 42; rollup-3.29.4/test/function/samples/module-sort-order/b.js000066400000000000000000000000371450520414700235420ustar00rootroot00000000000000export var b = function () {}; rollup-3.29.4/test/function/samples/module-sort-order/c.js000066400000000000000000000001201450520414700235340ustar00rootroot00000000000000import { b } from './b'; export var c = function() { assert.equal(42, 42); }; rollup-3.29.4/test/function/samples/module-sort-order/main.js000066400000000000000000000000601450520414700242410ustar00rootroot00000000000000import a from './a'; import z from './z'; z(); rollup-3.29.4/test/function/samples/module-sort-order/z.js000066400000000000000000000000771450520414700235760ustar00rootroot00000000000000import { c } from './c'; export default function () { c(); } rollup-3.29.4/test/function/samples/module-tree/000077500000000000000000000000001450520414700216225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-tree/_config.js000066400000000000000000000016221450520414700235650ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'bundle.modules includes dependencies (#903)', bundle(bundle) { const modules = bundle.cache.modules.map(module => ({ id: path.relative(__dirname, module.id), dependencies: module.dependencies.map(id => path.relative(__dirname, id)) })); assert.deepEqual(modules, [ { id: path.normalize('nested/qux.js'), dependencies: [] }, { id: path.normalize('nested/baz.js'), dependencies: [path.normalize('nested/qux.js')] }, { id: 'bar.js', dependencies: [path.normalize('nested/baz.js')] }, { id: 'foo.js', dependencies: ['bar.js'] }, { id: 'main.js', dependencies: ['foo.js', 'bar.js'] } ]); }, warnings: [ { code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "main".', names: ['main'] } ] }); rollup-3.29.4/test/function/samples/module-tree/bar.js000066400000000000000000000000321450520414700227170ustar00rootroot00000000000000import './nested/baz.js'; rollup-3.29.4/test/function/samples/module-tree/foo.js000066400000000000000000000000231450520414700227360ustar00rootroot00000000000000import './bar.js'; rollup-3.29.4/test/function/samples/module-tree/main.js000066400000000000000000000000461450520414700231040ustar00rootroot00000000000000import './foo.js'; import './bar.js'; rollup-3.29.4/test/function/samples/module-tree/nested/000077500000000000000000000000001450520414700231045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/module-tree/nested/baz.js000066400000000000000000000000341450520414700242130ustar00rootroot00000000000000import qux from './qux.js'; rollup-3.29.4/test/function/samples/module-tree/nested/qux.js000066400000000000000000000000331450520414700242530ustar00rootroot00000000000000export default 'whatever'; rollup-3.29.4/test/function/samples/mutate-via-parameter/000077500000000000000000000000001450520414700234325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/mutate-via-parameter/_config.js000066400000000000000000000004021450520414700253700ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'respects variable mutations via unknown parameter values if we lose track of a function', exports({ test }) { assert.ok(test(state => (state.modified = true))); } }); rollup-3.29.4/test/function/samples/mutate-via-parameter/main.js000066400000000000000000000002151450520414700247120ustar00rootroot00000000000000export function test(callback) { const state = { modified: false }; callback(state); if (state.modified) return true; return false; } rollup-3.29.4/test/function/samples/name-conflict-object/000077500000000000000000000000001450520414700233635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/name-conflict-object/_config.js000066400000000000000000000007531450520414700253320ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'avoids name conflicts with local variables named Object', options: { external: 'external', output: { exports: 'named' } }, context: { require() { return { foo: 'foo' }; } }, exports(exports) { assert.strictEqual(exports.Object, null); assert.strictEqual(exports.default, 'bar'); assert.strictEqual(exports.foo.foo, 'foo'); assert.strictEqual(exports.foo.default.foo, 'foo'); } }); rollup-3.29.4/test/function/samples/name-conflict-object/main.js000066400000000000000000000001231450520414700246410ustar00rootroot00000000000000export * as foo from 'external'; export const Object = null; export default 'bar'; rollup-3.29.4/test/function/samples/name-conflict-promise/000077500000000000000000000000001450520414700235735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/name-conflict-promise/_config.js000066400000000000000000000004361450520414700255400ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'avoids name conflicts with local variables named Promise', async exports(exports) { assert.strictEqual(exports.Promise, 'bar'); assert.strictEqual((await exports.promised).Promise, 'foo'); } }); rollup-3.29.4/test/function/samples/name-conflict-promise/dep.js000066400000000000000000000000361450520414700247000ustar00rootroot00000000000000export const Promise = 'foo'; rollup-3.29.4/test/function/samples/name-conflict-promise/main.js000066400000000000000000000001071450520414700250530ustar00rootroot00000000000000export const Promise = 'bar'; export const promised = import('./dep'); rollup-3.29.4/test/function/samples/name-conflict-symbol/000077500000000000000000000000001450520414700234225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/name-conflict-symbol/_config.js000066400000000000000000000005271450520414700253700ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'avoids name conflicts with local variables named Symbol', options: { output: { generatedCode: { symbols: true } } }, exports(exports) { assert.strictEqual(exports.Symbol, null); assert.strictEqual(exports.toString(), '[object Module]'); } }); rollup-3.29.4/test/function/samples/name-conflict-symbol/main.js000066400000000000000000000000341450520414700247010ustar00rootroot00000000000000export const Symbol = null; rollup-3.29.4/test/function/samples/named-external-method-in-prototype/000077500000000000000000000000001450520414700262315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/named-external-method-in-prototype/_config.js000066400000000000000000000005701450520414700301750ustar00rootroot00000000000000module.exports = defineTest({ description: 'method of external named import used inside prototype method (#68)', context: { // override require here, making "foo" appear as a global module require(name) { if (name === 'bar') { // @ts-expect-error test file return require('./bar'); } return require(name); } }, options: { external: ['bar'] } }); rollup-3.29.4/test/function/samples/named-external-method-in-prototype/bar.js000066400000000000000000000000721450520414700273320ustar00rootroot00000000000000exports.bar = { foobar: function () { return 42; } }; rollup-3.29.4/test/function/samples/named-external-method-in-prototype/foo.js000066400000000000000000000002271450520414700273530ustar00rootroot00000000000000import { bar } from 'bar'; export default function Foo() { this.answer = bar.foobar(); } Foo.prototype.bar = function () { return bar.foobar(); }; rollup-3.29.4/test/function/samples/named-external-method-in-prototype/main.js000066400000000000000000000001021450520414700275040ustar00rootroot00000000000000import Foo from './foo.js'; assert.equal( new Foo().bar(), 42 ); rollup-3.29.4/test/function/samples/namespace-keys-are-sorted/000077500000000000000000000000001450520414700243505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-keys-are-sorted/_config.js000066400000000000000000000001211450520414700263040ustar00rootroot00000000000000module.exports = defineTest({ description: 'supports sorted namespace keys' }); rollup-3.29.4/test/function/samples/namespace-keys-are-sorted/bar.js000066400000000000000000000000321450520414700254450ustar00rootroot00000000000000export const bar = 'foo'; rollup-3.29.4/test/function/samples/namespace-keys-are-sorted/foo.js000066400000000000000000000005461450520414700254760ustar00rootroot00000000000000const foo = 'bar'; export { foo as ø }; export { foo as z }; export { foo as ZZZ }; export { foo as $ }; export { foo as ς }; export default foo; export { foo as ___ }; export { foo as aa }; export { foo as AA }; export * as namespace from './bar.js'; export { foo as Z }; export { foo as ö }; export { foo as A }; export { foo }; export { foo as $$$ }; rollup-3.29.4/test/function/samples/namespace-keys-are-sorted/main.js000066400000000000000000000003221450520414700256270ustar00rootroot00000000000000import * as ns from './foo.js'; assert.deepStrictEqual(Object.getOwnPropertyNames(ns), [ '$', '$$$', 'A', 'AA', 'Z', 'ZZZ', '___', 'aa', 'default', 'foo', 'namespace', 'z', 'ö', 'ø', 'ς' ]); rollup-3.29.4/test/function/samples/namespace-literal-value/000077500000000000000000000000001450520414700241005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-literal-value/_config.js000066400000000000000000000004071450520414700260430ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not simplify accessing unknown properties from namespaces', exports({ isNull }) { assert.strictEqual(isNull('a'), true); assert.strictEqual(isNull('b'), false); } }); rollup-3.29.4/test/function/samples/namespace-literal-value/main.js000066400000000000000000000001461450520414700253630ustar00rootroot00000000000000import * as ns from './namespace'; export const isNull = prop => (ns[prop] === null ? true : false); rollup-3.29.4/test/function/samples/namespace-literal-value/namespace.js000066400000000000000000000000561450520414700263730ustar00rootroot00000000000000export const a = null; export const b = true; rollup-3.29.4/test/function/samples/namespace-member-side-effects/000077500000000000000000000000001450520414700251405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/assignment/000077500000000000000000000000001450520414700273105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/assignment/_config.js000066400000000000000000000002501450520414700312470ustar00rootroot00000000000000module.exports = defineTest({ description: 'checks side effects when reassigning namespace members', options: { treeshake: { tryCatchDeoptimization: false } } }); rollup-3.29.4/test/function/samples/namespace-member-side-effects/assignment/api/000077500000000000000000000000001450520414700300615ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/assignment/api/index.js000066400000000000000000000001151450520414700315230ustar00rootroot00000000000000import * as namespace from './namespace.js'; export default { namespace }; rollup-3.29.4/test/function/samples/namespace-member-side-effects/assignment/api/namespace.js000066400000000000000000000000001450520414700323410ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/assignment/main.js000066400000000000000000000002561450520414700305750ustar00rootroot00000000000000import api from './api/index'; let errored = false; try { api.namespace.x = 1; } catch { errored = true; } assert.ok(errored, 'namespace assignment should be preserved'); rollup-3.29.4/test/function/samples/namespace-member-side-effects/call/000077500000000000000000000000001450520414700260535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/call/_config.js000066400000000000000000000002361450520414700300160ustar00rootroot00000000000000module.exports = defineTest({ description: 'checks side effects when calling a namespace', options: { treeshake: { tryCatchDeoptimization: false } } }); rollup-3.29.4/test/function/samples/namespace-member-side-effects/call/api/000077500000000000000000000000001450520414700266245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/call/api/index.js000066400000000000000000000001151450520414700302660ustar00rootroot00000000000000import * as namespace from './namespace.js'; export default { namespace }; rollup-3.29.4/test/function/samples/namespace-member-side-effects/call/api/namespace.js000066400000000000000000000000001450520414700311040ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/call/main.js000066400000000000000000000002431450520414700273340ustar00rootroot00000000000000import api from './api/index'; let errored = false try { api.namespace() } catch { errored = true; } assert.ok(errored, 'namespace call should be preserved') rollup-3.29.4/test/function/samples/namespace-member-side-effects/member-call/000077500000000000000000000000001450520414700273205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/member-call/_config.js000066400000000000000000000001521450520414700312600ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects side effects when namespace members are called' }); rollup-3.29.4/test/function/samples/namespace-member-side-effects/member-call/api/000077500000000000000000000000001450520414700300715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/member-call/api/index.js000066400000000000000000000001151450520414700315330ustar00rootroot00000000000000import * as namespace from './namespace.js'; export default { namespace }; rollup-3.29.4/test/function/samples/namespace-member-side-effects/member-call/api/namespace.js000066400000000000000000000001671450520414700323670ustar00rootroot00000000000000import { sideEffects } from './sideEffects'; export function sideEffectFunction() { sideEffects.push('fn called'); } rollup-3.29.4/test/function/samples/namespace-member-side-effects/member-call/api/sideEffects.js000066400000000000000000000000371450520414700326530ustar00rootroot00000000000000export const sideEffects = []; rollup-3.29.4/test/function/samples/namespace-member-side-effects/member-call/main.js000066400000000000000000000002551450520414700306040ustar00rootroot00000000000000import api from './api/index.js'; import { sideEffects } from './api/sideEffects'; api.namespace.sideEffectFunction(); assert.deepStrictEqual(sideEffects, ['fn called']); rollup-3.29.4/test/function/samples/namespace-member-side-effects/missing-access/000077500000000000000000000000001450520414700300505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/missing-access/_config.js000066400000000000000000000002601450520414700320100ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects side effects when accessing missing namespace members', options: { treeshake: { tryCatchDeoptimization: false } } }); rollup-3.29.4/test/function/samples/namespace-member-side-effects/missing-access/api/000077500000000000000000000000001450520414700306215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/missing-access/api/index.js000066400000000000000000000001151450520414700322630ustar00rootroot00000000000000import * as namespace from './namespace.js'; export default { namespace }; rollup-3.29.4/test/function/samples/namespace-member-side-effects/missing-access/api/namespace.js000066400000000000000000000000001450520414700331010ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/missing-access/main.js000066400000000000000000000002741450520414700313350ustar00rootroot00000000000000import api from './api/index'; let errored = false; try { api.namespace.missing.foo; } catch { errored = true; } assert.ok(errored, 'unknown nested member access should be preserved'); rollup-3.29.4/test/function/samples/namespace-member-side-effects/unknown-access/000077500000000000000000000000001450520414700300765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/unknown-access/_config.js000066400000000000000000000003121450520414700320340ustar00rootroot00000000000000module.exports = defineTest({ description: 'respects side effects when accessing unknown namespace members', options: { external: ['external'], treeshake: { tryCatchDeoptimization: false } } }); rollup-3.29.4/test/function/samples/namespace-member-side-effects/unknown-access/api/000077500000000000000000000000001450520414700306475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/unknown-access/api/index.js000066400000000000000000000001151450520414700323110ustar00rootroot00000000000000import * as namespace from './namespace.js'; export default { namespace }; rollup-3.29.4/test/function/samples/namespace-member-side-effects/unknown-access/api/namespace.js000066400000000000000000000000001450520414700331270ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-member-side-effects/unknown-access/main.js000066400000000000000000000003431450520414700313600ustar00rootroot00000000000000import api from './api/index'; import { external } from 'external'; let errored = false; try { api.namespace[external].foo; } catch { errored = true; } assert.ok(errored, 'unknown nested member access should be preserved'); rollup-3.29.4/test/function/samples/namespace-missing-export/000077500000000000000000000000001450520414700243225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-missing-export/_config.js000066400000000000000000000013571450520414700262720ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_EMPTY = path.join(__dirname, 'empty.js'); module.exports = defineTest({ description: 'replaces missing namespace members with undefined and warns about them', warnings: [ { binding: 'foo', code: 'MISSING_EXPORT', exporter: ID_EMPTY, id: ID_MAIN, message: '"foo" is not exported by "empty.js", imported by "main.js".', url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module', pos: 61, loc: { column: 25, file: ID_MAIN, line: 3 }, frame: ` 1: import * as mod from './empty.js'; 2: 3: assert.equal( typeof mod.foo, 'undefined' ); ^` } ] }); rollup-3.29.4/test/function/samples/namespace-missing-export/empty.js000066400000000000000000000000471450520414700260170ustar00rootroot00000000000000// this space left intentionally blank rollup-3.29.4/test/function/samples/namespace-missing-export/main.js000066400000000000000000000001211450520414700255760ustar00rootroot00000000000000import * as mod from './empty.js'; assert.equal( typeof mod.foo, 'undefined' ); rollup-3.29.4/test/function/samples/namespace-override/000077500000000000000000000000001450520414700231515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-override/_config.js000066400000000000000000000001671450520414700251170ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not warn when overriding namespace reexports with explicit ones' }); rollup-3.29.4/test/function/samples/namespace-override/a.js000066400000000000000000000002701450520414700237260ustar00rootroot00000000000000export const a = 'a'; export const aExportOverride = 'a'; export const aReexportOverride = 'a'; export const hiddenConflictByExport = 'a'; export const hiddenConflictByReexport = 'a'; rollup-3.29.4/test/function/samples/namespace-override/b.js000066400000000000000000000002061450520414700237260ustar00rootroot00000000000000export const b = 'b'; export const hiddenConflictByExport = 'b'; export const hiddenConflictByReexport = 'b'; export * from './a.js'; rollup-3.29.4/test/function/samples/namespace-override/exportAll.js000066400000000000000000000003331450520414700254600ustar00rootroot00000000000000export * from './a.js'; export * from './b.js'; export const aExportOverride = 'override'; export const hiddenConflictByExport = 'hidden'; export { b as aReexportOverride, b as hiddenConflictByReexport } from './b.js'; rollup-3.29.4/test/function/samples/namespace-override/main.js000066400000000000000000000004711450520414700244350ustar00rootroot00000000000000import * as ns from './exportAll.js'; import { hiddenConflictByExport, hiddenConflictByReexport } from './exportAll.js'; assert.deepStrictEqual(ns, { __proto__: null, a: 'a', aExportOverride: 'override', aReexportOverride: 'b', b: 'b', hiddenConflictByExport: 'hidden', hiddenConflictByReexport: 'b', }); rollup-3.29.4/test/function/samples/namespace-reassign-import-fails/000077500000000000000000000000001450520414700255515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-reassign-import-fails/_config.js000066400000000000000000000031351450520414700275150ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { assertIncludes } = require('../../../utils.js'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'warns for reassignments to namespace exports', code(code) { assertIncludes(code, 'foo = 2'); assertIncludes(code, 'undefined = 3'); }, warnings: [ { binding: 'bar', code: 'MISSING_EXPORT', exporter: ID_FOO, id: ID_MAIN, message: '"bar" is not exported by "foo.js", imported by "main.js".', url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module', pos: 48, loc: { column: 4, file: ID_MAIN, line: 4 }, frame: ` 2: 3: exp.foo = 2; 4: exp.bar = 3; ^` }, { code: 'ILLEGAL_REASSIGNMENT', message: 'Illegal reassignment of import "exp" in "main.js".', id: ID_MAIN, pos: 31, loc: { column: 0, file: ID_MAIN, line: 3 }, frame: ` 1: import * as exp from './foo'; 2: 3: exp.foo = 2; ^ 4: exp.bar = 3;` }, { code: 'ILLEGAL_REASSIGNMENT', message: 'Illegal reassignment of import "exp" in "main.js".', id: ID_MAIN, pos: 44, loc: { column: 0, file: ID_MAIN, line: 4 }, frame: ` 2: 3: exp.foo = 2; 4: exp.bar = 3; ^` } ], runtimeError(error) { assert.strictEqual(error.message, 'Assignment to constant variable.'); } }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/namespace-reassign-import-fails rollup-3.29.4/test/function/samples/namespace-reassign-import-fails/foo.js000066400000000000000000000000261450520414700266700ustar00rootroot00000000000000export const foo = 1; rollup-3.29.4/test/function/samples/namespace-reassign-import-fails/main.js000066400000000000000000000000711450520414700270310ustar00rootroot00000000000000import * as exp from './foo'; exp.foo = 2; exp.bar = 3; rollup-3.29.4/test/function/samples/namespace-tostring/000077500000000000000000000000001450520414700232035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-tostring/dynamic-import-default-mode/000077500000000000000000000000001450520414700305035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-tostring/dynamic-import-default-mode/_config.js000066400000000000000000000010001450520414700324340ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'adds Symbol.toStringTag property to dynamic imports of entry chunks with default export mode', options: { input: ['main', 'foo'], output: { generatedCode: { symbols: true } } }, async exports(exports) { const foo = await exports; assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(foo.default, 42); } }); rollup-3.29.4/test/function/samples/namespace-tostring/dynamic-import-default-mode/foo.js000066400000000000000000000000231450520414700316170ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/namespace-tostring/dynamic-import-default-mode/main.js000066400000000000000000000000401450520414700317570ustar00rootroot00000000000000export default import('./foo'); rollup-3.29.4/test/function/samples/namespace-tostring/dynamic-import/000077500000000000000000000000001450520414700261375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-tostring/dynamic-import/_config.js000066400000000000000000000012601450520414700301000ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'adds Symbol.toStringTag property to dynamic imports', options: { output: { generatedCode: { symbols: true } } }, async exports(exports) { const namespace = await exports; assert.strictEqual(Object.prototype.toString.call(namespace), '[object Module]'); assert.strictEqual(namespace[Symbol.toStringTag], 'Module'); assert.strictEqual(namespace.bar, 42); const copied = { ...namespace }; assert.deepStrictEqual(copied, { bar: 42 }); assert.strictEqual(Object.prototype.toString.call(copied), '[object Object]'); assert.strictEqual(copied[Symbol.toStringTag], undefined); } }); rollup-3.29.4/test/function/samples/namespace-tostring/dynamic-import/foo.js000066400000000000000000000000271450520414700272570ustar00rootroot00000000000000export const bar = 42; rollup-3.29.4/test/function/samples/namespace-tostring/dynamic-import/main.js000066400000000000000000000000401450520414700274130ustar00rootroot00000000000000export default import('./foo'); rollup-3.29.4/test/function/samples/namespace-tostring/entry-default/000077500000000000000000000000001450520414700257665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-tostring/entry-default/_config.js000066400000000000000000000007261450520414700277350ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not add Symbol.toStringTag property to entry chunks with default export mode', options: { output: { generatedCode: { symbols: true }, exports: 'default' } }, exports(exports) { assert.strictEqual(exports[Symbol.toStringTag], undefined); assert.strictEqual(Object.prototype.toString.call(exports), '[object Object]'); assert.strictEqual(exports.foo, 42); } }); rollup-3.29.4/test/function/samples/namespace-tostring/entry-default/main.js000066400000000000000000000000341450520414700272450ustar00rootroot00000000000000export default { foo: 42 }; rollup-3.29.4/test/function/samples/namespace-tostring/entry-named/000077500000000000000000000000001450520414700254265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-tostring/entry-named/_config.js000066400000000000000000000012441450520414700273710ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'adds Symbol.toStringTag property to entry chunks with named exports', options: { output: { generatedCode: { symbols: true }, exports: 'named' } }, exports(exports) { assert.strictEqual(Object.prototype.toString.call(exports), '[object Module]'); assert.strictEqual(exports[Symbol.toStringTag], 'Module'); assert.strictEqual(exports.foo, 42); const copied = { ...exports }; assert.deepStrictEqual(copied, { foo: 42 }); assert.strictEqual(Object.prototype.toString.call(copied), '[object Object]'); assert.strictEqual(copied[Symbol.toStringTag], undefined); } }); rollup-3.29.4/test/function/samples/namespace-tostring/entry-named/main.js000066400000000000000000000000271450520414700267070ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/function/samples/namespace-tostring/external-namespaces/000077500000000000000000000000001450520414700271425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-tostring/external-namespaces/_config.js000066400000000000000000000011341450520414700311030ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to external namespaces', options: { external(id) { return id.startsWith('external'); }, output: { generatedCode: { symbols: true }, interop(id) { switch (id) { case 'external-auto': { return 'auto'; } case 'external-default': { return 'default'; } case 'external-defaultOnly': { return 'defaultOnly'; } default: { throw new Error(`Unexpected require "${id}"`); } } } } }, context: { require() { return { foo: 42 }; } } }); rollup-3.29.4/test/function/samples/namespace-tostring/external-namespaces/main.js000066400000000000000000000014201450520414700304210ustar00rootroot00000000000000import * as externalAuto from 'external-auto'; import * as externalDefault from 'external-default'; import * as externalDefaultOnly from 'external-defaultOnly'; assert.strictEqual(externalAuto[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalAuto), '[object Module]'); assert.strictEqual(externalAuto.foo, 42); assert.strictEqual(externalDefault[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefault), '[object Module]'); assert.strictEqual(externalDefault.foo, 42); assert.strictEqual(externalDefaultOnly[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(externalDefaultOnly), '[object Module]'); assert.deepStrictEqual(externalDefaultOnly.default, { foo: 42 }); rollup-3.29.4/test/function/samples/namespace-tostring/inlined-namespace/000077500000000000000000000000001450520414700265575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-tostring/inlined-namespace/_config.js000066400000000000000000000002551450520414700305230ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds Symbol.toStringTag property to inlined namespaces', options: { output: { generatedCode: { symbols: true } } } }); rollup-3.29.4/test/function/samples/namespace-tostring/inlined-namespace/foo.js000066400000000000000000000000271450520414700276770ustar00rootroot00000000000000export const bar = 42; rollup-3.29.4/test/function/samples/namespace-tostring/inlined-namespace/main.js000066400000000000000000000003031450520414700300350ustar00rootroot00000000000000import * as foo from './foo'; assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(foo.bar, 42); rollup-3.29.4/test/function/samples/namespace-tostring/interop-property-descriptor/000077500000000000000000000000001450520414700307215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-tostring/interop-property-descriptor/_config.js000066400000000000000000000005431450520414700326650ustar00rootroot00000000000000module.exports = defineTest({ description: 'generated interop namespaces should have correct Symbol.toStringTag', context: { require() { return { answer: 42 }; } }, options: { external(id) { return id.includes('external'); }, output: { generatedCode: { symbols: true }, interop(id) { return id.split('-')[1]; } } } }); rollup-3.29.4/test/function/samples/namespace-tostring/interop-property-descriptor/dep.js000066400000000000000000000001001450520414700320160ustar00rootroot00000000000000export * from 'external-default'; export const extra = 'extra'; rollup-3.29.4/test/function/samples/namespace-tostring/interop-property-descriptor/main.js000066400000000000000000000014761450520414700322130ustar00rootroot00000000000000import * as nsDefault from 'external-default'; import * as nsDefaultOnly from 'external-defaultOnly'; import * as nsMerged from './dep.js'; function verifyNamespace(ns, expected) { assert.deepStrictEqual(Object.getOwnPropertyDescriptor(ns, Symbol.toStringTag), { value: 'Module', configurable: false, enumerable: false, writable: false }); const assigned = Object.assign({}, ns); const spreaded = { ...ns }; assert.deepStrictEqual(assigned, expected); assert.strictEqual(assigned[Symbol.toStringTag], undefined); assert.deepStrictEqual(spreaded, expected); assert.strictEqual(spreaded[Symbol.toStringTag], undefined); } verifyNamespace(nsDefault, { answer: 42, default: { answer: 42 } }); verifyNamespace(nsDefaultOnly, { default: { answer: 42 } }); verifyNamespace(nsMerged, { answer: 42, extra: 'extra' }); rollup-3.29.4/test/function/samples/namespace-tostring/property-descriptor/000077500000000000000000000000001450520414700272435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-tostring/property-descriptor/_config.js000066400000000000000000000003111450520414700312000ustar00rootroot00000000000000module.exports = defineTest({ description: 'namespace export should have @@toStringTag with correct property descriptors #4336', options: { output: { generatedCode: { symbols: true } } } }); rollup-3.29.4/test/function/samples/namespace-tostring/property-descriptor/foo.js000066400000000000000000000000321450520414700303570ustar00rootroot00000000000000export const foo = 'bar'; rollup-3.29.4/test/function/samples/namespace-tostring/property-descriptor/main.js000066400000000000000000000012051450520414700305230ustar00rootroot00000000000000import * as ns from './foo.js'; const { assign, getOwnPropertyDescriptor } = Object; const { configurable, enumerable, value, writable } = getOwnPropertyDescriptor( ns, Symbol.toStringTag ); assert.strictEqual(value, 'Module', 'value'); assert.strictEqual(configurable, false, 'configurable'); assert.strictEqual(enumerable, false, 'enumerable'); assert.strictEqual(writable, false, 'writable'); const a = assign({}, ns); const b = { ...ns }; assert.deepStrictEqual(a, { foo: 'bar' }); assert.strictEqual(a[Symbol.toStringTag], undefined); assert.deepStrictEqual(b, { foo: 'bar' }); assert.strictEqual(b[Symbol.toStringTag], undefined); rollup-3.29.4/test/function/samples/namespace-update-import-fails/000077500000000000000000000000001450520414700252205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespace-update-import-fails/_config.js000066400000000000000000000015171450520414700271660ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { assertIncludes } = require('../../../utils.js'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'disallows updates to namespace exports', code(code) { assertIncludes(code, 'foo++'); }, warnings: [ { code: 'ILLEGAL_REASSIGNMENT', message: 'Illegal reassignment of import "exp" in "main.js".', id: ID_MAIN, pos: 31, loc: { column: 0, file: ID_MAIN, line: 3 }, frame: ` 1: import * as exp from './foo'; 2: 3: exp['foo']++; ^` } ], runtimeError(error) { assert.strictEqual(error.message, 'Assignment to constant variable.'); } }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/namespace-update-import-fails rollup-3.29.4/test/function/samples/namespace-update-import-fails/foo.js000066400000000000000000000000261450520414700263370ustar00rootroot00000000000000export const foo = 1; rollup-3.29.4/test/function/samples/namespace-update-import-fails/main.js000066400000000000000000000000551450520414700265020ustar00rootroot00000000000000import * as exp from './foo'; exp['foo']++; rollup-3.29.4/test/function/samples/namespaces-are-frozen/000077500000000000000000000000001450520414700235655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespaces-are-frozen/_config.js000066400000000000000000000011201450520414700255210ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'namespaces should be non-extensible and its properties immutatable and non-configurable', exports(exports) { const ns = exports.ns; assert.throws(() => { extend(ns); }); assert.throws(() => { reconfigure(ns); }); assert.throws(() => { mutate(ns); }); } }); function extend(object) { 'use strict'; object.newProperty = true; } function reconfigure(object) { Object.defineProperty(object, 'a', { value: null }); } function mutate(object) { 'use strict'; object.a = 2; } rollup-3.29.4/test/function/samples/namespaces-are-frozen/main.js000066400000000000000000000000551450520414700250470ustar00rootroot00000000000000import * as ns from './mod'; export { ns }; rollup-3.29.4/test/function/samples/namespaces-are-frozen/mod.js000066400000000000000000000000441450520414700247000ustar00rootroot00000000000000export var a = 1; export var b = 2; rollup-3.29.4/test/function/samples/namespaces-have-null-prototype/000077500000000000000000000000001450520414700254535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespaces-have-null-prototype/_config.js000066400000000000000000000001321450520414700274110ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates namespaces with null prototypes' }); rollup-3.29.4/test/function/samples/namespaces-have-null-prototype/main.js000066400000000000000000000001171450520414700267340ustar00rootroot00000000000000import * as ns from './mod'; assert.equal( Object.getPrototypeOf(ns), null ); rollup-3.29.4/test/function/samples/namespaces-have-null-prototype/mod.js000066400000000000000000000000441450520414700265660ustar00rootroot00000000000000export var a = 1; export var b = 2; rollup-3.29.4/test/function/samples/namespacing-collisions-2/000077500000000000000000000000001450520414700242005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespacing-collisions-2/Material.js000066400000000000000000000000641450520414700262740ustar00rootroot00000000000000export function Material() { return 'Material'; } rollup-3.29.4/test/function/samples/namespacing-collisions-2/MaterialAgain.js000066400000000000000000000000761450520414700272370ustar00rootroot00000000000000export function MaterialAgain() { return 'MaterialAgain'; } rollup-3.29.4/test/function/samples/namespacing-collisions-2/Something.js000066400000000000000000000002241450520414700264710ustar00rootroot00000000000000import * as Material from './Material'; export function Something() { assert.strictEqual(Material.Material(), 'Material'); return 'Something'; } rollup-3.29.4/test/function/samples/namespacing-collisions-2/SomethingAgain.js000066400000000000000000000002551450520414700274350ustar00rootroot00000000000000import * as Material from './MaterialAgain'; export function SomethingAgain() { assert.strictEqual(Material.MaterialAgain(), 'MaterialAgain'); return 'SomethingAgain'; } rollup-3.29.4/test/function/samples/namespacing-collisions-2/_config.js000066400000000000000000000004101450520414700261350ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'correctly namespaces when using * exports, take two (#910)', exports(exports) { assert.deepEqual(exports, ['Material', 'MaterialAgain', 'Something', 'SomethingAgain']); } }); rollup-3.29.4/test/function/samples/namespacing-collisions-2/main.js000066400000000000000000000004261450520414700254640ustar00rootroot00000000000000import { Something } from './Something'; import { SomethingAgain } from './SomethingAgain'; import { Material } from './Material'; import { MaterialAgain } from './MaterialAgain'; var result = [Material(), MaterialAgain(), Something(), SomethingAgain()] export default result; rollup-3.29.4/test/function/samples/namespacing-collisions/000077500000000000000000000000001450520414700240415ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespacing-collisions/Material.js000066400000000000000000000000641450520414700261350ustar00rootroot00000000000000export function Material() { return 'Material'; } rollup-3.29.4/test/function/samples/namespacing-collisions/Something.js000066400000000000000000000002241450520414700263320ustar00rootroot00000000000000import * as Material from './Material'; export function Something() { assert.strictEqual(Material.Material(), 'Material'); return 'Something'; } rollup-3.29.4/test/function/samples/namespacing-collisions/_config.js000066400000000000000000000003411450520414700260010ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'correctly namespaces when using * exports (#910)', exports(exports) { assert.deepStrictEqual(exports, ['Material', 'Something']); } }); rollup-3.29.4/test/function/samples/namespacing-collisions/main.js000066400000000000000000000002161450520414700253220ustar00rootroot00000000000000import { Something } from './Something'; import { Material } from './Material'; var result = [Material(), Something()] export default result;rollup-3.29.4/test/function/samples/namespacing-in-sub-functions/000077500000000000000000000000001450520414700250665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/namespacing-in-sub-functions/_config.js000066400000000000000000000002771450520414700270360ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'correctly namespaces sub-functions (#910)', exports(exports) { assert.equal(exports, 'foobar'); } }); rollup-3.29.4/test/function/samples/namespacing-in-sub-functions/main.js000066400000000000000000000003321450520414700263460ustar00rootroot00000000000000import { problematicFunc as otherFunc } from './problematicFunc'; function innerFunc() { function problematicFunc () { return otherFunc(); } return problematicFunc(); } var res = innerFunc(); export default res;rollup-3.29.4/test/function/samples/namespacing-in-sub-functions/problematicFunc.js000066400000000000000000000001151450520414700305360ustar00rootroot00000000000000function problematicFunc() { return 'foobar'; } export { problematicFunc };rollup-3.29.4/test/function/samples/nested-and-async-plugin/000077500000000000000000000000001450520414700240315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/nested-and-async-plugin/_config.js000066400000000000000000000010221450520414700257660ustar00rootroot00000000000000const pluginA = { name: 'nested-plugin-1', options(options) { options.plugins.push(pluginB); }, transform(code) { return code.replace('foo = 1', 'foo = 2'); } }; const pluginB = Promise.resolve({ name: 'async-plugin-2', transform(code) { return code.replace('answer = 41', 'answer = 42'); } }); module.exports = defineTest({ description: 'works when nested plugin', options: { // eslint-disable-next-line no-sparse-arrays plugins: [[Promise.resolve(pluginA)], [undefined, Promise.resolve([null])], ,] } }); rollup-3.29.4/test/function/samples/nested-and-async-plugin/main.js000066400000000000000000000001231450520414700253070ustar00rootroot00000000000000const foo = 1; const answer = 41; assert.equal(foo, 2); assert.equal(answer, 42); rollup-3.29.4/test/function/samples/nested-foreach/000077500000000000000000000000001450520414700222675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/nested-foreach/_config.js000066400000000000000000000003141450520414700242270ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'detects side-effects in nested .forEach calls (#3533)', exports: exports => assert.strictEqual(exports.result, 9) }); rollup-3.29.4/test/function/samples/nested-foreach/main.js000066400000000000000000000001501450520414700235450ustar00rootroot00000000000000const list = [1, 2]; export let result = 0; list.forEach(p => list.forEach(pp => (result += p * pp))); rollup-3.29.4/test/function/samples/nested-inlined-dynamic-import-1/000077500000000000000000000000001450520414700253725ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/nested-inlined-dynamic-import-1/_config.js000066400000000000000000000005071450520414700273360ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'deconflicts variables when nested dynamic imports are inlined via inlineDynamicImports', options: { output: { inlineDynamicImports: true } }, exports(exports) { return exports().then(result => assert.strictEqual(result, 43)); } }); rollup-3.29.4/test/function/samples/nested-inlined-dynamic-import-1/foo.js000066400000000000000000000000311450520414700265050ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/nested-inlined-dynamic-import-1/main.js000066400000000000000000000001411450520414700266500ustar00rootroot00000000000000export default () => { const foo = 1; return import('./foo.js').then(ns => ns.value + foo); }; rollup-3.29.4/test/function/samples/nested-inlined-dynamic-import-2/000077500000000000000000000000001450520414700253735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/nested-inlined-dynamic-import-2/_config.js000066400000000000000000000010271450520414700273350ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_LIB1 = path.join(__dirname, 'lib1.js'); const ID_LIB2 = path.join(__dirname, 'lib2.js'); module.exports = defineTest({ description: 'deconflicts variables when nested dynamic imports are inlined', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_LIB1, ID_LIB2, ID_LIB1], message: 'Circular dependency: lib1.js -> lib2.js -> lib1.js' } ], exports(exports) { return exports().then(result => assert.strictEqual(result, 43)); } }); rollup-3.29.4/test/function/samples/nested-inlined-dynamic-import-2/lib1.js000066400000000000000000000001671450520414700265640ustar00rootroot00000000000000import './lib2.js'; export default () => { const lib2 = 1; return import('./lib2.js').then(ns => ns.foo + lib2); }; rollup-3.29.4/test/function/samples/nested-inlined-dynamic-import-2/lib2.js000066400000000000000000000000541450520414700265600ustar00rootroot00000000000000import './lib1.js'; export const foo = 42; rollup-3.29.4/test/function/samples/nested-inlined-dynamic-import-2/main.js000066400000000000000000000000431450520414700266520ustar00rootroot00000000000000export {default} from './lib1.js'; rollup-3.29.4/test/function/samples/nested-namespace-member-expression/000077500000000000000000000000001450520414700262565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/nested-namespace-member-expression/_config.js000066400000000000000000000003121450520414700302140ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles accessing members of namespaces correctly', exports(exports) { assert.strictEqual(exports, false); } }); rollup-3.29.4/test/function/samples/nested-namespace-member-expression/helpers.js000066400000000000000000000000411450520414700302510ustar00rootroot00000000000000export var global = {Object: {}};rollup-3.29.4/test/function/samples/nested-namespace-member-expression/main.js000066400000000000000000000001321450520414700275340ustar00rootroot00000000000000import * as helpers from './helpers.js'; export default helpers.global.Object === Object; rollup-3.29.4/test/function/samples/nested-property-call-performance/000077500000000000000000000000001450520414700257545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/nested-property-call-performance/_config.js000066400000000000000000000001541450520414700277160ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles nested property calls with acceptable performance' }); rollup-3.29.4/test/function/samples/nested-property-call-performance/main.js000066400000000000000000000010761450520414700272420ustar00rootroot00000000000000assert.equal( 'u' .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat('') .concat(''), 'u' ); rollup-3.29.4/test/function/samples/new-target-meta/000077500000000000000000000000001450520414700224015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/new-target-meta/_config.js000066400000000000000000000001241450520414700243400ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not change new.target usages' }); rollup-3.29.4/test/function/samples/new-target-meta/main.js000066400000000000000000000001051450520414700236570ustar00rootroot00000000000000function Foo() { assert.strictEqual(new.target, Foo); } new Foo(); rollup-3.29.4/test/function/samples/newline-after-comment/000077500000000000000000000000001450520414700236005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/newline-after-comment/_config.js000066400000000000000000000002571450520414700255460ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'inserts newline after comment', exports(exports) { assert.equal(exports(), 42); } }); rollup-3.29.4/test/function/samples/newline-after-comment/main.js000066400000000000000000000001341450520414700250600ustar00rootroot00000000000000// this comment should not affect the line below export default function () { return 42; } rollup-3.29.4/test/function/samples/no-external-live-bindings-compact/000077500000000000000000000000001450520414700260105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/no-external-live-bindings-compact/_config.js000066400000000000000000000015511450520414700277540ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Allows omitting the code that handles external live bindings', options: { external: () => true, output: { compact: true, externalLiveBindings: false, name: 'bundle', dynamicImportInCjs: false } }, context: { require(id) { return { [id]: true, value: id }; } }, exports(exports) { assert.deepStrictEqual(Object.keys(exports).sort(), [ 'dynamic', 'external1', 'external2', 'value' ]); assert.strictEqual(exports.external1, true); assert.strictEqual(exports.external2, true); assert.strictEqual(exports.value, 'external2'); return exports.dynamic.then(dynamic => assert.deepStrictEqual(dynamic, { __proto__: null, external3: true, value: 'external3', default: { external3: true, value: 'external3' } }) ); } }); rollup-3.29.4/test/function/samples/no-external-live-bindings-compact/main.js000066400000000000000000000001561450520414700272740ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; export const dynamic = import('external3'); rollup-3.29.4/test/function/samples/no-external-live-bindings/000077500000000000000000000000001450520414700243645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/no-external-live-bindings/_config.js000066400000000000000000000015271450520414700263330ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Allows omitting the code that handles external live bindings', options: { external: () => true, output: { externalLiveBindings: false, name: 'bundle', dynamicImportInCjs: false } }, context: { require(id) { return { [id]: true, value: id }; } }, exports(exports) { assert.deepStrictEqual(Object.keys(exports).sort(), [ 'dynamic', 'external1', 'external2', 'value' ]); assert.strictEqual(exports.external1, true); assert.strictEqual(exports.external2, true); assert.strictEqual(exports.value, 'external2'); return exports.dynamic.then(dynamic => assert.deepStrictEqual(dynamic, { __proto__: null, external3: true, value: 'external3', default: { external3: true, value: 'external3' } }) ); } }); rollup-3.29.4/test/function/samples/no-external-live-bindings/main.js000066400000000000000000000001561450520414700256500ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; export const dynamic = import('external3'); rollup-3.29.4/test/function/samples/no-imports/000077500000000000000000000000001450520414700215075ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/no-imports/_config.js000066400000000000000000000001411450520414700234450ustar00rootroot00000000000000module.exports = defineTest({ description: 'creates a bundle from a module with no imports' }); rollup-3.29.4/test/function/samples/no-imports/main.js000066400000000000000000000000221450520414700227630ustar00rootroot00000000000000assert.ok( true );rollup-3.29.4/test/function/samples/no-relative-external/000077500000000000000000000000001450520414700234455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/no-relative-external/_config.js000066400000000000000000000005501450520414700254070ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'missing relative imports are an error, not a warning', error: { code: 'UNRESOLVED_IMPORT', exporter: './missing.js', id: ID_MAIN, watchFiles: [ID_MAIN], message: 'Could not resolve "./missing.js" from "main.js"' } }); rollup-3.29.4/test/function/samples/no-relative-external/main.js000066400000000000000000000000441450520414700247250ustar00rootroot00000000000000import missing from './missing.js'; rollup-3.29.4/test/function/samples/non-extension-dot/000077500000000000000000000000001450520414700227705ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/non-extension-dot/_config.js000066400000000000000000000001531450520414700247310ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds .js to module paths with non-extension dots in them' }); rollup-3.29.4/test/function/samples/non-extension-dot/foo.bar.js000066400000000000000000000000301450520414700246450ustar00rootroot00000000000000export default 'fubar'; rollup-3.29.4/test/function/samples/non-extension-dot/main.js000066400000000000000000000001011450520414700242420ustar00rootroot00000000000000import status from './foo.bar'; assert.equal( status, 'fubar' ); rollup-3.29.4/test/function/samples/non-function-hook-async/000077500000000000000000000000001450520414700240665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/non-function-hook-async/_config.js000066400000000000000000000006221450520414700260300ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when providing a value for an async function hook', options: { plugins: { resolveId: 'value' } }, error: { code: 'INVALID_PLUGIN_HOOK', hook: 'resolveId', message: 'Error running plugin hook "resolveId" for plugin "at position 1", expected a function hook or an object with a "handler" function.', plugin: 'at position 1' } }); rollup-3.29.4/test/function/samples/non-function-hook-async/foo.js000066400000000000000000000000231450520414700252020ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/non-function-hook-async/main.js000066400000000000000000000000511450520414700253440ustar00rootroot00000000000000export default () => import('./foo.js'); rollup-3.29.4/test/function/samples/non-function-hook-sync/000077500000000000000000000000001450520414700237255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/non-function-hook-sync/_config.js000066400000000000000000000006441450520414700256730ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when providing a value for a sync function hook', options: { plugins: { outputOptions: 'value' } }, generateError: { code: 'INVALID_PLUGIN_HOOK', hook: 'outputOptions', message: 'Error running plugin hook "outputOptions" for plugin "at position 1", expected a function hook or an object with a "handler" function.', plugin: 'at position 1' } }); rollup-3.29.4/test/function/samples/non-function-hook-sync/foo.js000066400000000000000000000000231450520414700250410ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/non-function-hook-sync/main.js000066400000000000000000000000511450520414700252030ustar00rootroot00000000000000export default () => import('./foo.js'); rollup-3.29.4/test/function/samples/non-js-extensions/000077500000000000000000000000001450520414700230015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/non-js-extensions/_config.js000066400000000000000000000004311450520414700247410ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'non .js extensions are preserved', options: { plugins: [ { transform(code, id) { if (path.extname(id) === '.json') { return 'export default ' + code; } } } ] } }); rollup-3.29.4/test/function/samples/non-js-extensions/info.json000066400000000000000000000000221450520414700246210ustar00rootroot00000000000000{ "answer": 42 } rollup-3.29.4/test/function/samples/non-js-extensions/main.js000066400000000000000000000001021450520414700242540ustar00rootroot00000000000000import info from './info.json'; assert.equal( info.answer, 42 ); rollup-3.29.4/test/function/samples/object-deep-access-effect/000077500000000000000000000000001450520414700242525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/object-deep-access-effect/_config.js000066400000000000000000000003451450520414700262160ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when an nested property of an unknown object property is accessed', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }); rollup-3.29.4/test/function/samples/object-deep-access-effect/main.js000066400000000000000000000002231450520414700255310ustar00rootroot00000000000000import { unknown } from 'external'; assert.throws(() => { const obj = {}; obj[unknown].prop; }, /^TypeError: Cannot read propert.*'prop'.*$/ ); rollup-3.29.4/test/function/samples/object-destructuring-renaming/000077500000000000000000000000001450520414700253445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/object-destructuring-renaming/_config.js000066400000000000000000000003571450520414700273130ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'renaming destructured object properties should request the correct property (#527)', exports(exports) { assert.equal(exports.env, process.env); } }); rollup-3.29.4/test/function/samples/object-destructuring-renaming/main.js000066400000000000000000000001021450520414700266170ustar00rootroot00000000000000import { getEnv } from './module.js'; export var env = getEnv(); rollup-3.29.4/test/function/samples/object-destructuring-renaming/module.js000066400000000000000000000001041450520414700271620ustar00rootroot00000000000000const { env } = process; export function getEnv() { return env; } rollup-3.29.4/test/function/samples/object-dynamic-properties/000077500000000000000000000000001450520414700244625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/object-dynamic-properties/_config.js000066400000000000000000000001401450520414700264170ustar00rootroot00000000000000module.exports = defineTest({ description: 'dynamic object assignments should be imported' }); rollup-3.29.4/test/function/samples/object-dynamic-properties/main.js000066400000000000000000000002421450520414700257420ustar00rootroot00000000000000import tags from './tags'; assert.equal(tags['[object Object]'], true); assert.equal(tags['[object Number]'], false); assert.equal(Object.keys(tags).length, 6); rollup-3.29.4/test/function/samples/object-dynamic-properties/tags.js000066400000000000000000000007571450520414700257670ustar00rootroot00000000000000// Emulates a piece of Lodash source code. // The tag strings are not imported, and a runtime error ensues. var objTag = '[object Object]'; var arrTag = '[object Array]'; var fnTag = '[object Function]'; var dateTag = '[object Date]'; var strTag = '[object String]'; var numTag = '[object Number]'; // Only the code below is included in the bundle. var tags = {}; tags[objTag] = tags[arrTag] = tags[fnTag] = tags[dateTag] = true; tags[strTag] = tags[numTag] = false; export default tags; rollup-3.29.4/test/function/samples/object-expression-shadowed-properties/000077500000000000000000000000001450520414700270315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/object-expression-shadowed-properties/_config.js000066400000000000000000000003211450520414700307670ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not remove calls to object expression methods that may have side-effects when properties may be shadowed', context: { unknownA: 'a', unknownB: 'b' } }); rollup-3.29.4/test/function/samples/object-expression-shadowed-properties/main.js000066400000000000000000000005331450520414700303140ustar00rootroot00000000000000const x = { a() {}, a() { triggeredX = true; } }; let triggeredX = false; x.a(); assert.ok(triggeredX); const y = { a() { triggeredY = true; }, [unknownB]() {} }; let triggeredY = false; y.a(); assert.ok(triggeredY); const z = { a() {}, [unknownA]() { triggeredZ = true; } }; let triggeredZ = false; z.a(); assert.ok(triggeredZ); rollup-3.29.4/test/function/samples/object-properties/000077500000000000000000000000001450520414700230405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/object-properties/_config.js000066400000000000000000000001341450520414700250000ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes object properties in definitions' }); rollup-3.29.4/test/function/samples/object-properties/main.js000066400000000000000000000001011450520414700243120ustar00rootroot00000000000000import object from './object'; assert.equal( object.answer, 42 );rollup-3.29.4/test/function/samples/object-properties/object.js000066400000000000000000000000651450520414700246450ustar00rootroot00000000000000var answer = 42; export default { answer: answer };rollup-3.29.4/test/function/samples/object-prototype-properties/000077500000000000000000000000001450520414700251035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/object-prototype-properties/_config.js000066400000000000000000000001551450520414700270460ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles names conflicting with Object.prototype properties' }); rollup-3.29.4/test/function/samples/object-prototype-properties/foo.js000066400000000000000000000001261450520414700262230ustar00rootroot00000000000000function valueOf() { return 42; } export default function() { return valueOf(); }; rollup-3.29.4/test/function/samples/object-prototype-properties/main.js000066400000000000000000000000651450520414700263660ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 42 ); rollup-3.29.4/test/function/samples/object-spread-side-effect/000077500000000000000000000000001450520414700242765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/object-spread-side-effect/_config.js000066400000000000000000000001461450520414700262410ustar00rootroot00000000000000module.exports = defineTest({ description: 'triggers getter side effects when spreading objects' }); rollup-3.29.4/test/function/samples/object-spread-side-effect/main.js000066400000000000000000000001751450520414700255630ustar00rootroot00000000000000let result = 'FAIL'; const unused = { ...{ get prop() { result = 'PASS'; } } }; assert.strictEqual(result, 'PASS'); rollup-3.29.4/test/function/samples/optional-catch-binding/000077500000000000000000000000001450520414700237155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/optional-catch-binding/_config.js000066400000000000000000000003231450520414700256550ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows optional catch binding with appropriate acorn settings', exports(exports) { assert.equal(exports.foo, true); } }); rollup-3.29.4/test/function/samples/optional-catch-binding/main.js000066400000000000000000000000701450520414700251740ustar00rootroot00000000000000export let foo; try { foo(); } catch { foo = true; } rollup-3.29.4/test/function/samples/optional-chaining-side-effect/000077500000000000000000000000001450520414700251575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/optional-chaining-side-effect/_config.js000066400000000000000000000003421450520414700271200ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles side effects in optional chaining (#4806)', exports({ get, set }) { set(['test']); assert.strictEqual(get('test'), 't'); } }); rollup-3.29.4/test/function/samples/optional-chaining-side-effect/main.js000066400000000000000000000002401450520414700264350ustar00rootroot00000000000000var value; export function get(v) { let g = value?.find(b => v === b); if (!g) { return; } return g.charAt(0); } export function set(a) { value = a; } rollup-3.29.4/test/function/samples/options-async-hook/000077500000000000000000000000001450520414700231445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/options-async-hook/_config.js000066400000000000000000000014521450520414700251100ustar00rootroot00000000000000const assert = require('node:assert'); const { promises: fs } = require('node:fs'); module.exports = defineTest({ description: 'resolves promises between sequential options hooks', options: { input: 'super-unused', treeshake: false, plugins: [ { name: 'test-plugin-1', async options(options) { assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { input: 'super-unused', plugins: [{ name: 'test-plugin-1' }, { name: 'test-plugin-2' }], strictDeprecations: true, treeshake: false }); return { ...options, input: (await fs.readFile('file.txt', 'utf8')).trim() }; } }, { name: 'test-plugin-2', options(options) { assert.strictEqual(options.input, 'unused'); return { ...options, input: 'used' }; } } ] } }); rollup-3.29.4/test/function/samples/options-async-hook/file.txt000066400000000000000000000000071450520414700246210ustar00rootroot00000000000000unused rollup-3.29.4/test/function/samples/options-async-hook/unused.js000066400000000000000000000000411450520414700250000ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/options-async-hook/used.js000066400000000000000000000000231450520414700244350ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/options-hook/000077500000000000000000000000001450520414700220315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/options-hook/_config.js000066400000000000000000000026661450520414700240050ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows to read and modify options in the options hook', options: { input: 'unused', treeshake: false, plugins: { name: 'test-plugin', buildStart(options) { assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { acorn: { ecmaVersion: 'latest', sourceType: 'module' }, acornInjectPlugins: [null], context: 'undefined', experimentalCacheExpiry: 10, experimentalLogSideEffects: false, input: ['used'], logLevel: 'info', makeAbsoluteExternalsRelative: 'ifRelativeSource', maxParallelFileOps: 20, maxParallelFileReads: 20, perf: false, plugins: [ { name: 'test-plugin' } ], preserveEntrySignatures: 'exports-only', preserveSymlinks: false, shimMissingExports: false, strictDeprecations: true, treeshake: false }); assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); assert.strictEqual(this.meta.watchMode, false); }, options(options) { assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { input: 'unused', plugins: { name: 'test-plugin' }, strictDeprecations: true, treeshake: false }); assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); assert.strictEqual(this.meta.watchMode, false); return { ...options, input: 'used' }; } } } }); rollup-3.29.4/test/function/samples/options-hook/unused.js000066400000000000000000000000411450520414700236650ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/options-hook/used.js000066400000000000000000000000231450520414700233220ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/options-in-renderstart/000077500000000000000000000000001450520414700240325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/options-in-renderstart/_config.js000066400000000000000000000013521450520414700257750ustar00rootroot00000000000000const assert = require('node:assert'); const checkedOptions = []; module.exports = defineTest({ description: 'makes input and output options available in renderStart', options: { context: 'global', plugins: { name: 'input-plugin', renderStart(outputOptions, inputOptions) { checkedOptions.push('input-plugin', outputOptions.format, inputOptions.context); } }, output: { plugins: { name: 'output-plugin', renderStart(outputOptions, inputOptions) { checkedOptions.push('output-plugin', outputOptions.format, inputOptions.context); } } } }, exports: () => { assert.deepStrictEqual(checkedOptions, [ 'input-plugin', 'cjs', 'global', 'output-plugin', 'cjs', 'global' ]); } }); rollup-3.29.4/test/function/samples/options-in-renderstart/main.js000066400000000000000000000000211450520414700253050ustar00rootroot00000000000000assert.ok(this); rollup-3.29.4/test/function/samples/output-options-hook/000077500000000000000000000000001450520414700233675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/output-options-hook/_config.js000066400000000000000000000041771450520414700253420ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows to read and modify options in the options hook', exports(exports) { assert.deepStrictEqual(exports, { foo: 42, bar: 43 }); }, options: { output: { banner: "throw new Error('unused')" }, plugins: { name: 'test-plugin', renderChunk(code, chunk, options) { assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { amd: { define: 'define', autoId: false, forceJsExtensionForImports: false }, assetFileNames: 'assets/[name]-[hash][extname]', chunkFileNames: '[name]-[hash].js', compact: false, dynamicImportInCjs: true, entryFileNames: '[name].js', esModule: 'if-default-prop', experimentalDeepDynamicChunkOptimization: false, experimentalMinChunkSize: 1, exports: 'auto', extend: false, externalImportAssertions: true, externalLiveBindings: true, format: 'cjs', freeze: true, generatedCode: { arrowFunctions: false, constBindings: false, objectShorthand: false, reservedNamesAsProps: true, symbols: false }, globals: {}, hoistTransitiveImports: true, indent: true, inlineDynamicImports: false, manualChunks: {}, minifyInternalExports: false, namespaceToStringTag: false, noConflict: false, paths: {}, plugins: [], preferConst: false, preserveModules: false, sourcemap: false, sourcemapExcludeSources: false, strict: true, systemNullSetters: true, validate: false }); assert.strictEqual(options.banner(), 'exports.bar = 43;'); assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); assert.strictEqual(this.meta.watchMode, false); }, outputOptions(options) { assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), { banner: "throw new Error('unused')", exports: 'auto', format: 'cjs' }); assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion)); assert.strictEqual(this.meta.watchMode, false); return { ...options, banner: 'exports.bar = 43;' }; } } } }); rollup-3.29.4/test/function/samples/output-options-hook/main.js000066400000000000000000000000271450520414700246500ustar00rootroot00000000000000export const foo = 42; rollup-3.29.4/test/function/samples/override-external-namespace/000077500000000000000000000000001450520414700247715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/override-external-namespace/_config.js000066400000000000000000000007451450520414700267410ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows overriding imports of external namespace reexports', options: { external: 'path' }, exports(exports) { assert.strictEqual(typeof exports.basename, 'function'); assert.strictEqual(exports.dirname, 'defined'); assert.strictEqual(exports.join, undefined); assert.strictEqual(exports.resolve, undefined); exports.reassign(); assert.strictEqual(exports.resolve, 'defined'); } }); rollup-3.29.4/test/function/samples/override-external-namespace/main.js000066400000000000000000000002221450520414700262470ustar00rootroot00000000000000export * from 'path'; export const dirname = 'defined'; export let resolve; export var join; export const reassign = () => (resolve = 'defined'); rollup-3.29.4/test/function/samples/override-static-external-namespace/000077500000000000000000000000001450520414700262565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/override-static-external-namespace/_config.js000066400000000000000000000010661450520414700302230ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'allows overriding imports of external namespace reexports without external live-bindings', options: { external: 'path', output: { externalLiveBindings: false } }, exports(exports) { assert.strictEqual(typeof exports.basename, 'function'); assert.strictEqual(exports.dirname, 'defined'); assert.strictEqual(exports.join, undefined); assert.strictEqual(exports.resolve, undefined); exports.reassign(); assert.strictEqual(exports.resolve, 'defined'); } }); rollup-3.29.4/test/function/samples/override-static-external-namespace/main.js000066400000000000000000000002211450520414700275330ustar00rootroot00000000000000export * from 'path'; export const dirname = 'defined'; export let resolve; export var join; export const reassign = () => (resolve = 'defined');rollup-3.29.4/test/function/samples/parameter-defaults/000077500000000000000000000000001450520414700231655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/arrays/000077500000000000000000000000001450520414700244665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/arrays/_config.js000066400000000000000000000001361450520414700264300ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps parameter defaults for array elements' }); rollup-3.29.4/test/function/samples/parameter-defaults/arrays/main.js000066400000000000000000000002651450520414700257530ustar00rootroot00000000000000const a = (foo = 'fallback a') => assert.strictEqual(foo, 'fallback a'); const array = [a, (foo = 'fallback b') => assert.strictEqual(foo, 'fallback b')]; array[0](); array[1](); rollup-3.29.4/test/function/samples/parameter-defaults/class-fields/000077500000000000000000000000001450520414700255365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/class-fields/_config.js000066400000000000000000000001341450520414700274760ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps parameter defaults for class fields' }); rollup-3.29.4/test/function/samples/parameter-defaults/class-fields/main.js000066400000000000000000000003611450520414700270200ustar00rootroot00000000000000const a = (foo = 'fallback a') => assert.strictEqual(foo, 'fallback a'); const b = (foo = 'fallback b') => assert.strictEqual(foo, 'fallback b'); class Test { static staticField = a; field = b; } Test.staticField(); new Test().field(); rollup-3.29.4/test/function/samples/parameter-defaults/exported/000077500000000000000000000000001450520414700250175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/exported/_config.js000066400000000000000000000006111450520414700267570ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'includes default parameters for exported functions', exports({ funDecl, funExp, arrow }) { assert.strictEqual(funDecl(), 'defaultValue', 'function declaration'); assert.strictEqual(funExp(), 'defaultValue', 'function expression'); assert.strictEqual(arrow(), 'defaultValue', 'arrow function'); } }); rollup-3.29.4/test/function/samples/parameter-defaults/exported/main.js000066400000000000000000000002611450520414700263000ustar00rootroot00000000000000export function funDecl(a = 'defaultValue') { return a; } export const funExp = function (a = 'defaultValue') { return a; }; export const arrow = (a = 'defaultValue') => a; rollup-3.29.4/test/function/samples/parameter-defaults/function-as-default/000077500000000000000000000000001450520414700270355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/function-as-default/_config.js000066400000000000000000000001431450520414700307750ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes functions supplied as default values' }); rollup-3.29.4/test/function/samples/parameter-defaults/function-as-default/main.js000066400000000000000000000001511450520414700303140ustar00rootroot00000000000000const foo = (a = 'fallback') => a; const bar = (a = foo) => a; assert.strictEqual(bar()(), 'fallback'); rollup-3.29.4/test/function/samples/parameter-defaults/function-return/000077500000000000000000000000001450520414700263275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/function-return/_config.js000066400000000000000000000001431450520414700302670ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks parameter defaults for returned functions' }); rollup-3.29.4/test/function/samples/parameter-defaults/function-return/main.js000066400000000000000000000003241450520414700276100ustar00rootroot00000000000000function test1() { return function (a = 'fallback') { return a; }; } assert.strictEqual(test1()(), 'fallback'); const test2 = () => (_, a = 'fallback') => a; assert.strictEqual(test2````, 'fallback'); rollup-3.29.4/test/function/samples/parameter-defaults/logical-expressions/000077500000000000000000000000001450520414700271575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/logical-expressions/_config.js000066400000000000000000000001441450520414700311200ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes default parameters in logical expressios' }); rollup-3.29.4/test/function/samples/parameter-defaults/logical-expressions/main.js000066400000000000000000000001251450520414700304370ustar00rootroot00000000000000const foo = ((a = 'fallback') => a) || false; assert.strictEqual(foo(), 'fallback'); rollup-3.29.4/test/function/samples/parameter-defaults/module-side-effects/000077500000000000000000000000001450520414700270115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/module-side-effects/_config.js000066400000000000000000000003041450520414700307500ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not tree-shake necessary parameter defaults when modulesSideEffects are disabled', options: { treeshake: { moduleSideEffects: false } } }); rollup-3.29.4/test/function/samples/parameter-defaults/module-side-effects/main.js000066400000000000000000000001071450520414700302710ustar00rootroot00000000000000import { foo } from './other'; assert.strictEqual(foo(), 'fallback'); rollup-3.29.4/test/function/samples/parameter-defaults/module-side-effects/other.js000066400000000000000000000000521450520414700304650ustar00rootroot00000000000000export const foo = (a = 'fallback') => a; rollup-3.29.4/test/function/samples/parameter-defaults/objects/000077500000000000000000000000001450520414700246165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/objects/_config.js000066400000000000000000000001421450520414700265550ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps parameter defaults for methods in objects' }); rollup-3.29.4/test/function/samples/parameter-defaults/objects/main.js000066400000000000000000000002671450520414700261050ustar00rootroot00000000000000const a = (foo = 'fallback a') => assert.strictEqual(foo, 'fallback a'); const obj = { a, b(foo = 'fallback b') { assert.strictEqual(foo, 'fallback b'); } }; obj.a(); obj.b(); rollup-3.29.4/test/function/samples/parameter-defaults/return-expressions/000077500000000000000000000000001450520414700270645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/return-expressions/_config.js000066400000000000000000000001441450520414700310250ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps parameter defaults for returned expressions' }); rollup-3.29.4/test/function/samples/parameter-defaults/return-expressions/main.js000066400000000000000000000002111450520414700303400ustar00rootroot00000000000000function foo() { const bar = (options = 'fallback') => { return options; }; return bar; } assert.strictEqual(foo()(), 'fallback'); rollup-3.29.4/test/function/samples/parameter-defaults/super-classes/000077500000000000000000000000001450520414700257565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/super-classes/_config.js000066400000000000000000000001351450520414700277170ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps parameter defaults for super classes' }); rollup-3.29.4/test/function/samples/parameter-defaults/super-classes/main.js000066400000000000000000000015401450520414700272400ustar00rootroot00000000000000class A { constructor(a = 'superConstructorDefault') { this.a = a; } static staticMethod(b = 'superStaticDefault') { return b; } method(c = 'superMethodDefault') { return c; } } class B extends A { constructor(a = 'constructorDefault') { assert.strictEqual(a, 'constructorDefault'); super(); } static staticMethod(b = 'staticDefault') { assert.strictEqual(b, 'staticDefault'); return super.staticMethod(); } method(c = 'methodDefault') { assert.strictEqual(c, 'methodDefault'); return super.method(); } } assert.strictEqual(B.staticMethod(), 'superStaticDefault'); const b = new B(); assert.strictEqual(b.a, 'superConstructorDefault'); assert.strictEqual(b.method(), 'superMethodDefault'); function SuperFunction(a = 'functionDefault') { assert.strictEqual(a, 'functionDefault'); } class C extends SuperFunction {} new C(); rollup-3.29.4/test/function/samples/parameter-defaults/tagged-templates/000077500000000000000000000000001450520414700264145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/tagged-templates/_config.js000066400000000000000000000001651450520414700303600ustar00rootroot00000000000000module.exports = defineTest({ description: 'includes necessary default parameters for tagged template literals' }); rollup-3.29.4/test/function/samples/parameter-defaults/tagged-templates/main.js000066400000000000000000000002671450520414700277030ustar00rootroot00000000000000const templateTag = ([, a = 'quasiFallback'], b = 'expressionFallback') => { assert.strictEqual(a, 'quasiFallback'); assert.strictEqual(b, 'expressionFallback'); }; templateTag``; rollup-3.29.4/test/function/samples/parameter-defaults/try-catch/000077500000000000000000000000001450520414700250635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-defaults/try-catch/_config.js000066400000000000000000000001521450520414700270230ustar00rootroot00000000000000module.exports = defineTest({ description: 'keeps parameter defaults when called from try-statement' }); rollup-3.29.4/test/function/samples/parameter-defaults/try-catch/main.js000066400000000000000000000002151450520414700263430ustar00rootroot00000000000000const test = (a = 'fallback') => a; let returnValue; try { returnValue = test(); } catch {} assert.strictEqual(returnValue, 'fallback'); rollup-3.29.4/test/function/samples/parameter-side-effects/000077500000000000000000000000001450520414700237175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parameter-side-effects/_config.js000066400000000000000000000001341450520414700256570ustar00rootroot00000000000000module.exports = defineTest({ description: 'retains calls with parameter side effects' }); rollup-3.29.4/test/function/samples/parameter-side-effects/main.js000066400000000000000000000003101450520414700251730ustar00rootroot00000000000000let effect = false; function getPatternValueWithEffect() { effect = true; return 'value'; } function test({ [getPatternValueWithEffect()]: value }) {} test({ value: 'foo' }); assert.ok(effect); rollup-3.29.4/test/function/samples/parenthesised-default-export/000077500000000000000000000000001450520414700251775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/parenthesised-default-export/_config.js000066400000000000000000000001471450520414700271430ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows default exports to be enclosed in parentheses' }); rollup-3.29.4/test/function/samples/parenthesised-default-export/main.js000066400000000000000000000000271450520414700264600ustar00rootroot00000000000000export default ( 42 ); rollup-3.29.4/test/function/samples/pass-namespace-to-function/000077500000000000000000000000001450520414700245435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/pass-namespace-to-function/_config.js000066400000000000000000000001401450520414700265000ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows a namespace to be passed to a function' }); rollup-3.29.4/test/function/samples/pass-namespace-to-function/bar.js000066400000000000000000000000471450520414700256460ustar00rootroot00000000000000// this space left intentionally blank rollup-3.29.4/test/function/samples/pass-namespace-to-function/foo.js000066400000000000000000000001641450520414700256650ustar00rootroot00000000000000import * as bar from './bar'; export default function foo () {} foo.x = function () { doSomethingWith( bar ); }; rollup-3.29.4/test/function/samples/pass-namespace-to-function/main.js000066400000000000000000000001011450520414700260150ustar00rootroot00000000000000import foo from './foo'; export default function () { foo(); } rollup-3.29.4/test/function/samples/paths-are-case-sensitive/000077500000000000000000000000001450520414700242045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/paths-are-case-sensitive/Foo.js000066400000000000000000000000641450520414700252650ustar00rootroot00000000000000export default function () { assert.ok( false ); } rollup-3.29.4/test/function/samples/paths-are-case-sensitive/_config.js000066400000000000000000000005211450520414700261440ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'insists on correct casing for imports', error: { code: 'UNRESOLVED_IMPORT', exporter: './foo.js', id: ID_MAIN, watchFiles: [ID_MAIN], message: 'Could not resolve "./foo.js" from "main.js"' } }); rollup-3.29.4/test/function/samples/paths-are-case-sensitive/main.js000066400000000000000000000000441450520414700254640ustar00rootroot00000000000000import foo from './foo.js'; foo(); rollup-3.29.4/test/function/samples/per-output-plugins-warn-hooks/000077500000000000000000000000001450520414700252715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/per-output-plugins-warn-hooks/_config.js000066400000000000000000000060731450520414700272410ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns when input hooks are used in output plugins', options: { output: { plugins: [ { name: 'test-plugin', options() {}, buildStart() {}, resolveId() {}, load() {}, transform() {}, buildEnd() {}, outputOptions() {}, renderStart() {}, banner() {}, footer() {}, intro() {}, outro() {}, resolveDynamicImport() {}, resolveFileUrl() {}, resolveImportMeta() {}, augmentChunkHash() {}, renderChunk() {}, generateBundle() {}, writeBundle() {}, renderError() {} }, { buildStart() {} } ] } }, warnings: [ { code: 'INPUT_HOOK_IN_OUTPUT_PLUGIN', message: 'The "buildEnd" hook used by the output plugin test-plugin is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.' }, { code: 'INPUT_HOOK_IN_OUTPUT_PLUGIN', message: 'The "buildStart" hook used by the output plugin test-plugin is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.' }, { code: 'INPUT_HOOK_IN_OUTPUT_PLUGIN', message: 'The "load" hook used by the output plugin test-plugin is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.' }, { code: 'INPUT_HOOK_IN_OUTPUT_PLUGIN', message: 'The "options" hook used by the output plugin test-plugin is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.' }, { code: 'INPUT_HOOK_IN_OUTPUT_PLUGIN', message: 'The "resolveDynamicImport" hook used by the output plugin test-plugin is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.' }, { code: 'INPUT_HOOK_IN_OUTPUT_PLUGIN', message: 'The "resolveId" hook used by the output plugin test-plugin is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.' }, { code: 'INPUT_HOOK_IN_OUTPUT_PLUGIN', message: 'The "transform" hook used by the output plugin test-plugin is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.' }, { code: 'INPUT_HOOK_IN_OUTPUT_PLUGIN', message: 'The "buildStart" hook used by the output plugin at output position 2 is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.' } ] }); rollup-3.29.4/test/function/samples/per-output-plugins-warn-hooks/main.js000066400000000000000000000000231450520414700265460ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/perf-adds-plugin-context-to-plugins/000077500000000000000000000000001450520414700263225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/perf-adds-plugin-context-to-plugins/_config.js000066400000000000000000000007651450520414700302740ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Adds plugin context to plugins with perf=true', options: { perf: true, plugins: [ { load() { assert.ok(typeof this.parse === 'function'); }, resolveDynamicImport() { assert.ok(typeof this.parse === 'function'); }, resolveId() { assert.ok(typeof this.parse === 'function'); }, transform() { assert.ok(typeof this.parse === 'function'); } } ] } }); rollup-3.29.4/test/function/samples/perf-adds-plugin-context-to-plugins/foo.js000066400000000000000000000000631450520414700274420ustar00rootroot00000000000000export default 'foo'; console.log('side-effect'); rollup-3.29.4/test/function/samples/perf-adds-plugin-context-to-plugins/main.js000066400000000000000000000000211450520414700275750ustar00rootroot00000000000000import('./foo'); rollup-3.29.4/test/function/samples/perf-supports-object-hooks/000077500000000000000000000000001450520414700246165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/perf-supports-object-hooks/_config.js000066400000000000000000000003771450520414700265670ustar00rootroot00000000000000module.exports = defineTest({ description: 'Supports object hooks with perf=true', options: { perf: true, plugins: [ { transform: { order: 'pre', handler(code) { return code.replace('FOO', 'BAR'); } } } ] } }); rollup-3.29.4/test/function/samples/perf-supports-object-hooks/main.js000066400000000000000000000000421450520414700260740ustar00rootroot00000000000000assert.strictEqual('FOO', 'BAR'); rollup-3.29.4/test/function/samples/plugin-cache/000077500000000000000000000000001450520414700217375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-cache/anonymous-delete/000077500000000000000000000000001450520414700252275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-cache/anonymous-delete/_config.js000066400000000000000000000006501450520414700271720ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for anonymous plugins deleting from the cache', options: { plugins: { buildStart() { this.cache.delete('asdf'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.', plugin: 'at position 1', pluginCode: 'ANONYMOUS_PLUGIN_CACHE' } }); rollup-3.29.4/test/function/samples/plugin-cache/anonymous-delete/main.js000066400000000000000000000000261450520414700265070ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-cache/anonymous-get/000077500000000000000000000000001450520414700245445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-cache/anonymous-get/_config.js000066400000000000000000000006371450520414700265140ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for anonymous plugins reading the cache', options: { plugins: { buildStart() { this.cache.get('asdf'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.', plugin: 'at position 1', pluginCode: 'ANONYMOUS_PLUGIN_CACHE' } }); rollup-3.29.4/test/function/samples/plugin-cache/anonymous-get/main.js000066400000000000000000000000261450520414700260240ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-cache/anonymous-has/000077500000000000000000000000001450520414700245405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-cache/anonymous-has/_config.js000066400000000000000000000006401450520414700265020ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for anonymous plugins checking the cache', options: { plugins: { buildStart() { this.cache.has('asdf'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.', plugin: 'at position 1', pluginCode: 'ANONYMOUS_PLUGIN_CACHE' } }); rollup-3.29.4/test/function/samples/plugin-cache/anonymous-has/main.js000066400000000000000000000000261450520414700260200ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-cache/anonymous-set/000077500000000000000000000000001450520414700245605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-cache/anonymous-set/_config.js000066400000000000000000000006511450520414700265240ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for anonymous plugins adding to the cache', options: { plugins: { buildStart() { this.cache.set('asdf', 'asdf'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.', plugin: 'at position 1', pluginCode: 'ANONYMOUS_PLUGIN_CACHE' } }); rollup-3.29.4/test/function/samples/plugin-cache/anonymous-set/main.js000066400000000000000000000000261450520414700260400ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-cache/duplicate-names-no-cache/000077500000000000000000000000001450520414700264655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-cache/duplicate-names-no-cache/_config.js000066400000000000000000000004651450520414700304340ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows plugins to have the same name if they do not access the cache', options: { plugins: [ { name: 'test-plugin', buildStart() { return null; } }, { name: 'test-plugin', buildStart() { return null; } } ] } }); rollup-3.29.4/test/function/samples/plugin-cache/duplicate-names-no-cache/main.js000066400000000000000000000000261450520414700277450ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-cache/duplicate-names/000077500000000000000000000000001450520414700250125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-cache/duplicate-names/_config.js000066400000000000000000000012431450520414700267540ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws if two plugins with the same name and no cache key access the cache', options: { plugins: [ { name: 'test-plugin', buildStart() { this.cache.set('asdf', 'asdf'); } }, { name: 'test-plugin', buildStart() { this.cache.set('asdf', 'asdf'); } } ] }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'The plugin name test-plugin is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).', plugin: 'test-plugin', pluginCode: 'DUPLICATE_PLUGIN_NAME' } }); rollup-3.29.4/test/function/samples/plugin-cache/duplicate-names/main.js000066400000000000000000000000261450520414700262720ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-error-loc-instead-pos/000077500000000000000000000000001450520414700250245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error-loc-instead-pos/_config.js000066400000000000000000000012041450520414700267630ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: '`this.error(...)` accepts { line, column } object as second parameter (#1265)', options: { plugins: [ { name: 'test', transform() { this.error('nope', { line: 1, column: 22 }); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'transform', id: path.join(__dirname, 'main.js'), watchFiles: [path.join(__dirname, 'main.js')], loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 22 }, frame: ` 1: assert.equal( 21 * 2, TK ); ^ ` } }); rollup-3.29.4/test/function/samples/plugin-error-loc-instead-pos/main.js000066400000000000000000000000341450520414700263030ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-3.29.4/test/function/samples/plugin-error-module-parsed/000077500000000000000000000000001450520414700245645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error-module-parsed/_config.js000066400000000000000000000006261450520414700265320ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'errors in moduleParsed abort the build', options: { plugins: [ { name: 'testPlugin', moduleParsed() { throw new Error('broken'); } } ] }, error: { code: 'PLUGIN_ERROR', hook: 'moduleParsed', message: 'broken', plugin: 'testPlugin', watchFiles: [path.join(__dirname, 'main.js')] } }); rollup-3.29.4/test/function/samples/plugin-error-module-parsed/main.js000066400000000000000000000002021450520414700260400ustar00rootroot00000000000000let effect = false; var b = { get a() { effect = true; } }; function X() {} X.prototype = b; new X().a; assert.ok(effect); rollup-3.29.4/test/function/samples/plugin-error-only-first-render-chunk/000077500000000000000000000000001450520414700265145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error-only-first-render-chunk/_config.js000066400000000000000000000007161450520414700304620ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws error only with first plugin renderChunk', options: { plugins: [ { name: 'plugin1', renderChunk() { throw new Error('Something happened 1'); } }, { name: 'plugin2', renderChunk() { throw new Error('Something happened 2'); } } ] }, generateError: { code: 'PLUGIN_ERROR', plugin: 'plugin1', hook: 'renderChunk', message: `Something happened 1` } }); rollup-3.29.4/test/function/samples/plugin-error-only-first-render-chunk/main.js000066400000000000000000000000201450520414700277660ustar00rootroot00000000000000console.log(1); rollup-3.29.4/test/function/samples/plugin-error-only-first-transform/000077500000000000000000000000001450520414700261425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error-only-first-transform/_config.js000066400000000000000000000010721450520414700301040ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'throws error only with first plugin transform', options: { plugins: [ { name: 'plugin1', transform() { throw new Error('Something happened 1'); } }, { name: 'plugin2', transform() { throw new Error('Something happened 2'); } } ] }, error: { code: 'PLUGIN_ERROR', message: `Something happened 1`, plugin: 'plugin1', hook: 'transform', id: path.join(__dirname, 'main.js'), watchFiles: [path.join(__dirname, 'main.js')] } }); rollup-3.29.4/test/function/samples/plugin-error-only-first-transform/main.js000066400000000000000000000000201450520414700274140ustar00rootroot00000000000000console.log(1); rollup-3.29.4/test/function/samples/plugin-error-should-transform/000077500000000000000000000000001450520414700253325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error-should-transform/_config.js000066400000000000000000000015261450520414700273000ustar00rootroot00000000000000const path = require('node:path'); const acorn = require('acorn'); const code = 'export default 42;\n'; const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'errors in shouldTransformCachedModule abort the build', options: { cache: { modules: [ { id: ID_MAIN, ast: acorn.parse(code, { ecmaVersion: 6, sourceType: 'module' }), code, dependencies: [], dynamicDependencies: [], originalCode: code, resolvedIds: {}, sourcemapChain: [], transformDependencies: [] } ] }, plugins: [ { name: 'test', shouldTransformCachedModule() { throw new Error('broken'); } } ] }, error: { code: 'PLUGIN_ERROR', hook: 'shouldTransformCachedModule', message: 'broken', plugin: 'test', watchFiles: [ID_MAIN] } }); rollup-3.29.4/test/function/samples/plugin-error-should-transform/main.js000066400000000000000000000000231450520414700266070ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/plugin-error-transform-pos/000077500000000000000000000000001450520414700246355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error-transform-pos/_config.js000066400000000000000000000012741450520414700266030ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: '`this.error(...)` accepts number as second parameter (#5044)', options: { plugins: [ { name: 'plugin1', transform(code) { return code + 'bar'; } }, { name: 'plugin2', transform() { this.error(new Error('error'), 26); } } ] }, error: { code: 'PLUGIN_ERROR', message: 'error', plugin: 'plugin2', hook: 'transform', id: ID_MAIN, watchFiles: [ID_MAIN], frame: ` 1: export const foo = 'foo'bar ^`, loc: { column: 26, file: ID_MAIN, line: 1 }, pos: 26 } }); rollup-3.29.4/test/function/samples/plugin-error-transform-pos/main.js000066400000000000000000000000301450520414700261100ustar00rootroot00000000000000export const foo = 'foo'rollup-3.29.4/test/function/samples/plugin-error-with-numeric-code/000077500000000000000000000000001450520414700253465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error-with-numeric-code/_config.js000066400000000000000000000010311450520414700273030ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'rollup do not break if get a plugin error that contains numeric code', options: { plugins: [ { name: 'test', transform() { const error = new Error('test message'); error.code = 100; throw error; } } ] }, error: { code: 'PLUGIN_ERROR', hook: 'transform', id: path.join(__dirname, 'main.js'), message: 'test message', plugin: 'test', pluginCode: 100, watchFiles: [path.join(__dirname, 'main.js')] } }); rollup-3.29.4/test/function/samples/plugin-error-with-numeric-code/main.js000066400000000000000000000000211450520414700266210ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/plugin-error/000077500000000000000000000000001450520414700220255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error/buildEnd/000077500000000000000000000000001450520414700235535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error/buildEnd/_config.js000066400000000000000000000004411450520414700255140ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', buildEnd() { this.error('nope'); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'buildEnd' } }); rollup-3.29.4/test/function/samples/plugin-error/buildEnd/main.js000066400000000000000000000000261450520414700250330ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-error/buildStart/000077500000000000000000000000001450520414700241425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error/buildStart/_config.js000066400000000000000000000004451450520414700261070ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', buildStart() { this.error('nope'); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'buildStart' } }); rollup-3.29.4/test/function/samples/plugin-error/buildStart/main.js000066400000000000000000000000261450520414700254220ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-error/generateBundle/000077500000000000000000000000001450520414700247515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error/generateBundle/_config.js000066400000000000000000000004651450520414700267200ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', generateBundle() { this.error('nope'); } } ] }, generateError: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'generateBundle' } }); rollup-3.29.4/test/function/samples/plugin-error/generateBundle/main.js000066400000000000000000000000261450520414700262310ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-error/load/000077500000000000000000000000001450520414700227445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error/load/_config.js000066400000000000000000000006411450520414700247070ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', load() { this.error('nope'); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: `Could not load ${path.join(__dirname, 'main.js')}: nope`, hook: 'load', watchFiles: [path.join(__dirname, 'main.js')] } }); rollup-3.29.4/test/function/samples/plugin-error/load/main.js000066400000000000000000000000261450520414700242240ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-error/renderChunk/000077500000000000000000000000001450520414700242755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error/renderChunk/_config.js000066400000000000000000000004571450520414700262450ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', renderChunk() { this.error('nope'); } } ] }, generateError: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'renderChunk' } }); rollup-3.29.4/test/function/samples/plugin-error/renderChunk/main.js000066400000000000000000000000261450520414700255550ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-error/renderStart/000077500000000000000000000000001450520414700243225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error/renderStart/_config.js000066400000000000000000000004571450520414700262720ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', renderStart() { this.error('nope'); } } ] }, generateError: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'renderStart' } }); rollup-3.29.4/test/function/samples/plugin-error/renderStart/main.js000066400000000000000000000000261450520414700256020ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-error/resolveId/000077500000000000000000000000001450520414700237615ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error/resolveId/_config.js000066400000000000000000000004431450520414700257240ustar00rootroot00000000000000module.exports = defineTest({ description: 'buildStart hooks can use this.error', options: { plugins: [ { name: 'test', resolveId() { this.error('nope'); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'resolveId' } }); rollup-3.29.4/test/function/samples/plugin-error/resolveId/main.js000066400000000000000000000000261450520414700252410ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-3.29.4/test/function/samples/plugin-error/transform/000077500000000000000000000000001450520414700240405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-error/transform/_config.js000066400000000000000000000011551450520414700260040ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'plugin transform hooks can use `this.error({...}, char)` (#1140)', options: { plugins: [ { name: 'test', transform() { this.error('nope', 22); } } ] }, error: { code: 'PLUGIN_ERROR', plugin: 'test', message: 'nope', hook: 'transform', id: path.join(__dirname, 'main.js'), watchFiles: [path.join(__dirname, 'main.js')], pos: 22, loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 22 }, frame: ` 1: assert.equal( 21 * 2, TK ); ^ ` } }); rollup-3.29.4/test/function/samples/plugin-error/transform/main.js000066400000000000000000000000341450520414700253170ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-3.29.4/test/function/samples/plugin-module-information-early-access/000077500000000000000000000000001450520414700270555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-module-information-early-access/_config.js000066400000000000000000000007111450520414700310160ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'handles accessing module information via plugins early in a graceful way', options: { external: ['path'], plugins: [ { buildStart() { assert.deepStrictEqual([...this.getModuleIds()], []); assert.strictEqual(this.getModuleInfo(ID_MAIN), null); } } ] } }); rollup-3.29.4/test/function/samples/plugin-module-information-early-access/main.js000066400000000000000000000000231450520414700303320ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/plugin-module-information-no-cache/000077500000000000000000000000001450520414700261575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-module-information-no-cache/_config.js000066400000000000000000000030301450520414700301150ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'handles accessing module information via plugins with cache disabled', options: { cache: false, plugins: [ { renderStart() { const info = this.getModuleInfo(ID_MAIN); const ast = { type: 'Program', start: 0, end: 19, body: [ { type: 'ExportDefaultDeclaration', start: 0, end: 18, declaration: { type: 'Literal', start: 15, end: 17, value: 42, raw: '42' } } ], sourceType: 'module' }; assert.deepStrictEqual(JSON.parse(JSON.stringify(info)), { assertions: {}, ast, code: 'export default 42;\n', dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [], exportedBindings: { '.': ['default'] }, exports: ['default'], hasDefaultExport: true, id: ID_MAIN, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, moduleSideEffects: true, syntheticNamedExports: false }); // Call AST again to ensure line coverage for cached getter assert.deepStrictEqual(JSON.parse(JSON.stringify(info.ast)), ast); } } ] } }); rollup-3.29.4/test/function/samples/plugin-module-information-no-cache/main.js000066400000000000000000000000231450520414700274340ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/plugin-module-information/000077500000000000000000000000001450520414700245045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-module-information/_config.js000066400000000000000000000274211450520414700264540ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { getObject } = require('../../../utils'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); const ID_NESTED = path.join(__dirname, 'nested', 'nested.js'); const ID_PATH = 'path'; let rendered = false; module.exports = defineTest({ description: 'provides module information on the plugin context', options: { external: ['path'], plugins: { load(id) { assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(id))), { assertions: {}, ast: null, code: null, dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: null, dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], moduleSideEffects: true, id, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [], isEntry: id === ID_MAIN, isExternal: false, isIncluded: null, meta: {}, syntheticNamedExports: false }); }, renderStart() { rendered = true; assert.deepStrictEqual( getObject( [...this.getModuleIds()].map(id => [ id, JSON.parse(JSON.stringify(this.getModuleInfo(id))) ]) ), { [ID_FOO]: { id: ID_FOO, assertions: {}, ast: { type: 'Program', start: 0, end: 66, body: [ { type: 'ImportDeclaration', start: 0, end: 24, specifiers: [ { type: 'ImportDefaultSpecifier', start: 7, end: 11, local: { type: 'Identifier', start: 7, end: 11, name: 'path' } } ], source: { type: 'Literal', start: 17, end: 23, value: 'path', raw: "'path'" } }, { type: 'ExportNamedDeclaration', start: 26, end: 65, declaration: { type: 'VariableDeclaration', start: 33, end: 65, declarations: [ { type: 'VariableDeclarator', start: 39, end: 64, id: { type: 'Identifier', start: 39, end: 42, name: 'foo' }, init: { type: 'CallExpression', start: 45, end: 64, callee: { type: 'MemberExpression', start: 45, end: 57, object: { type: 'Identifier', start: 45, end: 49, name: 'path' }, property: { type: 'Identifier', start: 50, end: 57, name: 'resolve' }, computed: false, optional: false }, arguments: [ { type: 'Literal', start: 58, end: 63, value: 'foo', raw: "'foo'" } ], optional: false } } ], kind: 'const' }, specifiers: [], source: null } ], sourceType: 'module' }, code: "import path from 'path';\n\nexport const foo = path.resolve('foo');\n", dynamicallyImportedIdResolutions: [], exportedBindings: { '.': ['foo'] }, exports: ['foo'], dynamicallyImportedIds: [], dynamicImporters: [], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: true, id: ID_PATH, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_PATH], importers: [ID_MAIN, ID_NESTED], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }, [ID_MAIN]: { id: ID_MAIN, assertions: {}, ast: { type: 'Program', start: 0, end: 159, body: [ { type: 'ExportNamedDeclaration', start: 0, end: 31, declaration: null, specifiers: [ { type: 'ExportSpecifier', start: 9, end: 12, local: { type: 'Identifier', start: 9, end: 12, name: 'foo' }, exported: { type: 'Identifier', start: 9, end: 12, name: 'foo' } } ], source: { type: 'Literal', start: 20, end: 30, value: './foo.js', raw: "'./foo.js'" } }, { type: 'ExportNamedDeclaration', start: 32, end: 80, declaration: { type: 'VariableDeclaration', start: 39, end: 80, declarations: [ { type: 'VariableDeclarator', start: 45, end: 79, id: { type: 'Identifier', start: 45, end: 51, name: 'nested' }, init: { type: 'ImportExpression', start: 54, end: 79, source: { type: 'Literal', start: 61, end: 78, value: './nested/nested', raw: "'./nested/nested'" } } } ], kind: 'const' }, specifiers: [], source: null }, { type: 'ExportNamedDeclaration', start: 81, end: 116, declaration: { type: 'VariableDeclaration', start: 88, end: 116, declarations: [ { type: 'VariableDeclarator', start: 94, end: 115, id: { type: 'Identifier', start: 94, end: 98, name: 'path' }, init: { type: 'ImportExpression', start: 101, end: 115, source: { type: 'Literal', start: 108, end: 114, value: 'path', raw: "'path'" } } } ], kind: 'const' }, specifiers: [], source: null }, { type: 'ExportNamedDeclaration', start: 117, end: 158, declaration: { type: 'VariableDeclaration', start: 124, end: 158, declarations: [ { type: 'VariableDeclarator', start: 130, end: 157, id: { type: 'Identifier', start: 130, end: 139, name: 'pathAgain' }, init: { type: 'ImportExpression', start: 142, end: 157, source: { type: 'Identifier', start: 149, end: 156, name: 'thePath' } } } ], kind: 'const' }, specifiers: [], source: null } ], sourceType: 'module' }, code: "export { foo } from './foo.js';\nexport const nested = import('./nested/nested');\nexport const path = import('path');\nexport const pathAgain = import(thePath);\n", dynamicallyImportedIdResolutions: [ { assertions: {}, external: false, id: ID_NESTED, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }, { assertions: {}, external: true, id: ID_PATH, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], dynamicallyImportedIds: [ID_NESTED, ID_PATH], dynamicImporters: [], exportedBindings: { '.': ['nested', 'path', 'pathAgain'], './foo.js': ['foo'] }, exports: ['nested', 'path', 'pathAgain', 'foo'], hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: ID_FOO, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_FOO], importers: [], isEntry: true, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }, [ID_NESTED]: { id: ID_NESTED, assertions: {}, ast: { type: 'Program', start: 0, end: 72, body: [ { type: 'ImportDeclaration', start: 0, end: 32, specifiers: [ { type: 'ImportSpecifier', start: 9, end: 12, imported: { type: 'Identifier', start: 9, end: 12, name: 'foo' }, local: { type: 'Identifier', start: 9, end: 12, name: 'foo' } } ], source: { type: 'Literal', start: 20, end: 31, value: '../foo.js', raw: "'../foo.js'" } }, { type: 'ExportNamedDeclaration', start: 34, end: 71, declaration: { type: 'VariableDeclaration', start: 41, end: 71, declarations: [ { type: 'VariableDeclarator', start: 47, end: 70, id: { type: 'Identifier', start: 47, end: 53, name: 'nested' }, init: { type: 'BinaryExpression', start: 56, end: 70, left: { type: 'Literal', start: 56, end: 64, value: 'nested', raw: "'nested'" }, operator: '+', right: { type: 'Identifier', start: 67, end: 70, name: 'foo' } } } ], kind: 'const' }, specifiers: [], source: null } ], sourceType: 'module' }, code: "import { foo } from '../foo.js';\n\nexport const nested = 'nested' + foo;\n", dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [ID_MAIN], exports: ['nested'], exportedBindings: { '.': ['nested'] }, hasDefaultExport: false, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [ { assertions: {}, external: false, id: ID_FOO, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ], importedIds: [ID_FOO], importers: [], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }, [ID_PATH]: { id: ID_PATH, assertions: {}, ast: null, code: null, dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], dynamicImporters: [ID_MAIN], exportedBindings: null, exports: null, hasDefaultExport: null, moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [ID_FOO], isEntry: false, isExternal: true, isIncluded: null, meta: {}, syntheticNamedExports: false } } ); } } }, context: { thePath: 'path' }, bundle() { assert.ok(rendered); } }); rollup-3.29.4/test/function/samples/plugin-module-information/foo.js000066400000000000000000000001021450520414700256160ustar00rootroot00000000000000import path from 'path'; export const foo = path.resolve('foo'); rollup-3.29.4/test/function/samples/plugin-module-information/main.js000066400000000000000000000002371450520414700257700ustar00rootroot00000000000000export { foo } from './foo.js'; export const nested = import('./nested/nested'); export const path = import('path'); export const pathAgain = import(thePath); rollup-3.29.4/test/function/samples/plugin-module-information/nested/000077500000000000000000000000001450520414700257665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-module-information/nested/nested.js000066400000000000000000000001101450520414700275760ustar00rootroot00000000000000import { foo } from '../foo.js'; export const nested = 'nested' + foo; rollup-3.29.4/test/function/samples/plugin-parse-ast-receives-comments/000077500000000000000000000000001450520414700262215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-parse-ast-receives-comments/_config.js000066400000000000000000000006511450520414700301650ustar00rootroot00000000000000const assert = require('node:assert'); const comments = []; module.exports = defineTest({ description: 'plugin parse ast receives comments', options: { plugins: [ { transform(code) { const ast = this.parse(code, { onComment(...parameters) { comments.push(parameters); } }); return { ast, code, map: null }; } } ] }, after() { assert.ok(comments.length > 0); } }); rollup-3.29.4/test/function/samples/plugin-parse-ast-receives-comments/main.js000066400000000000000000000001151450520414700275000ustar00rootroot00000000000000/* this is a comment */ export function main() { // this is also a comment }rollup-3.29.4/test/function/samples/plugin-parse-ast-remove-sourcemapping/000077500000000000000000000000001450520414700267405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-parse-ast-remove-sourcemapping/_config.js000066400000000000000000000006041450520414700307020ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'remove source mapping comment even if code is parsed by PluginContext.parse method', options: { plugins: [ { transform(code) { const ast = this.parse(code); return { ast, code, map: null }; } } ] }, code(code) { assert.ok(code.search(/sourceMappingURL/) === -1); } }); rollup-3.29.4/test/function/samples/plugin-parse-ast-remove-sourcemapping/main.js000066400000000000000000000003051450520414700302200ustar00rootroot00000000000000export function main() { } //# sourceMappingURL=http://example.com/path/to/your/sourcemap.map export function foo() { } /*# sourceMappingURL=http://example.com/path/to/your/sourcemap.map */ rollup-3.29.4/test/function/samples/plugin-parse/000077500000000000000000000000001450520414700220065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-parse/_config.js000066400000000000000000000012401450520414700237450ustar00rootroot00000000000000const MagicString = require('magic-string'); module.exports = defineTest({ description: 'plugin transform hooks can use `this.parse(code, options)`', options: { plugins: [ { name: 'test', transform(code) { const magicString = new MagicString(code); enforceTheAnswer(this.parse(code), magicString); return magicString.toString(); } } ] } }); function enforceTheAnswer(ast, magicString) { for (const node of ast.body) { if (node.type === 'VariableDeclaration') { for (const decl of node.declarations) { if (decl.id.name === 'answer') { magicString.overwrite(decl.init.start, decl.init.end, '42'); } } } } } rollup-3.29.4/test/function/samples/plugin-parse/main.js000066400000000000000000000001231450520414700232640ustar00rootroot00000000000000const foo = 1; const answer = 41; assert.equal(foo, 1); assert.equal(answer, 42); rollup-3.29.4/test/function/samples/plugin-warn-loc-instead-pos/000077500000000000000000000000001450520414700246425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-warn-loc-instead-pos/_config.js000066400000000000000000000012251450520414700266040ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: '`this.warn(...)` accepts { line, column } object as second parameter (#1265)', options: { plugins: [ { name: 'test', transform() { this.warn('foo', { line: 1, column: 22 }); return 'assert.equal( 21 * 2, 42 );'; } } ] }, warnings: [ { code: 'PLUGIN_WARNING', id: path.join(__dirname, 'main.js'), plugin: 'test', hook: 'transform', message: 'foo', loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 22 }, frame: ` 1: assert.equal( 21 * 2, TK ); ^ ` } ] }); rollup-3.29.4/test/function/samples/plugin-warn-loc-instead-pos/main.js000066400000000000000000000000341450520414700261210ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-3.29.4/test/function/samples/plugin-warn/000077500000000000000000000000001450520414700216435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugin-warn/_config.js000066400000000000000000000015171450520414700236110ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'plugin transform hooks can use `this.warn({...}, char)` (#1140)', options: { plugins: [ { name: 'test', transform() { this.warn({ message: 'foo', code: 'CODE' }); this.warn('bar', 22); return 'assert.equal( 21 * 2, 42 );'; } } ] }, warnings: [ { code: 'PLUGIN_WARNING', id: path.join(__dirname, 'main.js'), hook: 'transform', plugin: 'test', message: 'foo', pluginCode: 'CODE' }, { code: 'PLUGIN_WARNING', id: path.join(__dirname, 'main.js'), plugin: 'test', hook: 'transform', message: 'bar', pos: 22, loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 22 }, frame: ` 1: assert.equal( 21 * 2, TK ); ^ ` } ] }); rollup-3.29.4/test/function/samples/plugin-warn/main.js000066400000000000000000000000341450520414700231220ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-3.29.4/test/function/samples/plugins-can-manipulate-options/000077500000000000000000000000001450520414700254465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/plugins-can-manipulate-options/_config.js000066400000000000000000000005321450520414700274100ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'plugins can manipulate the options object', options: { plugins: [ { options(options) { options.input = path.join(__dirname, 'answer.js'); } } ] }, exports(answer) { assert.equal(answer, 42); } }); rollup-3.29.4/test/function/samples/plugins-can-manipulate-options/answer.js000066400000000000000000000000231450520414700272760ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/preload-after-build/000077500000000000000000000000001450520414700232225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preload-after-build/_config.js000066400000000000000000000007641450520414700251730ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'supports this.load() in buildEnd and renderStart', options: { plugins: [ { name: 'test', buildEnd() { this.load({ id: path.join(__dirname, 'other2.js') }); }, moduleParsed({ id }) { if (id.endsWith('main.js')) { this.load({ id: path.join(__dirname, 'other1.js') }); } }, renderStart() { this.load({ id: path.join(__dirname, 'other3.js') }); } } ] } }); rollup-3.29.4/test/function/samples/preload-after-build/main.js000066400000000000000000000000211450520414700244750ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/preload-after-build/other1.js000066400000000000000000000000211450520414700247530ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/preload-after-build/other2.js000066400000000000000000000000211450520414700247540ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/preload-after-build/other3.js000066400000000000000000000000211450520414700247550ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/preload-cyclic-module/000077500000000000000000000000001450520414700235555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preload-cyclic-module/_config.js000066400000000000000000000021731450520414700255220ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_PROXY = path.join(__dirname, 'main.js?proxy'); module.exports = defineTest({ description: 'handles pre-loading a cyclic module in the resolveId hook', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_PROXY, ID_MAIN], message: 'Circular dependency: main.js -> main.js?proxy -> main.js' } ], options: { plugins: [ { async resolveId(source, importer, options) { if (!importer || importer.endsWith('?proxy')) { return null; } const resolution = await this.resolve(source, importer, { skipSelf: true, ...options }); if (resolution && !resolution.external) { const moduleInfo = await this.load(resolution); if (moduleInfo.code.includes('/* use proxy */')) { return `${resolution.id}?proxy`; } } return resolution; }, load(id) { if (id.endsWith('?proxy')) { const importee = id.slice(0, -'?proxy'.length); return `export * from ${JSON.stringify(importee)}; export const extra = 'extra';`; } return null; } } ] } }); rollup-3.29.4/test/function/samples/preload-cyclic-module/main.js000066400000000000000000000002501450520414700250340ustar00rootroot00000000000000/* main *//* use proxy */ import { foo as bar, extra } from './main.js'; export const foo = 'foo'; assert.strictEqual(bar, 'foo'); assert.strictEqual(extra, 'extra'); rollup-3.29.4/test/function/samples/preload-loading-module/000077500000000000000000000000001450520414700237245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preload-loading-module/_config.js000066400000000000000000000006301450520414700256650ustar00rootroot00000000000000const assert = require('node:assert'); let preloadedCode; module.exports = defineTest({ description: 'waits for pre-loaded modules that are currently loading', options: { plugins: [ { name: 'test-plugin', load(id) { this.load({ id }).then(({ code }) => (preloadedCode = code)); }, buildEnd() { assert.strictEqual(preloadedCode, 'assert.ok(true);\n'); } } ] } }); rollup-3.29.4/test/function/samples/preload-loading-module/main.js000066400000000000000000000000211450520414700251770ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/preload-module/000077500000000000000000000000001450520414700223115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preload-module/_config.js000066400000000000000000000065131450520414700242600ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEP = path.join(__dirname, 'dep.js'); const ID_OTHER = path.join(__dirname, 'other.js'); const loadedModules = []; const transformedModules = []; const parsedModules = []; module.exports = defineTest({ description: 'allows pre-loading modules via this.load', options: { plugins: [ { name: 'test-plugin', load(id) { loadedModules.push(id); }, async transform(code, id) { transformedModules.push(id); }, moduleParsed({ id }) { parsedModules.push(id); }, async resolveId(source, importer, options) { if (source.endsWith('main.js')) { const resolvedId = await this.resolve(source, importer, { skipSelf: true, ...options }); const { ast, ...moduleInfo } = await this.load({ ...resolvedId, meta: { testPlugin: 'first' } }); assert.deepStrictEqual(moduleInfo, { id: ID_MAIN, assertions: {}, code: "import './dep';\nassert.ok(true);\n", dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [], isEntry: false, isExternal: false, isIncluded: null, meta: { testPlugin: 'first' }, syntheticNamedExports: false }); assert.strictEqual(loadedModules.filter(id => id === ID_MAIN).length, 1); assert.strictEqual(transformedModules.filter(id => id === ID_MAIN).length, 1); assert.strictEqual(parsedModules.filter(id => id === ID_MAIN).length, 0); // No dependencies have been loaded yet assert.deepStrictEqual([...this.getModuleIds()], [ID_MAIN]); await this.load({ id: ID_OTHER }); assert.deepStrictEqual([...this.getModuleIds()].sort(), [ID_MAIN, ID_OTHER]); return resolvedId; } }, async buildEnd(error) { if (error) { return; } const { ast, ...moduleInfo } = await this.load({ id: ID_DEP, // This should be ignored as the module was already loaded meta: { testPlugin: 'second' } }); assert.deepStrictEqual(moduleInfo, { id: ID_DEP, assertions: {}, code: 'assert.ok(true);\n', dynamicImporters: [], exportedBindings: { '.': [] }, exports: [], hasDefaultExport: false, dynamicallyImportedIdResolutions: [], dynamicallyImportedIds: [], moduleSideEffects: true, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIdResolutions: [], importedIds: [], importers: [ID_MAIN], isEntry: false, isExternal: false, isIncluded: true, meta: {}, syntheticNamedExports: false }); assert.strictEqual(loadedModules.filter(id => id === ID_DEP).length, 1); assert.strictEqual(transformedModules.filter(id => id === ID_DEP).length, 1); assert.strictEqual(parsedModules.filter(id => id === ID_DEP).length, 1); assert.deepStrictEqual([...this.getModuleIds()].sort(), [ID_DEP, ID_MAIN, ID_OTHER]); } } ] } }); rollup-3.29.4/test/function/samples/preload-module/dep.js000066400000000000000000000000211450520414700234100ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/preload-module/main.js000066400000000000000000000000411450520414700235660ustar00rootroot00000000000000import './dep'; assert.ok(true); rollup-3.29.4/test/function/samples/preload-module/other-dep.js000066400000000000000000000000531450520414700245340ustar00rootroot00000000000000throw new Error('Should not be executed'); rollup-3.29.4/test/function/samples/preload-module/other.js000066400000000000000000000001011450520414700237600ustar00rootroot00000000000000import './other-dep'; throw new Error('Should not be executed'); rollup-3.29.4/test/function/samples/preserve-for-of-iterable/000077500000000000000000000000001450520414700242065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-for-of-iterable/_config.js000066400000000000000000000001131450520414700261430ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves for...of loops' }); rollup-3.29.4/test/function/samples/preserve-for-of-iterable/iterables.js000066400000000000000000000007121450520414700265160ustar00rootroot00000000000000export let dirty; export const zeroToFive = { [Symbol.iterator]() { return { current: 0, last: 5, next() { const ret = this.current < this.last ? { done: false, value: this.current++ } : { done: true }; // assert later dirty = this.current; return ret; } }; } }; rollup-3.29.4/test/function/samples/preserve-for-of-iterable/loops.js000066400000000000000000000006531450520414700257040ustar00rootroot00000000000000export const awaitable = async (iterable) => { for await (const value of iterable) { } } // This is equivalent to the above 'awaitable' function. export const equivalent = async (iterable) => { const iterator = iterable[Symbol.asyncIterator]() let { done } = await iterator.next() while (!done) { ({ done } = await iterator.next()) } } export const iterate = iterable => { for (const value of iterable) { } } rollup-3.29.4/test/function/samples/preserve-for-of-iterable/main.js000066400000000000000000000002421450520414700254660ustar00rootroot00000000000000import { zeroToFive, dirty } from './iterables'; import { iterate } from './loops'; assert.equal(dirty, undefined); iterate(zeroToFive); assert.equal(dirty, 5); rollup-3.29.4/test/function/samples/preserve-modules-circular-order/000077500000000000000000000000001450520414700256145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules-circular-order/_config.js000066400000000000000000000020361450520414700275570ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_INDEX = path.join(__dirname, 'index.js'); const ID_DATA = path.join(__dirname, 'data.js'); const ID_TAG = path.join(__dirname, 'tag.js'); const executionOrder = []; module.exports = defineTest({ description: 'preserves execution order for circular dependencies when preserving modules', options: { output: { preserveModules: true } }, context: { executionOrder }, exports() { assert.deepStrictEqual(executionOrder, [ 'index', 'tag', 'data', 'main: Tag: Tag data Tag data' ]); }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_DATA, ID_TAG, ID_DATA], message: 'Circular dependency: data.js -> tag.js -> data.js' }, { code: 'CIRCULAR_DEPENDENCY', ids: [ID_DATA, ID_TAG, ID_INDEX, ID_DATA], message: 'Circular dependency: data.js -> tag.js -> index.js -> data.js' }, { code: 'CIRCULAR_DEPENDENCY', ids: [ID_TAG, ID_INDEX, ID_TAG], message: 'Circular dependency: tag.js -> index.js -> tag.js' } ] }); rollup-3.29.4/test/function/samples/preserve-modules-circular-order/data.js000066400000000000000000000002411450520414700270600ustar00rootroot00000000000000import { Tag } from './tag.js'; import './index.js'; executionOrder.push('data'); export const data = () => 'data'; export const Data = () => `Tag: ${Tag()}`; rollup-3.29.4/test/function/samples/preserve-modules-circular-order/index.js000066400000000000000000000002041450520414700272550ustar00rootroot00000000000000import { Data, data } from './data.js'; import { Tag } from './tag.js'; executionOrder.push('index'); export { Data, data, Tag }; rollup-3.29.4/test/function/samples/preserve-modules-circular-order/main.js000066400000000000000000000002111450520414700270700ustar00rootroot00000000000000import { Data } from './data.js'; import { Tag } from './tag.js'; import './index.js'; executionOrder.push(`main: ${Data()} ${Tag()}`); rollup-3.29.4/test/function/samples/preserve-modules-circular-order/tag.js000066400000000000000000000002101450520414700267160ustar00rootroot00000000000000import * as D from './data.js'; import './index.js'; executionOrder.push('tag'); export function Tag() { return `Tag ${D.data()}`; } rollup-3.29.4/test/function/samples/preserve-modules-default-mode-namespace/000077500000000000000000000000001450520414700271775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules-default-mode-namespace/_config.js000066400000000000000000000005441450520414700311440ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'import namespace from chunks with default export mode when preserving modules', options: { input: ['main', 'lib'], output: { preserveModules: true } }, exports(exports) { assert.deepStrictEqual(exports, { lib: { __proto__: null, default: 'foo' } }); } }); rollup-3.29.4/test/function/samples/preserve-modules-default-mode-namespace/lib.js000066400000000000000000000000261450520414700303010ustar00rootroot00000000000000export default 'foo'; rollup-3.29.4/test/function/samples/preserve-modules-default-mode-namespace/main.js000066400000000000000000000000611450520414700304560ustar00rootroot00000000000000import * as lib from './lib.js'; export { lib }; rollup-3.29.4/test/function/samples/preserve-modules/000077500000000000000000000000001450520414700227015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/inline-dynamic-imports/000077500000000000000000000000001450520414700272745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/inline-dynamic-imports/_config.js000066400000000000000000000007501450520414700312400ustar00rootroot00000000000000module.exports = defineTest({ description: 'Inlining dynamic imports is not supported when preserving modules', options: { input: ['main.js'], output: { preserveModules: true, inlineDynamicImports: true } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.inlineDynamicImports" - this option is not supported for "output.preserveModules".', url: 'https://rollupjs.org/configuration-options/#output-inlinedynamicimports' } }); rollup-3.29.4/test/function/samples/preserve-modules/inline-dynamic-imports/lib.js000066400000000000000000000000311450520414700303720ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/preserve-modules/inline-dynamic-imports/main.js000066400000000000000000000000741450520414700305570ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-3.29.4/test/function/samples/preserve-modules/invalid-default-export-mode/000077500000000000000000000000001450520414700302125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/invalid-default-export-mode/_config.js000066400000000000000000000007101450520414700321520ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when using default export mode with named exports', options: { input: ['main.js'], output: { exports: 'default', preserveModules: true } }, generateError: { code: 'INVALID_EXPORT_OPTION', message: '"default" was specified for "output.exports", but entry module "lib.js" has the following exports: "value"', url: 'https://rollupjs.org/configuration-options/#output-exports' } }); rollup-3.29.4/test/function/samples/preserve-modules/invalid-default-export-mode/lib.js000066400000000000000000000000311450520414700313100ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/preserve-modules/invalid-default-export-mode/main.js000066400000000000000000000001161450520414700314720ustar00rootroot00000000000000import { value } from './lib.js'; assert.equal(value, 42); export default 43; rollup-3.29.4/test/function/samples/preserve-modules/invalid-no-preserve-entry-signatures/000077500000000000000000000000001450520414700321135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/invalid-no-preserve-entry-signatures/_config.js000066400000000000000000000007421450520414700340600ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when setting preserveEntrySignatures to false', options: { input: ['main.js'], preserveEntrySignatures: false, output: { preserveModules: true } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "preserveEntrySignatures" - setting this option to false is not supported for "output.preserveModules".', url: 'https://rollupjs.org/configuration-options/#preserveentrysignatures' } }); rollup-3.29.4/test/function/samples/preserve-modules/invalid-no-preserve-entry-signatures/main.js000066400000000000000000000000311450520414700333670ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/preserve-modules/invalid-none-export-mode/000077500000000000000000000000001450520414700275255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/invalid-none-export-mode/_config.js000066400000000000000000000006771450520414700315010ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws when using none export mode with named exports', options: { input: ['main.js'], output: { exports: 'none', preserveModules: true } }, generateError: { code: 'INVALID_EXPORT_OPTION', message: '"none" was specified for "output.exports", but entry module "lib.js" has the following exports: "value"', url: 'https://rollupjs.org/configuration-options/#output-exports' } }); rollup-3.29.4/test/function/samples/preserve-modules/invalid-none-export-mode/lib.js000066400000000000000000000000311450520414700306230ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/preserve-modules/invalid-none-export-mode/main.js000066400000000000000000000000741450520414700310100ustar00rootroot00000000000000import { value } from './lib.js'; assert.equal(value, 42); rollup-3.29.4/test/function/samples/preserve-modules/manual-chunks/000077500000000000000000000000001450520414700254475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/manual-chunks/_config.js000066400000000000000000000007321450520414700274130ustar00rootroot00000000000000module.exports = defineTest({ description: 'Assigning manual chunks fails when preserving modules', options: { input: ['main.js'], output: { manualChunks: { lib: ['lib.js'] }, preserveModules: true } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.manualChunks" - this option is not supported for "output.preserveModules".', url: 'https://rollupjs.org/configuration-options/#output-manualchunks' } }); rollup-3.29.4/test/function/samples/preserve-modules/manual-chunks/lib.js000066400000000000000000000000311450520414700265450ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/function/samples/preserve-modules/manual-chunks/main.js000066400000000000000000000000711450520414700267270ustar00rootroot00000000000000import { value } from './lib'; assert.equal(value, 42); rollup-3.29.4/test/function/samples/preserve-modules/mixed-exports/000077500000000000000000000000001450520414700255115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/mixed-exports/_config.js000066400000000000000000000021141450520414700274510ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_LIB1 = path.join(__dirname, 'lib1.js'); module.exports = defineTest({ description: 'warns for mixed exports in all chunks when preserving modules', options: { input: ['main.js'], output: { preserveModules: true } }, warnings: [ { code: 'MIXED_EXPORTS', id: ID_MAIN, message: 'Entry module "main.js" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.', url: 'https://rollupjs.org/configuration-options/#output-exports' }, { code: 'MIXED_EXPORTS', id: ID_LIB1, message: 'Entry module "lib1.js" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.', url: 'https://rollupjs.org/configuration-options/#output-exports' } ] }); rollup-3.29.4/test/function/samples/preserve-modules/mixed-exports/lib1.js000066400000000000000000000000551450520414700266760ustar00rootroot00000000000000export const value1 = 42; export default 42; rollup-3.29.4/test/function/samples/preserve-modules/mixed-exports/lib2.js000066400000000000000000000000231450520414700266720ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/preserve-modules/mixed-exports/lib3.js000066400000000000000000000000321450520414700266730ustar00rootroot00000000000000export const value3 = 42; rollup-3.29.4/test/function/samples/preserve-modules/mixed-exports/main.js000066400000000000000000000003651450520414700267770ustar00rootroot00000000000000import lib1, { value1 } from './lib1'; import lib2 from './lib2'; import { value3 } from './lib3'; assert.equal(lib1, 42); assert.equal(value1, 42); assert.equal(lib2, 42); assert.equal(value3, 42); export const value = 42; export default 42; rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules-conflict/000077500000000000000000000000001450520414700276345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules-conflict/_config.js000066400000000000000000000014611450520414700316000ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Generates actual files for virtual modules when preserving modules', options: { plugins: [ { resolveId(id) { if (id === '\0virtualModule.js') return id; }, load(id) { if (id !== '\0virtualModule.js') return null; return 'export const virtual = "Virtual!";\n'; }, transform(code, id) { if (id === '\0virtualModule.js') return null; return 'import {virtual} from "\0virtualModule.js";\n' + code; } } ] }, bundle(bundle) { return bundle.generate({ format: 'es', preserveModules: true }).then(generated => assert.deepEqual( generated.output.map(chunk => chunk.fileName), ['main.js', '_virtual/_virtualModule.js', '_virtual/_virtualModule2.js'] ) ); } }); rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules-conflict/_virtual/000077500000000000000000000000001450520414700314615ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000001101450520414700347230ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules-conflict/_virtualexport const notSoVirtual = 'real'; assert.equal(virtual, 'Virtual!'); rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules-conflict/main.js000066400000000000000000000002021450520414700311100ustar00rootroot00000000000000import { notSoVirtual } from './_virtual/_virtualModule'; assert.equal(virtual, 'Virtual!'); assert.equal(notSoVirtual, 'real'); rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules/000077500000000000000000000000001450520414700260355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules/_config.js000066400000000000000000000014241450520414700300000ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Generates actual files for virtual modules when preserving modules', options: { plugins: [ { resolveId(id) { if (id === '\0virtualModule') return id; }, load(id) { if (id !== '\0virtualModule') return null; return 'export const virtual = "Virtual!";\n'; }, transform(code, id) { if (id === '\0virtualModule') return null; return 'import {virtual} from "\0virtualModule";\n' + code; } } ] }, bundle(bundle) { return bundle.generate({ format: 'es', preserveModules: true }).then(generated => assert.deepEqual( generated.output.map(chunk => chunk.fileName), ['main.js', '_virtual/_virtualModule.js', 'lib/lib.js'] ) ); } }); rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules/lib/000077500000000000000000000000001450520414700266035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules/lib/lib.js000066400000000000000000000000431450520414700277040ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); rollup-3.29.4/test/function/samples/preserve-modules/virtual-modules/main.js000066400000000000000000000000731450520414700273170ustar00rootroot00000000000000import './lib/lib.js'; assert.equal(virtual, 'Virtual!'); rollup-3.29.4/test/function/samples/preserve-symlink/000077500000000000000000000000001450520414700227175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-symlink/_config.js000066400000000000000000000002211450520414700246540ustar00rootroot00000000000000module.exports = defineTest({ skip: process.platform === 'win32', description: 'follows symlinks', options: { preserveSymlinks: true } }); rollup-3.29.4/test/function/samples/preserve-symlink/bar.js000066400000000000000000000000561450520414700240220ustar00rootroot00000000000000export default function () { return 'BAR'; } rollup-3.29.4/test/function/samples/preserve-symlink/foo.js000077700000000000000000000000001450520414700271532symlinked/foo.jsustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-symlink/main.js000066400000000000000000000000701450520414700241760ustar00rootroot00000000000000import foo from './foo.js'; assert.equal( foo, 'BAR' ); rollup-3.29.4/test/function/samples/preserve-symlink/symlinked/000077500000000000000000000000001450520414700247165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserve-symlink/symlinked/foo.js000066400000000000000000000000621450520414700260350ustar00rootroot00000000000000import bar from './bar.js'; export default bar(); rollup-3.29.4/test/function/samples/preserves-catch-argument/000077500000000000000000000000001450520414700243165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserves-catch-argument/_config.js000066400000000000000000000002101450520414700262510ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not replace argument to catch block (#1462)', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/preserves-catch-argument/main.js000066400000000000000000000003241450520414700255770ustar00rootroot00000000000000import { dirname as i } from 'path'; function foo (path) { const dir = i(path); try { throw new Error('something went wrong'); } catch (i) { assert.equal(i.message, 'something went wrong'); } } foo('');rollup-3.29.4/test/function/samples/preserves-default-exports-used-locally/000077500000000000000000000000001450520414700271355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserves-default-exports-used-locally/_config.js000066400000000000000000000001561450520414700311010ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves default exports that are only used locally (#984)' }); rollup-3.29.4/test/function/samples/preserves-default-exports-used-locally/foo.js000066400000000000000000000000741450520414700302570ustar00rootroot00000000000000export default function foo () { global.foo = 1; } foo(); rollup-3.29.4/test/function/samples/preserves-default-exports-used-locally/main.js000066400000000000000000000000571450520414700304210ustar00rootroot00000000000000import './foo'; assert.equal( global.foo, 1 ); rollup-3.29.4/test/function/samples/preserves-function-expression-names/000077500000000000000000000000001450520414700265375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserves-function-expression-names/_config.js000066400000000000000000000004541450520414700305040ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not rewrite function expression names incorrectly (#1083)', options: { external: ['path'] }, exports(exports) { assert.ok(!/path/.test(exports.x.name)); assert.equal(exports.y, 'somefile.txt'); } }); rollup-3.29.4/test/function/samples/preserves-function-expression-names/main.js000066400000000000000000000002011450520414700300120ustar00rootroot00000000000000import { basename } from 'path'; var x = function basename () {}; var y = basename( 'path/to/somefile.txt' ); export { x, y }; rollup-3.29.4/test/function/samples/preserves-var-declarations-in-dead-branches/000077500000000000000000000000001450520414700277345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/preserves-var-declarations-in-dead-branches/_config.js000066400000000000000000000001451450520414700316760ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves var declarations in dead branches (#977)' }); rollup-3.29.4/test/function/samples/preserves-var-declarations-in-dead-branches/main.js000066400000000000000000000000741450520414700312170ustar00rootroot00000000000000if ( false ) { var foo; } assert.equal( foo, undefined ); rollup-3.29.4/test/function/samples/prevent-asi-with-line-comments/000077500000000000000000000000001450520414700253565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/prevent-asi-with-line-comments/_config.js000066400000000000000000000003451450520414700273220ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'prevent semicolon insertion for return statements when there are line comments', exports(exports) { assert.strictEqual(exports(), 1); } }); rollup-3.29.4/test/function/samples/prevent-asi-with-line-comments/main.js000066400000000000000000000000771450520414700266440ustar00rootroot00000000000000export default function () { return true && // comment 1; } rollup-3.29.4/test/function/samples/prevent-context-resolve-loop/000077500000000000000000000000001450520414700251715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/prevent-context-resolve-loop/_config.js000066400000000000000000000033701450520414700271360ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_OTHER_1 = path.join(__dirname, 'other1.js'); const ID_OTHER_2 = path.join(__dirname, 'other2.js'); const ID_OTHER_3 = path.join(__dirname, 'other3.js'); const ID_OTHER_4 = path.join(__dirname, 'other4.js'); const thirdPluginCalls = new Set(); module.exports = defineTest({ description: 'prevents infinite loops when several plugins are calling this.resolve in resolveId', options: { plugins: [ { name: 'first', async resolveId(source, importer) { const { id } = await this.resolve(source, importer, { skipSelf: true }); if (id === ID_OTHER_1) { return ID_OTHER_4; } } }, { name: 'second', async resolveId(source, importer) { const { id } = await this.resolve(source, importer, { skipSelf: true }); if (id === ID_OTHER_2) { // To make this more interesting // The first plugin should resolve everything to 4 assert.strictEqual( (await this.resolve('./other1', importer, { skipSelf: true })).id, ID_OTHER_4 ); // The second file should however be resolved by core as this plugin is out of the loop assert.strictEqual( (await this.resolve(source, ID_OTHER_1, { skipSelf: true })).id, ID_OTHER_2 ); return ID_OTHER_4; } } }, { name: 'third', async resolveId(source, importer) { // Implement our own loop prevention const hash = `${source}:${importer}`; if (thirdPluginCalls.has(hash)) { return null; } thirdPluginCalls.add(hash); const { id } = await this.resolve(source, importer); thirdPluginCalls.delete(hash); if (id === ID_OTHER_3) { return ID_OTHER_4; } } } ] } }); rollup-3.29.4/test/function/samples/prevent-context-resolve-loop/dep.js000066400000000000000000000001001450520414700262660ustar00rootroot00000000000000import third from './other3.js'; assert.strictEqual(third, 4); rollup-3.29.4/test/function/samples/prevent-context-resolve-loop/main.js000066400000000000000000000002241450520414700264510ustar00rootroot00000000000000import first from './other1.js'; import second from './other2.js'; import './dep.js'; assert.strictEqual(first, 4); assert.strictEqual(second, 4); rollup-3.29.4/test/function/samples/prevent-context-resolve-loop/other1.js000066400000000000000000000000221450520414700267230ustar00rootroot00000000000000export default 1; rollup-3.29.4/test/function/samples/prevent-context-resolve-loop/other2.js000066400000000000000000000000221450520414700267240ustar00rootroot00000000000000export default 2; rollup-3.29.4/test/function/samples/prevent-context-resolve-loop/other3.js000066400000000000000000000000221450520414700267250ustar00rootroot00000000000000export default 3; rollup-3.29.4/test/function/samples/prevent-context-resolve-loop/other4.js000066400000000000000000000000221450520414700267260ustar00rootroot00000000000000export default 4; rollup-3.29.4/test/function/samples/prevent-tree-shaking-asi/000077500000000000000000000000001450520414700242145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/prevent-tree-shaking-asi/_config.js000066400000000000000000000003011450520414700261500ustar00rootroot00000000000000module.exports = defineTest({ description: 'prevent automatic semicolon insertion from changing behaviour when tree-shaking', options: { treeshake: { tryCatchDeoptimization: false } } }); rollup-3.29.4/test/function/samples/prevent-tree-shaking-asi/main.js000066400000000000000000000017251450520414700255030ustar00rootroot00000000000000function test1() { return true ? /* kept */ true ? 'expected' : 'unexpected' : 'unexpected'; } assert.strictEqual(test1(), 'expected'); function test2() { return false ? 'unexpected' : /* kept */ false ? 'unexpected' : 'expected'; } assert.strictEqual(test2(), 'expected'); function test3() { return true && /* kept */ 'expected' || false; } assert.strictEqual(test3(), 'expected'); function test4(value) { return true && value || false; } assert.strictEqual(test4('expected'), 'expected'); function test5() { return 'removed', /* kept */ 'expected'; } assert.strictEqual(test5(), 'expected'); try { throw true ? new Error('expected') : null; } catch (err) { assert.strictEqual(err.message, 'expected'); } function* test6() { yield false || 'expected' } assert.strictEqual(test6().next().value, 'expected'); function test7() { var x; return x = /* kept */ 'expected'; } assert.strictEqual(test7(), 'expected'); rollup-3.29.4/test/function/samples/property-keys-not-renamed/000077500000000000000000000000001450520414700244445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/property-keys-not-renamed/_config.js000066400000000000000000000001201450520414700263770ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not rename property keys' }); rollup-3.29.4/test/function/samples/property-keys-not-renamed/main.js000066400000000000000000000002561450520414700257310ustar00rootroot00000000000000import one from './one'; import two from './two'; import three from './three'; assert.equal( one(), 'one' ); assert.equal( two(), 'two' ); assert.equal( three(), 'three' ); rollup-3.29.4/test/function/samples/property-keys-not-renamed/one.js000066400000000000000000000001601450520414700255600ustar00rootroot00000000000000var obj = { foo: foo }; function foo () { return 'one'; } export default function () { return obj.foo(); } rollup-3.29.4/test/function/samples/property-keys-not-renamed/three.js000066400000000000000000000001621450520414700261100ustar00rootroot00000000000000var obj = { foo: foo }; function foo () { return 'three'; } export default function () { return obj.foo(); } rollup-3.29.4/test/function/samples/property-keys-not-renamed/two.js000066400000000000000000000001601450520414700256100ustar00rootroot00000000000000var obj = { foo: foo }; function foo () { return 'two'; } export default function () { return obj.foo(); } rollup-3.29.4/test/function/samples/propertyReadSideEffects-always/000077500000000000000000000000001450520414700254635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/propertyReadSideEffects-always/_config.js000066400000000000000000000002661450520414700274310ustar00rootroot00000000000000module.exports = defineTest({ description: 'verify property accesses are retained for getters with side effects', options: { treeshake: { propertyReadSideEffects: 'always' } } }); rollup-3.29.4/test/function/samples/propertyReadSideEffects-always/main.js000066400000000000000000000002661450520414700267510ustar00rootroot00000000000000let effects = 0 var obj = {} Object.defineProperty(obj, 'x', { get() { ++effects } }) let value ({x: value} = obj) obj.x obj["x"] const {x} = obj assert.strictEqual(effects, 4) rollup-3.29.4/test/function/samples/protect-cjs-globals/000077500000000000000000000000001450520414700232565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/protect-cjs-globals/_config.js000066400000000000000000000001341450520414700252160ustar00rootroot00000000000000module.exports = defineTest({ description: 'prevent conflicts with cjs module globals' }); rollup-3.29.4/test/function/samples/protect-cjs-globals/main.js000066400000000000000000000002061450520414700245360ustar00rootroot00000000000000export const exports = 1; export const require = 2; export const module = 3; export const __filename = 4; export const __dirname = 5; rollup-3.29.4/test/function/samples/proto-accessors/000077500000000000000000000000001450520414700225265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/proto-accessors/_config.js000066400000000000000000000001461450520414700244710ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles getters and setters on __proto__ properties' }); rollup-3.29.4/test/function/samples/proto-accessors/main.js000066400000000000000000000005431450520414700240120ustar00rootroot00000000000000let getter_effect = 'FAIL'; let setter_effect = 'FAIL'; let proto = { get foo() { getter_effect = 'PASS'; }, set bar(value) { setter_effect = 'PASS'; } }; let obj1 = { __proto__: proto }; let obj2 = { __proto__: proto }; let unused = obj1.foo; obj2.bar = 0; assert.strictEqual(getter_effect, 'PASS'); assert.strictEqual(setter_effect, 'PASS'); rollup-3.29.4/test/function/samples/re-export-default-import/000077500000000000000000000000001450520414700242575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/re-export-default-import/_config.js000066400000000000000000000003061450520414700262200ustar00rootroot00000000000000module.exports = defineTest({ description: 're-exports a default import' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/re-export-default-import rollup-3.29.4/test/function/samples/re-export-default-import/first.js000066400000000000000000000000601450520414700257400ustar00rootroot00000000000000export default function hi() { return 'hi'; } rollup-3.29.4/test/function/samples/re-export-default-import/main.js000066400000000000000000000000711450520414700255370ustar00rootroot00000000000000import { hi } from './second'; assert.equal(hi(), 'hi'); rollup-3.29.4/test/function/samples/re-export-default-import/second.js000066400000000000000000000000511450520414700260640ustar00rootroot00000000000000import hi from './first'; export { hi }; rollup-3.29.4/test/function/samples/re-export-namespace-import/000077500000000000000000000000001450520414700245675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/re-export-namespace-import/_config.js000066400000000000000000000003121450520414700265250ustar00rootroot00000000000000module.exports = defineTest({ description: 're-exports a namespace import' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/re-export-namespace-import rollup-3.29.4/test/function/samples/re-export-namespace-import/first.js000066400000000000000000000000441450520414700262520ustar00rootroot00000000000000export var a = 1; export var b = 2; rollup-3.29.4/test/function/samples/re-export-namespace-import/main.js000066400000000000000000000001351450520414700260500ustar00rootroot00000000000000import { mod } from './second'; assert.strictEqual(mod.a, 1); assert.strictEqual(mod.b, 2); rollup-3.29.4/test/function/samples/re-export-namespace-import/second.js000066400000000000000000000000601450520414700263740ustar00rootroot00000000000000import * as mod from './first'; export { mod }; rollup-3.29.4/test/function/samples/re-export-own/000077500000000000000000000000001450520414700221265ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/re-export-own/_config.js000066400000000000000000000011241450520414700240660ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = { description: 'avoid using export.hasOwnProperty', options: { input: './main.js', external: ['external'], output: { paths: { external: `${__dirname}/external.js` }, format: 'cjs' } }, exports(exports) { assert.strictEqual(exports.hasOwnProperty, null); assert.strictEqual(exports.name, null); assert.strictEqual( typeof Object.getOwnPropertyDescriptor(exports, 'hasOwnProperty').get, 'function' ); assert.strictEqual(typeof Object.getOwnPropertyDescriptor(exports, 'name').get, 'function'); } }; rollup-3.29.4/test/function/samples/re-export-own/external.js000066400000000000000000000000631450520414700243050ustar00rootroot00000000000000exports.hasOwnProperty = null; exports.name = null;rollup-3.29.4/test/function/samples/re-export-own/main.js000066400000000000000000000000311450520414700234020ustar00rootroot00000000000000export * from 'external';rollup-3.29.4/test/function/samples/reassign-array-literal-elements/000077500000000000000000000000001450520414700255735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-array-literal-elements/_config.js000066400000000000000000000001511450520414700275320ustar00rootroot00000000000000module.exports = defineTest({ description: 'makes sure reassignments of array elements are tracked' }); rollup-3.29.4/test/function/samples/reassign-array-literal-elements/main.js000066400000000000000000000002301450520414700270500ustar00rootroot00000000000000var foo = {x: true}; var bar = {x: true}; var baz = [foo, bar]; baz[0].x = false; baz[1].x = false; if (foo.x) assert.fail('foo was not reassigned'); rollup-3.29.4/test/function/samples/reassign-computed-prototype/000077500000000000000000000000001450520414700250745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-computed-prototype/_config.js000066400000000000000000000002201450520414700270300ustar00rootroot00000000000000module.exports = defineTest({ description: 'reassign function prototype via computed property access', context: { proto: 'prototype' } }); rollup-3.29.4/test/function/samples/reassign-computed-prototype/main.js000066400000000000000000000003121450520414700263520ustar00rootroot00000000000000function Foo() {} function Bar() {} Foo[proto].baz = function () { return 'foo'; }; Bar[proto] = Foo[proto]; Bar.prototype.baz = function () { return 'bar'; }; assert.equal( new Foo().baz(), 'bar' ); rollup-3.29.4/test/function/samples/reassign-constructor-parameter-property/000077500000000000000000000000001450520414700274365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-constructor-parameter-property/_config.js000066400000000000000000000001561450520414700314020ustar00rootroot00000000000000module.exports = defineTest({ description: 'track reassignments of properties of constructor parameters' }); rollup-3.29.4/test/function/samples/reassign-constructor-parameter-property/main.js000066400000000000000000000003111450520414700307130ustar00rootroot00000000000000const obj = { flag: false }; function Reassign(x) { x.flag = true; } new Reassign(obj); let hasBeenReassigned = false; if (obj.flag) { hasBeenReassigned = true; } assert.ok(hasBeenReassigned); rollup-3.29.4/test/function/samples/reassign-double-declarations/000077500000000000000000000000001450520414700251315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-double-declarations/_config.js000066400000000000000000000002151450520414700270710ustar00rootroot00000000000000module.exports = defineTest({ description: 'makes sure reassignments of double declared variables and their initializers are tracked' }); rollup-3.29.4/test/function/samples/reassign-double-declarations/main.js000066400000000000000000000003731450520414700264160ustar00rootroot00000000000000var bar = {x: true}; var foo = bar; reassignFooX(); var baz = {x: true}; var foo = baz; reassignFooX(); function reassignFooX() { foo.x = false; } if (bar.x) assert.fail('bar was not reassigned'); if (baz.x) assert.fail('baz was not reassigned'); rollup-3.29.4/test/function/samples/reassign-empty-objects/000077500000000000000000000000001450520414700237765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-empty-objects/_config.js000066400000000000000000000001371450520414700257410ustar00rootroot00000000000000module.exports = defineTest({ description: 'track reassignments of empty objects (#2306)' }); rollup-3.29.4/test/function/samples/reassign-empty-objects/main.js000066400000000000000000000005131450520414700252570ustar00rootroot00000000000000const map = {}; map.a = true; function checkMap(key, expected) { const result = map[key]; if (!result && expected) { throw new Error('Result was false but should have been true'); } if (result && !expected) { throw new Error('Result was true but should have been false'); } } checkMap('a', true); checkMap('b', false); rollup-3.29.4/test/function/samples/reassign-for-loop-declarations/000077500000000000000000000000001450520414700254145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-for-loop-declarations/_config.js000066400000000000000000000001211450520414700273500ustar00rootroot00000000000000module.exports = defineTest({ description: 'reassign for-loop declarations' }); rollup-3.29.4/test/function/samples/reassign-for-loop-declarations/main.js000066400000000000000000000004541450520414700267010ustar00rootroot00000000000000const list = [{}]; for (const element of list) { if (element) { element.foo = true; } } assert.ok(list[0].foo, 'List element was not reassigned'); const obj = { x: false }; for (const key in obj) { if (key) { obj[key] = true; } } assert.ok(obj.x, 'Object property was not reassigned'); rollup-3.29.4/test/function/samples/reassign-import-fails/000077500000000000000000000000001450520414700236175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-import-fails/_config.js000066400000000000000000000011521450520414700255600ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'disallows assignments to imported bindings', error: { code: 'ILLEGAL_REASSIGNMENT', id: ID_MAIN, pos: 113, loc: { column: 0, file: ID_MAIN, line: 8 }, frame: ` 6: }); 7: 8: x = 10; ^`, watchFiles: [ID_FOO, ID_MAIN], message: 'Illegal reassignment of import "x" in "main.js".' } }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/reassign-import-fails rollup-3.29.4/test/function/samples/reassign-import-fails/foo.js000066400000000000000000000000221450520414700247320ustar00rootroot00000000000000export var x = 1; rollup-3.29.4/test/function/samples/reassign-import-fails/main.js000066400000000000000000000001711450520414700251000ustar00rootroot00000000000000import { x } from './foo'; (function() { for(var x = 0; x < 1; x++){} for(var x = 0; x < 1; x++){} }); x = 10; rollup-3.29.4/test/function/samples/reassign-import-not-at-top-level-fails/000077500000000000000000000000001450520414700267245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-import-not-at-top-level-fails/_config.js000066400000000000000000000012401450520414700306630ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'disallows assignments to imported bindings not at the top level', error: { code: 'ILLEGAL_REASSIGNMENT', id: ID_MAIN, pos: 95, loc: { column: 2, file: ID_MAIN, line: 7 }, frame: ` 5: } 6: export function bar () { 7: x = 1; ^ 8: }`, watchFiles: [ID_FOO, ID_MAIN], message: 'Illegal reassignment of import "x" in "main.js".' } }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/reassign-import-fails rollup-3.29.4/test/function/samples/reassign-import-not-at-top-level-fails/foo.js000066400000000000000000000000221450520414700300370ustar00rootroot00000000000000export var x = 1; rollup-3.29.4/test/function/samples/reassign-import-not-at-top-level-fails/main.js000066400000000000000000000001501450520414700302020ustar00rootroot00000000000000import { x } from './foo'; export function foo () { var x = 1; } export function bar () { x = 1; } rollup-3.29.4/test/function/samples/reassign-namespace/000077500000000000000000000000001450520414700231455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-namespace/_config.js000066400000000000000000000002021450520414700251010ustar00rootroot00000000000000module.exports = defineTest({ description: 'members of namespaces are reassigned when the namespace is passed to a function' }); rollup-3.29.4/test/function/samples/reassign-namespace/foo.js000066400000000000000000000002201450520414700242600ustar00rootroot00000000000000const flags = {}; function test() { if (!flags.x) { throw new Error('Flag "x" not set'); } assert.ok(flags.x); } export { flags, test }; rollup-3.29.4/test/function/samples/reassign-namespace/main.js000066400000000000000000000001711450520414700244260ustar00rootroot00000000000000import * as foo from './foo.js'; function reassignFlagX(obj) { obj.flags.x = true; } reassignFlagX(foo); foo.test(); rollup-3.29.4/test/function/samples/reassign-object-literal-1/000077500000000000000000000000001450520414700242475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-object-literal-1/_config.js000066400000000000000000000001361450520414700262110ustar00rootroot00000000000000module.exports = defineTest({ description: 'track reassignments through object literals' }); rollup-3.29.4/test/function/samples/reassign-object-literal-1/main.js000066400000000000000000000003261450520414700255320ustar00rootroot00000000000000let triggered = false; const obj = { reassigned() {} }; let y = obj; reassign(); y = null; function reassign() { y.reassigned = function() { triggered = true; }; } obj.reassigned(); assert.ok(triggered); rollup-3.29.4/test/function/samples/reassign-object-literal-2/000077500000000000000000000000001450520414700242505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-object-literal-2/_config.js000066400000000000000000000001361450520414700262120ustar00rootroot00000000000000module.exports = defineTest({ description: 'track reassignments through object literals' }); rollup-3.29.4/test/function/samples/reassign-object-literal-2/main.js000066400000000000000000000003031450520414700255260ustar00rootroot00000000000000let triggered = false; const obj = { reassigned() {} }; global.wrapper = { obj }; global.wrapper.obj.reassigned = function() { triggered = true; }; obj.reassigned(); assert.ok(triggered); rollup-3.29.4/test/function/samples/reassign-parameter-property/000077500000000000000000000000001450520414700250535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-parameter-property/_config.js000066400000000000000000000001531450520414700270140ustar00rootroot00000000000000module.exports = defineTest({ description: 'track reassignments of properties of function parameters' }); rollup-3.29.4/test/function/samples/reassign-parameter-property/main.js000066400000000000000000000003051450520414700263330ustar00rootroot00000000000000const obj = { flag: false }; function reassign(x) { x.flag = true; } reassign(obj); let hasBeenReassigned = false; if (obj.flag) { hasBeenReassigned = true; } assert.ok(hasBeenReassigned); rollup-3.29.4/test/function/samples/reassign-parameter/000077500000000000000000000000001450520414700231715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-parameter/_config.js000066400000000000000000000001271450520414700251330ustar00rootroot00000000000000module.exports = defineTest({ description: 'parameters can be reassigned/updated' }); rollup-3.29.4/test/function/samples/reassign-parameter/main.js000066400000000000000000000002361450520414700244540ustar00rootroot00000000000000function numbers ( i ) { var array = new Array( i ); while ( i-- ) array[i] = i + 1; return array; } assert.deepEqual( numbers( 5 ), [ 1, 2, 3, 4, 5 ] ); rollup-3.29.4/test/function/samples/reassign-pattern-defaults/000077500000000000000000000000001450520414700244735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-pattern-defaults/_config.js000066400000000000000000000001531450520414700264340ustar00rootroot00000000000000module.exports = defineTest({ description: 'makes sure reassignments of pattern defaults are tracked' }); rollup-3.29.4/test/function/samples/reassign-pattern-defaults/main.js000066400000000000000000000001631450520414700257550ustar00rootroot00000000000000var foo = {x: true}; var {bar: bar = foo} = {}; bar.x = false; if (foo.x) assert.fail('foo was not reassigned'); rollup-3.29.4/test/function/samples/reassign-return-expression/000077500000000000000000000000001450520414700247255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-return-expression/_config.js000066400000000000000000000001541450520414700266670ustar00rootroot00000000000000module.exports = defineTest({ description: 'track reassignments of single function return expressions' }); rollup-3.29.4/test/function/samples/reassign-return-expression/main.js000066400000000000000000000002751450520414700262130ustar00rootroot00000000000000const obj = { flag: false }; const getObj = () => obj; getObj().flag = true; let hasBeenReassigned = false; if (obj.flag) { hasBeenReassigned = true; } assert.ok(hasBeenReassigned); rollup-3.29.4/test/function/samples/reassign-return-expressions/000077500000000000000000000000001450520414700251105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassign-return-expressions/_config.js000066400000000000000000000001561450520414700270540ustar00rootroot00000000000000module.exports = defineTest({ description: 'track reassignments of multiple function return expressions' }); rollup-3.29.4/test/function/samples/reassign-return-expressions/main.js000066400000000000000000000003541450520414700263740ustar00rootroot00000000000000const obj = { flag: false }; function getObj() { if (Math.random() < 0.5) return obj; return obj; } getObj().flag = true; let hasBeenReassigned = false; if (obj.flag) { hasBeenReassigned = true; } assert.ok(hasBeenReassigned); rollup-3.29.4/test/function/samples/reassigned-return-expression/000077500000000000000000000000001450520414700252365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reassigned-return-expression/_config.js000066400000000000000000000001701450520414700271760ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not bind return expressions before assignments are bound (#3382)' }); rollup-3.29.4/test/function/samples/reassigned-return-expression/main.js000066400000000000000000000003641450520414700265230ustar00rootroot00000000000000function getIcon() { var icon = undefined; icon = { code: true }; return icon; } function main() { var a = getIcon() || { code: undefined }; if (!a.code) { return 'broken'; } return 'works'; } assert.strictEqual(main(), 'works'); rollup-3.29.4/test/function/samples/recursive-parameter-assignments/000077500000000000000000000000001450520414700257165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/recursive-parameter-assignments/_config.js000066400000000000000000000001771450520414700276650ustar00rootroot00000000000000module.exports = defineTest({ description: 'Avoid maximum call stack error with recursive parameter assignments (#1710).' }); rollup-3.29.4/test/function/samples/recursive-parameter-assignments/main.js000066400000000000000000000003571450520414700272050ustar00rootroot00000000000000class Test { constructor ( name, opts ) { opts = opts || {}; if ( name && typeof name === 'object' ) { opts = name; name = opts.name; delete opts.name; } this.name = name; this.opts = opts; } } new Test( 'a', {} ); rollup-3.29.4/test/function/samples/recursive-reexports/000077500000000000000000000000001450520414700234405ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/recursive-reexports/_config.js000066400000000000000000000010051450520414700253760ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_OTHER = path.join(__dirname, 'other.js'); module.exports = defineTest({ description: 'handles recursive namespace reexports', exports(exports) { assert.deepStrictEqual(exports, { main: 'main', other: 'other' }); }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_OTHER, ID_MAIN], message: 'Circular dependency: main.js -> other.js -> main.js' } ] }); rollup-3.29.4/test/function/samples/recursive-reexports/main.js000066400000000000000000000000701450520414700247170ustar00rootroot00000000000000export * from './other.js'; export const main = 'main'; rollup-3.29.4/test/function/samples/recursive-reexports/other.js000066400000000000000000000000711450520414700251150ustar00rootroot00000000000000export * from './main.js'; export const other = 'other'; rollup-3.29.4/test/function/samples/redeclare-parameter/000077500000000000000000000000001450520414700233045ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/redeclare-parameter/_config.js000066400000000000000000000001331450520414700252430ustar00rootroot00000000000000module.exports = defineTest({ description: 'associates redeclared parameters (#2451)' }); rollup-3.29.4/test/function/samples/redeclare-parameter/main.js000066400000000000000000000007101450520414700245640ustar00rootroot00000000000000function fnDecl(a) { var a; if (!a) { throw Error("a was incorrectly assumed to be undefined in a function declaration"); } } fnDecl(true); export const fnExp = function(a) { var a; if (!a) { throw Error("a was incorrectly assumed to be undefined in a function expression"); } }; fnExp(true); export const arrowFn = a => { var a; if (!a) { throw Error("a was incorrectly assumed to be undefined in an arrow function"); } }; arrowFn(true); rollup-3.29.4/test/function/samples/reexport-from-synthetic/000077500000000000000000000000001450520414700242215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reexport-from-synthetic/_config.js000066400000000000000000000003551450520414700261660ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles reexporting a synthetic namespace from a non-synthetic module', options: { plugins: [ { transform() { return { syntheticNamedExports: '__synth' }; } } ] } }); rollup-3.29.4/test/function/samples/reexport-from-synthetic/main.js000066400000000000000000000002371450520414700255050ustar00rootroot00000000000000import { synth, explicit1, explicit2 } from './reexport.js'; assert.strictEqual(synth, 1); assert.strictEqual(explicit1, 2); assert.strictEqual(explicit2, 4); rollup-3.29.4/test/function/samples/reexport-from-synthetic/reexport.js000066400000000000000000000001021450520414700264200ustar00rootroot00000000000000export * from './synthetic1.js'; export * from './synthetic2.js'; rollup-3.29.4/test/function/samples/reexport-from-synthetic/synthetic1.js000066400000000000000000000001011450520414700266420ustar00rootroot00000000000000export const __synth = { synth: 1 }; export const explicit1 = 2; rollup-3.29.4/test/function/samples/reexport-from-synthetic/synthetic2.js000066400000000000000000000001011450520414700266430ustar00rootroot00000000000000export const __synth = { synth: 3 }; export const explicit2 = 4; rollup-3.29.4/test/function/samples/reexport-missing-error/000077500000000000000000000000001450520414700240465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reexport-missing-error/_config.js000066400000000000000000000012411450520414700260060ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_EMPTY = path.join(__dirname, 'empty.js'); module.exports = defineTest({ description: 'reexporting a missing identifier should print an error', error: { binding: 'foo', code: 'MISSING_EXPORT', exporter: ID_EMPTY, id: ID_MAIN, url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module', pos: 9, loc: { column: 9, file: ID_MAIN, line: 1 }, frame: ` 1: export { foo as bar } from './empty.js'; ^`, watchFiles: [ID_EMPTY, ID_MAIN], message: '"foo" is not exported by "empty.js", imported by "main.js".' } }); rollup-3.29.4/test/function/samples/reexport-missing-error/empty.js000066400000000000000000000000471450520414700255430ustar00rootroot00000000000000// this space left intentionally blank rollup-3.29.4/test/function/samples/reexport-missing-error/main.js000066400000000000000000000000511450520414700253240ustar00rootroot00000000000000export { foo as bar } from './empty.js'; rollup-3.29.4/test/function/samples/reexport-ns/000077500000000000000000000000001450520414700216665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reexport-ns/_config.js000066400000000000000000000006231450520414700236310ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'external namespace reexport', options: { external: ['external'], output: { generatedCode: { symbols: true } } }, exports(exports) { assert.strictEqual(typeof exports.maths, 'object'); assert.strictEqual(exports[Symbol.toStringTag], 'Module'); assert.strictEqual(exports.maths.external, true); } }); rollup-3.29.4/test/function/samples/reexport-ns/main.js000066400000000000000000000000741450520414700231510ustar00rootroot00000000000000import * as maths from './maths.js'; export default maths; rollup-3.29.4/test/function/samples/reexport-ns/maths.js000066400000000000000000000000601450520414700233340ustar00rootroot00000000000000export { default as maths } from './square.js'; rollup-3.29.4/test/function/samples/reexport-ns/square.js000066400000000000000000000000611450520414700235210ustar00rootroot00000000000000import * as m from 'external'; export default m; rollup-3.29.4/test/function/samples/reexports-from-external/000077500000000000000000000000001450520414700242145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reexports-from-external/_config.js000066400000000000000000000005711450520414700261610ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 're-exports * from external module (#791)', options: { external: ['external'] }, context: { require(id) { if (id === 'external') { return { foo: 1, bar: 2 }; } } }, exports: exports => { assert.equal(exports.foo, 1); assert.equal(exports.bar, 2); } }); rollup-3.29.4/test/function/samples/reexports-from-external/main.js000066400000000000000000000000321450520414700254710ustar00rootroot00000000000000export * from 'external'; rollup-3.29.4/test/function/samples/relative-external-include-once-nested/000077500000000000000000000000001450520414700266565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-nested/_config.js000066400000000000000000000006271450520414700306250ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'includes a relative external module only once (nested version)', options: { external: path.join(__dirname, './first/foo.js') }, context: { require(required) { assert.equal(required, './first/foo.js'); return 1; } }, exports(exports) { assert.equal(exports, 3); } }); rollup-3.29.4/test/function/samples/relative-external-include-once-nested/first/000077500000000000000000000000001450520414700300055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-nested/first/foo.js000066400000000000000000000000001450520414700311140ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-nested/first/module.js000066400000000000000000000001351450520414700316270ustar00rootroot00000000000000import foo from './foo'; import second from './second/module'; export default foo + second; rollup-3.29.4/test/function/samples/relative-external-include-once-nested/first/second/000077500000000000000000000000001450520414700312605ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-nested/first/second/module.js000066400000000000000000000000571450520414700331050ustar00rootroot00000000000000import foo from '../foo'; export default foo; rollup-3.29.4/test/function/samples/relative-external-include-once-nested/main.js000066400000000000000000000001401450520414700301330ustar00rootroot00000000000000import foo from './first/foo'; import first from './first/module'; export default foo + first; rollup-3.29.4/test/function/samples/relative-external-include-once-two-external/000077500000000000000000000000001450520414700300255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-two-external/_config.js000066400000000000000000000011121450520414700317620ustar00rootroot00000000000000const assert = require('node:assert'); const { join } = require('node:path'); module.exports = defineTest({ description: 'includes a relative external module only once (two external deps)', options: { external: [join(__dirname, './foo.js'), join(__dirname, './first/foo.js')] }, context: { require(required) { assert.ok(['./foo.js', './first/foo.js'].includes(required), 'required wrong module'); return required === './foo.js' ? 'a' : 'b'; } }, exports(exports) { assert.ok(exports === 'ab' || exports === 'ba', 'two different modules should be required'); } }); rollup-3.29.4/test/function/samples/relative-external-include-once-two-external/first/000077500000000000000000000000001450520414700311545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-two-external/first/foo.js000066400000000000000000000000001450520414700322630ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-two-external/first/module.js000066400000000000000000000000561450520414700330000ustar00rootroot00000000000000import foo from './foo'; export default foo; rollup-3.29.4/test/function/samples/relative-external-include-once-two-external/foo.js000066400000000000000000000000001450520414700311340ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-two-external/main.js000066400000000000000000000001321450520414700313030ustar00rootroot00000000000000import foo from './foo'; import first from './first/module'; export default foo + first; rollup-3.29.4/test/function/samples/relative-external-include-once-up/000077500000000000000000000000001450520414700260205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-up/_config.js000066400000000000000000000007111450520414700277610ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'includes a relative external module only once (from upper directory too)', options: { input: path.join(__dirname, 'first', 'main.js'), external: path.join(__dirname, './foo.js') }, context: { require(required) { assert.equal(required, '../foo.js'); return 1; } }, exports(exports) { assert.equal(exports, 3); } }); rollup-3.29.4/test/function/samples/relative-external-include-once-up/first/000077500000000000000000000000001450520414700271475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-up/first/main.js000066400000000000000000000001251450520414700304270ustar00rootroot00000000000000import foo from '../foo'; import first from './module'; export default foo + first; rollup-3.29.4/test/function/samples/relative-external-include-once-up/first/module.js000066400000000000000000000001361450520414700307720ustar00rootroot00000000000000import foo from '../foo'; import second from './second/module'; export default foo + second; rollup-3.29.4/test/function/samples/relative-external-include-once-up/first/second/000077500000000000000000000000001450520414700304225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once-up/first/second/module.js000066400000000000000000000000621450520414700322430ustar00rootroot00000000000000import foo from '../../foo'; export default foo; rollup-3.29.4/test/function/samples/relative-external-include-once-up/foo.js000066400000000000000000000000001450520414700271270ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once/000077500000000000000000000000001450520414700253765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once/_config.js000066400000000000000000000005721450520414700273440ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'includes a relative external module only once', options: { external: path.join(__dirname, './foo.js') }, context: { require(required) { assert.equal(required, './foo.js'); return 1; } }, exports(exports) { assert.equal(exports, 3); } }); rollup-3.29.4/test/function/samples/relative-external-include-once/first/000077500000000000000000000000001450520414700265255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once/first/module.js000066400000000000000000000001361450520414700303500ustar00rootroot00000000000000import foo from '../foo'; import second from './second/module'; export default foo + second; rollup-3.29.4/test/function/samples/relative-external-include-once/first/second/000077500000000000000000000000001450520414700300005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once/first/second/module.js000066400000000000000000000000621450520414700316210ustar00rootroot00000000000000import foo from '../../foo'; export default foo; rollup-3.29.4/test/function/samples/relative-external-include-once/foo.js000066400000000000000000000000001450520414700265050ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-external-include-once/main.js000066400000000000000000000001321450520414700266540ustar00rootroot00000000000000import foo from './foo'; import first from './first/module'; export default foo + first; rollup-3.29.4/test/function/samples/relative-outside-external/000077500000000000000000000000001450520414700245055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/relative-outside-external/_config.js000066400000000000000000000006571450520414700264570ustar00rootroot00000000000000const assert = require('node:assert'); const cwd = process.cwd; module.exports = defineTest({ description: 'correctly resolves relative external imports from outside directories', options: { external() { return true; } }, before() { process.cwd = () => '/'; }, context: { require(id) { return id; } }, exports(exports) { process.cwd = cwd; assert.strictEqual(exports.value, '../../../test.js'); } }); rollup-3.29.4/test/function/samples/relative-outside-external/main.js000066400000000000000000000000631450520414700257660ustar00rootroot00000000000000export {default as value} from '../../../test.js'; rollup-3.29.4/test/function/samples/removes-empty-exported-vars/000077500000000000000000000000001450520414700250155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/removes-empty-exported-vars/_config.js000066400000000000000000000002731450520414700267610ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'removes empty exported var declarations', exports(exports) { assert.equal(exports.foo, 42); } }); rollup-3.29.4/test/function/samples/removes-empty-exported-vars/main.js000066400000000000000000000000441450520414700262750ustar00rootroot00000000000000var foo; foo = 42; export { foo }; rollup-3.29.4/test/function/samples/rename-conditional-expression-children/000077500000000000000000000000001450520414700271335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/rename-conditional-expression-children/_config.js000066400000000000000000000001471450520414700310770ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly renders children of ConditionalExpressions' }); rollup-3.29.4/test/function/samples/rename-conditional-expression-children/foo.js000066400000000000000000000000561450520414700302550ustar00rootroot00000000000000export const bar = 42; export const baz = 43; rollup-3.29.4/test/function/samples/rename-conditional-expression-children/main.js000066400000000000000000000001201450520414700304060ustar00rootroot00000000000000import * as foo from './foo.js'; assert.equal( true ? foo.bar : foo.baz, 42 ); rollup-3.29.4/test/function/samples/rename-default-export/000077500000000000000000000000001450520414700236105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/rename-default-export/_config.js000066400000000000000000000003401450520414700255470ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'avoids SyntaxError with default token (#33)', exports(exports) { assert.equal(exports.foo, 42); assert.equal(exports.bar, 42); } }); rollup-3.29.4/test/function/samples/rename-default-export/bar.js000066400000000000000000000000621450520414700247100ustar00rootroot00000000000000import { baz } from './baz'; export default baz; rollup-3.29.4/test/function/samples/rename-default-export/baz.js000066400000000000000000000001051450520414700247160ustar00rootroot00000000000000function Baz () {} export var baz = 42; export default Baz( baz ); rollup-3.29.4/test/function/samples/rename-default-export/foo.js000066400000000000000000000000621450520414700247270ustar00rootroot00000000000000import { baz } from './baz'; export default baz; rollup-3.29.4/test/function/samples/rename-default-export/main.js000066400000000000000000000001121450520414700250640ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; export { foo, bar }; rollup-3.29.4/test/function/samples/renamed-arguments/000077500000000000000000000000001450520414700230165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/renamed-arguments/_config.js000066400000000000000000000004271450520414700247630ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'function arguments are renamed as appropriate (#32)', exports(exports) { const object = {}; assert.strictEqual(exports.foo(), 42); assert.strictEqual(exports.bar(object), object); } }); rollup-3.29.4/test/function/samples/renamed-arguments/bar.js000066400000000000000000000001031450520414700241120ustar00rootroot00000000000000function thing ( thing ) { return thing; } export default thing; rollup-3.29.4/test/function/samples/renamed-arguments/foo.js000066400000000000000000000000711450520414700241350ustar00rootroot00000000000000function thing () { return 42; } export default thing; rollup-3.29.4/test/function/samples/renamed-arguments/main.js000066400000000000000000000001121450520414700242720ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; export { foo, bar }; rollup-3.29.4/test/function/samples/render-chunk-async/000077500000000000000000000000001450520414700231005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/render-chunk-async/_config.js000066400000000000000000000005751450520414700250510ustar00rootroot00000000000000module.exports = defineTest({ description: 'bundle transformers can be asynchronous', options: { plugins: [ { renderChunk(code) { return Promise.resolve(code.replace('x', 1)); } }, { renderChunk(code) { return code.replace('1', 2); } }, { renderChunk(code) { return Promise.resolve(code.replace('2', 3)); } } ] } }); rollup-3.29.4/test/function/samples/render-chunk-async/main.js000066400000000000000000000000261450520414700243600ustar00rootroot00000000000000assert.equal( x, 3 ); rollup-3.29.4/test/function/samples/resolve-id-object/000077500000000000000000000000001450520414700227155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/resolve-id-object/_config.js000066400000000000000000000011731450520414700246610ustar00rootroot00000000000000const path = require('node:path'); module.exports = defineTest({ description: 'allows resolving an id with an object', options: { plugins: { resolveId(importee) { const fooId = path.join(__dirname, 'foo.js'); switch (importee) { case 'internal1': { return { id: fooId }; } case 'internal2': { return { id: fooId, external: false }; } case 'external': { return { id: 'my-external', external: true }; } } } } }, context: { require(id) { if (id === 'my-external') { return 'external'; } throw new Error(`Unexpected external id ${id}.`); } } }); rollup-3.29.4/test/function/samples/resolve-id-object/foo.js000066400000000000000000000000231450520414700240310ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/resolve-id-object/main.js000066400000000000000000000003321450520414700241750ustar00rootroot00000000000000import external from 'external'; import internal1 from 'internal1'; import internal2 from 'internal2'; assert.strictEqual(internal1, 42); assert.strictEqual(internal2, 42); assert.strictEqual(external, 'external'); rollup-3.29.4/test/function/samples/resolve-relative-external-id/000077500000000000000000000000001450520414700251025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/resolve-relative-external-id/_config.js000066400000000000000000000016461450520414700270530ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'resolves relative external ids', options: { external: [path.join(__dirname, 'external.js'), path.join(__dirname, 'nested', 'external.js')], plugins: { async buildStart() { assert.deepStrictEqual(await this.resolve('./external.js'), { assertions: {}, external: true, id: path.join(__dirname, 'external.js'), meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false }); assert.deepStrictEqual( await this.resolve('./external.js', path.join(__dirname, 'nested', 'some-file.js')), { assertions: {}, external: true, id: path.join(__dirname, 'nested', 'external.js'), meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } ); } } } }); rollup-3.29.4/test/function/samples/resolve-relative-external-id/main.js000066400000000000000000000000231450520414700263570ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/resolve-unordered-assignments-2/000077500000000000000000000000001450520414700255345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/resolve-unordered-assignments-2/_config.js000066400000000000000000000003331450520414700274750ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Assignments should be correctly bound independent of their order', exports(exports) { assert.equal(exports.baz, 'present'); } }); rollup-3.29.4/test/function/samples/resolve-unordered-assignments-2/main.js000066400000000000000000000003261450520414700270170ustar00rootroot00000000000000const foo1 = { value: false }; let foo2 = { value: false }; const bar = {}; assignFoo(); foo2.value = true; if (foo1.value) { bar.baz = 'present'; } function assignFoo () { foo2 = foo1; } export default bar; rollup-3.29.4/test/function/samples/resolve-unordered-assignments/000077500000000000000000000000001450520414700253755ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/resolve-unordered-assignments/_config.js000066400000000000000000000003331450520414700273360ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Assignments should be correctly bound independent of their order', exports(exports) { assert.equal(exports.baz, 'present'); } }); rollup-3.29.4/test/function/samples/resolve-unordered-assignments/main.js000066400000000000000000000003461450520414700266620ustar00rootroot00000000000000const foo1 = { noEffect: () => {} }; let foo2 = { noEffect: () => {} }; const bar = {}; assignFoo(); foo2.noEffect = () => { bar.baz = 'present'; }; foo1.noEffect(); function assignFoo () { foo2 = foo1; } export default bar; rollup-3.29.4/test/function/samples/resolveid-is-entry/000077500000000000000000000000001450520414700231445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/resolveid-is-entry/_config.js000066400000000000000000000053561450520414700251170ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'sends correct isEntry information to resolveId hooks', options: { plugins: [ { async buildStart() { return Promise.all([ this.emitFile({ type: 'chunk', id: 'chunkWithoutImporter.js' }), this.emitFile({ type: 'chunk', id: './chunkWithImporter.js', importer: ID_MAIN }), this.resolve('./resolutionWithoutImporter'), this.resolve('./resolutionWithoutImporterEntry', undefined, { isEntry: true }), this.resolve('./resolutionWithoutImporterNonEntry', undefined, { isEntry: false }), this.resolve('./resolutionWithImporter', ID_MAIN), this.resolve('./resolutionWithImporterEntry', ID_MAIN, { isEntry: true }), this.resolve('./resolutionWithImporterNonEntry', ID_MAIN, { isEntry: false }) ]); }, resolveId(source, importer, { isEntry }) { switch (source) { case ID_MAIN: { assert.strictEqual(importer, undefined, source); assert.strictEqual(isEntry, true, source); break; } case './dep.js': { assert.strictEqual(importer, ID_MAIN, source); assert.strictEqual(isEntry, false, source); break; } case 'chunkWithoutImporter.js': { assert.strictEqual(importer, undefined, source); assert.strictEqual(isEntry, true, source); break; } case './chunkWithImporter.js': { assert.strictEqual(importer, ID_MAIN, source); assert.strictEqual(isEntry, true, source); break; } case './resolutionWithoutImporter': { assert.strictEqual(importer, undefined, source); assert.strictEqual(isEntry, true, source); break; } case './resolutionWithoutImporterEntry': { assert.strictEqual(importer, undefined, source); assert.strictEqual(isEntry, true, source); break; } case './resolutionWithoutImporterNonEntry': { assert.strictEqual(importer, undefined, source); assert.strictEqual(isEntry, false, source); break; } case './resolutionWithImporter': { assert.strictEqual(importer, ID_MAIN, source); assert.strictEqual(isEntry, false, source); break; } case './resolutionWithImporterEntry': { assert.strictEqual(importer, ID_MAIN, source); assert.strictEqual(isEntry, true, source); break; } case './resolutionWithImporterNonEntry': { assert.strictEqual(importer, ID_MAIN, source); assert.strictEqual(isEntry, false, source); break; } default: { throw new Error(`Unexpected resolution of ${source}`); } } } } ] } }); rollup-3.29.4/test/function/samples/resolveid-is-entry/chunkWithImporter.js000066400000000000000000000000251450520414700271650ustar00rootroot00000000000000console.log('with'); rollup-3.29.4/test/function/samples/resolveid-is-entry/chunkWithoutImporter.js000066400000000000000000000000301450520414700277110ustar00rootroot00000000000000console.log('without'); rollup-3.29.4/test/function/samples/resolveid-is-entry/dep.js000066400000000000000000000000231450520414700242450ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/resolveid-is-entry/main.js000066400000000000000000000000761450520414700244310ustar00rootroot00000000000000import value from './dep.js'; assert.strictEqual(value, 42); rollup-3.29.4/test/function/samples/resolveid-is-entry/resolutionWithImporter.js000066400000000000000000000000251450520414700302600ustar00rootroot00000000000000console.log('with'); rollup-3.29.4/test/function/samples/resolveid-is-entry/resolutionWithImporterEntry.js000066400000000000000000000000331450520414700313010ustar00rootroot00000000000000console.log('with entry'); rollup-3.29.4/test/function/samples/resolveid-is-entry/resolutionWithImporterNonEntry.js000066400000000000000000000000371450520414700317600ustar00rootroot00000000000000console.log('with non entry'); rollup-3.29.4/test/function/samples/resolveid-is-entry/resolutionWithoutImporter.js000066400000000000000000000000301450520414700310040ustar00rootroot00000000000000console.log('without'); rollup-3.29.4/test/function/samples/resolveid-is-entry/resolutionWithoutImporterEntry.js000066400000000000000000000000361450520414700320340ustar00rootroot00000000000000console.log('without entry'); rollup-3.29.4/test/function/samples/resolveid-is-entry/resolutionWithoutImporterNonEntry.js000066400000000000000000000000421450520414700325040ustar00rootroot00000000000000console.log('without non entry'); rollup-3.29.4/test/function/samples/resolves-namespace-default/000077500000000000000000000000001450520414700246165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/resolves-namespace-default/_config.js000066400000000000000000000003051450520414700265560ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: "namespace's 'default' properties should be available", exports(exports) { assert.equal(exports, 42); } }); rollup-3.29.4/test/function/samples/resolves-namespace-default/main.js000066400000000000000000000001001450520414700260670ustar00rootroot00000000000000import * as mod from './mod.js'; export default mod.default(); rollup-3.29.4/test/function/samples/resolves-namespace-default/mod.js000066400000000000000000000000521450520414700257300ustar00rootroot00000000000000export default function () { return 42; } rollup-3.29.4/test/function/samples/respect-default-export-reexporter-side-effects/000077500000000000000000000000001450520414700305425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-default-export-reexporter-side-effects/_config.js000066400000000000000000000002771450520414700325120ustar00rootroot00000000000000module.exports = defineTest({ description: 'respect side-effects in reexporting modules even if moduleSideEffects are off', options: { treeshake: { moduleSideEffects: false } } }); rollup-3.29.4/test/function/samples/respect-default-export-reexporter-side-effects/foo.js000066400000000000000000000000271450520414700316620ustar00rootroot00000000000000export const foo = {}; rollup-3.29.4/test/function/samples/respect-default-export-reexporter-side-effects/main.js000066400000000000000000000002451450520414700320250ustar00rootroot00000000000000import { foo } from './reexporter-chain-1.js'; assert.deepStrictEqual(foo, { chain2: 'modified', chain3: 'modified', chain4: 'modified', chain5: 'modified' }); reexporter-chain-1.js000066400000000000000000000002051450520414700344330ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-default-export-reexporter-side-effectsimport { foo } from './reexporter-chain-2.js'; foo.chain1 = 'should not be modified'; export { foo } from './reexporter-chain-2.js'; reexporter-chain-2.js000066400000000000000000000001301450520414700344310ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-default-export-reexporter-side-effectsimport { foo } from './reexporter-chain-3.js'; foo.chain2 = 'modified'; export { foo }; reexporter-chain-3.js000066400000000000000000000001241450520414700344350ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-default-export-reexporter-side-effectsimport foo from './reexporter-chain-4.js'; foo.chain3 = 'modified'; export { foo }; reexporter-chain-4.js000066400000000000000000000001301450520414700344330ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-default-export-reexporter-side-effectsimport foo from './reexporter-chain-5.js'; foo.chain4 = 'modified'; export default foo; reexporter-chain-5.js000066400000000000000000000001151450520414700344370ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-default-export-reexporter-side-effectsimport { foo } from './foo.js'; foo.chain5 = 'modified'; export default foo; rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/000077500000000000000000000000001450520414700256015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/_config.js000066400000000000000000000002771450520414700275510ustar00rootroot00000000000000module.exports = defineTest({ description: 'respect side-effects in reexporting modules even if moduleSideEffects are off', options: { treeshake: { moduleSideEffects: false } } }); rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/foo.js000066400000000000000000000000271450520414700267210ustar00rootroot00000000000000export const foo = {}; rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/main.js000066400000000000000000000010571450520414700270660ustar00rootroot00000000000000import { foo as fooIndirect } from './reexporter-indirect.js'; import { foo as fooDirect } from './reexporter-direct'; import { foo as fooChained } from './reexporter-chain-1'; import { foo as fooIndirectIgnored } from './reexporter-indirect-ignored'; assert.deepStrictEqual(fooIndirect, { indirect: 'modified', chain2: 'modified', chain3: 'modified' }); assert.deepStrictEqual(fooDirect, { indirect: 'modified', chain2: 'modified', chain3: 'modified' }); assert.deepStrictEqual(fooChained, { indirect: 'modified', chain2: 'modified', chain3: 'modified' }); rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/reexporter-chain-1.js000066400000000000000000000002051450520414700315510ustar00rootroot00000000000000import { foo } from './reexporter-chain-2.js'; foo.chain1 = 'should not be modified'; export { foo } from './reexporter-chain-2.js'; rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/reexporter-chain-2.js000066400000000000000000000001301450520414700315470ustar00rootroot00000000000000import { foo } from './reexporter-chain-3.js'; foo.chain2 = 'modified'; export { foo }; rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/reexporter-chain-3.js000066400000000000000000000001111450520414700315470ustar00rootroot00000000000000import { foo } from './foo.js'; foo.chain3 = 'modified'; export { foo }; rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/reexporter-direct.js000066400000000000000000000001471450520414700316100ustar00rootroot00000000000000import { foo } from './foo.js'; foo.direct = 'should not be modified'; export { foo } from './foo.js'; rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/reexporter-indirect-ignored.js000066400000000000000000000001401450520414700335550ustar00rootroot00000000000000import { foo } from './foo.js'; foo.indirectIgnored = 'should not be modified'; export { foo }; rollup-3.29.4/test/function/samples/respect-reexporter-side-effects/reexporter-indirect.js000066400000000000000000000001131450520414700321300ustar00rootroot00000000000000import { foo } from './foo.js'; foo.indirect = 'modified'; export { foo }; rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effects/000077500000000000000000000000001450520414700311305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effects/_config.js000066400000000000000000000004511450520414700330720ustar00rootroot00000000000000module.exports = defineTest({ description: 'respect side-effects in reexporting modules even if moduleSideEffects are off', options: { treeshake: { moduleSideEffects: false }, plugins: [ { transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }); rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effects/baz.js000066400000000000000000000000511450520414700322360ustar00rootroot00000000000000export const baz = { bar: { foo: {} } }; rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effects/main.js000066400000000000000000000003741450520414700324160ustar00rootroot00000000000000import { foo } from './reexporter-chain-1.js'; assert.deepStrictEqual(foo, { chain2: 'modified', chain3: 'modified', chain4: 'modified', chain5: 'modified', chain7: 'modified', chain8: 'modified', chain10: 'modified', chain11: 'modified', }); reexporter-chain-1.js000066400000000000000000000002051450520414700350210ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { foo } from './reexporter-chain-2.js'; foo.chain1 = 'should not be modified'; export { foo } from './reexporter-chain-2.js'; reexporter-chain-10.js000066400000000000000000000001361450520414700351040ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport baz from './reexporter-chain-11.js'; baz.bar.foo.chain10 = 'modified'; export { baz }; reexporter-chain-11.js000066400000000000000000000001261450520414700351040ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { baz } from './baz.js'; baz.bar.foo.chain11 = 'modified'; export default baz; reexporter-chain-2.js000066400000000000000000000001241450520414700350220ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport foo from './reexporter-chain-3.js'; foo.chain2 = 'modified'; export { foo }; reexporter-chain-3.js000066400000000000000000000001341450520414700350240ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { foo } from './reexporter-chain-4.js'; foo.chain3 = 'modified'; export default foo; reexporter-chain-4.js000066400000000000000000000001461450520414700350300ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport bar from './reexporter-chain-5.js'; bar.foo.chain4 = 'modified'; export { bar as __synthetic };reexporter-chain-5.js000066400000000000000000000001401450520414700350230ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { bar } from './reexporter-chain-6.js'; bar.foo.chain5 = 'modified'; export default bar; reexporter-chain-6.js000066400000000000000000000002111450520414700350230ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { bar } from './reexporter-chain-7.js'; bar.foo.chain6 = 'should not be modified'; export { bar } from './reexporter-chain-7.js'; reexporter-chain-7.js000066400000000000000000000001341450520414700350300ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { bar } from './reexporter-chain-8.js'; bar.foo.chain7 = 'modified'; export { bar }; reexporter-chain-8.js000066400000000000000000000001571450520414700350360ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { baz } from './reexporter-chain-9.js'; baz.bar.foo.chain8 = 'modified'; export { baz as __synthetic }; reexporter-chain-9.js000066400000000000000000000002161450520414700350330ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { baz } from './reexporter-chain-10.js'; baz.bar.foo.chain9 = 'should not be modified'; export { baz } from './reexporter-chain-10.js';rollup-3.29.4/test/function/samples/retain-unknown-prototype-access/000077500000000000000000000000001450520414700256615ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/retain-unknown-prototype-access/_config.js000066400000000000000000000001511450520414700276200ustar00rootroot00000000000000module.exports = defineTest({ description: 'treats unknown builtin prototype properties as unknown' }); rollup-3.29.4/test/function/samples/retain-unknown-prototype-access/main.js000066400000000000000000000004101450520414700271360ustar00rootroot00000000000000Object.defineProperty(Array.prototype, 'isEmpty', { get() { return this.length === 0; } }); const array = []; assert.strictEqual(array.isEmpty ? 'works' : 'broken', 'works'); array.push('foo'); assert.strictEqual(array.isEmpty ? 'broken' : 'works', 'works'); rollup-3.29.4/test/function/samples/retains-sort-order-b/000077500000000000000000000000001450520414700233625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/retains-sort-order-b/_config.js000066400000000000000000000003401450520414700253210ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'sorts statements according to their original order within modules, part 2', exports(exports) { assert.equal(exports.answer, 42); } }); rollup-3.29.4/test/function/samples/retains-sort-order-b/bar.js000066400000000000000000000001321450520414700244600ustar00rootroot00000000000000var bar = {}; bar.apply = function ( object ) { object.answer = 42; }; export { bar }; rollup-3.29.4/test/function/samples/retains-sort-order-b/foo.js000066400000000000000000000002601450520414700245010ustar00rootroot00000000000000import { bar } from './bar'; var Foo = function () { this.id = incr(); }; bar.apply( Foo.prototype ); var count = 0; function incr () { return count++; }; export { Foo }; rollup-3.29.4/test/function/samples/retains-sort-order-b/main.js000066400000000000000000000000701450520414700246410ustar00rootroot00000000000000import { Foo } from './foo'; export default new Foo(); rollup-3.29.4/test/function/samples/retains-sort-order/000077500000000000000000000000001450520414700231435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/retains-sort-order/_config.js000066400000000000000000000003361450520414700251070ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'sorts statements according to their original order within modules', exports(exports) { assert.equal(exports, 'GREAT SUCCESS'); } }); rollup-3.29.4/test/function/samples/retains-sort-order/baz.js000066400000000000000000000000401450520414700242470ustar00rootroot00000000000000export default 'GREAT SUCCESS'; rollup-3.29.4/test/function/samples/retains-sort-order/foobar.js000066400000000000000000000003531450520414700247520ustar00rootroot00000000000000import baz from './baz'; export function Foo () {} Foo.prototype.test = function () { return 'nope'; }; export function Bar () {} Bar.prototype = Object.create( Foo.prototype ); Bar.prototype.test = function () { return baz; }; rollup-3.29.4/test/function/samples/retains-sort-order/main.js000066400000000000000000000001221450520414700244200ustar00rootroot00000000000000import { Foo, Bar } from './foobar'; new Foo(); export default new Bar().test(); rollup-3.29.4/test/function/samples/return-expression-depending-on-conditional/000077500000000000000000000000001450520414700277625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/return-expression-depending-on-conditional/_config.js000066400000000000000000000002301450520414700317170ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks return expressions that depend on conditional expressions that are deoptimized at some point' }); rollup-3.29.4/test/function/samples/return-expression-depending-on-conditional/main.js000066400000000000000000000002531450520414700312440ustar00rootroot00000000000000var x = true; var triggered = false; reassign(); (x ? () => () => {} : () => () => {triggered = true;})()(); function reassign() { x = false; } assert.ok(triggered); rollup-3.29.4/test/function/samples/returned-array-mutation/000077500000000000000000000000001450520414700242025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/returned-array-mutation/_config.js000066400000000000000000000001111450520414700261350ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks array mutations' }); rollup-3.29.4/test/function/samples/returned-array-mutation/main.js000066400000000000000000000003501450520414700254620ustar00rootroot00000000000000let push = false; const getArray = () => { const array = []; if (push) { array.push(true); } return array; }; assert.strictEqual(getArray()[0] || false, false); push = true; assert.strictEqual(getArray()[0] || false, true); rollup-3.29.4/test/function/samples/reuse-resolve-meta/000077500000000000000000000000001450520414700231245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/reuse-resolve-meta/_config.js000066400000000000000000000014601450520414700250670ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const meta = { plugin: { initial: true } }; const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'does not modify meta objects passed in resolveId', options: { plugins: [ { async resolveId(source, importer) { const { id } = await this.resolve(source, importer, { skipSelf: true }); return { id, meta }; }, transform(code) { return { code, meta: { otherPlugin: { ignored: true }, plugin: { replaced: true } } }; }, buildEnd() { assert.deepStrictEqual(meta, { plugin: { initial: true } }); assert.deepStrictEqual(this.getModuleInfo(ID_MAIN).meta, { otherPlugin: { ignored: true }, plugin: { replaced: true } }); } } ] } }); rollup-3.29.4/test/function/samples/reuse-resolve-meta/main.js000066400000000000000000000000211450520414700243770ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/function/samples/rewrite-member-expressions/000077500000000000000000000000001450520414700247065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/rewrite-member-expressions/_config.js000066400000000000000000000001511450520414700266450ustar00rootroot00000000000000module.exports = defineTest({ description: 'rewrites identifiers at the head of member expressions' }); rollup-3.29.4/test/function/samples/rewrite-member-expressions/getLengthOfOtherQueue.js000066400000000000000000000001521450520414700314570ustar00rootroot00000000000000export default function getLengthOfOtherQueue () { return queue.length; } var queue = new Array( 1000 );rollup-3.29.4/test/function/samples/rewrite-member-expressions/main.js000066400000000000000000000003361450520414700261720ustar00rootroot00000000000000import { addToQueue, getQueueItem } from './mainQueue'; import getLengthOfOtherQueue from './getLengthOfOtherQueue'; addToQueue( 42 ); assert.equal( getQueueItem( 0 ), 42 ); assert.equal( getLengthOfOtherQueue(), 1000 );rollup-3.29.4/test/function/samples/rewrite-member-expressions/mainQueue.js000066400000000000000000000002011450520414700271660ustar00rootroot00000000000000var queue = []; export function addToQueue ( x ) { queue.push( x ); } export function getQueueItem ( i ) { return queue[i]; }rollup-3.29.4/test/function/samples/self-referencing-namespace/000077500000000000000000000000001450520414700245505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/self-referencing-namespace/_config.js000066400000000000000000000011241450520414700265100ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'supports dynamic namespaces that reference themselves', options: { output: { generatedCode: { constBindings: true } } }, exports(exports) { assert.strictEqual(exports.foo, 'foo'); assert.strictEqual(exports.ns.foo, 'foo'); assert.strictEqual(exports.ns.ns.foo, 'foo'); }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_MAIN, ID_MAIN], message: 'Circular dependency: main.js -> main.js' } ] }); rollup-3.29.4/test/function/samples/self-referencing-namespace/main.js000066400000000000000000000000731450520414700260320ustar00rootroot00000000000000export * as ns from './main.js'; export const foo = 'foo'; rollup-3.29.4/test/function/samples/sequence-expression/000077500000000000000000000000001450520414700234055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/sequence-expression/_config.js000066400000000000000000000001541450520414700253470ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not change context of callable in sequence expressions' }); rollup-3.29.4/test/function/samples/sequence-expression/main.js000066400000000000000000000002121450520414700246620ustar00rootroot00000000000000 // should maintain this context var module = {}; module.bar = function () { assert.notEqual(this, module); }; var h = (0, module.bar)(); rollup-3.29.4/test/function/samples/sequence-expressions-template-tag/000077500000000000000000000000001450520414700261525ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/sequence-expressions-template-tag/_config.js000066400000000000000000000001771450520414700301210ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses corrrect "this" for tagged template expressions in simplified sequences' }); rollup-3.29.4/test/function/samples/sequence-expressions-template-tag/main.js000066400000000000000000000002341450520414700274330ustar00rootroot00000000000000let o = { f() { assert.ok(this !== o); } }; (1, o.f)(); (1, o.f)``; (true && o.f)(); (true && o.f)``; (true ? o.f : false)(); (true ? o.f : false)``; rollup-3.29.4/test/function/samples/shadowed-external-export/000077500000000000000000000000001450520414700243355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/shadowed-external-export/_config.js000066400000000000000000000001711450520414700262760ustar00rootroot00000000000000module.exports = defineTest({ description: 'external modules are not shadowed', options: { external: ['path'] } }); rollup-3.29.4/test/function/samples/shadowed-external-export/main.js000066400000000000000000000004631450520414700256220ustar00rootroot00000000000000import { relative, normalize } from 'path'; var paths = {}; function getRelativePath ( path, path2 ) { paths[ path ] = true; return relative( path, path2 ); } assert.equal( getRelativePath( 'foo/bar/baz', 'foo/baz/bar' ), normalize('../../baz/bar') ); assert.deepEqual( paths, { 'foo/bar/baz': true }); rollup-3.29.4/test/function/samples/shadowed-namespace-b/000077500000000000000000000000001450520414700233475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/shadowed-namespace-b/_config.js000066400000000000000000000001221450520414700253040ustar00rootroot00000000000000module.exports = defineTest({ description: 'namespaces are not shadowed (b)' }); rollup-3.29.4/test/function/samples/shadowed-namespace-b/bar.js000066400000000000000000000000471450520414700244520ustar00rootroot00000000000000export function foo () { return 42; } rollup-3.29.4/test/function/samples/shadowed-namespace-b/main.js000066400000000000000000000002201450520414700246230ustar00rootroot00000000000000import * as bar from './bar'; function car () { var foo = function () { return 'nope'; }; return bar.foo(); } assert.equal( car(), 42 ); rollup-3.29.4/test/function/samples/shadowed-namespace/000077500000000000000000000000001450520414700231305ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/shadowed-namespace/_config.js000066400000000000000000000001161450520414700250700ustar00rootroot00000000000000module.exports = defineTest({ description: 'namespaces are not shadowed' }); rollup-3.29.4/test/function/samples/shadowed-namespace/bar.js000066400000000000000000000000541450520414700242310ustar00rootroot00000000000000export function foo () { return 'FUBAR'; } rollup-3.29.4/test/function/samples/shadowed-namespace/main.js000066400000000000000000000002761450520414700244170ustar00rootroot00000000000000import * as bar from './bar'; function car () { var bar = { foo: function () { return 42; } }; return bar.foo(); } assert.equal( bar.foo(), 'FUBAR' ); assert.equal( car(), 42 ); rollup-3.29.4/test/function/samples/shadowed-variables/000077500000000000000000000000001450520414700231445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/shadowed-variables/_config.js000066400000000000000000000003201450520414700251010ustar00rootroot00000000000000module.exports = defineTest({ description: 'renames shadowed variables correctly' }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/named-function-expression rollup-3.29.4/test/function/samples/shadowed-variables/foo.js000066400000000000000000000000221450520414700242570ustar00rootroot00000000000000export var a = 1; rollup-3.29.4/test/function/samples/shadowed-variables/main.js000066400000000000000000000002171450520414700244260ustar00rootroot00000000000000import { a } from './foo'; var getA = function getA() { var a = 2; return a; }; assert.strictEqual(a, 1); assert.strictEqual(getA(), 2); rollup-3.29.4/test/function/samples/shims-missing-exports/000077500000000000000000000000001450520414700236745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/shims-missing-exports/_config.js000066400000000000000000000005661450520414700256450ustar00rootroot00000000000000const path = require('node:path'); const ID_DEP1 = path.join(__dirname, 'dep1.js'); module.exports = defineTest({ description: 'shims missing exports', options: { shimMissingExports: true }, warnings: [ { binding: 'missing', code: 'SHIMMED_EXPORT', exporter: ID_DEP1, message: 'Missing export "missing" has been shimmed in module "dep1.js".' } ] }); rollup-3.29.4/test/function/samples/shims-missing-exports/dep1.js000066400000000000000000000000001450520414700250510ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/shims-missing-exports/main.js000066400000000000000000000000721450520414700251550ustar00rootroot00000000000000import { missing } from './dep1.js'; export { missing }; rollup-3.29.4/test/function/samples/side-effect-free-module-function/000077500000000000000000000000001450520414700256035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/side-effect-free-module-function/_config.js000066400000000000000000000003501450520414700275430ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly include functions with side effects from side-effect-free modules (#3942)', options: { plugins: { transform() { return { moduleSideEffects: false }; } } } }); rollup-3.29.4/test/function/samples/side-effect-free-module-function/curry.js000066400000000000000000000002341450520414700273040ustar00rootroot00000000000000export function curry(fn, args = []) { return (..._args) => (rest => (rest.length >= fn.length ? fn(...rest) : curry(fn, rest)))([...args, ..._args]); } rollup-3.29.4/test/function/samples/side-effect-free-module-function/main.js000066400000000000000000000002261450520414700270650ustar00rootroot00000000000000import { curry } from './curry'; let result; function foo() { result = 'foo'; } var fooc = curry(foo); fooc(); assert.strictEqual(result, 'foo'); rollup-3.29.4/test/function/samples/side-effects-only-default-exports/000077500000000000000000000000001450520414700260445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/side-effects-only-default-exports/_config.js000066400000000000000000000006431450520414700300110ustar00rootroot00000000000000const assert = require('node:assert'); const mutated = {}; module.exports = defineTest({ description: 'Wraps inlined default exports which are rendered for side-effects only', options: { external: ['external'] }, context: { require: () => mutated }, bundle() { assert.ok(mutated.mutated); assert.ok(mutated.veryMutated); assert.ok(mutated.extremelyMutated); assert.ok(mutated.utterlyMutated); } }); rollup-3.29.4/test/function/samples/side-effects-only-default-exports/bar.js000066400000000000000000000001351450520414700271450ustar00rootroot00000000000000import x from 'external'; export default (x.veryMutated = true, x.extremelyMutated = true); rollup-3.29.4/test/function/samples/side-effects-only-default-exports/baz.js000066400000000000000000000001701450520414700271540ustar00rootroot00000000000000import x from 'external'; export default true ? { a: x.totallyMutated = true, makeSureThisIsAnObject: true } : null; rollup-3.29.4/test/function/samples/side-effects-only-default-exports/foo.js000066400000000000000000000001431450520414700271630ustar00rootroot00000000000000import x from 'external'; export default { a: x.mutated = true, makeSureThisIsAnObject: true }; rollup-3.29.4/test/function/samples/side-effects-only-default-exports/main.js000066400000000000000000000001621450520414700273250ustar00rootroot00000000000000import foo from './foo.js'; import bar from './bar.js'; import baz from './baz.js'; import quux from './quux.js'; rollup-3.29.4/test/function/samples/side-effects-only-default-exports/quux.js000066400000000000000000000001621450520414700274030ustar00rootroot00000000000000import x from 'external'; export default true && { a: x.utterlyMutated = true, makeSureThisIsAnObject: true }; rollup-3.29.4/test/function/samples/simplified-nested-if/000077500000000000000000000000001450520414700234015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/simplified-nested-if/_config.js000066400000000000000000000002511450520414700253410ustar00rootroot00000000000000module.exports = defineTest({ description: 'do not catch else branches from parent if statements when simplifiying if-statements', context: { unknown: true } }); rollup-3.29.4/test/function/samples/simplified-nested-if/main.js000066400000000000000000000011421450520414700246610ustar00rootroot00000000000000export let foo = 0; if (unknown) for (var x = 1; x-- > 0; ) if (!unknown) foo++; else 'Side effect free code to be dropped'; else throw new Error("Shouldn't be reached"); if (unknown) for (var x = 1; x-- > 0; ) if (foo++, false) foo++; else 'Side effect free code to be dropped'; else throw new Error("Shouldn't be reached"); if (unknown) { for (var x = 1; x-- > 0; ) if (!unknown) foo++; else 'Side effect free code to be dropped'; } else throw new Error("Shouldn't be reached"); if (unknown) for (var x = 1; x-- > 0; ) if (!unknown) foo++; else 'Side effect free code to be dropped'; rollup-3.29.4/test/function/samples/simplify-arrow-expression-with-object/000077500000000000000000000000001450520414700267765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/simplify-arrow-expression-with-object/_config.js000066400000000000000000000005071450520414700307420ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'correctly simplifies arrow expressions where the right hand side becomes an object', exports(exports) { assert.deepStrictEqual(exports.conditional(), { x: 42, y: 43 }); assert.deepStrictEqual(exports.logical(), { x: 42, y: 43 }); } }); rollup-3.29.4/test/function/samples/simplify-arrow-expression-with-object/main.js000066400000000000000000000001721450520414700302600ustar00rootroot00000000000000export const logical = () => true && { x: 42, y: 43, }; export const conditional = () => true ? { x: 42, y: 43, } : null; rollup-3.29.4/test/function/samples/simplify-class-expression-assignment/000077500000000000000000000000001450520414700267025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/simplify-class-expression-assignment/_config.js000066400000000000000000000001701450520414700306420ustar00rootroot00000000000000module.exports = defineTest({ description: 'wraps class expressions in call expressions in simplified assignments' }); rollup-3.29.4/test/function/samples/simplify-class-expression-assignment/main.js000066400000000000000000000003521450520414700301640ustar00rootroot00000000000000let calls = 0; Function.prototype.testFunc = () => { calls++; return { test: () => calls++ }; }; var x = class {}.testFunc(); var y; y = class {}.testFunc().test(); delete Object.prototype.testFunc; assert.strictEqual(calls, 3); rollup-3.29.4/test/function/samples/simplify-function-expression-assignment/000077500000000000000000000000001450520414700274225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/simplify-function-expression-assignment/_config.js000066400000000000000000000001731450520414700313650ustar00rootroot00000000000000module.exports = defineTest({ description: 'wraps function expressions in call expressions in simplified assignments' }); rollup-3.29.4/test/function/samples/simplify-function-expression-assignment/main.js000066400000000000000000000003661450520414700307110ustar00rootroot00000000000000let calls = 0; Function.prototype.testFunc = () => { calls++; return { test: () => calls++ }; }; var x = function () {}.testFunc(); var y; y = function () {}.testFunc().test(); delete Object.prototype.testFunc; assert.strictEqual(calls, 3); rollup-3.29.4/test/function/samples/simplify-object-expression-assignment/000077500000000000000000000000001450520414700270435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/simplify-object-expression-assignment/_config.js000066400000000000000000000001711450520414700310040ustar00rootroot00000000000000module.exports = defineTest({ description: 'wraps object expressions in call expressions in simplified assignments' }); rollup-3.29.4/test/function/samples/simplify-object-expression-assignment/main.js000066400000000000000000000003341450520414700303250ustar00rootroot00000000000000let calls = 0; Object.prototype.testFunc = () => { calls++; return { test: () => calls++ }; }; var x = {}.testFunc(); var y; y = {}.testFunc().test(); delete Object.prototype.testFunc; assert.strictEqual(calls, 3); rollup-3.29.4/test/function/samples/simplify-sequence-expressions/000077500000000000000000000000001450520414700254225ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/simplify-sequence-expressions/_config.js000066400000000000000000000002211450520414700273570ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly simplify sequence expressions if the new leading element would require parentheses' }); rollup-3.29.4/test/function/samples/simplify-sequence-expressions/main.js000066400000000000000000000013321450520414700267030ustar00rootroot00000000000000let value = 0; 1, function(){ value = 1 }(); assert.strictEqual(value, 1); 1, function(){ value = 2 }(), 2; assert.strictEqual(value, 2); 1, {foo: value = 3 }; assert.strictEqual(value, 3); 1, {foo: value = 4 }, 2; assert.strictEqual(value, 4); 1, true ? function(){ value = 5 }() : false; assert.strictEqual(value, 5); 1, true ? function(){ value = 6 }() : false, 2; assert.strictEqual(value, 6); 1, function(){ value = 7; return true }() ? true : false; assert.strictEqual(value, 7); 1, function(){ value = 8; return true }() ? true : false, 2; assert.strictEqual(value, 8); 1, false || function(){ value = 9 }(); assert.strictEqual(value, 9); 1, false || function(){ value = 10 }(), 2; assert.strictEqual(value, 10); rollup-3.29.4/test/function/samples/simplify-with-destructuring/000077500000000000000000000000001450520414700251055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/simplify-with-destructuring/_config.js000066400000000000000000000001661450520414700270520ustar00rootroot00000000000000module.exports = defineTest({ description: 'handle destructuring assignments in simplified sequence expressions' }); rollup-3.29.4/test/function/samples/simplify-with-destructuring/main.js000066400000000000000000000002641450520414700263710ustar00rootroot00000000000000let foo, unused; null, { foo } = { foo: 'bar' }; assert.strictEqual(foo, 'bar'); const assign = () => unused = { foo } = { foo: 'baz' }; assign(); assert.strictEqual(foo, 'baz'); rollup-3.29.4/test/function/samples/simplify-with-function-iife/000077500000000000000000000000001450520414700247425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/simplify-with-function-iife/_config.js000066400000000000000000000002031450520414700266770ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly uses parentheses when a simplification would put a function IIFE first' }); rollup-3.29.4/test/function/samples/simplify-with-function-iife/main.js000066400000000000000000000006501450520414700262250ustar00rootroot00000000000000let a = 0; const _1 = function (){}() ? a = 1 : a = 2; assert.strictEqual(a, 2); let b = 0; const _2 = function (){}() || (b = 1); assert.strictEqual(b, 1); let c = 0; const _3 = function (){}() + (c = 1); assert.strictEqual(c, 1); let d = 0; const _4 = function (){}() || function (){}() || (d = 1); assert.strictEqual(d, 1); let e = 0; const _5 = function (){}() + function (){}() + (e = 1); assert.strictEqual(e, 1); rollup-3.29.4/test/function/samples/sourcemap-base-url-invalid/000077500000000000000000000000001450520414700245325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/sourcemap-base-url-invalid/_config.js000066400000000000000000000006111450520414700264720ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for invalid sourcemapBaseUrl', options: { output: { sourcemapBaseUrl: 'example.com' } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value for option "output.sourcemapBaseUrl" - must be a valid URL, received "example.com".', url: 'https://rollupjs.org/configuration-options/#output-sourcemapbaseurl' } }); rollup-3.29.4/test/function/samples/sourcemap-base-url-invalid/main.js000066400000000000000000000000231450520414700260070ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/function/samples/sourcemap-inline-generatebundle/000077500000000000000000000000001450520414700256345ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/sourcemap-inline-generatebundle/_config.js000066400000000000000000000013321450520414700275750ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'includes inline sourcemap comments in generateBundle hook', options: { plugins: [ { name: 'test', generateBundle(options, bundle) { assert.deepStrictEqual(Object.keys(bundle), ['main.js']); assert.strictEqual( bundle['main.js'].code, `'use strict'; var main = 42; module.exports = main; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibWFpbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCA0MjtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLFdBQWUsRUFBRTs7OzsifQ== ` ); } } ], output: { sourcemap: 'inline' } } }); rollup-3.29.4/test/function/samples/sourcemap-inline-generatebundle/main.js000066400000000000000000000000231450520414700271110ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/sourcemap-true-generatebundle/000077500000000000000000000000001450520414700253355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/sourcemap-true-generatebundle/_config.js000066400000000000000000000015111450520414700272750ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'emits sourcemaps before generateBundle hook', options: { plugins: [ { name: 'test', generateBundle(options, bundle) { assert.deepStrictEqual(Object.keys(bundle), ['main.js', 'main.js.map']); assert.strictEqual( bundle['main.js'].code, `'use strict'; var main = 42; module.exports = main; //# sourceMappingURL=main.js.map ` ); assert.deepStrictEqual(bundle['main.js.map'], { fileName: 'main.js.map', name: undefined, needsCodeReference: false, source: '{"version":3,"file":"main.js","sources":["main.js"],"sourcesContent":["export default 42;\\n"],"names":[],"mappings":";;AAAA,WAAe,EAAE;;;;"}', type: 'asset' }); } } ], output: { sourcemap: true } } }); rollup-3.29.4/test/function/samples/sourcemap-true-generatebundle/main.js000066400000000000000000000000231450520414700266120ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/sourcemapping-url-comment/000077500000000000000000000000001450520414700245145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/sourcemapping-url-comment/_config.js000066400000000000000000000001501450520414700264520ustar00rootroot00000000000000module.exports = defineTest({ description: 'only removes valid sourcemapping URL comments (#1132)' }); rollup-3.29.4/test/function/samples/sourcemapping-url-comment/main.js000066400000000000000000000001021450520414700257670ustar00rootroot00000000000000////# sourceMappingURL=foo var val = 42; assert.equal( val, 42 ); rollup-3.29.4/test/function/samples/sourcemapping-url-multiline/000077500000000000000000000000001450520414700250545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/sourcemapping-url-multiline/_config.js000066400000000000000000000001661450520414700270210ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not mistakenly recognise sourceMappingURL comment with newline' }); rollup-3.29.4/test/function/samples/sourcemapping-url-multiline/main.js000066400000000000000000000001511450520414700263330ustar00rootroot00000000000000var sourceMappingURL; //# sourceMappingURL='something'; assert.equal( sourceMappingURL, 'something' ); rollup-3.29.4/test/function/samples/spread-arguments-unused/000077500000000000000000000000001450520414700241625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/spread-arguments-unused/_config.js000066400000000000000000000002211450520414700261170ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles using the spread operator to add arguments when the first argument is unused (#3652)' }); rollup-3.29.4/test/function/samples/spread-arguments-unused/main.js000066400000000000000000000001411450520414700254400ustar00rootroot00000000000000function test(unused, used) { assert.strictEqual(used, 'used'); } test(...['unused', 'used']); rollup-3.29.4/test/function/samples/statement-order/000077500000000000000000000000001450520414700225155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/statement-order/_config.js000066400000000000000000000004251450520414700244600ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'correct statement order is preserved even in weird edge cases', context: { getAnswer(object) { return object.answer; } }, exports(exports) { assert.equal(exports, 'right'); } }); rollup-3.29.4/test/function/samples/statement-order/answer.js000066400000000000000000000004051450520414700243510ustar00rootroot00000000000000var prop, answer; var foo = { answer: 'wrong' }; var bar = { answer: 'right' }; if ( typeof bar === "object" ) { for ( prop in bar ) { if ( bar.hasOwnProperty(prop) ) { foo[prop] = bar[prop]; } } } answer = getAnswer( foo ); export default answer; rollup-3.29.4/test/function/samples/statement-order/main.js000066400000000000000000000001151450520414700237740ustar00rootroot00000000000000import answer from './answer'; var answer2 = answer; export default answer2; rollup-3.29.4/test/function/samples/switch-break/000077500000000000000000000000001450520414700217635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/switch-break/_config.js000066400000000000000000000001671450520414700237310ustar00rootroot00000000000000module.exports = defineTest({ description: 'if switch does not always throw an error, retain the following break' }); rollup-3.29.4/test/function/samples/switch-break/main.js000066400000000000000000000005761450520414700232550ustar00rootroot00000000000000function issue(obj) { switch (obj.field1) { case 'baz': switch (obj.field2) { case 'value': { if (obj.field1) { if (obj.field1) { break; } } throw new Error(`error 1`); } default: throw new Error(`error 2`); } break; // retained default: throw new Error('error 3'); } } issue({ field1: 'baz', field2: 'value' }); rollup-3.29.4/test/function/samples/switch-cases-are-deconflicted/000077500000000000000000000000001450520414700251635ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/switch-cases-are-deconflicted/_config.js000066400000000000000000000003721450520414700271270ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'deconflicts variables in switch cases (#1970)', exports(exports) { assert.equal(exports.fn1('1'), 'correct'); assert.equal(exports.fn2('2'), 'correct'); } }); rollup-3.29.4/test/function/samples/switch-cases-are-deconflicted/main.js000066400000000000000000000001021450520414700264360ustar00rootroot00000000000000export { fn1 } from './mod1.js'; export { fn2 } from './mod2.js'; rollup-3.29.4/test/function/samples/switch-cases-are-deconflicted/mod1.js000066400000000000000000000002241450520414700263570ustar00rootroot00000000000000const VALUE = '1'; export function fn1 ( value ) { switch ( value ) { case VALUE: return 'correct'; default: return 'not matched'; } } rollup-3.29.4/test/function/samples/switch-cases-are-deconflicted/mod2.js000066400000000000000000000002241450520414700263600ustar00rootroot00000000000000const VALUE = '2'; export function fn2 ( value ) { switch ( value ) { case VALUE: return 'correct'; default: return 'not matched'; } } rollup-3.29.4/test/function/samples/switch-scope/000077500000000000000000000000001450520414700220105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/switch-scope/_config.js000066400000000000000000000001341450520414700237500ustar00rootroot00000000000000module.exports = defineTest({ description: 'uses correct scopes for switch statements' }); rollup-3.29.4/test/function/samples/switch-scope/main.js000066400000000000000000000001751450520414700232750ustar00rootroot00000000000000const foo = 1; let triggered = false; switch (foo) { case 1: const foo = 2; triggered = true; } assert.ok(triggered); rollup-3.29.4/test/function/samples/switch-statement-nested-continue/000077500000000000000000000000001450520414700260055ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/switch-statement-nested-continue/_config.js000066400000000000000000000001541450520414700277470ustar00rootroot00000000000000module.exports = defineTest({ description: 'treats continue different from break in switch statements' }); rollup-3.29.4/test/function/samples/switch-statement-nested-continue/main.js000066400000000000000000000005321450520414700272670ustar00rootroot00000000000000function getValueContinue() { for (var i = 0; i < 4; i++) { switch (i) { case 0: case 1: continue; } return i; } } assert.strictEqual(getValueContinue(), 2); function getValueBreak() { for (var i = 0; i < 4; i++) { switch (i) { case 0: case 1: break; } return i; } } assert.strictEqual(getValueBreak(), 0); rollup-3.29.4/test/function/samples/switch-statement-out-of-order-default/000077500000000000000000000000001450520414700266455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/switch-statement-out-of-order-default/_config.js000066400000000000000000000001641450520414700306100ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles side-effects in non-ordered defaults of switch statements' }); rollup-3.29.4/test/function/samples/switch-statement-out-of-order-default/main.js000066400000000000000000000002771450520414700301350ustar00rootroot00000000000000function getSelectedValue(selector) { switch (selector) { default: case 'bar': return 'bar'; case 'foo': } return selector; } assert.strictEqual(getSelectedValue('foo'), 'foo'); rollup-3.29.4/test/function/samples/switch-statements-removed-default/000077500000000000000000000000001450520414700261475ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/switch-statements-removed-default/_config.js000066400000000000000000000001701450520414700301070ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not remove code after a switch statement that should be retained' }); rollup-3.29.4/test/function/samples/switch-statements-removed-default/main.js000066400000000000000000000002211450520414700274240ustar00rootroot00000000000000function performSwitch(value) { switch (value) { case 'foo': return false; default: } return true; } assert.ok(performSwitch('baz')); rollup-3.29.4/test/function/samples/symlink/000077500000000000000000000000001450520414700210665ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/symlink/_config.js000066400000000000000000000001501450520414700230240ustar00rootroot00000000000000module.exports = defineTest({ skip: process.platform === 'win32', description: 'follows symlinks' }); rollup-3.29.4/test/function/samples/symlink/foo.js000077700000000000000000000000001450520414700253032symlinked/bar.jsustar00rootroot00000000000000rollup-3.29.4/test/function/samples/symlink/main.js000066400000000000000000000000701450520414700223450ustar00rootroot00000000000000import foo from './foo.js'; assert.equal( foo, 'BAZ' ); rollup-3.29.4/test/function/samples/symlink/symlinked/000077500000000000000000000000001450520414700230655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/symlink/symlinked/bar.js000066400000000000000000000000621450520414700241650ustar00rootroot00000000000000import baz from './baz.js'; export default baz(); rollup-3.29.4/test/function/samples/symlink/symlinked/baz.js000066400000000000000000000000561450520414700242000ustar00rootroot00000000000000export default function () { return 'BAZ'; } rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback-es2015/000077500000000000000000000000001450520414700266505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback-es2015/_config.js000066400000000000000000000004141450520414700306110ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds a fallback in case synthetic named exports are falsy', options: { output: { generatedCode: 'es2015' }, plugins: [ { transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }); rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback-es2015/array.js000066400000000000000000000001001450520414700303130ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = [1, 2, 3]; rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback-es2015/inherited.js000066400000000000000000000001361450520414700311610ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = Object.create({ inherited: 'ignored' }); rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback-es2015/main.js000066400000000000000000000007421450520414700301350ustar00rootroot00000000000000import * as fromNull from './null'; import * as fromString from './string'; import * as fromArray from './array'; import * as fromInherited from './inherited'; const expectedNs = { __proto__: null, foo: 'bar' }; Object.defineProperty(expectedNs, Symbol.toStringTag, { value: 'Module' }); assert.deepStrictEqual(fromNull, expectedNs); assert.deepStrictEqual(fromString, expectedNs); assert.deepStrictEqual(fromArray, expectedNs); assert.deepStrictEqual(fromInherited, expectedNs); rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback-es2015/null.js000066400000000000000000000000731450520414700301600ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = null; rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback-es2015/string.js000066400000000000000000000001041450520414700305070ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = 'some string'; rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback/000077500000000000000000000000001450520414700257335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback/_config.js000066400000000000000000000003451450520414700276770ustar00rootroot00000000000000module.exports = defineTest({ description: 'adds a fallback in case synthetic named exports are falsy', options: { plugins: [ { transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }); rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback/array.js000066400000000000000000000001001450520414700273760ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = [1, 2, 3]; rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback/inherited.js000066400000000000000000000001361450520414700302440ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = Object.create({ inherited: 'ignored' }); rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback/main.js000066400000000000000000000006651450520414700272240ustar00rootroot00000000000000import * as fromNull from './null'; import * as fromString from './string'; import * as fromArray from './array'; import * as fromInherited from './inherited'; assert.deepStrictEqual(fromNull, { __proto__: null, foo: 'bar' }); assert.deepStrictEqual(fromString, { __proto__: null, foo: 'bar' }); assert.deepStrictEqual(fromArray, { __proto__: null, foo: 'bar' }); assert.deepStrictEqual(fromInherited, { __proto__: null, foo: 'bar' }); rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback/null.js000066400000000000000000000000731450520414700272430ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = null; rollup-3.29.4/test/function/samples/synthetic-named-exports-fallback/string.js000066400000000000000000000001041450520414700275720ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = 'some string'; rollup-3.29.4/test/function/samples/synthetic-named-exports/000077500000000000000000000000001450520414700241765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/circular-synthetic-exports/000077500000000000000000000000001450520414700315145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/circular-synthetic-exports/_config.js000066400000000000000000000012601450520414700334550ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = defineTest({ description: 'handles circular synthetic exports', options: { plugins: [ { name: 'test', transform() { return { syntheticNamedExports: '__synthetic' }; } } ] }, error: { code: 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', exporter: ID_MAIN, watchFiles: [ID_DEP, ID_MAIN], message: 'Module "main.js" that is marked with `syntheticNamedExports: "__synthetic"` needs an explicit export named "__synthetic" that does not reexport an unresolved named export of the same module.' } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/circular-synthetic-exports/dep.js000066400000000000000000000000541450520414700326210ustar00rootroot00000000000000export { foo as default } from './main.js'; rollup-3.29.4/test/function/samples/synthetic-named-exports/circular-synthetic-exports/main.js000066400000000000000000000000631450520414700327750ustar00rootroot00000000000000export { default as __synthetic } from './dep.js'; rollup-3.29.4/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/000077500000000000000000000000001450520414700315765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/_config.js000066400000000000000000000005721450520414700335440ustar00rootroot00000000000000const path = require('node:path'); const ID_DEP1 = path.join(__dirname, 'dep1.js'); const ID_DEP2 = path.join(__dirname, 'dep2.js'); module.exports = defineTest({ description: 'handles circular synthetic exports', warnings: [ { code: 'CIRCULAR_DEPENDENCY', ids: [ID_DEP1, ID_DEP2, ID_DEP1], message: 'Circular dependency: dep1.js -> dep2.js -> dep1.js' } ] }); rollup-3.29.4/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/dep1.js000066400000000000000000000000571450520414700327670ustar00rootroot00000000000000import dep2 from './dep2'; export default dep2;rollup-3.29.4/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/dep2.js000066400000000000000000000000601450520414700327620ustar00rootroot00000000000000import dep1 from './dep1'; export default dep1; rollup-3.29.4/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/main.js000066400000000000000000000001001450520414700330470ustar00rootroot00000000000000import dep1 from './dep1'; assert.strictEqual(dep1, undefined); rollup-3.29.4/test/function/samples/synthetic-named-exports/dynamic-import/000077500000000000000000000000001450520414700271325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/dynamic-import/_config.js000066400000000000000000000013771450520414700311040ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'supports dynamically importing a module with synthetic named exports', options: { plugins: [ { name: 'test-plugin', transform(code, id) { if (id.endsWith('dep.js')) { return { code, syntheticNamedExports: true }; } }, moduleParsed({ id, syntheticNamedExports }) { if (id.endsWith('dep.js')) { assert.strictEqual(syntheticNamedExports, true); } } } ] }, async exports(exports) { const namespace = await exports; assert.strictEqual(namespace.foo, 'foo'); assert.strictEqual(namespace.bar, 'bar'); assert.strictEqual(namespace.baz, undefined); assert.deepStrictEqual(namespace.default, { foo: 'foo' }); } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/dynamic-import/dep.js000066400000000000000000000000711450520414700302360ustar00rootroot00000000000000export default { foo: 'foo' }; export const bar = 'bar'; rollup-3.29.4/test/function/samples/synthetic-named-exports/dynamic-import/main.js000066400000000000000000000000431450520414700304110ustar00rootroot00000000000000export default import('./dep.js'); rollup-3.29.4/test/function/samples/synthetic-named-exports/entry/000077500000000000000000000000001450520414700253375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/entry/_config.js000066400000000000000000000006321450520414700273020ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not expose the synthetic namespace if an entry point uses a string value', options: { plugins: [ { name: 'test-plugin', transform(code) { return { code, syntheticNamedExports: '__synthetic' }; } } ] }, exports(exports) { assert.deepStrictEqual(exports, { exists: 'exists' }); } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/entry/main.js000066400000000000000000000001271450520414700266210ustar00rootroot00000000000000export const exists = 'exists'; export const __synthetic = { synthetic: 'synthetic' }; rollup-3.29.4/test/function/samples/synthetic-named-exports/external-synthetic-exports/000077500000000000000000000000001450520414700315325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/external-synthetic-exports/_config.js000066400000000000000000000010461450520414700334750ustar00rootroot00000000000000module.exports = defineTest({ description: 'external modules can not have syntheticNamedExports', options: { plugins: [ { name: 'test-plugin', resolveId(id) { if (id === 'dep') { return { id, external: true, syntheticNamedExports: true }; } } } ] }, warnings: [ { code: 'EXTERNAL_SYNTHETIC_EXPORTS', exporter: 'dep', message: 'External "dep" cannot have "syntheticNamedExports" enabled (imported by "main.js").' } ], context: { require() { return 1; } } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/external-synthetic-exports/main.js000066400000000000000000000000401450520414700330060ustar00rootroot00000000000000import { foo } from 'dep'; foo; rollup-3.29.4/test/function/samples/synthetic-named-exports/namespace-object/000077500000000000000000000000001450520414700273765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/namespace-object/_config.js000066400000000000000000000010401450520414700313330ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not include named synthetic namespaces in namespace objects', options: { plugins: [ { name: 'test-plugin', transform(code, id) { if (id.endsWith('synthetic.js')) { return { code, syntheticNamedExports: '__moduleExports' }; } } } ] }, exports(exports) { assert.deepStrictEqual(exports, { synthetic: { __proto__: null, default: 'default', foo: 'synthetic-foo' } }); } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/namespace-object/main.js000066400000000000000000000000551450520414700306600ustar00rootroot00000000000000export * as synthetic from './synthetic.js'; rollup-3.29.4/test/function/samples/synthetic-named-exports/namespace-object/synthetic.js000066400000000000000000000001631450520414700317460ustar00rootroot00000000000000export default 'default'; export const __moduleExports = { foo: 'synthetic-foo', default: 'synthetic-default' }; rollup-3.29.4/test/function/samples/synthetic-named-exports/namespace-overrides/000077500000000000000000000000001450520414700301325ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/namespace-overrides/_config.js000066400000000000000000000015231450520414700320750ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'supports re-exported synthetic exports in namespace objects with correct export precedence', options: { plugins: [ { name: 'test-plugin', transform(code, id) { if (id.endsWith('synthetic.js')) { return { code, syntheticNamedExports: true }; } } } ] }, exports(exports) { assert.deepStrictEqual(exports, { dep: { __proto__: null, foo: 'foo', bar: 'bar', baz: 'synthetic-baz', default: 'not-overwritten', synthetic: { __proto__: null, foo: 'foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' } } } }); } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/namespace-overrides/dep.js000066400000000000000000000002111450520414700312320ustar00rootroot00000000000000export * as synthetic from './synthetic.js'; export const bar = 'bar'; export default 'not-overwritten'; export * from './synthetic.js'; rollup-3.29.4/test/function/samples/synthetic-named-exports/namespace-overrides/main.js000066400000000000000000000000411450520414700314070ustar00rootroot00000000000000export * as dep from './dep.js'; rollup-3.29.4/test/function/samples/synthetic-named-exports/namespace-overrides/synthetic.js000066400000000000000000000002201450520414700324740ustar00rootroot00000000000000export default { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' }; export const foo = 'foo'; rollup-3.29.4/test/function/samples/synthetic-named-exports/non-default-export/000077500000000000000000000000001450520414700277315ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/non-default-export/_config.js000066400000000000000000000012461450520414700316760ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'supports providing a named export to generate synthetic exports', options: { plugins: [ { name: 'test-plugin', transform(code, id) { if (id.endsWith('dep.js')) { return { code, syntheticNamedExports: '__synthetic' }; } }, moduleParsed({ id, syntheticNamedExports }) { if (id.endsWith('dep.js')) { assert.strictEqual(syntheticNamedExports, '__synthetic'); } } } ] }, exports(exports) { assert.deepStrictEqual(exports, { dep: 'default', doesNotExist: undefined, exists: 'exists', synthetic: 'synthetic' }); } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/non-default-export/dep.js000066400000000000000000000001531450520414700310360ustar00rootroot00000000000000export const exists = 'exists'; export const __synthetic = { synthetic: 'synthetic', default: 'default' }; rollup-3.29.4/test/function/samples/synthetic-named-exports/non-default-export/main.js000066400000000000000000000001111450520414700312040ustar00rootroot00000000000000export { exists, synthetic, doesNotExist, default as dep } from './dep'; rollup-3.29.4/test/function/samples/synthetic-named-exports/preserve-modules/000077500000000000000000000000001450520414700274775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/preserve-modules/_config.js000066400000000000000000000007211450520414700314410ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles a dynamic import with synthetic named exports in preserveModules mode', options: { output: { preserveModules: true }, plugins: [ { name: 'test', transform() { return { syntheticNamedExports: '__synthetic' }; } } ] }, async exports(exports) { const { foo } = await exports.promise; assert.strictEqual(foo, 'bar'); } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/preserve-modules/main.js000066400000000000000000000000521450520414700307560ustar00rootroot00000000000000export const promise = import('./other'); rollup-3.29.4/test/function/samples/synthetic-named-exports/preserve-modules/other.js000066400000000000000000000000531450520414700311540ustar00rootroot00000000000000export const __synthetic = { foo: 'bar' }; rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/000077500000000000000000000000001450520414700322455ustar00rootroot00000000000000_config.js000066400000000000000000000012401450520414700341250ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-exports-need-defaultconst path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = defineTest({ description: 'synthetic named exports modules need a default export', options: { plugins: [ { name: 'test-plugin', transform() { return { syntheticNamedExports: true }; } } ] }, error: { code: 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', exporter: ID_DEP, watchFiles: [ID_DEP, ID_MAIN], message: 'Module "dep.js" that is marked with `syntheticNamedExports: true` needs a default export that does not reexport an unresolved named export of the same module.' } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/dep.js000066400000000000000000000000251450520414700333500ustar00rootroot00000000000000export const foo = 1;rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/main.js000066400000000000000000000000611450520414700335240ustar00rootroot00000000000000import { a } from './dep.js'; a; console.log(a); rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-export/000077500000000000000000000000001450520414700336775ustar00rootroot00000000000000_config.js000066400000000000000000000014051450520414700355620ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-exportconst path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = defineTest({ description: 'synthetic named exports modules need their fallback export', options: { plugins: [ { name: 'test-plugin', transform(code, id) { if (id.endsWith('dep.js')) { return { code, syntheticNamedExports: '__synthetic' }; } } } ] }, error: { code: 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', exporter: ID_DEP, watchFiles: [ID_DEP, ID_MAIN], message: 'Module "dep.js" that is marked with `syntheticNamedExports: "__synthetic"` needs an explicit export named "__synthetic" that does not reexport an unresolved named export of the same module.' } }); dep.js000066400000000000000000000000261450520414700347240ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-exportexport const bar = 1; main.js000066400000000000000000000000401450520414700350740ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-exportexport { foo } from './dep.js'; rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/000077500000000000000000000000001450520414700326345ustar00rootroot00000000000000_config.js000066400000000000000000000003721450520414700345210ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-as-defaultmodule.exports = defineTest({ description: 'makes sure default exports of synthetic named exports are snapshots', options: { plugins: { name: 'test-plugin', transform() { return { syntheticNamedExports: '__synthetic' }; } } } }); rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/dep.js000066400000000000000000000000671450520414700337450ustar00rootroot00000000000000import { foo } from './synthetic'; export default foo; main.js000066400000000000000000000002241450520414700340350ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-as-defaultimport foo from './dep'; import { update } from './synthetic'; assert.strictEqual(foo, 'original'); update(); assert.strictEqual(foo, 'original'); synthetic.js000066400000000000000000000001561450520414700351270ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-as-defaultexport const __synthetic = { foo: 'original' }; export const update = () => (__synthetic.foo = 'reassigned'); rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-entry/000077500000000000000000000000001450520414700317505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-entry/_config.js000066400000000000000000000023031450520414700337100ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_OVERRIDE = path.join(__dirname, 'override.js'); const ID_NOOVERRIDE = path.join(__dirname, 'noOverride.js'); const ID_HIDDENNAMESPACE = path.join(__dirname, 'hiddenNamespace.js'); module.exports = defineTest({ description: 'does not expose synthetic named exports on entry points', options: { plugins: [ { name: 'test-plugin1', transform(code, id) { switch (id) { case ID_MAIN: { return { syntheticNamedExports: 'synthMain' }; } case ID_OVERRIDE: { return { syntheticNamedExports: 'synthOverride' }; } case ID_NOOVERRIDE: { return { syntheticNamedExports: 'synthNoOverride' }; } case ID_HIDDENNAMESPACE: { return { syntheticNamedExports: 'synthHiddenNamespace' }; } } } } ] }, exports(exports) { assert.deepStrictEqual(exports, { explicitReexport: { override: true }, hiddenNamespace: 'hiddenNamespace', main: 'main', noOverride: 'noOverride', override: 'override', synthHiddenNamespace: 'hidden in override', synthOverride: 'overridden' }); } }); hiddenNamespace.js000066400000000000000000000001611450520414700352750ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-entryexport const hiddenNamespace = 'hiddenNamespace'; export const synthHiddenNamespace = { hiddenNamespace: true }; rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-entry/main.js000066400000000000000000000004311450520414700332300ustar00rootroot00000000000000export const main = 'main'; export const synthMain = { main: true }; export * from './noOverride.js'; export * from './override.js'; export * from './hiddenNamespace.js'; export const synthOverride = 'overridden'; export { synthOverride as explicitReexport } from './override.js'; noOverride.js000066400000000000000000000001351450520414700343420ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-entryexport const noOverride = 'noOverride'; export const synthNoOverride = { noOverride: true }; rollup-3.29.4/test/function/samples/synthetic-named-exports/synthetic-named-export-entry/override.js000066400000000000000000000002171450520414700341250ustar00rootroot00000000000000export const override = 'override'; export const synthOverride = { override: true }; export const synthHiddenNamespace = 'hidden in override'; rollup-3.29.4/test/function/samples/tagged-template-deoptimize/000077500000000000000000000000001450520414700246135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/tagged-template-deoptimize/_config.js000066400000000000000000000001441450520414700265540ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly deoptimizes tagged template expressions' }); rollup-3.29.4/test/function/samples/tagged-template-deoptimize/main.js000066400000000000000000000005211450520414700260730ustar00rootroot00000000000000const tagReturn = 'return'; const param = { modified: false }; const obj = { modified: false, tag(_, param) { this.modified = true; param.modified = true; return tagReturn; } }; assert.strictEqual(obj.tag`${param}`, 'return'); assert.ok(obj.modified ? true : false, 'obj'); assert.ok(param.modified ? true : false, 'param'); rollup-3.29.4/test/function/samples/this-not-namespace/000077500000000000000000000000001450520414700230775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/this-not-namespace/_config.js000066400000000000000000000003351450520414700250420ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'does not treat this.foo as a possible namespace (#1258)', exports: exports => { assert.equal(typeof exports.Foo, 'function'); } }); rollup-3.29.4/test/function/samples/this-not-namespace/main.js000066400000000000000000000001111450520414700243520ustar00rootroot00000000000000export class Foo { constructor ( name ) { this.name = undefined; } } rollup-3.29.4/test/function/samples/this-side-effect/000077500000000000000000000000001450520414700225235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/this-side-effect/_config.js000066400000000000000000000001551450520414700244660ustar00rootroot00000000000000module.exports = defineTest({ description: 'detects side effects when mutating "this" in a constructor' }); rollup-3.29.4/test/function/samples/this-side-effect/main.js000066400000000000000000000002621450520414700240050ustar00rootroot00000000000000let effect = false; class Foo { constructor() { Object.defineProperty(this, 'x', { set() { effect = true; } }); this.x = 2; } } new Foo(); assert.ok(effect); rollup-3.29.4/test/function/samples/throws-not-found-module/000077500000000000000000000000001450520414700241205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/throws-not-found-module/_config.js000066400000000000000000000005111450520414700260570ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'throws error if module is not found', error: { code: 'UNRESOLVED_IMPORT', exporter: './mod', id: ID_MAIN, watchFiles: [ID_MAIN], message: 'Could not resolve "./mod" from "main.js"' } }); rollup-3.29.4/test/function/samples/throws-not-found-module/main.js000066400000000000000000000000171450520414700254000ustar00rootroot00000000000000import './mod';rollup-3.29.4/test/function/samples/top-level-arrow-function/000077500000000000000000000000001450520414700242625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/top-level-arrow-function/_config.js000066400000000000000000000001751450520414700262270ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles naked return value from top-level arrow function expression (#403)' }); rollup-3.29.4/test/function/samples/top-level-arrow-function/main.js000066400000000000000000000000571450520414700255460ustar00rootroot00000000000000const f = a => a; assert.equal( f( 42 ), 42 ); rollup-3.29.4/test/function/samples/top-level-block/000077500000000000000000000000001450520414700223775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/top-level-block/_config.js000066400000000000000000000001111450520414700243320ustar00rootroot00000000000000module.exports = defineTest({ description: 'allows top-level block' }); rollup-3.29.4/test/function/samples/top-level-block/main.js000066400000000000000000000000371450520414700236610ustar00rootroot00000000000000{ assert.equal( 1 + 1, 2 ); } rollup-3.29.4/test/function/samples/top-level-side-effect-on-imported/000077500000000000000000000000001450520414700257165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/top-level-side-effect-on-imported/_config.js000066400000000000000000000001311450520414700276530ustar00rootroot00000000000000module.exports = defineTest({ description: 'top level function calls are preserved' }); rollup-3.29.4/test/function/samples/top-level-side-effect-on-imported/lib.js000066400000000000000000000001101450520414700270120ustar00rootroot00000000000000import obj from './obj'; obj.value = 'augmented'; export default obj; rollup-3.29.4/test/function/samples/top-level-side-effect-on-imported/main.js000066400000000000000000000001061450520414700271750ustar00rootroot00000000000000import lib from './lib'; assert.strictEqual(lib.value, 'augmented'); rollup-3.29.4/test/function/samples/top-level-side-effect-on-imported/obj.js000066400000000000000000000000461450520414700270260ustar00rootroot00000000000000export default { value: 'original' }; rollup-3.29.4/test/function/samples/top-level-side-effects-are-preserved/000077500000000000000000000000001450520414700264105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/top-level-side-effects-are-preserved/_config.js000066400000000000000000000001271450520414700303520ustar00rootroot00000000000000module.exports = defineTest({ description: 'top level side effects are preserved' }); rollup-3.29.4/test/function/samples/top-level-side-effects-are-preserved/asap.js000066400000000000000000000000431450520414700276670ustar00rootroot00000000000000export default function asap () {} rollup-3.29.4/test/function/samples/top-level-side-effects-are-preserved/config.js000066400000000000000000000000301450520414700302040ustar00rootroot00000000000000export var config = {}; rollup-3.29.4/test/function/samples/top-level-side-effects-are-preserved/defer.js000066400000000000000000000001321450520414700300270ustar00rootroot00000000000000import { config } from './config'; export default function defer () { config.async(); } rollup-3.29.4/test/function/samples/top-level-side-effects-are-preserved/main.js000066400000000000000000000000521450520414700276670ustar00rootroot00000000000000import { defer } from './rsvp'; defer(); rollup-3.29.4/test/function/samples/top-level-side-effects-are-preserved/rsvp.js000066400000000000000000000002041450520414700277340ustar00rootroot00000000000000import { config } from './config'; import asap from './asap'; import defer from './defer'; config.async = asap; export { defer }; rollup-3.29.4/test/function/samples/trace-inclusion-of-virtual-literals/000077500000000000000000000000001450520414700264025ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/trace-inclusion-of-virtual-literals/_config.js000066400000000000000000000002051450520414700303410ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks the "included" state of virtual literals with regard to mutating oparations' }); rollup-3.29.4/test/function/samples/trace-inclusion-of-virtual-literals/main.js000066400000000000000000000000771450520414700276700ustar00rootroot00000000000000const foo = [].slice(); foo.push(1); assert.equal(foo[0], 1); rollup-3.29.4/test/function/samples/track-async-arrow-function-return-value/000077500000000000000000000000001450520414700272215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-async-arrow-function-return-value/_config.js000066400000000000000000000004511450520414700311630ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'tracks object mutations of async arrow function return values', async exports(exports) { assert.strictEqual(exports.toggled, false); await exports.test(); assert.strictEqual(exports.toggled, true); } }); rollup-3.29.4/test/function/samples/track-async-arrow-function-return-value/main.js000066400000000000000000000004771450520414700305130ustar00rootroot00000000000000const fn = async () => { const obj = { test() { if (typeof obj.testfn === 'function') { obj.testfn(); } } }; return obj; }; export let toggled = false; export const test = async function () { const obj1 = await fn(); const obj2 = await fn(); obj1.testfn = () => (toggled = true); obj1.test(); }; rollup-3.29.4/test/function/samples/track-async-function-return-value/000077500000000000000000000000001450520414700260715ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-async-function-return-value/_config.js000066400000000000000000000004431450520414700300340ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'tracks object mutations of async function return values', async exports(exports) { assert.strictEqual(exports.toggled, false); await exports.test(); assert.strictEqual(exports.toggled, true); } }); rollup-3.29.4/test/function/samples/track-async-function-return-value/main.js000066400000000000000000000004361450520414700273560ustar00rootroot00000000000000async function fn() { const obj = { test() { if (typeof obj.testfn === 'function') { obj.testfn(); } } }; return obj; } export let toggled = false; export const test = async function () { const obj = await fn(); obj.testfn = () => (toggled = true); obj.test(); }; rollup-3.29.4/test/function/samples/track-awaited-object/000077500000000000000000000000001450520414700233645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-awaited-object/_config.js000066400000000000000000000004211450520414700253230ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'tracks object mutations through await', async exports(exports) { assert.strictEqual(exports.toggled, false); await exports.test(); assert.strictEqual(exports.toggled, true); } }); rollup-3.29.4/test/function/samples/track-awaited-object/main.js000066400000000000000000000004301450520414700246430ustar00rootroot00000000000000function fn() { const obj = { test() { if (typeof obj.testfn === 'function') { obj.testfn(); } } }; return obj; } export let toggled = false; export const test = async function () { const obj = await fn(); obj.testfn = () => (toggled = true); obj.test(); }; rollup-3.29.4/test/function/samples/track-conditional-expression-return-reassignments/000077500000000000000000000000001450520414700313775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-conditional-expression-return-reassignments/_config.js000066400000000000000000000001701450520414700333370ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks reassignments of return expressions of conditional expressions' }); rollup-3.29.4/test/function/samples/track-conditional-expression-return-reassignments/main.js000066400000000000000000000004571450520414700326670ustar00rootroot00000000000000const obj1 = { x: false }, obj2 = { x: false }; function foo() { if (Math.random() > 0.5) { return () => obj1; } return () => obj2; } (Math.random() > 0.5 ? () => obj1 : function() { return obj2; })().x = true; if (!(obj1.x || obj2.x)) { throw new Error('Reassignment not tracked'); } rollup-3.29.4/test/function/samples/track-logical-expression-return-reassignments/000077500000000000000000000000001450520414700305065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-logical-expression-return-reassignments/_config.js000066400000000000000000000001641450520414700324510ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks reassignments of return expressions of logical expressions' }); rollup-3.29.4/test/function/samples/track-logical-expression-return-reassignments/main.js000066400000000000000000000002471450520414700317730ustar00rootroot00000000000000const obj1 = { x: false }, obj2 = { x: false }; ((() => obj1) || (() => obj2))().x = true; if (!obj1.x || obj2.x) { throw new Error('Reassignment not tracked'); } rollup-3.29.4/test/function/samples/track-multiple-return-expression-reassignments/000077500000000000000000000000001450520414700307275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-multiple-return-expression-reassignments/_config.js000066400000000000000000000001741450520414700326730ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks reassignments of return expressions of multiple return expressions' }); rollup-3.29.4/test/function/samples/track-multiple-return-expression-reassignments/main.js000066400000000000000000000010371450520414700322120ustar00rootroot00000000000000const obj1 = { x: false }, obj2 = { x: false }; function foo() { if (Math.random() > 0.5) { return function() { return obj1; }; } return function() { return obj2; }; } foo()().x = true; if (!(obj1.x || obj2.x)) { throw new Error('function reassignment not tracked'); } const obj3 = { x: false }, obj4 = { x: false }; const bar = () => { if (Math.random() > 0.5) { return () => obj3; } return () => obj4; }; bar()().x = true; if (!(obj3.x || obj4.x)) { throw new Error('arrow function reassignment not tracked'); } rollup-3.29.4/test/function/samples/track-mutated-in-callback/000077500000000000000000000000001450520414700243035ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-mutated-in-callback/_config.js000066400000000000000000000002631450520414700262460ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of variables in callbacks passed to globals', context: { globalFunction(callback) { callback(true); } } }); rollup-3.29.4/test/function/samples/track-mutated-in-callback/main.js000066400000000000000000000003131450520414700255620ustar00rootroot00000000000000const createCallback = box => newValue => { box[0] = newValue; return box[0]; }; const box = [null]; const callback = createCallback(box); globalFunction(callback); assert.ok(box[0] ? true : false); rollup-3.29.4/test/function/samples/track-parameter-return-reassignments/000077500000000000000000000000001450520414700266575ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-parameter-return-reassignments/_config.js000066400000000000000000000001531450520414700306200ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks reassignments of return expressions of parameters' }); rollup-3.29.4/test/function/samples/track-parameter-return-reassignments/main.js000066400000000000000000000012211450520414700301350ustar00rootroot00000000000000// function function foo(getObj) { getObj().x = true; } const obj1 = { x: false }; foo(function() { return obj1; }); if (!obj1.x) { throw new Error('function parameter reassignment not tracked'); } // // arrow function // const bar = getObj => { // getObj().x = true; // }; // // const obj2 = { x: false }; // foo(() => obj2); // // if (!obj2.x) { // throw new Error('function parameter reassignment not tracked'); // } // // // constructor // function Bar(getObj) { // getObj().x = true; // } // // const obj3 = { x: false }; // new Bar(() => obj3); // // if (!obj3.x) { // throw new Error('constructor parameter reassignment not tracked'); // } rollup-3.29.4/test/function/samples/track-reassigned-object-expression-return-reassignments/000077500000000000000000000000001450520414700324645ustar00rootroot00000000000000_config.js000066400000000000000000000002131450520414700343430ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-reassigned-object-expression-return-reassignmentsmodule.exports = defineTest({ description: 'tracks reassignments of return expressions of members of reassigned object expressions' }); rollup-3.29.4/test/function/samples/track-reassigned-object-expression-return-reassignments/main.js000066400000000000000000000005571450520414700337550ustar00rootroot00000000000000const foo = { foo: false }; const bar = { bar: false }; let obj2 = {}; const obj1 = { foo() {return foo;}, bar: () => bar }; obj2 = obj1; obj2.foo().foo = true; obj2.bar().bar = true; if (!foo.foo) { throw new Error('function return expression was not reassigned'); } if (!bar.bar) { throw new Error('arrow function return expression was not reassigned'); } rollup-3.29.4/test/function/samples/track-reassignments/000077500000000000000000000000001450520414700233645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/track-reassignments/_config.js000066400000000000000000000001271450520414700253260ustar00rootroot00000000000000module.exports = defineTest({ description: 'properly track reassignments (#4468)' }); rollup-3.29.4/test/function/samples/track-reassignments/main.js000066400000000000000000000005071450520414700246500ustar00rootroot00000000000000import { patchEventTarget } from './patchEventTarget.js'; class EventTarget { addEventListener(callback) { callback(); } } global.window = { EventTarget }; let patchCalled = false; patchEventTarget(() => (patchCalled = true)); const target = new EventTarget(); target.addEventListener() assert.ok(patchCalled, 'patch'); rollup-3.29.4/test/function/samples/track-reassignments/patchEventTarget.js000066400000000000000000000003701450520414700271720ustar00rootroot00000000000000export function patchEventTarget(callback) { var proto = window.EventTarget.prototype; var nativeAddEventListener = proto.addEventListener; proto.addEventListener = function () { return nativeAddEventListener(callback); }; return proto; } rollup-3.29.4/test/function/samples/tracks-alias-mutations-b/000077500000000000000000000000001450520414700242165ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/tracks-alias-mutations-b/_config.js000066400000000000000000000003211450520414700261540ustar00rootroot00000000000000const assert = require('node:assert'); const foo = {}; module.exports = defineTest({ description: 'tracks mutations of aliased objects', context: { foo }, exports() { assert.equal(foo.x, 42); } }); rollup-3.29.4/test/function/samples/tracks-alias-mutations-b/main.js000066400000000000000000000000351450520414700254760ustar00rootroot00000000000000var _foo = foo; _foo.x = 42; rollup-3.29.4/test/function/samples/tracks-alias-mutations/000077500000000000000000000000001450520414700237775ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/tracks-alias-mutations/_config.js000066400000000000000000000001261450520414700257400ustar00rootroot00000000000000module.exports = defineTest({ description: 'tracks mutations of aliased objects' }); rollup-3.29.4/test/function/samples/tracks-alias-mutations/bar.js000066400000000000000000000002431450520414700251000ustar00rootroot00000000000000import { foo } from './foo'; var f = Math.random() <= 1 ? foo : {}; var f2; f2 = Math.random() <= 1 ? f : {}; f2.wasMutated = true; export var bar = 'whatever'; rollup-3.29.4/test/function/samples/tracks-alias-mutations/foo.js000066400000000000000000000000251450520414700251150ustar00rootroot00000000000000export var foo = {}; rollup-3.29.4/test/function/samples/tracks-alias-mutations/main.js000066400000000000000000000001301450520414700252530ustar00rootroot00000000000000import { foo } from './foo'; import { bar } from './bar'; assert.ok( foo.wasMutated ); rollup-3.29.4/test/function/samples/transform-empty-string/000077500000000000000000000000001450520414700240535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/transform-empty-string/_config.js000066400000000000000000000006471450520414700260240ustar00rootroot00000000000000const assert = require('node:assert'); const sideEffects = []; module.exports = defineTest({ description: 'allows transformers to transform code to an empty string', context: { sideEffects }, exports() { assert.deepStrictEqual(sideEffects, ['this happens']); }, options: { plugins: { name: 'test-plugin', transform(code, id) { if (id.endsWith('transformed.js')) { return ''; } } } } }); rollup-3.29.4/test/function/samples/transform-empty-string/main.js000066400000000000000000000000761450520414700253400ustar00rootroot00000000000000import './transformed.js'; sideEffects.push('this happens'); rollup-3.29.4/test/function/samples/transform-empty-string/transformed.js000066400000000000000000000000471450520414700267360ustar00rootroot00000000000000sideEffects.push('should not happen'); rollup-3.29.4/test/function/samples/transform-without-code-warn-ast/000077500000000000000000000000001450520414700255565ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/transform-without-code-warn-ast/_config.js000066400000000000000000000006271450520414700275250ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns when returning a map but no code from a transform hook', options: { plugins: { name: 'test-plugin', transform() { return { ast: {} }; } } }, warnings: [ { code: 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', message: 'The plugin "test-plugin" returned a "map" or "ast" without returning a "code". This will be ignored.' } ] }); rollup-3.29.4/test/function/samples/transform-without-code-warn-ast/main.js000066400000000000000000000000231450520414700270330ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/transform-without-code-warn-map/000077500000000000000000000000001450520414700255445ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/transform-without-code-warn-map/_config.js000066400000000000000000000006451450520414700275130ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns when returning a map but no code from a transform hook', options: { plugins: { name: 'test-plugin', transform() { return { map: { mappings: '' } }; } } }, warnings: [ { code: 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', message: 'The plugin "test-plugin" returned a "map" or "ast" without returning a "code". This will be ignored.' } ] }); rollup-3.29.4/test/function/samples/transform-without-code-warn-map/main.js000066400000000000000000000000231450520414700270210ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/transform-without-code/000077500000000000000000000000001450520414700240245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/transform-without-code/_config.js000066400000000000000000000023201450520414700257630ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync } = require('node:fs'); const path = require('node:path'); const { SourceMapConsumer } = require('source-map'); module.exports = defineTest({ description: 'allows using the transform hook for annotations only without returning a code property and breaking sourcemaps', options: { plugins: { name: 'test-plugin', transform() { return { meta: { test: true } }; }, async generateBundle(options, bundle) { const { code, map } = bundle['main.js']; const line = 3; const column = 11; assert.strictEqual(code.split('\n')[line - 1].slice(column, column + 2), '42'); const smc = await new SourceMapConsumer(map); const originalLoc = smc.originalPositionFor({ line, column }); assert.notStrictEqual(originalLoc.line, null); const originalCode = readFileSync(path.join(__dirname, 'main.js'), 'utf8'); assert.strictEqual( originalCode .split('\n') [originalLoc.line - 1].slice(originalLoc.column, originalLoc.column + 2), '42' ); for (const id of this.getModuleIds()) { assert.strictEqual(this.getModuleInfo(id).meta.test, true); } } }, output: { sourcemap: true } } }); rollup-3.29.4/test/function/samples/transform-without-code/main.js000066400000000000000000000000521450520414700253030ustar00rootroot00000000000000const removed = 'foo'; export default 42; rollup-3.29.4/test/function/samples/transform-without-sourcemap-render-chunk/000077500000000000000000000000001450520414700274735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/transform-without-sourcemap-render-chunk/_config.js000066400000000000000000000014171450520414700314400ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves sourcemap chains when transforming', options: { plugins: [ { name: 'fake plugin 1', transform(code) { return code; } }, { name: 'fake plugin 2', transform(code) { return { code, map: null }; }, renderChunk(code) { return { code, map: null }; } } ], output: { sourcemap: true } }, warnings: [ { code: `SOURCEMAP_BROKEN`, plugin: 'fake plugin 1', message: `Sourcemap is likely to be incorrect: a plugin (fake plugin 1) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`, url: `https://rollupjs.org/troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect` } ] }); rollup-3.29.4/test/function/samples/transform-without-sourcemap-render-chunk/main.js000066400000000000000000000000341450520414700307520ustar00rootroot00000000000000assert.strictEqual(42, 42); rollup-3.29.4/test/function/samples/transformer-async/000077500000000000000000000000001450520414700230555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/transformer-async/_config.js000066400000000000000000000005601450520414700250200ustar00rootroot00000000000000module.exports = defineTest({ description: 'transformers can be asynchronous', options: { plugins: [ { transform(code) { return Promise.resolve(code.replace('x', 1)); } }, { transform(code) { return code.replace('1', 2); } }, { transform(code) { return Promise.resolve(code.replace('2', 3)); } } ] } }); rollup-3.29.4/test/function/samples/transformer-async/main.js000066400000000000000000000000261450520414700243350ustar00rootroot00000000000000assert.equal( x, 3 ); rollup-3.29.4/test/function/samples/transformer-multiple/000077500000000000000000000000001450520414700235735ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/transformer-multiple/_config.js000066400000000000000000000006251450520414700255400ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'accepts multiple transformer functions', options: { plugins: [ { transform(code) { return code.replace(/MAGIC_NUMBER/g, 3); } }, { transform(code) { return code.replace(/\d+/g, match => 2 * +match); } } ] }, exports(exports) { assert.equal(exports.magicNumber, 6); } }); rollup-3.29.4/test/function/samples/transformer-multiple/foo.js000066400000000000000000000000351450520414700247120ustar00rootroot00000000000000export default MAGIC_NUMBER; rollup-3.29.4/test/function/samples/transformer-multiple/main.js000066400000000000000000000000701450520414700250520ustar00rootroot00000000000000import foo from './foo'; export var magicNumber = foo; rollup-3.29.4/test/function/samples/transformer-single/000077500000000000000000000000001450520414700232215ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/transformer-single/_config.js000066400000000000000000000004651450520414700251700ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'accepts a single transformer function', options: { plugins: [ { transform(code) { return code.replace(/MAGIC_NUMBER/g, 3); } } ] }, exports(exports) { assert.equal(exports.magicNumber, 3); } }); rollup-3.29.4/test/function/samples/transformer-single/foo.js000066400000000000000000000000351450520414700243400ustar00rootroot00000000000000export default MAGIC_NUMBER; rollup-3.29.4/test/function/samples/transformer-single/main.js000066400000000000000000000000701450520414700245000ustar00rootroot00000000000000import foo from './foo'; export var magicNumber = foo; rollup-3.29.4/test/function/samples/transparent-dynamic-inlining/000077500000000000000000000000001450520414700251705ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/transparent-dynamic-inlining/_config.js000066400000000000000000000005111450520414700271270ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'Dynamic import inlining when resolution id is a module in the bundle', code(code) { assert.ok(!code.includes('import(')); assert.ok(code.includes('Promise.resolve(')); }, exports(exports) { assert.deepEqual(exports, { y: 42 }); } }); rollup-3.29.4/test/function/samples/transparent-dynamic-inlining/foo.js000066400000000000000000000002401450520414700263050ustar00rootroot00000000000000export var x = 42; import('./main').then(x => { const expected = { y: 42 }; Object.setPrototypeOf(expected, null); assert.deepStrictEqual(x, expected); }); rollup-3.29.4/test/function/samples/transparent-dynamic-inlining/main.js000066400000000000000000000000401450520414700264440ustar00rootroot00000000000000export { x as y } from './foo'; rollup-3.29.4/test/function/samples/tree-shake-deterministic-dynamic-import/000077500000000000000000000000001450520414700272235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/tree-shake-deterministic-dynamic-import/_config.js000066400000000000000000000017141450520414700311700ustar00rootroot00000000000000module.exports = { description: 'treeshakes dynamic imports when the target is deterministic', options: { output: { inlineDynamicImports: true }, plugins: [ { resolveId(id) { if (/(bail|effect)-(\d+).js$/.test(id)) { return id; } return null; }, load(id) { const match = /(bail|effect)-(\d+).js$/.exec(id); if (match) { if (match[1] === 'bail') return { code: [ `export default '@included-bail-${match[2]}'`, `export const named${match[2]} = 'bail${match[2]}';` ].join('\n') }; else if (match[1] === 'effect') { return { code: [ 'export function fn() { /* @tree-shaken */ }', `console.log('@included-effect-${match[2]}');` ].join('\n') }; } } return null; } } ] }, async exports({ allExports }) { await allExports(); }, context: { named1: 'named1', named4: 'named4' } }; rollup-3.29.4/test/function/samples/tree-shake-deterministic-dynamic-import/main.js000066400000000000000000000012341450520414700305050ustar00rootroot00000000000000export const allExports = () => Promise.all([ (async () => { const value = (await import('./bail-1.js'))[named1] assert.strictEqual(value, 'bail1'); })(), (async () => { const fn = (exports) => { assert.deepEqual(exports, { named2: 'bail2', default: '@included-bail-2' }); } await import('./bail-2.js').then(fn) })(), (async () => { await import('./bail-3.js').then(({ default: _, ...args }) => { assert.deepEqual(args, { named3: 'bail3' }); }) })(), (async () => { const { [named4]: value } = await import('./bail-4.js') assert.strictEqual(value, 'bail4'); })(), ]); rollup-3.29.4/test/function/samples/tree-shake-iterable/000077500000000000000000000000001450520414700232155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/tree-shake-iterable/_config.js000066400000000000000000000001611450520414700251550ustar00rootroot00000000000000module.exports = { description: 'retain functions that accept a iterable that has side effects on iteration' }; rollup-3.29.4/test/function/samples/tree-shake-iterable/main.js000066400000000000000000000011561450520414700245020ustar00rootroot00000000000000let effects = 0; const iterable = { [Symbol.iterator]() { return { next() { effects++; return { done: true }; } }; } }; new Map(iterable); new Set(iterable); new WeakMap(iterable); new WeakSet(iterable); Array.from(iterable); BigInt64Array.from(iterable); BigUint64Array.from(iterable); Float32Array.from(iterable); Float64Array.from(iterable); Int16Array.from(iterable); Int32Array.from(iterable); Int8Array.from(iterable); Uint16Array.from(iterable); Uint32Array.from(iterable); Uint8Array.from(iterable); Uint8ClampedArray.from(iterable); Object.fromEntries(iterable); assert.equal(effects, 17); rollup-3.29.4/test/function/samples/tree-shake-object-expression-assignment/000077500000000000000000000000001450520414700272375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/tree-shake-object-expression-assignment/_config.js000066400000000000000000000002201450520414700311730ustar00rootroot00000000000000module.exports = defineTest({ description: 'renders valid code when the target of an object expression with side-effects is tree-shaken' }); rollup-3.29.4/test/function/samples/tree-shake-object-expression-assignment/main.js000066400000000000000000000001721450520414700305210ustar00rootroot00000000000000const result = {}; let foo; foo = { [(result.x = 1)]: (result.y = 2) }; assert.deepStrictEqual(result, { x: 1, y: 2 }); rollup-3.29.4/test/function/samples/tree-shake-variable-declarations-2/000077500000000000000000000000001450520414700260205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/tree-shake-variable-declarations-2/_config.js000066400000000000000000000003171450520414700277630ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'remove unused variables from declarations (#1831)', code(code) { assert.ok(code.search(/var a = 'test'/) >= 0); } }); rollup-3.29.4/test/function/samples/tree-shake-variable-declarations-2/main.js000066400000000000000000000002241450520414700273000ustar00rootroot00000000000000class Test { constructor() { var testFn = function test(){}, //not used a = 'test'; // testFn(); console.log(a) } } export default Test rollup-3.29.4/test/function/samples/tree-shake-variable-declarations/000077500000000000000000000000001450520414700256615ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/tree-shake-variable-declarations/_config.js000066400000000000000000000003131450520414700276200ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'remove unused variables from declarations (#1937)', exports(exports) { assert.deepEqual(exports(), [0.07]); } }); rollup-3.29.4/test/function/samples/tree-shake-variable-declarations/main.js000066400000000000000000000003441450520414700271440ustar00rootroot00000000000000const FONT_HINGE_SIZE = 0.07; const BACK_HINGE_SIZE = 0.16; function PointerGauge () { const backHinge = BACK_HINGE_SIZE, fontHinge = FONT_HINGE_SIZE; return [ //backHinge, fontHinge ] } export default PointerGauge; rollup-3.29.4/test/function/samples/trim-conditional-branches-in-exports/000077500000000000000000000000001450520414700265455ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/trim-conditional-branches-in-exports/_config.js000066400000000000000000000001531450520414700305060ustar00rootroot00000000000000module.exports = defineTest({ description: 'trims conditional branches with a renamed default export' }); rollup-3.29.4/test/function/samples/trim-conditional-branches-in-exports/foo.js000066400000000000000000000000751450520414700276700ustar00rootroot00000000000000var foo = 0; export default Math.random() < 0.5 ? foo : foo; rollup-3.29.4/test/function/samples/trim-conditional-branches-in-exports/main.js000066400000000000000000000001131450520414700300220ustar00rootroot00000000000000import foo from './foo.js'; assert.equal(true ? (false ? foo : 0) : 1, 0); rollup-3.29.4/test/function/samples/try-catch-scoping/000077500000000000000000000000001450520414700227365ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/try-catch-scoping/_config.js000066400000000000000000000001461450520414700247010ustar00rootroot00000000000000module.exports = defineTest({ description: 'error parameter in catch clause is correctly scoped' }); rollup-3.29.4/test/function/samples/try-catch-scoping/foo.js000066400000000000000000000001431450520414700240550ustar00rootroot00000000000000export default function foo () { try { return 42; } catch ( err ) { console.log( err ); } } rollup-3.29.4/test/function/samples/try-catch-scoping/main.js000066400000000000000000000000631450520414700242170ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 42 );rollup-3.29.4/test/function/samples/unknown-for-loop-variables/000077500000000000000000000000001450520414700246005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unknown-for-loop-variables/_config.js000066400000000000000000000001441450520414700265410ustar00rootroot00000000000000module.exports = defineTest({ description: 'treat for-in and for-of loop variables as unknown' }); rollup-3.29.4/test/function/samples/unknown-for-loop-variables/main.js000066400000000000000000000005011450520414700260560ustar00rootroot00000000000000for (const name in {present: true}) { if (name !== 'present') { throw new Error('Always false for-in check was inlined'); } assert.equal(name, 'present'); } for (const name of ['present']) { if (name !== 'present') { throw new Error('Always false for-of check was inlined'); } assert.equal(name, 'present'); } rollup-3.29.4/test/function/samples/unknown-generated-code-preset/000077500000000000000000000000001450520414700252435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unknown-generated-code-preset/_config.js000066400000000000000000000007331450520414700272100ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for unknown presets for the generatedCode option', options: { output: { generatedCode: { // @ts-expect-error expected error preset: 'some-string' } } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value "some-string" for option "output.generatedCode.preset" - valid values are "es2015" and "es5".', url: 'https://rollupjs.org/configuration-options/#output-generatedcode' } }); rollup-3.29.4/test/function/samples/unknown-generated-code-preset/main.js000066400000000000000000000000411450520414700265200ustar00rootroot00000000000000throw new Error('not executed'); rollup-3.29.4/test/function/samples/unknown-generated-code-value/000077500000000000000000000000001450520414700250555ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unknown-generated-code-value/_config.js000066400000000000000000000010031450520414700270110ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for unknown string values for the generatedCode option', options: { output: { // @ts-expect-error expected error generatedCode: 'some-string' } }, generateError: { code: 'INVALID_OPTION', message: 'Invalid value "some-string" for option "output.generatedCode" - valid values are "es2015" and "es5". You can also supply an object for more fine-grained control.', url: 'https://rollupjs.org/configuration-options/#output-generatedcode' } }); rollup-3.29.4/test/function/samples/unknown-generated-code-value/main.js000066400000000000000000000000411450520414700263320ustar00rootroot00000000000000throw new Error('not executed'); rollup-3.29.4/test/function/samples/unknown-global-side-effects/000077500000000000000000000000001450520414700246745ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unknown-global-side-effects/_config.js000066400000000000000000000005041450520414700266350ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not omit side-effects from unknown globals', exports(exports) { let error; try { exports.max(1, 2); } catch (error_) { error = error_; } if (!(error instanceof ReferenceError)) { throw new TypeError('Expected a ReferenceError to be thrown.'); } } }); rollup-3.29.4/test/function/samples/unknown-global-side-effects/main.js000066400000000000000000000001631450520414700261560ustar00rootroot00000000000000function myMax(a, b) { return Math.max(a, b); } export function max(a, b) { return myMax(a, b, doesNotExist); } rollup-3.29.4/test/function/samples/unknown-statement/000077500000000000000000000000001450520414700231015ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unknown-statement/_config.js000066400000000000000000000001151450520414700250400ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles unknown statements' }); rollup-3.29.4/test/function/samples/unknown-statement/main.js000066400000000000000000000000561450520414700243640ustar00rootroot00000000000000debugger; if (true) debugger; else debugger; rollup-3.29.4/test/function/samples/unknown-treeshake-preset/000077500000000000000000000000001450520414700243505ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unknown-treeshake-preset/_config.js000066400000000000000000000006651450520414700263210ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for unknown presets for the treeshake option', options: { treeshake: { // @ts-expect-error expected error preset: 'some-string' } }, error: { code: 'INVALID_OPTION', message: 'Invalid value "some-string" for option "treeshake.preset" - valid values are "recommended", "safest" and "smallest".', url: 'https://rollupjs.org/configuration-options/#treeshake' } }); rollup-3.29.4/test/function/samples/unknown-treeshake-preset/main.js000066400000000000000000000000411450520414700256250ustar00rootroot00000000000000throw new Error('not executed'); rollup-3.29.4/test/function/samples/unknown-treeshake-value/000077500000000000000000000000001450520414700241625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unknown-treeshake-value/_config.js000066400000000000000000000007541450520414700261320ustar00rootroot00000000000000module.exports = defineTest({ description: 'throws for unknown string values for the treeshake option', options: { // @ts-expect-error expected error treeshake: 'some-string' }, error: { code: 'INVALID_OPTION', message: 'Invalid value "some-string" for option "treeshake" - valid values are false, true, "recommended", "safest" and "smallest". You can also supply an object for more fine-grained control.', url: 'https://rollupjs.org/configuration-options/#treeshake' } }); rollup-3.29.4/test/function/samples/unknown-treeshake-value/main.js000066400000000000000000000000411450520414700254370ustar00rootroot00000000000000throw new Error('not executed'); rollup-3.29.4/test/function/samples/unused-constructor-argument-fallback/000077500000000000000000000000001450520414700266435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-constructor-argument-fallback/_config.js000066400000000000000000000003441450520414700306060ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'handles unused logical expressions as constructor arguments (#4517)', exports({ create }) { assert.strictEqual(create().foo, 'foo'); } }); rollup-3.29.4/test/function/samples/unused-constructor-argument-fallback/main.js000066400000000000000000000001471450520414700301270ustar00rootroot00000000000000function Note() { this.foo = 'foo'; } export function create(data) { return new Note(data || {}); } rollup-3.29.4/test/function/samples/unused-do-while-loop-declaration/000077500000000000000000000000001450520414700256435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-do-while-loop-declaration/_config.js000066400000000000000000000002201450520414700275770ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not partially tree-shake unused declarations with side-effects in do-while loop bodies' }); rollup-3.29.4/test/function/samples/unused-do-while-loop-declaration/main.js000066400000000000000000000002271450520414700271260ustar00rootroot00000000000000let result = 3; var b = 3; do var b = b - 1, unused = result--, unused2 = 0; while (b > 0); assert.strictEqual(b, 0); assert.strictEqual(result, 0); rollup-3.29.4/test/function/samples/unused-for-in-loop-declaration/000077500000000000000000000000001450520414700253255ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-for-in-loop-declaration/_config.js000066400000000000000000000002161450520414700272660ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not partially tree-shake unused declarations with side-effects in for-in loop bodies' }); rollup-3.29.4/test/function/samples/unused-for-in-loop-declaration/main.js000066400000000000000000000002451450520414700266100ustar00rootroot00000000000000let result = 3; var b = 3; for (var x in {foo: 1, bar: 2}) var b = b - 1, unused = result--, unused2 = 0; assert.strictEqual(b, 1); assert.strictEqual(result, 1); rollup-3.29.4/test/function/samples/unused-for-loop-body-declaration/000077500000000000000000000000001450520414700256545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-for-loop-body-declaration/_config.js000066400000000000000000000002131450520414700276120ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not partially tree-shake unused declarations with side-effects in for loop bodies' }); rollup-3.29.4/test/function/samples/unused-for-loop-body-declaration/main.js000066400000000000000000000002051450520414700271330ustar00rootroot00000000000000let result = 3; for (var a = 0; a < 3; a++) var b = a, unused = result--; assert.strictEqual(b, 2); assert.strictEqual(result, 0); rollup-3.29.4/test/function/samples/unused-for-loop-init-declaration/000077500000000000000000000000001450520414700256625ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-for-loop-init-declaration/_config.js000066400000000000000000000002031450520414700276170ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not partially tree-shake unused declarations with side-effects in for loops' }); rollup-3.29.4/test/function/samples/unused-for-loop-init-declaration/main.js000066400000000000000000000003051450520414700271420ustar00rootroot00000000000000let result; let reassigned; for (var a = (reassigned = 'reassigned'), b = 0, unused = 3; b < 2; b++) { result = b; } assert.strictEqual(result, 1); assert.strictEqual(reassigned, 'reassigned'); rollup-3.29.4/test/function/samples/unused-for-of-loop-declaration/000077500000000000000000000000001450520414700253235ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-for-of-loop-declaration/_config.js000066400000000000000000000002161450520414700272640ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not partially tree-shake unused declarations with side-effects in for-of loop bodies' }); rollup-3.29.4/test/function/samples/unused-for-of-loop-declaration/main.js000066400000000000000000000002331450520414700266030ustar00rootroot00000000000000let result = 3; var b = 3; for (var x of [1, 2]) var b = b - 1, unused = result--, unused2 = 0; assert.strictEqual(b, 1); assert.strictEqual(result, 1); rollup-3.29.4/test/function/samples/unused-if-statement-declaration/000077500000000000000000000000001450520414700255645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-if-statement-declaration/_config.js000066400000000000000000000002031450520414700275210ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not partially tree-shake unused declarations with side-effects in for loops' }); rollup-3.29.4/test/function/samples/unused-if-statement-declaration/main.js000066400000000000000000000005031450520414700270440ustar00rootroot00000000000000let result; export function testStatement(condition) { if (condition) var a = 1, b = result = 1, unused1 = 3; else var a = 2, c = result = 2, unused2 = 3; return a; } assert.strictEqual(testStatement(true), 1); assert.strictEqual(result, 1); assert.strictEqual(testStatement(false), 2); assert.strictEqual(result, 2); rollup-3.29.4/test/function/samples/unused-import/000077500000000000000000000000001450520414700222135ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-import/_config.js000066400000000000000000000010031450520414700241470ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'warns on unused imports ([#595])', options: { external: ['external'] }, context: { require() { return {}; } }, warnings: [ { code: 'UNUSED_EXTERNAL_IMPORT', exporter: 'external', ids: [ID_MAIN], message: '"notused" and "neverused" are imported from external module "external" but never used in "main.js".', names: ['notused', 'neverused'] } ] }); rollup-3.29.4/test/function/samples/unused-import/main.js000066400000000000000000000001541450520414700234750ustar00rootroot00000000000000import { unused, notused, neverused as willnotuse } from 'external'; function alsoUnused () { unused(); } rollup-3.29.4/test/function/samples/unused-parameter-side-effects/000077500000000000000000000000001450520414700252205ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-parameter-side-effects/_config.js000066400000000000000000000002051450520414700271570ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not tree-shake arguments where the corresponding parameters have side-effects' }); rollup-3.29.4/test/function/samples/unused-parameter-side-effects/main.js000066400000000000000000000001741450520414700265040ustar00rootroot00000000000000let sideEffects = 0; function destructured({}) { sideEffects++; } destructured({}); assert.strictEqual(sideEffects, 1); rollup-3.29.4/test/function/samples/unused-parenthesed-assignment/000077500000000000000000000000001450520414700253515ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-parenthesed-assignment/_config.js000066400000000000000000000002571450520414700273170ustar00rootroot00000000000000module.exports = defineTest({ description: 'correctly simplifies assignments with right-hand-sides in parentheses (#3924)', context: { someObject: { isTrue: true } } }); rollup-3.29.4/test/function/samples/unused-parenthesed-assignment/main.js000066400000000000000000000000731450520414700266330ustar00rootroot00000000000000let unused = false; unused = (someObject.isTrue === true); rollup-3.29.4/test/function/samples/unused-var-a/000077500000000000000000000000001450520414700217075ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-var-a/_config.js000066400000000000000000000001231450520414700236450ustar00rootroot00000000000000module.exports = defineTest({ description: 'omits unused var declaration (a)' }); rollup-3.29.4/test/function/samples/unused-var-a/foo.js000066400000000000000000000001061450520414700230250ustar00rootroot00000000000000var unused = 'unused', foo = 'foo', bar = 'bar'; export { foo, bar }; rollup-3.29.4/test/function/samples/unused-var-a/main.js000066400000000000000000000001331450520414700231660ustar00rootroot00000000000000import { foo, bar } from './foo'; assert.equal( foo, 'foo' ); assert.equal( bar, 'bar' ); rollup-3.29.4/test/function/samples/unused-var-b/000077500000000000000000000000001450520414700217105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-var-b/_config.js000066400000000000000000000001231450520414700236460ustar00rootroot00000000000000module.exports = defineTest({ description: 'omits unused var declaration (b)' }); rollup-3.29.4/test/function/samples/unused-var-b/foo.js000066400000000000000000000001061450520414700230260ustar00rootroot00000000000000var foo = 'foo', unused = 'unused', bar = 'bar'; export { foo, bar }; rollup-3.29.4/test/function/samples/unused-var-b/main.js000066400000000000000000000001331450520414700231670ustar00rootroot00000000000000import { foo, bar } from './foo'; assert.equal( foo, 'foo' ); assert.equal( bar, 'bar' ); rollup-3.29.4/test/function/samples/unused-var-c/000077500000000000000000000000001450520414700217115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-var-c/_config.js000066400000000000000000000001231450520414700236470ustar00rootroot00000000000000module.exports = defineTest({ description: 'omits unused var declaration (c)' }); rollup-3.29.4/test/function/samples/unused-var-c/foo.js000066400000000000000000000001061450520414700230270ustar00rootroot00000000000000var foo = 'foo', bar = 'bar', unused = 'unused'; export { foo, bar }; rollup-3.29.4/test/function/samples/unused-var-c/main.js000066400000000000000000000001331450520414700231700ustar00rootroot00000000000000import { foo, bar } from './foo'; assert.equal( foo, 'foo' ); assert.equal( bar, 'bar' ); rollup-3.29.4/test/function/samples/unused-var-d/000077500000000000000000000000001450520414700217125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-var-d/_config.js000066400000000000000000000001231450520414700236500ustar00rootroot00000000000000module.exports = defineTest({ description: 'omits unused var declaration (d)' }); rollup-3.29.4/test/function/samples/unused-var-d/foo.js000066400000000000000000000001541450520414700230330ustar00rootroot00000000000000var unused_a = 'a', unused_b = 'b'; var unused_c = 'c'; var foo = 'foo', bar = 'bar'; export { foo, bar }; rollup-3.29.4/test/function/samples/unused-var-d/main.js000066400000000000000000000001331450520414700231710ustar00rootroot00000000000000import { foo, bar } from './foo'; assert.equal( foo, 'foo' ); assert.equal( bar, 'bar' ); rollup-3.29.4/test/function/samples/unused-while-loop-declaration/000077500000000000000000000000001450520414700252435ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/unused-while-loop-declaration/_config.js000066400000000000000000000002151450520414700272030ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not partially tree-shake unused declarations with side-effects in while loop bodies' }); rollup-3.29.4/test/function/samples/unused-while-loop-declaration/main.js000066400000000000000000000002231450520414700265220ustar00rootroot00000000000000let result = 3; var b = 3; while (b > 0) var b = b - 1, unused = result--, unused2 = 0; assert.strictEqual(b, 0); assert.strictEqual(result, 0); rollup-3.29.4/test/function/samples/update-expression-accessors/000077500000000000000000000000001450520414700250425ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/update-expression-accessors/_config.js000066400000000000000000000001631450520414700270040ustar00rootroot00000000000000module.exports = defineTest({ description: 'deoptimizes "this" for accessors triggered by update expressions' }); rollup-3.29.4/test/function/samples/update-expression-accessors/main.js000066400000000000000000000003501450520414700263220ustar00rootroot00000000000000const obj = { getter: false, setter: false, get foo() { this.getter = true; return 0; }, set foo(value) { this.setter = true; } }; obj.foo++; assert.ok(obj.getter ? true : false); assert.ok(obj.setter ? true : false); rollup-3.29.4/test/function/samples/update-expression-of-import-fails/000077500000000000000000000000001450520414700260655ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/update-expression-of-import-fails/_config.js000066400000000000000000000012051450520414700300250ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'disallows updates to imported bindings', error: { code: 'ILLEGAL_REASSIGNMENT', id: ID_MAIN, pos: 28, loc: { column: 0, file: ID_MAIN, line: 3 }, frame: ` 1: import { a } from './foo'; 2: 3: a++; ^`, watchFiles: [ID_FOO, ID_MAIN], message: 'Illegal reassignment of import "a" in "main.js".' } }); // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/update-expression-of-import-fails rollup-3.29.4/test/function/samples/update-expression-of-import-fails/foo.js000066400000000000000000000000221450520414700272000ustar00rootroot00000000000000export var a = 0; rollup-3.29.4/test/function/samples/update-expression-of-import-fails/main.js000066400000000000000000000000411450520414700273420ustar00rootroot00000000000000import { a } from './foo'; a++; rollup-3.29.4/test/function/samples/use-class-name-in-static-block/000077500000000000000000000000001450520414700251765ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/use-class-name-in-static-block/_config.js000066400000000000000000000002071450520414700271370ustar00rootroot00000000000000module.exports = defineTest({ description: 'use the original class name instead of renderName in class body', minNodeVersion: 16 }); rollup-3.29.4/test/function/samples/use-class-name-in-static-block/main.js000066400000000000000000000001751450520414700264630ustar00rootroot00000000000000import { Test } from './test1.js'; import { Test as Test2 } from './test2.js'; assert.ok(Test.test); assert.ok(Test2.test); rollup-3.29.4/test/function/samples/use-class-name-in-static-block/test1.js000066400000000000000000000003161450520414700265740ustar00rootroot00000000000000export class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test1'; static { assert.ok(Test.test); new Test(); } } rollup-3.29.4/test/function/samples/use-class-name-in-static-block/test2.js000066400000000000000000000003161450520414700265750ustar00rootroot00000000000000export class Test { constructor() { assert.ok(Test.test); assert.ok(this.getText()); } getText() { return Test.test; } static test = 'Test2'; static { assert.ok(Test.test); new Test(); } } rollup-3.29.4/test/function/samples/use-var-before-decl/000077500000000000000000000000001450520414700231275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/use-var-before-decl/_config.js000066400000000000000000000001451450520414700250710ustar00rootroot00000000000000module.exports = defineTest({ description: 'exercise `var` variables before their declarations' }); rollup-3.29.4/test/function/samples/use-var-before-decl/main.js000066400000000000000000000016111450520414700244100ustar00rootroot00000000000000var results = [], log = x => results.push(x); (function () { var a = "PASS1"; for (var b = 2; --b >= 0; ) { (function() { var c = function() { return 1; }(c && (a = "FAIL1")); })(); } log(a); })(); log(a ? "FAIL2" : "PASS2"); var a = 1; var b = 2; log(b ? "PASS3" : "FAIL3"); log(c ? "FAIL4" : "PASS4"); var c = 3; log(c ? "PASS5" : "FAIL5"); log(function() { if (x) return "FAIL6"; var x = 1; return "PASS6"; }()); (function () { var first = state(); var on = true; var obj = { state: state }; log(first) log(obj.state()); function state() { return on ? "ON" : "OFF"; } })(); (function () { var flag = false; function foo() { if (flag) { if (!value) log(flag + "1"); } var value = true; log(flag + "2"); } foo(); flag = true; foo(); })(); assert.strictEqual(results.join(" "), "PASS1 PASS2 PASS3 PASS4 PASS5 PASS6 OFF ON false2 true1 true2"); rollup-3.29.4/test/function/samples/uses-supplied-ast/000077500000000000000000000000001450520414700227675ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/uses-supplied-ast/_config.js000066400000000000000000000015641450520414700247370ustar00rootroot00000000000000const acorn = require('acorn'); const modules = { main: "import foo from 'foo';\nfoo();", // the code points to './bar' but the AST points to './baz', so we // can check the AST is being used foo: { code: "import bar from 'bar';\nexport default function foo () {\n\tassert.equal(bar, 42);\n}", ast: acorn.parse( "import bar from 'baz';\nexport default function foo () {\n\tassert.equal(bar, 42);\n}", { ecmaVersion: 6, sourceType: 'module' } ) }, baz: 'export default 42;' }; modules.foo.ast._ignoredProp = {}; module.exports = defineTest({ description: 'uses supplied AST', options: { plugins: [ { resolveId(importee, importer) { if (!importer) return 'main'; return importee; }, load(id) { if (id === 'bar') { throw new Error('loaded incorrect module'); } return modules[id]; } } ] } }); rollup-3.29.4/test/function/samples/validate-output/000077500000000000000000000000001450520414700225275ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/validate-output/_config.js000066400000000000000000000006621450520414700244750ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles validate failure', options: { onLog(_level, log) { throw log; }, output: { outro: '/*', validate: true } }, generateError: { code: 'CHUNK_INVALID', message: 'Chunk "main.js" is not valid JavaScript: Unterminated comment (5:0).', frame: ` 3: throw new Error('Not executed'); 4: 5: /* ^`, loc: { column: 0, file: 'main.js', line: 5 } } }); rollup-3.29.4/test/function/samples/validate-output/main.js000066400000000000000000000000411450520414700240040ustar00rootroot00000000000000throw new Error('Not executed'); rollup-3.29.4/test/function/samples/validate-resolved-by-logic/000077500000000000000000000000001450520414700245155ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/validate-resolved-by-logic/_config.js000066400000000000000000000023101450520414700264530ustar00rootroot00000000000000const assert = require('node:assert'); const { resolve } = require('node:path'); const FOO_IMPORTED_PATH = './foo.js'; const BAR_IMPORTED_PATH = './bar.js'; const OTHER_IMPORTED_PATH = './other.js'; const MAIN_PATH = resolve(__dirname, 'main.js'); module.exports = defineTest({ description: 'validate resolvedBy logic', options: { plugins: [ { name: 'plugin1', async resolveId(id) { if (id === FOO_IMPORTED_PATH) { return id; } } }, { name: 'plugin2', async resolveId(id) { if (id === BAR_IMPORTED_PATH) { return { id, resolvedBy: 'barByPlugin2' }; } } }, { name: 'plugin3', async buildEnd() { const [resolvedFooId, resolvedBarId, resolvedOtherId, resolvedMainId] = await Promise.all( [ this.resolve(FOO_IMPORTED_PATH), this.resolve(BAR_IMPORTED_PATH), this.resolve(OTHER_IMPORTED_PATH), this.resolve(MAIN_PATH) ] ); assert.equal(resolvedFooId.resolvedBy, 'plugin1'); assert.equal(resolvedBarId.resolvedBy, 'barByPlugin2'); assert.equal(resolvedOtherId.resolvedBy, 'rollup'); assert.equal(resolvedMainId.resolvedBy, 'rollup'); } } ] } }); rollup-3.29.4/test/function/samples/validate-resolved-by-logic/bar.js000066400000000000000000000000221450520414700256110ustar00rootroot00000000000000export default 1; rollup-3.29.4/test/function/samples/validate-resolved-by-logic/foo.js000066400000000000000000000000221450520414700256300ustar00rootroot00000000000000export default 1; rollup-3.29.4/test/function/samples/validate-resolved-by-logic/main.js000066400000000000000000000001731450520414700260000ustar00rootroot00000000000000import bar from './bar.js'; import foo from './foo.js'; import other from './other.js'; export default bar + foo + other; rollup-3.29.4/test/function/samples/validate-resolved-by-logic/other.js000066400000000000000000000000221450520414700261660ustar00rootroot00000000000000export default 1; rollup-3.29.4/test/function/samples/vars-in-for-loop-head/000077500000000000000000000000001450520414700234115ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/vars-in-for-loop-head/_config.js000066400000000000000000000001351450520414700253520ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not break apart vars in for loop head' }); rollup-3.29.4/test/function/samples/vars-in-for-loop-head/main.js000066400000000000000000000003451450520414700246750ustar00rootroot00000000000000function clone ( things ) { var result = []; for ( var i = 0, list = things; i < list.length; i += 1 ) { var thing = list[i]; result.push( thing ); } return result; } assert.deepEqual( clone([ 1, 2, 3 ]), [ 1, 2, 3 ] ); rollup-3.29.4/test/function/samples/vars-not-removed-in-if-block/000077500000000000000000000000001450520414700247005ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/vars-not-removed-in-if-block/_config.js000066400000000000000000000001421450520414700266370ustar00rootroot00000000000000module.exports = defineTest({ description: 'preserves var declarations in if blocks (#1113)' }); rollup-3.29.4/test/function/samples/vars-not-removed-in-if-block/main.js000066400000000000000000000001261450520414700261610ustar00rootroot00000000000000if ( Math.random() <= 1 ) { var x = 1; } else { var x = 2; } assert.equal( x, 1 ); rollup-3.29.4/test/function/samples/vars-not-removed/000077500000000000000000000000001450520414700226105ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/vars-not-removed/_config.js000066400000000000000000000001541450520414700245520ustar00rootroot00000000000000module.exports = defineTest({ description: 'does not erroneously remove var/let/const keywords (#390)' }); rollup-3.29.4/test/function/samples/vars-not-removed/bar.js000066400000000000000000000000551450520414700237120ustar00rootroot00000000000000var a = 2, b = 3; assert.equal( a + b, 5 ); rollup-3.29.4/test/function/samples/vars-not-removed/foo.js000066400000000000000000000000551450520414700237310ustar00rootroot00000000000000var a = 1, b = 2; assert.equal( a + b, 3 ); rollup-3.29.4/test/function/samples/vars-not-removed/main.js000066400000000000000000000000461450520414700240720ustar00rootroot00000000000000import './foo.js'; import './bar.js'; rollup-3.29.4/test/function/samples/vars-with-init-in-dead-branch/000077500000000000000000000000001450520414700250175ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/vars-with-init-in-dead-branch/_config.js000066400000000000000000000003261450520414700267620ustar00rootroot00000000000000module.exports = defineTest({ description: 'handles vars with init in dead branch (#1198)', warnings: [ { code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "main".', names: ['main'] } ] }); rollup-3.29.4/test/function/samples/vars-with-init-in-dead-branch/main.js000066400000000000000000000000761450520414700263040ustar00rootroot00000000000000if ( false ) { var foo = []; var bar = foo.concat( 'x' ); } rollup-3.29.4/test/function/samples/warn-missing-iife-name/000077500000000000000000000000001450520414700236465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warn-missing-iife-name/_config.js000066400000000000000000000006131450520414700256100ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns if no name is provided for an IIFE bundle', options: { output: { format: 'iife' } }, warnings: [ { code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', message: 'If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.', url: 'https://rollupjs.org/configuration-options/#output-name' } ] }); rollup-3.29.4/test/function/samples/warn-missing-iife-name/main.js000066400000000000000000000000251450520414700251250ustar00rootroot00000000000000export const x = 42; rollup-3.29.4/test/function/samples/warn-on-auto-named-default-exports/000077500000000000000000000000001450520414700261355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warn-on-auto-named-default-exports/_config.js000066400000000000000000000011161450520414700300760ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'warns if default and named exports are used in auto mode', warnings: [ { code: 'MIXED_EXPORTS', id: ID_MAIN, message: 'Entry module "main.js" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.', url: 'https://rollupjs.org/configuration-options/#output-exports' } ] }); rollup-3.29.4/test/function/samples/warn-on-auto-named-default-exports/main.js000066400000000000000000000001741450520414700274210ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } export default foo; export { bar }; rollup-3.29.4/test/function/samples/warn-on-empty-bundle/000077500000000000000000000000001450520414700233645ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warn-on-empty-bundle/_config.js000066400000000000000000000003231450520414700253240ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns if empty bundle is generated (#444)', warnings: [ { code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "main".', names: ['main'] } ] }); rollup-3.29.4/test/function/samples/warn-on-empty-bundle/main.js000066400000000000000000000000341450520414700246430ustar00rootroot00000000000000function noop () {} noop(); rollup-3.29.4/test/function/samples/warn-on-eval/000077500000000000000000000000001450520414700217065ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warn-on-eval/_config.js000066400000000000000000000010621450520414700236470ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'warns about use of eval', warnings: [ { code: 'EVAL', id: ID_MAIN, message: 'Use of eval in "main.js" is strongly discouraged as it poses security risks and may cause issues with minification.', url: 'https://rollupjs.org/troubleshooting/#avoiding-eval', pos: 13, loc: { column: 13, file: ID_MAIN, line: 1 }, frame: ` 1: var result = eval( '1 + 1' ); ^` } ] }); rollup-3.29.4/test/function/samples/warn-on-eval/main.js000066400000000000000000000000361450520414700231670ustar00rootroot00000000000000var result = eval( '1 + 1' ); rollup-3.29.4/test/function/samples/warn-on-namespace-conflict/000077500000000000000000000000001450520414700245125ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warn-on-namespace-conflict/_config.js000066400000000000000000000010111450520414700264450ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); const ID_BAR = path.join(__dirname, 'bar.js'); module.exports = defineTest({ description: 'warns on duplicate export * from', warnings: [ { binding: 'foo', code: 'NAMESPACE_CONFLICT', ids: [ID_FOO, ID_BAR], message: 'Conflicting namespaces: "main.js" re-exports "foo" from one of the modules "foo.js" and "bar.js" (will be ignored).', reexporter: ID_MAIN } ] }); rollup-3.29.4/test/function/samples/warn-on-namespace-conflict/bar.js000066400000000000000000000000321450520414700256070ustar00rootroot00000000000000export * from './deep.js';rollup-3.29.4/test/function/samples/warn-on-namespace-conflict/deep.js000066400000000000000000000000231450520414700257600ustar00rootroot00000000000000export var foo = 2;rollup-3.29.4/test/function/samples/warn-on-namespace-conflict/foo.js000066400000000000000000000000231450520414700256260ustar00rootroot00000000000000export var foo = 1;rollup-3.29.4/test/function/samples/warn-on-namespace-conflict/main.js000066400000000000000000000001161450520414700257720ustar00rootroot00000000000000export * from './foo.js'; export * from './bar.js'; export const retained = 1;rollup-3.29.4/test/function/samples/warn-on-top-level-this/000077500000000000000000000000001450520414700236335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warn-on-top-level-this/_config.js000066400000000000000000000015001450520414700255710ustar00rootroot00000000000000const path = require('node:path'); const { assertIncludes } = require('../../../utils.js'); module.exports = defineTest({ description: 'warns on top-level this (#770)', warnings: [ { code: 'THIS_IS_UNDEFINED', id: path.join(__dirname, 'main.js'), message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`, pos: 81, loc: { file: path.join(__dirname, 'main.js'), line: 3, column: 0 }, frame: ` 1: const someVariableJustToCheckOnCorrectLineNumber = true; // eslint-disable-line 2: 3: this.foo = 'bar'; ^ `, url: `https://rollupjs.org/troubleshooting/#error-this-is-undefined` } ], runtimeError: error => { assertIncludes(error.message, 'Cannot set propert'); assertIncludes(error.message, "'foo'"); } }); rollup-3.29.4/test/function/samples/warn-on-top-level-this/main.js000066400000000000000000000001431450520414700251130ustar00rootroot00000000000000const someVariableJustToCheckOnCorrectLineNumber = true; // eslint-disable-line this.foo = 'bar'; rollup-3.29.4/test/function/samples/warn-on-unused-missing-imports/000077500000000000000000000000001450520414700254245ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warn-on-unused-missing-imports/_config.js000066400000000000000000000012351450520414700273670ustar00rootroot00000000000000const path = require('node:path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_FOO = path.join(__dirname, 'foo.js'); module.exports = defineTest({ description: 'warns on missing (but unused) imports', warnings: [ { binding: 'b', code: 'MISSING_EXPORT', exporter: ID_FOO, id: ID_MAIN, message: '"b" is not exported by "foo.js", imported by "main.js".', url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module', pos: 12, loc: { column: 12, file: ID_MAIN, line: 1 }, frame: ` 1: import { a, b } from './foo.js'; ^ 2: 3: assert.equal( a, 42 );` } ] }); rollup-3.29.4/test/function/samples/warn-on-unused-missing-imports/foo.js000066400000000000000000000000231450520414700265400ustar00rootroot00000000000000export var a = 42; rollup-3.29.4/test/function/samples/warn-on-unused-missing-imports/main.js000066400000000000000000000000711450520414700267040ustar00rootroot00000000000000import { a, b } from './foo.js'; assert.equal( a, 42 ); rollup-3.29.4/test/function/samples/warning-incorrect-sourcemap-location/000077500000000000000000000000001450520414700266355ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warning-incorrect-sourcemap-location/_config.js000066400000000000000000000014351450520414700306020ustar00rootroot00000000000000const { join } = require('node:path'); const ID_MAIN = join(__dirname, 'main.js'); const ID_CONSTANTS = join(__dirname, 'constants.js'); module.exports = defineTest({ description: 'does not fail if a warning has an incorrect location due to missing sourcemaps', options: { plugins: [ { name: 'test', transform(code) { return '/* injected */;\n\n\n\n\n\n\n\n' + code; } } ] }, warnings: [ { binding: 'NON_EXISTENT', code: 'MISSING_EXPORT', exporter: ID_CONSTANTS, frame: '', id: ID_MAIN, loc: { column: 15, file: ID_MAIN, line: 12 }, message: '"NON_EXISTENT" is not exported by "constants.js", imported by "main.js".', pos: 111, url: 'https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module' } ] }); rollup-3.29.4/test/function/samples/warning-incorrect-sourcemap-location/constants.js000066400000000000000000000000321450520414700312020ustar00rootroot00000000000000export const q = 'Queue'; rollup-3.29.4/test/function/samples/warning-incorrect-sourcemap-location/main.js000066400000000000000000000001501450520414700301130ustar00rootroot00000000000000import * as CONSTANTS from './constants'; export default class Sample { x = CONSTANTS.NON_EXISTENT; } rollup-3.29.4/test/function/samples/warning-low-resolution-location/000077500000000000000000000000001450520414700256535ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warning-low-resolution-location/_config.js000066400000000000000000000020241450520414700276130ustar00rootroot00000000000000const path = require('node:path'); const { encode } = require('@jridgewell/sourcemap-codec'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = defineTest({ description: 'handles when a low resolution sourcemap is used to report an error', options: { plugins: { name: 'test-plugin', transform() { // each entry of each line consist of // [generatedColumn, sourceIndex, sourceLine, sourceColumn]; // this mapping only maps the first line to itself const decodedMap = [[[0], [0, 0, 0, 0], [1]]]; return { code: 'export default this', map: { mappings: encode(decodedMap), sources: [] } }; } } }, warnings: [ { code: 'THIS_IS_UNDEFINED', frame: ` 1: console.log('original source'); ^`, id: ID_MAIN, loc: { column: 0, file: ID_MAIN, line: 1 }, message: "The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten", pos: 15, url: 'https://rollupjs.org/troubleshooting/#error-this-is-undefined' } ] }); rollup-3.29.4/test/function/samples/warning-low-resolution-location/main.js000066400000000000000000000000401450520414700271270ustar00rootroot00000000000000console.log('original source'); rollup-3.29.4/test/function/samples/warnings-to-string/000077500000000000000000000000001450520414700231545ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warnings-to-string/_config.js000066400000000000000000000007171450520414700251230ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'provides a string conversion for warnings', options: { plugins: { name: 'test-plugin', transform(code) { this.warn('This might be removed', code.indexOf('removed')); } } }, warnings(warnings) { assert.deepStrictEqual(warnings.map(String), [ '(test-plugin plugin) main.js (1:6) This might be removed', 'Generated an empty chunk: "main".' ]); } }); rollup-3.29.4/test/function/samples/warnings-to-string/main.js000066400000000000000000000000231450520414700244310ustar00rootroot00000000000000const removed = 1; rollup-3.29.4/test/function/samples/warns-for-invalid-options/000077500000000000000000000000001450520414700244335ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/warns-for-invalid-options/_config.js000066400000000000000000000010601450520414700263720ustar00rootroot00000000000000module.exports = defineTest({ description: 'warns for invalid options', options: { myInvalidInputOption: true, output: { myInvalidOutputOption: true } }, warnings: [ { code: 'UNKNOWN_OPTION', message: 'Unknown input options: myInvalidInputOption. Allowed options: ' + // @ts-expect-error file outside root require('../../../misc/optionList').input }, { code: 'UNKNOWN_OPTION', message: 'Unknown output options: myInvalidOutputOption. Allowed options: ' + require('../../../misc/optionList').output } ] }); rollup-3.29.4/test/function/samples/warns-for-invalid-options/main.js000066400000000000000000000000231450520414700257100ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/function/samples/watch-option/000077500000000000000000000000001450520414700220145ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/watch-option/_config.js000066400000000000000000000001431450520414700237540ustar00rootroot00000000000000module.exports = defineTest({ description: 'expects watch option', options: { watch: {} } }); rollup-3.29.4/test/function/samples/watch-option/main.js000066400000000000000000000000201450520414700232660ustar00rootroot00000000000000assert.ok(true);rollup-3.29.4/test/function/samples/wraps-object-expressions-as-statements/000077500000000000000000000000001450520414700271465ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/wraps-object-expressions-as-statements/_config.js000066400000000000000000000001471450520414700311120ustar00rootroot00000000000000module.exports = defineTest({ description: 'wraps object expressions that have become statements' }); rollup-3.29.4/test/function/samples/wraps-object-expressions-as-statements/main.js000066400000000000000000000002161450520414700304270ustar00rootroot00000000000000const foo = {}; // new parent is expression statement true && { a: foo.a = true, b: foo.a = true }; assert.ok(foo.a); export default foo; rollup-3.29.4/test/function/samples/wraps-simplified-expressions/000077500000000000000000000000001450520414700252375ustar00rootroot00000000000000rollup-3.29.4/test/function/samples/wraps-simplified-expressions/_config.js000066400000000000000000000004001450520414700271730ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'wraps simplified expressions that have become callees if necessary', warnings: warnings => { for (const warning of warnings) assert.equal(warning.code, 'EVAL'); } }); rollup-3.29.4/test/function/samples/wraps-simplified-expressions/main.js000066400000000000000000000012761450520414700265270ustar00rootroot00000000000000const wrapper = { foo() { assert.notEqual(this, wrapper); } }; // Indirectly called member expressions set the callee's context to global "this" (true && wrapper.foo)(); (true ? wrapper.foo : null)(); (1, 2, wrapper.foo)(); (true && (true && wrapper.foo))(); (true && (true ? wrapper.foo : null))(); (true && (1, 2, wrapper.foo))(); function evoke(callee, arg) { return callee(arg); } // Indirectly invoked eval is executed in the global scope function testEval() { assert.notEqual((true && eval)('this'), 'test'); assert.notEqual((true ? eval : null)('this'), 'test'); assert.notEqual((1, 2, eval)('this'), 'test'); assert.equal(evoke(true && eval, '42'), '42'); } testEval.call('test'); rollup-3.29.4/test/function/tsconfig.json000066400000000000000000000001701450520414700204410ustar00rootroot00000000000000{ "extends": "../tsconfig.base.json", "include": [ "**/_config.js", "./index.js", "./define.d.ts" ] } rollup-3.29.4/test/hooks/000077500000000000000000000000001450520414700152325ustar00rootroot00000000000000rollup-3.29.4/test/hooks/index.js000066400000000000000000000733721450520414700167130ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { outputFile, readdir, remove } = require('fs-extra'); /** * @type {import('../../src/rollup/types')} Rollup */ const rollup = require('../../dist/rollup.js'); const { loader, wait } = require('../utils.js'); const TEMP_DIR = path.join(__dirname, 'tmp'); describe('hooks', () => { before(() => remove(TEMP_DIR)); it('allows to replace file with dir in the outputOptions hook', async () => { const bundle = await rollup.rollup({ input: 'input', treeshake: false, plugins: [ loader({ input: `console.log('input');import('other');`, other: `console.log('other');` }), { outputOptions(options) { const newOptions = { ...options, dir: TEMP_DIR, chunkFileNames: 'chunk.js' }; delete newOptions.file; return newOptions; } } ] }); await bundle.write({ file: path.join(TEMP_DIR, 'bundle.js'), format: 'es' }); const fileNames = (await readdir(TEMP_DIR)).sort(); await remove(TEMP_DIR); assert.deepStrictEqual(fileNames, ['chunk.js', 'input.js']); }); it('supports buildStart and buildEnd hooks', () => { let buildStartCnt = 0; let buildEndCnt = 0; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { buildStart() { buildStartCnt++; assert(this.meta); assert(this.meta.rollupVersion); }, buildEnd() { buildEndCnt++; assert(this.meta); assert(this.meta.rollupVersion); } } ] }) .then(() => { assert.strictEqual(buildStartCnt, 1); assert.strictEqual(buildEndCnt, 1); return rollup.rollup({ input: 'input', plugins: [ loader({ input: `invalid_source - @#$%^&*` }), { buildStart() { buildStartCnt++; }, buildEnd() { buildEndCnt++; } } ] }); }) .catch(error => { assert.ok(error); }) .then(() => { assert.strictEqual(buildStartCnt, 2); assert.strictEqual(buildEndCnt, 2); }); }); it('supports warnings in buildStart and buildEnd hooks', () => { let callCnt = 0; return rollup .rollup({ input: 'input', onwarn(warning) { if (callCnt === 0) { assert.strictEqual(warning.message, 'build start'); callCnt++; } else if (callCnt === 1) { assert.strictEqual(warning.message, 'build end'); callCnt++; } }, plugins: [ loader({ input: `alert('hello')` }), { buildStart() { this.warn('build start'); }, buildEnd() { this.warn('build end'); } } ] }) .then(() => { assert.strictEqual(callCnt, 2); }); }); it('passes errors to the buildEnd hook', () => { let handledError = false; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { buildStart() { this.error('build start error'); }, buildEnd(error) { assert.strictEqual(error.message, 'build start error'); handledError = true; } } ] }) .catch(error => { assert.ok(handledError); assert.strictEqual(error.message, 'build start error'); }) .then(() => { assert.ok(handledError); }); }); it('caches chunk emission in transform hook', () => { let cache; return rollup .rollup({ input: 'input', plugins: [ loader({ input: '', chunk: "console.log('chunk');" }), { transform(code, id) { if (id === 'input') { return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'chunk', id: 'chunk' })};`; } } } ] }) .then(bundle => { cache = bundle.cache; return bundle.generate({ format: 'es' }); }) .then(({ output }) => { assert.strictEqual( output[0].code, `var input = new URL('chunk-f0e7d366.js', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'chunk-f0e7d366.js'); assert.strictEqual(output[1].code, `console.log('chunk');\n`); return rollup.rollup({ cache, input: 'input', plugins: [ loader({ input: '', chunk: "console.log('chunk');" }), { transform() { assert.fail('Should cache transform'); } } ] }); }) .then(bundle => { cache = bundle.cache; return bundle.generate({ format: 'es' }); }) .then(({ output }) => { assert.strictEqual( output[0].code, `var input = new URL('chunk-f0e7d366.js', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'chunk-f0e7d366.js'); assert.strictEqual(output[1].code, `console.log('chunk');\n`); return rollup.rollup({ cache, input: 'input', plugins: [ loader({ input: '', chunk: "console.log('chunk');" }), { transform() { assert.fail('Should cache transform'); } } ] }); }) .then(bundle => bundle.generate({ format: 'es' })) .then(({ output }) => { assert.strictEqual( output[0].code, `var input = new URL('chunk-f0e7d366.js', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'chunk-f0e7d366.js'); assert.strictEqual(output[1].code, `console.log('chunk');\n`); }); }); it('does not overwrite files in other outputs when emitting assets during generate', () => rollup .rollup({ input: 'input', plugins: [ loader({ input: 'export default 42;' }), { generateBundle(outputOptions) { this.emitFile({ type: 'asset', source: outputOptions.format }); } } ] }) .then(bundle => Promise.all([ bundle.generate({ format: 'es', assetFileNames: 'asset' }), bundle.generate({ format: 'cjs', assetFileNames: 'asset', exports: 'auto' }) ]) ) .then(([{ output: output1 }, { output: output2 }]) => { assert.strictEqual(output1.length, 2, 'output1'); assert.strictEqual(output1[1].fileName, 'asset'); assert.strictEqual(output1[1].source, 'es'); assert.strictEqual(output2.length, 2, 'output2'); assert.strictEqual(output2[1].fileName, 'asset'); assert.strictEqual(output2[1].source, 'cjs'); })); it('caches asset emission in transform hook', () => { let cache; return rollup .rollup({ input: 'input', plugins: [ loader({ input: '' }), { transform() { return `export default import.meta.ROLLUP_FILE_URL_${this.emitFile({ type: 'asset', name: 'test.ext', source: 'hello world' })};`; } } ] }) .then(bundle => { cache = bundle.cache; return bundle.generate({ format: 'es' }); }) .then(({ output }) => { assert.strictEqual( output[0].code, `var input = new URL('assets/test-b94d27b9.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); assert.strictEqual(output[1].source, 'hello world'); return rollup.rollup({ cache, input: 'input', plugins: [ loader({ input: '' }), { transform() { assert.fail('Should cache transform'); } } ] }); }) .then(bundle => { cache = bundle.cache; return bundle.generate({ format: 'es' }); }) .then(({ output }) => { assert.strictEqual( output[0].code, `var input = new URL('assets/test-b94d27b9.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); assert.strictEqual(output[1].source, 'hello world'); return rollup.rollup({ cache, input: 'input', plugins: [ loader({ input: '' }), { transform() { assert.fail('Should cache transform'); } } ] }); }) .then(bundle => bundle.generate({ format: 'es' })) .then(({ output }) => { assert.strictEqual( output[0].code, `var input = new URL('assets/test-b94d27b9.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); assert.strictEqual(output[1].source, 'hello world'); }); }); it('keeps emitted ids stable between runs', () => { let cache; let emittedFile; return rollup .rollup({ input: 'input', plugins: [ { resolveId(id) { return id; }, load(id) { if (id === 'input') { return ''; } this.setAssetSource(emittedFile, 'first run'); return `console.log('imported')`; }, transform(code, id) { if (id === 'input') { emittedFile = this.emitFile({ type: 'asset', name: 'test.ext' }); return ( `import 'imported';\n` + `export default import.meta.ROLLUP_FILE_URL_${emittedFile};` ); } } } ] }) .then(bundle => { cache = bundle.cache; return bundle.generate({ format: 'es' }); }) .then(({ output }) => { assert.strictEqual( output[0].code, `console.log('imported');\n\n` + `var input = new URL('assets/test-7d48a582.ext', import.meta.url).href;\n\n` + `export { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-7d48a582.ext'); assert.strictEqual(output[1].source, 'first run'); return rollup.rollup({ cache, input: 'input', plugins: [ { resolveId(id) { return id; }, load(id) { if (id === 'input') { return ''; } this.setAssetSource(emittedFile, 'second run'); return `console.log('imported')`; }, transform() { assert.fail('Should cache transform'); } } ] }); }) .then(bundle => bundle.generate({ format: 'es' })) .then(({ output }) => { assert.strictEqual( output[0].code, `console.log('imported');\n\n` + `var input = new URL('assets/test-791d43e2.ext', import.meta.url).href;\n\n` + `export { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-791d43e2.ext'); assert.strictEqual(output[1].source, 'second run'); }); }); it('opts-out transform hook cache for custom cache', () => { let runs = 0; let cache; return rollup .rollup({ input: 'input', plugins: [ loader({ input: '' }), { name: 'x', transform() { this.cache.set('asdf', 'asdf'); runs++; const assetId = this.emitFile({ type: 'asset', name: 'test.ext', source: 'hello world' }); return `export default import.meta.ROLLUP_FILE_URL_${assetId};`; } } ] }) .then(bundle => { cache = bundle.cache; return bundle.generate({ format: 'es' }); }) .then(({ output }) => { assert.strictEqual( output[0].code, `var input = new URL('assets/test-b94d27b9.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); assert.strictEqual(output[1].source, 'hello world'); assert.strictEqual(output[1].fileName, 'assets/test-b94d27b9.ext'); assert.strictEqual(output[1].source, 'hello world'); return rollup.rollup({ cache, input: 'input', plugins: [ loader({ input: '' }), { name: 'x', transform() { runs++; return `alert('hello world')`; } } ] }); }) .then(bundle => bundle.generate({ format: 'es' })) .then(({ output }) => { assert.strictEqual(runs, 2); assert.strictEqual(output[0].code.trim(), `alert('hello world');`); assert.strictEqual(output.length, 1); }); }); it('supports generateBundle hook including reporting rendered exports and source length', () => rollup .rollup({ input: 'input', plugins: [ loader({ input: `export { a as default } from 'dep';`, dep: `export var a = 1; export var b = 2;` }), { generateBundle(options, outputBundle, isWrite) { assert.strictEqual(isWrite, false); const chunk = outputBundle['input.js']; // can detect that b has been tree-shaken this way assert.strictEqual(chunk.modules.dep.renderedExports[0], 'a'); assert.strictEqual(chunk.modules.dep.renderedExports.length, 1); assert.strictEqual(chunk.modules.dep.removedExports[0], 'b'); assert.strictEqual(chunk.modules.dep.removedExports.length, 1); assert.strictEqual(chunk.modules.dep.renderedLength, 10); assert.strictEqual(chunk.modules.dep.originalLength, 35); } } ] }) .then(bundle => bundle.generate({ format: 'es' }))); it('supports writeBundle hook', async () => { const file = path.join(TEMP_DIR, 'bundle.js'); let generatedBundle; let callCount = 0; const bundle = await rollup.rollup({ input: 'input', plugins: [ loader({ input: `export { a as default } from 'dep';`, dep: `export var a = 1; export var b = 2;` }), { generateBundle(options, outputBundle, isWrite) { generatedBundle = outputBundle; assert.strictEqual(isWrite, true); } }, { writeBundle(options, outputBundle) { assert.deepStrictEqual(options.file, file); assert.deepStrictEqual(outputBundle, generatedBundle); callCount++; } } ] }); await bundle.write({ format: 'es', file }); await remove(TEMP_DIR); assert.strictEqual(callCount, 1); }); it('supports this.cache for plugins', () => rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { name: 'cachePlugin', buildStart() { this.cache.set('asdf', 'asdf'); } } ] }) .then(bundle => rollup.rollup({ input: 'input', cache: bundle.cache, plugins: [ loader({ input: `alert('hello')` }), { name: 'cachePlugin', buildStart() { assert.ok(this.cache.has('asdf')); assert.strictEqual(this.cache.get('asdf'), 'asdf'); assert.strictEqual(this.cache.delete('asdf'), true); assert.ok(!this.cache.has('asdf')); } } ] }) )); it('Allows plugins with any names using a shared cacheKey', () => rollup.rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { name: 'a', cacheKey: 'a9b6', buildStart() { this.cache.set('asdf', 'asdf'); } }, { name: 'a', cacheKey: 'a9b6', buildEnd() { assert.strictEqual(this.cache.get('asdf'), 'asdf'); } }, { name: 'b', cacheKey: 'a9b6', buildEnd() { assert.strictEqual(this.cache.get('asdf'), 'asdf'); } } ] })); it('Evicts cache entries after cacheExpiry runs with no usage', () => rollup .rollup({ input: 'input', experimentalCacheExpiry: 5, plugins: [ loader({ input: `alert('hello')` }), { name: 'x', buildStart() { this.cache.set('first', 'first'); this.cache.set('second', 'second'); } } ] }) .then(bundle => { let promise = Promise.resolve(); for (let index = 0; index < 5; index++) promise = promise.then(() => rollup.rollup({ cache: bundle.cache, input: 'input', experimentalCacheExpiry: 5, plugins: [ loader({ input: `alert('hello')` }), { name: 'x', buildStart() { if (index === 4) assert.strictEqual(this.cache.has('second'), true); } } ] }) ); return promise; }) .then(bundle => rollup.rollup({ cache: bundle.cache, input: 'input', experimentalCacheExpiry: 5, plugins: [ loader({ input: `alert('hello')` }), { name: 'x', buildStart() { assert.strictEqual(this.cache.has('first'), false); assert.strictEqual(this.cache.get('first'), undefined); assert.strictEqual(this.cache.get('second'), 'second'); } } ] }) )); it('Supports disabling the cache with cache: false', () => rollup .rollup({ input: 'input', cache: false, plugins: [ loader({ input: `alert('hello')` }), { name: 'x', buildStart() { this.cache.set('x', 'x'); assert.ok(!this.cache.has('x')); assert.strictEqual(this.cache.get('x'), undefined); this.cache.delete('x'); } } ] }) .then(bundle => { assert.strictEqual(bundle.cache, undefined); })); it('Disables the default transform cache when using cache in transform only', () => rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { name: 'x', transform() { this.cache.set('asdf', 'asdf'); return `alert('hello world')`; } }, { name: 'y', transform(code) { return code + `;alert('world')`; } } ] }) .then(bundle => rollup.rollup({ input: 'input', cache: bundle.cache, plugins: [ loader({ input: `alert('hello')` }), { name: 'x', transform() { assert.ok(this.cache.has('asdf')); assert.strictEqual(this.cache.get('asdf'), 'asdf'); this.cache.delete('asdf'); assert.ok(!this.cache.has('asdf')); return `alert('hello')`; } }, { name: 'y', transform(code) { return code + `;alert('world')`; } } ] }) ) .then(bundle => bundle.generate({ format: 'es' }) ) .then(({ output }) => { assert.strictEqual(output[0].code.trim(), `alert('hello');alert('world');`); })); it('supports renderStart hook', () => { let renderStartCount = 0; let generateBundleCount = 0; let renderErrorCount = 0; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { renderStart() { renderStartCount++; assert.strictEqual(generateBundleCount, 0); assert.strictEqual(renderErrorCount, 0); }, generateBundle() { generateBundleCount++; assert.strictEqual(renderStartCount, 1); assert.strictEqual(renderErrorCount, 0); }, renderError() { renderErrorCount++; } } ] }) .then(bundle => bundle.generate({ format: 'es' })) .then(() => { assert.strictEqual(renderStartCount, 1, 'renderStart count'); assert.strictEqual(generateBundleCount, 1, 'generateBundle count'); assert.strictEqual(renderErrorCount, 0, 'renderError count'); }); }); it('supports renderError hook', () => { let renderStartCount = 0; let generateBundleCount = 0; let renderErrorCount = 0; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { renderStart() { renderStartCount++; }, renderChunk() { throw new Error('renderChunk error'); }, generateBundle() { generateBundleCount++; }, renderError(error) { assert(error); assert.strictEqual(error.message, 'renderChunk error'); assert.strictEqual(renderStartCount, 1); renderErrorCount++; } } ] }) .then(bundle => bundle.generate({ format: 'es' })) .catch(error => { assert.ok(error); }) .then(() => { assert.strictEqual(renderStartCount, 1, 'renderStart count'); assert.strictEqual(generateBundleCount, 0, 'generateBundle count'); assert.strictEqual(renderErrorCount, 1, 'renderError count'); }); }); it('Throws when not specifying "file" or "dir"', () => { const watcher = rollup.watch({ input: 'input', output: { format: 'es' }, plugins: [loader({ input: `alert('hello')` })] }); return new Promise((resolve, reject) => { watcher.on('event', event => { if (event.code === 'BUNDLE_END') reject(new Error('Expected an error')); else if (event.code === 'ERROR') reject(event.error); }); }) .catch(error => { watcher.close(); assert.strictEqual( error.message, 'You must specify "output.file" or "output.dir" for the build.' ); }) .then(() => watcher.close()); }); it('Throws when using the "file"" option for multiple chunks', () => { const watcher = rollup.watch({ input: 'input', output: { format: 'es', file: 'bundle.js' }, plugins: [loader({ input: `import('dep')`, dep: `console.log('dep')` })] }); return new Promise((resolve, reject) => { watcher.on('event', event => { if (event.code === 'BUNDLE_END') reject(new Error('Expected an error')); else if (event.code === 'ERROR') reject(event.error); }); }) .catch(error => { watcher.close(); assert.strictEqual( error.message, 'Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.' ); }) .then(() => watcher.close()); }); it('Throws when using the "sourcemapFile" option for multiple chunks', () => { const watcher = rollup.watch({ input: 'input', output: { format: 'es', sourcemapFile: 'bundle.map', dir: 'ignored' }, plugins: [loader({ input: `import('dep')`, dep: `console.log('dep')` })] }); return new Promise((resolve, reject) => { watcher.on('event', event => { if (event.code === 'BUNDLE_END') reject(new Error('Expected an error')); else if (event.code === 'ERROR') reject(event.error); }); }) .catch(error => { watcher.close(); assert.strictEqual( error.message, 'Invalid value for option "output.sourcemapFile" - "output.sourcemapFile" is only supported for single-file builds.' ); }) .then(() => watcher.close()); }); it('assigns chunk IDs before creating outputBundle chunks', () => { const chunks = []; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `export default [import('a'), import('b')];`, a: `import d from 'd'; import c from 'c'; export default () => c(d);`, b: `import c from 'c'; export default () => c(0);`, c: `export default (x) => console.log('c', x);`, d: `export default {};` }), { renderChunk(code, chunk) { chunks.push({ fileName: chunk.fileName, imports: chunk.imports, modules: Object.keys(chunk.modules) }); } } ] }) .then(bundle => bundle.generate({ entryFileNames: '[name].js', chunkFileNames: 'generated-[name].js', format: 'es' }) ) .then(() => { assert.deepEqual(chunks, [ { fileName: 'input.js', imports: [], modules: ['input'] }, { fileName: 'generated-a.js', imports: ['generated-c.js'], modules: ['d', 'a'] }, { fileName: 'generated-b.js', imports: ['generated-c.js'], modules: ['b'] }, { fileName: 'generated-c.js', imports: [], modules: ['c'] } ]); }); }); it('supports augmentChunkHash hook', () => { let augmentChunkHashCalls = 0; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { augmentChunkHash() { augmentChunkHashCalls++; assert(this.meta); assert(this.meta.rollupVersion); } } ] }) .then(bundle => bundle.generate({ format: 'es', dir: 'dist', entryFileNames: '[name]-[hash].js' }) ) .then(() => { assert.strictEqual(augmentChunkHashCalls, 1); }); }); it('supports closeBundle hook', () => { let closeBundleCalls = 0; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { closeBundle() { closeBundleCalls++; } } ] }) .then(bundle => bundle.close()) .then(() => { assert.strictEqual(closeBundleCalls, 1); }); }); it('calls closeBundle hook on build error', () => { let closeBundleCalls = 0; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { buildStart() { this.error('build start error'); }, closeBundle() { closeBundleCalls++; } } ] }) .catch(() => { assert.strictEqual(closeBundleCalls, 1); }); }); it('passes errors from closeBundle hook', () => { let handledError = false; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { closeBundle() { this.error('close bundle error'); } } ] }) .then(bundle => bundle.close()) .catch(error => { assert.strictEqual(error.message, 'close bundle error'); handledError = true; }) .then(() => { assert.ok(handledError); }); }); it('supports disabling sanitization for in-memory / in-browser / non-fs builds', () => rollup .rollup({ input: 'input.js', plugins: [ { resolveId: id => id, load: () => `export default 5` } ] }) .then(bundle => bundle.generate({ format: 'es', sanitizeFileName: false, entryFileNames: 'test:[name]' }) ) .then(({ output }) => { assert.strictEqual(output[0].fileName, 'test:input'); })); it('allows to enforce plugin hook order in watch mode', async () => { const hooks = ['closeBundle', 'closeWatcher', 'renderError', 'watchChange', 'writeBundle']; const calledHooks = {}; for (const hook of hooks) { calledHooks[hook] = []; } let first = true; const plugins = [ { name: 'render-error', renderChunk() { if (first) { first = false; throw new Error('Expected render error'); } } } ]; addPlugin(null); addPlugin('pre'); addPlugin('post'); addPlugin('post'); addPlugin('pre'); addPlugin(); function addPlugin(order) { const name = `${order}-${plugins.length}`; const plugin = { name }; for (const hook of hooks) { plugin[hook] = { order, handler() { if (!calledHooks[hook].includes(name)) { calledHooks[hook].push(name); } } }; } plugins.push(plugin); } const ID_MAIN = path.join(TEMP_DIR, 'main.js'); await outputFile(ID_MAIN, 'console.log(42);'); await wait(100); const watcher = rollup.watch({ input: ID_MAIN, output: { format: 'es', dir: path.join(TEMP_DIR, 'out') }, plugins }); return new Promise((resolve, reject) => { watcher.on('event', async event => { if (event.code === 'ERROR') { if (event.error.message !== 'Expected render error') { reject(event.error); } await wait(300); await outputFile(ID_MAIN, 'console.log(43);'); } else if (event.code === 'BUNDLE_END') { await event.result.close(); resolve(); } }); }).finally(async () => { await watcher.close(); await remove(TEMP_DIR); for (const hook of hooks) { assert.deepStrictEqual( calledHooks[hook], ['pre-2', 'pre-5', 'null-1', 'undefined-6', 'post-3', 'post-4'], hook ); } }); }); it('allows to enforce sequential plugin hook order in watch mode', async () => { const hooks = ['closeBundle', 'closeWatcher', 'renderError', 'watchChange', 'writeBundle']; const calledHooks = {}; const activeHooks = {}; for (const hook of hooks) { calledHooks[hook] = []; activeHooks[hook] = new Set(); } let first = true; const plugins = [ { name: 'render-error', renderChunk() { if (first) { first = false; throw new Error('Expected render error'); } } } ]; addPlugin(null, true); addPlugin('pre', false); addPlugin('post', false); addPlugin('post', false); addPlugin('pre', false); addPlugin(undefined, true); addPlugin(null, false); addPlugin('pre', true); addPlugin('post', true); addPlugin('post', true); addPlugin('pre', true); addPlugin(undefined, false); function addPlugin(order, sequential) { const name = `${order}-${sequential ? 'seq-' : ''}${plugins.length}`; const plugin = { name }; for (const hook of hooks) { plugin[hook] = { order, async handler() { const active = activeHooks[hook]; if (!calledHooks[hook].includes(name)) { calledHooks[hook].push(sequential ? name : [name, [...active]]); } if (sequential && active.size > 0) { throw new Error(`Detected parallel hook runs in ${hook}.`); } active.add(name); // A setTimeout always takes longer than any chain of immediately // resolved promises await wait(0); active.delete(name); }, sequential }; } plugins.push(plugin); } const ID_MAIN = path.join(TEMP_DIR, 'main.js'); await outputFile(ID_MAIN, 'console.log(42);'); await wait(100); const watcher = rollup.watch({ input: ID_MAIN, output: { format: 'es', dir: path.join(TEMP_DIR, 'out') }, plugins }); return new Promise((resolve, reject) => { watcher.on('event', async event => { if (event.code === 'ERROR') { if (event.error.message !== 'Expected render error') { reject(event.error); } await wait(300); await outputFile(ID_MAIN, 'console.log(43);'); } else if (event.code === 'BUNDLE_END') { await event.result.close(); resolve(); } }); }).finally(async () => { await watcher.close(); await remove(TEMP_DIR); for (const hook of hooks) { assert.deepStrictEqual( calledHooks[hook], [ ['pre-2', []], ['pre-5', ['pre-2']], 'pre-seq-8', 'pre-seq-11', 'null-seq-1', 'undefined-seq-6', ['null-7', []], ['undefined-12', ['null-7']], ['post-3', ['null-7', 'undefined-12']], ['post-4', ['null-7', 'undefined-12', 'post-3']], 'post-seq-9', 'post-seq-10' ], hook ); } }); }); }); rollup-3.29.4/test/incremental/000077500000000000000000000000001450520414700164105ustar00rootroot00000000000000rollup-3.29.4/test/incremental/index.js000066400000000000000000000244331450520414700200630ustar00rootroot00000000000000const assert = require('node:assert'); const acorn = require('acorn'); /** * @type {import('../../src/rollup/types')} Rollup */ const rollup = require('../../dist/rollup'); const { executeBundle, getObject } = require('../utils.js'); describe('incremental', () => { let resolveIdCalls; let transformCalls; let modules; const plugin = { resolveId: id => { resolveIdCalls++; return id === 'external' ? false : id; }, load: id => modules[id], transform: code => { transformCalls++; return code; } }; beforeEach(() => { resolveIdCalls = 0; transformCalls = 0; modules = { entry: `import foo from 'foo'; export default foo;`, foo: `export default 42`, bar: `export default 21` }; }); it('does not resolve ids and transforms in the second time', async () => { const firstBundle = await rollup.rollup({ input: 'entry', plugins: [plugin] }); assert.strictEqual(resolveIdCalls, 2); assert.strictEqual(transformCalls, 2); const secondBundle = await rollup.rollup({ input: 'entry', plugins: [plugin], cache: firstBundle }); assert.strictEqual(resolveIdCalls, 3); // +1 for entry point which is resolved every time assert.strictEqual(transformCalls, 2); const result = await executeBundle(secondBundle); assert.strictEqual(result, 42); }); it('does not resolve dynamic ids and transforms in the second time', () => { modules = { entry: `export default import('foo');`, foo: `export default 42` }; return rollup .rollup({ input: 'entry', plugins: [plugin] }) .then(bundle => { assert.strictEqual(resolveIdCalls, 2); assert.strictEqual(transformCalls, 2); return rollup.rollup({ input: 'entry', plugins: [plugin], cache: bundle }); }) .then(() => { assert.strictEqual(resolveIdCalls, 3); // +1 for entry point which is resolved every time assert.strictEqual(transformCalls, 2); }); }); it('transforms modified sources', () => { let cache; return rollup .rollup({ input: 'entry', plugins: [plugin] }) .then(bundle => { assert.strictEqual(transformCalls, 2); return executeBundle(bundle).then(result => { assert.strictEqual(result, 42); modules.foo = `export default 43`; cache = bundle.cache; }); }) .then(() => rollup.rollup({ input: 'entry', plugins: [plugin], cache }) ) .then(bundle => { assert.strictEqual(transformCalls, 3); return executeBundle(bundle); }) .then(result => { assert.strictEqual(result, 43); }); }); it('resolves id of new imports', () => { let cache; return rollup .rollup({ input: 'entry', plugins: [plugin] }) .then(bundle => { assert.strictEqual(resolveIdCalls, 2); return executeBundle(bundle).then(result => { assert.strictEqual(result, 42); modules.entry = `import bar from 'bar'; export default bar;`; cache = bundle.cache; }); }) .then(() => rollup.rollup({ input: 'entry', plugins: [plugin], cache }) ) .then(bundle => { assert.strictEqual(resolveIdCalls, 4); return executeBundle(bundle); }) .then(result => { assert.strictEqual(result, 21); }); }); it('respects externals from resolveId', () => { let cache; modules.foo = `import p from 'external'; export default p;`; // eslint-disable-next-line unicorn/consistent-function-scoping const require = id => id === 'external' && 43; return rollup .rollup({ input: 'entry', plugins: [plugin] }) .then(bundle => { assert.strictEqual(resolveIdCalls, 3); return executeBundle(bundle, require).then(result => { assert.strictEqual(result, 43); cache = bundle.cache; }); }) .then(() => rollup.rollup({ input: 'entry', plugins: [plugin], cache }) ) .then(bundle => { assert.strictEqual(resolveIdCalls, 4); return executeBundle(bundle, require); }) .then(result => { assert.strictEqual(result, 43); }); }); it('keeps ASTs between runs', () => rollup .rollup({ input: 'entry', plugins: [plugin] }) .then(bundle => { const asts = {}; for (const module of bundle.cache.modules) { asts[module.id] = module.ast; } assert.deepEqual( asts.entry, acorn.parse(modules.entry, { sourceType: 'module', ecmaVersion: 2020 }) ); assert.deepEqual( asts.foo, acorn.parse(modules.foo, { sourceType: 'module', ecmaVersion: 2020 }) ); })); it('recovers from errors', () => { modules.entry = `import foo from 'foo'; import bar from 'bar'; export default foo + bar;`; return rollup .rollup({ input: 'entry', plugins: [plugin] }) .then(cache => { modules.foo = `var 42 = nope;`; return rollup .rollup({ input: 'entry', plugins: [plugin], cache }) .catch(() => cache); }) .then(cache => { modules.foo = `export default 42;`; return rollup .rollup({ input: 'entry', plugins: [plugin], cache }) .then(bundle => executeBundle(bundle)) .then(result => { assert.strictEqual(result, 63); }); }); }); it('combines resolvedIds from resolvedExternalIds', () => { modules = { entry: `import foo from 'foo'; import external from 'external'; console.log(foo(external));`, foo: `export default 42` }; return rollup .rollup({ input: 'entry', external: ['external'], plugins: [plugin] }) .then(bundle => { assert.strictEqual(bundle.cache.modules[0].id, 'foo'); assert.strictEqual(bundle.cache.modules[1].id, 'entry'); assert.deepEqual(bundle.cache.modules[1].resolvedIds, { foo: { id: 'foo', assertions: {}, external: false, meta: {}, moduleSideEffects: true, resolvedBy: 'at position 1', syntheticNamedExports: false }, external: { id: 'external', assertions: {}, external: true, meta: {}, moduleSideEffects: true, resolvedBy: 'rollup', syntheticNamedExports: false } }); }); }); it('restores module options from cache', async () => { let moduleParsedCalls = 0; const plugin = { name: 'test', resolveId(id) { resolveIdCalls++; return { id, meta: { test: { resolved: id } } }; }, load(id) { return { code: modules[id], meta: { test: { loaded: id } } }; }, transform(code, id) { transformCalls++; assert.deepStrictEqual(this.getModuleInfo(id).meta, { test: { loaded: id } }, 'transform'); return { code, meta: { test: { transformed: id } } }; }, moduleParsed({ id, meta }) { assert.deepStrictEqual(meta, { test: { transformed: id } }, 'moduleParsed'); moduleParsedCalls++; }, buildEnd() { assert.deepStrictEqual( getObject([...this.getModuleIds()].map(id => [id, this.getModuleInfo(id).meta])), { entry: { test: { transformed: 'entry' } }, foo: { test: { transformed: 'foo' } } }, 'buildEnd' ); } }; const bundle = await rollup.rollup({ input: 'entry', plugins: [plugin] }); assert.strictEqual(resolveIdCalls, 2); assert.strictEqual(transformCalls, 2); assert.strictEqual(moduleParsedCalls, 2); await rollup.rollup({ input: 'entry', plugins: [plugin], cache: bundle }); assert.strictEqual(resolveIdCalls, 3); // +1 for entry point which is resolved every time assert.strictEqual(transformCalls, 2); assert.strictEqual(moduleParsedCalls, 4); // should not be cached }); it('runs shouldTransformCachedModule when using a cached module', async () => { modules = { entry: `import foo from 'foo'; export default foo;`, foo: `export default import('bar')`, bar: `export default 42` }; let shouldTransformCachedModuleCalls = 0; const transformPlugin = { async shouldTransformCachedModule({ ast, id, meta, resolvedSources, ...other }) { shouldTransformCachedModuleCalls++; assert.strictEqual(ast.type, 'Program'); assert.deepStrictEqual(other, { code: modules[id], moduleSideEffects: true, syntheticNamedExports: false }); switch (id) { case 'foo': { assert.deepStrictEqual(meta, { transform: { calls: 1, id } }); assert.deepStrictEqual(resolvedSources, { __proto__: null, bar: { assertions: {}, external: false, id: 'bar', meta: {}, moduleSideEffects: true, resolvedBy: 'at position 1', syntheticNamedExports: false } }); // we return promises to ensure they are awaited return false; } case 'bar': { assert.deepStrictEqual(meta, { transform: { calls: 2, id } }); assert.deepStrictEqual(resolvedSources, { __proto__: null }); return false; } case 'entry': { assert.deepStrictEqual(meta, { transform: { calls: 0, id } }); assert.deepStrictEqual(resolvedSources, { __proto__: null, foo: { assertions: {}, external: false, id: 'foo', meta: {}, moduleSideEffects: true, resolvedBy: 'at position 1', syntheticNamedExports: false } }); return true; } default: { throw new Error(`Unexpected id ${id}.`); } } }, transform: (code, id) => ({ meta: { transform: { calls: transformCalls, id } } }) }; const cache = await rollup.rollup({ input: 'entry', plugins: [transformPlugin, plugin] }); assert.strictEqual( shouldTransformCachedModuleCalls, 0, 'initial shouldTransformCachedModule calls' ); assert.strictEqual(transformCalls, 3, 'initial transform calls'); const { cache: { modules: cachedModules } } = await rollup.rollup({ input: 'entry', plugins: [transformPlugin, plugin], cache }); assert.strictEqual( shouldTransformCachedModuleCalls, 3, 'final shouldTransformCachedModule calls' ); assert.strictEqual(transformCalls, 4, 'final transform calls'); assert.strictEqual(cachedModules[0].id, 'foo'); assert.deepStrictEqual(cachedModules[0].meta, { transform: { calls: 1, id: 'foo' } }); assert.strictEqual(cachedModules[1].id, 'entry'); assert.deepStrictEqual(cachedModules[1].meta, { transform: { calls: 3, id: 'entry' } }); assert.strictEqual(cachedModules[2].id, 'bar'); assert.deepStrictEqual(cachedModules[2].meta, { transform: { calls: 2, id: 'bar' } }); }); }); rollup-3.29.4/test/leak/000077500000000000000000000000001450520414700150235ustar00rootroot00000000000000rollup-3.29.4/test/leak/index.js000066400000000000000000000017371450520414700165000ustar00rootroot00000000000000const path = require('node:path'); const weak = require('weak-napi'); /** * @type {import('../../src/rollup/types')} Rollup */ const rollup = require('../..'); const { wait } = require('../utils'); var shouldCollect = false; var isCollected = false; function onCollect() { isCollected = true; } async function waitForGC() { const startTime = process.hrtime(); do { global.gc(); await wait(0); } while (!isCollected && process.hrtime(startTime)[0] < 3); } var cache; async function run() { const bundle = await rollup.rollup({ input: path.resolve(__dirname, 'main.js'), cache }); weak(bundle, onCollect); cache = bundle; if (shouldCollect) { await waitForGC(); if (!isCollected) { throw new Error('Memory leak detected'); } } shouldCollect = true; } run() .then(run) .then(() => { console.log('Success: Previous bundle was correctly garbage collected.'); process.exit(0); }) .catch(error => { console.error(error.message); process.exit(1); }); rollup-3.29.4/test/leak/main.js000066400000000000000000000000211450520414700162760ustar00rootroot00000000000000console.log(42); rollup-3.29.4/test/load-config-file/000077500000000000000000000000001450520414700172065ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/index.js000066400000000000000000000132711450520414700206570ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { loadConfigFile } = require('../../dist/loadConfigFile.js'); const { compareError } = require('../utils'); describe('loadConfigFile', () => { const defaultConfigs = [ { external: [], input: 'my-input', output: [ { file: 'my-file', format: 'es', plugins: [] } ], plugins: [ { name: 'stdin' } ] } ]; it('loads an ESM config file', async () => { const { options, warnings } = await loadConfigFile( path.resolve(__dirname, 'samples/esm-via-pkg/rollup.config.js') ); assert.strictEqual(warnings.count, 0); // Remove undefined values and functions before checking assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), defaultConfigs); }); it('loads an ESM config file with mjs extension', async () => { const { options, warnings } = await loadConfigFile( path.resolve(__dirname, 'samples/esm-via-ext/rollup.config.mjs') ); assert.strictEqual(warnings.count, 0); // Remove undefined values and functions before checking assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), defaultConfigs); }); it('loads an ESM config file exporting a config as a function with defineConfig()', async () => { const { options, warnings } = await loadConfigFile( path.resolve(__dirname, 'samples/esm-defineconfig-as-fn/rollup.config.mjs') ); assert.strictEqual(warnings.count, 0); // Remove undefined values and functions before checking assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), defaultConfigs); }); it('loads a CommonJS config file', async () => { const { options, warnings } = await loadConfigFile( path.resolve(__dirname, 'samples/cjs-via-pkg/rollup.config.js') ); assert.strictEqual(warnings.count, 0); // Remove undefined values and functions before checking assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), defaultConfigs); }); it('loads a CommonJS config file with cjs extension', async () => { const { options, warnings } = await loadConfigFile( path.resolve(__dirname, 'samples/cjs-via-ext/rollup.config.cjs') ); assert.strictEqual(warnings.count, 0); // Remove undefined values and functions before checking assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), defaultConfigs); }); it('loads a CommonJS config file exporting a config as a function with defineConfig()', async () => { const { options, warnings } = await loadConfigFile( path.resolve(__dirname, 'samples/cjs-defineconfig-as-fn/rollup.config.cjs') ); assert.strictEqual(warnings.count, 0); // Remove undefined values and functions before checking assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), defaultConfigs); }); it('throws a helpful error when loading an ES module that should actually be CommonJS', async () => { let caughtError; try { await loadConfigFile(path.resolve(__dirname, 'samples/cjs-as-esm/rollup.config.js')); } catch (error) { caughtError = error; } compareError(caughtError, { cause: { message: "Unexpected token 'export'" }, code: 'INVALID_CONFIG_MODULE_FORMAT', message: 'Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: Unexpected token \'export\'', url: 'https://rollupjs.org/command-line-interface/#bundleconfigascjs' }); }); it('just throws the error if it is not accompanied by the proper warning', async () => { let caughtError; try { const promise = loadConfigFile( path.resolve(__dirname, 'samples/esm-with-error/rollup.config.js') ); process.emit('warning', { message: 'Another warning.' }); await promise; } catch (error) { caughtError = error; } compareError(caughtError, { message: 'Config broken.' }); }); it('throws a helpful error when loading a CommonJS module that should actually be ES', async () => { let caughtError; try { await loadConfigFile(path.resolve(__dirname, 'samples/esm-as-cjs/rollup.config.js')); } catch (error) { caughtError = error; } assert.strictEqual( caughtError.message.slice(0, 256), 'Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to ".cjs" or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: module is not defined in ES module scope' ); }); it('throws a helpful error when loading a CJS module that should actually be ESM while bundling', async () => { let caughtError; try { await loadConfigFile(path.resolve(__dirname, 'samples/esm-as-cjs/rollup.config.js'), { configPlugin: '{transform: c => c}' }); } catch (error) { caughtError = error; } compareError(caughtError, { cause: { message: 'module is not defined in ES module scope' }, code: 'INVALID_CONFIG_MODULE_FORMAT', message: 'Rollup transpiled your configuration to an ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.\n\nOriginal error: module is not defined in ES module scope', url: 'https://rollupjs.org/command-line-interface/#bundleconfigascjs' }); }); it('just throws other errors while bundling', async () => { let caughtError; try { await loadConfigFile(path.resolve(__dirname, 'samples/esm-with-error/rollup.config.js'), { configPlugin: '{transform: c => c}' }); } catch (error) { caughtError = error; } compareError(caughtError, { message: 'Config broken.' }); }); }); rollup-3.29.4/test/load-config-file/samples/000077500000000000000000000000001450520414700206525ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/cjs-as-esm/000077500000000000000000000000001450520414700226145ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/cjs-as-esm/package.json000066400000000000000000000000301450520414700250730ustar00rootroot00000000000000{ "type": "commonjs" } rollup-3.29.4/test/load-config-file/samples/cjs-as-esm/rollup.config.js000066400000000000000000000001301450520414700257250ustar00rootroot00000000000000export default { input: 'my-input', output: { file: 'my-file', format: 'es' } }; rollup-3.29.4/test/load-config-file/samples/cjs-defineconfig-as-fn/000077500000000000000000000000001450520414700250515ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/cjs-defineconfig-as-fn/rollup.config.cjs000066400000000000000000000003021450520414700303260ustar00rootroot00000000000000// @ts-check const { defineConfig } = require('../../../../dist/shared/rollup') module.exports = defineConfig(args => ({ input: 'my-input', output: { file: 'my-file', format: 'es' } })) rollup-3.29.4/test/load-config-file/samples/cjs-via-ext/000077500000000000000000000000001450520414700230045ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/cjs-via-ext/package.json000066400000000000000000000000261450520414700252700ustar00rootroot00000000000000{ "type": "module" } rollup-3.29.4/test/load-config-file/samples/cjs-via-ext/rollup.config.cjs000066400000000000000000000001321450520414700262620ustar00rootroot00000000000000module.exports = { input: 'my-input', output: { file: 'my-file', format: 'es' } }; rollup-3.29.4/test/load-config-file/samples/cjs-via-pkg/000077500000000000000000000000001450520414700227655ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/cjs-via-pkg/package.json000066400000000000000000000000301450520414700252440ustar00rootroot00000000000000{ "type": "commonjs" } rollup-3.29.4/test/load-config-file/samples/cjs-via-pkg/rollup.config.js000066400000000000000000000001321450520414700261000ustar00rootroot00000000000000module.exports = { input: 'my-input', output: { file: 'my-file', format: 'es' } }; rollup-3.29.4/test/load-config-file/samples/esm-as-cjs/000077500000000000000000000000001450520414700226145ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/esm-as-cjs/package.json000066400000000000000000000000261450520414700251000ustar00rootroot00000000000000{ "type": "module" } rollup-3.29.4/test/load-config-file/samples/esm-as-cjs/rollup.config.js000066400000000000000000000001321450520414700257270ustar00rootroot00000000000000module.exports = { input: 'my-input', output: { file: 'my-file', format: 'es' } }; rollup-3.29.4/test/load-config-file/samples/esm-defineconfig-as-fn/000077500000000000000000000000001450520414700250565ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/esm-defineconfig-as-fn/rollup.config.mjs000066400000000000000000000002721450520414700303530ustar00rootroot00000000000000// @ts-check import { defineConfig } from '../../../../dist/es/rollup.js' export default defineConfig(args => ({ input: 'my-input', output: { file: 'my-file', format: 'es' } })) rollup-3.29.4/test/load-config-file/samples/esm-via-ext/000077500000000000000000000000001450520414700230115ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/esm-via-ext/package.json000066400000000000000000000000301450520414700252700ustar00rootroot00000000000000{ "type": "commonjs" } rollup-3.29.4/test/load-config-file/samples/esm-via-ext/rollup.config.mjs000066400000000000000000000001301450520414700262770ustar00rootroot00000000000000export default { input: 'my-input', output: { file: 'my-file', format: 'es' } }; rollup-3.29.4/test/load-config-file/samples/esm-via-pkg/000077500000000000000000000000001450520414700227725ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/esm-via-pkg/package.json000066400000000000000000000000261450520414700252560ustar00rootroot00000000000000{ "type": "module" } rollup-3.29.4/test/load-config-file/samples/esm-via-pkg/rollup.config.js000066400000000000000000000001301450520414700261030ustar00rootroot00000000000000export default { input: 'my-input', output: { file: 'my-file', format: 'es' } }; rollup-3.29.4/test/load-config-file/samples/esm-with-error/000077500000000000000000000000001450520414700235365ustar00rootroot00000000000000rollup-3.29.4/test/load-config-file/samples/esm-with-error/package.json000066400000000000000000000000261450520414700260220ustar00rootroot00000000000000{ "type": "module" } rollup-3.29.4/test/load-config-file/samples/esm-with-error/rollup.config.js000066400000000000000000000000431450520414700266520ustar00rootroot00000000000000throw new Error('Config broken.'); rollup-3.29.4/test/misc/000077500000000000000000000000001450520414700150425ustar00rootroot00000000000000rollup-3.29.4/test/misc/acorn-plugins.js000066400000000000000000000023041450520414700201600ustar00rootroot00000000000000const assert = require('node:assert'); const rollup = require('../../dist/rollup'); const { executeBundle, loader } = require('../utils.js'); describe('acorn plugins', () => { it('injects plugins passed in acornInjectPlugins', async () => { let pluginAInjected = false; let pluginBInjected = false; const bundle = await rollup.rollup({ input: 'x.js', plugins: [loader({ 'x.js': `export const foo = 42` })], acornInjectPlugins: [ function pluginA(Parser) { assert.equal(typeof Parser.parse, 'function'); return class extends Parser { readToken(code) { pluginAInjected = true; super.readToken(code); } }; }, function pluginB(Parser) { assert.equal(typeof Parser.parse, 'function'); return class extends Parser { readToken(code) { pluginBInjected = true; super.readToken(code); } }; } ] }); const result = await executeBundle(bundle); assert.equal(result.foo, 42); assert( pluginAInjected, 'A plugin passed via acornInjectPlugins should inject itself into Acorn.' ); assert( pluginBInjected, 'A plugin passed via acornInjectPlugins should inject itself into Acorn.' ); }); }); rollup-3.29.4/test/misc/bundle-information.js000066400000000000000000000441451450520414700212040ustar00rootroot00000000000000const assert = require('node:assert'); const rollup = require('../../dist/rollup'); const { loader } = require('../utils.js'); describe('The bundle object', () => { it('contains information about the generated chunks', () => rollup .rollup({ input: ['input1', 'input2'], plugins: [ loader({ input1: 'import shared, {used} from "shared";console.log("input1", used, shared);export const out = true;', input2: 'import "shared";console.log("input2");export default 42', shared: 'console.log("shared");export const unused = null;export const used = "used"; export default "stuff";' }) ] }) .then(bundle => bundle.generate({ format: 'es', dir: 'dist', chunkFileNames: 'generated-[name]-[hash].js', entryFileNames: '[name]-[hash].js' }) ) .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), ['input1-fffbf648.js', 'input2-ee435193.js', 'generated-shared-4eca6591.js'], 'fileName' ); assert.deepEqual( output.map(chunk => chunk.code), [ `import { u as used, s as shared } from './generated-shared-4eca6591.js';\n\nconsole.log("input1", used, shared);const out = true;\n\nexport { out };\n`, `import './generated-shared-4eca6591.js';\n\nconsole.log("input2");var input2 = 42;\n\nexport { input2 as default };\n`, `console.log("shared");const used = "used"; var shared = "stuff";\n\nexport { shared as s, used as u };\n` ], 'code' ); assert.deepEqual( output.map(chunk => chunk.map), [null, null, null], 'map' ); assert.deepEqual( output.map(chunk => chunk.isEntry), [true, true, false], 'isEntry' ); assert.deepEqual( output.map(chunk => chunk.name), ['input1', 'input2', 'shared'], 'name' ); assert.deepEqual( output.map(chunk => chunk.facadeModuleId), ['input1', 'input2', null], 'facadeModuleId' ); assert.deepEqual( output.map(chunk => chunk.imports), [['generated-shared-4eca6591.js'], ['generated-shared-4eca6591.js'], []], 'imports' ); assert.deepEqual( output.map(chunk => chunk.importedBindings), [ { 'generated-shared-4eca6591.js': ['u', 's'] }, { 'generated-shared-4eca6591.js': [] }, {} ], 'importedBindings' ); assert.deepEqual( output.map(chunk => chunk.dynamicImports), [[], [], []], 'dynamicImports' ); assert.deepEqual( output.map(chunk => chunk.exports), [['out'], ['default'], ['s', 'u']], 'exports' ); assert.deepEqual( output.map(chunk => chunk.modules), [ { input1: { code: 'console.log("input1", used, shared);const out = true;', originalLength: 96, removedExports: [], renderedExports: ['out'], renderedLength: 53 } }, { input2: { code: 'console.log("input2");var input2 = 42;', originalLength: 55, removedExports: [], renderedExports: ['default'], renderedLength: 38 } }, { shared: { code: 'console.log("shared");const used = "used"; var shared = "stuff";', originalLength: 100, removedExports: ['unused'], renderedExports: ['used', 'default'], renderedLength: 64 } } ], 'modules' ); })); it('contains information about external imports and reexports', () => rollup .rollup({ input: ['input'], external: ['external1', 'external2', 'external3'], plugins: [ loader({ input: 'export {default as foo, bar} from "external1"; import * as external2 from "external2"; export * from "external3"; console.log(external2);' }) ] }) .then(bundle => bundle.generate({ format: 'es', dir: 'dist', entryFileNames: '[name].js' }) ) .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), ['input.js'], 'fileName' ); assert.deepEqual( output.map(chunk => chunk.code), [ `export { bar, default as foo } from 'external1';\nimport * as external2 from 'external2';\nexport * from 'external3';\n\nconsole.log(external2);\n` ], 'code' ); assert.deepEqual( output.map(chunk => chunk.map), [null], 'map' ); assert.deepEqual( output.map(chunk => chunk.isEntry), [true], 'isEntry' ); assert.deepEqual( output.map(chunk => chunk.name), ['input'], 'name' ); assert.deepEqual( output.map(chunk => chunk.facadeModuleId), ['input'], 'facadeModuleId' ); assert.deepEqual( output.map(chunk => chunk.imports), [['external1', 'external2', 'external3']], 'imports' ); assert.deepEqual( output.map(chunk => chunk.importedBindings), [{ external1: ['bar', 'default'], external2: ['*'], external3: ['*'] }], 'importedBindings' ); assert.deepEqual( output.map(chunk => chunk.dynamicImports), [[]], 'dynamicImports' ); assert.deepEqual( output.map(chunk => chunk.exports), [['*external3', 'bar', 'foo']], 'exports' ); assert.deepEqual( output.map(chunk => chunk.modules), [ { input: { code: 'console.log(external2);', originalLength: 137, removedExports: [], renderedExports: [], renderedLength: 23 } } ], 'modules' ); })); it('handles entry facades as entry points but not the facaded chunk', () => rollup .rollup({ input: ['input1', 'input2'], plugins: [ loader({ input1: 'import {shared} from "shared";import {input2} from "input2";console.log(input2, shared);', input2: 'import {shared} from "shared";export const input2 = shared + "input2";', shared: 'export const shared = "shared"' }) ] }) .then(bundle => bundle.generate({ format: 'es', dir: 'dist', chunkFileNames: 'generated-[name].js' }) ) .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), ['input1.js', 'input2.js', 'generated-input2.js'], 'fileName' ); assert.deepEqual( output.map(chunk => Object.keys(chunk.modules)), [['input1'], [], ['shared', 'input2']], 'modules' ); assert.deepEqual( output.map(chunk => chunk.isEntry), [true, true, false], 'isEntry' ); assert.deepEqual( output.map(chunk => chunk.facadeModuleId), ['input1', 'input2', null], 'facadeModuleId' ); })); it('prioritizes the proper facade name over the proper facaded chunk name', () => rollup .rollup({ input: ['input1', 'input2'], plugins: [ loader({ input1: 'import {shared} from "shared";import {input2} from "input2";console.log(input2, shared);', input2: 'import {shared} from "shared";export const input2 = shared + "input2";', shared: 'export const shared = "shared"' }) ] }) .then(bundle => bundle.generate({ format: 'es', dir: 'dist', entryFileNames: '[name].js', chunkFileNames: '[name].js' }) ) .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), ['input1.js', 'input2.js', 'input22.js'], 'fileName' ); assert.deepEqual( output.map(chunk => chunk.facadeModuleId), ['input1', 'input2', null], 'facadeModuleId' ); })); it('marks dynamic entry points but only marks them as normal entry points if they actually are', () => rollup .rollup({ input: ['input', 'dynamic1'], plugins: [ loader({ input: `Promise.all([import('dynamic1'), import('dynamic2')]).then(([{dynamic1}, {dynamic2}]) => console.log(dynamic1, dynamic2));`, dynamic1: 'export const dynamic1 = "dynamic1"', dynamic2: 'export const dynamic2 = "dynamic2"' }) ] }) .then(bundle => bundle.generate({ format: 'es', dir: 'dist', entryFileNames: '[name].js', chunkFileNames: 'generated-[name].js' }) ) .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), ['input.js', 'dynamic1.js', 'generated-dynamic2.js'], 'fileName' ); assert.deepEqual( output.map(chunk => chunk.isEntry), [true, true, false], 'isEntry' ); assert.deepEqual( output.map(chunk => chunk.code), [ `Promise.all([import('./dynamic1.js'), import('./generated-dynamic2.js')]).then(([{dynamic1}, {dynamic2}]) => console.log(dynamic1, dynamic2));\n`, 'const dynamic1 = "dynamic1";\n\nexport { dynamic1 };\n', 'const dynamic2 = "dynamic2";\n\nexport { dynamic2 };\n' ], 'code' ); assert.deepEqual( output.map(chunk => chunk.isDynamicEntry), [false, true, true], 'isDynamicEntry' ); assert.deepEqual( output.map(chunk => chunk.facadeModuleId), ['input', 'dynamic1', 'dynamic2'], 'facadeModuleId' ); assert.deepEqual( output.map(chunk => chunk.dynamicImports), [['dynamic1.js', 'generated-dynamic2.js'], [], []], 'dynamicImports' ); })); it('handles tainted dynamic entries', () => rollup .rollup({ input: ['input1', 'input2'], plugins: [ loader({ input1: `import('dynamic').then(({dynamic}) => console.log(dynamic));`, input2: `import {dep} from 'dep'; import {dynamic} from 'dynamic'; console.log(dep, dynamic);`, dynamic: `import {dep} from 'dep'; console.log(dep); export const dynamic = 'dynamic';`, dep: `export const dep = 'dep';` }) ] }) .then(bundle => bundle.generate({ format: 'es', dir: 'dist', entryFileNames: '[name].js', chunkFileNames: 'generated-[name].js' }) ) .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), ['input1.js', 'input2.js', 'generated-dynamic.js'], 'fileName' ); assert.deepEqual( output.map(chunk => Object.keys(chunk.modules)), [['input1'], ['input2'], ['dep', 'dynamic']], 'modules' ); assert.deepEqual( output.map(chunk => chunk.isDynamicEntry), [false, false, true], 'isDynamicEntry' ); assert.deepEqual( output.map(chunk => chunk.facadeModuleId), ['input1', 'input2', null], 'facadeModuleId' ); assert.deepEqual( output.map(chunk => chunk.dynamicImports), [['generated-dynamic.js'], [], []], 'dynamicImports' ); })); it('removes tree-shaken dynamic imports', () => rollup .rollup({ input: ['input'], plugins: [ loader({ input: `export default false ? import('dynamic') : null`, dynamic: `export default 'dynamic'` }) ] }) .then(bundle => bundle.generate({ format: 'es', dir: 'dist', entryFileNames: '[name].js', chunkFileNames: 'generated-[name].js' }) ) .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), ['input.js'], 'fileName' ); assert.deepEqual( output.map(chunk => chunk.imports), [[]], 'imports' ); assert.deepEqual( output.map(chunk => chunk.importedBindings), [{}], 'importedBindings' ); assert.deepEqual( output.map(chunk => chunk.dynamicImports), [[]], 'dynamicImports' ); assert.deepEqual( output.map(chunk => chunk.modules), [ { input: { code: 'var input = null;', originalLength: 47, removedExports: [], renderedExports: ['default'], renderedLength: 17 } } ], 'modules' ); })); it('adds correct flags to files when preserving modules', () => rollup .rollup({ input: ['input', 'dynamic1'], plugins: [ loader({ input: `import {other} from "other";console.log(other);Promise.all([import('dynamic1'), import('dynamic2')]).then(([{dynamic1}, {dynamic2}]) => console.log(dynamic1, dynamic2));`, dynamic1: 'export const dynamic1 = "dynamic1"', dynamic2: 'export const dynamic2 = "dynamic2"', other: 'export const other = "other"' }) ] }) .then(bundle => bundle.generate({ format: 'es', dir: 'dist', entryFileNames: '[name].js', chunkFileNames: 'generated-[name].js', preserveModules: true }) ) .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), [ '_virtual/input.js', '_virtual/dynamic1.js', '_virtual/dynamic2.js', '_virtual/other.js' ], 'fileName' ); assert.deepEqual( output.map(chunk => chunk.isEntry), [true, true, false, false], 'isEntry' ); assert.deepEqual( output.map(chunk => chunk.code), [ `import { other } from './other.js'; console.log(other);Promise.all([import('./dynamic1.js'), import('./dynamic2.js')]).then(([{dynamic1}, {dynamic2}]) => console.log(dynamic1, dynamic2));\n`, 'const dynamic1 = "dynamic1";\n\nexport { dynamic1 };\n', 'const dynamic2 = "dynamic2";\n\nexport { dynamic2 };\n', 'const other = "other";\n\nexport { other };\n' ], 'code' ); assert.deepEqual( output.map(chunk => chunk.name), ['_virtual/input', '_virtual/dynamic1', '_virtual/dynamic2', '_virtual/other'], 'name' ); assert.deepEqual( output.map(chunk => chunk.imports), [['_virtual/other.js'], [], [], []], 'imports' ); assert.deepEqual( output.map(chunk => chunk.importedBindings), [{ '_virtual/other.js': ['other'] }, {}, {}, {}], 'importedBindings' ); assert.deepEqual( output.map(chunk => chunk.exports), [[], ['dynamic1'], ['dynamic2'], ['other']], 'exports' ); assert.deepEqual( output.map(chunk => chunk.dynamicImports), [['_virtual/dynamic1.js', '_virtual/dynamic2.js'], [], [], []], 'dynamicImports' ); assert.deepEqual( output.map(chunk => chunk.modules), [ { input: { code: "console.log(other);Promise.all([import('./dynamic1.js'), import('./dynamic2.js')]).then(([{dynamic1}, {dynamic2}]) => console.log(dynamic1, dynamic2));", originalLength: 169, removedExports: [], renderedExports: [], renderedLength: 151 } }, { dynamic1: { code: 'const dynamic1 = "dynamic1";', originalLength: 34, removedExports: [], renderedExports: ['dynamic1'], renderedLength: 28 } }, { dynamic2: { code: 'const dynamic2 = "dynamic2";', originalLength: 34, removedExports: [], renderedExports: ['dynamic2'], renderedLength: 28 } }, { other: { code: 'const other = "other";', originalLength: 28, removedExports: [], renderedExports: ['other'], renderedLength: 22 } } ], 'modules' ); assert.deepEqual( output.map(chunk => chunk.isDynamicEntry), [false, true, true, false], 'isDynamicEntry' ); assert.deepEqual( output.map(chunk => chunk.facadeModuleId), ['input', 'dynamic1', 'dynamic2', 'other'], 'facadeModuleId' ); })); it('contains correct information about rendered/removedExports when directly exporting items', () => rollup .rollup({ input: ['input'], plugins: [ loader({ input: '/* removed header */ export { renderedFn, renderedClass, renderedConst } from "code"', code: 'export function renderedFn() {}\nexport function removedFn() {}\n' + 'export class renderedClass {}\nexport class removedClass {}\n' + 'export const renderedConst = 1;\nexport const removedConst = 1;' }) ] }) .then(bundle => bundle.generate({ format: 'es' }) ) .then(({ output: [output] }) => { assert.deepEqual( output.code, 'function renderedFn() {}\nclass renderedClass {}\nconst renderedConst = 1;\n\nexport { renderedClass, renderedConst, renderedFn };\n', 'code' ); assert.deepEqual( output.exports, ['renderedClass', 'renderedConst', 'renderedFn'], 'exports' ); assert.deepEqual( output.modules, { code: { code: 'function renderedFn() {}\nclass renderedClass {}\nconst renderedConst = 1;', originalLength: 184, removedExports: ['removedFn', 'removedClass', 'removedConst'], renderedExports: ['renderedFn', 'renderedClass', 'renderedConst'], renderedLength: 72 }, input: { code: null, originalLength: 84, removedExports: [], renderedExports: [], renderedLength: 0 } }, 'modules' ); })); it('contains correct information about rendered/removedExports when using export declaration', () => rollup .rollup({ input: ['input'], plugins: [ loader({ input: 'export { renderedFn, renderedClass, renderedConst } from "code"', code: 'function renderedFn() {}\nfunction removedFn() {}\n' + 'class renderedClass {}\nclass removedClass {}\n' + 'const renderedConst = 1;\nconst removedConst = 1;\n' + 'export { renderedFn, renderedClass, renderedConst, removedFn, removedClass, removedConst }' }) ] }) .then(bundle => bundle.generate({ format: 'es' }) ) .then(({ output: [output] }) => { assert.deepEqual( output.code, 'function renderedFn() {}\nclass renderedClass {}\nconst renderedConst = 1;\n\nexport { renderedClass, renderedConst, renderedFn };\n', 'code' ); assert.deepEqual( output.exports, ['renderedClass', 'renderedConst', 'renderedFn'], 'exports' ); assert.deepEqual( output.modules, { code: { code: 'function renderedFn() {}\nclass renderedClass {}\nconst renderedConst = 1;', originalLength: 233, removedExports: ['removedFn', 'removedClass', 'removedConst'], renderedExports: ['renderedFn', 'renderedClass', 'renderedConst'], renderedLength: 72 }, input: { code: null, originalLength: 63, removedExports: [], renderedExports: [], renderedLength: 0 } }, 'modules' ); })); }); rollup-3.29.4/test/misc/get-log-filter.js000066400000000000000000000074621450520414700202320ustar00rootroot00000000000000const assert = require('node:assert'); const { getLogFilter } = require('../../dist/getLogFilter'); describe('getLogFilter', () => { it('does not filter when there are no filters', () => { const filter = getLogFilter([]); assert.strictEqual(filter({ code: 'FIRST' }), true); }); it('filters for string matches', () => { const filter = getLogFilter(['code:FIRST']); assert.strictEqual(filter({ code: 'FIRST' }), true); assert.strictEqual(filter({ code: 'SECOND' }), false); assert.strictEqual(filter({ message: 'no code' }), false); }); it('combines multiple filters with "or"', () => { const filter = getLogFilter(['code:FIRST', 'message:second']); assert.strictEqual(filter({ code: 'FIRST', message: 'first' }), true); assert.strictEqual(filter({ code: 'SECOND', message: 'first' }), false); assert.strictEqual(filter({ code: 'FIRST', message: 'second' }), true); assert.strictEqual(filter({ code: 'SECOND', message: 'second' }), true); }); it('supports placeholders', () => { const filter = getLogFilter(['code:*A', 'code:B*', 'code:*C*', 'code:D*E*F']); assert.strictEqual(filter({ code: 'xxA' }), true, 'xxA'); assert.strictEqual(filter({ code: 'xxB' }), false, 'xxB'); assert.strictEqual(filter({ code: 'Axx' }), false, 'Axx'); assert.strictEqual(filter({ code: 'Bxx' }), true, 'Bxx'); assert.strictEqual(filter({ code: 'C' }), true, 'C'); assert.strictEqual(filter({ code: 'xxCxx' }), true, 'xxCxx'); assert.strictEqual(filter({ code: 'DxxExxF' }), true, 'DxxExxF'); }); it('supports inverted filters', () => { const filter = getLogFilter(['!code:FIRST']); assert.strictEqual(filter({ code: 'FIRST' }), false); assert.strictEqual(filter({ code: 'SECOND' }), true); }); it('supports AND conditions', () => { const filter = getLogFilter(['code:FIRST&plugin:my-plugin']); assert.strictEqual(filter({ code: 'FIRST', plugin: 'my-plugin' }), true); assert.strictEqual(filter({ code: 'FIRST', plugin: 'other-plugin' }), false); assert.strictEqual(filter({ code: 'SECOND', plugin: 'my-plugin' }), false); }); it('handles numbers and objects', () => { const filter = getLogFilter(['foo:1', 'bar:*2*', 'baz:{"a":1}', 'baz:{"b":1,*}']); assert.strictEqual(filter({ foo: 1 }), true, 'foo:1'); assert.strictEqual(filter({ foo: 10 }), false, 'foo:10'); assert.strictEqual(filter({ bar: 123 }), true, 'bar:123'); assert.strictEqual(filter({ bar: 13 }), false, 'bar:13'); assert.strictEqual(filter({ baz: { a: 1 } }), true, 'baz:{"a":1}'); assert.strictEqual(filter({ baz: { a: 1, b: 2 } }), false, 'baz:{"a":1,"b":2}'); assert.strictEqual(filter({ baz: { b: 1, c: 2 } }), true, 'baz:{"b":1,"c":2}'); }); it('handles edge case filters', () => { const filter = getLogFilter([ ':A', // property is "empty string" 'a:', // value is "empty string" '', // property and value are "empty string" 'code:A&', // property and value are "empty string", 'foo:bar:baz' // second colon is treated literally ]); assert.strictEqual(filter({ '': 'A' }), true, ':A'); assert.strictEqual(filter({ foo: 'A' }), false, 'foo:A'); assert.strictEqual(filter({ a: '' }), true, 'a:'); assert.strictEqual(filter({ a: 'foo' }), false, 'a:foo'); assert.strictEqual(filter({ '': '' }), true, ''); assert.strictEqual(filter({ code: 'A' }), false, 'code:A'); assert.strictEqual(filter({ code: 'A', '': '' }), true, 'code:A&'); assert.strictEqual(filter({ foo: 'bar:baz' }), true, 'foo:bar:baz'); }); it('handles nested properties', () => { const filter = getLogFilter(['foo.bar:baz']); assert.strictEqual(filter({ foo: null }), false, 'foo:bar'); assert.strictEqual(filter({ foo: { bar: 'baz' } }), true, 'foo.bar:baz'); assert.strictEqual(filter({ foo: { bar: 'qux' } }), false, 'foo.bar:qux'); assert.strictEqual(filter({ foo: { bar: { baz: 'qux' } } }), false, 'foo.bar.baz:qux'); }); }); rollup-3.29.4/test/misc/iife.js000066400000000000000000000111361450520414700163160ustar00rootroot00000000000000const assert = require('node:assert'); const { rollup } = require('../../dist/rollup'); const { loader } = require('../utils.js'); const { compareError } = require('../utils.js'); function runTestCode(code, globals) { const globalsWithAssert = { ...globals, assert }; const globalKeys = Object.keys(globalsWithAssert); const function_ = new Function(globalKeys, code); function_.apply( globals, globalKeys.map(key => globalsWithAssert[key]) ); } function runIifeTest(code, outputOptions) { const bundleName = outputOptions.name.split('.')[0]; const globals = { external: 'external', __exports: {} }; runTestCode( bundleName && !bundleName.includes('@') ? `${code}if (typeof ${bundleName} !== 'undefined') __exports.${bundleName} = ${bundleName};` : code, globals ); return getIifeExports(globals.__exports[bundleName] ? globals.__exports : globals, outputOptions); } function getIifeExports(global, outputOptions) { if (outputOptions.name) { return outputOptions.name .split('.') .reduce((currentVariable, nextKey) => currentVariable[nextKey] || {}, global); } return {}; } function getIifeCode(inputCode, outputOptions) { return rollup({ input: 'input', external: ['external'], plugins: [loader({ input: inputCode })] }) .then(bundle => bundle.generate({ format: 'iife', globals: { external: 'external' }, ...outputOptions }) ) .then(({ output }) => output[0].code); } function runTestsWithCode(code, outputOptions, expectedExports) { it('works with extend=false', () => { const options = { extend: false, ...outputOptions }; return getIifeCode(code, options).then(code => assert.deepEqual(runIifeTest(code, options), expectedExports, 'expected exports are returned') ); }); it('works with extend=true', () => { const options = { extend: true, ...outputOptions }; return getIifeCode(code, options).then(code => assert.deepEqual(runIifeTest(code, options), expectedExports, 'expected exports are returned') ); }); } for (const name of ['bundle', '@my.@nested/value.bundle']) for (const compact of [false, true]) describe(`The IIFE wrapper with name="${name}", compact=${compact}`, () => { const outputOptions = { compact, name }; describe('creating a bundle with neither exports nor imports', () => runTestsWithCode('assert.ok(true);', outputOptions, {})); describe('creating a bundle with named exports', () => runTestsWithCode('export const x = 42;', outputOptions, { x: 42 })); describe('creating a bundle with a default export', () => runTestsWithCode('export default {value: 42};', outputOptions, { value: 42 })); describe('creating a bundle with an external import', () => runTestsWithCode( 'import value from "external"; assert.equal(value, "external");', outputOptions, {} )); describe('creating a bundle with an external import and named exports', () => runTestsWithCode('import value from "external"; export const x = value;', outputOptions, { x: 'external' })); describe('creating a bundle with an external import and a default export', () => runTestsWithCode('import value from "external"; export default {value};', outputOptions, { value: 'external' })); }); describe('The IIFE wrapper with an illegal name', () => { it('fails if the name starts with a digit', () => getIifeCode('export const x = 42;', { name: '1name' }) .then(() => { throw new Error('Expected an error to be thrown.'); }) .catch(error => compareError(error, { code: 'ILLEGAL_IDENTIFIER_AS_NAME', message: 'Given name "1name" is not a legal JS identifier. If you need this, you can try "output.extend: true".', url: 'https://rollupjs.org/configuration-options/#output-extend' }) )); it('fails if the name contains an illegal character', () => getIifeCode('export const x = 42;', { name: 'my=name' }) .then(() => { throw new Error('Expected an error to be thrown.'); }) .catch(error => compareError(error, { code: 'ILLEGAL_IDENTIFIER_AS_NAME', message: 'Given name "my=name" is not a legal JS identifier. If you need this, you can try "output.extend: true".', url: 'https://rollupjs.org/configuration-options/#output-extend' }) )); it('does not fail for illegal characters if the extend option is used', () => getIifeCode('export const x = 42;', { name: 'my=name', extend: true }).then(code => assert.strictEqual( code, '(function (exports) {\n' + "\t'use strict';\n" + '\n' + '\tconst x = 42;\n' + '\n' + '\texports.x = x;\n' + '\n' + '})(this["my=name"] = this["my=name"] || {});\n' ) )); }); rollup-3.29.4/test/misc/in-memory-sourcemaps.js000066400000000000000000000016131450520414700214740ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); const { SourceMapConsumer } = require('source-map'); const rollup = require('../../dist/rollup'); const { loader } = require('../utils.js'); describe('in-memory sourcemaps', () => { it('generates an in-memory sourcemap', async () => { const bundle = await rollup.rollup({ input: 'main', plugins: [loader({ main: `console.log( 42 );` })] }); const { output: [generated] } = await bundle.generate({ format: 'cjs', sourcemap: true, sourcemapFile: path.resolve('bundle.js') }); const smc = await new SourceMapConsumer(generated.map); const locator = (await import('locate-character')).getLocator(generated.code, { offsetLine: 1 }); const loc = smc.originalPositionFor(locator('42')); // 42 assert.equal(loc.source, 'main'); assert.equal(loc.line, 1); assert.equal(loc.column, 13); }); }); rollup-3.29.4/test/misc/index.js000066400000000000000000000003211450520414700165030ustar00rootroot00000000000000require('./acorn-plugins'); require('./bundle-information'); require('./get-log-filter'); require('./iife'); require('./in-memory-sourcemaps'); require('./misc'); require('./sanity-checks'); require('./umd'); rollup-3.29.4/test/misc/misc.js000066400000000000000000000174421450520414700163430ustar00rootroot00000000000000const assert = require('node:assert'); const rollup = require('../../dist/rollup'); const { loader } = require('../utils.js'); describe('misc', () => { it('avoids modification of options or their properties', () => { const { freeze } = Object; return rollup.rollup( freeze({ input: 'input', external: freeze([]), plugins: freeze([ { name: 'loader', resolveId: freeze(() => 'input'), load: freeze(() => `export default 0;`) } ]), acornInjectPlugins: freeze([]), acorn: freeze({}), treeshake: freeze({}) }) ); }); it('warns if node builtins are unresolved in a non-CJS, non-ES bundle (#1051)', () => { const warnings = []; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `import { format } from 'util';\nexport default format( 'this is a %s', 'formatted string' );` }) ], onwarn: warning => warnings.push(warning) }) .then(bundle => bundle.generate({ format: 'iife', name: 'myBundle' }) ) .then(() => { const relevantWarnings = warnings.filter( warning => warning.code === 'MISSING_NODE_BUILTINS' ); assert.equal(relevantWarnings.length, 1); assert.equal( relevantWarnings[0].message, `Creating a browser bundle that depends on Node.js built-in modules ("util"). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node` ); }); }); it('warns when a global module name is guessed in a UMD bundle (#2358)', () => { const warnings = []; return rollup .rollup({ input: 'input', external: ['lodash'], plugins: [ loader({ input: `import * as _ from 'lodash'; console.log(_);` }) ], onwarn: warning => warnings.push(warning) }) .then(bundle => bundle.generate({ format: 'umd', globals: [], name: 'myBundle' }) ) .then(() => { delete warnings[0].toString; assert.deepEqual(warnings, [ { code: 'MISSING_GLOBAL_NAME', id: 'lodash', message: 'No name was provided for external module "lodash" in "output.globals" – guessing "_".', names: ['_'], url: 'https://rollupjs.org/configuration-options/#output-globals' } ]); }); }); it('sorts chunks in the output', () => { const warnings = []; return rollup .rollup({ input: ['main1', 'main2'], plugins: [ loader({ main1: 'import "dep";console.log("main1");', main2: 'import "dep";console.log("main2");', dep: 'console.log("dep");import("dyndep");', dyndep: 'console.log("dyndep");' }) ], onwarn: warning => warnings.push(warning) }) .then(bundle => bundle.generate({ format: 'es' })) .then(({ output }) => { assert.equal(warnings.length, 0); assert.deepEqual( output.map(({ fileName }) => fileName), ['main1.js', 'main2.js', 'dep-9394ae8f.js', 'dyndep-d5d54b59.js'] ); }); }); it('ignores falsy plugins', () => rollup.rollup({ input: 'x', plugins: [loader({ x: `console.log( 42 );` }), null, false, undefined] })); it('handles different import paths for different outputs', () => rollup .rollup({ input: 'x', external: ['the-answer'], plugins: [loader({ x: `import 'the-answer'` })] }) .then(bundle => Promise.all([ bundle .generate({ format: 'es' }) .then(generated => assert.equal(generated.output[0].code, "import 'the-answer';\n", 'no render path 1') ), bundle .generate({ format: 'es', paths: id => `//unpkg.com/${id}@?module` }) .then(generated => assert.equal( generated.output[0].code, "import '//unpkg.com/the-answer@?module';\n", 'with render path' ) ), bundle .generate({ format: 'es' }) .then(generated => assert.equal(generated.output[0].code, "import 'the-answer';\n", 'no render path 2') ) ]) )); it('allows passing the same object to `rollup` and `generate`', () => { const options = { input: 'input', onwarn(warning, handler) { if (warning.code !== 'INPUT_HOOK_IN_OUTPUT_PLUGIN') { handler(warning); } }, plugins: [ loader({ input: 'export default 42;' }) ], output: { format: 'es' } }; return rollup .rollup(options) .then(bundle => bundle.generate(options)) .then(output => assert.strictEqual( output.output[0].code, 'var input = 42;\n\nexport { input as default };\n' ) ); }); it('consistently handles comments when using the cache', async () => { const FILES = { main: `import value from "other"; console.log(value); /*#__PURE__*/console.log('removed');`, other: `var x = "foo"; export default x; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3RoZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvdGhlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFNLENBQUMsR0FBVyxLQUFLLENBQUM7QUFDeEIsZUFBZSxDQUFDLENBQUMifQ==` }; const EXPECTED_OUTPUT = `var x = "foo"; console.log(x); `; const firstBundle = await rollup.rollup({ input: 'main', plugins: [loader(FILES)] }); assert.strictEqual( (await firstBundle.generate({ format: 'es' })).output[0].code, EXPECTED_OUTPUT, 'first' ); const secondBundle = await rollup.rollup({ cache: firstBundle.cache, input: 'main', plugins: [loader(FILES)] }); assert.strictEqual( (await secondBundle.generate({ format: 'es' })).output[0].code, EXPECTED_OUTPUT, 'second' ); }); it('handles imports from chunks with names that correspond to parent directory names of other chunks', async () => { const bundle = await rollup.rollup({ input: { 'base/main': 'main.js', 'base/main/feature': 'feature.js', 'base/main/feature/sub': 'subfeature.js', 'base/main/feature/sub/sub': 'subsubfeature.js' }, plugins: [ loader({ 'main.js': 'export function fn () { return "main"; } console.log(fn());', 'feature.js': 'import { fn } from "main.js"; console.log(fn() + " feature");', 'subfeature.js': 'import { fn } from "main.js"; console.log(fn() + " subfeature");', 'subsubfeature.js': 'import { fn } from "main.js"; console.log(fn() + " subsubfeature");' }) ] }); const { output: [feature, subfeature, subsubfeature, main] } = await bundle.generate({ entryFileNames: `[name]`, chunkFileNames: `[name]`, format: 'es' }); assert.strictEqual(main.fileName, 'base/main'); assert.strictEqual(feature.fileName, 'base/main/feature'); assert.ok(feature.code.startsWith("import { fn } from '../main'")); assert.strictEqual(subfeature.fileName, 'base/main/feature/sub'); assert.ok(subfeature.code.startsWith("import { fn } from '../../main'")); assert.strictEqual(subsubfeature.fileName, 'base/main/feature/sub/sub'); assert.ok(subsubfeature.code.startsWith("import { fn } from '../../../main'")); }); it('throws the proper error on max call stack exception', async () => { const count = 10_000; let source = ''; for (let index = 0; index < count; index++) { source += `if (foo) {`; } for (let index = 0; index < count; index++) { source += '}'; } try { await rollup.rollup({ input: { input: 'input' }, plugins: [ loader({ input: source }) ] }); } catch (error) { assert.notDeepStrictEqual(error.message, 'Maximum call stack size exceeded'); assert.strictEqual(error.name, 'RollupError'); } }); it('supports rendering es after rendering iife with inlined dynamic imports', async () => { const bundle = await rollup.rollup({ input: 'main.js', plugins: [ loader({ 'main.js': "import('other.js');", 'other.js': "export const foo = 'bar';" }) ] }); await bundle.generate({ format: 'iife', inlineDynamicImports: true }); await bundle.generate({ format: 'es', exports: 'auto' }); }); }); rollup-3.29.4/test/misc/optionList.js000066400000000000000000000044661450520414700175560ustar00rootroot00000000000000exports.input = 'acorn, acornInjectPlugins, cache, context, experimentalCacheExpiry, experimentalLogSideEffects, external, inlineDynamicImports, input, logLevel, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileOps, maxParallelFileReads, moduleContext, onLog, onwarn, perf, plugins, preserveEntrySignatures, preserveModules, preserveSymlinks, shimMissingExports, strictDeprecations, treeshake, watch'; exports.flags = 'acorn, acornInjectPlugins, amd, assetFileNames, banner, bundleConfigAsCjs, c, cache, chunkFileNames, compact, config, configPlugin, context, d, dir, dynamicImportFunction, dynamicImportInCjs, e, entryFileNames, environment, esModule, experimentalCacheExpiry, experimentalDeepDynamicChunkOptimization, experimentalLogSideEffects, experimentalMinChunkSize, exports, extend, external, externalImportAssertions, externalLiveBindings, f, failAfterWarnings, file, filterLogs, footer, format, freeze, g, generatedCode, globals, h, hoistTransitiveImports, i, indent, inlineDynamicImports, input, interop, intro, logLevel, m, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileOps, maxParallelFileReads, minifyInternalExports, moduleContext, n, name, namespaceToStringTag, noConflict, o, onLog, onwarn, outro, p, paths, perf, plugin, plugins, preferConst, preserveEntrySignatures, preserveModules, preserveModulesRoot, preserveSymlinks, sanitizeFileName, shimMissingExports, silent, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, stdin, strict, strictDeprecations, systemNullSetters, treeshake, v, validate, w, waitForBundleInput, watch'; exports.output = 'amd, assetFileNames, banner, chunkFileNames, compact, dir, dynamicImportFunction, dynamicImportInCjs, entryFileNames, esModule, experimentalDeepDynamicChunkOptimization, experimentalMinChunkSize, exports, extend, externalImportAssertions, externalLiveBindings, file, footer, format, freeze, generatedCode, globals, hoistTransitiveImports, indent, inlineDynamicImports, interop, intro, manualChunks, minifyInternalExports, name, namespaceToStringTag, noConflict, outro, paths, plugins, preferConst, preserveModules, preserveModulesRoot, sanitizeFileName, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapFileNames, sourcemapIgnoreList, sourcemapPathTransform, strict, systemNullSetters, validate'; rollup-3.29.4/test/misc/sanity-checks.js000066400000000000000000000205471450520414700201550ustar00rootroot00000000000000const assert = require('node:assert'); const rollup = require('../../dist/rollup'); const { loader, compareError } = require('../utils.js'); describe('sanity checks', () => { it('exists', () => { assert.ok(!!rollup); }); it('has a rollup method', () => { assert.equal(typeof rollup.rollup, 'function'); }); it('fails without options', async () => { let error = null; try { await rollup.rollup(); } catch (buildError) { error = buildError; } assert.strictEqual(error && error.message, 'You must supply an options object to rollup'); }); it('node API passes warning and default handler to custom onwarn function', async () => { let parameters; await rollup.rollup({ input: 'x', plugins: [loader({ x: `eval(42);` })], onwarn(warning, onwarn) { parameters = [warning, onwarn]; } }); assert.equal(parameters[0].code, 'EVAL'); assert.equal( parameters[0].message, 'Use of eval in "x" is strongly discouraged as it poses security risks and may cause issues with minification.' ); assert.equal(typeof parameters[1], 'function'); }); it('fails without options.input', async () => { let error = null; try { await rollup.rollup({}); } catch (buildError) { error = buildError; } assert.strictEqual(error && error.message, 'You must supply options.input to rollup'); }); it('includes a newline at the end of the bundle', async () => { const bundle = await rollup.rollup({ input: 'x', plugins: [loader({ x: `console.log( 42 );` })] }); const { output: [{ code }] } = await bundle.generate({ format: 'iife' }); assert.ok(code[code.length - 1] === '\n'); }); it('throws on missing output options when generating a bundle', async () => { let error = null; const bundle = await rollup.rollup({ input: 'x', plugins: [loader({ x: `console.log( 42 );` })] }); try { await bundle.generate(); } catch (generateError) { error = generateError; } assert.strictEqual(error && error.message, 'You must supply an options object'); }); it('throws on missing output options when writing a bundle', async () => { let error = null; const bundle = await rollup.rollup({ input: 'x', plugins: [loader({ x: `console.log( 42 );` })] }); try { await bundle.write(); } catch (writeError) { error = writeError; } assert.strictEqual(error && error.message, 'You must supply an options object'); try { await bundle.write({ format: 'es' }); } catch (writeError) { error = writeError; } assert.strictEqual( error && error.message, 'You must specify "output.file" or "output.dir" for the build.' ); }); it('throws on incorrect bundle.generate format option', async () => { let error = null; const bundle = await rollup.rollup({ input: 'x', plugins: [loader({ x: `console.log( 42 );` })] }); try { await bundle.generate({ file: 'x', format: 'vanilla' }); } catch (generateError) { error = generateError; } assert.strictEqual( error && error.message, 'Invalid value "vanilla" for option "output.format" - Valid values are "amd", "cjs", "system", "es", "iife" or "umd".' ); }); it('defaults to output format `es` if not specified', async () => { const bundle = await rollup.rollup({ input: 'x', plugins: [loader({ x: `export function foo(x){ console.log(x); }` })] }); const { output: [{ code }] } = await bundle.generate({}); assert.equal(code, `function foo(x){ console.log(x); }\n\nexport { foo };\n`); }); it('reuses existing error object', async () => { class CustomError extends Error { constructor(message, x) { super(message); this.prop = x.toUpperCase(); } } let error = null; const customError = new CustomError('foo', 'bar'); try { await rollup.rollup({ input: 'x', plugins: [ loader({ x: `console.log( 42 );` }), { transform() { this.error(customError); } } ] }); } catch (buildError) { error = buildError; } assert.strictEqual(error, customError); }); it('throws when using multiple inputs together with the "file" option', async () => { let error = null; const bundle = await rollup.rollup({ input: ['x', 'y'], plugins: [loader({ x: 'console.log( "x" );', y: 'console.log( "y" );' })] }); try { await bundle.generate({ file: 'x', format: 'es' }); } catch (generateError) { error = generateError; } assert.strictEqual( error && error.message, 'Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.' ); }); it('does not throw when using a single element array of inputs together with the "file" option', async () => { const bundle = await rollup.rollup({ input: ['x'], plugins: [loader({ x: 'console.log( "x" );' })] }); await bundle.generate({ file: 'x', format: 'es' }); }); it('throws when using dynamic imports with the "file" option', async () => { let error = null; const bundle = await rollup.rollup({ input: 'x', plugins: [loader({ x: 'console.log( "x" );import("y");', y: 'console.log( "y" );' })] }); try { await bundle.generate({ file: 'x', format: 'es' }); } catch (generateError) { error = generateError; } assert.strictEqual( error && error.message, 'Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.' ); }); it('does not throw when using dynamic imports with the "file" option and "inlineDynamicImports"', async () => { const bundle = await rollup.rollup({ input: 'x', plugins: [loader({ x: 'console.log( "x" );import("y");', y: 'console.log( "y" );' })] }); await bundle.generate({ file: 'x', format: 'es', inlineDynamicImports: true }); }); it('throws when using the object form of "input" together with the "file" option', async () => { let error = null; const bundle = await rollup.rollup({ input: { main: 'x' }, plugins: [loader({ x: 'console.log( "x" );' })] }); try { await bundle.generate({ file: 'x', format: 'es' }); } catch (generateError) { error = generateError; } assert.strictEqual( error && error.message, 'Invalid value for option "output.file" - you must set "output.dir" instead of "output.file" when providing named inputs.' ); }); it('throws when using preserveModules together with the "file" option', async () => { let error = null; const bundle = await rollup.rollup({ input: 'x', plugins: [loader({ x: 'console.log( "x" );' })] }); try { await bundle.generate({ file: 'x', format: 'es', preserveModules: true }); } catch (generateError) { error = generateError; } assert.strictEqual( error && error.message, 'Invalid value for option "output.file" - you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option.' ); }); it('prevents generating and writing from a closed bundle', async () => { let error = null; const bundle = await rollup.rollup({ input: 'x', plugins: [loader({ x: 'console.log( "x" );' })] }); bundle.close(); // Can be safely called multiple times bundle.close(); try { await bundle.generate({ file: 'x', format: 'es' }); } catch (generateError) { error = generateError; } compareError(error, { code: 'ALREADY_CLOSED', message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.' }); error = null; try { await bundle.write({ file: 'x', format: 'es' }); } catch (writeError) { error = writeError; } compareError(error, { code: 'ALREADY_CLOSED', message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.' }); error = null; }); it('triggers a warning when using output.amd.id together with the "dir" option', async () => { let warning = null; const bundle = await rollup.rollup({ input: 'input', plugins: [loader({ input: `import('dep')`, dep: `console.log('dep')` })], onwarn: w => (warning = w) }); await bundle.generate({ dir: 'x', format: 'amd', amd: { id: 'something' } }); assert.strictEqual( warning && warning.message, 'Invalid value for option "output.amd.id" - this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead.' ); }); }); rollup-3.29.4/test/misc/umd.js000066400000000000000000000140671450520414700161750ustar00rootroot00000000000000const assert = require('node:assert'); const { rollup } = require('../../dist/rollup'); const { loader } = require('../utils.js'); function runTestCode(code, thisValue, globals) { const globalThisDesc = Object.getOwnPropertyDescriptor(global, 'globalThis'); delete global.globalThis; const globalsWithAssert = { ...globals, assert }; const globalKeys = Object.keys(globalsWithAssert); const function_ = new Function(globalKeys, code); function_.apply( thisValue, globalKeys.map(key => globalsWithAssert[key]) ); if (globalThisDesc) { Object.defineProperty(global, 'globalThis', globalThisDesc); } } function runNodeTest(code) { const module = { exports: {} }; runTestCode(code, module.exports, { module, exports: module.exports, require: importee => { if (importee !== 'external') { throw new Error(`Tried to import unknown "${importee}".`); } return runNodeTest('module.exports = "external";'); } }); return module.exports; } function runAmdTest(code) { let defineArguments; function define(...parameters) { defineArguments = parameters; } define.amd = true; runTestCode(code, undefined, { define }); if (typeof defineArguments[0] === 'function') { return defineArguments[0]() || {}; } const module = { exports: {} }; const result = defineArguments[1]( ...defineArguments[0].map(injection => { switch (injection) { case 'module': { return module; } case 'exports': { return module.exports; } case 'external': { return 'external'; } default: { throw new Error(`unexpected AMD injection ${injection}`); } } }) ) || {}; return defineArguments[0].includes('exports') ? module.exports : result; } function runIifeTestWithThis(code, outputOptions) { const global = { external: 'external' }; runTestCode(code, global, {}); return getAndCheckIifeExports(global, outputOptions); } function runStrictIifeTestWithSelf(code, outputOptions) { const global = { external: 'external' }; runTestCode('"use strict";' + code, undefined, { self: global }); return getAndCheckIifeExports(global, outputOptions); } function runStrictIifeTestWithGlobalThis(code, outputOptions) { const global = { external: 'external' }; runTestCode('"use strict";' + code, undefined, { globalThis: global }); return getAndCheckIifeExports(global, outputOptions); } function runIifeWithExistingValuesTest(code, outputOptions) { const global = { external: 'external', bundle: 'previous', my: { '@nested/value': { bundle: 'previous' } } }; runTestCode(code, global, {}); const exports = getAndCheckIifeExports(global, outputOptions); if (outputOptions.noConflict) { // As "noConflict" was already called when getting the exports, the previous globals should be restored assert.deepEqual( global, { external: 'external', bundle: 'previous', my: { '@nested/value': { bundle: 'previous' } } }, 'noConflict restores global' ); } return exports === 'previous' ? {} : exports; } function getAndCheckIifeExports(global, outputOptions) { const exports = getIifeExports(global, outputOptions); if (outputOptions.noConflict) { assert.deepEqual(exports.noConflict(), exports, 'noConflict() returns exports'); delete exports.noConflict; } return exports; } function getIifeExports(global, outputOptions) { if (outputOptions.name) { return outputOptions.name .split('.') .reduce((currentVariable, nextKey) => currentVariable[nextKey] || {}, global); } return {}; } async function getUmdCode(inputCode, outputOptions) { const bundle = await rollup({ input: 'input', external: ['external'], plugins: [loader({ input: inputCode })] }); const { output } = await bundle.generate({ format: 'umd', globals: { external: 'external' }, ...outputOptions }); return output[0].code; } function runTestsWithCode(code, outputOptions, expectedExports) { let umdCodePromise; function getUmdCodePromise() { if (umdCodePromise) { return umdCodePromise; } return (umdCodePromise = getUmdCode(code, outputOptions)); } for (const { environmentName, runTest } of [ { environmentName: 'node', runTest: runNodeTest }, { environmentName: 'amd', runTest: runAmdTest }, { environmentName: 'iife with this', runTest: runIifeTestWithThis }, { environmentName: 'strict mode iife with self', runTest: runStrictIifeTestWithSelf }, { environmentName: 'strict mode iife with globalThis', runTest: runStrictIifeTestWithGlobalThis }, { environmentName: 'iife with existing globals', runTest: runIifeWithExistingValuesTest } ]) it(`works in ${environmentName} environment`, async () => { assert.deepEqual( runTest(await getUmdCodePromise(), outputOptions), expectedExports, 'expected exports are returned' ); }); } for (const name of ['bundle', 'my.@nested/value.bundle']) for (const compact of [false, true]) { for (const noConflict of [false, true]) describe(`The UMD wrapper with name="${name}", compact=${compact}, noConflict=${noConflict}`, () => { const outputOptions = { compact, name, noConflict }; describe('creating a bundle with neither exports nor imports', () => runTestsWithCode('assert.ok(true);', outputOptions, {})); describe('creating a bundle with named exports', () => runTestsWithCode('export const x = 42;', outputOptions, { x: 42 })); describe('creating a bundle with a default export', () => runTestsWithCode('export default {value: 42};', outputOptions, { value: 42 })); describe('creating a bundle with an external import', () => runTestsWithCode( 'import value from "external"; assert.equal(value, "external");', outputOptions, {} )); describe('creating a bundle with an external import and named exports', () => runTestsWithCode('import value from "external"; export const x = value;', outputOptions, { x: 'external' })); describe('creating a bundle with an external import and a default export', () => runTestsWithCode('import value from "external"; export default {value};', outputOptions, { value: 'external' })); }); } rollup-3.29.4/test/node_modules/000077500000000000000000000000001450520414700165645ustar00rootroot00000000000000rollup-3.29.4/test/node_modules/external-esm/000077500000000000000000000000001450520414700211705ustar00rootroot00000000000000rollup-3.29.4/test/node_modules/external-esm/index.js000066400000000000000000000000441450520414700226330ustar00rootroot00000000000000export default { external: true }; rollup-3.29.4/test/node_modules/external-esm/package.json000066400000000000000000000000531450520414700234540ustar00rootroot00000000000000{ "type": "module", "main": "index.js" } rollup-3.29.4/test/node_modules/external.js000066400000000000000000000000461450520414700207440ustar00rootroot00000000000000module.exports = { external: true }; rollup-3.29.4/test/sourcemaps/000077500000000000000000000000001450520414700162705ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/define.d.ts000066400000000000000000000002211450520414700203070ustar00rootroot00000000000000import type { TestConfigSourcemap } from '../types'; declare global { function defineTest(config: TestConfigSourcemap): TestConfigSourcemap; } rollup-3.29.4/test/sourcemaps/getLocation.js000066400000000000000000000012621450520414700210770ustar00rootroot00000000000000/** * @param {string} source * @param {string | number} search * @returns {{ line: number, column: number } | undefined} */ module.exports = function getLocation(source, search) { var lines = source.split('\n'); var length_ = lines.length; var lineStart = 0; var index; const charIndex = typeof search === 'number' ? search : source.indexOf(search); for (index = 0; index < length_; index += 1) { var line = lines[index]; var lineEnd = lineStart + line.length + 1; // +1 for newline if (lineEnd > charIndex) { return { line: index + 1, column: charIndex - lineStart }; } lineStart = lineEnd; } throw new Error('Could not determine location of character'); }; rollup-3.29.4/test/sourcemaps/index.js000066400000000000000000000040571450520414700177430ustar00rootroot00000000000000const path = require('node:path'); /** * @type {import('../../src/rollup/types')} Rollup */ // @ts-expect-error not included in types const rollup = require('../../dist/rollup'); // @ts-expect-error not included in types const { compareLogs, runTestSuiteWithSamples } = require('../utils.js'); const FORMATS = ['amd', 'cjs', 'system', 'es', 'iife', 'umd']; runTestSuiteWithSamples( 'sourcemaps', path.resolve(__dirname, 'samples'), /** * @param {import('../types').TestConfigSourcemap} config */ (directory, config) => { (config.skip ? describe.skip : config.solo ? describe.only : describe)( path.basename(directory) + ': ' + config.description, () => { for (const format of config.formats || FORMATS) { it('generates ' + format, async () => { process.chdir(directory); const warnings = []; const inputOptions = { input: directory + '/main.js', onwarn: warning => warnings.push(warning), strictDeprecations: true, ...config.options }; const outputOptions = { exports: 'auto', file: directory + '/_actual/bundle.' + format + '.js', format, sourcemap: true, ...(config.options || {}).output }; let bundle = await rollup.rollup(inputOptions); await generateAndTestBundle(bundle, outputOptions, config, format, warnings); // cache rebuild does not reemit warnings. if (config.warnings) { return; } // test cache noop rebuild bundle = await rollup.rollup({ cache: bundle, ...inputOptions }); await generateAndTestBundle(bundle, outputOptions, config, format, warnings); }); } } ); } ); async function generateAndTestBundle(bundle, outputOptions, config, format, warnings) { if (config.warnings) { compareLogs(warnings, config.warnings); } else if (warnings.length > 0) { throw new Error(`Unexpected warnings`); } const { output: [{ code, map, fileName, sourcemapFileName }] } = await bundle.write(outputOptions); await config.test(code, map, { fileName, sourcemapFileName, format }); } rollup-3.29.4/test/sourcemaps/samples/000077500000000000000000000000001450520414700177345ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/basic-support/000077500000000000000000000000001450520414700225275ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/basic-support/_config.js000066400000000000000000000023611450520414700244730ustar00rootroot00000000000000const assert = require('node:assert'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'basic sourcemap support', async test(code, map) { assert.equal(map.version, 3); assert.ok(/^bundle\.(\w+)\.js/.test(map.file)); const smc = await new SourceMapConsumer(map); let generatedLoc; let originalLoc; // main.js generatedLoc = getLocation(code, code.indexOf("console.log( 'hello from main.js' )")); originalLoc = smc.originalPositionFor(generatedLoc); assert.equal(originalLoc.line, 4); assert.equal(originalLoc.column, 0); assert.equal(originalLoc.source, '../main.js'); // foo.js generatedLoc = getLocation(code, code.indexOf("console.log( 'hello from foo.js' )")); originalLoc = smc.originalPositionFor(generatedLoc); assert.equal(originalLoc.line, 2); assert.equal(originalLoc.column, 1); assert.equal(originalLoc.source, '../foo.js'); // bar.js generatedLoc = getLocation(code, code.indexOf("console.log( 'hello from bar.js' )")); originalLoc = smc.originalPositionFor(generatedLoc); assert.equal(originalLoc.line, 2); assert.equal(originalLoc.column, 1); assert.equal(originalLoc.source, '../bar.js'); } }); rollup-3.29.4/test/sourcemaps/samples/basic-support/bar.js000066400000000000000000000001101450520414700236210ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-3.29.4/test/sourcemaps/samples/basic-support/foo.js000066400000000000000000000001101450520414700236400ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-3.29.4/test/sourcemaps/samples/basic-support/main.js000066400000000000000000000001471450520414700240130ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-3.29.4/test/sourcemaps/samples/combined-sourcemap-with-loader/000077500000000000000000000000001450520414700257255ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/combined-sourcemap-with-loader/_config.js000066400000000000000000000051131450520414700276670ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync } = require('node:fs'); const buble = require('buble'); const MagicString = require('magic-string').default; const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'get combined sourcemap in transforming with loader', options: { plugins: [ { name: 'test-plugin1', load(id) { const code = readFileSync(id, 'utf8'); const out = buble.transform(code, { transforms: { modules: false }, sourceMap: true, source: id }); return { code: out.code, map: out.map }; } }, { name: 'test-plugin2', async transform(code, id) { const sourcemap = this.getCombinedSourcemap(); const smc = await new SourceMapConsumer(sourcemap); const s = new MagicString(code); if (/foo.js$/.test(id)) { testFoo(code, smc); s.prepend('console.log("foo start");\n\n'); s.append('\nconsole.log("foo end");'); } else { testMain(code, smc); s.appendRight(code.indexOf('console'), 'console.log("main start");\n\n'); s.append('\nconsole.log("main end");'); } return { code: s.toString(), map: s.generateMap({ hires: true }) }; } }, { name: 'test-plugin3', async transform(code, id) { const sourcemap = this.getCombinedSourcemap(); const smc = await new SourceMapConsumer(sourcemap); const s = new MagicString(code); if (/foo.js$/.test(id)) { testFoo(code, smc); s.prepend('console.log("-- foo ---");\n\n'); s.append('\nconsole.log("-----");'); } else { testMain(code, smc); s.appendRight(code.indexOf('console'), 'console.log("-- main ---");\n\n'); s.append('\nconsole.log("-----");'); } return { code: s.toString(), map: s.generateMap({ hires: true }) }; } } ] }, async test(code, map) { const smc = await new SourceMapConsumer(map); testFoo(code, smc); testMain(code, smc); } }); function testFoo(code, smc) { const generatedLoc = getLocation(code, code.indexOf(42)); const originalLoc = smc.originalPositionFor(generatedLoc); assert.ok(/foo/.test(originalLoc.source)); assert.equal(originalLoc.line, 1); assert.equal(originalLoc.column, 25); } function testMain(code, smc) { const generatedLoc = getLocation(code, code.indexOf('info')); const originalLoc = smc.originalPositionFor(generatedLoc); assert.ok(/main/.test(originalLoc.source)); assert.equal(originalLoc.line, 3); assert.equal(originalLoc.column, 8); } rollup-3.29.4/test/sourcemaps/samples/combined-sourcemap-with-loader/foo.js000066400000000000000000000000351450520414700270440ustar00rootroot00000000000000export const foo = () => 42; rollup-3.29.4/test/sourcemaps/samples/combined-sourcemap-with-loader/main.js000066400000000000000000000001101450520414700271770ustar00rootroot00000000000000import { foo } from './foo'; console.info( `the answer is ${foo()}` ); rollup-3.29.4/test/sourcemaps/samples/combined-sourcemap/000077500000000000000000000000001450520414700235105ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/combined-sourcemap/_config.js000066400000000000000000000043351450520414700254570ustar00rootroot00000000000000const assert = require('node:assert'); const MagicString = require('magic-string').default; const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'get combined sourcemap in transforming', options: { plugins: [ { name: 'test-plugin1', async transform(code, id) { const sourcemap = this.getCombinedSourcemap(); const smc = await new SourceMapConsumer(sourcemap); const s = new MagicString(code); if (/foo.js$/.test(id)) { testFoo(code, smc); s.prepend('console.log("foo start");\n\n'); s.append('\nconsole.log("foo end");'); } else { testMain(code, smc); s.appendRight(code.indexOf('console'), 'console.log("main start");\n\n'); s.append('\nconsole.log("main end");'); } return { code: s.toString(), map: s.generateMap({ hires: true }) }; } }, { name: 'test-plugin2', async transform(code, id) { const sourcemap = this.getCombinedSourcemap(); const smc = await new SourceMapConsumer(sourcemap); const s = new MagicString(code); if (/foo.js$/.test(id)) { testFoo(code, smc); s.prepend('console.log("-- foo ---");\n\n'); s.append('\nconsole.log("-----");'); } else { testMain(code, smc); s.appendRight(code.indexOf('console'), 'console.log("-- main ---");\n\n'); s.append('\nconsole.log("-----");'); } return { code: s.toString(), map: s.generateMap({ hires: true }) }; } } ] }, async test(code, map) { const smc = await new SourceMapConsumer(map); testFoo(code, smc); testMain(code, smc); } }); function testFoo(code, smc) { const generatedLoc = getLocation(code, code.indexOf(42)); const originalLoc = smc.originalPositionFor(generatedLoc); assert.ok(/foo/.test(originalLoc.source)); assert.equal(originalLoc.line, 1); assert.equal(originalLoc.column, 25); } function testMain(code, smc) { const generatedLoc = getLocation(code, code.indexOf('info')); const originalLoc = smc.originalPositionFor(generatedLoc); assert.ok(/main/.test(originalLoc.source)); assert.equal(originalLoc.line, 3); assert.equal(originalLoc.column, 8); } rollup-3.29.4/test/sourcemaps/samples/combined-sourcemap/foo.js000066400000000000000000000000351450520414700246270ustar00rootroot00000000000000export const foo = () => 42; rollup-3.29.4/test/sourcemaps/samples/combined-sourcemap/main.js000066400000000000000000000001101450520414700247620ustar00rootroot00000000000000import { foo } from './foo'; console.info( `the answer is ${foo()}` ); rollup-3.29.4/test/sourcemaps/samples/excludes-plugin-helpers/000077500000000000000000000000001450520414700245045ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/excludes-plugin-helpers/_config.js000066400000000000000000000012501450520414700264440ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync } = require('node:fs'); const path = require('node:path'); const HELPER = '\0helper'; module.exports = defineTest({ description: 'excludes plugin helpers from sources', options: { output: { format: 'cjs' }, plugins: [ { name: 'test-plugin', resolveId(id) { if (id === HELPER) return id; }, load(id) { if (id === HELPER) { return readFileSync(path.join(__dirname, 'helper.js'), 'utf8'); } } } ] }, test: (code, map) => { assert.equal(map.sources.length, 1); assert.equal(map.sourcesContent.length, 1); assert.ok(/main/.test(map.sources[0])); } }); rollup-3.29.4/test/sourcemaps/samples/excludes-plugin-helpers/helper.js000066400000000000000000000001061450520414700263160ustar00rootroot00000000000000export default function foo ( input ) { assert.equal( input, 42 ); } rollup-3.29.4/test/sourcemaps/samples/excludes-plugin-helpers/main.js000066400000000000000000000000501450520414700257610ustar00rootroot00000000000000import foo from '\0helper'; foo( 42 ); rollup-3.29.4/test/sourcemaps/samples/existing-external-sourcemaps-combined/000077500000000000000000000000001450520414700273435ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/existing-external-sourcemaps-combined/_config.js000066400000000000000000000003121450520414700313010ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'removes sourcemap comments', async test(code) { assert.ok(!code.includes('sourceMappingURL=main.js.map')); } }); rollup-3.29.4/test/sourcemaps/samples/existing-external-sourcemaps-combined/main.js000066400000000000000000000001521450520414700306230ustar00rootroot00000000000000import value from "./other"; const s = `other: ${value}`; console.log(s); //# sourceMappingURL=main.js.maprollup-3.29.4/test/sourcemaps/samples/existing-external-sourcemaps-combined/main.js.map000066400000000000000000000003141450520414700313770ustar00rootroot00000000000000{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,MAAM,CAAC,GAAW,UAAU,KAAK,EAAE,CAAC;AAEpC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC"}rollup-3.29.4/test/sourcemaps/samples/existing-external-sourcemaps-combined/other.js000066400000000000000000000001041450520414700310150ustar00rootroot00000000000000const x = "foo"; export default x; //# sourceMappingURL=other.js.maprollup-3.29.4/test/sourcemaps/samples/existing-external-sourcemaps-combined/other.js.map000066400000000000000000000002211450520414700315710ustar00rootroot00000000000000{"version":3,"file":"other.js","sourceRoot":"","sources":["other.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,GAAW,KAAK,CAAC;AACxB,eAAe,CAAC,CAAC"}rollup-3.29.4/test/sourcemaps/samples/existing-inline-sourcemaps-combined/000077500000000000000000000000001450520414700267775ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/existing-inline-sourcemaps-combined/_config.js000066400000000000000000000003131450520414700307360ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'removes existing inline sourcemaps', async test(code) { assert.ok(!code.includes('sourceMappingURL=data')); } }); rollup-3.29.4/test/sourcemaps/samples/existing-inline-sourcemaps-combined/main.js000066400000000000000000000006141450520414700302620ustar00rootroot00000000000000import value from "./other"; const s = `other: ${value}`; console.log(s); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm1haW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sU0FBUyxDQUFDO0FBRTVCLE1BQU0sQ0FBQyxHQUFXLFVBQVUsS0FBSyxFQUFFLENBQUM7QUFFcEMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyJ9rollup-3.29.4/test/sourcemaps/samples/existing-inline-sourcemaps-combined/other.js000066400000000000000000000004311450520414700304540ustar00rootroot00000000000000const x = "foo"; export default x; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3RoZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvdGhlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsR0FBVyxLQUFLLENBQUM7QUFDeEIsZUFBZSxDQUFDLENBQUMifQ==rollup-3.29.4/test/sourcemaps/samples/ignore-list-default/000077500000000000000000000000001450520414700236125ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/ignore-list-default/_config.js000066400000000000000000000007551450520414700255630ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'defaults to adding files within node_modules to the ignore list', options: { output: { name: 'myModule', file: path.resolve(__dirname, '_actual/bundle.js'), sourcemapPathTransform: sourcePath => path.basename(sourcePath) } }, test(code, map) { assert.deepEqual(map.sources, ['lib.js', 'main.js']); assert.deepEqual(map.x_google_ignoreList, [0]); } }); rollup-3.29.4/test/sourcemaps/samples/ignore-list-default/main.js000066400000000000000000000001021450520414700250650ustar00rootroot00000000000000import one from './node_modules/lib.js'; export default one * 2; rollup-3.29.4/test/sourcemaps/samples/ignore-list-default/node_modules/000077500000000000000000000000001450520414700262675ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/ignore-list-default/node_modules/lib.js000066400000000000000000000000221450520414700273650ustar00rootroot00000000000000export default 1; rollup-3.29.4/test/sourcemaps/samples/ignore-list-false/000077500000000000000000000000001450520414700232605ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/ignore-list-false/_config.js000066400000000000000000000010641450520414700252230ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'accepts false for `sourcemapIgnoreList` to disable the default ignore-listing of node_modules', options: { output: { name: 'myModule', file: path.resolve(__dirname, '_actual/bundle.js'), sourcemapPathTransform: sourcePath => path.basename(sourcePath), sourcemapIgnoreList: false } }, test(code, map) { assert.deepEqual(map.sources, ['lib.js', 'main.js']); assert.strictEqual(map.x_google_ignoreList, undefined); } }); rollup-3.29.4/test/sourcemaps/samples/ignore-list-false/main.js000066400000000000000000000001021450520414700245330ustar00rootroot00000000000000import one from './node_modules/lib.js'; export default one * 5; rollup-3.29.4/test/sourcemaps/samples/ignore-list-false/node_modules/000077500000000000000000000000001450520414700257355ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/ignore-list-false/node_modules/lib.js000066400000000000000000000000221450520414700270330ustar00rootroot00000000000000export default 1; rollup-3.29.4/test/sourcemaps/samples/ignore-list-source-files/000077500000000000000000000000001450520414700245665ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/ignore-list-source-files/_config.js000066400000000000000000000010241450520414700265250ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'populates ignore list', options: { output: { name: 'myModule', file: path.resolve(__dirname, '_actual/bundle.js'), sourcemapIgnoreList: sourcePath => sourcePath.includes('lib'), sourcemapPathTransform: sourcePath => path.basename(sourcePath) } }, test(code, map) { assert.deepEqual(map.sources, ['lib1.js', 'lib2.js', 'main.js']); assert.deepEqual(map.x_google_ignoreList, [0, 1]); } }); rollup-3.29.4/test/sourcemaps/samples/ignore-list-source-files/lib1.js000066400000000000000000000000221450520414700257450ustar00rootroot00000000000000export default 1; rollup-3.29.4/test/sourcemaps/samples/ignore-list-source-files/lib2.js000066400000000000000000000000221450520414700257460ustar00rootroot00000000000000export default 2; rollup-3.29.4/test/sourcemaps/samples/ignore-list-source-files/main.js000066400000000000000000000001251450520414700260460ustar00rootroot00000000000000import one from './lib1.js'; import two from './lib2.js'; export default one + two; rollup-3.29.4/test/sourcemaps/samples/ignore-list-sourcemap-path/000077500000000000000000000000001450520414700251165ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/ignore-list-sourcemap-path/_config.js000066400000000000000000000013001450520414700270520ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'correctly passes source map path', options: { output: { name: 'myModule', file: path.resolve(__dirname, '_actual/output.js'), sourcemapIgnoreList: (relativeSourcePath, sourcemapPath) => path.basename(sourcemapPath) === 'output.js.map' && path.basename(path.dirname(sourcemapPath)) === '_actual' && path.basename(relativeSourcePath) === 'main.js', sourcemapPathTransform: relativeSourcePath => path.basename(relativeSourcePath) } }, test(code, map) { assert.deepEqual(map.sources, ['main.js']); assert.deepEqual(map.x_google_ignoreList, [0]); } }); rollup-3.29.4/test/sourcemaps/samples/ignore-list-sourcemap-path/main.js000066400000000000000000000000231450520414700263730ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/sourcemaps/samples/loaders/000077500000000000000000000000001450520414700213655ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/loaders/_config.js000066400000000000000000000035351450520414700233350ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync } = require('node:fs'); const buble = require('buble'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'preserves sourcemap chains when transforming', options: { plugins: [ { load(id) { if (/foo.js$/.test(id)) { id = id.replace(/foo.js$/, 'bar.js'); } else if (/bar.js$/.test(id)) { id = id.replace(/bar.js$/, 'foo.js'); } const code = readFileSync(id, 'utf8'); const out = buble.transform(code, { transforms: { modules: false }, sourceMap: true, source: id }); if (!/main.js$/.test(id)) { const slash = out.map.sources[0].lastIndexOf('/') + 1; out.map.sources = out.map.sources.map(source => '../' + source.slice(slash)); out.map.sourceRoot = 'fake'; } return { code: out.code, map: out.map }; } } ] }, async test(code, map) { const smc = await new SourceMapConsumer(map); let generatedLoc; let originalLoc; generatedLoc = getLocation(code, code.indexOf('22')); originalLoc = smc.originalPositionFor(generatedLoc); assert.equal(originalLoc.source, '../foo.js'); assert.equal(originalLoc.line, 1); assert.equal(originalLoc.column, 32); generatedLoc = getLocation(code, code.indexOf('20')); originalLoc = smc.originalPositionFor(generatedLoc); assert.equal(originalLoc.source, '../bar.js'); assert.equal(originalLoc.line, 1); assert.equal(originalLoc.column, 37); generatedLoc = getLocation(code, code.indexOf('log')); originalLoc = smc.originalPositionFor(generatedLoc); assert.equal(originalLoc.source, '../main.js'); assert.ok(/columns/.test(smc.sourceContentFor('../main.js'))); assert.equal(originalLoc.line, 4); assert.equal(originalLoc.column, 19); } }); rollup-3.29.4/test/sourcemaps/samples/loaders/bar.js000066400000000000000000000000511450520414700224630ustar00rootroot00000000000000/*misalign*/export const foo = () => 20; rollup-3.29.4/test/sourcemaps/samples/loaders/foo.js000066400000000000000000000000441450520414700225040ustar00rootroot00000000000000/*the*/export const bar = () => 22; rollup-3.29.4/test/sourcemaps/samples/loaders/main.js000066400000000000000000000001671450520414700226530ustar00rootroot00000000000000import { foo } from './foo'; import { bar } from './bar'; /*columns*/console.log( `the answer is ${foo() + bar()}` ); rollup-3.29.4/test/sourcemaps/samples/names-transformed-render-chunk/000077500000000000000000000000001450520414700257445ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/names-transformed-render-chunk/_config.js000066400000000000000000000026311450520414700277100ustar00rootroot00000000000000const assert = require('node:assert'); const MagicString = require('magic-string'); const { SourceMapConsumer } = require('source-map'); const terser = require('terser'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'names are recovered if transforms are used', options: { plugins: [ { transform(code) { const s = new MagicString(code); const pattern = /mangleMe/g; let match; while ((match = pattern.exec(code))) { s.overwrite(match.index, match.index + match[0].length, 'mangleMePlease', { storeName: true, contentOnly: false }); } return { code: s.toString(), map: s.generateMap({ hires: true }) }; }, renderChunk(code) { return terser.minify(code, { sourceMap: { filename: 'x' } }); } } ] }, async test(code, map) { const smc = await new SourceMapConsumer(map); let generatedLoc = getLocation(code, /\w+=["']this/.exec(code).index); let originalLoc = smc.originalPositionFor(generatedLoc); assert.deepEqual(originalLoc, { source: '../a.js', line: 1, column: 4, name: 'mangleMe' }); generatedLoc = getLocation(code, /\w+=["']nor/.exec(code).index); originalLoc = smc.originalPositionFor(generatedLoc); assert.deepEqual(originalLoc, { source: '../b.js', line: 1, column: 4, name: 'mangleMe' }); } }); rollup-3.29.4/test/sourcemaps/samples/names-transformed-render-chunk/a.js000066400000000000000000000001771450520414700265270ustar00rootroot00000000000000var mangleMe = "this string should not be inlined".toLowerCase(); export default function () { assert.equal( mangleMe, 1 ); } rollup-3.29.4/test/sourcemaps/samples/names-transformed-render-chunk/b.js000066400000000000000000000001611450520414700265210ustar00rootroot00000000000000var mangleMe = "nor should this one".toLowerCase(); export default function () { assert.equal( mangleMe, 2 ); } rollup-3.29.4/test/sourcemaps/samples/names-transformed-render-chunk/main.js000066400000000000000000000000731450520414700272260ustar00rootroot00000000000000import a from './a.js'; import b from './b.js'; a(); b(); rollup-3.29.4/test/sourcemaps/samples/names/000077500000000000000000000000001450520414700210375ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/names/_config.js000066400000000000000000000015661450520414700230110ustar00rootroot00000000000000const assert = require('node:assert'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'names are recovered (https://github.com/rollup/rollup/issues/101)', options: { output: { name: 'myModule' } }, async test(code, map) { const smc = await new SourceMapConsumer(map); let pattern = /Object\.create\( ([\w$]+)\.prototype \)/; let match = pattern.exec(code); let generatedLoc = getLocation(code, match.index + 'Object.create ( '.length); let original = smc.originalPositionFor(generatedLoc); assert.equal(original.name, 'Bar'); pattern = /function Foo([\w$]+)/; match = pattern.exec(code); generatedLoc = getLocation(code, match.index + 'function '.length); original = smc.originalPositionFor(generatedLoc); assert.equal(original.name, 'Foo'); } }); rollup-3.29.4/test/sourcemaps/samples/names/bar.js000066400000000000000000000000421450520414700221350ustar00rootroot00000000000000export default function Foo () {} rollup-3.29.4/test/sourcemaps/samples/names/foo.js000066400000000000000000000001551450520414700221610ustar00rootroot00000000000000import Bar from './bar'; export default function Foo () {} Foo.prototype = Object.create( Bar.prototype ); rollup-3.29.4/test/sourcemaps/samples/names/main.js000066400000000000000000000000501450520414700223140ustar00rootroot00000000000000export { default as Foo } from './foo'; rollup-3.29.4/test/sourcemaps/samples/reified-namespace/000077500000000000000000000000001450520414700232755ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/reified-namespace/_config.js000066400000000000000000000014141450520414700252370ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync } = require('node:fs'); const path = require('node:path'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'generates correct sourcemap with reified namespace (#668)', async test(code, map) { const smc = await new SourceMapConsumer(map); const main = readFileSync(path.join(__dirname, 'main.js'), 'utf8'); const generatedLoc = getLocation(code, 'deepEqual'); const actual = smc.originalPositionFor(generatedLoc); const expected = getLocation(main, 'deepEqual'); assert.equal(actual.line, expected.line); assert.equal(actual.column, expected.column); assert.equal(actual.source, '../main.js'); } }); rollup-3.29.4/test/sourcemaps/samples/reified-namespace/foo.js000066400000000000000000000000251450520414700244130ustar00rootroot00000000000000export var bar = 42; rollup-3.29.4/test/sourcemaps/samples/reified-namespace/main.js000066400000000000000000000001071450520414700245550ustar00rootroot00000000000000import * as foo from './foo.js'; assert.deepEqual( foo, { bar: 42 }); rollup-3.29.4/test/sourcemaps/samples/relative-paths/000077500000000000000000000000001450520414700226645ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/relative-paths/_config.js000066400000000000000000000005441450520414700246310ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'source paths are relative with relative dest (#344)', options: { output: { name: 'myModule', file: path.resolve(__dirname, '_actual/bundle.js') } }, test(code, map) { assert.deepEqual(map.sources, ['../main.js']); } }); rollup-3.29.4/test/sourcemaps/samples/relative-paths/main.js000066400000000000000000000000231450520414700241410ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/sourcemaps/samples/render-chunk-babili/000077500000000000000000000000001450520414700235415ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/render-chunk-babili/_config.js000066400000000000000000000020101450520414700254740ustar00rootroot00000000000000const assert = require('node:assert'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); const babiliResults = require('./babili-results'); module.exports = defineTest({ description: 'generates valid sourcemap when source could not be determined', options: { plugins: [ { name: 'test-plugin', renderChunk(code, chunk, options) { const format = options.format; return babiliResults[format]; } } ], output: { indent: false } }, async test(code, map) { const smc = await new SourceMapConsumer(map); let generatedLoc = getLocation(code, code.indexOf('42')); let originalLoc = smc.originalPositionFor(generatedLoc); assert.ok(/main/.test(originalLoc.source)); assert.equal(originalLoc.line, 1); assert.equal(originalLoc.column, 13); generatedLoc = getLocation(code, code.indexOf('log')); originalLoc = smc.originalPositionFor(generatedLoc); assert.equal(originalLoc.line, 1); assert.equal(originalLoc.column, 8); } }); rollup-3.29.4/test/sourcemaps/samples/render-chunk-babili/babili-results.js000066400000000000000000000031701450520414700270210ustar00rootroot00000000000000exports.amd = {"code":"define(function(){'use strict';console.log(42)});","map":{"version":3,"sources":["unknown"],"names":["define","console","log"],"mappings":"AAAAA,OAAO,UAAY,CAAE,aAErBC,QAAQC,GAAR,CAAa,EAAb,CAEC,CAJD,C","file":"unknown","sourcesContent":["define(function () { 'use strict';\n\nconsole.log( 42 );\n\n});"]}}; exports.cjs = {"code":"'use strict';console.log(42);","map":{"version":3,"sources":["unknown"],"names":["console","log"],"mappings":"AAAA,aAEAA,QAAQC,GAAR,CAAa,EAAb,C","file":"unknown","sourcesContent":["'use strict';\n\nconsole.log( 42 );"]}}; exports.es = {"code":"console.log(42);","map":{"version":3,"sources":["unknown"],"names":["console","log"],"mappings":"AAAAA,QAAQC,GAAR,CAAa,EAAb,C","file":"unknown","sourcesContent":["console.log( 42 );"]}}; exports.iife = {"code":"(function(){'use strict';console.log(42)})();","map":{"version":3,"sources":["unknown"],"names":["console","log"],"mappings":"AAAC,WAAY,CACb,aAEAA,QAAQC,GAAR,CAAa,EAAb,CAEC,CALA,G","file":"unknown","sourcesContent":["(function () {\n'use strict';\n\nconsole.log( 42 );\n\n}());"]}}; exports.umd = {"code":"(function(a){'function'==typeof define&&define.amd?define(a):a()})(function(){'use strict';console.log(42)});","map":{"version":3,"sources":["unknown"],"names":["define","amd","console","log"],"mappings":"AAAC,YAAmB,CACF,UAAlB,QAAOA,OAAP,EAAgCA,OAAOC,GAAvC,CAA6CD,SAA7C,CACA,GACC,CAHA,EAGC,UAAY,CAAE,aAEhBE,QAAQC,GAAR,CAAa,EAAb,CAEC,CAPA,C","file":"main.js","sourcesContent":["(function (factory) {\ntypeof define === 'function' && define.amd ? define(factory) :\nfactory();\n}(function () { 'use strict';\n\nconsole.log( 42 );\n\n}));\n"]}}; rollup-3.29.4/test/sourcemaps/samples/render-chunk-babili/main.js000066400000000000000000000000231450520414700250160ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/sourcemaps/samples/render-chunk/000077500000000000000000000000001450520414700223215ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/render-chunk/_config.js000066400000000000000000000020131450520414700242570ustar00rootroot00000000000000const assert = require('node:assert'); const { SourceMapConsumer } = require('source-map'); const terser = require('terser'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'preserves sourcemap chains when transforming', options: { plugins: [ { name: 'test-plugin', renderChunk(code) { const options = { sourceMap: { filename: 'x' // trigger sourcemap generation } }; return terser.minify(code, options); } } ] }, async test(code, map) { const smc = await new SourceMapConsumer(map); let generatedLoc = getLocation(code, code.indexOf('42')); let originalLoc = smc.originalPositionFor(generatedLoc); assert.ok(/main/.test(originalLoc.source)); assert.equal(originalLoc.line, 1); assert.equal(originalLoc.column, 13); generatedLoc = getLocation(code, code.indexOf('log')); originalLoc = smc.originalPositionFor(generatedLoc); assert.equal(originalLoc.line, 1); assert.equal(originalLoc.column, 8); } }); rollup-3.29.4/test/sourcemaps/samples/render-chunk/main.js000066400000000000000000000000231450520414700235760ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/sourcemaps/samples/single-length-segments/000077500000000000000000000000001450520414700243175ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/single-length-segments/_config.js000066400000000000000000000022051450520414700262600ustar00rootroot00000000000000const assert = require('node:assert'); const { readFileSync } = require('node:fs'); const path = require('node:path'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); const original = readFileSync(path.resolve(__dirname, 'main.js'), 'utf8'); module.exports = defineTest({ description: 'handles single-length sourcemap segments', options: { plugins: [ { name: 'test-plugin', transform() { return { code: readFileSync(path.resolve(__dirname, 'output.js'), 'utf8'), map: readFileSync(path.resolve(__dirname, 'output.js.map'), 'utf8') }; } } ], output: { name: 'x' } }, async test(code, map) { const smc = await new SourceMapConsumer(map); for (const token of ['Foo', 'log']) { const generatedLoc = getLocation(code, code.indexOf(token)); const originalLoc = smc.originalPositionFor(generatedLoc); const expectedLoc = getLocation(original, original.indexOf(token)); assert.ok(/main/.test(originalLoc.source)); assert.equal(originalLoc.line, expectedLoc.line); assert.equal(originalLoc.column, expectedLoc.column); } } }); rollup-3.29.4/test/sourcemaps/samples/single-length-segments/main.js000066400000000000000000000001011450520414700255710ustar00rootroot00000000000000class Foo { bar () { console.log( 42 ); } } export { Foo }; rollup-3.29.4/test/sourcemaps/samples/single-length-segments/output.js000066400000000000000000000003431450520414700262150ustar00rootroot00000000000000var Foo = function () { function Foo() { babelHelpers.classCallCheck(this, Foo); } babelHelpers.createClass(Foo, [{ key: "bar", value: function bar() { console.log(42); } }]); return Foo; }(); export { Foo }; rollup-3.29.4/test/sourcemaps/samples/single-length-segments/output.js.map000066400000000000000000000004021450520414700267650ustar00rootroot00000000000000{ "version":3, "sources":["index.js"], "names":[], "mappings":"IAAM,G;;;;;;;wBACE;AACN,WAAQ,GAAR,CAAa,EAAb;AACA;;;;;AAGF,SAAS,GAAT", "file":"index.js", "sourcesContent":["class Foo {\n\tbar () {\n\t\tconsole.log( 42 );\n\t}\n}\n\nexport { Foo };\n"] } rollup-3.29.4/test/sourcemaps/samples/sourcemap-base-url-without-trailing-slash/000077500000000000000000000000001450520414700300625ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/sourcemap-base-url-without-trailing-slash/_config.js000066400000000000000000000006651450520414700320330ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'add a trailing slash automatically if it is missing', options: { output: { sourcemapBaseUrl: 'https://example.com/a' } }, test: (code, map, { format }) => { const sourceMappingURL = code.split('\n').slice(-2)[0]; assert.strictEqual( sourceMappingURL, `//# sourceMappingURL=https://example.com/a/bundle.${format}.js.map` ); } }); rollup-3.29.4/test/sourcemaps/samples/sourcemap-base-url-without-trailing-slash/main.js000066400000000000000000000000211450520414700313350ustar00rootroot00000000000000assert.ok(true); rollup-3.29.4/test/sourcemaps/samples/sourcemap-base-url/000077500000000000000000000000001450520414700234425ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/sourcemap-base-url/_config.js000066400000000000000000000007071450520414700254100ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'adds a sourcemap base url', options: { output: { sourcemapBaseUrl: 'https://example.com/a/' } }, test: (code, map, { format }) => { assert.equal(map.file, `bundle.${format}.js`); const sourceMappingURL = code.split('\n').slice(-2)[0]; assert.equal( sourceMappingURL, `//# sourceMappingURL=https://example.com/a/bundle.${format}.js.map` ); } }); rollup-3.29.4/test/sourcemaps/samples/sourcemap-base-url/main.js000066400000000000000000000000231450520414700247170ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/sourcemaps/samples/sourcemap-file-hashed/000077500000000000000000000000001450520414700241015ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/sourcemap-file-hashed/_config.js000066400000000000000000000005261450520414700260460ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'populates file property of sourcemap with final name when using hashes', options: { output: { entryFileNames: '[hash].js', file: null, dir: '_actual' } }, test: (code, map, { fileName }) => { assert.strictEqual(map.file, fileName); } }); rollup-3.29.4/test/sourcemaps/samples/sourcemap-file-hashed/main.js000066400000000000000000000000231450520414700253560ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/sourcemaps/samples/sourcemap-file/000077500000000000000000000000001450520414700226475ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/sourcemap-file/_config.js000066400000000000000000000005501450520414700246110ustar00rootroot00000000000000const assert = require('node:assert'); module.exports = defineTest({ description: 'populates file property of sourcemap when plugins are used (#986)', options: { plugins: [ { name: 'test-plugin', transform() { return null; } } ] }, test: (code, map, profile) => { assert.equal(map.file, `bundle.${profile.format}.js`); } }); rollup-3.29.4/test/sourcemaps/samples/sourcemap-file/main.js000066400000000000000000000000231450520414700241240ustar00rootroot00000000000000console.log( 42 ); rollup-3.29.4/test/sourcemaps/samples/transform-full-source-paths/000077500000000000000000000000001450520414700253225ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/transform-full-source-paths/_config.js000066400000000000000000000010341450520414700272620ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'provides the full source map path when transforming source maps', options: { output: { name: 'myModule', file: path.join(__dirname, '_actual/bundle.js'), sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => path.resolve(path.dirname(sourcemapPath), relativeSourcePath) } }, test(code, map) { assert.deepEqual(map.sources, [path.resolve(__dirname, 'main.js').replace(/\\/g, '/')]); } }); rollup-3.29.4/test/sourcemaps/samples/transform-full-source-paths/main.js000066400000000000000000000000231450520414700265770ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/sourcemaps/samples/transform-low-resolution/000077500000000000000000000000001450520414700247475ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/transform-low-resolution/_config.js000066400000000000000000000027411450520414700267150ustar00rootroot00000000000000const assert = require('node:assert'); const { encode } = require('@jridgewell/sourcemap-codec'); const MagicString = require('magic-string').default; const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'handles combining low-resolution and high-resolution source-maps when transforming', options: { output: { name: 'bundle' }, plugins: [ { name: 'test-plugin1', transform(code) { // each entry of each line consist of // [generatedColumn, sourceIndex, sourceLine, sourceColumn]; // this mapping only maps the second line to the first with no column // details /** @type {import('@jridgewell/sourcemap-codec').SourceMapMappings} */ const decodedMap = [[], [[0, 0, 0, 0]]]; return { code: `console.log('added');\n${code}`, /** @type {any} */ map: { mappings: encode(decodedMap) } }; } }, { name: 'test-plugin2', transform(code) { const s = new MagicString(code); s.prepend("console.log('second');\n"); return { code: s.toString(), map: s.generateMap({ hires: true }) }; } } ] }, async test(code, map) { const smc = await new SourceMapConsumer(map); const generatedLoc = getLocation(code, code.indexOf("'baz'")); const originalLoc = smc.originalPositionFor(generatedLoc); assert.strictEqual(originalLoc.line, 1); assert.strictEqual(originalLoc.column, 0); } }); rollup-3.29.4/test/sourcemaps/samples/transform-low-resolution/main.js000066400000000000000000000000461450520414700262310ustar00rootroot00000000000000export let foo = 'bar'; foo += 'baz'; rollup-3.29.4/test/sourcemaps/samples/transform-source-paths/000077500000000000000000000000001450520414700243625ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/transform-source-paths/_config.js000066400000000000000000000006671450520414700263350ustar00rootroot00000000000000const assert = require('node:assert'); const path = require('node:path'); module.exports = defineTest({ description: 'transform sourcemap paths (#2168)', options: { output: { name: 'myModule', file: path.resolve(__dirname, '_actual/bundle.js'), sourcemapPathTransform: sourcePath => sourcePath.replace(`..${path.sep}`, '~/pkg-name/') } }, test(code, map) { assert.deepEqual(map.sources, ['~/pkg-name/main.js']); } }); rollup-3.29.4/test/sourcemaps/samples/transform-source-paths/main.js000066400000000000000000000000231450520414700256370ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/sourcemaps/samples/transforms/000077500000000000000000000000001450520414700221325ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/transforms/_config.js000066400000000000000000000024661450520414700241040ustar00rootroot00000000000000const assert = require('node:assert'); const buble = require('buble'); const MagicString = require('magic-string').default; const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = defineTest({ description: 'preserves sourcemap chains when transforming', options: { plugins: [ { name: 'test-plugin1', transform(source) { return buble.transform(source, { transforms: { modules: false } }); } }, { name: 'test-plugin2', transform(source) { const s = new MagicString(source); s.append('\nassert.equal( 1 + 1, 2 );\nassert.equal( 2 + 2, 4 );'); return { code: s.toString(), map: s.generateMap({ hires: true }) }; } } ] }, async test(code, map) { const smc = await new SourceMapConsumer(map); let generatedLoc = getLocation(code, code.indexOf('42')); let originalLoc = smc.originalPositionFor(generatedLoc); assert.ok(/foo/.test(originalLoc.source)); assert.equal(originalLoc.line, 1); assert.equal(originalLoc.column, 25); generatedLoc = getLocation(code, code.indexOf('log')); originalLoc = smc.originalPositionFor(generatedLoc); assert.ok(/main/.test(originalLoc.source)); assert.equal(originalLoc.line, 3); assert.equal(originalLoc.column, 8); } }); rollup-3.29.4/test/sourcemaps/samples/transforms/foo.js000066400000000000000000000000351450520414700232510ustar00rootroot00000000000000export const foo = () => 42; rollup-3.29.4/test/sourcemaps/samples/transforms/main.js000066400000000000000000000001071450520414700234120ustar00rootroot00000000000000import { foo } from './foo'; console.log( `the answer is ${foo()}` ); rollup-3.29.4/test/sourcemaps/samples/untransformed-modules/000077500000000000000000000000001450520414700242715ustar00rootroot00000000000000rollup-3.29.4/test/sourcemaps/samples/untransformed-modules/_config.js000066400000000000000000000011431450520414700262320ustar00rootroot00000000000000const assert = require('node:assert'); const MagicString = require('magic-string').default; module.exports = defineTest({ description: 'allows sourcemap chains with some untransformed modules (#404)', options: { plugins: [ { name: 'test-plugin', transform(code, id) { if (/untransformed-modules\/foo/.test(id)) { const s = new MagicString(code); const index = code.indexOf('1'); s.overwrite(index, index + 1, '2'); return { code: s.toString(), map: s.generateMap({ hires: true }) }; } } } ] }, test() { assert.ok(true); } }); rollup-3.29.4/test/sourcemaps/samples/untransformed-modules/foo.js000066400000000000000000000000241450520414700254060ustar00rootroot00000000000000export var foo = 1; rollup-3.29.4/test/sourcemaps/samples/untransformed-modules/main.js000066400000000000000000000000701450520414700255500ustar00rootroot00000000000000import { foo } from './foo.js'; assert.equal( foo, 2 ); rollup-3.29.4/test/sourcemaps/tsconfig.json000066400000000000000000000001641450520414700210000ustar00rootroot00000000000000{ "extends": "../tsconfig.base.json", "include": [ "**/_config.js", "./*.js", "./define.d.ts" ] } rollup-3.29.4/test/test.js000066400000000000000000000007231450520414700154260ustar00rootroot00000000000000require('source-map-support').install(); describe('rollup', function () { this.timeout(30_000); require('./misc/index.js'); require('./function/index.js'); require('./form/index.js'); require('./chunking-form/index.js'); require('./file-hashes/index.js'); require('./sourcemaps/index.js'); require('./incremental/index.js'); require('./hooks/index.js'); require('./load-config-file/index.js'); require('./cli/index.js'); require('./watch/index.js'); }); rollup-3.29.4/test/tsconfig.base.json000066400000000000000000000005251450520414700175310ustar00rootroot00000000000000{ "compilerOptions": { // enable this to capture type errors, or add @ts-check to the top of the file // "checkJs": true, "allowJs": true, "composite": true, "target": "esnext", "module": "node16", "noEmit": true, "lib": ["esnext"], "esModuleInterop": true, "moduleResolution": "node", "types": ["node", "mocha"] } } rollup-3.29.4/test/tsconfig.json000066400000000000000000000006101450520414700166130ustar00rootroot00000000000000{ "extends": "./tsconfig.base.json", "compilerOptions": { "checkJs": true }, "include": [ "./utils.js" ], "references": [ { "path": "./browser" }, { "path": "./chunking-form" }, { "path": "./file-hashes" }, { "path": "./form" }, { "path": "./function" }, { "path": "./sourcemaps" } ] } rollup-3.29.4/test/types.d.ts000066400000000000000000000127731450520414700160570ustar00rootroot00000000000000import type { SourceMap } from 'magic-string'; import type { RollupLog } from 'rollup'; import type { RollupBuild, RollupError, RollupOptions } from '../src/rollup/types'; export interface TestConfigBase { /** * Description of the test. Determines the name of the test in the test * runner. */ description: string; /** * Only run this test if the major Node version is high enough. */ minNodeVersion?: number; /** * Only run this test on Windows. */ onlyWindows?: boolean; /** * Skip this test. */ skip?: boolean; /** * Do not run this test on Windows. */ skipIfWindows?: boolean; /** * Only run this test. Should never be committed. */ solo?: boolean; } export interface TestConfigBrowser extends TestConfigBase { /** * Expected error when running rollup.rollup() */ error?: RollupError; /** * Expected warning codes. Any of these warnings will not cause the test to * fail. */ expectedWarnings?: string[]; /** * Expected error when running bundle.generate(). */ generateError?: RollupError; /** * Rollup options for bundling. */ options?: RollupOptions; } export interface TestConfigChunkingForm extends TestConfigBase { /** * Called after the test is run. */ after?: () => void; /** * Called before the test is run. */ before?: () => void; /** * Expected warning codes. Any of these warnings will not cause the test to * fail. */ expectedWarnings?: string[]; /** * Assert the expected logs. */ logs?: RollupLog[]; /** * The directory to bundle the code in. */ nestedDir?: string; /** * Rollup options for bundling. */ options?: RollupOptions; /** * Execute the AMD module. */ runAmd?: | boolean | { exports?: (exportObject: any) => void | Promise; }; } export interface TestConfigCli extends TestConfigBase { /** * Assert the stderr stream, return true to abort the test. */ abortOnStderr?: (data: string) => boolean | void | Promise; /** * Called after the test is run. */ after?: (error: Error | null, stdout: string, stderr: string) => void | Promise; /** * Called before the test is run. */ before?: () => void | Promise; command?: string; cwd?: string; /** * Environment variables to set for the test. */ env?: Record; /** * Test the expected error. Assertions about the test output will only * be performed afterward if you return "true" or do not supply this option. */ error?: (error: RollupError) => boolean | void; /** * Execute the bundled code. */ execute?: boolean; /** * Run assertions against the exports of the bundle after executing it. */ exports?: (exportObject: any) => void | Promise; /** * Run assertions against the generated code when bundling to stdout. */ result?: (code: string) => void; retry?: number; /** * Display generated output in console. */ show?: boolean; /** * Assert the stderr of the build. Assertions about the test output will only * be performed afterward if you return "true" or do not supply this option. */ stderr?: (stderr: string) => boolean | undefined; /** * Run assertions after the command has finished. */ test?: () => void; } export interface TestConfigFileHash extends TestConfigBase { options1: RollupOptions; options2: RollupOptions; } export interface TestConfigForm extends TestConfigBase { /** * Called after the test is run. */ after?: () => void | Promise; /** * Called before the test is run. */ before?: () => void | Promise; /** * Expected warning codes. Any of these warnings will not cause the test to * fail. */ expectedWarnings?: string[]; /** * Output formats to test. */ formats?: string[]; /** * Assert the expected logs. */ logs?: RollupLog[]; /** * Rollup options for bundling. */ options?: RollupOptions; } export interface TestConfigFunction extends TestConfigBase { /** * Called after the test is run. */ after?: () => void | Promise; /** * Called before the test is run. */ before?: () => void | Promise; /** * Make assertions against the generated Rollup output object. */ bundle?: (bundle: RollupBuild) => void | Promise; /** * Make assertions against the generated code. */ code?: (code: string | Record) => void; /** * The global context executed the bundled code. */ context?: Record; /** * Expected error when running rollup.rollup() */ error?: RollupError; /** * Assetions for the exports of the bundle. */ exports?: (exportObject: any) => void | Promise; /** * Expected error when running bundle.generate(). */ generateError?: RollupError; /** * Assert the expected logs. */ logs?: RollupLog[]; /** * Rollup options for bundling. */ options?: RollupOptions; /** * Make assertions against an expected runtime error. */ runtimeError?: (error: Error) => void; /** * Display generated output in console. */ show?: boolean; /** * Make assertions on the expected warnings. */ warnings?: RollupError[] | ((warnings: RollupError[]) => boolean | void); } export interface TestConfigSourcemap extends TestConfigBase { /** * Output formats to test. */ formats?: string[]; /** * Rollup options for bundling. */ options?: RollupOptions; /** * Generate the bundle and run assertions. */ test: ( code: string, map: SourceMap, options: { fileName: string; format: string } ) => void | Promise; /** * List expected warnings. */ warnings?: RollupError[]; } rollup-3.29.4/test/typescript/000077500000000000000000000000001450520414700163155ustar00rootroot00000000000000rollup-3.29.4/test/typescript/index.ts000066400000000000000000000033611450520414700177770ustar00rootroot00000000000000// eslint-disable-next-line import/no-unresolved import type * as rollup from './dist/rollup'; // Plugin API interface Options { extensions?: string | string[]; } const plugin: rollup.PluginImpl = (options = {}) => { const _extensions = options.extensions || ['.js']; return { name: 'my-plugin', resolveId: { handler(source, _importer, _options) { // @ts-expect-error source is typed as string const _s: number = source; } } }; }; plugin(); plugin({ extensions: ['.js', 'json'] }); const _pluginHooks: rollup.Plugin = { buildStart: { handler() {}, sequential: true }, async load(id) { // @ts-expect-error id is typed as string const _index: number = id; await this.resolve('rollup'); }, name: 'test', renderChunk(_code, { modules }) { for (const id in modules) { // @ts-expect-error Cannot assign to 'code' because it is a read-only property modules[id].code += '\n'; } }, resolveId: { async handler(source, _importer, _options) { await this.resolve('rollup'); // @ts-expect-error source is typed as string const _s: number = source; }, // @ts-expect-error sequential is only supported for parallel hooks sequential: true } }; const _amdOutputOptions: rollup.OutputOptions['amd'][] = [ {}, { id: 'a' }, { autoId: false, id: 'a' }, { autoId: true, basePath: 'a' }, { autoId: true }, { autoId: false }, { autoId: false, // @ts-expect-error for "basePath", "autoId" needs to be true basePath: '', id: 'a' }, { autoId: true, // @ts-expect-error cannot combine "id" and "autoId" id: 'a' }, { // @ts-expect-error cannot combine "id" and "basePath" basePath: '', id: 'a' }, // @ts-expect-error needs "autoId" for "basePath" { basePath: '' } ]; rollup-3.29.4/test/typescript/tsconfig.json000066400000000000000000000002651450520414700210270ustar00rootroot00000000000000{ "compilerOptions": { "noEmit": true, "strict": true, "pretty": true, "lib": ["es2015"], "types": [] }, "include": ["./dist", "./typings"], "files": ["./index.ts"] } rollup-3.29.4/test/utils.js000066400000000000000000000246121450520414700156120ustar00rootroot00000000000000/** * @typedef {import('../src/rollup/types').RollupError} RollupError * @typedef {import('../src/rollup/types').RollupLog} RollupLog * @typedef {import('../src/rollup/types').LogLevel} LogLevel * @typedef {import('../src/rollup/types').Plugin} Plugin * @typedef {import('./types').TestConfigBase} TestConfigBase */ const assert = require('node:assert'); const { closeSync, fsyncSync, openSync, readdirSync, renameSync, unlinkSync, rmSync, writeFileSync, writeSync } = require('node:fs'); const { basename, join } = require('node:path'); const { platform, version } = require('node:process'); const fixturify = require('fixturify'); if (!globalThis.defineTest) { globalThis.defineTest = config => config; } /** * @param {number} ms * @returns {Promise} */ exports.wait = function wait(ms) { return new Promise(fulfil => { setTimeout(fulfil, ms); }); }; function normaliseError(error) { const clone = { ...error, message: error.message }; delete clone.stack; delete clone.toString; if (clone.watchFiles) { clone.watchFiles.sort(); } if (clone.frame) { clone.frame = clone.frame.replace(/\s+$/gm, ''); } if (clone.cause) { clone.cause = normaliseError(clone.cause); } return clone; } /** * @param {RollupError} actual * @param {RollupError} expected */ exports.compareError = function compareError(actual, expected) { actual = normaliseError(actual); if (expected.frame) { expected.frame = deindent(expected.frame); } assert.deepEqual(actual, expected); }; /** * @param {(RollupLog & {level: LogLevel})[]} actual * @param {(RollupLog & {level: LogLevel})[]} expected */ exports.compareLogs = function compareLogs(actual, expected) { const normalizedActual = actual.map(normaliseError); const sortedActual = normalizedActual.sort(sortLogs); try { assert.deepEqual( sortedActual, expected .map(warning => { if (warning.frame) { warning.frame = deindent(warning.frame); } return warning; }) .sort(sortLogs) ); } catch (error) { console.log('Actual logs:', JSON.stringify(normalizedActual)); throw error; } }; /** * @param {RollupLog} a * @param {RollupLog} b */ function sortLogs(a, b) { return a.message === b.message ? 0 : a.message < b.message ? -1 : 1; } /** * @param {string} stringValue */ function deindent(stringValue) { return stringValue.slice(1).replace(/^\t+/gm, '').replace(/\s+$/gm, '').trim(); } exports.deindent = deindent; exports.executeBundle = async function executeBundle(bundle, require) { const { output: [cjs] } = await bundle.generate({ exports: 'auto', format: 'cjs' }); const wrapper = new Function('module', 'exports', 'require', cjs.code); const module = { exports: {} }; wrapper(module, module.exports, require); return module.exports; }; /** * @param {Iterable<[string, any]>} entries * @returns {Record} */ exports.getObject = function getObject(entries) { const object = {}; for (const [key, value] of entries) { object[key] = value; } return object; }; /** * @param {Record} modules * @returns {Plugin} */ exports.loader = function loader(modules) { modules = Object.assign(Object.create(null), modules); return { name: 'test-plugin-loader', resolveId(id) { return id in modules ? id : null; }, load(id) { return modules[id]; } }; }; exports.normaliseOutput = function normaliseOutput(code) { return code.toString().trim().replace(/\r\n/g, '\n'); }; /** * @template {TestConfigBase} C * @param {string} suiteName * @param {string} samplesDirectory * @param {(directory: string, config: C) => void} runTest * @param {() => void | Promise} [onTeardown] */ function runTestSuiteWithSamples(suiteName, samplesDirectory, runTest, onTeardown) { describe(suiteName, () => runSamples(samplesDirectory, runTest, onTeardown)); } // You can run only or skip certain kinds of tests by appending .only or .skip /** * @template {TestConfigBase} C * @param {string} suiteName * @param {string} samplesDirectory * @param {(directory: string, config: C) => void} runTest * @param {() => void | Promise} onTeardown */ runTestSuiteWithSamples.only = function (suiteName, samplesDirectory, runTest, onTeardown) { describe.only(suiteName, () => runSamples(samplesDirectory, runTest, onTeardown)); }; /** * @param {string} suiteName */ runTestSuiteWithSamples.skip = function (suiteName) { describe.skip(suiteName, () => {}); }; exports.runTestSuiteWithSamples = runTestSuiteWithSamples; /** * @template {TestConfigBase} C * @param {string} samplesDirectory * @param {(directory: string, config: C) => void} runTest * @param {Mocha.Func} onTeardown */ function runSamples(samplesDirectory, runTest, onTeardown) { if (onTeardown) { afterEach(onTeardown); } for (const fileName of readdirSync(samplesDirectory) .filter(name => name[0] !== '.') .sort()) { runTestsInDirectory(join(samplesDirectory, fileName), runTest); } } /** * @template {TestConfigBase} C * @param {string} directory * @param {(directory: string, config: C) => void} runTest */ function runTestsInDirectory(directory, runTest) { const fileNames = getFileNamesAndRemoveOutput(directory); if (fileNames.includes('_config.js')) { loadConfigAndRunTest(directory, runTest); } else if (fileNames.length === 0) { console.warn(`Removing empty test directory ${directory}`); rmSync(directory, { force: true, recursive: true }); } else { describe(basename(directory), () => { for (const fileName of fileNames.filter(name => name[0] !== '.').sort()) { runTestsInDirectory(join(directory, fileName), runTest); } }); } } /** * @param {string} directory */ function getFileNamesAndRemoveOutput(directory) { try { return readdirSync(directory).filter(fileName => { if (fileName === '_actual') { rmSync(join(directory, '_actual'), { force: true, recursive: true }); return false; } if (fileName === '_actual.js') { unlinkSync(join(directory, '_actual.js')); return false; } return true; }); } catch (error) { if (error.code === 'ENOTDIR') { throw new Error( `${directory} is not located next to a "_config.js" file but is not a directory or old test output either. Please inspect and consider removing the file.` ); } throw error; } } exports.getFileNamesAndRemoveOutput = getFileNamesAndRemoveOutput; /** * @template {TestConfigBase} C * @param {string} directory * @param {(directory: string, config: C) => void} runTest */ function loadConfigAndRunTest(directory, runTest) { const configFile = join(directory, '_config.js'); const config = require(configFile); if (!config || !config.description) { throw new Error(`Found invalid config without description: ${configFile}`); } if ( (!config.skipIfWindows || platform !== 'win32') && (!config.onlyWindows || platform === 'win32') && (!config.minNodeVersion || config.minNodeVersion <= Number(/^v(\d+)/.exec(version)[1])) ) { runTest(directory, config); } } /** * @param {string} actualDirectory * @param {string} expectedDirectory */ exports.assertDirectoriesAreEqual = function assertDirectoriesAreEqual( actualDirectory, expectedDirectory ) { const actualFiles = fixturify.readSync(actualDirectory); let expectedFiles; try { expectedFiles = fixturify.readSync(expectedDirectory); } catch { expectedFiles = []; } assertFilesAreEqual(actualFiles, expectedFiles); }; function assertFilesAreEqual(actualFiles, expectedFiles, directories = []) { for (const fileName of Object.keys({ ...actualFiles, ...expectedFiles })) { const pathSegments = [...directories, fileName]; if (typeof actualFiles[fileName] === 'object' && typeof expectedFiles[fileName] === 'object') { assertFilesAreEqual(actualFiles[fileName], expectedFiles[fileName], pathSegments); continue; } const shortName = pathSegments.join('/'); assert.strictEqual( `${shortName}: ${actualFiles[fileName]}`, `${shortName}: ${expectedFiles[fileName]}` ); } } exports.assertFilesAreEqual = assertFilesAreEqual; /** * @param {string} actual * @param {string} expected */ exports.assertIncludes = function assertIncludes(actual, expected) { try { assert.ok( actual.includes(expected), `${JSON.stringify(actual)}\nshould include\n${JSON.stringify(expected)}` ); } catch (error) { error.actual = actual; error.expected = expected; throw error; } }; /** * @param {string} actual * @param {string} expected */ exports.assertDoesNotInclude = function assertDoesNotInclude(actual, expected) { try { assert.ok( !actual.includes(expected), `${JSON.stringify(actual)}\nshould not include\n${JSON.stringify(expected)}` ); } catch (error) { error.actual = actual; error.expected = expected; throw error; } }; /** * Workaround a race condition in fs.writeFileSync that temporarily creates * an empty file for a brief moment which may be read by rollup watch - even * if the content being overwritten is identical. * * @param {string} filePath * @param {string} contents */ function atomicWriteFileSync(filePath, contents) { const stagingPath = filePath + '_'; writeFileSync(stagingPath, contents); renameSync(stagingPath, filePath); } exports.atomicWriteFileSync = atomicWriteFileSync; /** * It appears that on macOS, it sometimes takes long for the file system to update * * @param {string} filePath * @param {string} contents */ exports.writeAndSync = function writeAndSync(filePath, contents) { const file = openSync(filePath, 'w'); writeSync(file, contents); fsyncSync(file); closeSync(file); }; /** * Sometimes, watchers on macOS do not seem to fire. In those cases, it helps * to write the same content again. This function returns a callback to stop * further updates. * * @param {string} filePath * @param {string} contents */ exports.writeAndRetry = function writeAndRetry(filePath, contents) { let retries = 0; let updateRetryTimeout; const writeFile = () => { if (retries > 0) { console.error(`RETRIED writeFile (${retries})`); } retries++; atomicWriteFileSync(filePath, contents); updateRetryTimeout = setTimeout(writeFile, 1000); }; writeFile(); return () => clearTimeout(updateRetryTimeout); }; /** * @param {any} object * @param {any} replaced */ exports.replaceDirectoryInStringifiedObject = function replaceDirectoryInStringifiedObject( object, replaced ) { return JSON.stringify(object, null, 2).replace( new RegExp( JSON.stringify(JSON.stringify(replaced).slice(1, -1)).slice(1, -1) + '[/\\\\]*', 'g' ), '**/' ); }; rollup-3.29.4/test/watch/000077500000000000000000000000001450520414700152155ustar00rootroot00000000000000rollup-3.29.4/test/watch/index.js000066400000000000000000001274611450520414700166750ustar00rootroot00000000000000const assert = require('node:assert'); const { existsSync, readdirSync, readFileSync, rmSync, unlinkSync } = require('node:fs'); const { rm, unlink, writeFile } = require('node:fs/promises'); const { resolve } = require('node:path'); const { chdir, cwd, hrtime } = require('node:process'); const { copy } = require('fs-extra'); /** * @type {import('../../src/rollup/types')} Rollup */ const rollup = require('../../dist/rollup'); const { atomicWriteFileSync, wait } = require('../utils'); describe('rollup.watch', () => { let watcher; beforeEach(() => { chdir(cwd()); return rm('test/_tmp', { force: true, recursive: true }); }); afterEach(() => { if (watcher) { watcher.close(); watcher = null; } }); it('watches a file and triggers reruns if necessary', async () => { let triggerRestart = false; await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', plugins: { name: 'test-plugin', options() { assert.strictEqual(this.meta.watchMode, true, 'watchMode in options'); }, async transform(code) { assert.strictEqual(this.meta.watchMode, true, 'watchMode in transform'); if (triggerRestart) { triggerRestart = false; await wait(100); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 44;'); await wait(100); return code; } } }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); triggerRestart = true; atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 44); } ]); }); it('waits for event listeners', async () => { let run = 0; const events = new Set(); await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', plugins: { async writeBundle() { if (run++ === 0) { await wait(100); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 48;'); await wait(100); } if (run === 2) { watcher.close(); } } }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); await new Promise((resolve, reject) => { let currentEvent = null; const handleEvent = async (...parameters) => { events.add(parameters[0]?.code); if (currentEvent) { watcher.close(); return reject( new Error( `Event ${JSON.stringify(parameters)} was emitted while handling ${JSON.stringify( currentEvent )}.` ) ); } currentEvent = parameters; await wait(100); currentEvent = null; }; // This should work but should not have an effect watcher.off('event', handleEvent); watcher.on('event', handleEvent); watcher.on('change', handleEvent); watcher.on('restart', handleEvent); watcher.on('close', resolve); }); assert.deepStrictEqual([...events], ['START', 'BUNDLE_START', 'BUNDLE_END', 'END', undefined]); }); it('does not fail for virtual files', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', plugins: { resolveId(id) { if (id === 'virtual') { return id; } }, load(id) { if (id === 'virtual') { return `export const value = 42;`; } } }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); atomicWriteFileSync( 'test/_tmp/input/main.js', "import {value} from 'virtual';\nexport default value + 1;" ); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); } ]); }); it('passes file events to the watchChange plugin hook once for each change', async () => { let watchChangeCnt = 0; await copy('test/watch/samples/basic', 'test/_tmp/input'); await wait(100); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: { watchChange(id) { watchChangeCnt++; assert.strictEqual(id, resolve('test/_tmp/input/main.js')); } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { watchChangeCnt = 0; assert.strictEqual(run('../_tmp/output/bundle.js'), 42); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); assert.strictEqual(watchChangeCnt, 1); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); assert.strictEqual(watchChangeCnt, 2); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); assert.strictEqual(watchChangeCnt, 3); } ]); }); it('passes change parameter to the watchChange plugin hook', async () => { const WATCHED_ID = resolve('test/_tmp/input/watched'); const events = []; let ids; const expectedIds = [WATCHED_ID, resolve('test/_tmp/input/main.js')]; await copy('test/watch/samples/watch-files', 'test/_tmp/input'); await unlink(WATCHED_ID); await wait(100); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, watch: { buildDelay: 300 }, plugins: { buildStart() { this.addWatchFile(WATCHED_ID); }, watchChange(id, { event }) { assert.strictEqual(id, WATCHED_ID); events.push(event); }, buildEnd() { ids = this.getWatchFiles(); } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); assert.deepStrictEqual(events, []); assert.deepStrictEqual(ids, expectedIds); atomicWriteFileSync(WATCHED_ID, 'first'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); assert.deepStrictEqual(events, ['create']); assert.deepStrictEqual(ids, expectedIds); atomicWriteFileSync(WATCHED_ID, 'first'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); assert.deepStrictEqual(events, ['create', 'update']); assert.deepStrictEqual(ids, expectedIds); unlinkSync(WATCHED_ID); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); assert.deepStrictEqual(events, ['create', 'update', 'delete']); assert.deepStrictEqual(ids, expectedIds); } ]); }); it('correctly rewrites change event during build delay', async () => { const WATCHED_ID = resolve('test/_tmp/input/watched'); const MAIN_ID = resolve('test/_tmp/input/main.js'); let lastEvent = null; await copy('test/watch/samples/watch-files', 'test/_tmp/input'); await wait(100); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, watch: { buildDelay: 600, chokidar: { atomic: false } }, plugins: { buildStart() { this.addWatchFile(WATCHED_ID); }, watchChange(id, { event }) { if (id === WATCHED_ID) { assert.strictEqual(lastEvent, null); lastEvent = event; } } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.strictEqual(lastEvent, null); atomicWriteFileSync(WATCHED_ID, 'another'); await wait(100); await unlink(WATCHED_ID); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.strictEqual(lastEvent, 'delete'); lastEvent = null; atomicWriteFileSync(WATCHED_ID, '123'); await wait(100); await unlink(WATCHED_ID); // To ensure there is always another change to trigger a rebuild atomicWriteFileSync(MAIN_ID, 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.strictEqual(lastEvent, null); atomicWriteFileSync(WATCHED_ID, '123'); await wait(100); atomicWriteFileSync(WATCHED_ID, 'asd'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(lastEvent, 'create'); } ]); }); it('calls closeWatcher plugin hook', async () => { let calls = 0; let context1; let context2; await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: [ { buildStart() { // eslint-disable-next-line @typescript-eslint/no-this-alias context1 = this; }, closeWatcher() { assert.strictEqual(context1, this); calls++; } }, { buildStart() { // eslint-disable-next-line @typescript-eslint/no-this-alias context2 = this; }, closeWatcher() { assert.strictEqual(context2, this); calls++; } } ] }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); assert.ok(context1); assert.ok(context2); watcher.once('close', () => { assert.strictEqual(calls, 2); }); watcher.close(); } ]); }); it('watches a file in code-splitting mode', async () => { await copy('test/watch/samples/code-splitting', 'test/_tmp/input'); watcher = rollup.watch({ input: ['test/_tmp/input/main1.js', 'test/_tmp/input/main2.js'], output: { dir: 'test/_tmp/output', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/main1.js'), 21); assert.strictEqual(run('../_tmp/output/main2.js'), 42); atomicWriteFileSync('test/_tmp/input/shared.js', 'export const value = 22;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/main1.js'), 22); assert.strictEqual(run('../_tmp/output/main2.js'), 44); } ]); }); it('watches a file in code-splitting mode with an input object', async () => { await copy('test/watch/samples/code-splitting', 'test/_tmp/input'); watcher = rollup.watch({ input: { _main_1: 'test/_tmp/input/main1.js', 'subfolder/_main_2': 'test/_tmp/input/main2.js' }, output: { dir: 'test/_tmp/output', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/_main_1.js'), 21); assert.strictEqual(run('../_tmp/output/subfolder/_main_2.js'), 42); atomicWriteFileSync('test/_tmp/input/shared.js', 'export const value = 22;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/_main_1.js'), 22); assert.strictEqual(run('../_tmp/output/subfolder/_main_2.js'), 44); } ]); }); it('recovers from an error', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); atomicWriteFileSync('test/_tmp/input/main.js', 'export nope;'); }, 'START', 'BUNDLE_START', 'ERROR:Unexpected token', 'END', () => { atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); } ]); }); it('recovers from an error on initial build', async () => { await copy('test/watch/samples/error', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'ERROR:Unexpected token', 'END', () => { assert.strictEqual(existsSync('../_tmp/output/bundle.js'), false); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); } ]); }); it('recovers from a plugin error on initial build', async () => { let count = 0; await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', plugins: { transform() { if (count++ === 0) { this.error('The first run failed, try again.'); } } }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'ERROR:The first run failed, try again.', 'END', () => { assert.strictEqual(existsSync('../_tmp/output/bundle.js'), false); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); } ]); }); it('awaits and recovers from a plugin error in the watchChange hook', async () => { let fail = true; await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', plugins: { async watchChange() { await new Promise(resolve => setTimeout(resolve, 300)); if (fail) { this.error('Failed in watchChange'); } } }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 21;'); }, 'ERROR:Failed in watchChange', 'END', () => { fail = false; atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); } ]); }); it('recovers from an error even when erroring entry was "renamed" (#38)', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); unlinkSync('test/_tmp/input/main.js'); atomicWriteFileSync('test/_tmp/input/main.js', 'export nope;'); }, 'START', 'BUNDLE_START', 'ERROR:Unexpected token', 'END', () => { unlinkSync('test/_tmp/input/main.js'); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); } ]); }); it('recovers from an error even when erroring dependency was "renamed" (#38)', async () => { await copy('test/watch/samples/dependency', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); unlinkSync('test/_tmp/input/dep.js'); atomicWriteFileSync('test/_tmp/input/dep.js', 'export nope;'); }, 'START', 'BUNDLE_START', 'ERROR:Unexpected token', 'END', () => { unlinkSync('test/_tmp/input/dep.js'); atomicWriteFileSync('test/_tmp/input/dep.js', 'export const value = 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 44); } ]); }); it('handles closing the watcher during a build', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', plugins: { load() { watcher.close(); } }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); const events = []; watcher.on('event', event => events.push(event.code)); return sequence(watcher, [ 'START', 'BUNDLE_START', async () => { atomicWriteFileSync('test/_tmp/input/main.js', 'export default 44;'); await wait(400); assert.deepStrictEqual(events, ['START', 'BUNDLE_START']); } ]); }); it('handles closing the watcher during a build even if an error occurred', async () => { await copy('test/watch/samples/error', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', plugins: { load() { watcher.close(); } }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); const events = []; watcher.on('event', event => events.push(event.code)); return sequence(watcher, [ 'START', 'BUNDLE_START', async () => { atomicWriteFileSync('test/_tmp/input/main.js', 'export default 44;'); await wait(400); assert.deepStrictEqual(events, ['START', 'BUNDLE_START']); } ]); }); it('stops watching files that are no longer part of the graph', async () => { await copy('test/watch/samples/dependency', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 42;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); let unexpectedEvent = false; watcher.once('event', event => { unexpectedEvent = event; }); atomicWriteFileSync('test/_tmp/input/dep.js', '= invalid'); await wait(400); assert.strictEqual(unexpectedEvent, false); } ]); }); it('refuses to watch the output file (#15)', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); atomicWriteFileSync('test/_tmp/input/main.js', `import '../output/bundle.js'`); }, 'START', 'BUNDLE_START', 'ERROR:Cannot import the generated bundle', 'END', () => { atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); } ]); }); it('ignores files that are not specified in options.watch.include, if given', async () => { await copy('test/watch/samples/ignored', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, watch: { include: ['test/_tmp/input/+(main|foo).js'] } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.deepStrictEqual(run('../_tmp/output/bundle.js'), { foo: 'foo-1', bar: 'bar-1' }); atomicWriteFileSync('test/_tmp/input/foo.js', `export default 'foo-2';`); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.deepStrictEqual(run('../_tmp/output/bundle.js'), { foo: 'foo-2', bar: 'bar-1' }); let unexpectedEvent = false; watcher.once('event', event => { unexpectedEvent = event; }); atomicWriteFileSync('test/_tmp/input/bar.js', "export default 'bar-2';"); await wait(400); assert.deepStrictEqual(run('../_tmp/output/bundle.js'), { foo: 'foo-2', bar: 'bar-1' }); assert.strictEqual(unexpectedEvent, false); } ]); }); it('ignores files that are specified in options.watch.exclude, if given', async () => { await copy('test/watch/samples/ignored', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, watch: { exclude: ['test/_tmp/input/bar.js'] } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.deepStrictEqual(run('../_tmp/output/bundle.js'), { foo: 'foo-1', bar: 'bar-1' }); atomicWriteFileSync('test/_tmp/input/foo.js', `export default 'foo-2';`); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.deepStrictEqual(run('../_tmp/output/bundle.js'), { foo: 'foo-2', bar: 'bar-1' }); let unexpectedEvent = false; watcher.once('event', event => { unexpectedEvent = event; }); atomicWriteFileSync('test/_tmp/input/bar.js', "export default 'bar-2';"); await wait(400); assert.deepStrictEqual(run('../_tmp/output/bundle.js'), { foo: 'foo-2', bar: 'bar-1' }); assert.strictEqual(unexpectedEvent, false); } ]); }); it('only rebuilds the appropriate configs', async () => { await copy('test/watch/samples/multiple', 'test/_tmp/input'); await wait(100); watcher = rollup.watch([ { input: 'test/_tmp/input/main1.js', output: { file: 'test/_tmp/output/bundle1.js', format: 'cjs', exports: 'auto' } }, { input: 'test/_tmp/input/main2.js', output: { file: 'test/_tmp/output/bundle2.js', format: 'cjs', exports: 'auto' } } ]); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.deepStrictEqual(run('../_tmp/output/bundle1.js'), 42); assert.deepStrictEqual(run('../_tmp/output/bundle2.js'), 43); atomicWriteFileSync('test/_tmp/input/main2.js', 'export default 44'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.deepStrictEqual(run('../_tmp/output/bundle1.js'), 42); assert.deepStrictEqual(run('../_tmp/output/bundle2.js'), 44); } ]); }); it('allows watching only some configs', async () => { await copy('test/watch/samples/multiple', 'test/_tmp/input'); await wait(100); watcher = rollup.watch([ { input: 'test/_tmp/input/main1.js', watch: false, output: { file: 'test/_tmp/output/bundle1.js', format: 'cjs', exports: 'auto' } }, { input: 'test/_tmp/input/main2.js', output: { file: 'test/_tmp/output/bundle2.js', format: 'cjs', exports: 'auto' } } ]); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(existsSync(resolve(__dirname, '../_tmp/output/bundle1.js')), false); assert.strictEqual(existsSync(resolve(__dirname, '../_tmp/output/bundle2.js')), true); assert.deepStrictEqual(run('../_tmp/output/bundle2.js'), 43); } ]); }); it('respects output.globals', async () => { await copy('test/watch/samples/globals', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'iife', globals: { jquery: 'jQuery' } }, external: ['jquery'] }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { const generated = readFileSync('test/_tmp/output/bundle.js', { encoding: 'utf8' }); assert.ok(/jQuery/.test(generated)); } ]); }); it('treats filenames literally, not as globs', async () => { await copy('test/watch/samples/non-glob', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); atomicWriteFileSync('test/_tmp/input/[foo]/bar.js', `export const bar = 43;`); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); } ]); }); it('updates the right hashes on dependency changes', async () => { let dynamicName; let staticName; let chunkName; await copy('test/watch/samples/hashing', 'test/_tmp/input'); watcher = rollup.watch({ input: ['test/_tmp/input/main-static.js', 'test/_tmp/input/main-dynamic.js'], output: { dir: 'test/_tmp/output', format: 'cjs', exports: 'auto', entryFileNames: '[name].[hash].js', chunkFileNames: '[name].[hash].js' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { [dynamicName, staticName, chunkName] = readdirSync('test/_tmp/output').sort(); rmSync('test/_tmp/output', { force: true, recursive: true }); // this should only update the hash of that particular entry point atomicWriteFileSync( 'test/_tmp/input/main-static.js', "import {value} from './shared';\nexport default 2 * value;" ); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { const [newDynamicName, newStaticName, newChunkName] = readdirSync('test/_tmp/output').sort(); rmSync('test/_tmp/output', { force: true, recursive: true }); assert.notEqual(newStaticName, staticName); assert.strictEqual(newDynamicName, dynamicName); assert.strictEqual(newChunkName, chunkName); staticName = newStaticName; // this should update all hashes atomicWriteFileSync('test/_tmp/input/shared.js', 'export const value = 42;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { const [newDynamicName, newStaticName, newChunkName] = readdirSync('test/_tmp/output').sort(); assert.notEqual(newStaticName, staticName); assert.notEqual(newDynamicName, dynamicName); assert.notEqual(newChunkName, chunkName); } ]); }); it('runs transforms again on previously erroring files that were changed back', async () => { const brokenFiles = new Set(); await copy('test/watch/samples/basic', 'test/_tmp/input'); const INITIAL_CONTENT = 'export default 42;'; atomicWriteFileSync('test/_tmp/input/main.js', INITIAL_CONTENT); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', plugins: { transform(code, id) { if (code.includes('broken')) { brokenFiles.add(id); throw new Error('Broken in transform'); } brokenFiles.delete(id); }, generateBundle() { if (brokenFiles.size > 0) { throw new Error('Broken in generate'); } } }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); atomicWriteFileSync('test/_tmp/input/main.js', 'export default "broken";'); }, 'START', 'BUNDLE_START', 'ERROR:Broken in transform', () => { atomicWriteFileSync('test/_tmp/input/main.js', INITIAL_CONTENT); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); } ]); }); it('skips filesystem writes when configured', async () => { let watchChangeCnt = 0; await copy('test/watch/samples/skip-writes', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, watch: { skipWrite: true }, plugins: { watchChange(id) { watchChangeCnt++; assert.strictEqual(id, resolve('test/_tmp/input/main.js')); } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { watchChangeCnt = 0; assert.strictEqual(existsSync('../_tmp/output/bundle.js'), false); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(existsSync('../_tmp/output/bundle.js'), false); assert.strictEqual(watchChangeCnt, 1); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(existsSync('../_tmp/output/bundle.js'), false); assert.strictEqual(watchChangeCnt, 2); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', // 'END', event => { assert.strictEqual(existsSync('../_tmp/output/bundle.js'), false); assert.strictEqual(watchChangeCnt, 3); // still aware of its output destination assert.strictEqual(event.output[0], resolve('test/_tmp/output/bundle.js')); } ]); }); it('rebuilds immediately by default', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); await wait(300); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }); let startTime; return sequence( watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); startTime = hrtime(); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); const timeDiff = getTimeDiffInMs(startTime); assert.ok(timeDiff < 400, `Time difference ${timeDiff} < 400`); } ], 0 ); }); it('observes configured build delays', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch( [ { input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }, { input: 'test/_tmp/input/main.js', watch: { clearScreen: true }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }, { input: 'test/_tmp/input/main.js', watch: { buildDelay: 1000 }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } }, { input: 'test/_tmp/input/main.js', watch: { buildDelay: 50 }, output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' } } ], 0 ); let startTime; return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'BUNDLE_START', 'BUNDLE_END', 'BUNDLE_START', 'BUNDLE_END', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); atomicWriteFileSync('test/_tmp/input/main.js', 'export default 43;'); startTime = hrtime(); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'BUNDLE_START', 'BUNDLE_END', 'BUNDLE_START', 'BUNDLE_END', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 43); const timeDiff = getTimeDiffInMs(startTime); assert.ok(timeDiff > 1000, `Time difference ${timeDiff} > 1000`); } ]); }); describe('addWatchFile', () => { it('supports adding additional watch files in plugin hooks', async () => { const watchChangeIds = new Set(); const buildStartFile = resolve('test/_tmp/input/buildStart'); const loadFile = resolve('test/_tmp/input/load'); const resolveIdFile = resolve('test/_tmp/input/resolveId'); const transformFile = resolve('test/_tmp/input/transform'); const watchFiles = [buildStartFile, loadFile, resolveIdFile, transformFile]; await copy('test/watch/samples/basic', 'test/_tmp/input'); await Promise.all(watchFiles.map(file => writeFile(file, 'initial'))); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: { buildStart() { this.addWatchFile(buildStartFile); }, load() { this.addWatchFile(loadFile); }, resolveId() { this.addWatchFile(resolveIdFile); }, transform() { this.addWatchFile(transformFile); }, watchChange(id) { watchChangeIds.add(id); } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); // sometimes the watcher is triggered during the initial run watchChangeIds.clear(); await Promise.all(watchFiles.map(file => writeFile(file, 'changed'))); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); assert.deepStrictEqual([...watchChangeIds].sort(), watchFiles.sort()); } ]); }); it('respects changed watched files in the load hook', async () => { const WATCHED_ID = resolve('test/_tmp/input/watched'); await copy('test/watch/samples/watch-files', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: { load() { this.addWatchFile(WATCHED_ID); return `export default "${readFileSync(WATCHED_ID).toString().trim()}"`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 'initial'); atomicWriteFileSync(WATCHED_ID, 'next'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 'next'); } ]); }); it('respects changed watched files in the transform hook and removes them if they are no longer watched', async () => { const WATCHED_ID = resolve('test/_tmp/input/watched'); let addWatchFile = true; await copy('test/watch/samples/watch-files', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: { resolveId(id) { if (id === 'dep') { return id; } }, load(id) { if (id === 'dep') { return `throw new Error('This should not be executed);`; } }, transform(code, id) { if (id.endsWith('main.js')) { return `export { value as default } from 'dep';`; } else { if (addWatchFile) { this.addWatchFile(WATCHED_ID); } return `export const value = "${readFileSync(WATCHED_ID).toString().trim()}"`; } } } }); const events = []; watcher.on('event', event => events.push(event.code)); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 'initial'); addWatchFile = false; atomicWriteFileSync(WATCHED_ID, 'next'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 'next'); atomicWriteFileSync(WATCHED_ID, 'other'); events.length = 0; await wait(400); assert.deepStrictEqual(events, []); } ]); }); it('respects changed watched modules that are already part of the graph in the transform hook', async () => { await copy('test/watch/samples/dependencies', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: { transform(code, id) { if (id.endsWith('dep1.js')) { this.addWatchFile(resolve('test/_tmp/input/dep2.js')); const text = readFileSync('test/_tmp/input/dep2.js').toString().trim(); return `export default ${JSON.stringify(text)}`; } } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual( run('../_tmp/output/bundle.js'), `dep1: "export default 'dep2';", dep2: "dep2"` ); atomicWriteFileSync('test/_tmp/input/dep2.js', 'export default "next";'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual( run('../_tmp/output/bundle.js'), `dep1: "export default "next";", dep2: "next"` ); } ]); }); it('respects changed watched directories in the transform hook', async () => { const WATCHED_ID = resolve('test/_tmp/input/watched'); await copy('test/watch/samples/watch-files', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: { transform() { this.addWatchFile('test/_tmp/input'); return `export default ${existsSync(WATCHED_ID)}`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), true); unlinkSync(WATCHED_ID); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), false); watcher.close(); } ]); }); it('respects initially missing added watched files', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: { transform() { this.addWatchFile('test/_tmp/input/dep'); return `export default ${existsSync('test/_tmp/input/dep')}`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), false); atomicWriteFileSync('test/_tmp/input/dep', ''); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), true); } ]); }); it('respects unlinked and re-added watched files', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); await writeFile('test/_tmp/input/dep', ''); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: { transform() { this.addWatchFile('test/_tmp/input/dep'); return `export default ${existsSync('test/_tmp/input/dep')}`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), true); unlinkSync('test/_tmp/input/dep'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), false); atomicWriteFileSync('test/_tmp/input/dep', ''); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), true); } ]); }); it('does not rerun the transform hook if a non-watched change triggered the re-run', async () => { const WATCHED_ID = resolve('test/_tmp/input/watched'); let transformRuns = 0; await copy('test/watch/samples/watch-files', 'test/_tmp/input'); await wait(100); await writeFile('test/_tmp/input/alsoWatched', 'initial'); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: { buildStart() { this.addWatchFile('test/_tmp/input/alsoWatched'); }, transform() { transformRuns++; this.addWatchFile(WATCHED_ID); return `export default "${readFileSync(WATCHED_ID).toString().trim()}"`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(transformRuns, 1); atomicWriteFileSync('test/_tmp/input/alsoWatched', 'next'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(transformRuns, 1); } ]); }); }); }); function run(file) { const resolved = require.resolve(file); delete require.cache[resolved]; return require(resolved); } function sequence(watcher, events, timeout = 300) { const handledEvents = []; const sequencePromise = new Promise((fulfil, reject) => { function go(event) { const next = events.shift(); if (!next) { handledEvents.push('DONE'); watcher.close(); fulfil(); } else if (typeof next === 'string') { handledEvents.push(next); const [eventCode, eventMessage] = next.split(':'); watcher.once('event', event => { if (event.code !== eventCode) { watcher.close(); if (event.code === 'ERROR') console.log(event.error); reject(new Error(`Expected ${eventCode} event, got ${event.code}`)); } else if ( eventCode === 'ERROR' && eventMessage && event.error.message !== eventMessage ) { reject( new Error(`Expected to throw "${eventMessage}" but got "${event.error.message}".`) ); } else { go(event); } }); } else { wait(timeout) // gah, this appears to be necessary to fix random errors .then(() => { handledEvents.push(`fn: ${JSON.stringify(event)}`); next(event); go(); }) .catch(error => { watcher.close(); reject(error); }); } } go(); }); return Promise.race([ sequencePromise.then(() => wait(100)), wait(20_000).then(() => { throw new Error(`Test timed out\n${handledEvents.join('\n')}`); }) ]); } function getTimeDiffInMs(previous) { const [seconds, nanoseconds] = hrtime(previous); return seconds * 1e3 + nanoseconds / 1e6; } rollup-3.29.4/test/watch/samples/000077500000000000000000000000001450520414700166615ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/basic/000077500000000000000000000000001450520414700177425ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/basic/main.js000066400000000000000000000000231450520414700212170ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/watch/samples/code-splitting/000077500000000000000000000000001450520414700216065ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/code-splitting/main1.js000066400000000000000000000000651450520414700231520ustar00rootroot00000000000000import {value} from './shared'; export default value;rollup-3.29.4/test/watch/samples/code-splitting/main2.js000066400000000000000000000000711450520414700231500ustar00rootroot00000000000000import {value} from './shared'; export default value * 2;rollup-3.29.4/test/watch/samples/code-splitting/shared.js000066400000000000000000000000301450520414700234030ustar00rootroot00000000000000export const value = 21;rollup-3.29.4/test/watch/samples/dependencies/000077500000000000000000000000001450520414700213075ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/dependencies/dep1.js000066400000000000000000000000271450520414700224750ustar00rootroot00000000000000export default 'dep1'; rollup-3.29.4/test/watch/samples/dependencies/dep2.js000066400000000000000000000000271450520414700224760ustar00rootroot00000000000000export default 'dep2'; rollup-3.29.4/test/watch/samples/dependencies/main.js000066400000000000000000000001571450520414700225740ustar00rootroot00000000000000import dep1 from './dep1.js'; import dep2 from './dep2.js'; export default `dep1: "${dep1}", dep2: "${dep2}"`; rollup-3.29.4/test/watch/samples/dependency/000077500000000000000000000000001450520414700207775ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/dependency/dep.js000066400000000000000000000000311450520414700220770ustar00rootroot00000000000000export const value = 42; rollup-3.29.4/test/watch/samples/dependency/main.js000066400000000000000000000000741450520414700222620ustar00rootroot00000000000000import { value } from './dep.js'; export default value + 1; rollup-3.29.4/test/watch/samples/error/000077500000000000000000000000001450520414700200125ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/error/main.js000066400000000000000000000000251450520414700212710ustar00rootroot00000000000000export default 42; = rollup-3.29.4/test/watch/samples/globals/000077500000000000000000000000001450520414700203045ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/globals/main.js000066400000000000000000000001011450520414700215560ustar00rootroot00000000000000import $ from 'jquery'; $('body').html('

Hello world!

');rollup-3.29.4/test/watch/samples/hashing/000077500000000000000000000000001450520414700203025ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/hashing/main-dynamic.js000066400000000000000000000000431450520414700232030ustar00rootroot00000000000000export default import('./shared'); rollup-3.29.4/test/watch/samples/hashing/main-static.js000066400000000000000000000000651450520414700230520ustar00rootroot00000000000000import {value} from './shared'; export default value;rollup-3.29.4/test/watch/samples/hashing/shared.js000066400000000000000000000000301450520414700220770ustar00rootroot00000000000000export const value = 21;rollup-3.29.4/test/watch/samples/ignored/000077500000000000000000000000001450520414700203105ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/ignored/bar.js000066400000000000000000000000271450520414700214110ustar00rootroot00000000000000export default 'bar-1';rollup-3.29.4/test/watch/samples/ignored/foo.js000066400000000000000000000000271450520414700214300ustar00rootroot00000000000000export default 'foo-1';rollup-3.29.4/test/watch/samples/ignored/main.js000066400000000000000000000001151450520414700215670ustar00rootroot00000000000000import foo from './foo.js'; import bar from './bar.js'; export { foo, bar };rollup-3.29.4/test/watch/samples/multiple/000077500000000000000000000000001450520414700205145ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/multiple/main1.js000066400000000000000000000000231450520414700220520ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/watch/samples/multiple/main2.js000066400000000000000000000000231450520414700220530ustar00rootroot00000000000000export default 43; rollup-3.29.4/test/watch/samples/non-glob/000077500000000000000000000000001450520414700203745ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/non-glob/[foo]/000077500000000000000000000000001450520414700214475ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/non-glob/[foo]/bar.js000066400000000000000000000000261450520414700225470ustar00rootroot00000000000000export const bar = 42;rollup-3.29.4/test/watch/samples/non-glob/main.js000066400000000000000000000000721450520414700216550ustar00rootroot00000000000000import { bar } from './[foo]/bar.js'; export default bar;rollup-3.29.4/test/watch/samples/skip-writes/000077500000000000000000000000001450520414700211425ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/skip-writes/main.js000066400000000000000000000000231450520414700224170ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/watch/samples/virtual/000077500000000000000000000000001450520414700203475ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/virtual/main.js000066400000000000000000000000541450520414700216300ustar00rootroot00000000000000export { value as default } from 'virtual'; rollup-3.29.4/test/watch/samples/watch-files/000077500000000000000000000000001450520414700210675ustar00rootroot00000000000000rollup-3.29.4/test/watch/samples/watch-files/main.js000066400000000000000000000000231450520414700223440ustar00rootroot00000000000000export default 42; rollup-3.29.4/test/watch/samples/watch-files/watched000066400000000000000000000000101450520414700224200ustar00rootroot00000000000000initial rollup-3.29.4/tsconfig.json000066400000000000000000000010421450520414700156340ustar00rootroot00000000000000{ "compilerOptions": { "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, "module": "ESNext", "moduleResolution": "Node", "noEmitOnError": true, "noUnusedParameters": true, "pretty": true, "resolveJsonModule": true, "skipLibCheck": true, "strict": true, "target": "ES2020", "useDefineForClassFields": false }, "include": ["typings/**/*.d.ts", "src", "cli", "browser", "rollup.config.ts"], "exclude": ["dist", "node_modules", "test/typescript", "browser/dist"] } rollup-3.29.4/typings/000077500000000000000000000000001450520414700146255ustar00rootroot00000000000000rollup-3.29.4/typings/declarations.d.ts000066400000000000000000000050271450520414700200730ustar00rootroot00000000000000// internal declare module 'help.md' { const value: string; export default value; } // external libs declare module 'rollup-plugin-string' { import type { PluginImpl } from 'rollup'; export const string: PluginImpl; } declare module 'acorn-import-assertions' { export const importAssertions: () => unknown; } declare module 'is-reference' { import type * as estree from 'estree'; export default function is_reference( node: NodeWithFieldDefinition, parent: NodeWithFieldDefinition ): boolean; export type Node = | estree.ArrayExpression | estree.ArrayPattern | estree.ArrowFunctionExpression | estree.AssignmentExpression | estree.AssignmentPattern | estree.AssignmentProperty | estree.AwaitExpression | estree.BinaryExpression | estree.BlockStatement | estree.BreakStatement | estree.CatchClause | estree.ChainExpression | estree.ClassBody | estree.ClassDeclaration | estree.ClassExpression | estree.ConditionalExpression | estree.ContinueStatement | estree.DebuggerStatement | estree.DoWhileStatement | estree.EmptyStatement | estree.ExportAllDeclaration | estree.ExportDefaultDeclaration | estree.ExportNamedDeclaration | estree.ExportSpecifier | estree.ExpressionStatement | estree.ForInStatement | estree.ForOfStatement | estree.ForStatement | estree.FunctionDeclaration | estree.FunctionExpression | estree.IfStatement | estree.Identifier | estree.ImportDeclaration | estree.ImportDefaultSpecifier | estree.ImportExpression | estree.ImportNamespaceSpecifier | estree.ImportSpecifier | estree.LabeledStatement | estree.LogicalExpression | estree.MemberExpression | estree.MetaProperty | estree.MethodDefinition | estree.NewExpression | estree.ObjectExpression | estree.ObjectPattern | estree.Program | estree.Property | estree.RegExpLiteral | estree.RestElement | estree.ReturnStatement | estree.SequenceExpression | estree.SimpleCallExpression | estree.SimpleLiteral | estree.SpreadElement | estree.Super | estree.SwitchCase | estree.SwitchStatement | estree.TaggedTemplateExpression | estree.TemplateElement | estree.TemplateLiteral | estree.ThisExpression | estree.ThrowStatement | estree.TryStatement | estree.UnaryExpression | estree.UpdateExpression | estree.VariableDeclaration | estree.VariableDeclarator | estree.WhileStatement | estree.WithStatement | estree.YieldExpression; export type NodeWithFieldDefinition = | Node | { computed: boolean; type: 'FieldDefinition'; value: Node; }; } rollup-3.29.4/typings/fsevents.d.ts000066400000000000000000000005051450520414700172540ustar00rootroot00000000000000// 'fsevents' (which also has typings included) is an optional dependency installed on macOS, // and not installed on linux/windows. this will provide (bogus) type information for // linux/windows, and overwrite (replace) the types coming with the 'fsevents' module on macOS declare module 'fsevents' { export default {}; } rollup-3.29.4/typings/hash.js.d.ts000066400000000000000000000002401450520414700167510ustar00rootroot00000000000000declare module 'hash.js/lib/hash/sha/256' { export default function sha256(): { digest: (format: string) => string; update: (data: unknown) => void; }; } rollup-3.29.4/typings/package.json.d.ts000066400000000000000000000000721450520414700177610ustar00rootroot00000000000000declare module 'package.json' { const version: string; }